mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-09-01 15:54:03 +03:00
4612 lines
3.6 MiB
4612 lines
3.6 MiB
import{a as qn,b as dn,c as z4,d as de,e as oe,f as H4,g as nt,h as W4,i as G4,j as q4,k as Q4,l as Ie,m as Ct,n as it,o as vc,p as Le,q as St,r as Ve,s as ve,t as d5,u as m5,v as zC,w as p5,x as sh}from"./chunk-ERB75MEN.js";import{$ as ui,A as t5,B as n5,C as br,D as ns,E as ie,F as Ak,G as ah,H as qr,I as yr,J as i5,K as Zd,L as o5,M as eo,N as pi,O as r5,P as a5,Q as Wo,R as Go,S as s5,T as l5,U as c5,V as ho,W as Qr,X as Jd,Y as Ei,Z as em,_ as qo,a as Mt,aa as u5,b as ht,c as Xe,d as ni,e as RC,f as ts,g as Ti,h as LC,i as rh,j as Me,k as we,l as Cd,m as VC,n as X4,o as K4,p as BC,q as Y4,r as ft,s as Z4,t as J4,u as Vo,v as Pt,w as e5,x as gt,y as Eo,z as Js}from"./chunk-EXPJ4N52.js";import{$ as te,$a as A,$b as JO,$c as h4,$d as Vt,$e as ki,A as No,Aa as Na,Ab as Xt,Ac as r4,Ad as MC,Ae as Pk,B as Ca,Ba as lC,Bb as Kt,Bc as a4,Bd as S4,Be as NC,C as aC,Ca as Zo,Cb as ke,Cc as fC,Ce as N4,D as Wn,Da as qu,Db as Yt,Dc as gC,Dd as kC,De as FC,E as ci,Ea as m,Eb as Ae,Ec as s4,Ee as Ik,F as Qs,Fa as Ja,Fb as ar,Fc as l4,Fe as vd,G as uo,Ga as Ro,Gb as d,Gc as Xu,Gd as th,Ge as F4,H as Mk,Ha as md,Hb as B,Hc as c4,Hd as w4,He as er,I as kk,Ia as Si,Ib as ee,Ic as d4,Id as _d,Ie as R4,J as VO,Ja as at,Jb as mi,Jc as Ks,Jd as Nt,Je as Tp,K as BO,Ka as qO,Kb as dC,Kc as m4,Kd as TC,Ke as L4,L as Fo,La as ro,Lb as mc,Lc as Ku,Ld as je,Le as V4,M as zO,Ma as F,Mb as pc,Mc as p4,Md as M4,Me as lt,N as jO,Na as Gt,Nb as uc,Nc as xr,Nd as EC,Ne as ih,O as yp,Oa as vt,Ob as Hi,Oc as sr,Od as Dt,Oe as _t,P as $O,Pa as Br,Pb as Mp,Pc as _C,Pd as ot,Pe as vn,Q as HO,Qb as fn,Qc as vC,Qd as DC,Qe as B4,R as sC,Ra as di,Rb as Tt,Rc as kp,Rd as Ho,Re as dt,S as $l,Sa as Ce,Sb as un,Sc as CC,Sd as Gn,T as Sp,Ta as Qu,Tb as aa,Tc as xC,Td as fc,Te as j4,Ua as QO,Ub as mC,Uc as bC,Ud as $e,Ue as Zs,V as gi,Va as XO,Vb as pC,Vc as u4,Vd as k4,Ve as $4,W as Vn,Wa as KO,Wb as nn,Wc as Ul,Wd as rt,We as la,X as Ge,Xa as Qt,Xb as $n,Xc as Es,Xd as Uo,Xe as ze,Y as yi,Yb as sa,Yc as es,Yd as Ys,Ye as _c,Z as Mi,Za as I,Zb as ZO,Zc as ud,Zd as T4,Ze as pe,_ as dd,_a as YO,_b as Kd,_c as Yu,_d as E4,_e as G,a as Z,aa as Wt,ab as Ni,ac as Dk,ad as f4,ae as Ft,af as U4,b as Ye,ba as cn,bb as Oe,bc as $t,bd as g4,be as D4,bf as mn,c as rC,ca as ge,cb as K,cc as hc,cd as _i,ce as P4,cf as Ra,d as ws,da as f,db as Y,dc as e4,dd as _4,de as nh,df as oh,e as Ln,ea as UO,eb as C,ec as $g,ee as gc,f as Gs,fa as WO,fb as s,fc as ae,fe as I4,g as Mo,ga as k,gb as l,gc as Rt,gd as hd,ge as PC,h as Rr,ha as T,hb as R,hc as t4,hd as v4,he as Bn,i as We,ia as ti,ib as Co,id as C4,ie as Je,j as tn,ja as Vr,jb as ko,jc as U,jd as fd,je as Et,k as Xd,ka as rr,kb as ks,kc as X,kd as yC,ke as Fa,l as FO,la as Qi,lb as Fe,lc as pd,ld as To,m as qs,ma as Ms,mb as Re,mc as yt,md as x4,me as IC,n as Uu,na as _e,nb as Fi,nc as Lo,o as Wu,oa as Ai,ob as z,od as gd,p as Nn,pa as GO,pb as Jo,pc as uC,pe as AC,q as $o,qa as Q,qb as _,qc as Ji,qd as b4,r as jg,ra as ur,rb as cC,rc as n4,s as RO,sa as Pn,sb as v,sc as i4,sd as Zu,ta as Oi,tb as ai,tc as Xs,td as Ju,u as Bt,ua as Jt,ub as an,uc as Hg,ud as xa,v as Lr,va as Hl,vb as Zi,vc as Gr,vd as y4,w as dc,wa as Gu,wb as In,wc as o4,wd as SC,we as A4,x as wk,xa as Tk,xb as mt,xc as hC,xd as wC,xe as Yd,y as LO,ya as Ek,yb as pt,yc as ne,yd as eh,ye as OC,z as Yi,za as wp,zc as Ts,ze as O4}from"./chunk-TYGV4UPE.js";var lL=ws((unt,Qb)=>{(function(n,o,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"},i={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,se){if(P.addEventListener){P.addEventListener(L,se,!1);return}P.attachEvent("on"+L,se)}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]:i[P.which]?i[P.which]:String.fromCharCode(P.which).toLowerCase()}function g(P,L){return P.sort().join(",")===L.sort().join(",")}function y(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 b(P){if(P.preventDefault){P.preventDefault();return}P.returnValue=!1}function x(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 S(P,L,se){return se||(se=w()[P]?"keydown":"keypress"),se=="keypress"&&L.length&&(se="keydown"),se}function E(P){return P==="+"?["+"]:(P=P.replace(/\+{2}/g,"+plus"),P.split("+"))}function O(P,L){var se,re,W,$=[];for(se=E(P),W=0;W<se.length;++W)re=se[W],a[re]&&(re=a[re]),L&&L!="keypress"&&r[re]&&(re=r[re],$.push("shift")),M(re)&&$.push(re);return L=S(re,$,L),{key:re,modifiers:$,action:L}}function D(P,L){return P===null||P===o?!1:P===L?!0:D(P.parentNode,L)}function N(P){var L=this;if(P=P||o,!(L instanceof N))return new N(P);L.target=P,L._callbacks={},L._directMap={};var se={},re,W=!1,$=!1,ue=!1;function be(ce){ce=ce||{};var De=!1,He;for(He in se){if(ce[He]){De=!0;continue}se[He]=0}De||(ue=!1)}function me(ce,De,He,et,Ze,ye){var q,Ne,Qe=[],ct=He.type;if(!L._callbacks[ce])return[];for(ct=="keyup"&&M(ce)&&(De=[ce]),q=0;q<L._callbacks[ce].length;++q)if(Ne=L._callbacks[ce][q],!(!et&&Ne.seq&&se[Ne.seq]!=Ne.level)&&ct==Ne.action&&(ct=="keypress"&&!He.metaKey&&!He.ctrlKey||g(De,Ne.modifiers))){var At=!et&&Ne.combo==Ze,Yn=et&&Ne.seq==et&&Ne.level==ye;(At||Yn)&&L._callbacks[ce].splice(q,1),Qe.push(Ne)}return Qe}function Pe(ce,De,He,et){L.stopCallback(De,De.target||De.srcElement,He,et)||ce(De,He)===!1&&(b(De),x(De))}L._handleKey=function(ce,De,He){var et=me(ce,De,He),Ze,ye={},q=0,Ne=!1;for(Ze=0;Ze<et.length;++Ze)et[Ze].seq&&(q=Math.max(q,et[Ze].level));for(Ze=0;Ze<et.length;++Ze){if(et[Ze].seq){if(et[Ze].level!=q)continue;Ne=!0,ye[et[Ze].seq]=1,Pe(et[Ze].callback,He,et[Ze].combo,et[Ze].seq);continue}Ne||Pe(et[Ze].callback,He,et[Ze].combo)}var Qe=He.type=="keypress"&&$;He.type==ue&&!M(ce)&&!Qe&&be(ye),$=Ne&&He.type=="keydown"};function he(ce){typeof ce.which!="number"&&(ce.which=ce.keyCode);var De=h(ce);if(De){if(ce.type=="keyup"&&W===De){W=!1;return}L.handleKey(De,y(ce),ce)}}function j(){clearTimeout(re),re=setTimeout(be,1e3)}function J(ce,De,He,et){se[ce]=0;function Ze(ct){return function(){ue=ct,++se[ce],j()}}function ye(ct){Pe(He,ct,ce),et!=="keyup"&&(W=h(ct)),setTimeout(be,10)}for(var q=0;q<De.length;++q){var Ne=q+1===De.length,Qe=Ne?ye:Ze(et||O(De[q+1]).action);le(De[q],Qe,et,ce,q)}}function le(ce,De,He,et,Ze){L._directMap[ce+":"+He]=De,ce=ce.replace(/\s+/g," ");var ye=ce.split(" "),q;if(ye.length>1){J(ce,ye,De,He);return}q=O(ce,He),L._callbacks[q.key]=L._callbacks[q.key]||[],me(q.key,q.modifiers,{type:q.action},et,ce,Ze),L._callbacks[q.key][et?"unshift":"push"]({callback:De,modifiers:q.modifiers,action:q.action,seq:et,level:Ze,combo:ce})}L._bindMultiple=function(ce,De,He){for(var et=0;et<ce.length;++et)le(ce[et],De,He)},u(P,"keypress",he),u(P,"keydown",he),u(P,"keyup",he)}N.prototype.bind=function(P,L,se){var re=this;return P=P instanceof Array?P:[P],re._bindMultiple.call(re,P,L,se),re},N.prototype.unbind=function(P,L){var se=this;return se.bind.call(se,P,function(){},L)},N.prototype.trigger=function(P,L){var se=this;return se._directMap[P+":"+L]&&se._directMap[P+":"+L]({},P),se},N.prototype.reset=function(){var P=this;return P._callbacks={},P._directMap={},P},N.prototype.stopCallback=function(P,L){var se=this;if((" "+L.className+" ").indexOf(" mousetrap ")>-1||D(L,se.target))return!1;if("composedPath"in P&&typeof P.composedPath=="function"){var re=P.composedPath()[0];re!==P.target&&(L=re)}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(o);for(var L in P)L.charAt(0)!=="_"&&(N[L]=(function(se){return function(){return P[se].apply(P,arguments)}})(L))},N.init(),n.Mousetrap=N,typeof Qb<"u"&&Qb.exports&&(Qb.exports=N),typeof define=="function"&&define.amd&&define(function(){return N})})(typeof window<"u"?window:null,typeof window<"u"?document:null)});var g7=ws(HP=>{var f7="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");HP.encode=function(n){if(0<=n&&n<f7.length)return f7[n];throw new TypeError("Must be between 0 and 63: "+n)};HP.decode=function(n){var o=65,e=90,t=97,i=122,r=48,a=57,c=43,p=47,u=26,h=52;return o<=n&&n<=e?n-o:t<=n&&n<=i?n-t+u:r<=n&&n<=a?n-r+h:n==c?62:n==p?63:-1}});var b7=ws(WP=>{var _7=g7(),UP=5,v7=1<<UP,C7=v7-1,x7=v7;function dde(n){return n<0?(-n<<1)+1:(n<<1)+0}function mde(n){var o=(n&1)===1,e=n>>1;return o?-e:e}WP.encode=function(o){var e="",t,i=dde(o);do t=i&C7,i>>>=UP,i>0&&(t|=x7),e+=_7.encode(t);while(i>0);return e};WP.decode=function(o,e,t){var i=o.length,r=0,a=0,c,p;do{if(e>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(p=_7.decode(o.charCodeAt(e++)),p===-1)throw new Error("Invalid base64 digit: "+o.charAt(e-1));c=!!(p&x7),p&=C7,r=r+(p<<a),a+=UP}while(c);t.value=mde(r),t.rest=e}});var gy=ws(oa=>{function pde(n,o,e){if(o in n)return n[o];if(arguments.length===3)return e;throw new Error('"'+o+'" is a required argument.')}oa.getArg=pde;var y7=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,ude=/^data:.+\,.+$/;function tv(n){var o=n.match(y7);return o?{scheme:o[1],auth:o[2],host:o[3],port:o[4],path:o[5]}:null}oa.urlParse=tv;function Cf(n){var o="";return n.scheme&&(o+=n.scheme+":"),o+="//",n.auth&&(o+=n.auth+"@"),n.host&&(o+=n.host),n.port&&(o+=":"+n.port),n.path&&(o+=n.path),o}oa.urlGenerate=Cf;var hde=32;function fde(n){var o=[];return function(e){for(var t=0;t<o.length;t++)if(o[t].input===e){var i=o[0];return o[0]=o[t],o[t]=i,o[0].result}var r=n(e);return o.unshift({input:e,result:r}),o.length>hde&&o.pop(),r}}var GP=fde(function(o){var e=o,t=tv(o);if(t){if(!t.path)return o;e=t.path}for(var i=oa.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=i?"/":"."),t?(t.path=e,Cf(t)):e});oa.normalize=GP;function S7(n,o){n===""&&(n="."),o===""&&(o=".");var e=tv(o),t=tv(n);if(t&&(n=t.path||"/"),e&&!e.scheme)return t&&(e.scheme=t.scheme),Cf(e);if(e||o.match(ude))return o;if(t&&!t.host&&!t.path)return t.host=o,Cf(t);var i=o.charAt(0)==="/"?o:GP(n.replace(/\/+$/,"")+"/"+o);return t?(t.path=i,Cf(t)):i}oa.join=S7;oa.isAbsolute=function(n){return n.charAt(0)==="/"||y7.test(n)};function gde(n,o){n===""&&(n="."),n=n.replace(/\/$/,"");for(var e=0;o.indexOf(n+"/")!==0;){var t=n.lastIndexOf("/");if(t<0||(n=n.slice(0,t),n.match(/^([^\/]+:\/)?\/*$/)))return o;++e}return Array(e+1).join("../")+o.substr(n.length+1)}oa.relative=gde;var w7=(function(){var n=Object.create(null);return!("__proto__"in n)})();function M7(n){return n}function _de(n){return k7(n)?"$"+n:n}oa.toSetString=w7?M7:_de;function vde(n){return k7(n)?n.slice(1):n}oa.fromSetString=w7?M7:vde;function k7(n){if(!n)return!1;var o=n.length;if(o<9||n.charCodeAt(o-1)!==95||n.charCodeAt(o-2)!==95||n.charCodeAt(o-3)!==111||n.charCodeAt(o-4)!==116||n.charCodeAt(o-5)!==111||n.charCodeAt(o-6)!==114||n.charCodeAt(o-7)!==112||n.charCodeAt(o-8)!==95||n.charCodeAt(o-9)!==95)return!1;for(var e=o-10;e>=0;e--)if(n.charCodeAt(e)!==36)return!1;return!0}function Cde(n,o,e){var t=Bd(n.source,o.source);return t!==0||(t=n.originalLine-o.originalLine,t!==0)||(t=n.originalColumn-o.originalColumn,t!==0||e)||(t=n.generatedColumn-o.generatedColumn,t!==0)||(t=n.generatedLine-o.generatedLine,t!==0)?t:Bd(n.name,o.name)}oa.compareByOriginalPositions=Cde;function xde(n,o,e){var t;return t=n.originalLine-o.originalLine,t!==0||(t=n.originalColumn-o.originalColumn,t!==0||e)||(t=n.generatedColumn-o.generatedColumn,t!==0)||(t=n.generatedLine-o.generatedLine,t!==0)?t:Bd(n.name,o.name)}oa.compareByOriginalPositionsNoSource=xde;function bde(n,o,e){var t=n.generatedLine-o.generatedLine;return t!==0||(t=n.generatedColumn-o.generatedColumn,t!==0||e)||(t=Bd(n.source,o.source),t!==0)||(t=n.originalLine-o.originalLine,t!==0)||(t=n.originalColumn-o.originalColumn,t!==0)?t:Bd(n.name,o.name)}oa.compareByGeneratedPositionsDeflated=bde;function yde(n,o,e){var t=n.generatedColumn-o.generatedColumn;return t!==0||e||(t=Bd(n.source,o.source),t!==0)||(t=n.originalLine-o.originalLine,t!==0)||(t=n.originalColumn-o.originalColumn,t!==0)?t:Bd(n.name,o.name)}oa.compareByGeneratedPositionsDeflatedNoLine=yde;function Bd(n,o){return n===o?0:n===null?1:o===null?-1:n>o?1:-1}function Sde(n,o){var e=n.generatedLine-o.generatedLine;return e!==0||(e=n.generatedColumn-o.generatedColumn,e!==0)||(e=Bd(n.source,o.source),e!==0)||(e=n.originalLine-o.originalLine,e!==0)||(e=n.originalColumn-o.originalColumn,e!==0)?e:Bd(n.name,o.name)}oa.compareByGeneratedPositionsInflated=Sde;function wde(n){return JSON.parse(n.replace(/^\)]}'[^\n]*\n/,""))}oa.parseSourceMapInput=wde;function Mde(n,o,e){if(o=o||"",n&&(n[n.length-1]!=="/"&&o[0]!=="/"&&(n+="/"),o=n+o),e){var t=tv(e);if(!t)throw new Error("sourceMapURL could not be parsed");if(t.path){var i=t.path.lastIndexOf("/");i>=0&&(t.path=t.path.substring(0,i+1))}o=S7(Cf(t),o)}return GP(o)}oa.computeSourceURL=Mde});var E7=ws(T7=>{var qP=gy(),QP=Object.prototype.hasOwnProperty,Su=typeof Map<"u";function zd(){this._array=[],this._set=Su?new Map:Object.create(null)}zd.fromArray=function(o,e){for(var t=new zd,i=0,r=o.length;i<r;i++)t.add(o[i],e);return t};zd.prototype.size=function(){return Su?this._set.size:Object.getOwnPropertyNames(this._set).length};zd.prototype.add=function(o,e){var t=Su?o:qP.toSetString(o),i=Su?this.has(o):QP.call(this._set,t),r=this._array.length;(!i||e)&&this._array.push(o),i||(Su?this._set.set(o,r):this._set[t]=r)};zd.prototype.has=function(o){if(Su)return this._set.has(o);var e=qP.toSetString(o);return QP.call(this._set,e)};zd.prototype.indexOf=function(o){if(Su){var e=this._set.get(o);if(e>=0)return e}else{var t=qP.toSetString(o);if(QP.call(this._set,t))return this._set[t]}throw new Error('"'+o+'" is not in the set.')};zd.prototype.at=function(o){if(o>=0&&o<this._array.length)return this._array[o];throw new Error("No element indexed by "+o)};zd.prototype.toArray=function(){return this._array.slice()};T7.ArraySet=zd});var I7=ws(P7=>{var D7=gy();function kde(n,o){var e=n.generatedLine,t=o.generatedLine,i=n.generatedColumn,r=o.generatedColumn;return t>e||t==e&&r>=i||D7.compareByGeneratedPositionsInflated(n,o)<=0}function _y(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}_y.prototype.unsortedForEach=function(o,e){this._array.forEach(o,e)};_y.prototype.add=function(o){kde(this._last,o)?(this._last=o,this._array.push(o)):(this._sorted=!1,this._array.push(o))};_y.prototype.toArray=function(){return this._sorted||(this._array.sort(D7.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};P7.MappingList=_y});var O7=ws(A7=>{var nv=b7(),vr=gy(),vy=E7().ArraySet,Tde=I7().MappingList;function El(n){n||(n={}),this._file=vr.getArg(n,"file",null),this._sourceRoot=vr.getArg(n,"sourceRoot",null),this._skipValidation=vr.getArg(n,"skipValidation",!1),this._ignoreInvalidMapping=vr.getArg(n,"ignoreInvalidMapping",!1),this._sources=new vy,this._names=new vy,this._mappings=new Tde,this._sourcesContents=null}El.prototype._version=3;El.fromSourceMap=function(o,e){var t=o.sourceRoot,i=new El(Object.assign(e||{},{file:o.file,sourceRoot:t}));return o.eachMapping(function(r){var a={generated:{line:r.generatedLine,column:r.generatedColumn}};r.source!=null&&(a.source=r.source,t!=null&&(a.source=vr.relative(t,a.source)),a.original={line:r.originalLine,column:r.originalColumn},r.name!=null&&(a.name=r.name)),i.addMapping(a)}),o.sources.forEach(function(r){var a=r;t!==null&&(a=vr.relative(t,r)),i._sources.has(a)||i._sources.add(a);var c=o.sourceContentFor(r);c!=null&&i.setSourceContent(r,c)}),i};El.prototype.addMapping=function(o){var e=vr.getArg(o,"generated"),t=vr.getArg(o,"original",null),i=vr.getArg(o,"source",null),r=vr.getArg(o,"name",null);!this._skipValidation&&this._validateMapping(e,t,i,r)===!1||(i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),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:i,name:r}))};El.prototype.setSourceContent=function(o,e){var t=o;this._sourceRoot!=null&&(t=vr.relative(this._sourceRoot,t)),e!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[vr.toSetString(t)]=e):this._sourcesContents&&(delete this._sourcesContents[vr.toSetString(t)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};El.prototype.applySourceMap=function(o,e,t){var i=e;if(e==null){if(o.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=o.file}var r=this._sourceRoot;r!=null&&(i=vr.relative(r,i));var a=new vy,c=new vy;this._mappings.unsortedForEach(function(p){if(p.source===i&&p.originalLine!=null){var u=o.originalPositionFor({line:p.originalLine,column:p.originalColumn});u.source!=null&&(p.source=u.source,t!=null&&(p.source=vr.join(t,p.source)),r!=null&&(p.source=vr.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 g=p.name;g!=null&&!c.has(g)&&c.add(g)},this),this._sources=a,this._names=c,o.sources.forEach(function(p){var u=o.sourceContentFor(p);u!=null&&(t!=null&&(p=vr.join(t,p)),r!=null&&(p=vr.relative(r,p)),this.setSourceContent(p,u))},this)};El.prototype._validateMapping=function(o,e,t,i){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(!(o&&"line"in o&&"column"in o&&o.line>0&&o.column>=0&&!e&&!t&&!i)){if(o&&"line"in o&&"column"in o&&e&&"line"in e&&"column"in e&&o.line>0&&o.column>=0&&e.line>0&&e.column>=0&&t)return;var r="Invalid mapping: "+JSON.stringify({generated:o,source:t,original:e,name:i});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(r),!1;throw new Error(r)}};El.prototype._serializeMappings=function(){for(var o=0,e=1,t=0,i=0,r=0,a=0,c="",p,u,h,g,y=this._mappings.toArray(),b=0,x=y.length;b<x;b++){if(u=y[b],p="",u.generatedLine!==e)for(o=0;u.generatedLine!==e;)p+=";",e++;else if(b>0){if(!vr.compareByGeneratedPositionsInflated(u,y[b-1]))continue;p+=","}p+=nv.encode(u.generatedColumn-o),o=u.generatedColumn,u.source!=null&&(g=this._sources.indexOf(u.source),p+=nv.encode(g-a),a=g,p+=nv.encode(u.originalLine-1-i),i=u.originalLine-1,p+=nv.encode(u.originalColumn-t),t=u.originalColumn,u.name!=null&&(h=this._names.indexOf(u.name),p+=nv.encode(h-r),r=h)),c+=p}return c};El.prototype._generateSourcesContent=function(o,e){return o.map(function(t){if(!this._sourcesContents)return null;e!=null&&(t=vr.relative(e,t));var i=vr.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};El.prototype.toJSON=function(){var o={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(o.file=this._file),this._sourceRoot!=null&&(o.sourceRoot=this._sourceRoot),this._sourcesContents&&(o.sourcesContent=this._generateSourcesContent(o.sources,o.sourceRoot)),o};El.prototype.toString=function(){return JSON.stringify(this.toJSON())};A7.SourceMapGenerator=El});var mO=ws((A9,Uw)=>{(function(n){"use strict";let o="(0?\\d+|0x[a-f0-9]+)",e={fourOctet:new RegExp(`^${o}\\.${o}\\.${o}\\.${o}$`,"i"),threeOctet:new RegExp(`^${o}\\.${o}\\.${o}$`,"i"),twoOctet:new RegExp(`^${o}\\.${o}$`,"i"),longValue:new RegExp(`^${o}$`,"i")},t=new RegExp("^0[0-7]+$","i"),i=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(`^(?:::)(${o}\\.${o}\\.${o}\\.${o}(${r})?)$`,"i"),transitional:new RegExp(`^((?:${a})|(?:::)(?:${a})?)${o}\\.${o}\\.${o}\\.${o}(${r})?$`,"i")};function p(b,x){if(b.indexOf("::")!==b.lastIndexOf("::"))return null;let M=0,w=-1,S=(b.match(c.zoneIndex)||[])[0],E,O;for(S&&(S=S.substring(1),b=b.replace(/%.+$/,""));(w=b.indexOf(":",w+1))>=0;)M++;if(b.substr(0,2)==="::"&&M--,b.substr(-2,2)==="::"&&M--,M>x)return null;for(O=x-M,E=":";O--;)E+="0:";return b=b.replace("::",E),b[0]===":"&&(b=b.slice(1)),b[b.length-1]===":"&&(b=b.slice(0,-1)),x=(function(){let D=b.split(":"),N=[];for(let P=0;P<D.length;P++)N.push(parseInt(D[P],16));return N})(),{parts:x,zoneId:S}}function u(b,x,M,w){if(b.length!==x.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let S=0,E;for(;w>0;){if(E=M-w,E<0&&(E=0),b[S]>>E!==x[S]>>E)return!1;w-=M,S+=1}return!0}function h(b){if(i.test(b))return parseInt(b,16);if(b[0]==="0"&&!isNaN(parseInt(b[1],10))){if(t.test(b))return parseInt(b,8);throw new Error(`ipaddr: cannot parse ${b} as octal`)}return parseInt(b,10)}function g(b,x){for(;b.length<x;)b=`0${b}`;return b}let y={};y.IPv4=(function(){function b(x){if(x.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let M,w;for(M=0;M<x.length;M++)if(w=x[M],!(0<=w&&w<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=x}return b.prototype.SpecialRanges={unspecified:[[new b([0,0,0,0]),8]],broadcast:[[new b([255,255,255,255]),32]],multicast:[[new b([224,0,0,0]),4]],linkLocal:[[new b([169,254,0,0]),16]],loopback:[[new b([127,0,0,0]),8]],carrierGradeNat:[[new b([100,64,0,0]),10]],private:[[new b([10,0,0,0]),8],[new b([172,16,0,0]),12],[new b([192,168,0,0]),16]],reserved:[[new b([192,0,0,0]),24],[new b([192,0,2,0]),24],[new b([192,88,99,0]),24],[new b([198,18,0,0]),15],[new b([198,51,100,0]),24],[new b([203,0,113,0]),24],[new b([240,0,0,0]),4]],as112:[[new b([192,175,48,0]),24],[new b([192,31,196,0]),24]],amt:[[new b([192,52,193,0]),24]]},b.prototype.kind=function(){return"ipv4"},b.prototype.match=function(x,M){let w;if(M===void 0&&(w=x,x=w[0],M=w[1]),x.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return u(this.octets,x.octets,8,M)},b.prototype.prefixLengthFromSubnetMask=function(){let x=0,M=!1,w={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},S,E,O;for(S=3;S>=0;S-=1)if(E=this.octets[S],E in w){if(O=w[E],M&&O!==0)return null;O!==8&&(M=!0),x+=O}else return null;return 32-x},b.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},b.prototype.toByteArray=function(){return this.octets.slice(0)},b.prototype.toIPv4MappedAddress=function(){return y.IPv6.parse(`::ffff:${this.toString()}`)},b.prototype.toNormalizedString=function(){return this.toString()},b.prototype.toString=function(){return this.octets.join(".")},b})(),y.IPv4.broadcastAddressFromCIDR=function(b){try{let x=this.parseCIDR(b),M=x[0].toByteArray(),w=this.subnetMaskFromPrefixLength(x[1]).toByteArray(),S=[],E=0;for(;E<4;)S.push(parseInt(M[E],10)|parseInt(w[E],10)^255),E++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.isIPv4=function(b){return this.parser(b)!==null},y.IPv4.isValid=function(b){try{return new this(this.parser(b)),!0}catch{return!1}},y.IPv4.isValidCIDR=function(b){try{return this.parseCIDR(b),!0}catch{return!1}},y.IPv4.isValidFourPartDecimal=function(b){return!!(y.IPv4.isValid(b)&&b.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},y.IPv4.isValidCIDRFourPartDecimal=function(b){let x=b.match(/^(.+)\/(\d+)$/);return!y.IPv4.isValidCIDR(b)||!x?!1:y.IPv4.isValidFourPartDecimal(x[1])},y.IPv4.networkAddressFromCIDR=function(b){let x,M,w,S,E;try{for(x=this.parseCIDR(b),w=x[0].toByteArray(),E=this.subnetMaskFromPrefixLength(x[1]).toByteArray(),S=[],M=0;M<4;)S.push(parseInt(w[M],10)&parseInt(E[M],10)),M++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.parse=function(b){let x=this.parser(b);if(x===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(x)},y.IPv4.parseCIDR=function(b){let x;if(x=b.match(/^(.+)\/(\d+)$/)){let M=parseInt(x[2]);if(M>=0&&M<=32){let w=[this.parse(x[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")},y.IPv4.parser=function(b){let x,M,w;if(x=b.match(e.fourOctet))return(function(){let S=x.slice(1,6),E=[];for(let O=0;O<S.length;O++)M=S[O],E.push(h(M));return E})();if(x=b.match(e.longValue)){if(w=h(x[1]),w>4294967295||w<0)throw new Error("ipaddr: address outside defined range");return(function(){let S=[],E;for(E=0;E<=24;E+=8)S.push(w>>E&255);return S})().reverse()}else return(x=b.match(e.twoOctet))?(function(){let S=x.slice(1,4),E=[];if(w=h(S[1]),w>16777215||w<0)throw new Error("ipaddr: address outside defined range");return E.push(h(S[0])),E.push(w>>16&255),E.push(w>>8&255),E.push(w&255),E})():(x=b.match(e.threeOctet))?(function(){let S=x.slice(1,5),E=[];if(w=h(S[2]),w>65535||w<0)throw new Error("ipaddr: address outside defined range");return E.push(h(S[0])),E.push(h(S[1])),E.push(w>>8&255),E.push(w&255),E})():null},y.IPv4.subnetMaskFromPrefixLength=function(b){if(b=parseInt(b),b<0||b>32)throw new Error("ipaddr: invalid IPv4 prefix length");let x=[0,0,0,0],M=0,w=Math.floor(b/8);for(;M<w;)x[M]=255,M++;return w<4&&(x[w]=Math.pow(2,b%8)-1<<8-b%8),new this(x)},y.IPv6=(function(){function b(x,M){let w,S;if(x.length===16)for(this.parts=[],w=0;w<=14;w+=2)this.parts.push(x[w]<<8|x[w+1]);else if(x.length===8)this.parts=x;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(w=0;w<this.parts.length;w++)if(S=this.parts[w],!(0<=S&&S<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");M&&(this.zoneId=M)}return b.prototype.SpecialRanges={unspecified:[new b([0,0,0,0,0,0,0,0]),128],linkLocal:[new b([65152,0,0,0,0,0,0,0]),10],multicast:[new b([65280,0,0,0,0,0,0,0]),8],loopback:[new b([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new b([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new b([0,0,0,0,0,65535,0,0]),96],discard:[new b([256,0,0,0,0,0,0,0]),64],rfc6145:[new b([0,0,0,0,65535,0,0,0]),96],rfc6052:[new b([100,65435,0,0,0,0,0,0]),96],"6to4":[new b([8194,0,0,0,0,0,0,0]),16],teredo:[new b([8193,0,0,0,0,0,0,0]),32],benchmarking:[new b([8193,2,0,0,0,0,0,0]),48],amt:[new b([8193,3,0,0,0,0,0,0]),32],as112v6:[[new b([8193,4,274,0,0,0,0,0]),48],[new b([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new b([8193,16,0,0,0,0,0,0]),28],orchid2:[new b([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new b([8193,48,0,0,0,0,0,0]),28],reserved:[[new b([8193,0,0,0,0,0,0,0]),23],[new b([8193,3512,0,0,0,0,0,0]),32]]},b.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},b.prototype.kind=function(){return"ipv6"},b.prototype.match=function(x,M){let w;if(M===void 0&&(w=x,x=w[0],M=w[1]),x.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return u(this.parts,x.parts,16,M)},b.prototype.prefixLengthFromSubnetMask=function(){let x=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},S,E;for(let O=7;O>=0;O-=1)if(S=this.parts[O],S in w){if(E=w[S],M&&E!==0)return null;E!==16&&(M=!0),x+=E}else return null;return 128-x},b.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},b.prototype.toByteArray=function(){let x,M=[],w=this.parts;for(let S=0;S<w.length;S++)x=w[S],M.push(x>>8),M.push(x&255);return M},b.prototype.toFixedLengthString=function(){let x=function(){let w=[];for(let S=0;S<this.parts.length;S++)w.push(g(this.parts[S].toString(16),4));return w}.call(this).join(":"),M="";return this.zoneId&&(M=`%${this.zoneId}`),x+M},b.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let x=this.parts.slice(-2),M=x[0],w=x[1];return new y.IPv4([M>>8,M&255,w>>8,w&255])},b.prototype.toNormalizedString=function(){let x=function(){let w=[];for(let S=0;S<this.parts.length;S++)w.push(this.parts[S].toString(16));return w}.call(this).join(":"),M="";return this.zoneId&&(M=`%${this.zoneId}`),x+M},b.prototype.toRFC5952String=function(){let x=/((^|:)(0(:|$)){2,})/g,M=this.toNormalizedString(),w=0,S=-1,E;for(;E=x.exec(M);)E[0].length>S&&(w=E.index,S=E[0].length);return S<0?M:`${M.substring(0,w)}::${M.substring(w+S)}`},b.prototype.toString=function(){return this.toRFC5952String()},b})(),y.IPv6.broadcastAddressFromCIDR=function(b){try{let x=this.parseCIDR(b),M=x[0].toByteArray(),w=this.subnetMaskFromPrefixLength(x[1]).toByteArray(),S=[],E=0;for(;E<16;)S.push(parseInt(M[E],10)|parseInt(w[E],10)^255),E++;return new this(S)}catch(x){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${x})`)}},y.IPv6.isIPv6=function(b){return this.parser(b)!==null},y.IPv6.isValid=function(b){if(typeof b=="string"&&b.indexOf(":")===-1)return!1;try{let x=this.parser(b);return new this(x.parts,x.zoneId),!0}catch{return!1}},y.IPv6.isValidCIDR=function(b){if(typeof b=="string"&&b.indexOf(":")===-1)return!1;try{return this.parseCIDR(b),!0}catch{return!1}},y.IPv6.networkAddressFromCIDR=function(b){let x,M,w,S,E;try{for(x=this.parseCIDR(b),w=x[0].toByteArray(),E=this.subnetMaskFromPrefixLength(x[1]).toByteArray(),S=[],M=0;M<16;)S.push(parseInt(w[M],10)&parseInt(E[M],10)),M++;return new this(S)}catch(O){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${O})`)}},y.IPv6.parse=function(b){let x=this.parser(b);if(x.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(x.parts,x.zoneId)},y.IPv6.parseCIDR=function(b){let x,M,w;if((M=b.match(/^(.+)\/(\d+)$/))&&(x=parseInt(M[2]),x>=0&&x<=128))return w=[this.parse(M[1]),x],Object.defineProperty(w,"toString",{value:function(){return this.join("/")}}),w;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},y.IPv6.parser=function(b){let x,M,w,S,E,O;if(w=b.match(c.deprecatedTransitional))return this.parser(`::ffff:${w[1]}`);if(c.native.test(b))return p(b,8);if((w=b.match(c.transitional))&&(O=w[6]||"",x=w[1],w[1].endsWith("::")||(x=x.slice(0,-1)),x=p(x+O,6),x.parts)){for(E=[parseInt(w[2]),parseInt(w[3]),parseInt(w[4]),parseInt(w[5])],M=0;M<E.length;M++)if(S=E[M],!(0<=S&&S<=255))return null;return x.parts.push(E[0]<<8|E[1]),x.parts.push(E[2]<<8|E[3]),{parts:x.parts,zoneId:x.zoneId}}return null},y.IPv6.subnetMaskFromPrefixLength=function(b){if(b=parseInt(b),b<0||b>128)throw new Error("ipaddr: invalid IPv6 prefix length");let x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],M=0,w=Math.floor(b/8);for(;M<w;)x[M]=255,M++;return w<16&&(x[w]=Math.pow(2,b%8)-1<<8-b%8),new this(x)},y.fromByteArray=function(b){let x=b.length;if(x===4)return new y.IPv4(b);if(x===16)return new y.IPv6(b);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},y.isValid=function(b){return y.IPv6.isValid(b)||y.IPv4.isValid(b)},y.isValidCIDR=function(b){return y.IPv6.isValidCIDR(b)||y.IPv4.isValidCIDR(b)},y.parse=function(b){if(y.IPv6.isValid(b))return y.IPv6.parse(b);if(y.IPv4.isValid(b))return y.IPv4.parse(b);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},y.parseCIDR=function(b){try{return y.IPv6.parseCIDR(b)}catch{try{return y.IPv4.parseCIDR(b)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},y.process=function(b){let x=this.parse(b);return x.kind()==="ipv6"&&x.isIPv4MappedAddress()?x.toIPv4Address():x},y.subnetMatch=function(b,x,M){let w,S,E,O;M==null&&(M="unicast");for(S in x)if(Object.prototype.hasOwnProperty.call(x,S)){for(E=x[S],E[0]&&!(E[0]instanceof Array)&&(E=[E]),w=0;w<E.length;w++)if(O=E[w],b.kind()===O[0].kind()&&b.match.apply(b,O))return S}return M},typeof Uw<"u"&&Uw.exports?Uw.exports=y:n.ipaddr=y})(A9)});var j9=ws((B9,z9)=>{(function(n){if(typeof B9=="object")z9.exports=n();else if(typeof define=="function"&&define.amd)define(n);else{var o;try{o=window}catch{o=self}o.SparkMD5=n()}})(function(n){"use strict";var o=function(S,E){return S+E&4294967295},e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function t(S,E,O,D,N,P){return E=o(o(E,S),o(D,P)),o(E<<N|E>>>32-N,O)}function i(S,E){var O=S[0],D=S[1],N=S[2],P=S[3];O+=(D&N|~D&P)+E[0]-680876936|0,O=(O<<7|O>>>25)+D|0,P+=(O&D|~O&N)+E[1]-389564586|0,P=(P<<12|P>>>20)+O|0,N+=(P&O|~P&D)+E[2]+606105819|0,N=(N<<17|N>>>15)+P|0,D+=(N&P|~N&O)+E[3]-1044525330|0,D=(D<<22|D>>>10)+N|0,O+=(D&N|~D&P)+E[4]-176418897|0,O=(O<<7|O>>>25)+D|0,P+=(O&D|~O&N)+E[5]+1200080426|0,P=(P<<12|P>>>20)+O|0,N+=(P&O|~P&D)+E[6]-1473231341|0,N=(N<<17|N>>>15)+P|0,D+=(N&P|~N&O)+E[7]-45705983|0,D=(D<<22|D>>>10)+N|0,O+=(D&N|~D&P)+E[8]+1770035416|0,O=(O<<7|O>>>25)+D|0,P+=(O&D|~O&N)+E[9]-1958414417|0,P=(P<<12|P>>>20)+O|0,N+=(P&O|~P&D)+E[10]-42063|0,N=(N<<17|N>>>15)+P|0,D+=(N&P|~N&O)+E[11]-1990404162|0,D=(D<<22|D>>>10)+N|0,O+=(D&N|~D&P)+E[12]+1804603682|0,O=(O<<7|O>>>25)+D|0,P+=(O&D|~O&N)+E[13]-40341101|0,P=(P<<12|P>>>20)+O|0,N+=(P&O|~P&D)+E[14]-1502002290|0,N=(N<<17|N>>>15)+P|0,D+=(N&P|~N&O)+E[15]+1236535329|0,D=(D<<22|D>>>10)+N|0,O+=(D&P|N&~P)+E[1]-165796510|0,O=(O<<5|O>>>27)+D|0,P+=(O&N|D&~N)+E[6]-1069501632|0,P=(P<<9|P>>>23)+O|0,N+=(P&D|O&~D)+E[11]+643717713|0,N=(N<<14|N>>>18)+P|0,D+=(N&O|P&~O)+E[0]-373897302|0,D=(D<<20|D>>>12)+N|0,O+=(D&P|N&~P)+E[5]-701558691|0,O=(O<<5|O>>>27)+D|0,P+=(O&N|D&~N)+E[10]+38016083|0,P=(P<<9|P>>>23)+O|0,N+=(P&D|O&~D)+E[15]-660478335|0,N=(N<<14|N>>>18)+P|0,D+=(N&O|P&~O)+E[4]-405537848|0,D=(D<<20|D>>>12)+N|0,O+=(D&P|N&~P)+E[9]+568446438|0,O=(O<<5|O>>>27)+D|0,P+=(O&N|D&~N)+E[14]-1019803690|0,P=(P<<9|P>>>23)+O|0,N+=(P&D|O&~D)+E[3]-187363961|0,N=(N<<14|N>>>18)+P|0,D+=(N&O|P&~O)+E[8]+1163531501|0,D=(D<<20|D>>>12)+N|0,O+=(D&P|N&~P)+E[13]-1444681467|0,O=(O<<5|O>>>27)+D|0,P+=(O&N|D&~N)+E[2]-51403784|0,P=(P<<9|P>>>23)+O|0,N+=(P&D|O&~D)+E[7]+1735328473|0,N=(N<<14|N>>>18)+P|0,D+=(N&O|P&~O)+E[12]-1926607734|0,D=(D<<20|D>>>12)+N|0,O+=(D^N^P)+E[5]-378558|0,O=(O<<4|O>>>28)+D|0,P+=(O^D^N)+E[8]-2022574463|0,P=(P<<11|P>>>21)+O|0,N+=(P^O^D)+E[11]+1839030562|0,N=(N<<16|N>>>16)+P|0,D+=(N^P^O)+E[14]-35309556|0,D=(D<<23|D>>>9)+N|0,O+=(D^N^P)+E[1]-1530992060|0,O=(O<<4|O>>>28)+D|0,P+=(O^D^N)+E[4]+1272893353|0,P=(P<<11|P>>>21)+O|0,N+=(P^O^D)+E[7]-155497632|0,N=(N<<16|N>>>16)+P|0,D+=(N^P^O)+E[10]-1094730640|0,D=(D<<23|D>>>9)+N|0,O+=(D^N^P)+E[13]+681279174|0,O=(O<<4|O>>>28)+D|0,P+=(O^D^N)+E[0]-358537222|0,P=(P<<11|P>>>21)+O|0,N+=(P^O^D)+E[3]-722521979|0,N=(N<<16|N>>>16)+P|0,D+=(N^P^O)+E[6]+76029189|0,D=(D<<23|D>>>9)+N|0,O+=(D^N^P)+E[9]-640364487|0,O=(O<<4|O>>>28)+D|0,P+=(O^D^N)+E[12]-421815835|0,P=(P<<11|P>>>21)+O|0,N+=(P^O^D)+E[15]+530742520|0,N=(N<<16|N>>>16)+P|0,D+=(N^P^O)+E[2]-995338651|0,D=(D<<23|D>>>9)+N|0,O+=(N^(D|~P))+E[0]-198630844|0,O=(O<<6|O>>>26)+D|0,P+=(D^(O|~N))+E[7]+1126891415|0,P=(P<<10|P>>>22)+O|0,N+=(O^(P|~D))+E[14]-1416354905|0,N=(N<<15|N>>>17)+P|0,D+=(P^(N|~O))+E[5]-57434055|0,D=(D<<21|D>>>11)+N|0,O+=(N^(D|~P))+E[12]+1700485571|0,O=(O<<6|O>>>26)+D|0,P+=(D^(O|~N))+E[3]-1894986606|0,P=(P<<10|P>>>22)+O|0,N+=(O^(P|~D))+E[10]-1051523|0,N=(N<<15|N>>>17)+P|0,D+=(P^(N|~O))+E[1]-2054922799|0,D=(D<<21|D>>>11)+N|0,O+=(N^(D|~P))+E[8]+1873313359|0,O=(O<<6|O>>>26)+D|0,P+=(D^(O|~N))+E[15]-30611744|0,P=(P<<10|P>>>22)+O|0,N+=(O^(P|~D))+E[6]-1560198380|0,N=(N<<15|N>>>17)+P|0,D+=(P^(N|~O))+E[13]+1309151649|0,D=(D<<21|D>>>11)+N|0,O+=(N^(D|~P))+E[4]-145523070|0,O=(O<<6|O>>>26)+D|0,P+=(D^(O|~N))+E[11]-1120210379|0,P=(P<<10|P>>>22)+O|0,N+=(O^(P|~D))+E[2]+718787259|0,N=(N<<15|N>>>17)+P|0,D+=(P^(N|~O))+E[9]-343485551|0,D=(D<<21|D>>>11)+N|0,S[0]=O+S[0]|0,S[1]=D+S[1]|0,S[2]=N+S[2]|0,S[3]=P+S[3]|0}function r(S){var E=[],O;for(O=0;O<64;O+=4)E[O>>2]=S.charCodeAt(O)+(S.charCodeAt(O+1)<<8)+(S.charCodeAt(O+2)<<16)+(S.charCodeAt(O+3)<<24);return E}function a(S){var E=[],O;for(O=0;O<64;O+=4)E[O>>2]=S[O]+(S[O+1]<<8)+(S[O+2]<<16)+(S[O+3]<<24);return E}function c(S){var E=S.length,O=[1732584193,-271733879,-1732584194,271733878],D,N,P,L,se,re;for(D=64;D<=E;D+=64)i(O,r(S.substring(D-64,D)));for(S=S.substring(D-64),N=S.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]|=S.charCodeAt(D)<<(D%4<<3);if(P[D>>2]|=128<<(D%4<<3),D>55)for(i(O,P),D=0;D<16;D+=1)P[D]=0;return L=E*8,L=L.toString(16).match(/(.*?)(.{0,8})$/),se=parseInt(L[2],16),re=parseInt(L[1],16)||0,P[14]=se,P[15]=re,i(O,P),O}function p(S){var E=S.length,O=[1732584193,-271733879,-1732584194,271733878],D,N,P,L,se,re;for(D=64;D<=E;D+=64)i(O,a(S.subarray(D-64,D)));for(S=D-64<E?S.subarray(D-64):new Uint8Array(0),N=S.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]|=S[D]<<(D%4<<3);if(P[D>>2]|=128<<(D%4<<3),D>55)for(i(O,P),D=0;D<16;D+=1)P[D]=0;return L=E*8,L=L.toString(16).match(/(.*?)(.{0,8})$/),se=parseInt(L[2],16),re=parseInt(L[1],16)||0,P[14]=se,P[15]=re,i(O,P),O}function u(S){var E="",O;for(O=0;O<4;O+=1)E+=e[S>>O*8+4&15]+e[S>>O*8&15];return E}function h(S){var E;for(E=0;E<S.length;E+=1)S[E]=u(S[E]);return S.join("")}h(c("hello"))!=="5d41402abc4b2a76b9719d911017c592"&&(o=function(S,E){var O=(S&65535)+(E&65535),D=(S>>16)+(E>>16)+(O>>16);return D<<16|O&65535}),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&(function(){function S(E,O){return E=E|0||0,E<0?Math.max(E+O,0):Math.min(E,O)}ArrayBuffer.prototype.slice=function(E,O){var D=this.byteLength,N=S(E,D),P=D,L,se,re,W;return O!==n&&(P=S(O,D)),N>P?new ArrayBuffer(0):(L=P-N,se=new ArrayBuffer(L),re=new Uint8Array(se),W=new Uint8Array(this,N,L),re.set(W),se)}})();function g(S){return/[\u0080-\uFFFF]/.test(S)&&(S=unescape(encodeURIComponent(S))),S}function y(S,E){var O=S.length,D=new ArrayBuffer(O),N=new Uint8Array(D),P;for(P=0;P<O;P+=1)N[P]=S.charCodeAt(P);return E?N:D}function b(S){return String.fromCharCode.apply(null,new Uint8Array(S))}function x(S,E,O){var D=new Uint8Array(S.byteLength+E.byteLength);return D.set(new Uint8Array(S)),D.set(new Uint8Array(E),S.byteLength),O?D:D.buffer}function M(S){var E=[],O=S.length,D;for(D=0;D<O-1;D+=2)E.push(parseInt(S.substr(D,2),16));return String.fromCharCode.apply(String,E)}function w(){this.reset()}return w.prototype.append=function(S){return this.appendBinary(g(S)),this},w.prototype.appendBinary=function(S){this._buff+=S,this._length+=S.length;var E=this._buff.length,O;for(O=64;O<=E;O+=64)i(this._hash,r(this._buff.substring(O-64,O)));return this._buff=this._buff.substring(O-64),this},w.prototype.end=function(S){var E=this._buff,O=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<O;D+=1)N[D>>2]|=E.charCodeAt(D)<<(D%4<<3);return this._finish(N,O),P=h(this._hash),S&&(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(S){return this._buff=S.buff,this._length=S.length,this._hash=S.hash,this},w.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},w.prototype._finish=function(S,E){var O=E,D,N,P;if(S[O>>2]|=128<<(O%4<<3),O>55)for(i(this._hash,S),O=0;O<16;O+=1)S[O]=0;D=this._length*8,D=D.toString(16).match(/(.*?)(.{0,8})$/),N=parseInt(D[2],16),P=parseInt(D[1],16)||0,S[14]=N,S[15]=P,i(this._hash,S)},w.hash=function(S,E){return w.hashBinary(g(S),E)},w.hashBinary=function(S,E){var O=c(S),D=h(O);return E?M(D):D},w.ArrayBuffer=function(){this.reset()},w.ArrayBuffer.prototype.append=function(S){var E=x(this._buff.buffer,S,!0),O=E.length,D;for(this._length+=S.byteLength,D=64;D<=O;D+=64)i(this._hash,a(E.subarray(D-64,D)));return this._buff=D-64<O?new Uint8Array(E.buffer.slice(D-64)):new Uint8Array(0),this},w.ArrayBuffer.prototype.end=function(S){var E=this._buff,O=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<O;N+=1)D[N>>2]|=E[N]<<(N%4<<3);return this._finish(D,O),P=h(this._hash),S&&(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 S=w.prototype.getState.call(this);return S.buff=b(S.buff),S},w.ArrayBuffer.prototype.setState=function(S){return S.buff=y(S.buff,!0),w.prototype.setState.call(this,S)},w.ArrayBuffer.prototype.destroy=w.prototype.destroy,w.ArrayBuffer.prototype._finish=w.prototype._finish,w.ArrayBuffer.hash=function(S,E){var O=p(new Uint8Array(S)),D=h(O);return E?M(D):D},w})});var G9=ws(hO=>{"use strict";(function(){var n=typeof hO<"u"&&hO||typeof define<"u"&&{}||this||window;typeof define<"u"&&define("save-svg-as-png",[],function(){return n}),n.default=n;var o="http://www.w3.org/2000/xmlns/",e="http://www.w3.org/1999/xhtml",t="http://www.w3.org/2000/svg",i='<?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 " ">]>',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},g=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")},y=function($){for(var ue="",be=new Uint8Array($),me=0;me<be.byteLength;me++)ue+=String.fromCharCode(be[me]);return window.btoa(ue)},b=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},x=function($,ue,be,me){if($.tagName==="svg")return{width:be||b($,ue,"width"),height:me||b($,ue,"height")};if($.getBBox){var Pe=$.getBBox(),he=Pe.x,j=Pe.y,J=Pe.width,le=Pe.height;return{width:he+J,height:j+le}}},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),Pe=new Uint8Array(me),he=0;he<ue.length;he++)Pe[he]=ue.charCodeAt(he);return new Blob([me],{type:be})},S=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 Pe=me.startsWith("../")?ue+"/../"+me:me.startsWith("./")?ue+"/."+me:me;return{text:$.cssText,format:g(Pe),url:Pe}}},O=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,Pe){var he=document.createElement("canvas"),j=new Image;j.crossOrigin="anonymous",j.src=be,j.onerror=function(){return Pe(new Error("Could not load "+be))},j.onload=function(){he.width=j.width,he.height=j.height,he.getContext("2d").drawImage(j,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 Pe=new XMLHttpRequest;Pe.addEventListener("load",function(){var he=y(Pe.response),j=ue.text.replace(r,'url("data:'+ue.format+";base64,"+he+'")')+`
|
||
`;D[ue.url]=j,be(j)}),Pe.addEventListener("error",function(he){console.warn("Failed to load font from: "+ue.url,he),D[ue.url]=null,be(null)}),Pe.addEventListener("abort",function(he){console.warn("Aborted loading font from: "+ue.url,he),be(null)}),Pe.open("GET",ue.url),Pe.responseType="arraybuffer",Pe.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),{}}}))},se=function($,ue){var be=ue||{},me=be.selectorRemap,Pe=be.modifyStyle,he=be.modifyCss,j=be.fonts,J=be.excludeUnusedCss,le=he||function(et,Ze){var ye=me?me(et):et,q=Pe?Pe(Ze):Ze;return ye+"{"+q+`}
|
||
`},ce=[],De=typeof j>"u",He=j||[];return L().forEach(function(et){var Ze=et.rules,ye=et.href;Ze&&Array.from(Ze).forEach(function(q){if(typeof q.style<"u")if(S($,q.selectorText))ce.push(le(q.selectorText,q.style.cssText));else if(De&&q.cssText.match(/^@font-face/)){var Ne=E(q,ye);Ne&&He.push(Ne)}else J||ce.push(q.cssText)})}),N(He).then(function(et){return ce.join(`
|
||
`)+et})},re=function(){if(!navigator.msSaveOrOpenBlob&&!("download"in document.createElement("a")))return{popup:window.open()}};n.prepareSvg=function(W,$,ue){p(W);var be=$||{},me=be.left,Pe=me===void 0?0:me,he=be.top,j=he===void 0?0:he,J=be.width,le=be.height,ce=be.scale,De=ce===void 0?1:ce,He=be.responsive,et=He===void 0?!1:He,Ze=be.excludeCss,ye=Ze===void 0?!1:Ze;return O(W).then(function(){var q=W.cloneNode(!0);q.style.backgroundColor=($||{}).backgroundColor||W.style.backgroundColor;var Ne=x(W,q,J,le),Qe=Ne.width,ct=Ne.height;if(W.tagName!=="svg")if(W.getBBox){q.getAttribute("transform")!=null&&q.setAttribute("transform",q.getAttribute("transform").replace(/translate\(.*?\)/,""));var At=document.createElementNS("http://www.w3.org/2000/svg","svg");At.appendChild(q),q=At}else{console.error("Attempted to render non-SVG element",W);return}if(q.setAttribute("version","1.1"),q.setAttribute("viewBox",[Pe,j,Qe,ct].join(" ")),q.getAttribute("xmlns")||q.setAttributeNS(o,"xmlns",t),q.getAttribute("xmlns:xlink")||q.setAttributeNS(o,"xmlns:xlink","http://www.w3.org/1999/xlink"),et?(q.removeAttribute("width"),q.removeAttribute("height"),q.setAttribute("preserveAspectRatio","xMinYMin meet")):(q.setAttribute("width",Qe*De),q.setAttribute("height",ct*De)),Array.from(q.querySelectorAll("foreignObject > *")).forEach(function(vo){vo.setAttributeNS(o,"xmlns",vo.tagName==="svg"?t:e)}),ye){var Yn=document.createElement("div");Yn.appendChild(q);var Oo=Yn.innerHTML;if(typeof ue=="function")ue(Oo,Qe,ct);else return{src:Oo,width:Qe,height:ct}}else return se(W,$).then(function(vo){var Wr=document.createElement("style");Wr.setAttribute("type","text/css"),Wr.innerHTML=`<![CDATA[
|
||
`+vo+`
|
||
]]>`;var Rn=document.createElement("defs");Rn.appendChild(Wr),q.insertBefore(Rn,q.firstChild);var Gd=document.createElement("div");Gd.appendChild(q);var Hu=Gd.innerHTML.replace(/NS\d+:href/gi,'xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href');if(typeof ue=="function")ue(Hu,Qe,ct);else return{src:Hu,width:Qe,height:ct}})})},n.svgAsDataUri=function(W,$,ue){return p(W),n.prepareSvg(W,$).then(function(be){var me=be.src,Pe=be.width,he=be.height,j="data:image/svg+xml;base64,"+window.btoa(M(i+me));return typeof ue=="function"&&ue(j,Pe,he),j})},n.svgAsPngUri=function(W,$,ue){p(W);var be=$||{},me=be.encoderType,Pe=me===void 0?"image/png":me,he=be.encoderOptions,j=he===void 0?.8:he,J=be.canvg,le=function(De){var He=De.src,et=De.width,Ze=De.height,ye=document.createElement("canvas"),q=ye.getContext("2d"),Ne=window.devicePixelRatio||1;ye.width=et*Ne,ye.height=Ze*Ne,ye.style.width=ye.width+"px",ye.style.height=ye.height+"px",q.setTransform(Ne,0,0,Ne,0,0),J?J(ye,He):q.drawImage(He,0,0);var Qe=void 0;try{Qe=ye.toDataURL(Pe,j)}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(Qe,ye.width,ye.height),Promise.resolve(Qe)};return J?n.prepareSvg(W,$).then(le):n.svgAsDataUri(W,$).then(function(ce){return new Promise(function(De,He){var et=new Image;et.onload=function(){return De(le({src:et,width:et.width,height:et.height}))},et.onerror=function(){He(`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)},et.src=ce})})},n.download=function(W,$,ue){if(navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(w($),W);else{var be=document.createElement("a");if("download"in be){be.download=W,be.style.display="none",document.body.appendChild(be);try{var me=w($),Pe=URL.createObjectURL(me);be.href=Pe,be.onclick=function(){return requestAnimationFrame(function(){return URL.revokeObjectURL(Pe)})}}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=W,ue.popup.location.replace($))}},n.saveSvg=function(W,$,ue){var be=re();return u(W).then(function(me){return n.svgAsDataUri(me,ue||{})}).then(function(me){return n.download($,me,be)})},n.saveSvgAsPng=function(W,$,ue){var be=re();return u(W).then(function(me){return n.svgAsPngUri(me,ue||{})}).then(function(me){return n.download($,me,be)})}})()});var xO=ws((q2,CO)=>{(function(n,o){if(typeof q2=="object"&&typeof CO=="object")CO.exports=o();else if(typeof define=="function"&&define.amd)define([],o);else{var e=o();for(var t in e)(typeof q2=="object"?q2:n)[t]=e[t]}})(globalThis,()=>(()=>{"use strict";var n={4567:function(i,r,a){var c=this&&this.__decorate||function(w,S,E,O){var D,N=arguments.length,P=N<3?S:O===null?O=Object.getOwnPropertyDescriptor(S,E):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(w,S,E,O);else for(var L=w.length-1;L>=0;L--)(D=w[L])&&(P=(N<3?D(P):N>3?D(S,E,P):D(S,E))||P);return N>3&&P&&Object.defineProperty(S,E,P),P},p=this&&this.__param||function(w,S){return function(E,O){S(E,O,w)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;let u=a(9042),h=a(9924),g=a(844),y=a(4725),b=a(2585),x=a(3656),M=r.AccessibilityManager=class extends g.Disposable{constructor(w,S,E,O){super(),this._terminal=w,this._coreBrowserService=E,this._renderService=O,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,x.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,g.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(w){for(let S=0;S<w;S++)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,S){this._liveRegionDebouncer.refresh(w,S,this._terminal.rows)}_renderRows(w,S){let E=this._terminal.buffer,O=E.lines.length.toString();for(let D=w;D<=S;D++){let N=E.lines.get(E.ydisp+D),P=[],L=N?.translateToString(!0,void 0,void 0,P)||"",se=(E.ydisp+D+1).toString(),re=this._rowElements[D];re&&(L.length===0?(re.innerText="\xA0",this._rowColumns.set(re,[0,1])):(re.textContent=L,this._rowColumns.set(re,P)),re.setAttribute("aria-posinset",se),re.setAttribute("aria-setsize",O))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(w,S){let E=w.target,O=this._rowElements[S===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||w.relatedTarget!==O)return;let D,N;if(S===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),S===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(S===0?-1:1),this._rowElements[S===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 S={node:w.anchorNode,offset:w.anchorOffset},E={node:w.focusNode,offset:w.focusOffset};if((S.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===E.node&&S.offset>E.offset)&&([S,E]=[E,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.node))return;let O=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(O)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:O,offset:O.textContent?.length??0}),!this._rowContainer.contains(E.node))return;let D=({node:L,offset:se})=>{let re=L instanceof Text?L.parentNode:L,W=parseInt(re?.getAttribute("aria-posinset"),10)-1;if(isNaN(W))return console.warn("row is invalid. Race condition?"),null;let $=this._rowColumns.get(re);if(!$)return console.warn("columns is null. Race condition?"),null;let ue=se<$.length?$[se]:$.slice(-1)[0]+1;return ue>=this._terminal.cols&&(++W,ue=0),{row:W,column:ue}},N=D(S),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 S=this._rowContainer.children.length;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);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,b.IInstantiationService),p(2,y.ICoreBrowserService),p(3,y.IRenderService)],M)},3614:(i,r)=>{function a(h){return h.replace(/\r?\n/g,"\r")}function c(h,g){return g?"\x1B[200~"+h+"\x1B[201~":h}function p(h,g,y,b){h=c(h=a(h),y.decPrivateModes.bracketedPasteMode&&b.rawOptions.ignoreBracketedPasteMode!==!0),y.triggerDataEvent(h,!0),g.value=""}function u(h,g,y){let b=y.getBoundingClientRect(),x=h.clientX-b.left-10,M=h.clientY-b.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${x}px`,g.style.top=`${M}px`,g.style.zIndex="1000",g.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,g){h.clipboardData&&h.clipboardData.setData("text/plain",g.selectionText),h.preventDefault()},r.handlePasteEvent=function(h,g,y,b){h.stopPropagation(),h.clipboardData&&p(h.clipboardData.getData("text/plain"),g,y,b)},r.paste=p,r.moveTextAreaUnderMouseCursor=u,r.rightClickHandler=function(h,g,y,b,x){u(h,g,y),x&&b.rightClickSelect(h),g.value=b.selectionText,g.select()}},7239:(i,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:(i,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(i,r,a){var c=this&&this.__decorate||function(M,w,S,E){var O,D=arguments.length,N=D<3?w:E===null?E=Object.getOwnPropertyDescriptor(w,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(M,w,S,E);else for(var P=M.length-1;P>=0;P--)(O=M[P])&&(N=(D<3?O(N):D>3?O(w,S,N):O(w,S))||N);return D>3&&N&&Object.defineProperty(w,S,N),N},p=this&&this.__param||function(M,w){return function(S,E){w(S,E,M)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;let u=a(3656),h=a(8460),g=a(844),y=a(2585),b=a(4725),x=r.Linkifier=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(M,w,S,E,O){super(),this._element=M,this._mouseService=w,this._renderService=S,this._bufferService=E,this._linkProviderService=O,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,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.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 S=M.composedPath();for(let E=0;E<S.length;E++){let O=S[E];if(O.classList.contains("xterm"))break;if(O.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(O=>{O.link.dispose&&O.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=M.y);let S=!1;for(let[E,O]of this._linkProviderService.linkProviders.entries())w?this._activeProviderReplies?.get(E)&&(S=this._checkLinkProviderResult(E,M,S)):O.provideLinks(M.y,D=>{if(this._isMouseOut)return;let N=D?.map(P=>({link:P}));this._activeProviderReplies?.set(E,N),S=this._checkLinkProviderResult(E,M,S),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(M.y,this._activeProviderReplies)})}_removeIntersectingLinks(M,w){let S=new Set;for(let E=0;E<w.size;E++){let O=w.get(E);if(O)for(let D=0;D<O.length;D++){let N=O[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 se=P;se<=L;se++){if(S.has(se)){O.splice(D--,1);break}S.add(se)}}}}_checkLinkProviderResult(M,w,S){if(!this._activeProviderReplies)return S;let E=this._activeProviderReplies.get(M),O=!1;for(let D=0;D<M;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(O=!0);if(!O&&E){let D=E.find(N=>this._linkAtPosition(N.link,w));D&&(S=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!S)for(let D=0;D<this._activeProviderReplies.size;D++){let N=this._activeProviderReplies.get(D)?.find(P=>this._linkAtPosition(P.link,w));if(N){S=!0,this._handleNewLink(N);break}}return S}_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,g.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:S=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==S&&(this._currentLink.state.decorations.pointerCursor=S,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",S))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:S=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==S&&(this._currentLink.state.decorations.underline=S,this._currentLink.state.isHovered&&this._fireUnderlineEvent(M.link,S))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(S=>{if(!this._currentLink)return;let E=S.start===0?0:S.start+1+this._bufferService.buffer.ydisp,O=this._bufferService.buffer.ydisp+1+S.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=O&&(this._clearCurrentLink(E,O),this._lastMouseEvent)){let D=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);D&&this._askForLink(D,!1)}})))}_linkHover(M,w,S){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(S,w.text)}_fireUnderlineEvent(M,w){let S=M.range,E=this._bufferService.buffer.ydisp,O=this._createLinkUnderlineEvent(S.start.x-1,S.start.y-E-1,S.end.x,S.end.y-E-1,void 0);(w?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(O)}_linkLeave(M,w,S){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(S,w.text)}_linkAtPosition(M,w){let S=M.range.start.y*this._bufferService.cols+M.range.start.x,E=M.range.end.y*this._bufferService.cols+M.range.end.x,O=w.y*this._bufferService.cols+w.x;return S<=O&&O<=E}_positionFromMouseEvent(M,w,S){let E=S.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,S,E,O){return{x1:M,y1:w,x2:S,y2:E,cols:this._bufferService.cols,fg:O}}};r.Linkifier=x=c([p(1,b.IMouseService),p(2,b.IRenderService),p(3,y.IBufferService),p(4,b.ILinkProviderService)],x)},9042:(i,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(i,r,a){var c=this&&this.__decorate||function(b,x,M,w){var S,E=arguments.length,O=E<3?x:w===null?w=Object.getOwnPropertyDescriptor(x,M):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(b,x,M,w);else for(var D=b.length-1;D>=0;D--)(S=b[D])&&(O=(E<3?S(O):E>3?S(x,M,O):S(x,M))||O);return E>3&&O&&Object.defineProperty(x,M,O),O},p=this&&this.__param||function(b,x){return function(M,w){x(M,w,b)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;let u=a(511),h=a(2585),g=r.OscLinkProvider=class{constructor(b,x,M){this._bufferService=b,this._optionsService=x,this._oscLinkService=M}provideLinks(b,x){let M=this._bufferService.buffer.lines.get(b-1);if(!M)return void x(void 0);let w=[],S=this._optionsService.rawOptions.linkHandler,E=new u.CellData,O=M.getTrimmedLength(),D=-1,N=-1,P=!1;for(let L=0;L<O;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===O-1){let se=this._oscLinkService.getLinkData(D)?.uri;if(se){let re={start:{x:N+1,y:b},end:{x:L+(P||L!==O-1?0:1),y:b}},W=!1;if(!S?.allowNonHttpProtocols)try{let $=new URL(se);["http:","https:"].includes($.protocol)||(W=!0)}catch{W=!0}W||w.push({text:se,range:re,activate:($,ue)=>S?S.activate($,ue,re):y(0,ue),hover:($,ue)=>S?.hover?.($,ue,re),leave:($,ue)=>S?.leave?.($,ue,re)})}P=!1,E.hasExtendedAttrs()&&E.extended.urlId?(N=L,D=E.extended.urlId):(N=-1,D=-1)}}x(w)}};function y(b,x){if(confirm(`Do you want to navigate to ${x}?
|
||
|
||
WARNING: This link could potentially be dangerous`)){let M=window.open();if(M){try{M.opener=null}catch{}M.location.href=x}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=g=c([p(0,h.IBufferService),p(1,h.IOptionsService),p(2,h.IOscLinkService)],g)},6193:(i,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:(i,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),g=a(3730),y=a(1680),b=a(3107),x=a(5744),M=a(2950),w=a(1296),S=a(428),E=a(4269),O=a(5114),D=a(8934),N=a(3230),P=a(9312),L=a(4725),se=a(6731),re=a(8055),W=a(8969),$=a(8460),ue=a(844),be=a(6114),me=a(8437),Pe=a(2584),he=a(7399),j=a(5941),J=a(9074),le=a(2585),ce=a(5435),De=a(4567),He=a(779);class et extends W.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(J.DecorationService),this._instantiationService.setService(le.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(He.LinkProviderService),this._instantiationService.setService(L.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((q,Ne)=>this.refresh(q,Ne))),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 Ne,Qe="";switch(q.index){case 256:Ne="foreground",Qe="10";break;case 257:Ne="background",Qe="11";break;case 258:Ne="cursor",Qe="12";break;default:Ne="ansi",Qe="4;"+q.index}switch(q.type){case 0:let ct=re.color.toColorRGB(Ne==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[Ne]);this.coreService.triggerDataEvent(`${Pe.C0.ESC}]${Qe};${(0,j.toRgbString)(ct)}${Pe.C1_ESCAPED.ST}`);break;case 1:if(Ne==="ansi")this._themeService.modifyColors(At=>At.ansi[q.index]=re.channels.toColor(...q.color));else{let At=Ne;this._themeService.modifyColors(Yn=>Yn[At]=re.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(De.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(ye){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Pe.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(Pe.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 Ne=Math.min(this.buffer.x,this.cols-1),Qe=this._renderService.dimensions.css.cell.height,ct=q.getWidth(Ne),At=this._renderService.dimensions.css.cell.width*ct,Yn=this.buffer.y*this._renderService.dimensions.css.cell.height,Oo=Ne*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Oo+"px",this.textarea.style.top=Yn+"px",this.textarea.style.width=At+"px",this.textarea.style.height=Qe+"px",this.textarea.style.lineHeight=Qe+"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",Ne=>this.updateCursorStyle(Ne))),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(O.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",Ne=>this._handleTextAreaFocus(Ne))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(S.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(L.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(se.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(Ne=>this._onRender.fire(Ne))),this.onResize(Ne=>this._renderService.resize(Ne.cols,Ne.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(y.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(Ne=>this.scrollLines(Ne.amount,Ne.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(Ne=>this.scrollLines(Ne.amount,Ne.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(Ne=>this._renderService.handleSelectionChanged(Ne.start,Ne.end,Ne.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(Ne=>{this.textarea.value=Ne,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(Ne=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(b.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",Ne=>this._selectionService.handleMouseDown(Ne))),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(De.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",Ne=>this._handleScreenReaderModeOptionChange(Ne))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(x.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",Ne=>{!this._overviewRulerRenderer&&Ne&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(x.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 Ne(At){let Yn=ye._mouseService.getMouseReportCoords(At,ye.screenElement);if(!Yn)return!1;let Oo,vo;switch(At.overrideType||At.type){case"mousemove":vo=32,At.buttons===void 0?(Oo=3,At.button!==void 0&&(Oo=At.button<3?At.button:3)):Oo=1&At.buttons?0:4&At.buttons?1:2&At.buttons?2:3;break;case"mouseup":vo=0,Oo=At.button<3?At.button:3;break;case"mousedown":vo=1,Oo=At.button<3?At.button:3;break;case"wheel":if(ye._customWheelEventHandler&&ye._customWheelEventHandler(At)===!1||ye.viewport.getLinesScrolled(At)===0)return!1;vo=At.deltaY<0?0:1,Oo=4;break;default:return!1}return!(vo===void 0||Oo===void 0||Oo>4)&&ye.coreMouseService.triggerMouseEvent({col:Yn.col,row:Yn.row,x:Yn.x,y:Yn.y,button:Oo,action:vo,ctrl:At.ctrlKey,alt:At.altKey,shift:At.shiftKey})}let Qe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ct={mouseup:At=>(Ne(At),At.buttons||(this._document.removeEventListener("mouseup",Qe.mouseup),Qe.mousedrag&&this._document.removeEventListener("mousemove",Qe.mousedrag)),this.cancel(At)),wheel:At=>(Ne(At),this.cancel(At,!0)),mousedrag:At=>{At.buttons&&Ne(At)},mousemove:At=>{At.buttons||Ne(At)}};this.register(this.coreMouseService.onProtocolChange(At=>{At?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(At)),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&At?Qe.mousemove||(q.addEventListener("mousemove",ct.mousemove),Qe.mousemove=ct.mousemove):(q.removeEventListener("mousemove",Qe.mousemove),Qe.mousemove=null),16&At?Qe.wheel||(q.addEventListener("wheel",ct.wheel,{passive:!1}),Qe.wheel=ct.wheel):(q.removeEventListener("wheel",Qe.wheel),Qe.wheel=null),2&At?Qe.mouseup||(Qe.mouseup=ct.mouseup):(this._document.removeEventListener("mouseup",Qe.mouseup),Qe.mouseup=null),4&At?Qe.mousedrag||(Qe.mousedrag=ct.mousedrag):(this._document.removeEventListener("mousemove",Qe.mousedrag),Qe.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(q,"mousedown",At=>{if(At.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(At))return Ne(At),Qe.mouseup&&this._document.addEventListener("mouseup",Qe.mouseup),Qe.mousedrag&&this._document.addEventListener("mousemove",Qe.mousedrag),this.cancel(At)})),this.register((0,p.addDisposableDomListener)(q,"wheel",At=>{if(!Qe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(At)===!1)return!1;if(!this.buffer.hasScrollback){let Yn=this.viewport.getLinesScrolled(At);if(Yn===0)return;let Oo=Pe.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(At.deltaY<0?"A":"B"),vo="";for(let Wr=0;Wr<Math.abs(Yn);Wr++)vo+=Oo;return this.coreService.triggerDataEvent(vo,!0),this.cancel(At,!0)}return this.viewport.handleWheel(At)?this.cancel(At):void 0}},{passive:!1})),this.register((0,p.addDisposableDomListener)(q,"touchstart",At=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(At),this.cancel(At)},{passive:!0})),this.register((0,p.addDisposableDomListener)(q,"touchmove",At=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(At)?void 0:this.cancel(At)},{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,Ne=0){Ne===1?(super.scrollLines(ye,q,Ne),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,Ne){this._selectionService.setSelection(ye,q,Ne)}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 Ne=(0,he.evaluateKeyboardEvent)(ye,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(ye),Ne.type===3||Ne.type===2){let Qe=this.rows-1;return this.scrollLines(Ne.type===2?-Qe:Qe),this.cancel(ye,!0)}return Ne.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,ye)||(Ne.cancel&&this.cancel(ye,!0),!Ne.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):(Ne.key!==Pe.C0.ETX&&Ne.key!==Pe.C0.CR||(this.textarea.value=""),this._onKey.fire({key:Ne.key,domEvent:ye}),this._showCursor(),this.coreService.triggerDataEvent(Ne.key,!0),!this.optionsService.rawOptions.screenReaderMode||ye.altKey||ye.ctrlKey?this.cancel(ye,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(ye,q){let Ne=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"?Ne:Ne&&(!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(Pe.C0.ESC+"[I"):this.coreService.triggerDataEvent(Pe.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),Ne=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Pe.C0.ESC}[4;${Ne};${q}t`);break;case ce.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:let Qe=this._renderService.dimensions.css.cell.width.toFixed(0),ct=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Pe.C0.ESC}[6;${ct};${Qe}t`)}}cancel(ye,q){if(this.options.cancelEvents||q)return ye.preventDefault(),ye.stopPropagation(),!1}}r.Terminal=et},9924:(i,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,g=this._debounceThresholdMS-h;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},g)}}_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(i,r,a){var c=this&&this.__decorate||function(M,w,S,E){var O,D=arguments.length,N=D<3?w:E===null?E=Object.getOwnPropertyDescriptor(w,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(M,w,S,E);else for(var P=M.length-1;P>=0;P--)(O=M[P])&&(N=(D<3?O(N):D>3?O(w,S,N):O(w,S))||N);return D>3&&N&&Object.defineProperty(w,S,N),N},p=this&&this.__param||function(M,w){return function(S,E){w(S,E,M)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;let u=a(3656),h=a(4725),g=a(8460),y=a(844),b=a(2585),x=r.Viewport=class extends y.Disposable{constructor(M,w,S,E,O,D,N,P){super(),this._viewportElement=M,this._scrollArea=w,this._bufferService=S,this._optionsService=E,this._charSizeService=O,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 g.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 S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(w<0&&this._viewportElement.scrollTop!==0||w>0&&S<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 S,E="",O=[],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 se=N.get(P+1)?.isWrapped;if(E+=L.translateToString(!se),!se||P===N.length-1){let re=document.createElement("div");re.textContent=E,O.push(re),E.length>0&&(S=re),E=""}}return{bufferElements:O,cursorElement:S}}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 S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&w.altKey||S==="ctrl"&&w.ctrlKey||S==="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=x=c([p(2,b.IBufferService),p(3,b.IOptionsService),p(4,h.ICharSizeService),p(5,h.IRenderService),p(6,h.ICoreBrowserService),p(7,h.IThemeService)],x)},3107:function(i,r,a){var c=this&&this.__decorate||function(b,x,M,w){var S,E=arguments.length,O=E<3?x:w===null?w=Object.getOwnPropertyDescriptor(x,M):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(b,x,M,w);else for(var D=b.length-1;D>=0;D--)(S=b[D])&&(O=(E<3?S(O):E>3?S(x,M,O):S(x,M))||O);return E>3&&O&&Object.defineProperty(x,M,O),O},p=this&&this.__param||function(b,x){return function(M,w){x(M,w,b)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;let u=a(4725),h=a(844),g=a(2585),y=r.BufferDecorationRenderer=class extends h.Disposable{constructor(b,x,M,w,S){super(),this._screenElement=b,this._bufferService=x,this._coreBrowserService=M,this._decorationService=w,this._renderService=S,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 b of this._decorationService.decorations)this._renderDecoration(b);this._dimensionsChanged=!1}_renderDecoration(b){this._refreshStyle(b),this._dimensionsChanged&&this._refreshXPosition(b)}_createElement(b){let x=this._coreBrowserService.mainDocument.createElement("div");x.classList.add("xterm-decoration"),x.classList.toggle("xterm-decoration-top-layer",b?.options?.layer==="top"),x.style.width=`${Math.round((b.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,x.style.height=(b.options.height||1)*this._renderService.dimensions.css.cell.height+"px",x.style.top=(b.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",x.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let M=b.options.x??0;return M&&M>this._bufferService.cols&&(x.style.display="none"),this._refreshXPosition(b,x),x}_refreshStyle(b){let x=b.marker.line-this._bufferService.buffers.active.ydisp;if(x<0||x>=this._bufferService.rows)b.element&&(b.element.style.display="none",b.onRenderEmitter.fire(b.element));else{let M=this._decorationElements.get(b);M||(M=this._createElement(b),b.element=M,this._decorationElements.set(b,M),this._container.appendChild(M),b.onDispose(()=>{this._decorationElements.delete(b),M.remove()})),M.style.top=x*this._renderService.dimensions.css.cell.height+"px",M.style.display=this._altBufferIsActive?"none":"block",b.onRenderEmitter.fire(M)}}_refreshXPosition(b,x=b.element){if(!x)return;let M=b.options.x??0;(b.options.anchor||"left")==="right"?x.style.right=M?M*this._renderService.dimensions.css.cell.width+"px":"":x.style.left=M?M*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(b){this._decorationElements.get(b)?.remove(),this._decorationElements.delete(b),b.dispose()}};r.BufferDecorationRenderer=y=c([p(1,g.IBufferService),p(2,u.ICoreBrowserService),p(3,g.IDecorationService),p(4,u.IRenderService)],y)},5871:(i,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(i,r,a){var c=this&&this.__decorate||function(S,E,O,D){var N,P=arguments.length,L=P<3?E:D===null?D=Object.getOwnPropertyDescriptor(E,O):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,E,O,D);else for(var se=S.length-1;se>=0;se--)(N=S[se])&&(L=(P<3?N(L):P>3?N(E,O,L):N(E,O))||L);return P>3&&L&&Object.defineProperty(E,O,L),L},p=this&&this.__param||function(S,E){return function(O,D){E(O,D,S)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;let u=a(5871),h=a(4725),g=a(844),y=a(2585),b={full:0,left:0,center:0,right:0},x={full:0,left:0,center:0,right:0},M={full:0,left:0,center:0,right:0},w=r.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,E,O,D,N,P,L){super(),this._viewportElement=S,this._screenElement=E,this._bufferService=O,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 se=this._canvas.getContext("2d");if(!se)throw new Error("Ctx cannot be null");this._ctx=se,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.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 S=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);x.full=this._canvas.width,x.left=S,x.center=E,x.right=S,this._refreshDrawHeightConstants(),M.full=0,M.left=0,M.center=x.left,M.right=x.left+x.center}_refreshDrawHeightConstants(){b.full=Math.round(2*this._coreBrowserService.dpr);let S=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(S,12),6)*this._coreBrowserService.dpr);b.left=E,b.center=E,b.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.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 S=this._colorZoneStore.zones;for(let E of S)E.position!=="full"&&this._renderColorZone(E);for(let E of S)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(M[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-b[S.position||"full"]/2),x[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+b[S.position||"full"]))}_queueRefresh(S,E){this._shouldUpdateDimensions=S||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,y.IBufferService),p(3,y.IDecorationService),p(4,h.IRenderService),p(5,y.IOptionsService),p(6,h.ICoreBrowserService)],w)},2950:function(i,r,a){var c=this&&this.__decorate||function(b,x,M,w){var S,E=arguments.length,O=E<3?x:w===null?w=Object.getOwnPropertyDescriptor(x,M):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(b,x,M,w);else for(var D=b.length-1;D>=0;D--)(S=b[D])&&(O=(E<3?S(O):E>3?S(x,M,O):S(x,M))||O);return E>3&&O&&Object.defineProperty(x,M,O),O},p=this&&this.__param||function(b,x){return function(M,w){x(M,w,b)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;let u=a(4725),h=a(2585),g=a(2584),y=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(b,x,M,w,S,E){this._textarea=b,this._compositionView=x,this._bufferService=M,this._optionsService=w,this._coreService=S,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(b){this._compositionView.textContent=b.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(b){if(this._isComposing||this._isSendingComposition){if(b.keyCode===229||b.keyCode===16||b.keyCode===17||b.keyCode===18)return!1;this._finalizeComposition(!1)}return b.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(b){if(this._compositionView.classList.remove("active"),this._isComposing=!1,b){let x={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let M;this._isSendingComposition=!1,x.start+=this._dataAlreadySent.length,M=this._isComposing?this._textarea.value.substring(x.start,x.end):this._textarea.value.substring(x.start),M.length>0&&this._coreService.triggerDataEvent(M,!0)}},0)}else{this._isSendingComposition=!1;let x=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(x,!0)}}_handleAnyTextareaChanges(){let b=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let x=this._textarea.value,M=x.replace(b,"");this._dataAlreadySent=M,x.length>b.length?this._coreService.triggerDataEvent(M,!0):x.length<b.length?this._coreService.triggerDataEvent(`${g.C0.DEL}`,!0):x.length===b.length&&x!==b&&this._coreService.triggerDataEvent(x,!0)}},0)}updateCompositionElements(b){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let x=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,S=x*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=S+"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=S+"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"}b||setTimeout(()=>this.updateCompositionElements(!0),0)}}};r.CompositionHelper=y=c([p(2,h.IBufferService),p(3,h.IOptionsService),p(4,h.ICoreService),p(5,u.IRenderService)],y)},9806:(i,r)=>{function a(c,p,u){let h=u.getBoundingClientRect(),g=c.getComputedStyle(u),y=parseInt(g.getPropertyValue("padding-left")),b=parseInt(g.getPropertyValue("padding-top"));return[p.clientX-h.left-y,p.clientY-h.top-b]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=a,r.getCoords=function(c,p,u,h,g,y,b,x,M){if(!y)return;let w=a(c,p,u);return w?(w[0]=Math.ceil((w[0]+(M?b/2:0))/b),w[1]=Math.ceil(w[1]/x),w[0]=Math.min(Math.max(w[0],1),h+(M?1:0)),w[1]=Math.min(Math.max(w[1],1),g),w):void 0}},9504:(i,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;let c=a(2584);function p(x,M,w,S){let E=x-u(x,w),O=M-u(M,w),D=Math.abs(E-O)-(function(N,P,L){let se=0,re=N-u(N,L),W=P-u(P,L);for(let $=0;$<Math.abs(re-W);$++){let ue=h(N,P)==="A"?-1:1;L.buffer.lines.get(re+ue*$)?.isWrapped&&se++}return se})(x,M,w);return b(D,y(h(x,M),S))}function u(x,M){let w=0,S=M.buffer.lines.get(x),E=S?.isWrapped;for(;E&&x>=0&&x<M.rows;)w++,S=M.buffer.lines.get(--x),E=S?.isWrapped;return w}function h(x,M){return x>M?"A":"B"}function g(x,M,w,S,E,O){let D=x,N=M,P="";for(;D!==w||N!==S;)D+=E?1:-1,E&&D>O.cols-1?(P+=O.buffer.translateBufferLineToString(N,!1,x,D),D=0,x=0,N++):!E&&D<0&&(P+=O.buffer.translateBufferLineToString(N,!1,0,x+1),D=O.cols-1,x=D,N--);return P+O.buffer.translateBufferLineToString(N,!1,x,D)}function y(x,M){let w=M?"O":"[";return c.C0.ESC+w+x}function b(x,M){x=Math.floor(x);let w="";for(let S=0;S<x;S++)w+=M;return w}r.moveToCellSequence=function(x,M,w,S){let E=w.buffer.x,O=w.buffer.y;if(!w.buffer.hasScrollback)return(function(P,L,se,re,W,$){return p(L,re,W,$).length===0?"":b(g(P,L,P,L-u(L,W),!1,W).length,y("D",$))})(E,O,0,M,w,S)+p(O,M,w,S)+(function(P,L,se,re,W,$){let ue;ue=p(L,re,W,$).length>0?re-u(re,W):L;let be=re,me=(function(Pe,he,j,J,le,ce){let De;return De=p(j,J,le,ce).length>0?J-u(J,le):he,Pe<j&&De<=J||Pe>=j&&De<J?"C":"D"})(P,L,se,re,W,$);return b(g(P,ue,se,be,me==="C",W).length,y(me,$))})(E,O,x,M,w,S);let D;if(O===M)return D=E>x?"D":"C",b(Math.abs(E-x),y(D,S));D=O>M?"D":"C";let N=Math.abs(O-M);return b((function(P,L){return L.cols-P})(O>M?x:E,w)+(N-1)*w.cols+1+((O>M?E:x)-1),y(D,S))}},1296:function(i,r,a){var c=this&&this.__decorate||function($,ue,be,me){var Pe,he=arguments.length,j=he<3?ue:me===null?me=Object.getOwnPropertyDescriptor(ue,be):me;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate($,ue,be,me);else for(var J=$.length-1;J>=0;J--)(Pe=$[J])&&(j=(he<3?Pe(j):he>3?Pe(ue,be,j):Pe(ue,be))||j);return he>3&&j&&Object.defineProperty(ue,be,j),j},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),g=a(2223),y=a(6171),b=a(6052),x=a(4725),M=a(8055),w=a(8460),S=a(844),E=a(2585),O="xterm-dom-renderer-owner-",D="xterm-rows",N="xterm-fg-",P="xterm-bg-",L="xterm-focus",se="xterm-selection",re=1,W=r.DomRenderer=class extends S.Disposable{constructor($,ue,be,me,Pe,he,j,J,le,ce,De,He,et){super(),this._terminal=$,this._document=ue,this._element=be,this._screenElement=me,this._viewportElement=Pe,this._helperContainer=he,this._linkifier2=j,this._charSizeService=le,this._optionsService=ce,this._bufferService=De,this._coreBrowserService=He,this._themeService=et,this._terminalClass=re++,this._rowElements=[],this._selectionRenderModel=(0,b.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(se),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,y.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(Ze=>this._injectCss(Ze))),this._injectCss(this._themeService.colors),this._rowFactory=J.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(O+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(Ze=>this._handleLinkHover(Ze))),this.register(this._linkifier2.onHideLinkUnderline(Ze=>this._handleLinkLeave(Ze))),this.register((0,S.toDisposable)(()=>{this._element.classList.remove(O+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}`,Pe=`blink_block_${this._terminalClass}`;ue+=`@keyframes ${be} { 50% { border-bottom-style: hidden; }}`,ue+=`@keyframes ${me} { 50% { box-shadow: none; }}`,ue+=`@keyframes ${Pe} { 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: ${Pe} 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} .${se} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${se} div { position: absolute; background-color: ${$.selectionBackgroundOpaque.css};}${this._terminalSelector} .${se} div { position: absolute; background-color: ${$.selectionInactiveBackgroundOpaque.css};}`;for(let[he,j]of $.ansi.entries())ue+=`${this._terminalSelector} .${N}${he} { color: ${j.css}; }${this._terminalSelector} .${N}${he}.xterm-dim { color: ${M.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${P}${he} { background-color: ${j.css}; }`;ue+=`${this._terminalSelector} .${N}${g.INVERTED_DEFAULT_COLOR} { color: ${M.color.opaque($.background).css}; }${this._terminalSelector} .${N}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${M.color.multiplyOpacity(M.color.opaque($.background),.5).css}; }${this._terminalSelector} .${P}${g.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,Pe=this._selectionRenderModel.viewportEndRow,he=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(he>=this._bufferService.rows||j<0)return;let J=this._document.createDocumentFragment();if(be){let le=$[0]>ue[0];J.appendChild(this._createSelectionElement(he,le?ue[0]:$[0],le?$[0]:ue[0],j-he+1))}else{let le=me===he?$[0]:0,ce=he===Pe?ue[0]:this._bufferService.cols;J.appendChild(this._createSelectionElement(he,le,ce));let De=j-he-1;if(J.appendChild(this._createSelectionElement(he+1,0,this._bufferService.cols,De)),he!==j){let He=Pe===j?ue[0]:this._bufferService.cols;J.appendChild(this._createSelectionElement(j,0,He))}}this._selectionContainer.appendChild(J)}_createSelectionElement($,ue,be,me=1){let Pe=this._document.createElement("div"),he=ue*this.dimensions.css.cell.width,j=this.dimensions.css.cell.width*(be-ue);return he+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-he),Pe.style.height=me*this.dimensions.css.cell.height+"px",Pe.style.top=$*this.dimensions.css.cell.height+"px",Pe.style.left=`${he}px`,Pe.style.width=`${j}px`,Pe}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,Pe=Math.min(be.x,this._bufferService.cols-1),he=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let le=$;le<=ue;le++){let ce=le+be.ydisp,De=this._rowElements[le],He=be.lines.get(ce);if(!De||!He)break;De.replaceChildren(...this._rowFactory.createRow(He,ce,ce===me,j,J,Pe,he,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${O}${this._terminalClass}`}_handleLinkHover($){this._setCellUnderline($.x1,$.x2,$.y1,$.y2,$.cols,!0)}_handleLinkLeave($){this._setCellUnderline($.x1,$.x2,$.y1,$.y2,$.cols,!1)}_setCellUnderline($,ue,be,me,Pe,he){be<0&&($=0),me<0&&(ue=0);let j=this._bufferService.rows-1;be=Math.max(Math.min(be,j),0),me=Math.max(Math.min(me,j),0),Pe=Math.min(Pe,this._bufferService.cols);let J=this._bufferService.buffer,le=J.ybase+J.y,ce=Math.min(J.x,Pe-1),De=this._optionsService.rawOptions.cursorBlink,He=this._optionsService.rawOptions.cursorStyle,et=this._optionsService.rawOptions.cursorInactiveStyle;for(let Ze=be;Ze<=me;++Ze){let ye=Ze+J.ydisp,q=this._rowElements[Ze],Ne=J.lines.get(ye);if(!q||!Ne)break;q.replaceChildren(...this._rowFactory.createRow(Ne,ye,ye===le,He,et,ce,De,this.dimensions.css.cell.width,this._widthCache,he?Ze===be?$:0:-1,he?(Ze===me?ue:Pe)-1:-1))}}};r.DomRenderer=W=c([p(7,E.IInstantiationService),p(8,x.ICharSizeService),p(9,E.IOptionsService),p(10,E.IBufferService),p(11,x.ICoreBrowserService),p(12,x.IThemeService)],W)},3787:function(i,r,a){var c=this&&this.__decorate||function(D,N,P,L){var se,re=arguments.length,W=re<3?N:L===null?L=Object.getOwnPropertyDescriptor(N,P):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(D,N,P,L);else for(var $=D.length-1;$>=0;$--)(se=D[$])&&(W=(re<3?se(W):re>3?se(N,P,W):se(N,P))||W);return re>3&&W&&Object.defineProperty(N,P,W),W},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),g=a(511),y=a(2585),b=a(8055),x=a(4725),M=a(4269),w=a(6171),S=a(3734),E=r.DomRendererRowFactory=class{constructor(D,N,P,L,se,re,W){this._document=D,this._characterJoinerService=N,this._optionsService=P,this._coreBrowserService=L,this._coreService=se,this._decorationService=re,this._themeService=W,this._workCell=new g.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,se,re,W,$,ue,be,me){let Pe=[],he=this._characterJoinerService.getJoinedCharacters(N),j=this._themeService.colors,J,le=D.getNoBgTrimmedLength();P&&le<re+1&&(le=re+1);let ce=0,De="",He=0,et=0,Ze=0,ye=!1,q=0,Ne=!1,Qe=0,ct=[],At=be!==-1&&me!==-1;for(let Yn=0;Yn<le;Yn++){D.loadCell(Yn,this._workCell);let Oo=this._workCell.getWidth();if(Oo===0)continue;let vo=!1,Wr=Yn,Rn=this._workCell;if(he.length>0&&Yn===he[0][0]){vo=!0;let Yo=he.shift();Rn=new M.JoinedCellData(this._workCell,D.translateToString(!0,Yo[0],Yo[1]),Yo[1]-Yo[0]),Wr=Yo[1]-1,Oo=Rn.getWidth()}let Gd=this._isCellInSelection(Yn,N),Hu=P&&Yn===re,bk=At&&Yn>=be&&Yn<=me,yk=!1;this._decorationService.forEachDecorationAtCell(Yn,N,void 0,Yo=>{yk=!0});let iC=Rn.getChars()||h.WHITESPACE_CELL_CHAR;if(iC===" "&&(Rn.isUnderline()||Rn.isOverline())&&(iC="\xA0"),Qe=Oo*$-ue.get(iC,Rn.isBold(),Rn.isItalic()),J){if(ce&&(Gd&&Ne||!Gd&&!Ne&&Rn.bg===He)&&(Gd&&Ne&&j.selectionForeground||Rn.fg===et)&&Rn.extended.ext===Ze&&bk===ye&&Qe===q&&!Hu&&!vo&&!yk){Rn.isInvisible()?De+=h.WHITESPACE_CELL_CHAR:De+=iC,ce++;continue}ce&&(J.textContent=De),J=this._document.createElement("span"),ce=0,De=""}else J=this._document.createElement("span");if(He=Rn.bg,et=Rn.fg,Ze=Rn.extended.ext,ye=bk,q=Qe,Ne=Gd,vo&&re>=Yn&&re<=Wr&&(re=Yn),!this._coreService.isCursorHidden&&Hu&&this._coreService.isCursorInitialized){if(ct.push("xterm-cursor"),this._coreBrowserService.isFocused)W&&ct.push("xterm-cursor-blink"),ct.push(L==="bar"?"xterm-cursor-bar":L==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(se)switch(se){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"),De=Rn.isInvisible()?h.WHITESPACE_CELL_CHAR:Rn.getChars()||h.WHITESPACE_CELL_CHAR,Rn.isUnderline()&&(ct.push(`xterm-underline-${Rn.extended.underlineStyle}`),De===" "&&(De="\xA0"),!Rn.isUnderlineColorDefault()))if(Rn.isUnderlineColorRGB())J.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(Rn.getUnderlineColor()).join(",")})`;else{let Yo=Rn.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Rn.isBold()&&Yo<8&&(Yo+=8),J.style.textDecorationColor=j.ansi[Yo].css}Rn.isOverline()&&(ct.push("xterm-overline"),De===" "&&(De="\xA0")),Rn.isStrikethrough()&&ct.push("xterm-strikethrough"),bk&&(J.style.textDecoration="underline");let Ws=Rn.getFgColor(),Vg=Rn.getFgColorMode(),cc=Rn.getBgColor(),Bg=Rn.getBgColorMode(),Sk=!!Rn.isInverse();if(Sk){let Yo=Ws;Ws=cc,cc=Yo;let V$=Vg;Vg=Bg,Bg=V$}let qd,oC,Qd,zg=!1;switch(this._decorationService.forEachDecorationAtCell(Yn,N,void 0,Yo=>{Yo.options.layer!=="top"&&zg||(Yo.backgroundColorRGB&&(Bg=50331648,cc=Yo.backgroundColorRGB.rgba>>8&16777215,qd=Yo.backgroundColorRGB),Yo.foregroundColorRGB&&(Vg=50331648,Ws=Yo.foregroundColorRGB.rgba>>8&16777215,oC=Yo.foregroundColorRGB),zg=Yo.options.layer==="top")}),!zg&&Gd&&(qd=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,cc=qd.rgba>>8&16777215,Bg=50331648,zg=!0,j.selectionForeground&&(Vg=50331648,Ws=j.selectionForeground.rgba>>8&16777215,oC=j.selectionForeground)),zg&&ct.push("xterm-decoration-top"),Bg){case 16777216:case 33554432:Qd=j.ansi[cc],ct.push(`xterm-bg-${cc}`);break;case 50331648:Qd=b.channels.toColor(cc>>16,cc>>8&255,255&cc),this._addStyle(J,`background-color:#${O((cc>>>0).toString(16),"0",6)}`);break;default:Sk?(Qd=j.foreground,ct.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Qd=j.background}switch(qd||Rn.isDim()&&(qd=b.color.multiplyOpacity(Qd,.5)),Vg){case 16777216:case 33554432:Rn.isBold()&&Ws<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ws+=8),this._applyMinimumContrast(J,Qd,j.ansi[Ws],Rn,qd,void 0)||ct.push(`xterm-fg-${Ws}`);break;case 50331648:let Yo=b.channels.toColor(Ws>>16&255,Ws>>8&255,255&Ws);this._applyMinimumContrast(J,Qd,Yo,Rn,qd,oC)||this._addStyle(J,`color:#${O(Ws.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(J,Qd,j.foreground,Rn,qd,oC)||Sk&&ct.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}ct.length&&(J.className=ct.join(" "),ct.length=0),Hu||vo||yk?J.textContent=De:ce++,Qe!==this.defaultSpacing&&(J.style.letterSpacing=`${Qe}px`),Pe.push(J),Yn=Wr}return J&&ce&&(J.textContent=De),Pe}_applyMinimumContrast(D,N,P,L,se,re){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,w.treatGlyphAsBackgroundColor)(L.getCode()))return!1;let W=this._getContrastCache(L),$;if(se||re||($=W.getColor(N.rgba,P.rgba)),$===void 0){let ue=this._optionsService.rawOptions.minimumContrastRatio/(L.isDim()?2:1);$=b.color.ensureContrastRatio(se||N,re||P,ue),W.setColor((se||N).rgba,(re||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 O(D,N,P){for(;D.length<P;)D=N+D;return D}r.DomRendererRowFactory=E=c([p(1,x.ICharacterJoinerService),p(2,y.IOptionsService),p(3,x.ICoreBrowserService),p(4,y.ICoreService),p(5,y.IDecorationService),p(6,x.IThemeService)],E)},2550:(i,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 g=a.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[p,u,h,g],this._container.appendChild(p),this._container.appendChild(u),this._container.appendChild(h),this._container.appendChild(g),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 y=this._measure(a,0);return y>0&&(this._flat[u]=y),y}let h=a;c&&(h+="B"),p&&(h+="I");let g=this._holey.get(h);if(g===void 0){let y=0;c&&(y|=1),p&&(y|=2),g=this._measure(a,y),g>0&&this._holey.set(h,g)}return g}_measure(a,c){let p=this._measureElements[c];return p.textContent=a.repeat(32),p.offsetWidth/32}}},2223:(i,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:(i,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,g){return u===1&&h>Math.ceil(1.5*g)&&p!==void 0&&p>255&&!c(p)&&!a(p)&&!(function(y){return 57344<=y&&y<=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:(i,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,g=!1){if(this.selectionStart=u,this.selectionEnd=h,!u||!h||u[0]===h[0]&&u[1]===h[1])return void this.clear();let y=p.buffers.active.ydisp,b=u[1]-y,x=h[1]-y,M=Math.max(b,0),w=Math.min(x,p.rows-1);M>=p.rows||w<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=b,this.viewportEndRow=x,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:(i,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(i,r,a){var c=this&&this.__decorate||function(w,S,E,O){var D,N=arguments.length,P=N<3?S:O===null?O=Object.getOwnPropertyDescriptor(S,E):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(w,S,E,O);else for(var L=w.length-1;L>=0;L--)(D=w[L])&&(P=(N<3?D(P):N>3?D(S,E,P):D(S,E))||P);return N>3&&P&&Object.defineProperty(S,E,P),P},p=this&&this.__param||function(w,S){return function(E,O){S(E,O,w)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;let u=a(2585),h=a(8460),g=a(844),y=r.CharSizeService=class extends g.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(w,S,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 x(w,S,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=y=c([p(2,u.IOptionsService)],y);class b extends g.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(S,E){S!==void 0&&S>0&&E!==void 0&&E>0&&(this._result.width=S,this._result.height=E)}}class x extends b{constructor(S,E,O){super(),this._document=S,this._parentElement=E,this._optionsService=O,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 b{constructor(S){super(),this._optionsService=S,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 S=this._ctx.measureText("W");return this._validateAndSet(S.width,S.fontBoundingBoxAscent+S.fontBoundingBoxDescent),this._result}}},4269:function(i,r,a){var c=this&&this.__decorate||function(M,w,S,E){var O,D=arguments.length,N=D<3?w:E===null?E=Object.getOwnPropertyDescriptor(w,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(M,w,S,E);else for(var P=M.length-1;P>=0;P--)(O=M[P])&&(N=(D<3?O(N):D>3?O(w,S,N):O(w,S))||N);return D>3&&N&&Object.defineProperty(w,S,N),N},p=this&&this.__param||function(M,w){return function(S,E){w(S,E,M)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;let u=a(3734),h=a(643),g=a(511),y=a(2585);class b extends u.AttributeData{constructor(w,S,E){super(),this.content=0,this.combinedData="",this.fg=w.fg,this.bg=w.bg,this.combinedData=S,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=b;let x=r.CharacterJoinerService=class cj{constructor(w){this._bufferService=w,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(w){let S={id:this._nextCharacterJoinerId++,handler:w};return this._characterJoiners.push(S),S.id}deregister(w){for(let S=0;S<this._characterJoiners.length;S++)if(this._characterJoiners[S].id===w)return this._characterJoiners.splice(S,1),!0;return!1}getJoinedCharacters(w){if(this._characterJoiners.length===0)return[];let S=this._bufferService.buffer.lines.get(w);if(!S||S.length===0)return[];let E=[],O=S.translateToString(!0),D=0,N=0,P=0,L=S.getFg(0),se=S.getBg(0);for(let re=0;re<S.getTrimmedLength();re++)if(S.loadCell(re,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==L||this._workCell.bg!==se){if(re-D>1){let W=this._getJoinedRanges(O,P,N,S,D);for(let $=0;$<W.length;$++)E.push(W[$])}D=re,P=N,L=this._workCell.fg,se=this._workCell.bg}N+=this._workCell.getChars().length||h.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-D>1){let re=this._getJoinedRanges(O,P,N,S,D);for(let W=0;W<re.length;W++)E.push(re[W])}return E}_getJoinedRanges(w,S,E,O,D){let N=w.substring(S,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 se=this._characterJoiners[L].handler(N);for(let re=0;re<se.length;re++)cj._mergeRanges(P,se[re])}catch(se){console.error(se)}return this._stringRangesToCellRanges(P,O,D),P}_stringRangesToCellRanges(w,S,E){let O=0,D=!1,N=0,P=w[O];if(P){for(let L=E;L<this._bufferService.cols;L++){let se=S.getWidth(L),re=S.getString(L).length||h.WHITESPACE_CELL_CHAR.length;if(se!==0){if(!D&&P[0]<=N&&(P[0]=L,D=!0),P[1]<=N){if(P[1]=L,P=w[++O],!P)break;P[0]<=N?(P[0]=L,D=!0):D=!1}N+=re}}P&&(P[1]=this._bufferService.cols)}}static _mergeRanges(w,S){let E=!1;for(let O=0;O<w.length;O++){let D=w[O];if(E){if(S[1]<=D[0])return w[O-1][1]=S[1],w;if(S[1]<=D[1])return w[O-1][1]=Math.max(S[1],D[1]),w.splice(O,1),w;w.splice(O,1),O--}else{if(S[1]<=D[0])return w.splice(O,0,S),w;if(S[1]<=D[1])return D[0]=Math.min(S[0],D[0]),w;S[0]<D[1]&&(D[0]=Math.min(S[0],D[0]),E=!0)}}return E?w[w.length-1][1]=S[1]:w.push(S),w}};r.CharacterJoinerService=x=c([p(0,y.IBufferService)],x)},5114:(i,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(b,x,M){super(),this._textarea=b,this._window=x,this.mainDocument=M,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new g(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(b){this._window!==b&&(this._window=b,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 g extends c.Disposable{constructor(b){super(),this._parentWindow=b,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(b){this._parentWindow=b,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:(i,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 g=this.linkProviders.indexOf(h);g!==-1&&this.linkProviders.splice(g,1)}}}}r.LinkProviderService=p},8934:function(i,r,a){var c=this&&this.__decorate||function(y,b,x,M){var w,S=arguments.length,E=S<3?b:M===null?M=Object.getOwnPropertyDescriptor(b,x):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(y,b,x,M);else for(var O=y.length-1;O>=0;O--)(w=y[O])&&(E=(S<3?w(E):S>3?w(b,x,E):w(b,x))||E);return S>3&&E&&Object.defineProperty(b,x,E),E},p=this&&this.__param||function(y,b){return function(x,M){b(x,M,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;let u=a(4725),h=a(9806),g=r.MouseService=class{constructor(y,b){this._renderService=y,this._charSizeService=b}getCoords(y,b,x,M,w){return(0,h.getCoords)(window,y,b,x,M,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,w)}getMouseReportCoords(y,b){let x=(0,h.getCoordsRelativeToElement)(window,y,b);if(this._charSizeService.hasValidSize)return x[0]=Math.min(Math.max(x[0],0),this._renderService.dimensions.css.canvas.width-1),x[1]=Math.min(Math.max(x[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(x[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(x[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(x[0]),y:Math.floor(x[1])}}};r.MouseService=g=c([p(0,u.IRenderService),p(1,u.ICharSizeService)],g)},3230:function(i,r,a){var c=this&&this.__decorate||function(w,S,E,O){var D,N=arguments.length,P=N<3?S:O===null?O=Object.getOwnPropertyDescriptor(S,E):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(w,S,E,O);else for(var L=w.length-1;L>=0;L--)(D=w[L])&&(P=(N<3?D(P):N>3?D(S,E,P):D(S,E))||P);return N>3&&P&&Object.defineProperty(S,E,P),P},p=this&&this.__param||function(w,S){return function(E,O){S(E,O,w)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;let u=a(6193),h=a(4725),g=a(8460),y=a(844),b=a(7226),x=a(2585),M=r.RenderService=class extends y.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(w,S,E,O,D,N,P,L){super(),this._rowCount=w,this._charSizeService=O,this._renderer=this.register(new y.MutableDisposable),this._pausedResizeTask=new b.DebouncedIdleTask,this._observerDisposable=this.register(new y.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 g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer((se,re)=>this._renderRows(se,re),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,S),this.register(P.onWindowChange(se=>this._registerIntersectionObserver(se,S)))}_registerIntersectionObserver(w,S){if("IntersectionObserver"in w){let E=new w.IntersectionObserver(O=>this._handleIntersectionChange(O[O.length-1]),{threshold:0});E.observe(S),this._observerDisposable.value=(0,y.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,S,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(w,S,this._rowCount))}_renderRows(w,S){this._renderer.value&&(w=Math.min(w,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(w,S),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:S}),this._onRender.fire({start:w,end:S}),this._isNextRenderRedrawOnly=!0)}resize(w,S){this._rowCount=S,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(S=>this.refreshRows(S.start,S.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,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(w,S)):this._renderer.value.handleResize(w,S),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(w,S,E){this._selectionState.start=w,this._selectionState.end=S,this._selectionState.columnSelectMode=E,this._renderer.value?.handleSelectionChanged(w,S,E)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};r.RenderService=M=c([p(2,x.IOptionsService),p(3,h.ICharSizeService),p(4,x.IDecorationService),p(5,x.IBufferService),p(6,h.ICoreBrowserService),p(7,h.IThemeService)],M)},9312:function(i,r,a){var c=this&&this.__decorate||function(P,L,se,re){var W,$=arguments.length,ue=$<3?L:re===null?re=Object.getOwnPropertyDescriptor(L,se):re;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ue=Reflect.decorate(P,L,se,re);else for(var be=P.length-1;be>=0;be--)(W=P[be])&&(ue=($<3?W(ue):$>3?W(L,se,ue):W(L,se))||ue);return $>3&&ue&&Object.defineProperty(L,se,ue),ue},p=this&&this.__param||function(P,L){return function(se,re){L(se,re,P)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;let u=a(9806),h=a(9504),g=a(456),y=a(4725),b=a(8460),x=a(844),M=a(6114),w=a(4841),S=a(511),E=a(2585),O="\xA0",D=new RegExp(O,"g"),N=r.SelectionService=class extends x.Disposable{constructor(P,L,se,re,W,$,ue,be,me){super(),this._element=P,this._screenElement=L,this._linkifier=se,this._bufferService=re,this._coreService=W,this._mouseService=$,this._optionsService=ue,this._renderService=be,this._coreBrowserService=me,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new S.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new b.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new b.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new b.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Pe=>this._handleMouseMove(Pe),this._mouseUpListener=Pe=>this._handleMouseUp(Pe),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(Pe=>this._handleTrim(Pe)),this.register(this._bufferService.buffers.onBufferActivate(Pe=>this._handleBufferActivate(Pe))),this.enable(),this._model=new g.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,x.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 se=this._bufferService.buffer,re=[];if(this._activeSelectionMode===3){if(P[0]===L[0])return"";let W=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=se.translateBufferLineToString(ue,!0,W,$);re.push(be)}}else{let W=P[1]===L[1]?L[0]:void 0;re.push(se.translateBufferLineToString(P[1],!0,P[0],W));for(let $=P[1]+1;$<=L[1]-1;$++){let ue=se.lines.get($),be=se.translateBufferLineToString($,!0);ue?.isWrapped?re[re.length-1]+=be:re.push(be)}if(P[1]!==L[1]){let $=se.lines.get(L[1]),ue=se.translateBufferLineToString(L[1],!0,0,L[0]);$&&$.isWrapped?re[re.length-1]+=ue:re.push(ue)}}return re.map(W=>W.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),se=this._model.finalSelectionStart,re=this._model.finalSelectionEnd;return!!(se&&re&&L)&&this._areCoordsInSelection(L,se,re)}isCellInSelection(P,L){let se=this._model.finalSelectionStart,re=this._model.finalSelectionEnd;return!(!se||!re)&&this._areCoordsInSelection([P,L],se,re)}_areCoordsInSelection(P,L,se){return P[1]>L[1]&&P[1]<se[1]||L[1]===se[1]&&P[1]===L[1]&&P[0]>=L[0]&&P[0]<se[0]||L[1]<se[1]&&P[1]===se[1]&&P[0]<se[0]||L[1]<se[1]&&P[1]===L[1]&&P[0]>=L[0]}_selectWordAtCursor(P,L){let se=this._linkifier.currentLink?.link?.range;if(se)return this._model.selectionStart=[se.start.x-1,se.start.y-1],this._model.selectionStartLength=(0,w.getRangeLength)(se,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let re=this._getMouseBufferCoords(P);return!!re&&(this._selectWordAt(re,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],se=this._renderService.dimensions.css.canvas.height;return L>=0&&L<=se?0:(L>se&&(L-=se),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 se=this._bufferService.buffer;if(this._model.selectionEnd[1]<se.lines.length){let re=se.lines.get(this._model.selectionEnd[1]);re&&re.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 se=this._mouseService.getCoords(P,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(se&&se[0]!==void 0&&se[1]!==void 0){let re=(0,h.moveToCellSequence)(se[0]-1,se[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(re,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let P=this._model.finalSelectionStart,L=this._model.finalSelectionEnd,se=!(!P||!L||P[0]===L[0]&&P[1]===L[1]);se?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,se)):this._oldHasSelection&&this._fireOnSelectionChange(P,L,se)}_fireOnSelectionChange(P,L,se){this._oldSelectionStart=P,this._oldSelectionEnd=L,this._oldHasSelection=se,this._onSelectionChange.fire()}_handleBufferActivate(P){this.clearSelection(),this._trimListener.dispose(),this._trimListener=P.activeBuffer.lines.onTrim(L=>this._handleTrim(L))}_convertViewportColToCharacterIndex(P,L){let se=L;for(let re=0;L>=re;re++){let W=P.loadCell(re,this._workCell).getChars().length;this._workCell.getWidth()===0?se--:W>1&&L!==re&&(se+=W-1)}return se}setSelection(P,L,se){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[P,L],this._model.selectionStartLength=se,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(P){this._isClickInSelection(P)||(this._selectWordAtCursor(P,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(P,L,se=!0,re=!0){if(P[0]>=this._bufferService.cols)return;let W=this._bufferService.buffer,$=W.lines.get(P[1]);if(!$)return;let ue=W.translateBufferLineToString(P[1],!1),be=this._convertViewportColToCharacterIndex($,P[0]),me=be,Pe=P[0]-be,he=0,j=0,J=0,le=0;if(ue.charAt(be)===" "){for(;be>0&&ue.charAt(be-1)===" ";)be--;for(;me<ue.length&&ue.charAt(me+1)===" ";)me++}else{let He=P[0],et=P[0];$.getWidth(He)===0&&(he++,He--),$.getWidth(et)===2&&(j++,et++);let Ze=$.getString(et).length;for(Ze>1&&(le+=Ze-1,me+=Ze-1);He>0&&be>0&&!this._isCharWordSeparator($.loadCell(He-1,this._workCell));){$.loadCell(He-1,this._workCell);let ye=this._workCell.getChars().length;this._workCell.getWidth()===0?(he++,He--):ye>1&&(J+=ye-1,be-=ye-1),be--,He--}for(;et<$.length&&me+1<ue.length&&!this._isCharWordSeparator($.loadCell(et+1,this._workCell));){$.loadCell(et+1,this._workCell);let ye=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,et++):ye>1&&(le+=ye-1,me+=ye-1),me++,et++}}me++;let ce=be+Pe-he+J,De=Math.min(this._bufferService.cols,me-be+he+j-J-le);if(L||ue.slice(be,me).trim()!==""){if(se&&ce===0&&$.getCodePoint(0)!==32){let He=W.lines.get(P[1]-1);if(He&&$.isWrapped&&He.getCodePoint(this._bufferService.cols-1)!==32){let et=this._getWordAt([this._bufferService.cols-1,P[1]-1],!1,!0,!1);if(et){let Ze=this._bufferService.cols-et.start;ce-=Ze,De+=Ze}}}if(re&&ce+De===this._bufferService.cols&&$.getCodePoint(this._bufferService.cols-1)!==32){let He=W.lines.get(P[1]+1);if(He?.isWrapped&&He.getCodePoint(0)!==32){let et=this._getWordAt([0,P[1]+1],!1,!1,!0);et&&(De+=et.length)}}return{start:ce,length:De}}}_selectWordAt(P,L){let se=this._getWordAt(P,L);if(se){for(;se.start<0;)se.start+=this._bufferService.cols,P[1]--;this._model.selectionStart=[se.start,P[1]],this._model.selectionStartLength=se.length}}_selectToWordAt(P){let L=this._getWordAt(P,!0);if(L){let se=P[1];for(;L.start<0;)L.start+=this._bufferService.cols,se--;if(!this._model.areSelectionValuesReversed())for(;L.start+L.length>this._bufferService.cols;)L.length-=this._bufferService.cols,se++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?L.start:L.start+L.length,se]}}_isCharWordSeparator(P){return P.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(P.getChars())>=0}_selectLineAt(P){let L=this._bufferService.buffer.getWrappedRangeForLine(P),se={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)(se,this._bufferService.cols)}};r.SelectionService=N=c([p(3,E.IBufferService),p(4,E.ICoreService),p(5,y.IMouseService),p(6,E.IOptionsService),p(7,y.IRenderService),p(8,y.ICoreBrowserService)],N)},4725:(i,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(i,r,a){var c=this&&this.__decorate||function(N,P,L,se){var re,W=arguments.length,$=W<3?P:se===null?se=Object.getOwnPropertyDescriptor(P,L):se;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(N,P,L,se);else for(var ue=N.length-1;ue>=0;ue--)(re=N[ue])&&($=(W<3?re($):W>3?re(P,L,$):re(P,L))||$);return W>3&&$&&Object.defineProperty(P,L,$),$},p=this&&this.__param||function(N,P){return function(L,se){P(L,se,N)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;let u=a(7239),h=a(8055),g=a(8460),y=a(844),b=a(2585),x=h.css.toColor("#ffffff"),M=h.css.toColor("#000000"),w=h.css.toColor("#ffffff"),S=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 se=P[L/36%6|0],re=P[L/6%6|0],W=P[L%6];N.push({css:h.channels.toCss(se,re,W),rgba:h.channels.toRgba(se,re,W)})}for(let L=0;L<24;L++){let se=8+10*L;N.push({css:h.channels.toCss(se,se,se),rgba:h.channels.toRgba(se,se,se)})}return N})());let O=r.ThemeService=class extends y.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 g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:x,background:M,cursor:w,cursorAccent:S,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,x),P.background=D(N.background,M),P.cursor=D(N.cursor,w),P.cursorAccent=D(N.cursorAccent,S),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 se=0;se<L;se++)P.ansi[se+16]=D(N.extendedAnsi[se],r.DEFAULT_ANSI_COLORS[se+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=O=c([p(0,b.IOptionsService)],O)},6349:(i,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(g){super(),this._maxLength=g,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(g){if(this._maxLength===g)return;let y=new Array(g);for(let b=0;b<Math.min(g,this.length);b++)y[b]=this._array[this._getCyclicIndex(b)];this._array=y,this._maxLength=g,this._startIndex=0}get length(){return this._length}set length(g){if(g>this._length)for(let y=this._length;y<g;y++)this._array[y]=void 0;this._length=g}get(g){return this._array[this._getCyclicIndex(g)]}set(g,y){this._array[this._getCyclicIndex(g)]=y}push(g){this._array[this._getCyclicIndex(this._length)]=g,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(g,y,...b){if(y){for(let x=g;x<this._length-y;x++)this._array[this._getCyclicIndex(x)]=this._array[this._getCyclicIndex(x+y)];this._length-=y,this.onDeleteEmitter.fire({index:g,amount:y})}for(let x=this._length-1;x>=g;x--)this._array[this._getCyclicIndex(x+b.length)]=this._array[this._getCyclicIndex(x)];for(let x=0;x<b.length;x++)this._array[this._getCyclicIndex(g+x)]=b[x];if(b.length&&this.onInsertEmitter.fire({index:g,amount:b.length}),this._length+b.length>this._maxLength){let x=this._length+b.length-this._maxLength;this._startIndex+=x,this._length=this._maxLength,this.onTrimEmitter.fire(x)}else this._length+=b.length}trimStart(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,y,b){if(!(y<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+b<0)throw new Error("Cannot shift elements in list beyond index 0");if(b>0){for(let M=y-1;M>=0;M--)this.set(g+M+b,this.get(g+M));let x=g+y+b-this._length;if(x>0)for(this._length+=x;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let x=0;x<y;x++)this.set(g+x+b,this.get(g+x))}}_getCyclicIndex(g){return(this._startIndex+g)%this._maxLength}}r.CircularList=u},1439:(i,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:(i,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,g,y,b,x;function M(S){let E=S.toString(16);return E.length<2?"0"+E:E}function w(S,E){return S<E?(E+.05)/(S+.05):(S+.05)/(E+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(S){S.toCss=function(E,O,D,N){return N!==void 0?`#${M(E)}${M(O)}${M(D)}${M(N)}`:`#${M(E)}${M(O)}${M(D)}`},S.toRgba=function(E,O,D,N=255){return(E<<24|O<<16|D<<8|N)>>>0},S.toColor=function(E,O,D,N){return{css:S.toCss(E,O,D,N),rgba:S.toRgba(E,O,D,N)}}})(h||(r.channels=h={})),(function(S){function E(O,D){return u=Math.round(255*D),[a,c,p]=x.toChannels(O.rgba),{css:h.toCss(a,c,p,u),rgba:h.toRgba(a,c,p,u)}}S.blend=function(O,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,se=O.rgba>>24&255,re=O.rgba>>16&255,W=O.rgba>>8&255;return a=se+Math.round((N-se)*u),c=re+Math.round((P-re)*u),p=W+Math.round((L-W)*u),{css:h.toCss(a,c,p),rgba:h.toRgba(a,c,p)}},S.isOpaque=function(O){return(255&O.rgba)==255},S.ensureContrastRatio=function(O,D,N){let P=x.ensureContrastRatio(O.rgba,D.rgba,N);if(P)return h.toColor(P>>24&255,P>>16&255,P>>8&255)},S.opaque=function(O){let D=(255|O.rgba)>>>0;return[a,c,p]=x.toChannels(D),{css:h.toCss(a,c,p),rgba:D}},S.opacity=E,S.multiplyOpacity=function(O,D){return u=255&O.rgba,E(O,u*D/255)},S.toColorRGB=function(O){return[O.rgba>>24&255,O.rgba>>16&255,O.rgba>>8&255]}})(g||(r.color=g={})),(function(S){let E,O;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",O=E.createLinearGradient(0,0,1,1))}catch{}S.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||!O)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=O,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}}})(y||(r.css=y={})),(function(S){function E(O,D,N){let P=O/255,L=D/255,se=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*(se<=.03928?se/12.92:Math.pow((se+.055)/1.055,2.4))}S.relativeLuminance=function(O){return E(O>>16&255,O>>8&255,255&O)},S.relativeLuminance2=E})(b||(r.rgb=b={})),(function(S){function E(D,N,P){let L=D>>24&255,se=D>>16&255,re=D>>8&255,W=N>>24&255,$=N>>16&255,ue=N>>8&255,be=w(b.relativeLuminance2(W,$,ue),b.relativeLuminance2(L,se,re));for(;be<P&&(W>0||$>0||ue>0);)W-=Math.max(0,Math.ceil(.1*W)),$-=Math.max(0,Math.ceil(.1*$)),ue-=Math.max(0,Math.ceil(.1*ue)),be=w(b.relativeLuminance2(W,$,ue),b.relativeLuminance2(L,se,re));return(W<<24|$<<16|ue<<8|255)>>>0}function O(D,N,P){let L=D>>24&255,se=D>>16&255,re=D>>8&255,W=N>>24&255,$=N>>16&255,ue=N>>8&255,be=w(b.relativeLuminance2(W,$,ue),b.relativeLuminance2(L,se,re));for(;be<P&&(W<255||$<255||ue<255);)W=Math.min(255,W+Math.ceil(.1*(255-W))),$=Math.min(255,$+Math.ceil(.1*(255-$))),ue=Math.min(255,ue+Math.ceil(.1*(255-ue))),be=w(b.relativeLuminance2(W,$,ue),b.relativeLuminance2(L,se,re));return(W<<24|$<<16|ue<<8|255)>>>0}S.blend=function(D,N){if(u=(255&N)/255,u===1)return N;let P=N>>24&255,L=N>>16&255,se=N>>8&255,re=D>>24&255,W=D>>16&255,$=D>>8&255;return a=re+Math.round((P-re)*u),c=W+Math.round((L-W)*u),p=$+Math.round((se-$)*u),h.toRgba(a,c,p)},S.ensureContrastRatio=function(D,N,P){let L=b.relativeLuminance(D>>8),se=b.relativeLuminance(N>>8);if(w(L,se)<P){if(se<L){let $=E(D,N,P),ue=w(L,b.relativeLuminance($>>8));if(ue<P){let be=O(D,N,P);return ue>w(L,b.relativeLuminance(be>>8))?$:be}return $}let re=O(D,N,P),W=w(L,b.relativeLuminance(re>>8));if(W<P){let $=E(D,N,P);return W>w(L,b.relativeLuminance($>>8))?re:$}return re}},S.reduceLuminance=E,S.increaseLuminance=O,S.toChannels=function(D){return[D>>24&255,D>>16&255,D>>8&255,255&D]}})(x||(r.rgba=x={})),r.toPaddedHex=M,r.contrastRatio=w},8969:(i,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),g=a(744),y=a(7302),b=a(6975),x=a(8460),M=a(1753),w=a(1480),S=a(7994),E=a(9282),O=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 x.EventEmitter),this._onScroll.event(re=>{this._onScrollApi?.fire(re.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(re){for(let W in re)this.optionsService.options[W]=re[W]}constructor(re){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new x.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new x.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new x.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new x.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new x.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new x.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new y.OptionsService(re)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.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(b.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(S.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 O.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,x.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,x.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,x.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,x.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(W=>{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(W=>{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((W,$)=>this._inputHandler.parse(W,$))),this.register((0,x.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(re,W){this._writeBuffer.write(re,W)}writeSync(re,W){this._logService.logLevel<=p.LogLevelEnum.WARN&&!P&&(this._logService.warn("writeSync is unreliable and will be removed soon."),P=!0),this._writeBuffer.writeSync(re,W)}input(re,W=!0){this.coreService.triggerDataEvent(re,W)}resize(re,W){isNaN(re)||isNaN(W)||(re=Math.max(re,g.MINIMUM_COLS),W=Math.max(W,g.MINIMUM_ROWS),this._bufferService.resize(re,W))}scroll(re,W=!1){this._bufferService.scroll(re,W)}scrollLines(re,W,$){this._bufferService.scrollLines(re,W,$)}scrollPages(re){this.scrollLines(re*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(re){let W=re-this._bufferService.buffer.ydisp;W!==0&&this.scrollLines(W)}registerEscHandler(re,W){return this._inputHandler.registerEscHandler(re,W)}registerDcsHandler(re,W){return this._inputHandler.registerDcsHandler(re,W)}registerCsiHandler(re,W){return this._inputHandler.registerCsiHandler(re,W)}registerOscHandler(re,W){return this._inputHandler.registerOscHandler(re,W)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let re=!1,W=this.optionsService.rawOptions.windowsPty;W&&W.buildNumber!==void 0&&W.buildNumber!==void 0?re=W.backend==="conpty"&&W.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(re=!0),re?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let re=[];re.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),re.push(this.registerCsiHandler({final:"H"},()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(let W of re)W.dispose()})}}}r.CoreTerminal=L},8460:(i,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(i,r,a){var c=this&&this.__decorate||function(he,j,J,le){var ce,De=arguments.length,He=De<3?j:le===null?le=Object.getOwnPropertyDescriptor(j,J):le;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")He=Reflect.decorate(he,j,J,le);else for(var et=he.length-1;et>=0;et--)(ce=he[et])&&(He=(De<3?ce(He):De>3?ce(j,J,He):ce(j,J))||He);return De>3&&He&&Object.defineProperty(j,J,He),He},p=this&&this.__param||function(he,j){return function(J,le){j(J,le,he)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;let u=a(2584),h=a(7116),g=a(2015),y=a(844),b=a(482),x=a(8437),M=a(8460),w=a(643),S=a(511),E=a(3734),O=a(2585),D=a(1480),N=a(6242),P=a(6351),L=a(5941),se={"(":0,")":1,"*":2,"+":3,"-":1,".":2},re=131072;function W(he,j){if(he>24)return j.setWinLines||!1;switch(he){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.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 y.Disposable{getAttrData(){return this._curAttrData}constructor(j,J,le,ce,De,He,et,Ze,ye=new g.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=J,this._coreService=le,this._logService=ce,this._optionsService=De,this._oscLinkService=He,this._coreMouseService=et,this._unicodeService=Ze,this._parser=ye,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new b.StringToUtf32,this._utf8Decoder=new b.Utf8ToUtf32,this._workCell=new S.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=x.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=x.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,Ne)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:Ne.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,Ne,Qe)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:Ne,data:Qe})}),this._parser.setDcsHandlerFallback((q,Ne,Qe)=>{Ne==="HOOK"&&(Qe=Qe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:Ne,payload:Qe})}),this._parser.setPrintHandler((q,Ne,Qe)=>this.print(q,Ne,Qe)),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,Ne)=>this.requestStatusString(q,Ne)))}_preserveStack(j,J,le,ce){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=J,this._parseStack.decodedLength=le,this._parseStack.position=ce}_logSlowResolvingAsync(j){this._logService.logLevel<=O.LogLevelEnum.WARN&&Promise.race([j,new Promise((J,le)=>setTimeout(()=>le("#SLOW_TIMEOUT"),5e3))]).catch(J=>{if(J!=="#SLOW_TIMEOUT")throw J;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,J){let le,ce=this._activeBuffer.x,De=this._activeBuffer.y,He=0,et=this._parseStack.paused;if(et){if(le=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,J))return this._logSlowResolvingAsync(le),le;ce=this._parseStack.cursorStartX,De=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>re&&(He=this._parseStack.position+re)}if(this._logService.logLevel<=O.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,q=>String.fromCharCode(q)).join("")}"`),typeof j=="string"?j.split("").map(q=>q.charCodeAt(0)):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<re&&(this._parseBuffer=new Uint32Array(Math.min(j.length,re))),et||this._dirtyRowTracker.clearRange(),j.length>re)for(let q=He;q<j.length;q+=re){let Ne=q+re<j.length?q+re:j.length,Qe=typeof j=="string"?this._stringDecoder.decode(j.substring(q,Ne),this._parseBuffer):this._utf8Decoder.decode(j.subarray(q,Ne),this._parseBuffer);if(le=this._parser.parse(this._parseBuffer,Qe))return this._preserveStack(ce,De,Qe,q),this._logSlowResolvingAsync(le),le}else if(!et){let q=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(le=this._parser.parse(this._parseBuffer,q))return this._preserveStack(ce,De,q,0),this._logSlowResolvingAsync(le),le}this._activeBuffer.x===ce&&this._activeBuffer.y===De||this._onCursorMove.fire();let Ze=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(Ze,this._bufferService.rows-1))}print(j,J,le){let ce,De,He=this._charsetService.charset,et=this._optionsService.rawOptions.screenReaderMode,Ze=this._bufferService.cols,ye=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,Ne=this._curAttrData,Qe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&le-J>0&&Qe.getWidth(this._activeBuffer.x-1)===2&&Qe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,Ne);let ct=this._parser.precedingJoinState;for(let At=J;At<le;++At){if(ce=j[At],ce<127&&He){let Wr=He[String.fromCharCode(ce)];Wr&&(ce=Wr.charCodeAt(0))}let Yn=this._unicodeService.charProperties(ce,ct);De=D.UnicodeService.extractWidth(Yn);let Oo=D.UnicodeService.extractShouldJoin(Yn),vo=Oo?D.UnicodeService.extractWidth(ct):0;if(ct=Yn,et&&this._onA11yChar.fire((0,b.stringFromCodePoint)(ce)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+De-vo>Ze){if(ye){let Wr=Qe,Rn=this._activeBuffer.x-vo;for(this._activeBuffer.x=vo,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),Qe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),vo>0&&Qe instanceof x.BufferLine&&Qe.copyCellsFrom(Wr,Rn,0,vo,!1);Rn<Ze;)Wr.setCellFromCodepoint(Rn++,0,1,Ne)}else if(this._activeBuffer.x=Ze-1,De===2)continue}if(Oo&&this._activeBuffer.x){let Wr=Qe.getWidth(this._activeBuffer.x-1)?1:2;Qe.addCodepointToCell(this._activeBuffer.x-Wr,ce,De);for(let Rn=De-vo;--Rn>=0;)Qe.setCellFromCodepoint(this._activeBuffer.x++,0,0,Ne)}else if(q&&(Qe.insertCells(this._activeBuffer.x,De-vo,this._activeBuffer.getNullCell(Ne)),Qe.getWidth(Ze-1)===2&&Qe.setCellFromCodepoint(Ze-1,w.NULL_CELL_CODE,w.NULL_CELL_WIDTH,Ne)),Qe.setCellFromCodepoint(this._activeBuffer.x++,ce,De,Ne),De>0)for(;--De;)Qe.setCellFromCodepoint(this._activeBuffer.x++,0,0,Ne)}this._parser.precedingJoinState=ct,this._activeBuffer.x<Ze&&le-J>0&&Qe.getWidth(this._activeBuffer.x)===0&&!Qe.hasContent(this._activeBuffer.x)&&Qe.setCellFromCodepoint(this._activeBuffer.x,0,1,Ne),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,J){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,J):this._parser.registerCsiHandler(j,le=>!W(le.params[0],this._optionsService.rawOptions.windowOptions)||J(le))}registerDcsHandler(j,J){return this._parser.registerDcsHandler(j,new P.DcsHandler(J))}registerEscHandler(j,J){return this._parser.registerEscHandler(j,J)}registerOscHandler(j,J){return this._parser.registerOscHandler(j,new N.OscHandler(J))}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 j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);j.hasWidth(this._activeBuffer.x)&&!j.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,J){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+J):(this._activeBuffer.x=j,this._activeBuffer.y=J),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,J){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+J)}cursorUp(j){let J=this._activeBuffer.y-this._activeBuffer.scrollTop;return J>=0?this._moveCursor(0,-Math.min(J,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){let J=this._activeBuffer.scrollBottom-this._activeBuffer.y;return J>=0?this._moveCursor(0,Math.min(J,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){let J=j.params[0];return J===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:J===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let J=j.params[0]||1;for(;J--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let J=j.params[0]||1;for(;J--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){let J=j.params[0];return J===1&&(this._curAttrData.bg|=536870912),J!==2&&J!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,J,le,ce=!1,De=!1){let He=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);He.replaceCells(J,le,this._activeBuffer.getNullCell(this._eraseAttrData()),De),ce&&(He.isWrapped=!1)}_resetBufferLine(j,J=!1){let le=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);le&&(le.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),J),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),le.isWrapped=!1)}eraseInDisplay(j,J=!1){let le;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(le=this._activeBuffer.y,this._dirtyRowTracker.markDirty(le),this._eraseInBufferLine(le++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,J);le<this._bufferService.rows;le++)this._resetBufferLine(le,J);this._dirtyRowTracker.markDirty(le);break;case 1:for(le=this._activeBuffer.y,this._dirtyRowTracker.markDirty(le),this._eraseInBufferLine(le,0,this._activeBuffer.x+1,!0,J),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(le+1).isWrapped=!1);le--;)this._resetBufferLine(le,J);this._dirtyRowTracker.markDirty(0);break;case 2:for(le=this._bufferService.rows,this._dirtyRowTracker.markDirty(le-1);le--;)this._resetBufferLine(le,J);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(j,J=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,J);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,J);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,J)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let J=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let le=this._activeBuffer.ybase+this._activeBuffer.y,ce=this._bufferService.rows-1-this._activeBuffer.scrollBottom,De=this._bufferService.rows-1+this._activeBuffer.ybase-ce+1;for(;J--;)this._activeBuffer.lines.splice(De-1,1),this._activeBuffer.lines.splice(le,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(j){this._restrictCursor();let J=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let le=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;J--;)this._activeBuffer.lines.splice(le,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(j){this._restrictCursor();let J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return J&&(J.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();let J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return J&&(J.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let J=j.params[0]||1;for(;J--;)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(j){let J=j.params[0]||1;for(;J--;)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(x.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let J=j.params[0]||1;for(let le=this._activeBuffer.scrollTop;le<=this._activeBuffer.scrollBottom;++le){let ce=this._activeBuffer.lines.get(this._activeBuffer.ybase+le);ce.deleteCells(0,J,this._activeBuffer.getNullCell(this._eraseAttrData())),ce.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let J=j.params[0]||1;for(let le=this._activeBuffer.scrollTop;le<=this._activeBuffer.scrollBottom;++le){let ce=this._activeBuffer.lines.get(this._activeBuffer.ybase+le);ce.insertCells(0,J,this._activeBuffer.getNullCell(this._eraseAttrData())),ce.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let J=j.params[0]||1;for(let le=this._activeBuffer.scrollTop;le<=this._activeBuffer.scrollBottom;++le){let ce=this._activeBuffer.lines.get(this._activeBuffer.ybase+le);ce.insertCells(this._activeBuffer.x,J,this._activeBuffer.getNullCell(this._eraseAttrData())),ce.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let J=j.params[0]||1;for(let le=this._activeBuffer.scrollTop;le<=this._activeBuffer.scrollBottom;++le){let ce=this._activeBuffer.lines.get(this._activeBuffer.ybase+le);ce.deleteCells(this._activeBuffer.x,J,this._activeBuffer.getNullCell(this._eraseAttrData())),ce.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();let J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return J&&(J.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){let J=this._parser.precedingJoinState;if(!J)return!0;let le=j.params[0]||1,ce=D.UnicodeService.extractWidth(J),De=this._activeBuffer.x-ce,He=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(De),et=new Uint32Array(He.length*le),Ze=0;for(let q=0;q<He.length;){let Ne=He.codePointAt(q)||0;et[Ze++]=Ne,q+=Ne>65535?2:1}let ye=Ze;for(let q=1;q<le;++q)et.copyWithin(ye,0,Ze),ye+=Ze;return this.print(et,0,ye),!0}sendDeviceAttributesPrimary(j){return j.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(j){return j.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(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let J=0;J<j.length;J++)switch(j.params[J]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let J=0;J<j.length;J++)switch(j.params[J]){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(j){for(let J=0;J<j.length;J++)switch(j.params[J]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let J=0;J<j.length;J++)switch(j.params[J]){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(),j.params[J]===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(j,J){let le=this._coreService.decPrivateModes,{activeProtocol:ce,activeEncoding:De}=this._coreMouseService,He=this._coreService,{buffers:et,cols:Ze}=this._bufferService,{active:ye,alt:q}=et,Ne=this._optionsService.rawOptions,Qe=Oo=>Oo?1:2,ct=j.params[0];return At=ct,Yn=J?ct===2?4:ct===4?Qe(He.modes.insertMode):ct===12?3:ct===20?Qe(Ne.convertEol):0:ct===1?Qe(le.applicationCursorKeys):ct===3?Ne.windowOptions.setWinLines?Ze===80?2:Ze===132?1:0:0:ct===6?Qe(le.origin):ct===7?Qe(le.wraparound):ct===8?3:ct===9?Qe(ce==="X10"):ct===12?Qe(Ne.cursorBlink):ct===25?Qe(!He.isCursorHidden):ct===45?Qe(le.reverseWraparound):ct===66?Qe(le.applicationKeypad):ct===67?4:ct===1e3?Qe(ce==="VT200"):ct===1002?Qe(ce==="DRAG"):ct===1003?Qe(ce==="ANY"):ct===1004?Qe(le.sendFocus):ct===1005?4:ct===1006?Qe(De==="SGR"):ct===1015?4:ct===1016?Qe(De==="SGR_PIXELS"):ct===1048?1:ct===47||ct===1047||ct===1049?Qe(ye===q):ct===2004?Qe(le.bracketedPasteMode):0,He.triggerDataEvent(`${u.C0.ESC}[${J?"":"?"}${At};${Yn}$y`),!0;var At,Yn}_updateAttrColor(j,J,le,ce,De){return J===2?(j|=50331648,j&=-16777216,j|=E.AttributeData.fromColorRGB([le,ce,De])):J===5&&(j&=-50331904,j|=33554432|255&le),j}_extractColor(j,J,le){let ce=[0,0,-1,0,0,0],De=0,He=0;do{if(ce[He+De]=j.params[J+He],j.hasSubParams(J+He)){let et=j.getSubParams(J+He),Ze=0;do ce[1]===5&&(De=1),ce[He+Ze+1+De]=et[Ze];while(++Ze<et.length&&Ze+He+1+De<ce.length);break}if(ce[1]===5&&He+De>=2||ce[1]===2&&He+De>=5)break;ce[1]&&(De=1)}while(++He+J<j.length&&He+De<ce.length);for(let et=2;et<ce.length;++et)ce[et]===-1&&(ce[et]=0);switch(ce[0]){case 38:le.fg=this._updateAttrColor(le.fg,ce[1],ce[3],ce[4],ce[5]);break;case 48:le.bg=this._updateAttrColor(le.bg,ce[1],ce[3],ce[4],ce[5]);break;case 58:le.extended=le.extended.clone(),le.extended.underlineColor=this._updateAttrColor(le.extended.underlineColor,ce[1],ce[3],ce[4],ce[5])}return He}_processUnderline(j,J){J.extended=J.extended.clone(),(!~j||j>5)&&(j=1),J.extended.underlineStyle=j,J.fg|=268435456,j===0&&(J.fg&=-268435457),J.updateExtended()}_processSGR0(j){j.fg=x.DEFAULT_ATTR_DATA.fg,j.bg=x.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;let J=j.length,le,ce=this._curAttrData;for(let De=0;De<J;De++)le=j.params[De],le>=30&&le<=37?(ce.fg&=-50331904,ce.fg|=16777216|le-30):le>=40&&le<=47?(ce.bg&=-50331904,ce.bg|=16777216|le-40):le>=90&&le<=97?(ce.fg&=-50331904,ce.fg|=16777224|le-90):le>=100&&le<=107?(ce.bg&=-50331904,ce.bg|=16777224|le-100):le===0?this._processSGR0(ce):le===1?ce.fg|=134217728:le===3?ce.bg|=67108864:le===4?(ce.fg|=268435456,this._processUnderline(j.hasSubParams(De)?j.getSubParams(De)[0]:1,ce)):le===5?ce.fg|=536870912:le===7?ce.fg|=67108864:le===8?ce.fg|=1073741824:le===9?ce.fg|=2147483648:le===2?ce.bg|=134217728:le===21?this._processUnderline(2,ce):le===22?(ce.fg&=-134217729,ce.bg&=-134217729):le===23?ce.bg&=-67108865:le===24?(ce.fg&=-268435457,this._processUnderline(0,ce)):le===25?ce.fg&=-536870913:le===27?ce.fg&=-67108865:le===28?ce.fg&=-1073741825:le===29?ce.fg&=2147483647:le===39?(ce.fg&=-67108864,ce.fg|=16777215&x.DEFAULT_ATTR_DATA.fg):le===49?(ce.bg&=-67108864,ce.bg|=16777215&x.DEFAULT_ATTR_DATA.bg):le===38||le===48||le===58?De+=this._extractColor(j,De,ce):le===53?ce.bg|=1073741824:le===55?ce.bg&=-1073741825:le===59?(ce.extended=ce.extended.clone(),ce.extended.underlineColor=-1,ce.updateExtended()):le===100?(ce.fg&=-67108864,ce.fg|=16777215&x.DEFAULT_ATTR_DATA.fg,ce.bg&=-67108864,ce.bg|=16777215&x.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",le);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:let J=this._activeBuffer.y+1,le=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${J};${le}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){let J=this._activeBuffer.y+1,le=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${J};${le}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=x.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(j){let J=j.params[0]||1;switch(J){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 le=J%2==1;return this._optionsService.options.cursorBlink=le,!0}setScrollRegion(j){let J=j.params[0]||1,le;return(j.length<2||(le=j.params[1])>this._bufferService.rows||le===0)&&(le=this._bufferService.rows),le>J&&(this._activeBuffer.scrollTop=J-1,this._activeBuffer.scrollBottom=le-1,this._setCursor(0,0)),!0}windowOptions(j){if(!W(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;let J=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:J!==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:J!==0&&J!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),J!==0&&J!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:J!==0&&J!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),J!==0&&J!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){let J=[],le=j.split(";");for(;le.length>1;){let ce=le.shift(),De=le.shift();if(/^\d+$/.exec(ce)){let He=parseInt(ce);if(Pe(He))if(De==="?")J.push({type:0,index:He});else{let et=(0,L.parseColor)(De);et&&J.push({type:1,index:He,color:et})}}}return J.length&&this._onColor.fire(J),!0}setHyperlink(j){let J=j.split(";");return!(J.length<2)&&(J[1]?this._createHyperlink(J[0],J[1]):!J[0]&&this._finishHyperlink())}_createHyperlink(j,J){this._getCurrentLinkId()&&this._finishHyperlink();let le=j.split(":"),ce,De=le.findIndex(He=>He.startsWith("id="));return De!==-1&&(ce=le[De].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:ce,uri:J}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,J){let le=j.split(";");for(let ce=0;ce<le.length&&!(J>=this._specialColors.length);++ce,++J)if(le[ce]==="?")this._onColor.fire([{type:0,index:this._specialColors[J]}]);else{let De=(0,L.parseColor)(le[ce]);De&&this._onColor.fire([{type:1,index:this._specialColors[J],color:De}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;let J=[],le=j.split(";");for(let ce=0;ce<le.length;++ce)if(/^\d+$/.exec(le[ce])){let De=parseInt(le[ce]);Pe(De)&&J.push({type:2,index:De})}return J.length&&this._onColor.fire(J),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){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(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(se[j[0]],h.CHARSETS[j[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 j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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=x.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=x.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){let j=new S.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let J=0;J<this._bufferService.rows;++J){let le=this._activeBuffer.ybase+this._activeBuffer.y+J,ce=this._activeBuffer.lines.get(le);ce&&(ce.fill(j),ce.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,J){let le=this._bufferService.buffer,ce=this._optionsService.rawOptions;return(De=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${De}${u.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${le.scrollTop+1};${le.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[ce.cursorStyle]-(ce.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,J){this._dirtyRowTracker.markRangeDirty(j,J)}}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,j){he>j&&(ue=he,he=j,j=ue),he<this.start&&(this.start=he),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Pe(he){return 0<=he&&he<256}me=c([p(0,O.IBufferService)],me)},844:(i,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:(i,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,g){this._data.get(c,p)||this._data.set(c,p,new a),this._data.get(c,p).set(u,h,g)}get(c,p,u,h){return this._data.get(c,p)?.get(u,h)}clear(){this._data.clear()}}},6114:(i,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:(i,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,g=this._getKey(this._array[h]);if(g>c)u=h-1;else{if(!(g<c)){for(;h>0&&this._getKey(this._array[h-1])===c;)h--;return h}p=h+1}}return p}}},7226:(i,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(g){this._tasks.push(g),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(g){this._idleCallback=void 0;let y=0,b=0,x=g.timeRemaining(),M=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),b=Math.max(y,b),M=g.timeRemaining(),1.5*b>M)return x-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(x-y))}ms`),void this._start();x=M}this.clear()}}class u extends p{_requestCallback(g){return setTimeout(()=>g(this._createDeadline(16)))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){let y=Date.now()+g;return{timeRemaining:()=>Math.max(0,y-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:(i,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),g=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);g&&h&&(g.isWrapped=h[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&h[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(i,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:(i,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),g=a(4634),y=a(511),b=a(643),x=a(4863),M=a(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(w,S,E){this._hasScrollback=w,this._optionsService=S,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=y.CellData.fromCharData([0,b.NULL_CELL_CHAR,b.NULL_CELL_WIDTH,b.NULL_CELL_CODE]),this._whitespaceCell=y.CellData.fromCharData([0,b.WHITESPACE_CELL_CHAR,b.WHITESPACE_CELL_WIDTH,b.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,S){return new h.BufferLine(this._bufferService.cols,this.getNullCell(w),S)}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 S=w+this._optionsService.rawOptions.scrollback;return S>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:S}fillViewportRows(w){if(this.lines.length===0){w===void 0&&(w=h.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)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,S){let E=this.getNullCell(h.DEFAULT_ATTR_DATA),O=0,D=this._getCorrectBufferLength(S);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++)O+=+this.lines.get(P).resize(w,E);let N=0;if(this._rows<S)for(let P=this._rows;P<S;P++)this.lines.length<S+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>S;P--)this.lines.length>S+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,S-1),N&&(this.y+=N),this.savedX=Math.min(this.savedX,w-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(w,S),this._cols>w))for(let N=0;N<this.lines.length;N++)O+=+this.lines.get(N).resize(w,E);this._cols=w,this._rows=S,this._memoryCleanupQueue.clear(),O>.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 S=0;for(;this._memoryCleanupPosition<this.lines.length;)if(S+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),S>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,S){this._cols!==w&&(w>this._cols?this._reflowLarger(w,S):this._reflowSmaller(w,S))}_reflowLarger(w,S){let E=(0,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,w,this.ybase+this.y,this.getNullCell(h.DEFAULT_ATTR_DATA));if(E.length>0){let O=(0,g.reflowLargerCreateNewLayout)(this.lines,E);(0,g.reflowLargerApplyNewLayout)(this.lines,O.layout),this._reflowLargerAdjustViewport(w,S,O.countRemoved)}}_reflowLargerAdjustViewport(w,S,E){let O=this.getNullCell(h.DEFAULT_ATTR_DATA),D=E;for(;D-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<S&&this.lines.push(new h.BufferLine(w,O))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(w,S){let E=this.getNullCell(h.DEFAULT_ATTR_DATA),O=[],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 se=this.ybase+this.y;if(se>=N&&se<N+L.length)continue;let re=L[L.length-1].getTrimmedLength(),W=(0,g.reflowSmallerGetNewLineLengths)(L,this._cols,w),$=W.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 le=0;le<$;le++){let ce=this.getBlankLine(h.DEFAULT_ATTR_DATA,!0);be.push(ce)}be.length>0&&(O.push({start:N+L.length+D,newLines:be}),D+=be.length),L.push(...be);let me=W.length-1,Pe=W[me];Pe===0&&(me--,Pe=W[me]);let he=L.length-$-1,j=re;for(;he>=0;){let le=Math.min(j,Pe);if(L[me]===void 0)break;if(L[me].copyCellsFrom(L[he],j-le,Pe-le,le,!0),Pe-=le,Pe===0&&(me--,Pe=W[me]),j-=le,j===0){he--;let ce=Math.max(he,0);j=(0,g.getWrappedLineTrimmedLength)(L,ce,this._cols)}}for(let le=0;le<L.length;le++)W[le]<w&&L[le].setCell(W[le],E);let J=$-ue;for(;J-- >0;)this.ybase===0?this.y<S-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+D)-S&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+$,this.ybase+S-1)}if(O.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,se=L-1,re=0,W=O[re];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(W&&W.start>se+$){for(let Pe=W.newLines.length-1;Pe>=0;Pe--)this.lines.set(me--,W.newLines[Pe]);me++,N.push({index:se+1,amount:W.newLines.length}),$+=W.newLines.length,W=O[++re]}else this.lines.set(me,P[se--]);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,S,E=0,O){let D=this.lines.get(w);return D?D.translateToString(S,E,O):""}getWrappedRangeForLine(w){let S=w,E=w;for(;S>0&&this.lines.get(S).isWrapped;)S--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:S,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 S=0;S<this.markers.length;S++)this.markers[S].line===w&&(this.markers[S].dispose(),this.markers.splice(S--,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 S=new x.Marker(w);return this.markers.push(S),S.register(this.lines.onTrim(E=>{S.line-=E,S.line<0&&S.dispose()})),S.register(this.lines.onInsert(E=>{S.line>=E.index&&(S.line+=E.amount)})),S.register(this.lines.onDelete(E=>{S.line>=E.index&&S.line<E.index+E.amount&&S.dispose(),S.line>E.index&&(S.line-=E.amount)})),S.register(S.onDispose(()=>this._removeMarker(S))),S}_removeMarker(w){this._isClearing||this.markers.splice(this.markers.indexOf(w),1)}}},8437:(i,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 g=0;class y{constructor(x,M,w=!1){this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*x);let S=M||p.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let E=0;E<x;++E)this.setCell(E,S);this.length=x}get(x){let M=this._data[3*x+0],w=2097151&M;return[this._data[3*x+1],2097152&M?this._combined[x]:w?(0,h.stringFromCodePoint)(w):"",M>>22,2097152&M?this._combined[x].charCodeAt(this._combined[x].length-1):w]}set(x,M){this._data[3*x+1]=M[u.CHAR_DATA_ATTR_INDEX],M[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[x]=M[1],this._data[3*x+0]=2097152|x|M[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*x+0]=M[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|M[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(x){return this._data[3*x+0]>>22}hasWidth(x){return 12582912&this._data[3*x+0]}getFg(x){return this._data[3*x+1]}getBg(x){return this._data[3*x+2]}hasContent(x){return 4194303&this._data[3*x+0]}getCodePoint(x){let M=this._data[3*x+0];return 2097152&M?this._combined[x].charCodeAt(this._combined[x].length-1):2097151&M}isCombined(x){return 2097152&this._data[3*x+0]}getString(x){let M=this._data[3*x+0];return 2097152&M?this._combined[x]:2097151&M?(0,h.stringFromCodePoint)(2097151&M):""}isProtected(x){return 536870912&this._data[3*x+2]}loadCell(x,M){return g=3*x,M.content=this._data[g+0],M.fg=this._data[g+1],M.bg=this._data[g+2],2097152&M.content&&(M.combinedData=this._combined[x]),268435456&M.bg&&(M.extended=this._extendedAttrs[x]),M}setCell(x,M){2097152&M.content&&(this._combined[x]=M.combinedData),268435456&M.bg&&(this._extendedAttrs[x]=M.extended),this._data[3*x+0]=M.content,this._data[3*x+1]=M.fg,this._data[3*x+2]=M.bg}setCellFromCodepoint(x,M,w,S){268435456&S.bg&&(this._extendedAttrs[x]=S.extended),this._data[3*x+0]=M|w<<22,this._data[3*x+1]=S.fg,this._data[3*x+2]=S.bg}addCodepointToCell(x,M,w){let S=this._data[3*x+0];2097152&S?this._combined[x]+=(0,h.stringFromCodePoint)(M):2097151&S?(this._combined[x]=(0,h.stringFromCodePoint)(2097151&S)+(0,h.stringFromCodePoint)(M),S&=-2097152,S|=2097152):S=M|4194304,w&&(S&=-12582913,S|=w<<22),this._data[3*x+0]=S}insertCells(x,M,w){if((x%=this.length)&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x-1,0,1,w),M<this.length-x){let S=new p.CellData;for(let E=this.length-x-M-1;E>=0;--E)this.setCell(x+M+E,this.loadCell(x+E,S));for(let E=0;E<M;++E)this.setCell(x+E,w)}else for(let S=x;S<this.length;++S)this.setCell(S,w);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,w)}deleteCells(x,M,w){if(x%=this.length,M<this.length-x){let S=new p.CellData;for(let E=0;E<this.length-x-M;++E)this.setCell(x+E,this.loadCell(x+M+E,S));for(let E=this.length-M;E<this.length;++E)this.setCell(E,w)}else for(let S=x;S<this.length;++S)this.setCell(S,w);x&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x-1,0,1,w),this.getWidth(x)!==0||this.hasContent(x)||this.setCellFromCodepoint(x,0,1,w)}replaceCells(x,M,w,S=!1){if(S)for(x&&this.getWidth(x-1)===2&&!this.isProtected(x-1)&&this.setCellFromCodepoint(x-1,0,1,w),M<this.length&&this.getWidth(M-1)===2&&!this.isProtected(M)&&this.setCellFromCodepoint(M,0,1,w);x<M&&x<this.length;)this.isProtected(x)||this.setCell(x,w),x++;else for(x&&this.getWidth(x-1)===2&&this.setCellFromCodepoint(x-1,0,1,w),M<this.length&&this.getWidth(M-1)===2&&this.setCellFromCodepoint(M,0,1,w);x<M&&x<this.length;)this.setCell(x++,w)}resize(x,M){if(x===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;let w=3*x;if(x>this.length){if(this._data.buffer.byteLength>=4*w)this._data=new Uint32Array(this._data.buffer,0,w);else{let S=new Uint32Array(w);S.set(this._data),this._data=S}for(let S=this.length;S<x;++S)this.setCell(S,M)}else{this._data=this._data.subarray(0,w);let S=Object.keys(this._combined);for(let O=0;O<S.length;O++){let D=parseInt(S[O],10);D>=x&&delete this._combined[D]}let E=Object.keys(this._extendedAttrs);for(let O=0;O<E.length;O++){let D=parseInt(E[O],10);D>=x&&delete this._extendedAttrs[D]}}return this.length=x,4*w*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){let x=new Uint32Array(this._data.length);return x.set(this._data),this._data=x,1}return 0}fill(x,M=!1){if(M)for(let w=0;w<this.length;++w)this.isProtected(w)||this.setCell(w,x);else{this._combined={},this._extendedAttrs={};for(let w=0;w<this.length;++w)this.setCell(w,x)}}copyFrom(x){this.length!==x.length?this._data=new Uint32Array(x._data):this._data.set(x._data),this.length=x.length,this._combined={};for(let M in x._combined)this._combined[M]=x._combined[M];this._extendedAttrs={};for(let M in x._extendedAttrs)this._extendedAttrs[M]=x._extendedAttrs[M];this.isWrapped=x.isWrapped}clone(){let x=new y(0);x._data=new Uint32Array(this._data),x.length=this.length;for(let M in this._combined)x._combined[M]=this._combined[M];for(let M in this._extendedAttrs)x._extendedAttrs[M]=this._extendedAttrs[M];return x.isWrapped=this.isWrapped,x}getTrimmedLength(){for(let x=this.length-1;x>=0;--x)if(4194303&this._data[3*x+0])return x+(this._data[3*x+0]>>22);return 0}getNoBgTrimmedLength(){for(let x=this.length-1;x>=0;--x)if(4194303&this._data[3*x+0]||50331648&this._data[3*x+2])return x+(this._data[3*x+0]>>22);return 0}copyCellsFrom(x,M,w,S,E){let O=x._data;if(E)for(let N=S-1;N>=0;N--){for(let P=0;P<3;P++)this._data[3*(w+N)+P]=O[3*(M+N)+P];268435456&O[3*(M+N)+2]&&(this._extendedAttrs[w+N]=x._extendedAttrs[M+N])}else for(let N=0;N<S;N++){for(let P=0;P<3;P++)this._data[3*(w+N)+P]=O[3*(M+N)+P];268435456&O[3*(M+N)+2]&&(this._extendedAttrs[w+N]=x._extendedAttrs[M+N])}let D=Object.keys(x._combined);for(let N=0;N<D.length;N++){let P=parseInt(D[N],10);P>=M&&(this._combined[P-M+w]=x._combined[P])}}translateToString(x,M,w,S){M=M??0,w=w??this.length,x&&(w=Math.min(w,this.getTrimmedLength())),S&&(S.length=0);let E="";for(;M<w;){let O=this._data[3*M+0],D=2097151&O,N=2097152&O?this._combined[M]:D?(0,h.stringFromCodePoint)(D):u.WHITESPACE_CELL_CHAR;if(E+=N,S)for(let P=0;P<N.length;++P)S.push(M);M+=O>>22||1}return S&&S.push(M),E}}r.BufferLine=y},4841:(i,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:(i,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,g=c[p+1].getWidth(0)===2;return h&&g?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,g){let y=[];for(let b=0;b<c.length-1;b++){let x=b,M=c.get(++x);if(!M.isWrapped)continue;let w=[c.get(b)];for(;x<c.length&&M.isWrapped;)w.push(M),M=c.get(++x);if(h>=b&&h<x){b+=w.length-1;continue}let S=0,E=a(w,S,p),O=1,D=0;for(;O<w.length;){let P=a(w,O,p),L=P-D,se=u-E,re=Math.min(L,se);w[S].copyCellsFrom(w[O],D,E,re,!1),E+=re,E===u&&(S++,E=0),D+=re,D===P&&(O++,D=0),E===0&&S!==0&&w[S-1].getWidth(u-1)===2&&(w[S].copyCellsFrom(w[S-1],u-1,E++,1,!1),w[S-1].setCell(u-1,g))}w[S].replaceCells(E,u,g);let N=0;for(let P=w.length-1;P>0&&(P>S||w[P].getTrimmedLength()===0);P--)N++;N>0&&(y.push(b+w.length-N),y.push(N)),b+=w.length-1}return y},r.reflowLargerCreateNewLayout=function(c,p){let u=[],h=0,g=p[h],y=0;for(let b=0;b<c.length;b++)if(g===b){let x=p[++h];c.onDeleteEmitter.fire({index:b-y,amount:x}),b+=x-1,y+=x,g=p[++h]}else u.push(b);return{layout:u,countRemoved:y}},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=[],g=c.map((M,w)=>a(c,w,p)).reduce((M,w)=>M+w),y=0,b=0,x=0;for(;x<g;){if(g-x<u){h.push(g-x);break}y+=u;let M=a(c,b,p);y>M&&(y-=M,b++);let w=c[b].getWidth(y-1)===2;w&&y--;let S=w?u-1:u;h.push(S),x+=S}return h},r.getWrappedLineTrimmedLength=a},5295:(i,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(y,b){super(),this._optionsService=y,this._bufferService=b,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(y){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(y),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(y,b){this._normal.resize(y,b),this._alt.resize(y,b),this.setupTabStops(y)}setupTabStops(y){this._normal.setupTabStops(y),this._alt.setupTabStops(y)}}r.BufferSet=h},511:(i,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(y){let b=new h;return b.setFromCharData(y),b}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(y){this.fg=y[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let b=!1;if(y[p.CHAR_DATA_CHAR_INDEX].length>2)b=!0;else if(y[p.CHAR_DATA_CHAR_INDEX].length===2){let x=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=x&&x<=56319){let M=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=M&&M<=57343?this.content=1024*(x-55296)+M-56320+65536|y[p.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[p.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=y[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=h},643:(i,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:(i,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(g){this.line=g,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(g){return this._disposables.push(g),g}}r.Marker=u,u._nextId=1},7116:(i,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:(i,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:(i,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,g,y){let b={type:0,cancel:!1,key:void 0},x=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?b.key=h?c.C0.ESC+"OA":c.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?b.key=h?c.C0.ESC+"OD":c.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?b.key=h?c.C0.ESC+"OC":c.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(b.key=h?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:b.key=u.ctrlKey?"\b":c.C0.DEL,u.altKey&&(b.key=c.C0.ESC+b.key);break;case 9:if(u.shiftKey){b.key=c.C0.ESC+"[Z";break}b.key=c.C0.HT,b.cancel=!0;break;case 13:b.key=u.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,b.cancel=!0;break;case 27:b.key=c.C0.ESC,u.altKey&&(b.key=c.C0.ESC+c.C0.ESC),b.cancel=!0;break;case 37:if(u.metaKey)break;x?(b.key=c.C0.ESC+"[1;"+(x+1)+"D",b.key===c.C0.ESC+"[1;3D"&&(b.key=c.C0.ESC+(g?"b":"[1;5D"))):b.key=h?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(u.metaKey)break;x?(b.key=c.C0.ESC+"[1;"+(x+1)+"C",b.key===c.C0.ESC+"[1;3C"&&(b.key=c.C0.ESC+(g?"f":"[1;5C"))):b.key=h?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(u.metaKey)break;x?(b.key=c.C0.ESC+"[1;"+(x+1)+"A",g||b.key!==c.C0.ESC+"[1;3A"||(b.key=c.C0.ESC+"[1;5A")):b.key=h?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(u.metaKey)break;x?(b.key=c.C0.ESC+"[1;"+(x+1)+"B",g||b.key!==c.C0.ESC+"[1;3B"||(b.key=c.C0.ESC+"[1;5B")):b.key=h?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(b.key=c.C0.ESC+"[2~");break;case 46:b.key=x?c.C0.ESC+"[3;"+(x+1)+"~":c.C0.ESC+"[3~";break;case 36:b.key=x?c.C0.ESC+"[1;"+(x+1)+"H":h?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:b.key=x?c.C0.ESC+"[1;"+(x+1)+"F":h?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:u.shiftKey?b.type=2:u.ctrlKey?b.key=c.C0.ESC+"[5;"+(x+1)+"~":b.key=c.C0.ESC+"[5~";break;case 34:u.shiftKey?b.type=3:u.ctrlKey?b.key=c.C0.ESC+"[6;"+(x+1)+"~":b.key=c.C0.ESC+"[6~";break;case 112:b.key=x?c.C0.ESC+"[1;"+(x+1)+"P":c.C0.ESC+"OP";break;case 113:b.key=x?c.C0.ESC+"[1;"+(x+1)+"Q":c.C0.ESC+"OQ";break;case 114:b.key=x?c.C0.ESC+"[1;"+(x+1)+"R":c.C0.ESC+"OR";break;case 115:b.key=x?c.C0.ESC+"[1;"+(x+1)+"S":c.C0.ESC+"OS";break;case 116:b.key=x?c.C0.ESC+"[15;"+(x+1)+"~":c.C0.ESC+"[15~";break;case 117:b.key=x?c.C0.ESC+"[17;"+(x+1)+"~":c.C0.ESC+"[17~";break;case 118:b.key=x?c.C0.ESC+"[18;"+(x+1)+"~":c.C0.ESC+"[18~";break;case 119:b.key=x?c.C0.ESC+"[19;"+(x+1)+"~":c.C0.ESC+"[19~";break;case 120:b.key=x?c.C0.ESC+"[20;"+(x+1)+"~":c.C0.ESC+"[20~";break;case 121:b.key=x?c.C0.ESC+"[21;"+(x+1)+"~":c.C0.ESC+"[21~";break;case 122:b.key=x?c.C0.ESC+"[23;"+(x+1)+"~":c.C0.ESC+"[23~";break;case 123:b.key=x?c.C0.ESC+"[24;"+(x+1)+"~":c.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(g&&!y||!u.altKey||u.metaKey)!g||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?b.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(b.key=c.C0.US),u.key==="@"&&(b.key=c.C0.NUL)):u.keyCode===65&&(b.type=1);else{let M=p[u.keyCode],w=M?.[u.shiftKey?1:0];if(w)b.key=c.C0.ESC+w;else if(u.keyCode>=65&&u.keyCode<=90){let S=u.ctrlKey?u.keyCode-64:u.keyCode+32,E=String.fromCharCode(S);u.shiftKey&&(E=E.toUpperCase()),b.key=c.C0.ESC+E}else if(u.keyCode===32)b.key=c.C0.ESC+(u.ctrlKey?c.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let S=u.code.slice(3,4);u.shiftKey||(S=S.toLowerCase()),b.key=c.C0.ESC+S,b.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?b.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?b.key=c.C0.NUL:u.keyCode>=51&&u.keyCode<=55?b.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?b.key=c.C0.DEL:u.keyCode===219?b.key=c.C0.ESC:u.keyCode===220?b.key=c.C0.FS:u.keyCode===221&&(b.key=c.C0.GS)}return b}},482:(i,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 g=a[h];g>65535?(g-=65536,u+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):u+=String.fromCharCode(g)}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 g=a.charCodeAt(h++);56320<=g&&g<=57343?c[u++]=1024*(this._interim-55296)+g-56320+65536:(c[u++]=this._interim,c[u++]=g),this._interim=0}for(let g=h;g<p;++g){let y=a.charCodeAt(g);if(55296<=y&&y<=56319){if(++g>=p)return this._interim=y,u;let b=a.charCodeAt(g);56320<=b&&b<=57343?c[u++]=1024*(y-55296)+b-56320+65536:(c[u++]=y,c[u++]=b)}else y!==65279&&(c[u++]=y)}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,g,y,b=0,x=0,M=0;if(this.interim[0]){let E=!1,O=this.interim[0];O&=(224&O)==192?31:(240&O)==224?15:7;let D,N=0;for(;(D=63&this.interim[++N])&&N<4;)O<<=6,O|=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,O<<=6,O|=63&D}E||(P===2?O<128?M--:c[b++]=O:P===3?O<2048||O>=55296&&O<=57343||O===65279||(c[b++]=O):O<65536||O>1114111||(c[b++]=O)),this.interim.fill(0)}let w=p-4,S=M;for(;S<p;){for(;!(!(S<w)||128&(u=a[S])||128&(h=a[S+1])||128&(g=a[S+2])||128&(y=a[S+3]));)c[b++]=u,c[b++]=h,c[b++]=g,c[b++]=y,S+=4;if(u=a[S++],u<128)c[b++]=u;else if((224&u)==192){if(S>=p)return this.interim[0]=u,b;if(h=a[S++],(192&h)!=128){S--;continue}if(x=(31&u)<<6|63&h,x<128){S--;continue}c[b++]=x}else if((240&u)==224){if(S>=p)return this.interim[0]=u,b;if(h=a[S++],(192&h)!=128){S--;continue}if(S>=p)return this.interim[0]=u,this.interim[1]=h,b;if(g=a[S++],(192&g)!=128){S--;continue}if(x=(15&u)<<12|(63&h)<<6|63&g,x<2048||x>=55296&&x<=57343||x===65279)continue;c[b++]=x}else if((248&u)==240){if(S>=p)return this.interim[0]=u,b;if(h=a[S++],(192&h)!=128){S--;continue}if(S>=p)return this.interim[0]=u,this.interim[1]=h,b;if(g=a[S++],(192&g)!=128){S--;continue}if(S>=p)return this.interim[0]=u,this.interim[1]=h,this.interim[2]=g,b;if(y=a[S++],(192&y)!=128){S--;continue}if(x=(7&u)<<18|(63&h)<<12|(63&g)<<6|63&y,x<65536||x>1114111)continue;c[b++]=x}}return b}}},225:(i,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 g=0;g<p.length;++g)h.fill(0,p[g][0],p[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?h[g]:(function(y,b){let x,M=0,w=b.length-1;if(y<b[0][0]||y>b[w][1])return!1;for(;w>=M;)if(x=M+w>>1,y>b[x][1])M=x+1;else{if(!(y<b[x][0]))return!0;w=x-1}return!1})(g,u)?0:g>=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,y){let b=this.wcwidth(g),x=b===0&&y!==0;if(x){let M=c.UnicodeService.extractWidth(y);M===0?x=!1:M>b&&(b=M)}return c.UnicodeService.createPropertyValue(0,b,x)}}},5981:(i,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(g){super(),this._action=g,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(g,y){if(y!==void 0&&this._syncCalls>y)return void(this._syncCalls=0);if(this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let b;for(this._isSyncWriting=!0;b=this._writeBuffer.shift();){this._action(b);let x=this._callbacks.shift();x&&x()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(g,y){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+=g.length,this._writeBuffer.push(g),this._callbacks.push(y),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(y)}_innerWrite(g=0,y=!0){let b=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){let x=this._writeBuffer[this._bufferOffset],M=this._action(x,y);if(M){let S=E=>Date.now()-b>=12?setTimeout(()=>this._innerWrite(0,E)):this._innerWrite(b,E);return void M.catch(E=>(queueMicrotask(()=>{throw E}),Promise.resolve(!1))).then(S)}let w=this._callbacks[this._bufferOffset];if(w&&w(),this._bufferOffset++,this._pendingData-=x.length,Date.now()-b>=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:(i,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 g=u.toString(16),y=g.length<2?"0"+g:g;switch(h){case 4:return g[0];case 8:return y;case 12:return(y+y).slice(0,3);default:return y+y}}r.parseColor=function(u){if(!u)return;let h=u.toLowerCase();if(h.indexOf("rgb:")===0){h=h.slice(4);let g=a.exec(h);if(g){let y=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/y*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/y*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/y*255)]}}else if(h.indexOf("#")===0&&(h=h.slice(1),c.exec(h)&&[3,6,9,12].includes(h.length))){let g=h.length/3,y=[0,0,0];for(let b=0;b<3;++b){let x=parseInt(h.slice(g*b,g*b+g),16);y[b]=g===1?x<<4:g===2?x:g===3?x>>4:x>>8}return y}},r.toRgbString=function(u,h=16){let[g,y,b]=u;return`rgb:${p(g,h)}/${p(y,h)}/${p(b,h)}`}},5770:(i,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(i,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(y,b){this._handlers[y]===void 0&&(this._handlers[y]=[]);let x=this._handlers[y];return x.push(b),{dispose:()=>{let M=x.indexOf(b);M!==-1&&x.splice(M,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}reset(){if(this._active.length)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].unhook(!1);this._stack.paused=!1,this._active=h,this._ident=0}hook(y,b){if(this.reset(),this._ident=y,this._active=this._handlers[y]||h,this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].hook(b);else this._handlerFb(this._ident,"HOOK",b)}put(y,b,x){if(this._active.length)for(let M=this._active.length-1;M>=0;M--)this._active[M].put(y,b,x);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(y,b,x))}unhook(y,b=!0){if(this._active.length){let x=!1,M=this._active.length-1,w=!1;if(this._stack.paused&&(M=this._stack.loopPosition-1,x=b,w=this._stack.fallThrough,this._stack.paused=!1),!w&&x===!1){for(;M>=0&&(x=this._active[M].unhook(y),x!==!0);M--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=M,this._stack.fallThrough=!1,x;M--}for(;M>=0;M--)if(x=this._active[M].unhook(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=M,this._stack.fallThrough=!0,x}else this._handlerFb(this._ident,"UNHOOK",y);this._active=h,this._ident=0}};let g=new p.Params;g.addParam(0),r.DcsHandler=class{constructor(y){this._handler=y,this._data="",this._params=g,this._hitLimit=!1}hook(y){this._params=y.length>1||y.params[0]?y.clone():g,this._data="",this._hitLimit=!1}put(y,b,x){this._hitLimit||(this._data+=(0,c.utf32ToString)(y,b,x),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(y){let b=!1;if(this._hitLimit)b=!1;else if(y&&(b=this._handler(this._data,this._params),b instanceof Promise))return b.then(x=>(this._params=g,this._data="",this._hitLimit=!1,x));return this._params=g,this._data="",this._hitLimit=!1,b}}},2015:(i,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 g{constructor(M){this.table=new Uint8Array(M)}setDefault(M,w){this.table.fill(M<<4|w)}add(M,w,S,E){this.table[w<<8|M]=S<<4|E}addMany(M,w,S,E){for(let O=0;O<M.length;O++)this.table[w<<8|M[O]]=S<<4|E}}r.TransitionTable=g;let y=160;r.VT500_TRANSITION_TABLE=(function(){let x=new g(4095),M=Array.apply(null,Array(256)).map((N,P)=>P),w=(N,P)=>M.slice(N,P),S=w(32,127),E=w(0,24);E.push(25),E.push.apply(E,w(28,32));let O=w(0,14),D;for(D in x.setDefault(1,0),x.addMany(S,0,2,0),O)x.addMany([24,26,153,154],D,3,0),x.addMany(w(128,144),D,3,0),x.addMany(w(144,152),D,3,0),x.add(156,D,0,0),x.add(27,D,11,1),x.add(157,D,4,8),x.addMany([152,158,159],D,0,7),x.add(155,D,11,3),x.add(144,D,11,9);return x.addMany(E,0,3,0),x.addMany(E,1,3,1),x.add(127,1,0,1),x.addMany(E,8,0,8),x.addMany(E,3,3,3),x.add(127,3,0,3),x.addMany(E,4,3,4),x.add(127,4,0,4),x.addMany(E,6,3,6),x.addMany(E,5,3,5),x.add(127,5,0,5),x.addMany(E,2,3,2),x.add(127,2,0,2),x.add(93,1,4,8),x.addMany(S,8,5,8),x.add(127,8,5,8),x.addMany([156,27,24,26,7],8,6,0),x.addMany(w(28,32),8,0,8),x.addMany([88,94,95],1,0,7),x.addMany(S,7,0,7),x.addMany(E,7,0,7),x.add(156,7,0,0),x.add(127,7,0,7),x.add(91,1,11,3),x.addMany(w(64,127),3,7,0),x.addMany(w(48,60),3,8,4),x.addMany([60,61,62,63],3,9,4),x.addMany(w(48,60),4,8,4),x.addMany(w(64,127),4,7,0),x.addMany([60,61,62,63],4,0,6),x.addMany(w(32,64),6,0,6),x.add(127,6,0,6),x.addMany(w(64,127),6,0,0),x.addMany(w(32,48),3,9,5),x.addMany(w(32,48),5,9,5),x.addMany(w(48,64),5,0,6),x.addMany(w(64,127),5,7,0),x.addMany(w(32,48),4,9,5),x.addMany(w(32,48),1,9,2),x.addMany(w(32,48),2,9,2),x.addMany(w(48,127),2,10,0),x.addMany(w(48,80),1,10,0),x.addMany(w(81,88),1,10,0),x.addMany([89,90,92],1,10,0),x.addMany(w(96,127),1,10,0),x.add(80,1,11,9),x.addMany(E,9,0,9),x.add(127,9,0,9),x.addMany(w(28,32),9,0,9),x.addMany(w(32,48),9,9,12),x.addMany(w(48,60),9,8,10),x.addMany([60,61,62,63],9,9,10),x.addMany(E,11,0,11),x.addMany(w(32,128),11,0,11),x.addMany(w(28,32),11,0,11),x.addMany(E,10,0,10),x.add(127,10,0,10),x.addMany(w(28,32),10,0,10),x.addMany(w(48,60),10,8,10),x.addMany([60,61,62,63],10,0,11),x.addMany(w(32,48),10,9,12),x.addMany(E,12,0,12),x.add(127,12,0,12),x.addMany(w(28,32),12,0,12),x.addMany(w(32,48),12,9,12),x.addMany(w(48,64),12,0,11),x.addMany(w(64,127),12,12,13),x.addMany(w(64,127),10,12,13),x.addMany(w(64,127),9,12,13),x.addMany(E,13,13,13),x.addMany(S,13,13,13),x.add(127,13,0,13),x.addMany([27,156,24,26],13,14,0),x.add(y,0,2,0),x.add(y,8,5,8),x.add(y,6,0,6),x.add(y,11,0,11),x.add(y,13,13,13),x})();class b 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,S,E)=>{},this._executeHandlerFb=w=>{},this._csiHandlerFb=(w,S)=>{},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 S=0;if(M.prefix){if(M.prefix.length>1)throw new Error("only one byte as prefix supported");if(S=M.prefix.charCodeAt(0),S&&60>S||S>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 O=0;O<M.intermediates.length;++O){let D=M.intermediates.charCodeAt(O);if(32>D||D>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");S<<=8,S|=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 S<<=8,S|=E,S}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 S=this._identifier(M,[48,126]);this._escHandlers[S]===void 0&&(this._escHandlers[S]=[]);let E=this._escHandlers[S];return E.push(w),{dispose:()=>{let O=E.indexOf(w);O!==-1&&E.splice(O,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 S=this._identifier(M);this._csiHandlers[S]===void 0&&(this._csiHandlers[S]=[]);let E=this._csiHandlers[S];return E.push(w),{dispose:()=>{let O=E.indexOf(w);O!==-1&&E.splice(O,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,S,E,O){this._parseStack.state=M,this._parseStack.handlers=w,this._parseStack.handlerPos=S,this._parseStack.transition=E,this._parseStack.chunkPos=O}parse(M,w,S){let E,O=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(S===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(S===!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(S===!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(O=M[this._parseStack.chunkPos],E=this._dcsParser.unhook(O!==24&&O!==26,S),E)return E;O===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(O=M[this._parseStack.chunkPos],E=this._oscParser.end(O!==24&&O!==26,S),E)return E;O===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(O=M[P],D=this._transitions.table[this.currentState<<8|(O<160?O:y)],D>>4){case 2:for(let $=P+1;;++$){if($>=w||(O=M[$])<32||O>126&&O<y){this._printHandler(M,P,$),P=$-1;break}if(++$>=w||(O=M[$])<32||O>126&&O<y){this._printHandler(M,P,$),P=$-1;break}if(++$>=w||(O=M[$])<32||O>126&&O<y){this._printHandler(M,P,$),P=$-1;break}if(++$>=w||(O=M[$])<32||O>126&&O<y){this._printHandler(M,P,$),P=$-1;break}}break;case 3:this._executeHandlers[O]?this._executeHandlers[O]():this._executeHandlerFb(O),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:P,code:O,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let L=this._csiHandlers[this._collect<<8|O],se=L?L.length-1:-1;for(;se>=0&&(E=L[se](this._params),E!==!0);se--)if(E instanceof Promise)return this._preserveStack(3,L,se,D,P),E;se<0&&this._csiHandlerFb(this._collect<<8|O,this._params),this.precedingJoinState=0;break;case 8:do switch(O){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(O-48)}while(++P<w&&(O=M[P])>47&&O<60);P--;break;case 9:this._collect<<=8,this._collect|=O;break;case 10:let re=this._escHandlers[this._collect<<8|O],W=re?re.length-1:-1;for(;W>=0&&(E=re[W](),E!==!0);W--)if(E instanceof Promise)return this._preserveStack(4,re,W,D,P),E;W<0&&this._escHandlerFb(this._collect<<8|O),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|O,this._params);break;case 13:for(let $=P+1;;++$)if($>=w||(O=M[$])===24||O===26||O===27||O>127&&O<y){this._dcsParser.put(M,P,$),P=$-1;break}break;case 14:if(E=this._dcsParser.unhook(O!==24&&O!==26),E)return this._preserveStack(6,[],0,D,P),E;O===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||(O=M[$])<32||O>127&&O<y){this._oscParser.put(M,P,$),P=$-1;break}break;case 6:if(E=this._oscParser.end(O!==24&&O!==26),E)return this._preserveStack(5,[],0,D,P),E;O===27&&(D|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&D}}}r.EscapeSequenceParser=b},6242:(i,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,g){this._handlers[h]===void 0&&(this._handlers[h]=[]);let y=this._handlers[h];return y.push(g),{dispose:()=>{let b=y.indexOf(g);b!==-1&&y.splice(b,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,g,y){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(h,g,y);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(h,g,y))}start(){this.reset(),this._state=1}put(h,g,y){if(this._state!==3){if(this._state===1)for(;g<y;){let b=h[g++];if(b===59){this._state=2,this._start();break}if(b<48||57<b)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+b-48}this._state===2&&y-g>0&&this._put(h,g,y)}}end(h,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let y=!1,b=this._active.length-1,x=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,y=g,x=this._stack.fallThrough,this._stack.paused=!1),!x&&y===!1){for(;b>=0&&(y=this._active[b].end(h),y!==!0);b--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,y;b--}for(;b>=0;b--)if(y=this._active[b].end(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,y}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,g,y){this._hitLimit||(this._data+=(0,p.utf32ToString)(h,g,y),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(h){let g=!1;if(this._hitLimit)g=!1;else if(h&&(g=this._handler(this._data),g instanceof Promise))return g.then(y=>(this._data="",this._hitLimit=!1,y));return this._data="",this._hitLimit=!1,g}}},8742:(i,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 g=Array.isArray(u[0])?1:0;g<u.length;++g){let y=u[g];if(Array.isArray(y))for(let b=0;b<y.length;++b)h.addSubParam(y[b]);else h.addParam(y)}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 g=this._subParamsIdx[h]>>8,y=255&this._subParamsIdx[h];y-g>0&&u.push(Array.prototype.slice.call(this._subParams,g,y))}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,g=255&this._subParamsIdx[u];return g-h>0?this._subParams.subarray(h,g):null}getSubParamsAll(){let u={};for(let h=0;h<this.length;++h){let g=this._subParamsIdx[h]>>8,y=255&this._subParamsIdx[h];y-g>0&&(u[h]=this._subParams.slice(g,y))}return u}addDigit(u){let h;if(this._rejectDigits||!(h=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let g=this._digitIsSub?this._subParams:this.params,y=g[h-1];g[h-1]=~y?Math.min(10*y+u,a):u}}r.Params=c},5741:(i,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:(i,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:(i,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:(i,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(y){super(),this._core=y,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:(i,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:(i,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(i,r,a){var c=this&&this.__decorate||function(x,M,w,S){var E,O=arguments.length,D=O<3?M:S===null?S=Object.getOwnPropertyDescriptor(M,w):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(x,M,w,S);else for(var N=x.length-1;N>=0;N--)(E=x[N])&&(D=(O<3?E(D):O>3?E(M,w,D):E(M,w))||D);return O>3&&D&&Object.defineProperty(M,w,D),D},p=this&&this.__param||function(x,M){return function(w,S){M(w,S,x)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;let u=a(8460),h=a(844),g=a(5295),y=a(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let b=r.BufferService=class extends h.Disposable{get buffer(){return this.buffers.active}constructor(x){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(x.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(x.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new g.BufferSet(x,this))}resize(x,M){this.cols=x,this.rows=M,this.buffers.resize(x,M),this._onResize.fire({cols:x,rows:M})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(x,M=!1){let w=this.buffer,S;S=this._cachedBlankLine,S&&S.length===this.cols&&S.getFg(0)===x.fg&&S.getBg(0)===x.bg||(S=w.getBlankLine(x,M),this._cachedBlankLine=S),S.isWrapped=M;let E=w.ybase+w.scrollTop,O=w.ybase+w.scrollBottom;if(w.scrollTop===0){let D=w.lines.isFull;O===w.lines.length-1?D?w.lines.recycle().copyFrom(S):w.lines.push(S.clone()):w.lines.splice(O+1,0,S.clone()),D?this.isUserScrolling&&(w.ydisp=Math.max(w.ydisp-1,0)):(w.ybase++,this.isUserScrolling||w.ydisp++)}else{let D=O-E+1;w.lines.shiftElements(E+1,D-1,-1),w.lines.set(O,S.clone())}this.isUserScrolling||(w.ydisp=w.ybase),this._onScroll.fire(w.ydisp)}scrollLines(x,M,w){let S=this.buffer;if(x<0){if(S.ydisp===0)return;this.isUserScrolling=!0}else x+S.ydisp>=S.ybase&&(this.isUserScrolling=!1);let E=S.ydisp;S.ydisp=Math.max(Math.min(S.ydisp+x,S.ybase),0),E!==S.ydisp&&(M||this._onScroll.fire(S.ydisp))}};r.BufferService=b=c([p(0,y.IOptionsService)],b)},7994:(i,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(i,r,a){var c=this&&this.__decorate||function(S,E,O,D){var N,P=arguments.length,L=P<3?E:D===null?D=Object.getOwnPropertyDescriptor(E,O):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,E,O,D);else for(var se=S.length-1;se>=0;se--)(N=S[se])&&(L=(P<3?N(L):P>3?N(E,O,L):N(E,O))||L);return P>3&&L&&Object.defineProperty(E,O,L),L},p=this&&this.__param||function(S,E){return function(O,D){E(O,D,S)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;let u=a(2585),h=a(8460),g=a(844),y={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:S=>S.button!==4&&S.action===1&&(S.ctrl=!1,S.alt=!1,S.shift=!1,!0)},VT200:{events:19,restrict:S=>S.action!==32},DRAG:{events:23,restrict:S=>S.action!==32||S.button!==3},ANY:{events:31,restrict:S=>!0}};function b(S,E){let O=(S.ctrl?16:0)|(S.shift?4:0)|(S.alt?8:0);return S.button===4?(O|=64,O|=S.action):(O|=3&S.button,4&S.button&&(O|=64),8&S.button&&(O|=128),S.action===32?O|=32:S.action!==0||E||(O|=3)),O}let x=String.fromCharCode,M={DEFAULT:S=>{let E=[b(S,!1)+32,S.col+32,S.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${x(E[0])}${x(E[1])}${x(E[2])}`},SGR:S=>{let E=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${b(S,!0)};${S.col};${S.row}${E}`},SGR_PIXELS:S=>{let E=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${b(S,!0)};${S.x};${S.y}${E}`}},w=r.CoreMouseService=class extends g.Disposable{constructor(S,E){super(),this._bufferService=S,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 O of Object.keys(y))this.addProtocol(O,y[O]);for(let O of Object.keys(M))this.addEncoding(O,M[O]);this.reset()}addProtocol(S,E){this._protocols[S]=E}addEncoding(S,E){this._encodings[S]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(S){if(!this._protocols[S])throw new Error(`unknown protocol "${S}"`);this._activeProtocol=S,this._onProtocolChange.fire(this._protocols[S].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(S){if(!this._encodings[S])throw new Error(`unknown encoding "${S}"`);this._activeEncoding=S}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(S){if(S.col<0||S.col>=this._bufferService.cols||S.row<0||S.row>=this._bufferService.rows||S.button===4&&S.action===32||S.button===3&&S.action!==32||S.button!==4&&(S.action===2||S.action===3)||(S.col++,S.row++,S.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,S,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(S))return!1;let E=this._encodings[this._activeEncoding](S);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=S,!0}explainEvents(S){return{down:!!(1&S),up:!!(2&S),drag:!!(4&S),move:!!(8&S),wheel:!!(16&S)}}_equalEvents(S,E,O){if(O){if(S.x!==E.x||S.y!==E.y)return!1}else if(S.col!==E.col||S.row!==E.row)return!1;return S.button===E.button&&S.action===E.action&&S.ctrl===E.ctrl&&S.alt===E.alt&&S.shift===E.shift}};r.CoreMouseService=w=c([p(0,u.IBufferService),p(1,u.ICoreService)],w)},6975:function(i,r,a){var c=this&&this.__decorate||function(w,S,E,O){var D,N=arguments.length,P=N<3?S:O===null?O=Object.getOwnPropertyDescriptor(S,E):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(w,S,E,O);else for(var L=w.length-1;L>=0;L--)(D=w[L])&&(P=(N<3?D(P):N>3?D(S,E,P):D(S,E))||P);return N>3&&P&&Object.defineProperty(S,E,P),P},p=this&&this.__param||function(w,S){return function(E,O){S(E,O,w)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;let u=a(1439),h=a(8460),g=a(844),y=a(2585),b=Object.freeze({insertMode:!1}),x=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),M=r.CoreService=class extends g.Disposable{constructor(w,S,E){super(),this._bufferService=w,this._logService=S,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)(b),this.decPrivateModes=(0,u.clone)(x)}reset(){this.modes=(0,u.clone)(b),this.decPrivateModes=(0,u.clone)(x)}triggerDataEvent(w,S=!1){if(this._optionsService.rawOptions.disableStdin)return;let E=this._bufferService.buffer;S&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),S&&this._onUserInput.fire(),this._logService.debug(`sending data "${w}"`,()=>w.split("").map(O=>O.charCodeAt(0))),this._onData.fire(w)}triggerBinaryEvent(w){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${w}"`,()=>w.split("").map(S=>S.charCodeAt(0))),this._onBinary.fire(w))}};r.CoreService=M=c([p(0,y.IBufferService),p(1,y.ILogService),p(2,y.IOptionsService)],M)},9074:(i,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),g=0,y=0;class b 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 S=new x(w);if(S){let E=S.marker.onDispose(()=>S.dispose());S.onDispose(()=>{S&&(this._decorations.delete(S)&&this._onDecorationRemoved.fire(S),E.dispose())}),this._decorations.insert(S),this._onDecorationRegistered.fire(S)}return S}reset(){for(let w of this._decorations.values())w.dispose();this._decorations.clear()}*getDecorationsAtCell(w,S,E){let O=0,D=0;for(let N of this._decorations.getKeyIterator(S))O=N.options.x??0,D=O+(N.options.width??1),w>=O&&w<D&&(!E||(N.options.layer??"bottom")===E)&&(yield N)}forEachDecorationAtCell(w,S,E,O){this._decorations.forEachByKey(S,D=>{g=D.options.x??0,y=g+(D.options.width??1),w>=g&&w<y&&(!E||(D.options.layer??"bottom")===E)&&O(D)})}}r.DecorationService=b;class x 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:(i,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;let c=a(2585),p=a(8343);class u{constructor(...g){this._entries=new Map;for(let[y,b]of g)this.set(y,b)}set(g,y){let b=this._entries.get(g);return this._entries.set(g,y),b}forEach(g){for(let[y,b]of this._entries.entries())g(y,b)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}r.ServiceCollection=u,r.InstantiationService=class{constructor(){this._services=new u,this._services.set(c.IInstantiationService,this)}setService(h,g){this._services.set(h,g)}getService(h){return this._services.get(h)}createInstance(h,...g){let y=(0,p.getServiceDependencies)(h).sort((M,w)=>M.index-w.index),b=[];for(let M of y){let w=this._services.get(M.id);if(!w)throw new Error(`[createInstance] ${h.name} depends on UNKNOWN service ${M.id}.`);b.push(w)}let x=y.length>0?y[0].index:g.length;if(g.length!==x)throw new Error(`[createInstance] First service dependency of ${h.name} at position ${x+1} conflicts with ${g.length} static arguments`);return new h(...g,...b)}}},7866:function(i,r,a){var c=this&&this.__decorate||function(x,M,w,S){var E,O=arguments.length,D=O<3?M:S===null?S=Object.getOwnPropertyDescriptor(M,w):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(x,M,w,S);else for(var N=x.length-1;N>=0;N--)(E=x[N])&&(D=(O<3?E(D):O>3?E(M,w,D):E(M,w))||D);return O>3&&D&&Object.defineProperty(M,w,D),D},p=this&&this.__param||function(x,M){return function(w,S){M(w,S,x)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;let u=a(844),h=a(2585),g={trace:h.LogLevelEnum.TRACE,debug:h.LogLevelEnum.DEBUG,info:h.LogLevelEnum.INFO,warn:h.LogLevelEnum.WARN,error:h.LogLevelEnum.ERROR,off:h.LogLevelEnum.OFF},y,b=r.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(x){super(),this._optionsService=x,this._logLevel=h.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),y=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(x){for(let M=0;M<x.length;M++)typeof x[M]=="function"&&(x[M]=x[M]())}_log(x,M,w){this._evalLazyOptionalParams(w),x.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+M,...w)}trace(x,...M){this._logLevel<=h.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,x,M)}debug(x,...M){this._logLevel<=h.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,x,M)}info(x,...M){this._logLevel<=h.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,x,M)}warn(x,...M){this._logLevel<=h.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,x,M)}error(x,...M){this._logLevel<=h.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,x,M)}};r.LogService=b=c([p(0,h.IOptionsService)],b),r.setTraceLogger=function(x){y=x},r.traceCall=function(x,M,w){if(typeof w.value!="function")throw new Error("not supported");let S=w.value;w.value=function(...E){if(y.logLevel!==h.LogLevelEnum.TRACE)return S.apply(this,E);y.trace(`GlyphRenderer#${S.name}(${E.map(D=>JSON.stringify(D)).join(", ")})`);let O=S.apply(this,E);return y.trace(`GlyphRenderer#${S.name} return`,O),O}}},7302:(i,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 g extends p.Disposable{constructor(b){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;let x=Z({},r.DEFAULT_OPTIONS);for(let M in b)if(M in x)try{let w=b[M];x[M]=this._sanitizeAndValidateOption(M,w)}catch(w){console.error(w)}this.rawOptions=x,this.options=Z({},x),this._setupOptions(),this.register((0,p.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(b,x){return this.onOptionChange(M=>{M===b&&x(this.rawOptions[b])})}onMultipleOptionChange(b,x){return this.onOptionChange(M=>{b.indexOf(M)!==-1&&x()})}_setupOptions(){let b=M=>{if(!(M in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${M}"`);return this.rawOptions[M]},x=(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:b.bind(this,M),set:x.bind(this,M)};Object.defineProperty(this.options,M,w)}}_sanitizeAndValidateOption(b,x){switch(b){case"cursorStyle":if(x||(x=r.DEFAULT_OPTIONS[b]),!(function(M){return M==="block"||M==="underline"||M==="bar"})(x))throw new Error(`"${x}" is not a valid value for ${b}`);break;case"wordSeparator":x||(x=r.DEFAULT_OPTIONS[b]);break;case"fontWeight":case"fontWeightBold":if(typeof x=="number"&&1<=x&&x<=1e3)break;x=h.includes(x)?x:r.DEFAULT_OPTIONS[b];break;case"cursorWidth":x=Math.floor(x);case"lineHeight":case"tabStopWidth":if(x<1)throw new Error(`${b} cannot be less than 1, value: ${x}`);break;case"minimumContrastRatio":x=Math.max(1,Math.min(21,Math.round(10*x)/10));break;case"scrollback":if((x=Math.min(x,4294967295))<0)throw new Error(`${b} cannot be less than 0, value: ${x}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(x<=0)throw new Error(`${b} cannot be less than or equal to 0, value: ${x}`);break;case"rows":case"cols":if(!x&&x!==0)throw new Error(`${b} must be numeric, value: ${x}`);break;case"windowsPty":x=x??{}}return x}}r.OptionsService=g},2660:function(i,r,a){var c=this&&this.__decorate||function(g,y,b,x){var M,w=arguments.length,S=w<3?y:x===null?x=Object.getOwnPropertyDescriptor(y,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(g,y,b,x);else for(var E=g.length-1;E>=0;E--)(M=g[E])&&(S=(w<3?M(S):w>3?M(y,b,S):M(y,b))||S);return w>3&&S&&Object.defineProperty(y,b,S),S},p=this&&this.__param||function(g,y){return function(b,x){y(b,x,g)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;let u=a(2585),h=r.OscLinkService=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){let y=this._bufferService.buffer;if(g.id===void 0){let E=y.addMarker(y.ybase+y.y),O={data:g,id:this._nextId++,lines:[E]};return E.onDispose(()=>this._removeMarkerFromLink(O,E)),this._dataByLinkId.set(O.id,O),O.id}let b=g,x=this._getEntryIdKey(b),M=this._entriesWithId.get(x);if(M)return this.addLineToLink(M.id,y.ybase+y.y),M.id;let w=y.addMarker(y.ybase+y.y),S={id:this._nextId++,key:this._getEntryIdKey(b),data:b,lines:[w]};return w.onDispose(()=>this._removeMarkerFromLink(S,w)),this._entriesWithId.set(S.key,S),this._dataByLinkId.set(S.id,S),S.id}addLineToLink(g,y){let b=this._dataByLinkId.get(g);if(b&&b.lines.every(x=>x.line!==y)){let x=this._bufferService.buffer.addMarker(y);b.lines.push(x),x.onDispose(()=>this._removeMarkerFromLink(b,x))}}getLinkData(g){return this._dataByLinkId.get(g)?.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,y){let b=g.lines.indexOf(y);b!==-1&&(g.lines.splice(b,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};r.OscLinkService=h=c([p(0,u.IBufferService)],h)},8343:(i,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,g,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(b,x,M){x[a]===x?x[c].push({id:b,index:M}):(x[c]=[{id:b,index:M}],x[a]=x)})(u,h,y)};return u.toString=()=>p,r.serviceRegistry.set(p,u),u}},2585:(i,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:(i,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;let c=a(8460),p=a(225);class u{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,y,b=!1){return(16777215&g)<<3|(3&y)<<1|(b?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;let g=new p.UnicodeV6;this.register(g),this._active=g.version,this._activeProvider=g}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(g){if(!this._providers[g])throw new Error(`unknown Unicode version "${g}"`);this._active=g,this._activeProvider=this._providers[g],this._onChange.fire(g)}register(g){this._providers[g.version]=g}wcwidth(g){return this._activeProvider.wcwidth(g)}getStringCellWidth(g){let y=0,b=0,x=g.length;for(let M=0;M<x;++M){let w=g.charCodeAt(M);if(55296<=w&&w<=56319){if(++M>=x)return y+this.wcwidth(w);let O=g.charCodeAt(M);56320<=O&&O<=57343?w=1024*(w-55296)+O-56320+65536:y+=this.wcwidth(O)}let S=this.charProperties(w,b),E=u.extractWidth(S);u.extractShouldJoin(S)&&(E-=u.extractWidth(b)),y+=E,b=S}return y}charProperties(g,y){return this._activeProvider.charProperties(g,y)}}r.UnicodeService=u}},o={};function e(i){var r=o[i];if(r!==void 0)return r.exports;var a=o[i]={exports:{}};return n[i].call(a.exports,a,a.exports,e),a.exports}var t={};return(()=>{var i=t;Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;let r=e(9042),a=e(3236),c=e(844),p=e(5741),u=e(8285),h=e(7975),g=e(7090),y=["cols","rows"];class b extends c.Disposable{constructor(M){super(),this._core=this.register(new a.Terminal(M)),this._addonManager=this.register(new p.AddonManager),this._publicOptions=Z({},this._core.options);let w=E=>this._core.options[E],S=(E,O)=>{this._checkReadonlyOptions(E),this._core.options[E]=O};for(let E in this._core.options){let O={get:w.bind(this,E),set:S.bind(this,E)};Object.defineProperty(this._publicOptions,E,O)}}_checkReadonlyOptions(M){if(y.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 g.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,S){this._verifyIntegers(M,w,S),this._core.select(M,w,S)}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")}}i.Terminal=b})(),t})())});var yO=ws((Q2,bO)=>{(function(n,o){typeof Q2=="object"&&typeof bO=="object"?bO.exports=o():typeof define=="function"&&define.amd?define([],o):typeof Q2=="object"?Q2.AttachAddon=o():n.AttachAddon=o()})(self,()=>(()=>{"use strict";var n={};return(()=>{var o=n;function e(t,i,r){return t.addEventListener(i,r),{dispose:()=>{r&&t.removeEventListener(i,r)}}}Object.defineProperty(o,"__esModule",{value:!0}),o.AttachAddon=void 0,o.AttachAddon=class{constructor(t,i){this._disposables=[],this._socket=t,this._socket.binaryType="arraybuffer",this._bidirectional=!(i&&i.bidirectional===!1)}activate(t){this._disposables.push(e(this._socket,"message",i=>{let r=i.data;t.write(typeof r=="string"?r:new Uint8Array(r))})),this._bidirectional&&(this._disposables.push(t.onData(i=>this._sendData(i))),this._disposables.push(t.onBinary(i=>this._sendBinary(i)))),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 i=new Uint8Array(t.length);for(let r=0;r<t.length;++r)i[r]=255&t.charCodeAt(r);this._socket.send(i)}_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 wO=ws((X2,SO)=>{(function(n,o){typeof X2=="object"&&typeof SO=="object"?SO.exports=o():typeof define=="function"&&define.amd?define([],o):typeof X2=="object"?X2.FitAddon=o():n.FitAddon=o()})(self,()=>(()=>{"use strict";var n={};return(()=>{var o=n;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.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 i=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")))-i;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 h5=new RegExp(`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,"g"),Mh=class n{element=null;classNames=[];attrs=[];notSelectors=[];static parse(o){let e=[],t=(p,u)=>{u.notSelectors.length>0&&!u.element&&u.classNames.length==0&&u.attrs.length==0&&(u.element="*"),p.push(u)},i=new n,r,a=i,c=!1;for(h5.lastIndex=0;r=h5.exec(o);){if(r[1]){if(c)throw new Error("Nesting :not in a selector is not allowed");c=!0,a=new n,i.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=i),r[8]){if(c)throw new Error("Multiple selectors in :not are not supported");t(e,i),i=a=new n}}return t(e,i),e}unescapeAttribute(o){let e="",t=!1;for(let i=0;i<o.length;i++){let r=o.charAt(i);if(r==="\\"){t=!0;continue}if(r==="$"&&!t)throw new Error(`Error in attribute selector "${o}". Unescaped "$" is not supported. Please escape with "\\$".`);t=!1,e+=r}return e}escapeAttribute(o){return o.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(o=null){this.element=o}getAttrs(){let o=[];return this.classNames.length>0&&o.push("class",this.classNames.join(" ")),o.concat(this.attrs)}addAttribute(o,e=""){this.attrs.push(o,e&&e.toLowerCase()||"")}addClassName(o){this.classNames.push(o.toLowerCase())}toString(){let o=this.element||"";if(this.classNames&&this.classNames.forEach(e=>o+=`.${e}`),this.attrs)for(let e=0;e<this.attrs.length;e+=2){let t=this.escapeAttribute(this.attrs[e]),i=this.attrs[e+1];o+=`[${t}${i?"="+i:""}]`}return this.notSelectors.forEach(e=>o+=`:not(${e})`),o}},o1=class n{static createNotMatcher(o){let e=new n;return e.addSelectables(o,null),e}_elementMap=new Map;_elementPartialMap=new Map;_classMap=new Map;_classPartialMap=new Map;_attrValueMap=new Map;_attrValuePartialMap=new Map;_listContexts=[];addSelectables(o,e){let t=null;o.length>1&&(t=new tT(o),this._listContexts.push(t));for(let i=0;i<o.length;i++)this._addSelectable(o[i],e,t)}_addSelectable(o,e,t){let i=this,r=o.element,a=o.classNames,c=o.attrs,p=new nT(o,e,t);if(r&&(c.length===0&&a.length===0?this._addTerminal(i._elementMap,r,p):i=this._addPartial(i._elementPartialMap,r)),a)for(let u=0;u<a.length;u++){let h=c.length===0&&u===a.length-1,g=a[u];h?this._addTerminal(i._classMap,g,p):i=this._addPartial(i._classPartialMap,g)}if(c)for(let u=0;u<c.length;u+=2){let h=u===c.length-2,g=c[u],y=c[u+1];if(h){let b=i._attrValueMap,x=b.get(g);x||(x=new Map,b.set(g,x)),this._addTerminal(x,y,p)}else{let b=i._attrValuePartialMap,x=b.get(g);x||(x=new Map,b.set(g,x)),i=this._addPartial(x,y)}}}_addTerminal(o,e,t){let i=o.get(e);i||(i=[],o.set(e,i)),i.push(t)}_addPartial(o,e){let t=o.get(e);return t||(t=new n,o.set(e,t)),t}match(o,e){let t=!1,i=o.element,r=o.classNames,a=o.attrs;for(let c=0;c<this._listContexts.length;c++)this._listContexts[c].alreadyMatched=!1;if(t=this._matchTerminal(this._elementMap,i,o,e)||t,t=this._matchPartial(this._elementPartialMap,i,o,e)||t,r)for(let c=0;c<r.length;c++){let p=r[c];t=this._matchTerminal(this._classMap,p,o,e)||t,t=this._matchPartial(this._classPartialMap,p,o,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,"",o,e)||t),t=this._matchTerminal(h,u,o,e)||t;let g=this._attrValuePartialMap.get(p);u&&(t=this._matchPartial(g,"",o,e)||t),t=this._matchPartial(g,u,o,e)||t}return t}_matchTerminal(o,e,t,i){if(!o||typeof e!="string")return!1;let r=o.get(e)||[],a=o.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,i)||p;return p}_matchPartial(o,e,t,i){if(!o||typeof e!="string")return!1;let r=o.get(e);return r?r.match(t,i):!1}},tT=class{selectors;alreadyMatched=!1;constructor(o){this.selectors=o}},nT=class{selector;cbContext;listContext;notSelectors;constructor(o,e,t){this.selector=o,this.cbContext=e,this.listContext=t,this.notSelectors=o.notSelectors}finalize(o,e){let t=!0;return this.notSelectors.length>0&&(!this.listContext||!this.listContext.alreadyMatched)&&(t=!o1.createNotMatcher(this.notSelectors).match(o,null)),t&&e&&(!this.listContext||!this.listContext.alreadyMatched)&&(this.listContext&&(this.listContext.alreadyMatched=!0),e(this.selector,this.cbContext)),t}},r1=class{registry;constructor(o){this.registry=o}match(o){return this.registry.has(o)?this.registry.get(o):[]}},fi=(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})(fi||{}),JC,f5="svg",B$="math";function z$(){return JC||(JC={},tm(fi.HTML,void 0,[["iframe",["srcdoc"]],["*",["innerHTML","outerHTML"]]]),tm(fi.STYLE,void 0,[["*",["style"]]]),tm(fi.URL,void 0,[["*",["formAction"]],["area",["href"]],["a",["href","xlink:href"]],["form",["action"]],["img",["src"]],["video",["src"]]]),tm(fi.URL,B$,[["annotation",["href","xlink:href"]],["annotation-xml",["href","xlink:href"]],["maction",["href","xlink:href"]],["malignmark",["href","xlink:href"]],["math",["href","xlink:href"]],["mroot",["href","xlink:href"]],["msqrt",["href","xlink:href"]],["merror",["href","xlink:href"]],["mfrac",["href","xlink:href"]],["mglyph",["href","xlink:href"]],["msub",["href","xlink:href"]],["msup",["href","xlink:href"]],["msubsup",["href","xlink:href"]],["mmultiscripts",["href","xlink:href"]],["mprescripts",["href","xlink:href"]],["mi",["href","xlink:href"]],["mn",["href","xlink:href"]],["mo",["href","xlink:href"]],["mpadded",["href","xlink:href"]],["mphantom",["href","xlink:href"]],["mrow",["href","xlink:href"]],["ms",["href","xlink:href"]],["mspace",["href","xlink:href"]],["mstyle",["href","xlink:href"]],["mtable",["href","xlink:href"]],["mtd",["href","xlink:href"]],["mtr",["href","xlink:href"]],["mtext",["href","xlink:href"]],["mover",["href","xlink:href"]],["munder",["href","xlink:href"]],["munderover",["href","xlink:href"]],["semantics",["href","xlink:href"]],["none",["href","xlink:href"]]]),tm(fi.RESOURCE_URL,void 0,[["base",["href"]],["embed",["src"]],["frame",["src"]],["iframe",["src"]],["link",["href"]],["object",["codebase","data"]]]),tm(fi.URL,f5,[["a",["href","xlink:href"]]]),tm(fi.ATTRIBUTE_NO_BINDING,f5,[["animate",["attributeName","values","to","from"]],["set",["to","attributeName"]],["animateMotion",["attributeName"]],["animateTransform",["attributeName"]]]),tm(fi.ATTRIBUTE_NO_BINDING,void 0,[["unknown",["attributeName","values","to","from","sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]],["iframe",["sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority"]]])),JC}function tm(n,o,e){for(let[t,i]of e){let r=o&&t!=="*"&&t!=="unknown"?`:${o}:${t}`:t;r=r.toLowerCase();for(let a of i)JC[`${r}|${a.toLowerCase()}`]=n}}var Pp=(function(n){return n[n.Emulated=0]="Emulated",n[n.None=2]="None",n[n.ShadowDom=3]="ShadowDom",n[n.ExperimentalIsolatedShadowDom=4]="ExperimentalIsolatedShadowDom",n})(Pp||{}),IE=(function(n){return n[n.OnPush=0]="OnPush",n[n.Default=1]="Default",n[n.Eager=1]="Eager",n})(IE||{}),e_=(function(n){return n[n.None=0]="None",n[n.SignalBased=1]="SignalBased",n[n.HasDecoratorInputTransform=2]="HasDecoratorInputTransform",n})(e_||{}),g5={name:"custom-elements"},_5={name:"no-errors-schema"};function j$(n){let o=n.classNames&&n.classNames.length?[8,...n.classNames]:[];return[n.element&&n.element!=="*"?n.element:"",...n.attrs,...o]}function $$(n){let o=n.classNames&&n.classNames.length?[8,...n.classNames]:[];return n.element?[5,n.element,...n.attrs,...o]:n.attrs.length?[3,...n.attrs,...o]:n.classNames&&n.classNames.length?[9,...n.classNames]:[]}function H$(n){let o=j$(n),e=n.notSelectors&&n.notSelectors.length?n.notSelectors.map(t=>$$(t)):[];return o.concat(...e)}function AE(n){return n?Mh.parse(n).map(H$):[]}var xd=(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})(xd||{});var a1;function U$(n){return Q$(q$(n.nodes).join("")+`[${n.meaning}]`)}function W$(n){return n.id||cF(n)}function cF(n){let o=new iT,e=n.nodes.map(t=>t.visit(o,null));return dF(e.join(""),n.meaning)}var s1=class{visitText(o,e){return o.value}visitContainer(o,e){return`[${o.children.map(t=>t.visit(this)).join(", ")}]`}visitIcu(o,e){let t=Object.keys(o.cases).map(i=>`${i} {${o.cases[i].visit(this)}}`);return`{${o.expression}, ${o.type}, ${t.join(", ")}}`}visitTagPlaceholder(o,e){return o.isVoid?`<ph tag name="${o.startName}"/>`:`<ph tag name="${o.startName}">${o.children.map(t=>t.visit(this)).join(", ")}</ph name="${o.closeName}">`}visitPlaceholder(o,e){return o.value?`<ph name="${o.name}">${o.value}</ph>`:`<ph name="${o.name}"/>`}visitIcuPlaceholder(o,e){return`<ph icu name="${o.name}">${o.value.visit(this)}</ph>`}visitBlockPlaceholder(o,e){return`<ph block name="${o.startName}">${o.children.map(t=>t.visit(this)).join(", ")}</ph name="${o.closeName}">`}},G$=new s1;function q$(n){return n.map(o=>o.visit(G$,null))}var iT=class extends s1{visitIcu(o){let e=Object.keys(o.cases).map(t=>`${t} {${o.cases[t].visit(this)}}`);return`{${o.type}, ${e.join(", ")}}`}};function Q$(n){a1??=new TextEncoder;let o=[...a1.encode(n)],e=Y$(o,OE.Big),t=o.length*8,i=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 g=r,y=a,b=c,x=p,M=u;for(let w=0;w<80;w++){w<16?i[w]=e[h+w]:i[w]=Ok(i[w-3]^i[w-8]^i[w-14]^i[w-16],1);let S=X$(w,a,c,p),E=S[0],O=S[1],D=[Ok(r,5),E,u,O,i[w]].reduce(lh);u=p,p=c,c=Ok(a,30),a=r,r=D}r=lh(r,g),a=lh(a,y),c=lh(c,b),p=lh(p,x),u=lh(u,M)}return Ug(r)+Ug(a)+Ug(c)+Ug(p)+Ug(u)}function Ug(n){return(n>>>0).toString(16).padStart(8,"0")}function X$(n,o,e,t){return n<20?[o&e|~o&t,1518500249]:n<40?[o^e^t,1859775393]:n<60?[o&e|o&t|e&t,2400959708]:[o^e^t,3395469782]}function v5(n){a1??=new TextEncoder;let o=a1.encode(n),e=new DataView(o.buffer,o.byteOffset,o.byteLength),t=C5(e,o.length,0),i=C5(e,o.length,102072);return t==0&&(i==0||i==1)&&(t=t^319790063,i=i^-1801410264),BigInt.asUintN(32,BigInt(t))<<BigInt(32)|BigInt.asUintN(32,BigInt(i))}function dF(n,o=""){let e=v5(n);return o&&(e=BigInt.asUintN(64,e<<BigInt(1))|e>>BigInt(63)&BigInt(1),e+=v5(o)),BigInt.asUintN(63,e).toString()}function C5(n,o,e){let t=2654435769,i=2654435769,r=0,a=o-12;for(;r<=a;r+=12){t+=n.getUint32(r,!0),i+=n.getUint32(r+4,!0),e+=n.getUint32(r+8,!0);let p=x5(t,i,e);t=p[0],i=p[1],e=p[2]}let c=o-r;return e+=o,c>=4?(t+=n.getUint32(r,!0),r+=4,c>=8?(i+=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&&(i+=n.getUint8(r++)),c>=6&&(i+=n.getUint8(r++)<<8),c===7&&(i+=n.getUint8(r++)<<16))):(c>=1&&(t+=n.getUint8(r++)),c>=2&&(t+=n.getUint8(r++)<<8),c===3&&(t+=n.getUint8(r++)<<16)),x5(t,i,e)[2]}function x5(n,o,e){return n-=o,n-=e,n^=e>>>13,o-=e,o-=n,o^=n<<8,e-=n,e-=o,e^=o>>>13,n-=o,n-=e,n^=e>>>12,o-=e,o-=n,o^=n<<16,e-=n,e-=o,e^=o>>>5,n-=o,n-=e,n^=e>>>3,o-=e,o-=n,o^=n<<10,e-=n,e-=o,e^=o>>>15,[n,o,e]}var OE=(function(n){return n[n.Little=0]="Little",n[n.Big=1]="Big",n})(OE||{});function lh(n,o){return K$(n,o)[1]}function K$(n,o){let e=(n&65535)+(o&65535),t=(n>>>16)+(o>>>16)+(e>>>16);return[t>>>16,t<<16|e&65535]}function Ok(n,o){return n<<o|n>>>32-o}function Y$(n,o){let e=n.length+3>>>2,t=[];for(let i=0;i<e;i++)t[i]=Z$(n,i*4,o);return t}function b5(n,o){return o>=n.length?0:n[o]}function Z$(n,o,e){let t=0;if(e===OE.Big)for(let i=0;i<4;i++)t+=b5(n,o+i)<<24-8*i;else for(let i=0;i<4;i++)t+=b5(n,o+i)<<8*i;return t}var mF=(function(n){return n[n.None=0]="None",n[n.Const=1]="Const",n})(mF||{}),l1=class{modifiers;constructor(o=mF.None){this.modifiers=o}hasModifier(o){return(this.modifiers&o)!==0}},Ed=(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})(Ed||{}),Tc=class extends l1{name;constructor(o,e){super(e),this.name=o}visitType(o,e){return o.visitBuiltinType(this,e)}},ll=class extends l1{value;typeParams;constructor(o,e,t=null){super(e),this.value=o,this.typeParams=t}visitType(o,e){return o.visitExpressionType(this,e)}};var ls=new Tc(Ed.Dynamic),Wl=new Tc(Ed.Inferred),J$=new Tc(Ed.Bool),e6e=new Tc(Ed.Int),Gp=new Tc(Ed.Number),NE=new Tc(Ed.String),t6e=new Tc(Ed.Function),Ec=new Tc(Ed.None),f_=(function(n){return n[n.Minus=0]="Minus",n[n.Plus=1]="Plus",n})(f_||{}),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 eH(n,o){return n==null||o==null?n==o:n.isEquivalent(o)}function pF(n,o,e){let t=n.length;if(t!==o.length)return!1;for(let i=0;i<t;i++)if(!e(n[i],o[i]))return!1;return!0}function Ns(n,o){return pF(n,o,(e,t)=>e.isEquivalent(t))}var Ui=class{type;sourceSpan;constructor(o,e){this.type=o||null,this.sourceSpan=e||null}prop(o,e){return new Fs(this,o,null,e)}key(o,e,t){return new Md(this,o,e,t)}callFn(o,e,t){return new cs(this,o,null,e,t)}instantiate(o,e,t){return new __(this,o,e,t)}conditional(o,e=null,t){return new Dc(this,o,e,null,t)}equals(o,e){return new vi(st.Equals,this,o,null,e)}notEquals(o,e){return new vi(st.NotEquals,this,o,null,e)}identical(o,e){return new vi(st.Identical,this,o,null,e)}notIdentical(o,e){return new vi(st.NotIdentical,this,o,null,e)}minus(o,e){return new vi(st.Minus,this,o,null,e)}plus(o,e){return new vi(st.Plus,this,o,null,e)}divide(o,e){return new vi(st.Divide,this,o,null,e)}multiply(o,e){return new vi(st.Multiply,this,o,null,e)}modulo(o,e){return new vi(st.Modulo,this,o,null,e)}power(o,e){return new vi(st.Exponentiation,this,o,null,e)}and(o,e){return new vi(st.And,this,o,null,e)}bitwiseOr(o,e){return new vi(st.BitwiseOr,this,o,null,e)}bitwiseAnd(o,e){return new vi(st.BitwiseAnd,this,o,null,e)}or(o,e){return new vi(st.Or,this,o,null,e)}lower(o,e){return new vi(st.Lower,this,o,null,e)}lowerEquals(o,e){return new vi(st.LowerEquals,this,o,null,e)}bigger(o,e){return new vi(st.Bigger,this,o,null,e)}biggerEquals(o,e){return new vi(st.BiggerEquals,this,o,null,e)}isBlank(o){return this.equals(rH,o)}nullishCoalesce(o,e){return new vi(st.NullishCoalesce,this,o,null,e)}toStmt(){return new pa(this,null)}},Gl=class n extends Ui{name;constructor(o,e,t){super(e,t),this.name=o}isEquivalent(o){return o instanceof n&&this.name===o.name}isConstant(){return!1}visitExpression(o,e){return o.visitReadVarExpr(this,e)}clone(){return new n(this.name,this.type,this.sourceSpan)}set(o){return new vi(st.Assign,this,o,null,this.sourceSpan)}},kh=class n extends Ui{expr;constructor(o,e,t){super(e,t),this.expr=o}visitExpression(o,e){return o.visitTypeofExpr(this,e)}isEquivalent(o){return o instanceof n&&o.expr.isEquivalent(this.expr)}isConstant(){return this.expr.isConstant()}clone(){return new n(this.expr.clone())}},c1=class n extends Ui{expr;constructor(o,e,t){super(e,t),this.expr=o}visitExpression(o,e){return o.visitVoidExpr(this,e)}isEquivalent(o){return o instanceof n&&o.expr.isEquivalent(this.expr)}isConstant(){return this.expr.isConstant()}clone(){return new n(this.expr.clone())}},si=class n extends Ui{node;constructor(o,e,t){super(e,t),this.node=o}isEquivalent(o){return o instanceof n&&this.node===o.node}isConstant(){return!1}visitExpression(o,e){return o.visitWrappedNodeExpr(this,e)}clone(){return new n(this.node,this.type,this.sourceSpan)}},cs=class n extends Ui{fn;args;pure;constructor(o,e,t,i,r=!1){super(t,i),this.fn=o,this.args=e,this.pure=r}get receiver(){return this.fn}isEquivalent(o){return o instanceof n&&this.fn.isEquivalent(o.fn)&&Ns(this.args,o.args)&&this.pure===o.pure}isConstant(){return!1}visitExpression(o,e){return o.visitInvokeFunctionExpr(this,e)}clone(){return new n(this.fn.clone(),this.args.map(o=>o.clone()),this.type,this.sourceSpan,this.pure)}},g_=class n extends Ui{tag;template;constructor(o,e,t,i){super(t,i),this.tag=o,this.template=e}isEquivalent(o){return o instanceof n&&this.tag.isEquivalent(o.tag)&&this.template.isEquivalent(o.template)}isConstant(){return!1}visitExpression(o,e){return o.visitTaggedTemplateLiteralExpr(this,e)}clone(){return new n(this.tag.clone(),this.template.clone(),this.type,this.sourceSpan)}},__=class n extends Ui{classExpr;args;constructor(o,e,t,i){super(t,i),this.classExpr=o,this.args=e}isEquivalent(o){return o instanceof n&&this.classExpr.isEquivalent(o.classExpr)&&Ns(this.args,o.args)}isConstant(){return!1}visitExpression(o,e){return o.visitInstantiateExpr(this,e)}clone(){return new n(this.classExpr.clone(),this.args.map(o=>o.clone()),this.type,this.sourceSpan)}},Th=class n extends Ui{body;flags;constructor(o,e,t){super(null,t),this.body=o,this.flags=e}isEquivalent(o){return o instanceof n&&this.body===o.body&&this.flags===o.flags}isConstant(){return!0}visitExpression(o,e){return o.visitRegularExpressionLiteral(this,e)}clone(){return new n(this.body,this.flags,this.sourceSpan)}},ma=class n extends Ui{value;constructor(o,e,t){super(e,t),this.value=o}isEquivalent(o){return o instanceof n&&this.value===o.value}isConstant(){return!0}visitExpression(o,e){return o.visitLiteralExpr(this,e)}clone(){return new n(this.value,this.type,this.sourceSpan)}},v_=class n extends Ui{elements;expressions;constructor(o,e,t){super(null,t),this.elements=o,this.expressions=e}isEquivalent(o){return o instanceof n&&pF(this.elements,o.elements,(e,t)=>e.text===t.text)&&Ns(this.expressions,o.expressions)}isConstant(){return!1}visitExpression(o,e){return o.visitTemplateLiteralExpr(this,e)}clone(){return new n(this.elements.map(o=>o.clone()),this.expressions.map(o=>o.clone()))}},d1=class n extends Ui{text;rawText;constructor(o,e,t){super(NE,e),this.text=o,this.rawText=t??oT(e1(o))}visitExpression(o,e){return o.visitTemplateLiteralElementExpr(this,e)}isEquivalent(o){return o instanceof n&&o.text===this.text&&o.rawText===this.rawText}isConstant(){return!0}clone(){return new n(this.text,this.sourceSpan,this.rawText)}},Vp=class{text;sourceSpan;constructor(o,e){this.text=o,this.sourceSpan=e}},yh=class{text;sourceSpan;associatedMessage;constructor(o,e,t){this.text=o,this.sourceSpan=e,this.associatedMessage=t}},tH="|",y5="@@",nH="\u241F",m1=class n extends Ui{metaBlock;messageParts;placeHolderNames;expressions;constructor(o,e,t,i,r){super(NE,r),this.metaBlock=o,this.messageParts=e,this.placeHolderNames=t,this.expressions=i}isEquivalent(o){return!1}isConstant(){return!1}visitExpression(o,e){return o.visitLocalizedString(this,e)}clone(){return new n(this.metaBlock,this.messageParts,this.placeHolderNames,this.expressions.map(o=>o.clone()),this.sourceSpan)}serializeI18nHead(){let o=this.metaBlock.description||"";return this.metaBlock.meaning&&(o=`${this.metaBlock.meaning}${tH}${o}`),this.metaBlock.customId&&(o=`${o}${y5}${this.metaBlock.customId}`),this.metaBlock.legacyIds&&this.metaBlock.legacyIds.forEach(e=>{o=`${o}${nH}${e}`}),S5(o,this.messageParts[0].text,this.getMessagePartSourceSpan(0))}getMessagePartSourceSpan(o){return this.messageParts[o]?.sourceSpan??this.sourceSpan}getPlaceholderSourceSpan(o){return this.placeHolderNames[o]?.sourceSpan??this.expressions[o]?.sourceSpan??this.sourceSpan}serializeI18nTemplatePart(o){let e=this.placeHolderNames[o-1],t=this.messageParts[o],i=e.text;return e.associatedMessage?.legacyIds.length===0&&(i+=`${y5}${dF(e.associatedMessage.messageString,e.associatedMessage.meaning)}`),S5(i,t.text,this.getMessagePartSourceSpan(o))}},e1=n=>n.replace(/\\/g,"\\\\"),iH=n=>n.replace(/^:/,"\\:"),oH=n=>n.replace(/:/g,"\\:"),oT=n=>n.replace(/`/g,"\\`").replace(/\${/g,"$\\{");function S5(n,o,e){return n===""?{cooked:o,raw:oT(iH(e1(o))),range:e}:{cooked:`:${n}:${o}`,raw:oT(`:${oH(e1(n))}:${e1(o)}`),range:e}}var qp=class n extends Ui{value;typeParams;constructor(o,e,t=null,i){super(e,i),this.value=o,this.typeParams=t}isEquivalent(o){return o instanceof n&&this.value.name===o.value.name&&this.value.moduleName===o.value.moduleName}isConstant(){return!1}visitExpression(o,e){return o.visitExternalExpr(this,e)}clone(){return new n(this.value,this.type,this.typeParams,this.sourceSpan)}};var Dc=class n extends Ui{condition;falseCase;trueCase;constructor(o,e,t=null,i,r){super(i||e.type,r),this.condition=o,this.falseCase=t,this.trueCase=e}isEquivalent(o){return o instanceof n&&this.condition.isEquivalent(o.condition)&&this.trueCase.isEquivalent(o.trueCase)&&eH(this.falseCase,o.falseCase)}isConstant(){return!1}visitExpression(o,e){return o.visitConditionalExpr(this,e)}clone(){return new n(this.condition.clone(),this.trueCase.clone(),this.falseCase?.clone(),this.type,this.sourceSpan)}};var C_=class n extends Ui{condition;constructor(o,e){super(J$,e),this.condition=o}isEquivalent(o){return o instanceof n&&this.condition.isEquivalent(o.condition)}isConstant(){return!1}visitExpression(o,e){return o.visitNotExpr(this,e)}clone(){return new n(this.condition.clone(),this.sourceSpan)}},Mr=class n{name;type;constructor(o,e=null){this.name=o,this.type=e}isEquivalent(o){return this.name===o.name}clone(){return new n(this.name,this.type)}},mm=class n extends Ui{params;statements;name;constructor(o,e,t,i,r){super(t,i),this.params=o,this.statements=e,this.name=r}isEquivalent(o){return(o instanceof n||o instanceof x_)&&Ns(this.params,o.params)&&Ns(this.statements,o.statements)}isConstant(){return!1}visitExpression(o,e){return o.visitFunctionExpr(this,e)}toDeclStmt(o,e){return new x_(o,this.params,this.statements,this.type,e,this.sourceSpan)}clone(){return new n(this.params.map(o=>o.clone()),this.statements,this.type,this.sourceSpan,this.name)}},su=class rT extends Ui{params;body;constructor(o,e,t,i){super(t,i),this.params=o,this.body=e}isEquivalent(o){return!(o instanceof rT)||!Ns(this.params,o.params)?!1:this.body instanceof Ui&&o.body instanceof Ui?this.body.isEquivalent(o.body):Array.isArray(this.body)&&Array.isArray(o.body)?Ns(this.body,o.body):!1}isConstant(){return!1}visitExpression(o,e){return o.visitArrowFunctionExpr(this,e)}clone(){return new rT(this.params.map(o=>o.clone()),Array.isArray(this.body)?this.body:this.body.clone(),this.type,this.sourceSpan)}toDeclStmt(o,e){return new Hr(o,this,Wl,e,this.sourceSpan)}},Qp=class n extends Ui{operator;expr;parens;constructor(o,e,t,i,r=!0){super(t||Gp,i),this.operator=o,this.expr=e,this.parens=r}isEquivalent(o){return o instanceof n&&this.operator===o.operator&&this.expr.isEquivalent(o.expr)}isConstant(){return!1}visitExpression(o,e){return o.visitUnaryOperatorExpr(this,e)}clone(){return new n(this.operator,this.expr.clone(),this.type,this.sourceSpan,this.parens)}},ql=class n extends Ui{expr;constructor(o,e,t){super(e,t),this.expr=o}visitExpression(o,e){return o.visitParenthesizedExpr(this,e)}isEquivalent(o){return o instanceof n&&o.expr.isEquivalent(this.expr)}isConstant(){return this.expr.isConstant()}clone(){return new n(this.expr.clone())}},vi=class n extends Ui{operator;rhs;lhs;constructor(o,e,t,i,r){super(i||e.type,r),this.operator=o,this.rhs=t,this.lhs=e}isEquivalent(o){return o instanceof n&&this.operator===o.operator&&this.lhs.isEquivalent(o.lhs)&&this.rhs.isEquivalent(o.rhs)}isConstant(){return!1}visitExpression(o,e){return o.visitBinaryOperatorExpr(this,e)}clone(){return new n(this.operator,this.lhs.clone(),this.rhs.clone(),this.type,this.sourceSpan)}isAssignment(){let o=this.operator;return o===st.Assign||o===st.AdditionAssignment||o===st.SubtractionAssignment||o===st.MultiplicationAssignment||o===st.DivisionAssignment||o===st.RemainderAssignment||o===st.ExponentiationAssignment||o===st.AndAssignment||o===st.OrAssignment||o===st.NullishCoalesceAssignment}},Fs=class n extends Ui{receiver;name;constructor(o,e,t,i){super(t,i),this.receiver=o,this.name=e}get index(){return this.name}isEquivalent(o){return o instanceof n&&this.receiver.isEquivalent(o.receiver)&&this.name===o.name}isConstant(){return!1}visitExpression(o,e){return o.visitReadPropExpr(this,e)}set(o){return new vi(st.Assign,this.receiver.prop(this.name),o,null,this.sourceSpan)}clone(){return new n(this.receiver.clone(),this.name,this.type,this.sourceSpan)}},Md=class n extends Ui{receiver;index;constructor(o,e,t,i){super(t,i),this.receiver=o,this.index=e}isEquivalent(o){return o instanceof n&&this.receiver.isEquivalent(o.receiver)&&this.index.isEquivalent(o.index)}isConstant(){return!1}visitExpression(o,e){return o.visitReadKeyExpr(this,e)}set(o){return new vi(st.Assign,this.receiver.key(this.index),o,null,this.sourceSpan)}clone(){return new n(this.receiver.clone(),this.index.clone(),this.type,this.sourceSpan)}},Pc=class n extends Ui{entries;constructor(o,e,t){super(e,t),this.entries=o}isConstant(){return this.entries.every(o=>o.isConstant())}isEquivalent(o){return o instanceof n&&Ns(this.entries,o.entries)}visitExpression(o,e){return o.visitLiteralArrayExpr(this,e)}clone(){return new n(this.entries.map(o=>o.clone()),this.type,this.sourceSpan)}},Eh=class n{key;value;quoted;constructor(o,e,t){this.key=o,this.value=e,this.quoted=t}isEquivalent(o){return this.key===o.key&&this.value.isEquivalent(o.value)}clone(){return new n(this.key,this.value.clone(),this.quoted)}isConstant(){return this.value.isConstant()}},pm=class n{expression;constructor(o){this.expression=o}isEquivalent(o){return o instanceof n&&this.expression.isEquivalent(o.expression)}clone(){return new n(this.expression.clone())}isConstant(){return this.expression.isConstant()}},Ql=class n extends Ui{entries;valueType=null;constructor(o,e,t){super(e,t),this.entries=o,e&&(this.valueType=e.valueType)}isEquivalent(o){return o instanceof n&&Ns(this.entries,o.entries)}isConstant(){return this.entries.every(o=>o.isConstant())}visitExpression(o,e){return o.visitLiteralMapExpr(this,e)}clone(){let o=this.entries.map(e=>e.clone());return new n(o,this.type,this.sourceSpan)}};var Xp=class n extends Ui{expression;constructor(o,e){super(null,e),this.expression=o}isEquivalent(o){return o instanceof n&&this.expression.isEquivalent(o.expression)}isConstant(){return this.expression.isConstant()}visitExpression(o,e){return o.visitSpreadElementExpr(this,e)}clone(){return new n(this.expression.clone(),this.sourceSpan)}},Dh=new ma(null,null,null),rH=new ma(null,Wl,null),ca=(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})(ca||{}),aT=class{text;multiline;trailingNewline;constructor(o,e,t){this.text=o,this.multiline=e,this.trailingNewline=t}toString(){return this.multiline?` ${this.text} `:this.text}},p1=class extends aT{tags;constructor(o){super("",!0,!0),this.tags=o}toString(){return dH(this.tags)}},Kp=class{modifiers;sourceSpan;leadingComments;constructor(o=ca.None,e=null,t){this.modifiers=o,this.sourceSpan=e,this.leadingComments=t}hasModifier(o){return(this.modifiers&o)!==0}addLeadingComment(o){this.leadingComments=this.leadingComments??[],this.leadingComments.push(o)}},Hr=class n extends Kp{name;value;type;constructor(o,e,t,i,r,a){super(i,r,a),this.name=o,this.value=e,this.type=t||e&&e.type||null}isEquivalent(o){return o instanceof n&&this.name===o.name&&(this.value?!!o.value&&this.value.isEquivalent(o.value):!o.value)}visitStatement(o,e){return o.visitDeclareVarStmt(this,e)}},x_=class n extends Kp{name;params;statements;type;constructor(o,e,t,i,r,a,c){super(r,a,c),this.name=o,this.params=e,this.statements=t,this.type=i||null}isEquivalent(o){return o instanceof n&&Ns(this.params,o.params)&&Ns(this.statements,o.statements)}visitStatement(o,e){return o.visitDeclareFunctionStmt(this,e)}},pa=class n extends Kp{expr;constructor(o,e,t){super(ca.None,e,t),this.expr=o}isEquivalent(o){return o instanceof n&&this.expr.isEquivalent(o.expr)}visitStatement(o,e){return o.visitExpressionStmt(this,e)}},kr=class n extends Kp{value;constructor(o,e=null,t){super(ca.None,e,t),this.value=o}isEquivalent(o){return o instanceof n&&this.value.isEquivalent(o.value)}visitStatement(o,e){return o.visitReturnStmt(this,e)}},u1=class n extends Kp{condition;trueCase;falseCase;constructor(o,e,t=[],i,r){super(ca.None,i,r),this.condition=o,this.trueCase=e,this.falseCase=t}isEquivalent(o){return o instanceof n&&this.condition.isEquivalent(o.condition)&&Ns(this.trueCase,o.trueCase)&&Ns(this.falseCase,o.falseCase)}visitStatement(o,e){return o.visitIfStmt(this,e)}};function aH(n=[]){return new p1(n)}function Jn(n,o,e){return new Gl(n,o,e)}function jt(n,o=null,e){return new qp(n,null,o,e)}function da(n,o,e){return new ll(n,o,e)}function p0(n){return new kh(n)}function Xi(n,o,e){return new Pc(n,o,e)}function cl(n,o=null){return new Ql(n.map(e=>new Eh(e.key,e.value,e.quoted)),o,null)}function sH(n,o){return new C_(n,o)}function um(n,o,e,t,i){return new mm(n,o,e,t,i)}function Rs(n,o,e,t){return new su(n,o,e,t)}function px(n,o,e,t,i){return new u1(n,o,e,t,i)}function lH(n,o,e,t){return new g_(n,o,e,t)}function Ee(n,o,e){return new ma(n,o,e)}function cH(n,o,e,t,i){return new m1(n,o,e,t,i)}function w5(n){let o="";if(n.tagName&&(o+=` @${n.tagName}`),n.text){if(n.text.match(/\/\*|\*\//))throw new Error('JSDoc text cannot contain "/*" and "*/"');o+=" "+n.text.replace(/@/g,"\\@")}return o}function dH(n){if(n.length===0)return"";if(n.length===1&&n[0].tagName&&!n[0].text)return`*${w5(n[0])} `;let o=`*
|
||
`;for(let e of n)o+=" *",o+=w5(e).replace(/\n/g,`
|
||
* `),o+=`
|
||
`;return o+=" ",o}var mH="_c",pH={},uH=50,h1=class n extends Ui{resolved;original;shared=!1;constructor(o){super(o.type),this.resolved=o,this.original=o}visitExpression(o,e){return e===pH?this.original.visitExpression(o,e):this.resolved.visitExpression(o,e)}isEquivalent(o){return o instanceof n&&this.resolved.isEquivalent(o.resolved)}isConstant(){return!0}clone(){throw new Error("Not supported.")}fixup(o){this.resolved=o,this.shared=!0}},f1=class{isClosureCompilerEnabled;statements=[];literals=new Map;literalFactories=new Map;sharedConstants=new Map;_claimedNames=new Map;nextNameIndex=0;constructor(o=!1){this.isClosureCompilerEnabled=o}getConstLiteral(o,e){if(o instanceof ma&&!M5(o)||o instanceof h1)return o;let t=b_.INSTANCE.keyOf(o),i=this.literals.get(t),r=!1;if(i||(i=new h1(o),this.literals.set(t,i),r=!0),!r&&!i.shared||r&&e){let a=this.freshName(),c,p;this.isClosureCompilerEnabled&&M5(o)?(c=new mm([],[new kr(o)]),p=Jn(a).callFn([])):(c=o,p=Jn(a)),this.statements.push(new Hr(a,c,Wl,ca.Final)),i.fixup(p)}return i}getSharedConstant(o,e){let t=o.keyOf(e);if(!this.sharedConstants.has(t)){let i=this.freshName();this.sharedConstants.set(t,Jn(i)),this.statements.push(o.toSharedConstantDeclaration(i,e))}return this.sharedConstants.get(t)}getSharedFunctionReference(o,e,t=!0){let i=o instanceof su;for(let a of this.statements)if(i&&a instanceof Hr&&a.value?.isEquivalent(o)||!i&&a instanceof x_&&o instanceof mm&&o.isEquivalent(a))return Jn(a.name);let r=t?this.uniqueName(e):e;return this.statements.push(o instanceof mm?o.toDeclStmt(r,ca.Final):new Hr(r,o,Wl,ca.Final,o.sourceSpan)),Jn(r)}uniqueName(o,e=!0){let t=this._claimedNames.get(o)??0,i=t===0&&!e?`${o}`:`${o}${t}`;return this._claimedNames.set(o,t+1),i}freshName(){return this.uniqueName(mH)}},b_=class n{static INSTANCE=new n;keyOf(o){if(o instanceof ma&&typeof o.value=="string")return`"${o.value}"`;if(o instanceof ma)return String(o.value);if(o instanceof Th)return`/${o.body}/${o.flags??""}`;if(o instanceof Pc){let e=[];for(let t of o.entries)e.push(this.keyOf(t));return`[${e.join(",")}]`}else if(o instanceof Ql){let e=[];for(let t of o.entries)if(t instanceof pm)e.push("..."+this.keyOf(t.expression));else{let i=t.key;t.quoted&&(i=`"${i}"`),e.push(i+":"+this.keyOf(t.value))}return`{${e.join(",")}}`}else{if(o instanceof qp)return`import("${o.value.moduleName}", ${o.value.name})`;if(o instanceof Gl)return`read(${o.name})`;if(o instanceof kh)return`typeof(${this.keyOf(o.expr)})`;if(o instanceof Xp)return`...${this.keyOf(o.expression)}`;throw new Error(`${this.constructor.name} does not handle expressions of type ${o.constructor.name}`)}}};function M5(n){return n instanceof ma&&typeof n.value=="string"&&n.value.length>=uH}var xe="@angular/core",fe=(()=>{class n{static core={name:null,moduleName:xe};static namespaceHTML={name:"\u0275\u0275namespaceHTML",moduleName:xe};static namespaceMathML={name:"\u0275\u0275namespaceMathML",moduleName:xe};static namespaceSVG={name:"\u0275\u0275namespaceSVG",moduleName:xe};static element={name:"\u0275\u0275element",moduleName:xe};static elementStart={name:"\u0275\u0275elementStart",moduleName:xe};static elementEnd={name:"\u0275\u0275elementEnd",moduleName:xe};static domElement={name:"\u0275\u0275domElement",moduleName:xe};static domElementStart={name:"\u0275\u0275domElementStart",moduleName:xe};static domElementEnd={name:"\u0275\u0275domElementEnd",moduleName:xe};static domElementContainer={name:"\u0275\u0275domElementContainer",moduleName:xe};static domElementContainerStart={name:"\u0275\u0275domElementContainerStart",moduleName:xe};static domElementContainerEnd={name:"\u0275\u0275domElementContainerEnd",moduleName:xe};static domTemplate={name:"\u0275\u0275domTemplate",moduleName:xe};static domListener={name:"\u0275\u0275domListener",moduleName:xe};static advance={name:"\u0275\u0275advance",moduleName:xe};static syntheticHostProperty={name:"\u0275\u0275syntheticHostProperty",moduleName:xe};static syntheticHostListener={name:"\u0275\u0275syntheticHostListener",moduleName:xe};static attribute={name:"\u0275\u0275attribute",moduleName:xe};static classProp={name:"\u0275\u0275classProp",moduleName:xe};static elementContainerStart={name:"\u0275\u0275elementContainerStart",moduleName:xe};static elementContainerEnd={name:"\u0275\u0275elementContainerEnd",moduleName:xe};static elementContainer={name:"\u0275\u0275elementContainer",moduleName:xe};static styleMap={name:"\u0275\u0275styleMap",moduleName:xe};static classMap={name:"\u0275\u0275classMap",moduleName:xe};static styleProp={name:"\u0275\u0275styleProp",moduleName:xe};static interpolate={name:"\u0275\u0275interpolate",moduleName:xe};static interpolate1={name:"\u0275\u0275interpolate1",moduleName:xe};static interpolate2={name:"\u0275\u0275interpolate2",moduleName:xe};static interpolate3={name:"\u0275\u0275interpolate3",moduleName:xe};static interpolate4={name:"\u0275\u0275interpolate4",moduleName:xe};static interpolate5={name:"\u0275\u0275interpolate5",moduleName:xe};static interpolate6={name:"\u0275\u0275interpolate6",moduleName:xe};static interpolate7={name:"\u0275\u0275interpolate7",moduleName:xe};static interpolate8={name:"\u0275\u0275interpolate8",moduleName:xe};static interpolateV={name:"\u0275\u0275interpolateV",moduleName:xe};static nextContext={name:"\u0275\u0275nextContext",moduleName:xe};static resetView={name:"\u0275\u0275resetView",moduleName:xe};static templateCreate={name:"\u0275\u0275template",moduleName:xe};static defer={name:"\u0275\u0275defer",moduleName:xe};static deferWhen={name:"\u0275\u0275deferWhen",moduleName:xe};static deferOnIdle={name:"\u0275\u0275deferOnIdle",moduleName:xe};static deferOnImmediate={name:"\u0275\u0275deferOnImmediate",moduleName:xe};static deferOnTimer={name:"\u0275\u0275deferOnTimer",moduleName:xe};static deferOnHover={name:"\u0275\u0275deferOnHover",moduleName:xe};static deferOnInteraction={name:"\u0275\u0275deferOnInteraction",moduleName:xe};static deferOnViewport={name:"\u0275\u0275deferOnViewport",moduleName:xe};static deferPrefetchWhen={name:"\u0275\u0275deferPrefetchWhen",moduleName:xe};static deferPrefetchOnIdle={name:"\u0275\u0275deferPrefetchOnIdle",moduleName:xe};static deferPrefetchOnImmediate={name:"\u0275\u0275deferPrefetchOnImmediate",moduleName:xe};static deferPrefetchOnTimer={name:"\u0275\u0275deferPrefetchOnTimer",moduleName:xe};static deferPrefetchOnHover={name:"\u0275\u0275deferPrefetchOnHover",moduleName:xe};static deferPrefetchOnInteraction={name:"\u0275\u0275deferPrefetchOnInteraction",moduleName:xe};static deferPrefetchOnViewport={name:"\u0275\u0275deferPrefetchOnViewport",moduleName:xe};static deferHydrateWhen={name:"\u0275\u0275deferHydrateWhen",moduleName:xe};static deferHydrateNever={name:"\u0275\u0275deferHydrateNever",moduleName:xe};static deferHydrateOnIdle={name:"\u0275\u0275deferHydrateOnIdle",moduleName:xe};static deferHydrateOnImmediate={name:"\u0275\u0275deferHydrateOnImmediate",moduleName:xe};static deferHydrateOnTimer={name:"\u0275\u0275deferHydrateOnTimer",moduleName:xe};static deferHydrateOnHover={name:"\u0275\u0275deferHydrateOnHover",moduleName:xe};static deferHydrateOnInteraction={name:"\u0275\u0275deferHydrateOnInteraction",moduleName:xe};static deferHydrateOnViewport={name:"\u0275\u0275deferHydrateOnViewport",moduleName:xe};static deferEnableTimerScheduling={name:"\u0275\u0275deferEnableTimerScheduling",moduleName:xe};static conditionalCreate={name:"\u0275\u0275conditionalCreate",moduleName:xe};static conditionalBranchCreate={name:"\u0275\u0275conditionalBranchCreate",moduleName:xe};static conditional={name:"\u0275\u0275conditional",moduleName:xe};static repeater={name:"\u0275\u0275repeater",moduleName:xe};static repeaterCreate={name:"\u0275\u0275repeaterCreate",moduleName:xe};static repeaterTrackByIndex={name:"\u0275\u0275repeaterTrackByIndex",moduleName:xe};static repeaterTrackByIdentity={name:"\u0275\u0275repeaterTrackByIdentity",moduleName:xe};static componentInstance={name:"\u0275\u0275componentInstance",moduleName:xe};static text={name:"\u0275\u0275text",moduleName:xe};static enableBindings={name:"\u0275\u0275enableBindings",moduleName:xe};static disableBindings={name:"\u0275\u0275disableBindings",moduleName:xe};static getCurrentView={name:"\u0275\u0275getCurrentView",moduleName:xe};static textInterpolate={name:"\u0275\u0275textInterpolate",moduleName:xe};static textInterpolate1={name:"\u0275\u0275textInterpolate1",moduleName:xe};static textInterpolate2={name:"\u0275\u0275textInterpolate2",moduleName:xe};static textInterpolate3={name:"\u0275\u0275textInterpolate3",moduleName:xe};static textInterpolate4={name:"\u0275\u0275textInterpolate4",moduleName:xe};static textInterpolate5={name:"\u0275\u0275textInterpolate5",moduleName:xe};static textInterpolate6={name:"\u0275\u0275textInterpolate6",moduleName:xe};static textInterpolate7={name:"\u0275\u0275textInterpolate7",moduleName:xe};static textInterpolate8={name:"\u0275\u0275textInterpolate8",moduleName:xe};static textInterpolateV={name:"\u0275\u0275textInterpolateV",moduleName:xe};static restoreView={name:"\u0275\u0275restoreView",moduleName:xe};static pureFunction0={name:"\u0275\u0275pureFunction0",moduleName:xe};static pureFunction1={name:"\u0275\u0275pureFunction1",moduleName:xe};static pureFunction2={name:"\u0275\u0275pureFunction2",moduleName:xe};static pureFunction3={name:"\u0275\u0275pureFunction3",moduleName:xe};static pureFunction4={name:"\u0275\u0275pureFunction4",moduleName:xe};static pureFunction5={name:"\u0275\u0275pureFunction5",moduleName:xe};static pureFunction6={name:"\u0275\u0275pureFunction6",moduleName:xe};static pureFunction7={name:"\u0275\u0275pureFunction7",moduleName:xe};static pureFunction8={name:"\u0275\u0275pureFunction8",moduleName:xe};static pureFunctionV={name:"\u0275\u0275pureFunctionV",moduleName:xe};static pipeBind1={name:"\u0275\u0275pipeBind1",moduleName:xe};static pipeBind2={name:"\u0275\u0275pipeBind2",moduleName:xe};static pipeBind3={name:"\u0275\u0275pipeBind3",moduleName:xe};static pipeBind4={name:"\u0275\u0275pipeBind4",moduleName:xe};static pipeBindV={name:"\u0275\u0275pipeBindV",moduleName:xe};static domProperty={name:"\u0275\u0275domProperty",moduleName:xe};static ariaProperty={name:"\u0275\u0275ariaProperty",moduleName:xe};static property={name:"\u0275\u0275property",moduleName:xe};static control={name:"\u0275\u0275control",moduleName:xe};static controlCreate={name:"\u0275\u0275controlCreate",moduleName:xe};static animationEnterListener={name:"\u0275\u0275animateEnterListener",moduleName:xe};static animationLeaveListener={name:"\u0275\u0275animateLeaveListener",moduleName:xe};static animationEnter={name:"\u0275\u0275animateEnter",moduleName:xe};static animationLeave={name:"\u0275\u0275animateLeave",moduleName:xe};static i18n={name:"\u0275\u0275i18n",moduleName:xe};static i18nAttributes={name:"\u0275\u0275i18nAttributes",moduleName:xe};static i18nExp={name:"\u0275\u0275i18nExp",moduleName:xe};static i18nStart={name:"\u0275\u0275i18nStart",moduleName:xe};static i18nEnd={name:"\u0275\u0275i18nEnd",moduleName:xe};static i18nApply={name:"\u0275\u0275i18nApply",moduleName:xe};static i18nPostprocess={name:"\u0275\u0275i18nPostprocess",moduleName:xe};static pipe={name:"\u0275\u0275pipe",moduleName:xe};static projection={name:"\u0275\u0275projection",moduleName:xe};static projectionDef={name:"\u0275\u0275projectionDef",moduleName:xe};static reference={name:"\u0275\u0275reference",moduleName:xe};static inject={name:"\u0275\u0275inject",moduleName:xe};static injectAttribute={name:"\u0275\u0275injectAttribute",moduleName:xe};static directiveInject={name:"\u0275\u0275directiveInject",moduleName:xe};static invalidFactory={name:"\u0275\u0275invalidFactory",moduleName:xe};static invalidFactoryDep={name:"\u0275\u0275invalidFactoryDep",moduleName:xe};static templateRefExtractor={name:"\u0275\u0275templateRefExtractor",moduleName:xe};static forwardRef={name:"forwardRef",moduleName:xe};static resolveForwardRef={name:"resolveForwardRef",moduleName:xe};static replaceMetadata={name:"\u0275\u0275replaceMetadata",moduleName:xe};static getReplaceMetadataURL={name:"\u0275\u0275getReplaceMetadataURL",moduleName:xe};static \u0275\u0275defineInjectable={name:"\u0275\u0275defineInjectable",moduleName:xe};static declareInjectable={name:"\u0275\u0275ngDeclareInjectable",moduleName:xe};static InjectableDeclaration={name:"\u0275\u0275InjectableDeclaration",moduleName:xe};static resolveWindow={name:"\u0275\u0275resolveWindow",moduleName:xe};static resolveDocument={name:"\u0275\u0275resolveDocument",moduleName:xe};static resolveBody={name:"\u0275\u0275resolveBody",moduleName:xe};static getComponentDepsFactory={name:"\u0275\u0275getComponentDepsFactory",moduleName:xe};static defineComponent={name:"\u0275\u0275defineComponent",moduleName:xe};static declareComponent={name:"\u0275\u0275ngDeclareComponent",moduleName:xe};static setComponentScope={name:"\u0275\u0275setComponentScope",moduleName:xe};static ChangeDetectionStrategy={name:"ChangeDetectionStrategy",moduleName:xe};static ViewEncapsulation={name:"ViewEncapsulation",moduleName:xe};static ComponentDeclaration={name:"\u0275\u0275ComponentDeclaration",moduleName:xe};static FactoryDeclaration={name:"\u0275\u0275FactoryDeclaration",moduleName:xe};static declareFactory={name:"\u0275\u0275ngDeclareFactory",moduleName:xe};static FactoryTarget={name:"\u0275\u0275FactoryTarget",moduleName:xe};static defineDirective={name:"\u0275\u0275defineDirective",moduleName:xe};static declareDirective={name:"\u0275\u0275ngDeclareDirective",moduleName:xe};static DirectiveDeclaration={name:"\u0275\u0275DirectiveDeclaration",moduleName:xe};static InjectorDef={name:"\u0275\u0275InjectorDef",moduleName:xe};static InjectorDeclaration={name:"\u0275\u0275InjectorDeclaration",moduleName:xe};static defineInjector={name:"\u0275\u0275defineInjector",moduleName:xe};static declareInjector={name:"\u0275\u0275ngDeclareInjector",moduleName:xe};static NgModuleDeclaration={name:"\u0275\u0275NgModuleDeclaration",moduleName:xe};static ModuleWithProviders={name:"ModuleWithProviders",moduleName:xe};static defineNgModule={name:"\u0275\u0275defineNgModule",moduleName:xe};static declareNgModule={name:"\u0275\u0275ngDeclareNgModule",moduleName:xe};static setNgModuleScope={name:"\u0275\u0275setNgModuleScope",moduleName:xe};static registerNgModuleType={name:"\u0275\u0275registerNgModuleType",moduleName:xe};static PipeDeclaration={name:"\u0275\u0275PipeDeclaration",moduleName:xe};static definePipe={name:"\u0275\u0275definePipe",moduleName:xe};static declarePipe={name:"\u0275\u0275ngDeclarePipe",moduleName:xe};static declareClassMetadata={name:"\u0275\u0275ngDeclareClassMetadata",moduleName:xe};static declareClassMetadataAsync={name:"\u0275\u0275ngDeclareClassMetadataAsync",moduleName:xe};static setClassMetadata={name:"\u0275setClassMetadata",moduleName:xe};static setClassMetadataAsync={name:"\u0275setClassMetadataAsync",moduleName:xe};static setClassDebugInfo={name:"\u0275setClassDebugInfo",moduleName:xe};static queryRefresh={name:"\u0275\u0275queryRefresh",moduleName:xe};static viewQuery={name:"\u0275\u0275viewQuery",moduleName:xe};static loadQuery={name:"\u0275\u0275loadQuery",moduleName:xe};static contentQuery={name:"\u0275\u0275contentQuery",moduleName:xe};static viewQuerySignal={name:"\u0275\u0275viewQuerySignal",moduleName:xe};static contentQuerySignal={name:"\u0275\u0275contentQuerySignal",moduleName:xe};static queryAdvance={name:"\u0275\u0275queryAdvance",moduleName:xe};static twoWayProperty={name:"\u0275\u0275twoWayProperty",moduleName:xe};static twoWayBindingSet={name:"\u0275\u0275twoWayBindingSet",moduleName:xe};static twoWayListener={name:"\u0275\u0275twoWayListener",moduleName:xe};static declareLet={name:"\u0275\u0275declareLet",moduleName:xe};static storeLet={name:"\u0275\u0275storeLet",moduleName:xe};static readContextLet={name:"\u0275\u0275readContextLet",moduleName:xe};static arrowFunction={name:"\u0275\u0275arrowFunction",moduleName:xe};static attachSourceLocations={name:"\u0275\u0275attachSourceLocations",moduleName:xe};static NgOnChangesFeature={name:"\u0275\u0275NgOnChangesFeature",moduleName:xe};static ControlFeature={name:"\u0275\u0275ControlFeature",moduleName:xe};static InheritDefinitionFeature={name:"\u0275\u0275InheritDefinitionFeature",moduleName:xe};static ProvidersFeature={name:"\u0275\u0275ProvidersFeature",moduleName:xe};static HostDirectivesFeature={name:"\u0275\u0275HostDirectivesFeature",moduleName:xe};static ExternalStylesFeature={name:"\u0275\u0275ExternalStylesFeature",moduleName:xe};static listener={name:"\u0275\u0275listener",moduleName:xe};static getInheritedFactory={name:"\u0275\u0275getInheritedFactory",moduleName:xe};static sanitizeHtml={name:"\u0275\u0275sanitizeHtml",moduleName:xe};static sanitizeStyle={name:"\u0275\u0275sanitizeStyle",moduleName:xe};static validateAttribute={name:"\u0275\u0275validateAttribute",moduleName:xe};static sanitizeResourceUrl={name:"\u0275\u0275sanitizeResourceUrl",moduleName:xe};static sanitizeScript={name:"\u0275\u0275sanitizeScript",moduleName:xe};static sanitizeUrl={name:"\u0275\u0275sanitizeUrl",moduleName:xe};static sanitizeUrlOrResourceUrl={name:"\u0275\u0275sanitizeUrlOrResourceUrl",moduleName:xe};static trustConstantHtml={name:"\u0275\u0275trustConstantHtml",moduleName:xe};static trustConstantResourceUrl={name:"\u0275\u0275trustConstantResourceUrl",moduleName:xe};static inputDecorator={name:"Input",moduleName:xe};static outputDecorator={name:"Output",moduleName:xe};static viewChildDecorator={name:"ViewChild",moduleName:xe};static viewChildrenDecorator={name:"ViewChildren",moduleName:xe};static contentChildDecorator={name:"ContentChild",moduleName:xe};static contentChildrenDecorator={name:"ContentChildren",moduleName:xe};static InputSignalBrandWriteType={name:"\u0275INPUT_SIGNAL_BRAND_WRITE_TYPE",moduleName:xe};static UnwrapDirectiveSignalInputs={name:"\u0275UnwrapDirectiveSignalInputs",moduleName:xe};static unwrapWritableSignal={name:"\u0275unwrapWritableSignal",moduleName:xe};static assertType={name:"\u0275assertType",moduleName:xe}}return n})(),hH=/-+([a-z0-9])/g;function fH(n){return n.replace(hH,(...o)=>o[1].toUpperCase())}function gH(n,o){return uF(n,":",o)}function _H(n,o){return uF(n,".",o)}function uF(n,o,e){let t=n.indexOf(o);return t==-1?e:[n.slice(0,t).trim(),n.slice(t+1).trim()]}function vH(n){let o=[];for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);if(t>=55296&&t<=56319&&n.length>e+1){let i=n.charCodeAt(e+1);i>=56320&&i<=57343&&(e++,t=(t-55296<<10)+i-56320+65536)}t<=127?o.push(t):t<=2047?o.push(t>>6&31|192,t&63|128):t<=65535?o.push(t>>12|224,t>>6&63|128,t&63|128):t<=2097151&&o.push(t>>18&7|240,t>>12&63|128,t>>6&63|128,t&63|128)}return o}function hF(n){if(typeof n=="string")return n;if(Array.isArray(n))return`[${n.map(hF).join(", ")}]`;if(n==null)return""+n;let o=n.overriddenName||n.name;if(o)return`${o}`;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 sT=class{full;major;minor;patch;constructor(o){this.full=o;let e=o.split(".");this.major=e[0],this.minor=e[1],this.patch=e.slice(2).join(".")}},a_=globalThis,CH=/^([1-9]|1[0-8])\./;function fF(n){return n.startsWith("0.")?!0:!CH.test(n)}var xH=3,bH="# sourceMappingURL=data:application/json;base64,",lT=class{file;sourcesContent=new Map;lines=[];lastCol0=0;hasMappings=!1;constructor(o=null){this.file=o}addSource(o,e=null){return this.sourcesContent.has(o)||this.sourcesContent.set(o,e),this}addLine(){return this.lines.push([]),this.lastCol0=0,this}addMapping(o,e,t,i){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(o==null)throw new Error("The column in the generated code must be provided");if(o<this.lastCol0)throw new Error("Mapping should be added in output order");if(e&&(t==null||i==null))throw new Error("The source location must be provided when a source url is provided");return this.hasMappings=!0,this.lastCol0=o,this.currentLine.push({col0:o,sourceUrl:e,sourceLine0:t,sourceCol0:i}),this}get currentLine(){return this.lines.slice(-1)[0]}toJSON(){if(!this.hasMappings)return null;let o=new Map,e=[],t=[];Array.from(this.sourcesContent.keys()).forEach((u,h)=>{o.set(u,h),e.push(u),t.push(this.sourcesContent.get(u)||null)});let i="",r=0,a=0,c=0,p=0;return this.lines.forEach(u=>{r=0,i+=u.map(h=>{let g=jC(h.col0-r);return r=h.col0,h.sourceUrl!=null&&(g+=jC(o.get(h.sourceUrl)-a),a=o.get(h.sourceUrl),g+=jC(h.sourceLine0-c),c=h.sourceLine0,g+=jC(h.sourceCol0-p),p=h.sourceCol0),g}).join(","),i+=";"}),i=i.slice(0,-1),{file:this.file||"",version:xH,sourceRoot:"",sources:e,sourcesContent:t,mappings:i}}toJsComment(){return this.hasMappings?"//"+bH+yH(JSON.stringify(this,null,0)):""}};function yH(n){let o="",e=vH(n);for(let t=0;t<e.length;){let i=e[t++],r=t<e.length?e[t++]:null,a=t<e.length?e[t++]:null;o+=t_(i>>2),o+=t_((i&3)<<4|(r===null?0:r>>4)),o+=r===null?"=":t_((r&15)<<2|(a===null?0:a>>6)),o+=r===null||a===null?"=":t_(a&63)}return o}function jC(n){n=n<0?(-n<<1)+1:n<<1;let o="";do{let e=n&31;n=n>>5,n>0&&(e=e|32),o+=t_(e)}while(n>0);return o}var SH="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function t_(n){if(n<0||n>=64)throw new Error("Can only encode value in the range [0, 63]");return SH[n]}var wH=/'|\\|\n|\r|\$/g,MH=/^[$A-Z_][0-9A-Z_$]*$/i,cT=" ",g1=class{indent;partsLength=0;parts=[];srcSpans=[];constructor(o){this.indent=o}},kH=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,"??="]]),dT=class n{_indent;static createRoot(){return new n(0)}_lines;constructor(o){this._indent=o,this._lines=[new g1(o)]}get _currentLine(){return this._lines[this._lines.length-1]}println(o,e=""){this.print(o||null,e,!0)}lineIsEmpty(){return this._currentLine.parts.length===0}lineLength(){return this._currentLine.indent*cT.length+this._currentLine.partsLength}print(o,e,t=!1){e.length>0&&(this._currentLine.parts.push(e),this._currentLine.partsLength+=e.length,this._currentLine.srcSpans.push(o&&o.sourceSpan||null)),t&&this._lines.push(new g1(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(o=>o.parts.length>0?k5(o.indent)+o.parts.join(""):"").join(`
|
||
`)}toSourceMapGenerator(o,e=0){let t=new lT(o),i=!1,r=()=>{i||(t.addSource(o," ").addMapping(0,o,0,0),i=!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*cT.length,g=0;for(;g<p.length&&!p[g];)h+=u[g].length,g++;for(g<p.length&&c===0&&h===0?i=!0:r();g<p.length;){let y=p[g],b=y.start.file,x=y.start.line,M=y.start.col;for(t.addSource(b.url,b.content).addMapping(h,b.url,x,M),h+=u[g].length,g++;g<p.length&&(y===p[g]||!p[g]);)h+=u[g].length,g++}}),t}spanOf(o,e){let t=this._lines[o];if(t){let i=e-k5(t.indent).length;for(let r=0;r<t.parts.length;r++){let a=t.parts[r];if(a.length>i)return t.srcSpans[r];i-=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}},mT=class{_escapeDollarInStrings;lastIfCondition=null;constructor(o){this._escapeDollarInStrings=o}printLeadingComments(o,e){if(o.leadingComments!==void 0)for(let t of o.leadingComments)t instanceof p1?e.print(o,`/*${t.toString()}*/`,t.trailingNewline):t.multiline?e.print(o,`/* ${t.text} */`,t.trailingNewline):t.text.split(`
|
||
`).forEach(i=>{e.println(o,`// ${i}`)})}visitExpressionStmt(o,e){return this.printLeadingComments(o,e),o.expr.visitExpression(this,e),e.println(o,";"),null}visitReturnStmt(o,e){return this.printLeadingComments(o,e),e.print(o,"return "),o.value.visitExpression(this,e),e.println(o,";"),null}visitIfStmt(o,e){this.printLeadingComments(o,e),e.print(o,"if ("),this.lastIfCondition=o.condition,o.condition.visitExpression(this,e),this.lastIfCondition=null,e.print(o,") {");let t=o.falseCase!=null&&o.falseCase.length>0;return o.trueCase.length<=1&&!t?(e.print(o," "),this.visitAllStatements(o.trueCase,e),e.removeEmptyLastLine(),e.print(o," ")):(e.println(),e.incIndent(),this.visitAllStatements(o.trueCase,e),e.decIndent(),t&&(e.println(o,"} else {"),e.incIndent(),this.visitAllStatements(o.falseCase,e),e.decIndent())),e.println(o,"}"),null}visitInvokeFunctionExpr(o,e){let t=o.fn instanceof su;return t&&e.print(o.fn,"("),o.fn.visitExpression(this,e),t&&e.print(o.fn,")"),e.print(o,"("),this.visitAllExpressions(o.args,e,","),e.print(o,")"),null}visitTaggedTemplateLiteralExpr(o,e){return o.tag.visitExpression(this,e),o.template.visitExpression(this,e),null}visitTemplateLiteralExpr(o,e){e.print(o,"`");for(let t=0;t<o.elements.length;t++){o.elements[t].visitExpression(this,e);let i=t<o.expressions.length?o.expressions[t]:null;i!==null&&(e.print(i,"${"),i.visitExpression(this,e),e.print(i,"}"))}e.print(o,"`")}visitTemplateLiteralElementExpr(o,e){e.print(o,o.rawText)}visitWrappedNodeExpr(o,e){throw new Error("Abstract emitter cannot visit WrappedNodeExpr.")}visitTypeofExpr(o,e){e.print(o,"typeof "),o.expr.visitExpression(this,e)}visitVoidExpr(o,e){e.print(o,"void "),o.expr.visitExpression(this,e)}visitReadVarExpr(o,e){return e.print(o,o.name),null}visitInstantiateExpr(o,e){return e.print(o,"new "),o.classExpr.visitExpression(this,e),e.print(o,"("),this.visitAllExpressions(o.args,e,","),e.print(o,")"),null}visitLiteralExpr(o,e){let t=o.value;return typeof t=="string"?e.print(o,Np(t,this._escapeDollarInStrings)):e.print(o,`${t}`),null}visitRegularExpressionLiteral(o,e){return e.print(o,`/${o.body}/${o.flags||""}`),null}visitLocalizedString(o,e){let t=o.serializeI18nHead();e.print(o,"$localize `"+t.raw);for(let i=1;i<o.messageParts.length;i++)e.print(o,"${"),o.expressions[i-1].visitExpression(this,e),e.print(o,`}${o.serializeI18nTemplatePart(i).raw}`);return e.print(o,"`"),null}visitConditionalExpr(o,e){return e.print(o,"("),o.condition.visitExpression(this,e),e.print(o,"? "),o.trueCase.visitExpression(this,e),e.print(o,": "),o.falseCase.visitExpression(this,e),e.print(o,")"),null}visitDynamicImportExpr(o,e){e.print(o,`import(${o.url})`)}visitNotExpr(o,e){return e.print(o,"!"),o.condition.visitExpression(this,e),null}visitUnaryOperatorExpr(o,e){let t;switch(o.operator){case f_.Plus:t="+";break;case f_.Minus:t="-";break;default:throw new Error(`Unknown operator ${o.operator}`)}let i=o!==this.lastIfCondition;return i&&e.print(o,"("),e.print(o,t),o.expr.visitExpression(this,e),i&&e.print(o,")"),null}visitBinaryOperatorExpr(o,e){let t=kH.get(o.operator);if(!t)throw new Error(`Unknown operator ${o.operator}`);let i=o!==this.lastIfCondition;return i&&e.print(o,"("),o.lhs.visitExpression(this,e),e.print(o,` ${t} `),o.rhs.visitExpression(this,e),i&&e.print(o,")"),null}visitReadPropExpr(o,e){return o.receiver.visitExpression(this,e),e.print(o,"."),e.print(o,o.name),null}visitReadKeyExpr(o,e){return o.receiver.visitExpression(this,e),e.print(o,"["),o.index.visitExpression(this,e),e.print(o,"]"),null}visitLiteralArrayExpr(o,e){return e.print(o,"["),this.visitAllExpressions(o.entries,e,","),e.print(o,"]"),null}visitLiteralMapExpr(o,e){return e.print(o,"{"),this.visitAllObjects(t=>{t instanceof pm?(e.print(o,"..."),t.expression.visitExpression(this,e)):(e.print(o,`${Np(t.key,this._escapeDollarInStrings,t.quoted)}:`),t.value.visitExpression(this,e))},o.entries,e,","),e.print(o,"}"),null}visitCommaExpr(o,e){return e.print(o,"("),this.visitAllExpressions(o.parts,e,","),e.print(o,")"),null}visitParenthesizedExpr(o,e){o.expr.visitExpression(this,e)}visitSpreadElementExpr(o,e){e.print(o,"..."),o.expression.visitExpression(this,e)}visitAllExpressions(o,e,t){this.visitAllObjects(i=>i.visitExpression(this,e),o,e,t)}visitAllObjects(o,e,t,i){let r=!1;for(let a=0;a<e.length;a++)a>0&&(t.lineLength()>80?(t.print(null,i,!0),r||(t.incIndent(),t.incIndent(),r=!0)):t.print(null,i,!1)),o(e[a]);r&&(t.decIndent(),t.decIndent())}visitAllStatements(o,e){o.forEach(t=>t.visitStatement(this,e))}};function Np(n,o,e=!0){if(n==null)return null;let t=n.replace(wH,(...r)=>r[0]=="$"?o?"\\$":"$":r[0]==`
|
||
`?"\\n":r[0]=="\r"?"\\r":`\\${r[0]}`);return e||!MH.test(t)?`'${t}'`:t}function k5(n){let o="";for(let e=0;e<n;e++)o+=cT;return o}function ux(n,o){if(o===0)return da(n);let e=[];for(let t=0;t<o;t++)e.push(ls);return da(n,void 0,e)}function TH(n,o){let e=Np(o,!1,!1);return e!==o?`${n}[${e}]`:`${n}.${o}`}function EH(n){return DH("ngJitMode",n)}function DH(n,o){let e=new qp({name:n,moduleName:null}),t=new vi(st.Identical,new kh(e),Ee("undefined")),i=new vi(st.Or,t,e,void 0,void 0);return new vi(st.And,i,o)}function jr(n){let o=new si(n);return{value:o,type:o}}function Fp(n,o){let e=Xi(n.map(t=>t.value));return o?Rs([],e):e}function FE(n,o){return{expression:n,forwardRef:o}}function PH({expression:n,forwardRef:o}){switch(o){case 0:case 1:return n;case 2:return IH(n)}}function IH(n){return jt(fe.forwardRef).callFn([Rs([],n)])}var _1=(function(n){return n[n.Class=0]="Class",n[n.Function=1]="Function",n})(_1||{});function Ip(n){let o=Jn("__ngFactoryType__"),e=null,t=E5(n)?o:new vi(st.Or,o,n.type.value),i=null;n.deps!==null?n.deps!=="invalid"&&(i=new __(t,T5(n.deps,n.target))):(e=Jn(`\u0275${n.name}_BaseFactory`),i=e.callFn([t]));let r=[],a=null;function c(u){let h=Jn("__ngConditionalFactory__");r.push(new Hr(h.name,Dh,Wl));let g=i!==null?h.set(i).toStmt():jt(fe.invalidFactory).callFn([]).toStmt();return r.push(px(o,[g],[h.set(u).toStmt()])),h}if(E5(n)){let u=T5(n.delegateDeps,n.target),h=new(n.delegateType===_1.Class?__:cs)(n.delegate,u);a=c(h)}else RH(n)?a=c(n.expression):a=i;if(a===null)r.push(jt(fe.invalidFactory).callFn([]).toStmt());else if(e!==null){let u=jt(fe.getInheritedFactory).callFn([n.type.value]),h=new vi(st.Or,e,e.set(u));r.push(new kr(h.callFn([t])))}else r.push(new kr(a));let p=um([new Mr(o.name,ls)],r,Wl,void 0,`${n.name}_Factory`);return e!==null&&(p=Rs([],[new Hr(e.name),new kr(p)]).callFn([],void 0,!0)),{expression:p,statements:[],type:AH(n)}}function AH(n){let o=n.deps!==null&&n.deps!=="invalid"?NH(n.deps):Ec;return da(jt(fe.FactoryDeclaration,[ux(n.type.type,n.typeArgumentCount),o]))}function T5(n,o){return n.map((e,t)=>OH(e,o,t))}function OH(n,o,e){if(n.token===null)return jt(fe.invalidFactoryDep).callFn([Ee(e)]);if(n.attributeNameType===null){let t=0|(n.self?2:0)|(n.skipSelf?4:0)|(n.host?1:0)|(n.optional?8:0)|(o===xd.Pipe?16:0),i=t!==0||n.optional?Ee(t):null,r=[n.token];i&&r.push(i);let a=LH(o);return jt(a).callFn(r)}else return jt(fe.injectAttribute).callFn([n.token])}function NH(n){let o=!1,e=n.map(t=>{let i=FH(t);return i!==null?(o=!0,i):Ee(null)});return o?da(Xi(e)):Ec}function FH(n){let o=[];return n.attributeNameType!==null&&o.push({key:"attribute",value:n.attributeNameType,quoted:!1}),n.optional&&o.push({key:"optional",value:Ee(!0),quoted:!1}),n.host&&o.push({key:"host",value:Ee(!0),quoted:!1}),n.self&&o.push({key:"self",value:Ee(!0),quoted:!1}),n.skipSelf&&o.push({key:"skipSelf",value:Ee(!0),quoted:!1}),o.length>0?cl(o):null}function E5(n){return n.delegateType!==void 0}function RH(n){return n.expression!==void 0}function LH(n){switch(n){case xd.Component:case xd.Directive:case xd.Pipe:return fe.directiveInject;case xd.NgModule:case xd.Injectable:default:return fe.inject}}var Yp=class{start;end;constructor(o,e){this.start=o,this.end=e}toAbsolute(o){return new As(o+this.start,o+this.end)}},no=class{span;sourceSpan;constructor(o,e){this.span=o,this.sourceSpan=e}toString(){return"AST"}},y_=class extends no{nameSpan;constructor(o,e,t){super(o,e),this.nameSpan=t}},ba=class extends no{visit(o,e=null){return o.visitEmptyExpr?.(this,e)}},Ic=class extends no{visit(o,e=null){return o.visitImplicitReceiver(this,e)}},S_=class extends no{visit(o,e=null){return o.visitThisReceiver?.(this,e)}},Ph=class extends no{expressions;constructor(o,e,t){super(o,e),this.expressions=t}visit(o,e=null){return o.visitChain(this,e)}},v1=class extends no{condition;trueExp;falseExp;constructor(o,e,t,i,r){super(o,e),this.condition=t,this.trueExp=i,this.falseExp=r}visit(o,e=null){return o.visitConditional(this,e)}},Mc=class extends y_{receiver;name;constructor(o,e,t,i,r){super(o,e,t),this.receiver=i,this.name=r}visit(o,e=null){return o.visitPropertyRead(this,e)}},w_=class extends y_{receiver;name;constructor(o,e,t,i,r){super(o,e,t),this.receiver=i,this.name=r}visit(o,e=null){return o.visitSafePropertyRead(this,e)}},Zp=class extends no{receiver;key;constructor(o,e,t,i){super(o,e),this.receiver=t,this.key=i}visit(o,e=null){return o.visitKeyedRead(this,e)}},M_=class extends no{receiver;key;constructor(o,e,t,i){super(o,e),this.receiver=t,this.key=i}visit(o,e=null){return o.visitSafeKeyedRead(this,e)}},t1=(function(n){return n[n.ReferencedByName=0]="ReferencedByName",n[n.ReferencedDirectly=1]="ReferencedDirectly",n})(t1||{}),C1=class extends y_{exp;name;args;type;constructor(o,e,t,i,r,a,c){super(o,e,c),this.exp=t,this.name=i,this.args=r,this.type=a}visit(o,e=null){return o.visitPipe(this,e)}},os=class extends no{value;constructor(o,e,t){super(o,e),this.value=t}visit(o,e=null){return o.visitLiteralPrimitive(this,e)}},k_=class extends no{expressions;constructor(o,e,t){super(o,e),this.expressions=t}visit(o,e=null){return o.visitLiteralArray(this,e)}},x1=class extends no{expression;constructor(o,e,t){super(o,e),this.expression=t}visit(o,e=null){return o.visitSpreadElement(this,e)}},Jp=class extends no{keys;values;constructor(o,e,t,i){super(o,e),this.keys=t,this.values=i}visit(o,e=null){return o.visitLiteralMap(this,e)}},u0=class extends no{strings;expressions;constructor(o,e,t,i){super(o,e),this.strings=t,this.expressions=i}visit(o,e=null){return o.visitInterpolation(this,e)}},La=class extends no{operation;left;right;constructor(o,e,t,i,r){super(o,e),this.operation=t,this.left=i,this.right=r}visit(o,e=null){return o.visitBinary(this,e)}static isAssignmentOperation(o){return o==="="||o==="+="||o==="-="||o==="*="||o==="/="||o==="%="||o==="**="||o==="&&="||o==="||="||o==="??="}},Sh=class n extends La{operator;expr;left=null;right=null;operation=null;static createMinus(o,e,t){return new n(o,e,"-",t,"-",new os(o,e,0),t)}static createPlus(o,e,t){return new n(o,e,"+",t,"-",t,new os(o,e,0))}constructor(o,e,t,i,r,a,c){super(o,e,r,a,c),this.operator=t,this.expr=i}visit(o,e=null){return o.visitUnary!==void 0?o.visitUnary(this,e):o.visitBinary(this,e)}},T_=class extends no{expression;constructor(o,e,t){super(o,e),this.expression=t}visit(o,e=null){return o.visitPrefixNot(this,e)}},E_=class extends no{expression;constructor(o,e,t){super(o,e),this.expression=t}visit(o,e=null){return o.visitTypeofExpression(this,e)}},D_=class extends no{expression;constructor(o,e,t){super(o,e),this.expression=t}visit(o,e=null){return o.visitVoidExpression(this,e)}},P_=class extends no{expression;constructor(o,e,t){super(o,e),this.expression=t}visit(o,e=null){return o.visitNonNullAssert(this,e)}},Ih=class extends no{receiver;args;argumentSpan;constructor(o,e,t,i,r){super(o,e),this.receiver=t,this.args=i,this.argumentSpan=r}visit(o,e=null){return o.visitCall(this,e)}},b1=class extends no{receiver;args;argumentSpan;constructor(o,e,t,i,r){super(o,e),this.receiver=t,this.args=i,this.argumentSpan=r}visit(o,e=null){return o.visitSafeCall(this,e)}},I_=class extends no{tag;template;constructor(o,e,t,i){super(o,e),this.tag=t,this.template=i}visit(o,e){return o.visitTaggedTemplateLiteral(this,e)}},A_=class extends no{elements;expressions;constructor(o,e,t,i){super(o,e),this.elements=t,this.expressions=i}visit(o,e){return o.visitTemplateLiteral(this,e)}},y1=class extends no{text;constructor(o,e,t){super(o,e),this.text=t}visit(o,e){return o.visitTemplateLiteralElement(this,e)}},O_=class extends no{expression;constructor(o,e,t){super(o,e),this.expression=t}visit(o,e){return o.visitParenthesizedExpression(this,e)}},pT=class{name;span;sourceSpan;constructor(o,e,t){this.name=o,this.span=e,this.sourceSpan=t}},S1=class extends no{parameters;body;constructor(o,e,t,i){super(o,e),this.parameters=t,this.body=i}visit(o,e){return o.visitArrowFunction(this,e)}},w1=class extends no{body;flags;constructor(o,e,t,i){super(o,e),this.body=t,this.flags=i}visit(o,e){return o.visitRegularExpressionLiteral(this,e)}},As=class{start;end;constructor(o,e){this.start=o,this.end=e}},as=class extends no{ast;source;location;errors;constructor(o,e,t,i,r){super(new Yp(0,e===null?0:e.length),new As(i,e===null?i:i+e.length)),this.ast=o,this.source=e,this.location=t,this.errors=r}visit(o,e=null){return o.visitASTWithSource?o.visitASTWithSource(this,e):this.ast.visit(o,e)}toString(){return`${this.source} in ${this.location}`}},N_=class{sourceSpan;key;value;constructor(o,e,t){this.sourceSpan=o,this.key=e,this.value=t}},uT=class{sourceSpan;key;value;constructor(o,e,t){this.sourceSpan=o,this.key=e,this.value=t}},Ah=class{visit(o,e){o.visit(this,e)}visitUnary(o,e){this.visit(o.expr,e)}visitBinary(o,e){this.visit(o.left,e),this.visit(o.right,e)}visitChain(o,e){this.visitAll(o.expressions,e)}visitConditional(o,e){this.visit(o.condition,e),this.visit(o.trueExp,e),this.visit(o.falseExp,e)}visitPipe(o,e){this.visit(o.exp,e),this.visitAll(o.args,e)}visitImplicitReceiver(o,e){}visitThisReceiver(o,e){}visitInterpolation(o,e){this.visitAll(o.expressions,e)}visitKeyedRead(o,e){this.visit(o.receiver,e),this.visit(o.key,e)}visitLiteralArray(o,e){this.visitAll(o.expressions,e)}visitLiteralMap(o,e){this.visitAll(o.values,e)}visitLiteralPrimitive(o,e){}visitPrefixNot(o,e){this.visit(o.expression,e)}visitTypeofExpression(o,e){this.visit(o.expression,e)}visitVoidExpression(o,e){this.visit(o.expression,e)}visitNonNullAssert(o,e){this.visit(o.expression,e)}visitPropertyRead(o,e){this.visit(o.receiver,e)}visitSafePropertyRead(o,e){this.visit(o.receiver,e)}visitSafeKeyedRead(o,e){this.visit(o.receiver,e),this.visit(o.key,e)}visitCall(o,e){this.visit(o.receiver,e),this.visitAll(o.args,e)}visitSafeCall(o,e){this.visit(o.receiver,e),this.visitAll(o.args,e)}visitTemplateLiteral(o,e){for(let t=0;t<o.elements.length;t++){this.visit(o.elements[t],e);let i=t<o.expressions.length?o.expressions[t]:null;i!==null&&this.visit(i,e)}}visitTemplateLiteralElement(o,e){}visitTaggedTemplateLiteral(o,e){this.visit(o.tag,e),this.visit(o.template,e)}visitParenthesizedExpression(o,e){this.visit(o.expression,e)}visitArrowFunction(o,e){this.visit(o.body,e)}visitRegularExpressionLiteral(o,e){}visitSpreadElement(o,e){this.visit(o.expression,e)}visitEmptyExpr(o,e){}visitAll(o,e){for(let t of o)this.visit(t,e)}},_h=class{name;expression;type;sourceSpan;keySpan;valueSpan;isLiteral;isLegacyAnimation;isAnimation;constructor(o,e,t,i,r,a){this.name=o,this.expression=e,this.type=t,this.sourceSpan=i,this.keySpan=r,this.valueSpan=a,this.isLiteral=this.type===bc.LITERAL_ATTR,this.isLegacyAnimation=this.type===bc.LEGACY_ANIMATION,this.isAnimation=this.type===bc.ANIMATION}},bc=(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})(bc||{}),$a=(function(n){return n[n.Regular=0]="Regular",n[n.LegacyAnimation=1]="LegacyAnimation",n[n.TwoWay=2]="TwoWay",n[n.Animation=3]="Animation",n})($a||{}),M1=class{name;targetOrPhase;type;handler;sourceSpan;handlerSpan;keySpan;constructor(o,e,t,i,r,a,c){this.name=o,this.targetOrPhase=e,this.type=t,this.handler=i,this.sourceSpan=r,this.handlerSpan=a,this.keySpan=c}},hT=class{name;value;sourceSpan;keySpan;valueSpan;constructor(o,e,t,i,r){this.name=o,this.value=e,this.sourceSpan=t,this.keySpan=i,this.valueSpan=r}},Di=(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})(Di||{}),k1=class{name;type;securityContext;value;unit;sourceSpan;keySpan;valueSpan;constructor(o,e,t,i,r,a,c,p){this.name=o,this.type=e,this.securityContext=t,this.value=i,this.unit=r,this.sourceSpan=a,this.keySpan=c,this.valueSpan=p}},yc=(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})(yc||{});function Sa(n,o=!0){if(n[0]!=":")return[null,n];let e=n.indexOf(":",1);if(e===-1){if(o)throw new Error(`Unsupported format "${n}" expecting ":namespace:name"`);return[null,n]}return[n.slice(1,e),n.slice(e+1)]}function D5(n){return Sa(n)[1]==="ng-container"}function fT(n){return Sa(n)[1]==="ng-content"}function VH(n){return Sa(n)[1]==="ng-template"}function gT(n){return n===null?null:Sa(n)[0]}function n1(n,o){return n?`:${n}:${o}`:o}var hx=class{value;sourceSpan;constructor(o,e){this.value=o,this.sourceSpan=e}visit(o){throw new Error("visit() not implemented for Comment")}},Rp=class{value;sourceSpan;constructor(o,e){this.value=o,this.sourceSpan=e}visit(o){return o.visitText(this)}},Oh=class{value;sourceSpan;i18n;constructor(o,e,t){this.value=o,this.sourceSpan=e,this.i18n=t}visit(o){return o.visitBoundText(this)}},Nh=class{name;value;sourceSpan;keySpan;valueSpan;i18n;constructor(o,e,t,i,r,a){this.name=o,this.value=e,this.sourceSpan=t,this.keySpan=i,this.valueSpan=r,this.i18n=a}visit(o){return o.visitTextAttribute(this)}},_T=class n{name;type;securityContext;value;unit;sourceSpan;keySpan;valueSpan;i18n;constructor(o,e,t,i,r,a,c,p,u){this.name=o,this.type=e,this.securityContext=t,this.value=i,this.unit=r,this.sourceSpan=a,this.keySpan=c,this.valueSpan=p,this.i18n=u}static fromBoundElementProperty(o,e){if(o.keySpan===void 0)throw new Error(`Unexpected state: keySpan must be defined for bound attributes but was not for ${o.name}: ${o.sourceSpan}`);return new n(o.name,o.type,o.securityContext,o.value,o.unit,o.sourceSpan,o.keySpan,o.valueSpan,e)}visit(o){return o.visitBoundAttribute(this)}},vT=class n{name;type;handler;target;phase;sourceSpan;handlerSpan;keySpan;constructor(o,e,t,i,r,a,c,p){this.name=o,this.type=e,this.handler=t,this.target=i,this.phase=r,this.sourceSpan=a,this.handlerSpan=c,this.keySpan=p}static fromParsedEvent(o){let e=o.type===$a.Regular?o.targetOrPhase:null,t=o.type===$a.LegacyAnimation?o.targetOrPhase:null;if(o.keySpan===void 0)throw new Error(`Unexpected state: keySpan must be defined for bound event but was not for ${o.name}: ${o.sourceSpan}`);return new n(o.name,o.type,o.handler,e,t,o.sourceSpan,o.handlerSpan,o.keySpan)}visit(o){return o.visitBoundEvent(this)}},Ac=class{name;attributes;inputs;outputs;directives;children;references;isSelfClosing;sourceSpan;startSourceSpan;endSourceSpan;isVoid;i18n;constructor(o,e,t,i,r,a,c,p,u,h,g,y,b){this.name=o,this.attributes=e,this.inputs=t,this.outputs=i,this.directives=r,this.children=a,this.references=c,this.isSelfClosing=p,this.sourceSpan=u,this.startSourceSpan=h,this.endSourceSpan=g,this.isVoid=y,this.i18n=b}visit(o){return o.visitElement(this)}},Oc=class{nameSpan;sourceSpan;prefetchSpan;whenOrOnSourceSpan;hydrateSpan;constructor(o,e,t,i,r){this.nameSpan=o,this.sourceSpan=e,this.prefetchSpan=t,this.whenOrOnSourceSpan=i,this.hydrateSpan=r}visit(o){return o.visitDeferredTrigger(this)}},T1=class extends Oc{value;constructor(o,e,t,i,r){super(null,e,t,i,r),this.value=o}},CT=class extends Oc{},xT=class extends Oc{},bT=class extends Oc{},E1=class extends Oc{reference;constructor(o,e,t,i,r,a){super(e,t,i,r,a),this.reference=o}},yT=class extends Oc{delay;constructor(o,e,t,i,r,a){super(e,t,i,r,a),this.delay=o}},D1=class extends Oc{reference;constructor(o,e,t,i,r,a){super(e,t,i,r,a),this.reference=o}},F_=class extends Oc{reference;options;constructor(o,e,t,i,r,a,c){super(t,i,r,a,c),this.reference=o,this.options=e}},ds=class{nameSpan;sourceSpan;startSourceSpan;endSourceSpan;constructor(o,e,t,i){this.nameSpan=o,this.sourceSpan=e,this.startSourceSpan=t,this.endSourceSpan=i}},R_=class extends ds{children;minimumTime;i18n;constructor(o,e,t,i,r,a,c){super(t,i,r,a),this.children=o,this.minimumTime=e,this.i18n=c}visit(o){return o.visitDeferredBlockPlaceholder(this)}},L_=class extends ds{children;afterTime;minimumTime;i18n;constructor(o,e,t,i,r,a,c,p){super(i,r,a,c),this.children=o,this.afterTime=e,this.minimumTime=t,this.i18n=p}visit(o){return o.visitDeferredBlockLoading(this)}},V_=class extends ds{children;i18n;constructor(o,e,t,i,r,a){super(e,t,i,r),this.children=o,this.i18n=a}visit(o){return o.visitDeferredBlockError(this)}},eu=class extends ds{children;placeholder;loading;error;mainBlockSpan;i18n;triggers;prefetchTriggers;hydrateTriggers;definedTriggers;definedPrefetchTriggers;definedHydrateTriggers;constructor(o,e,t,i,r,a,c,p,u,h,g,y,b){super(p,u,g,y),this.children=o,this.placeholder=r,this.loading=a,this.error=c,this.mainBlockSpan=h,this.i18n=b,this.triggers=e,this.prefetchTriggers=t,this.hydrateTriggers=i,this.definedTriggers=Object.keys(e),this.definedPrefetchTriggers=Object.keys(t),this.definedHydrateTriggers=Object.keys(i)}visit(o){return o.visitDeferredBlock(this)}visitAll(o){this.visitTriggers(this.definedHydrateTriggers,this.hydrateTriggers,o),this.visitTriggers(this.definedTriggers,this.triggers,o),this.visitTriggers(this.definedPrefetchTriggers,this.prefetchTriggers,o),Nk(o,this.children);let e=[this.placeholder,this.loading,this.error].filter(t=>t!==null);Nk(o,e)}visitTriggers(o,e,t){Nk(t,o.map(i=>e[i]))}},P1=class extends ds{expression;groups;unknownBlocks;exhaustiveCheck;constructor(o,e,t,i,r,a,c,p){super(p,r,a,c),this.expression=o,this.groups=e,this.unknownBlocks=t,this.exhaustiveCheck=i}visit(o){return o.visitSwitchBlock(this)}},ST=class extends ds{expression;constructor(o,e,t,i,r){super(r,e,t,i),this.expression=o}visit(o){return o.visitSwitchBlockCase(this)}},B_=class extends ds{cases;children;i18n;constructor(o,e,t,i,r,a,c){super(a,t,i,r),this.cases=o,this.children=e,this.i18n=c}visit(o){return o.visitSwitchBlockCaseGroup(this)}},wT=class extends ds{constructor(o,e,t,i){super(i,o,e,t)}visit(o){return o.visitSwitchExhaustiveCheck(this)}},Fh=class extends ds{item;expression;trackBy;trackKeywordSpan;contextVariables;children;empty;mainBlockSpan;i18n;constructor(o,e,t,i,r,a,c,p,u,h,g,y,b){super(y,p,h,g),this.item=o,this.expression=e,this.trackBy=t,this.trackKeywordSpan=i,this.contextVariables=r,this.children=a,this.empty=c,this.mainBlockSpan=u,this.i18n=b}visit(o){return o.visitForLoopBlock(this)}},z_=class extends ds{children;i18n;constructor(o,e,t,i,r,a){super(r,e,t,i),this.children=o,this.i18n=a}visit(o){return o.visitForLoopBlockEmpty(this)}},I1=class extends ds{branches;constructor(o,e,t,i,r){super(r,e,t,i),this.branches=o}visit(o){return o.visitIfBlock(this)}},Bp=class extends ds{expression;children;expressionAlias;i18n;constructor(o,e,t,i,r,a,c,p){super(c,i,r,a),this.expression=o,this.children=e,this.expressionAlias=t,this.i18n=p}visit(o){return o.visitIfBlockBranch(this)}},A1=class{name;sourceSpan;nameSpan;constructor(o,e,t){this.name=o,this.sourceSpan=e,this.nameSpan=t}visit(o){return o.visitUnknownBlock(this)}},RE=class{name;value;sourceSpan;nameSpan;valueSpan;constructor(o,e,t,i,r){this.name=o,this.value=e,this.sourceSpan=t,this.nameSpan=i,this.valueSpan=r}visit(o){return o.visitLetDeclaration(this)}},s_=class{componentName;tagName;fullName;attributes;inputs;outputs;directives;children;references;isSelfClosing;sourceSpan;startSourceSpan;endSourceSpan;i18n;constructor(o,e,t,i,r,a,c,p,u,h,g,y,b,x){this.componentName=o,this.tagName=e,this.fullName=t,this.attributes=i,this.inputs=r,this.outputs=a,this.directives=c,this.children=p,this.references=u,this.isSelfClosing=h,this.sourceSpan=g,this.startSourceSpan=y,this.endSourceSpan=b,this.i18n=x}visit(o){return o.visitComponent(this)}},gF=class{name;attributes;inputs;outputs;references;sourceSpan;startSourceSpan;endSourceSpan;i18n;constructor(o,e,t,i,r,a,c,p,u){this.name=o,this.attributes=e,this.inputs=t,this.outputs=i,this.references=r,this.sourceSpan=a,this.startSourceSpan=c,this.endSourceSpan=p,this.i18n=u}visit(o){return o.visitDirective(this)}},Os=class{tagName;attributes;inputs;outputs;directives;templateAttrs;children;references;variables;isSelfClosing;sourceSpan;startSourceSpan;endSourceSpan;i18n;constructor(o,e,t,i,r,a,c,p,u,h,g,y,b,x){this.tagName=o,this.attributes=e,this.inputs=t,this.outputs=i,this.directives=r,this.templateAttrs=a,this.children=c,this.references=p,this.variables=u,this.isSelfClosing=h,this.sourceSpan=g,this.startSourceSpan=y,this.endSourceSpan=b,this.i18n=x}visit(o){return o.visitTemplate(this)}},Rh=class{selector;attributes;children;isSelfClosing;sourceSpan;startSourceSpan;endSourceSpan;i18n;name="ng-content";constructor(o,e,t,i,r,a,c,p){this.selector=o,this.attributes=e,this.children=t,this.isSelfClosing=i,this.sourceSpan=r,this.startSourceSpan=a,this.endSourceSpan=c,this.i18n=p}visit(o){return o.visitContent(this)}},hm=class{name;value;sourceSpan;keySpan;valueSpan;constructor(o,e,t,i,r){this.name=o,this.value=e,this.sourceSpan=t,this.keySpan=i,this.valueSpan=r}visit(o){return o.visitVariable(this)}},j_=class{name;value;sourceSpan;keySpan;valueSpan;constructor(o,e,t,i,r){this.name=o,this.value=e,this.sourceSpan=t,this.keySpan=i,this.valueSpan=r}visit(o){return o.visitReference(this)}},_F=class{vars;placeholders;sourceSpan;i18n;constructor(o,e,t,i){this.vars=o,this.placeholders=e,this.sourceSpan=t,this.i18n=i}visit(o){return o.visitIcu(this)}},$_=class{tagNames;bindings;listeners;sourceSpan;constructor(o,e,t,i){if(this.tagNames=o,this.bindings=e,this.listeners=t,this.sourceSpan=i,o.length===0)throw new Error("HostElement must have at least one tag name.")}visit(){throw new Error("HostElement cannot be visited")}};function Nk(n,o){let e=[];if(n.visit)for(let t of o)n.visit(t);else for(let t of o){let i=t.visit(n);i&&e.push(i)}return e}var Ha=class{nodes;placeholders;placeholderToMessage;meaning;description;customId;sources;id;legacyIds=[];messageString;constructor(o,e,t,i,r,a){this.nodes=o,this.placeholders=e,this.placeholderToMessage=t,this.meaning=i,this.description=r,this.customId=a,this.id=this.customId,this.messageString=BH(this.nodes),o.length?this.sources=[{filePath:o[0].sourceSpan.start.file.url,startLine:o[0].sourceSpan.start.line+1,startCol:o[0].sourceSpan.start.col+1,endLine:o[o.length-1].sourceSpan.end.line+1,endCol:o[0].sourceSpan.start.col+1}]:this.sources=[]}},Wg=class{value;sourceSpan;constructor(o,e){this.value=o,this.sourceSpan=e}visit(o,e){return o.visitText(this,e)}},Sd=class{children;sourceSpan;constructor(o,e){this.children=o,this.sourceSpan=e}visit(o,e){return o.visitContainer(this,e)}},O1=class{expression;type;cases;sourceSpan;expressionPlaceholder;constructor(o,e,t,i,r){this.expression=o,this.type=e,this.cases=t,this.sourceSpan=i,this.expressionPlaceholder=r}visit(o,e){return o.visitIcu(this,e)}},fm=class{tag;attrs;startName;closeName;children;isVoid;sourceSpan;startSourceSpan;endSourceSpan;constructor(o,e,t,i,r,a,c,p,u){this.tag=o,this.attrs=e,this.startName=t,this.closeName=i,this.children=r,this.isVoid=a,this.sourceSpan=c,this.startSourceSpan=p,this.endSourceSpan=u}visit(o,e){return o.visitTagPlaceholder(this,e)}},H_=class{value;name;sourceSpan;constructor(o,e,t){this.value=o,this.name=e,this.sourceSpan=t}visit(o,e){return o.visitPlaceholder(this,e)}},Lh=class{value;name;sourceSpan;previousMessage;constructor(o,e,t){this.value=o,this.name=e,this.sourceSpan=t}visit(o,e){return o.visitIcuPlaceholder(this,e)}},gm=class{name;parameters;startName;closeName;children;sourceSpan;startSourceSpan;endSourceSpan;constructor(o,e,t,i,r,a,c,p){this.name=o,this.parameters=e,this.startName=t,this.closeName=i,this.children=r,this.sourceSpan=a,this.startSourceSpan=c,this.endSourceSpan=p}visit(o,e){return o.visitBlockPlaceholder(this,e)}};function BH(n){let o=new MT;return n.map(t=>t.visit(o)).join("")}var MT=class{visitText(o){return o.value}visitContainer(o){return o.children.map(e=>e.visit(this)).join("")}visitIcu(o){let e=Object.keys(o.cases).map(t=>`${t} {${o.cases[t].visit(this)}}`);return`{${o.expressionPlaceholder}, ${o.type}, ${e.join(" ")}}`}visitTagPlaceholder(o){let e=o.children.map(t=>t.visit(this)).join("");return`{$${o.startName}}${e}{$${o.closeName}}`}visitPlaceholder(o){return`{$${o.name}}`}visitIcuPlaceholder(o){return`{$${o.name}}`}visitBlockPlaceholder(o){let e=o.children.map(t=>t.visit(this)).join("");return`{$${o.startName}}${e}{$${o.closeName}}`}};var zH=class{visitTag(o){let e=this._serializeAttributes(o.attrs);if(o.children.length==0)return`<${o.name}${e}/>`;let t=o.children.map(i=>i.visit(this));return`<${o.name}${e}>${t.join("")}</${o.name}>`}visitText(o){return o.value}visitDeclaration(o){return`<?xml${this._serializeAttributes(o.attrs)} ?>`}_serializeAttributes(o){let e=Object.keys(o).map(t=>`${t}="${o[t]}"`).join(" ");return e.length>0?" "+e:""}visitDoctype(o){return`<!DOCTYPE ${o.rootTag} [
|
||
${o.dtd}
|
||
]>`}},u6e=new zH;function jH(n){return n.toUpperCase().replace(/[^A-Z0-9_]/g,"_")}var vF="i18n",kT="i18n-",$H="VAR_";function CF(n){return n===vF||n.startsWith(kT)}function HH(n){return n.attrs.some(o=>CF(o.name))}function xF(n){return n.nodes[0]}function LE(n={},o){let e={};return n&&Object.keys(n).length&&Object.keys(n).forEach(t=>e[h0(t,o)]=n[t]),e}function h0(n,o=!0){let e=jH(n);if(!o)return e;let t=e.split("_");if(t.length===1)return n.toLowerCase();let i;/^\d+$/.test(t[t.length-1])&&(i=t.pop());let r=t.shift().toLowerCase();return t.length&&(r+=t.map(a=>a.charAt(0).toUpperCase()+a.slice(1).toLowerCase()).join("")),i?`${r}_${i}`:r}var UH=/[-.]/,VE="_t",Ls="ctx",Wh="rf";function bF(n,o){let e=null;return()=>(e||(n(new Hr(VE,void 0,ls)),e=Jn(o)),e)}function vh(n){return Array.isArray(n)?Xi(n.map(vh)):Ee(n,Wl)}function P5(n,o){let e=Object.getOwnPropertyNames(n);return e.length===0?null:cl(e.map(t=>{let i=n[t],r,a,c,p;if(typeof i=="string")r=t,c=t,a=i,p=vh(a);else{c=t,r=i.classPropertyName,a=i.bindingPropertyName;let u=a!==r,h=i.transformFunction!==null,g=e_.None;if(i.isSignal&&(g|=e_.SignalBased),h&&(g|=e_.HasDecoratorInputTransform),o&&(u||h||g!==e_.None)){let y=[Ee(g),vh(a)];(u||h)&&(y.push(vh(r)),h&&y.push(i.transformFunction)),p=Xi(y)}else p=vh(a)}return{key:c,quoted:UH.test(c),value:p}}))}var _m=class{values=[];set(o,e){if(e){let t=this.values.find(i=>i.key===o);t?t.value=e:this.values.push({key:o,value:e,quoted:!1})}}toLiteralMap(){return cl(this.values)}};function WH(n){let o=n instanceof Ac?n.name:"ng-template",e=GH(n),t=new Mh,i=Sa(o)[1];return t.setElement(i),Object.getOwnPropertyNames(e).forEach(r=>{let a=Sa(r)[1],c=e[r];t.addAttribute(a,c),r.toLowerCase()==="class"&&c.trim().split(/\s+/).forEach(u=>t.addClassName(u))}),t}function GH(n){let o={};return n instanceof Os&&n.tagName!=="ng-template"?n.templateAttrs.forEach(e=>o[e.name]=""):(n.attributes.forEach(e=>{CF(e.name)||(o[e.name]=e.value)}),n.inputs.forEach(e=>{(e.type===Di.Property||e.type===Di.TwoWay)&&(o[e.name]="")}),n.outputs.forEach(e=>{o[e.name]=""})),o}function I5(n,o){let e=null,t={name:n.name,type:n.type,typeArgumentCount:n.typeArgumentCount,deps:[],target:xd.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=Ip(Ye(Z({},t),{delegate:n.useClass.expression,delegateDeps:p,delegateType:_1.Class})):c?e=Ip(t):e={statements:[],expression:A5(n.type.value,n.useClass.expression,o)}}else n.useFactory!==void 0?n.deps!==void 0?e=Ip(Ye(Z({},t),{delegate:n.useFactory,delegateDeps:n.deps||[],delegateType:_1.Function})):e={statements:[],expression:Rs([],n.useFactory.callFn([]))}:n.useValue!==void 0?e=Ip(Ye(Z({},t),{expression:n.useValue.expression})):n.useExisting!==void 0?e=Ip(Ye(Z({},t),{expression:jt(fe.inject).callFn([n.useExisting.expression])})):e={statements:[],expression:A5(n.type.value,n.type.value,o)};let i=n.type.value,r=new _m;return r.set("token",i),r.set("factory",e.expression),n.providedIn.expression.value!==null&&r.set("providedIn",PH(n.providedIn)),{expression:jt(fe.\u0275\u0275defineInjectable).callFn([r.toLiteralMap()],void 0,!0),type:qH(n),statements:e.statements}}function qH(n){return new ll(jt(fe.InjectableDeclaration,[ux(n.type.type,n.typeArgumentCount)]))}function A5(n,o,e){if(n.node===o.node)return o.prop("\u0275fac");if(!e)return O5(o);let t=jt(fe.resolveForwardRef).callFn([o]);return O5(t)}function O5(n){let o=new Mr("__ngFactoryType__",ls);return Rs([o],n.prop("\u0275fac").callFn([Jn(o.name)]))}var Yr=0,QH=8,BE=9,zp=10,yF=11,SF=12,zE=13,wF=32,TT=33,U_=34,MF=35,fx=36,XH=37,N1=38,W_=39,ja=40,Sr=41,N5=42,kF=43,ya=44,F1=45,Dp=46,tl=47,Sc=58,rs=59,wh=60,Xr=61,Ps=62,F5=63,jE=48,KH=55,TF=57,Sm=65,YH=69,ZH=70,JH=88,Gh=90,kc=91,jp=92,bd=93,eU=94,wm=95,tu=97,tU=98,nU=101,$E=102,EF=110,DF=114,PF=116,IF=117,AF=118,OF=120,f0=122,ol=123,R5=124,Ba=125,NF=160,ch=64,ET=96;function G_(n){return n>=BE&&n<=wF||n==NF}function nl(n){return jE<=n&&n<=TF}function vm(n){return n>=tu&&n<=f0||n>=Sm&&n<=Gh}function iU(n){return n>=tu&&n<=$E||n>=Sm&&n<=ZH||nl(n)}function R1(n){return n===zp||n===zE}function L5(n){return jE<=n&&n<=KH}function l_(n){return n===W_||n===U_||n===ET}var q_=class n{file;offset;line;col;constructor(o,e,t,i){this.file=o,this.offset=e,this.line=t,this.col=i}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(o){let e=this.file.content,t=e.length,i=this.offset,r=this.line,a=this.col;for(;i>0&&o<0;)if(i--,o++,e.charCodeAt(i)==zp){r--;let p=e.substring(0,i-1).lastIndexOf(String.fromCharCode(zp));a=p>0?i-p:i}else a--;for(;i<t&&o>0;){let c=e.charCodeAt(i);i++,o--,c==zp?(r++,a=0):a++}return new n(this.file,i,r,a)}getContext(o,e){let t=this.file.content,i=this.offset;if(i!=null){i>t.length-1&&(i=t.length-1);let r=i,a=0,c=0;for(;a<o&&i>0&&(i--,a++,!(t[i]==`
|
||
`&&++c==e)););for(a=0,c=0;a<o&&r<t.length-1&&(r++,a++,!(t[r]==`
|
||
`&&++c==e)););return{before:t.substring(i,this.offset),after:t.substring(this.offset,r+1)}}return null}},L1=class{content;url;constructor(o,e){this.content=o,this.url=e}},gn=class{start;end;fullStart;details;constructor(o,e,t=o,i=null){this.start=o,this.end=e,this.fullStart=t,this.details=i}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}},cm=(function(n){return n[n.WARNING=0]="WARNING",n[n.ERROR=1]="ERROR",n})(cm||{}),sn=class extends Error{span;msg;level;relatedError;constructor(o,e,t=cm.ERROR,i){super(e),this.span=o,this.msg=e,this.level=t,this.relatedError=i,Object.setPrototypeOf(this,new.target.prototype)}contextualMessage(){let o=this.span.start.getContext(100,3);return o?`${this.msg} ("${o.before}[${cm[this.level]} ->]${o.after}")`:this.msg}toString(){let o=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${o}`}};function oU(n,o,e){let t=`in ${n} ${o} in ${e}`,i=new L1("",t);return new gn(new q_(i,-1,-1,-1),new q_(i,-1,-1,-1))}var rU=0;function aU(n){if(!n||!n.reference)return null;let o=n.reference;if(o.__anonymousType)return o.__anonymousType;if(o.__forward_ref__)return"__forward_ref__";let e=hF(o);return e.indexOf("(")>=0?(e=`anonymous_${rU++}`,o.__anonymousType=e):e=Ap(e),e}function Ap(n){return n.replace(/\W/g,"_")}var V5='(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})',DT=class extends mT{constructor(){super(!1)}visitWrappedNodeExpr(o,e){throw new Error("Cannot emit a WrappedNodeExpr in Javascript.")}visitDeclareVarStmt(o,e){return e.print(o,`var ${o.name}`),o.value&&(e.print(o," = "),o.value.visitExpression(this,e)),e.println(o,";"),null}visitTaggedTemplateLiteralExpr(o,e){let t=o.template.elements;return o.tag.visitExpression(this,e),e.print(o,`(${V5}(`),e.print(o,`[${t.map(i=>Np(i.text,!1)).join(", ")}], `),e.print(o,`[${t.map(i=>Np(i.rawText,!1)).join(", ")}])`),o.template.expressions.forEach(i=>{e.print(o,", "),i.visitExpression(this,e)}),e.print(o,")"),null}visitTemplateLiteralExpr(o,e){e.print(o,"`");for(let t=0;t<o.elements.length;t++){o.elements[t].visitExpression(this,e);let i=t<o.expressions.length?o.expressions[t]:null;i!==null&&(e.print(i,"${"),i.visitExpression(this,e),e.print(i,"}"))}e.print(o,"`")}visitTemplateLiteralElementExpr(o,e){return e.print(o,o.rawText),null}visitFunctionExpr(o,e){return e.print(o,`function${o.name?" "+o.name:""}(`),this._visitParams(o.params,e),e.println(o,") {"),e.incIndent(),this.visitAllStatements(o.statements,e),e.decIndent(),e.print(o,"}"),null}visitArrowFunctionExpr(o,e){if(e.print(o,"("),this._visitParams(o.params,e),e.print(o,") =>"),Array.isArray(o.body))e.println(o,"{"),e.incIndent(),this.visitAllStatements(o.body,e),e.decIndent(),e.print(o,"}");else{let t=o.body instanceof Ql;t&&e.print(o,"("),o.body.visitExpression(this,e),t&&e.print(o,")")}return null}visitDeclareFunctionStmt(o,e){return e.print(o,`function ${o.name}(`),this._visitParams(o.params,e),e.println(o,") {"),e.incIndent(),this.visitAllStatements(o.statements,e),e.decIndent(),e.println(o,"}"),null}visitLocalizedString(o,e){e.print(o,`$localize(${V5}(`);let t=[o.serializeI18nHead()];for(let i=1;i<o.messageParts.length;i++)t.push(o.serializeI18nTemplatePart(i));return e.print(o,`[${t.map(i=>Np(i.cooked,!1)).join(", ")}], `),e.print(o,`[${t.map(i=>Np(i.raw,!1)).join(", ")}])`),o.expressions.forEach(i=>{e.print(o,", "),i.visitExpression(this,e)}),e.print(o,")"),null}_visitParams(o,e){this.visitAllObjects(t=>e.print(null,t.name),o,e,",")}},$C;function sU(){if($C===void 0){let n=a_.trustedTypes;if($C=null,n)try{$C=n.createPolicy("angular#unsafe-jit",{createScript:o=>o})}catch{}}return $C}function lU(n){return sU()?.createScript(n)||n}function B5(...n){if(!a_.trustedTypes)return new Function(...n);let o=n.slice(0,-1).join(","),e=n[n.length-1],t=`(function anonymous(${o}
|
||
) { ${e}
|
||
})`,i=a_.eval(lU(t));return i.bind===void 0?new Function(...n):(i.toString=()=>t,i.bind(a_))}var PT=class{evaluateStatements(o,e,t,i){let r=new IT(t),a=dT.createRoot();return e.length>0&&!cU(e[0])&&(e=[Ee("use strict").toStmt(),...e]),r.visitAllStatements(e,a),r.createReturnStmt(a),this.evaluateCode(o,a,r.getArgs(),i)}evaluateCode(o,e,t,i){let r=`"use strict";${e.toSource()}
|
||
//# sourceURL=${o}`,a=[],c=[];for(let u in t)c.push(t[u]),a.push(u);if(i){let u=B5(...a.concat("return null;")).toString(),h=u.slice(0,u.indexOf("return null;")).split(`
|
||
`).length-1;r+=`
|
||
${e.toSourceMapGenerator(o,h).toJsComment()}`}let p=B5(...a.concat(r));return this.executeFunction(p,c)}executeFunction(o,e){return o(...e)}},IT=class extends DT{refResolver;_evalArgNames=[];_evalArgValues=[];_evalExportedVars=[];constructor(o){super(),this.refResolver=o}createReturnStmt(o){new kr(new Ql(this._evalExportedVars.map(t=>new Eh(t,Jn(t),!1)))).visitStatement(this,o)}getArgs(){let o={};for(let e=0;e<this._evalArgNames.length;e++)o[this._evalArgNames[e]]=this._evalArgValues[e];return o}visitExternalExpr(o,e){return this._emitReferenceToExternal(o,this.refResolver.resolveExternalReference(o.value),e),null}visitWrappedNodeExpr(o,e){return this._emitReferenceToExternal(o,o.node,e),null}visitDeclareVarStmt(o,e){return o.hasModifier(ca.Exported)&&this._evalExportedVars.push(o.name),super.visitDeclareVarStmt(o,e)}visitDeclareFunctionStmt(o,e){return o.hasModifier(ca.Exported)&&this._evalExportedVars.push(o.name),super.visitDeclareFunctionStmt(o,e)}_emitReferenceToExternal(o,e,t){let i=this._evalArgValues.indexOf(e);if(i===-1){i=this._evalArgValues.length,this._evalArgValues.push(e);let r=aU({reference:e})||"val";this._evalArgNames.push(`jit_${r}_${i}`)}t.print(o,this._evalArgNames[i])}};function cU(n){return n.isEquivalent(Ee("use strict").toStmt())}function z5(n){let o=new _m;n.providers!==null&&o.set("providers",n.providers),n.imports.length>0&&o.set("imports",Xi(n.imports));let e=jt(fe.defineInjector).callFn([o.toLiteralMap()],void 0,!0),t=dU(n);return{expression:e,type:t,statements:[]}}function dU(n){return new ll(jt(fe.InjectorDeclaration,[new ll(n.type.type)]))}var AT=class{context;constructor(o){this.context=o}resolveExternalReference(o){if(o.moduleName!=="@angular/core")throw new Error(`Cannot resolve external reference to ${o.moduleName}, only references to @angular/core are supported.`);if(!this.context.hasOwnProperty(o.name))throw new Error(`No value provided for @angular/core symbol '${o.name}'.`);return this.context[o.name]}},V1=(function(n){return n[n.Inline=0]="Inline",n[n.SideEffect=1]="SideEffect",n[n.Omit=2]="Omit",n})(V1||{}),dm=(function(n){return n[n.Global=0]="Global",n[n.Local=1]="Local",n})(dm||{});function mU(n){let o=[],e=new _m;if(e.set("type",n.type.value),n.kind===dm.Global&&n.bootstrap.length>0&&e.set("bootstrap",Fp(n.bootstrap,n.containsForwardDecls)),n.selectorScopeMode===V1.Inline)n.declarations.length>0&&e.set("declarations",Fp(n.declarations,n.containsForwardDecls)),n.imports.length>0&&e.set("imports",Fp(n.imports,n.containsForwardDecls)),n.exports.length>0&&e.set("exports",Fp(n.exports,n.containsForwardDecls));else if(n.selectorScopeMode===V1.SideEffect){let r=hU(n);r!==null&&o.push(r)}n.schemas!==null&&n.schemas.length>0&&e.set("schemas",Xi(n.schemas.map(r=>r.value))),n.id!==null&&(e.set("id",n.id),o.push(jt(fe.registerNgModuleType).callFn([n.type.value,n.id]).toStmt()));let t=jt(fe.defineNgModule).callFn([e.toLiteralMap()],void 0,!0),i=uU(n);return{expression:t,type:i,statements:o}}function pU(n){let o=new _m;return o.set("type",new si(n.type)),n.bootstrap!==void 0&&o.set("bootstrap",new si(n.bootstrap)),n.declarations!==void 0&&o.set("declarations",new si(n.declarations)),n.imports!==void 0&&o.set("imports",new si(n.imports)),n.exports!==void 0&&o.set("exports",new si(n.exports)),n.schemas!==void 0&&o.set("schemas",new si(n.schemas)),n.id!==void 0&&o.set("id",new si(n.id)),jt(fe.defineNgModule).callFn([o.toLiteralMap()])}function uU(n){if(n.kind===dm.Local)return new ll(n.type.value);let{type:o,declarations:e,exports:t,imports:i,includeImportTypes:r,publicDeclarationTypes:a}=n;return new ll(jt(fe.NgModuleDeclaration,[new ll(o.type),a===null?Fk(e):fU(a),r?Fk(i):Ec,Fk(t)]))}function hU(n){let o=new _m;if(n.kind===dm.Global?n.declarations.length>0&&o.set("declarations",Fp(n.declarations,n.containsForwardDecls)):n.declarationsExpression&&o.set("declarations",n.declarationsExpression),n.kind===dm.Global?n.imports.length>0&&o.set("imports",Fp(n.imports,n.containsForwardDecls)):n.importsExpression&&o.set("imports",n.importsExpression),n.kind===dm.Global?n.exports.length>0&&o.set("exports",Fp(n.exports,n.containsForwardDecls)):n.exportsExpression&&o.set("exports",n.exportsExpression),n.kind===dm.Local&&n.bootstrapExpression&&o.set("bootstrap",n.bootstrapExpression),Object.keys(o.values).length===0)return null;let e=new cs(jt(fe.setNgModuleScope),[n.type.value,o.toLiteralMap()]),t=EH(e),i=new mm([],[t.toStmt()]);return new cs(i,[]).toStmt()}function Fk(n){let o=n.map(e=>p0(e.type));return n.length>0?da(Xi(o)):Ec}function fU(n){let o=n.map(e=>p0(e));return n.length>0?da(Xi(o)):Ec}function j5(n){let o=[];o.push({key:"name",value:Ee(n.pipeName??n.name),quoted:!1}),o.push({key:"type",value:n.type.value,quoted:!1}),o.push({key:"pure",value:Ee(n.pure),quoted:!1}),n.isStandalone===!1&&o.push({key:"standalone",value:Ee(!1),quoted:!1});let e=jt(fe.definePipe).callFn([cl(o)],void 0,!0),t=gU(n);return{expression:e,type:t,statements:[]}}function gU(n){return new ll(jt(fe.PipeDeclaration,[ux(n.type.type,n.typeArgumentCount),new ll(new ma(n.pipeName)),new ll(new ma(n.isStandalone))]))}var Vh=(function(n){return n[n.Directive=0]="Directive",n[n.Pipe=1]="Pipe",n[n.NgModule=2]="NgModule",n})(Vh||{}),_U=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"]),vU=["@media","@supports","@document","@layer","@container","@scope","@starting-style"],OT=class{shimCssText(o,e,t=""){let i=[];o=o.replace(NU,c=>{if(c.match(FU))i.push(c);else{let p=c.match(OU);i.push(p?.join("")??"")}return UE}),o=this._insertDirectives(o);let r=this._scopeCssText(o,e,t),a=0;return r.replace(RU,()=>i[a++])}_insertDirectives(o){return o=this._insertPolyfillDirectivesInCssText(o),this._insertPolyfillRulesInCssText(o)}_scopeKeyframesRelatedCss(o,e){let t=new Set,i=HC(o,r=>this._scopeLocalKeyframeDeclarations(r,e,t));return HC(i,r=>this._scopeAnimationRule(r,e,t))}_scopeLocalKeyframeDeclarations(o,e,t){return Ye(Z({},o),{selector:o.selector.replace(/(^@(?:-webkit-)?keyframes(?:\s+))(['"]?)(.+)\2(\s*)$/,(i,r,a,c,p)=>(t.add(U5(c,a)),`${r}${a}${e}_${c}${a}${p}`))})}_scopeAnimationKeyframe(o,e,t){return o.replace(/^(\s*)(['"]?)(.+?)\2(\s*)$/,(i,r,a,c,p)=>(c=`${t.has(U5(c,a))?e+"_":""}${c}`,`${r}${a}${c}${a}${p}`))}_animationDeclarationKeyframesRe=/(^|\s+|,)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;_scopeAnimationRule(o,e,t){let i=o.content.replace(/((?:^|\s+|;)(?:-webkit-)?animation\s*:\s*),*([^;]+)/g,(r,a,c)=>a+c.replace(this._animationDeclarationKeyframesRe,(p,u,h="",g,y)=>g?`${u}${this._scopeAnimationKeyframe(`${h}${g}${h}`,e,t)}`:_U.has(y)?p:`${u}${this._scopeAnimationKeyframe(y,e,t)}`));return i=i.replace(/((?:^|\s+|;)(?:-webkit-)?animation-name(?:\s*):(?:\s*))([^;]+)/g,(r,a,c)=>`${a}${c.split(",").map(p=>this._scopeAnimationKeyframe(p,e,t)).join(",")}`),Ye(Z({},o),{content:i})}_insertPolyfillDirectivesInCssText(o){return o.replace(xU,function(...e){return e[2]+"{"})}_insertPolyfillRulesInCssText(o){return o.replace(bU,(...e)=>{let t=e[0].replace(e[1],"").replace(e[2],"");return e[4]+t})}_scopeCssText(o,e,t){let i=this._extractUnscopedRulesFromCssText(o);return o=this._insertPolyfillHostInCssText(o),o=this._convertColonHost(o),o=this._convertColonHostContext(o),o=this._convertShadowDOMSelectors(o),e&&(o=this._scopeKeyframesRelatedCss(o,e),o=this._scopeSelectors(o,e,t)),o=o+`
|
||
`+i,o.trim()}_extractUnscopedRulesFromCssText(o){let e="",t;for($5.lastIndex=0;(t=$5.exec(o))!==null;){let i=t[0].replace(t[2],"").replace(t[1],t[4]);e+=i+`
|
||
|
||
`}return e}_convertColonHost(o){return o.replace(MU,(e,t,i)=>{if(t){let r=[];for(let a of this._splitOnTopLevelCommas(t,!0)){let c=a.trim();if(!c)break;let p=am+c.replace(B1,"")+i;r.push(p)}return r.join(",")}else return am+i})}*_splitOnTopLevelCommas(o,e){let t=o.length,i=0,r=0;for(let a=0;a<t;a++){let c=o.charCodeAt(a);if(c===ja)i++;else if(c===Sr){if(i--,i<0&&e){yield o.slice(r,a);return}}else c===ya&&i===0&&(yield o.slice(r,a),r=a+1)}yield o.slice(r)}_convertColonHostContext(o){let e=[];for(let t of this._splitOnTopLevelCommas(o,!1))e.push(this._convertColonHostContextInSelectorPart(t));return e.join(",")}_convertColonHostContextInSelectorPart(o){return o.replace(TU,(e,t)=>{let i=[[]],r=e.indexOf(fh);for(;r!==-1;){let a=e.substring(r+fh.length);if(!a||a[0]!=="("){e=a,r=e.indexOf(fh);continue}let c=[],p=0;for(let h of this._splitOnTopLevelCommas(a.substring(1),!0)){p=p+h.length+1;let g=h.trim();g&&c.push(g)}let u=i.length;qU(i,c.length);for(let h=0;h<c.length;h++)for(let g=0;g<u;g++)i[g+h*u].push(c[h]);e=a.substring(p+1),r=e.indexOf(fh)}return i.map(a=>GU(a,e,t)).join(", ")})}_convertShadowDOMSelectors(o){return DU.reduce((e,t)=>e.replace(t," "),o)}_scopeSelectors(o,e,t){return HC(o,i=>{let r=i.selector,a=i.content;return i.selector[0]!=="@"?r=this._scopeSelector({selector:r,scopeSelector:e,hostSelector:t,isParentSelector:!0}):vU.some(c=>i.selector.startsWith(c))?a=this._scopeSelectors(i.content,e,t):(i.selector.startsWith("@font-face")||i.selector.startsWith("@page"))&&(a=this._stripScopingSelectors(i.content)),new Q_(r,a)})}_stripScopingSelectors(o){return HC(o,e=>{let t=e.selector.replace(H5," ").replace(Rk," ");return new Q_(t,e.content)})}_safeSelector;_shouldScopeIndicator;_scopeSelector({selector:o,scopeSelector:e,hostSelector:t,isParentSelector:i=!1}){let r=/ ?,(?!(?:[^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\))) ?/;return o.split(r).map(a=>a.split(H5)).map(a=>{let[c,...p]=a;return[(h=>this._selectorNeedsScoping(h,e)?this._applySelectorScope({selector:h,scopeSelector:e,hostSelector:t,isParentSelector:i}):h)(c),...p].join(" ")}).join(", ")}_selectorNeedsScoping(o,e){return!this._makeScopeMatcher(e).test(o)}_makeScopeMatcher(o){let e=/\[/g,t=/\]/g;return o=o.replace(e,"\\[").replace(t,"\\]"),new RegExp("^("+o+")"+PU,"m")}_applySimpleSelectorScope(o,e,t){if(Ch.lastIndex=0,Ch.test(o)){let i=`[${t}]`,r=o;for(;r.match(Rk);)r=r.replace(Rk,(a,c)=>c.replace(/([^:\)]*)(:*)(.*)/,(p,u,h,g)=>u+i+h+g));return r.replace(Ch,i)}return e+" "+o}_applySelectorScope({selector:o,scopeSelector:e,hostSelector:t,isParentSelector:i}){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(am)){if(w=this._applySimpleSelectorScope(M,e,t),!M.match(EU)){let[S,E,O,D]=w.match(/([^:]*)(:*)([\s\S]*)/);w=E+a+O+D}}else{let S=M.replace(Ch,"");if(S.length>0){let E=S.match(/([^:]*)(:*)([\s\S]*)/);E&&(w=E[1]+a+E[2]+E[3])}}return w},p=M=>{let w="",S=[],E;for(;(E=Gg.exec(M))!==null;){let O=1,D=Gg.lastIndex;for(;D<M.length;){let N=M[D];if(D++,N==="("){O++;continue}if(N===")"){if(O--,O===0)break;continue}}S.push(`${E[0]}${M.slice(Gg.lastIndex,D)}`),Gg.lastIndex=D}return S.join("")===M?w=S.map(O=>{let[D]=O.match(Gg)??[],N=O.slice(D?.length,-1);N.includes(am)&&(this._shouldScopeIndicator=!0);let P=this._scopeSelector({selector:N,scopeSelector:e,hostSelector:t});return`${D}${P})`}).join(""):(this._shouldScopeIndicator=this._shouldScopeIndicator||M.includes(am),w=this._shouldScopeIndicator?c(M):M),w};i&&(this._safeSelector=new NT(o),o=this._safeSelector.content());let u="",h=0,g,y=/( |>|\+|~(?!=))(?!([^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\)))\s*/g,b=o.includes(am);for((i||this._shouldScopeIndicator)&&(this._shouldScopeIndicator=!b);(g=y.exec(o))!==null;){let M=g[1],w=o.slice(h,g.index);if(w.match(/__esc-ph-(\d+)__/)&&o[g.index+1]?.match(/[a-fA-F\d]/))continue;let S=p(w);u+=`${S} ${M} `,h=y.lastIndex}let x=o.substring(h);return u+=p(x),this._safeSelector.restore(u)}_insertPolyfillHostInCssText(o){return o.replace(AU,fh).replace(IU,B1)}},NT=class{placeholders=[];index=0;_content;constructor(o){o=this._escapeRegexMatches(o,/(\[[^\]]*\])/g),o=o.replace(/(\\.)/g,(e,t)=>{let i=`__esc-ph-${this.index}__`;return this.placeholders.push(t),this.index++,i}),this._content=o.replace(wU,(e,t,i)=>{let r=`__ph-${this.index}__`;return this.placeholders.push(`(${i})`),this.index++,t+r})}restore(o){return o.replace(/__(?:ph|esc-ph)-(\d+)__/g,(e,t)=>this.placeholders[+t])}content(){return this._content}_escapeRegexMatches(o,e){return o.replace(e,(t,i)=>{let r=`__ph-${this.index}__`;return this.placeholders.push(i),this.index++,r})}},CU="(:(where|is)\\()?",Gg=/:(where|is)\(/gi,xU=/polyfill-next-selector[^}]*content:[\s]*?(['"])(.*?)\1[;\s]*}([^{]*?){/gim,bU=/(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim,$5=/(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim,B1="-shadowcsshost",fh="-shadowcsscontext",FT="[^)(]*",yU=String.raw`(?:\(${FT}\)|${FT})+?`,SU=String.raw`(?:\(${yU}\)|${FT})+?`,HE=String.raw`(?:\((${SU})\))`,wU=new RegExp(String.raw`(:nth-[-\w]+)`+HE,"g"),MU=new RegExp(B1+HE+"?([^,{]*)","gim"),kU=fh+HE+"?([^{]*)",TU=new RegExp(`${CU}(${kU})`,"gim"),am=B1+"-no-combinator",EU=new RegExp(`${am}(?![^(]*\\))`,"g"),Rk=/-shadowcsshost-no-combinator([^\s,]*)/,DU=[/::shadow/g,/::content/g,/\/shadow-deep\//g,/\/shadow\//g],H5=/(?:>>>)|(?:\/deep\/)|(?:::ng-deep)/g,PU="([>\\s~+[.,{:][\\s\\S]*)?$",Ch=/-shadowcsshost/gim,IU=/:host/gim,AU=/:host-context/gim,OU=/\r?\n/g,NU=/\/\*[\s\S]*?\*\//g,FU=/\/\*\s*#\s*source(Mapping)?URL=/g,UE="%COMMENT%",RU=new RegExp(UE,"g"),Lk="%BLOCK%",LU=new RegExp(`(\\s*(?:${UE}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`,"g"),VU=new Map([["{","}"]]),FF="%COMMA_IN_PLACEHOLDER%",RF="%SEMI_IN_PLACEHOLDER%",LF="%COLON_IN_PLACEHOLDER%",BU=new RegExp(FF,"g"),zU=new RegExp(RF,"g"),jU=new RegExp(LF,"g"),Q_=class{selector;content;constructor(o,e){this.selector=o,this.content=e}};function HC(n,o){let e=UU(n),t=$U(e,VU,Lk),i=0,r=t.escapedString.replace(LU,(...a)=>{let c=a[2],p="",u=a[4],h="";u&&u.startsWith("{"+Lk)&&(p=t.blocks[i++],u=u.substring(Lk.length+1),h="{");let g=o(new Q_(c,p));return`${a[1]}${g.selector}${a[3]}${h}${g.content}${u}`});return WU(r)}var RT=class{escapedString;blocks;constructor(o,e){this.escapedString=o,this.blocks=e}};function $U(n,o,e){let t=[],i=[],r=0,a=0,c=-1,p,u;for(let h=0;h<n.length;h++){let g=n[h];g==="\\"?h++:g===u?(r--,r===0&&(i.push(n.substring(c,h)),t.push(e),a=h,c=-1,p=u=void 0)):g===p?r++:r===0&&o.has(g)&&(p=g,u=o.get(g),r=1,c=h+1,t.push(n.substring(a,c)))}return c!==-1?(i.push(n.substring(c)),t.push(e)):t.push(n.substring(a)),new RT(t.join(""),i)}var HU={";":RF,",":FF,":":LF};function UU(n){let o=n,e=null;for(let t=0;t<o.length;t++){let i=o[t];if(i==="\\")t++;else if(e!==null)if(i===e)e=null;else{let r=HU[i];r&&(o=`${o.substr(0,t)}${r}${o.substr(t+1)}`,t+=r.length-1)}else(i==="'"||i==='"')&&(e=i)}return o}function WU(n){let o=n.replace(BU,",");return o=o.replace(zU,";"),o=o.replace(jU,":"),o}function U5(n,o){return o?n.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g,"$1"):n}function GU(n,o,e=""){let t=am;Ch.lastIndex=0;let i=Ch.test(o);if(n.length===0)return t+o;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=>i?`${e}${a}${o}`:`${e}${a}${t}${o}, ${e}${a} ${t}${o}`).join(",")}function qU(n,o){let e=n.length;for(let t=1;t<o;t++)for(let i=0;i<e;i++)n[i+t*e]=n[i].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||{}),Zt=(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})(Zt||{}),rl=(function(n){return n[n.None=0]="None",n[n.AlwaysInline=1]="AlwaysInline",n})(rl||{}),Zr=(function(n){return n[n.Context=0]="Context",n[n.Identifier=1]="Identifier",n[n.SavedView=2]="SavedView",n[n.Alias=3]="Alias",n})(Zr||{}),Ht=(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})(Ht||{}),X_=(function(n){return n[n.Creation=0]="Creation",n[n.Postproccessing=1]="Postproccessing",n})(X_||{}),qh=(function(n){return n[n.I18nText=0]="I18nText",n[n.I18nAttribute=1]="I18nAttribute",n})(qh||{}),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||{}),wr=(function(n){return n[n.HTML=0]="HTML",n[n.SVG=1]="SVG",n[n.Math=2]="Math",n})(wr||{}),to=(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})(to||{}),Lp=(function(n){return n[n.RootI18n=0]="RootI18n",n[n.Icu=1]="Icu",n[n.Attr=2]="Attr",n})(Lp||{}),ss=(function(n){return n[n.NgTemplate=0]="NgTemplate",n[n.Structural=1]="Structural",n[n.Block=2]="Block",n})(ss||{}),Ke=(()=>{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 i of e)this.push(i);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,i=this.head;for(let r of e)i.next=r,r.prev=i,i=r;i.next=t,t.prev=i}*[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 i=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=i,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 i of e)n.insertBefore(i,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 Vs(n){return Z({kind:V.Statement,statement:n},_n)}function lm(n,o,e,t){return Z({kind:V.Variable,xref:n,variable:o,initializer:e,flags:t},_n)}var _n={debugListId:null,prev:null,next:null},VF=Symbol("ConsumesSlot"),WE=Symbol("DependsOnSlotContext"),lu=Symbol("ConsumesVars"),g0=Symbol("UsesVarOffset"),dl={[VF]:!0,numSlotsUsed:1},ms={[WE]:!0},ps={[lu]:!0};function Qh(n){return n[VF]===!0}function K_(n){return n[WE]===!0}function Vk(n){return n[lu]===!0}function W5(n){return n[g0]===!0}function QU(n,o,e){return Z(Z(Z({kind:V.InterpolateText,target:n,interpolation:o,sourceSpan:e},ms),ps),_n)}var tr=class{strings;expressions;i18nPlaceholders;constructor(o,e,t){if(this.strings=o,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 nu(n,o,e,t,i,r,a,c,p,u,h){return Z({kind:V.Binding,bindingKind:o,target:n,name:e,expression:t,unit:i,securityContext:r,isTextAttribute:a,isStructuralTemplateAttribute:c,templateKind:p,i18nContext:null,i18nMessage:u,sourceSpan:h},_n)}function XU(n,o,e,t,i,r,a,c,p,u){return Z(Z(Z({kind:V.Property,target:n,name:o,expression:e,bindingKind:t,securityContext:i,sanitizer:null,isStructuralTemplateAttribute:r,templateKind:a,i18nContext:c,i18nMessage:p,sourceSpan:u},ms),ps),_n)}function KU(n,o,e,t,i,r,a,c,p){return Z(Z(Z({kind:V.TwoWayProperty,target:n,name:o,expression:e,securityContext:t,sanitizer:null,isStructuralTemplateAttribute:i,templateKind:r,i18nContext:a,i18nMessage:c,sourceSpan:p},ms),ps),_n)}function YU(n,o,e,t,i){return Z(Z(Z({kind:V.StyleProp,target:n,name:o,expression:e,unit:t,sourceSpan:i},ms),ps),_n)}function ZU(n,o,e,t){return Z(Z(Z({kind:V.ClassProp,target:n,name:o,expression:e,sourceSpan:t},ms),ps),_n)}function JU(n,o,e){return Z(Z(Z({kind:V.StyleMap,target:n,expression:o,sourceSpan:e},ms),ps),_n)}function eW(n,o,e){return Z(Z(Z({kind:V.ClassMap,target:n,expression:o,sourceSpan:e},ms),ps),_n)}function G5(n,o,e,t,i,r,a,c,p,u){return Z(Z(Z({kind:V.Attribute,target:n,namespace:o,name:e,expression:t,securityContext:i,sanitizer:null,isTextAttribute:r,isStructuralTemplateAttribute:a,templateKind:c,i18nContext:null,i18nMessage:p,sourceSpan:u},ms),ps),_n)}function tW(n,o){return Z({kind:V.Advance,delta:n,sourceSpan:o},_n)}function BF(n,o,e,t){return Z(Z(Z({kind:V.Conditional,target:n,test:o,conditions:e,processed:null,sourceSpan:t,contextValue:null},_n),ms),ps)}function nW(n,o,e,t){return Z(Z({kind:V.Repeater,target:n,targetSlot:o,collection:e,sourceSpan:t},_n),ms)}function q5(n,o,e,t,i,r,a){return Z({kind:V.AnimationBinding,name:n,target:o,animationKind:e,expression:t,i18nMessage:null,securityContext:i,sanitizer:null,sourceSpan:r,animationBindingKind:a},_n)}function iW(n,o,e,t){return Z(Z(Z({kind:V.DeferWhen,target:n,expr:o,modifier:e,sourceSpan:t},_n),ms),ps)}function zF(n,o,e,t,i,r,a,c,p,u,h){return Z(Z(Z({kind:V.I18nExpression,context:n,target:o,i18nOwner:e,handle:t,expression:i,icuPlaceholder:r,i18nPlaceholder:a,resolutionTime:c,usage:p,name:u,sourceSpan:h},_n),ps),ms)}function oW(n,o,e){return Z({kind:V.I18nApply,owner:n,handle:o,sourceSpan:e},_n)}function rW(n,o,e,t){return Z(Z(Z({kind:V.StoreLet,target:n,declaredName:o,value:e,sourceSpan:t},ms),ps),_n)}function aW(n,o){return Z(Z({kind:V.Control,sourceSpan:o,target:n},ms),_n)}function Nc(n){return n instanceof Ki}var Ki=class extends Ui{constructor(o=null){super(null,o)}},Kr=class n extends Ki{name;kind=Zt.LexicalRead;constructor(o){super(),this.name=o}visitExpression(o,e){}isEquivalent(o){return this.name===o.name}isConstant(){return!1}transformInternalExpressions(){}clone(){return new n(this.name)}},z1=class n extends Ki{target;targetSlot;offset;kind=Zt.Reference;constructor(o,e,t){super(),this.target=o,this.targetSlot=e,this.offset=t}visitExpression(){}isEquivalent(o){return o instanceof n&&o.target===this.target}isConstant(){return!1}transformInternalExpressions(){}clone(){return new n(this.target,this.targetSlot,this.offset)}},Y_=class n extends Ki{target;value;sourceSpan;kind=Zt.StoreLet;[lu]=!0;[WE]=!0;constructor(o,e,t){super(),this.target=o,this.value=e,this.sourceSpan=t}visitExpression(){}isEquivalent(o){return o instanceof n&&o.target===this.target&&o.value.isEquivalent(this.value)}isConstant(){return!1}transformInternalExpressions(o,e){this.value=zt(this.value,o,e)}clone(){return new n(this.target,this.value,this.sourceSpan)}},Z_=class n extends Ki{target;targetSlot;kind=Zt.ContextLetReference;constructor(o,e){super(),this.target=o,this.targetSlot=e}visitExpression(){}isEquivalent(o){return o instanceof n&&o.target===this.target}isConstant(){return!1}transformInternalExpressions(){}clone(){return new n(this.target,this.targetSlot)}},Cm=class n extends Ki{view;kind=Zt.Context;constructor(o){super(),this.view=o}visitExpression(){}isEquivalent(o){return o instanceof n&&o.view===this.view}isConstant(){return!1}transformInternalExpressions(){}clone(){return new n(this.view)}},LT=class n extends Ki{view;kind=Zt.TrackContext;constructor(o){super(),this.view=o}visitExpression(){}isEquivalent(o){return o instanceof n&&o.view===this.view}isConstant(){return!1}transformInternalExpressions(){}clone(){return new n(this.view)}},j1=class n extends Ki{kind=Zt.NextContext;steps=1;visitExpression(){}isEquivalent(o){return o instanceof n&&o.steps===this.steps}isConstant(){return!1}transformInternalExpressions(){}clone(){let o=new n;return o.steps=this.steps,o}},VT=class n extends Ki{kind=Zt.GetCurrentView;constructor(){super()}visitExpression(){}isEquivalent(o){return o instanceof n}isConstant(){return!1}transformInternalExpressions(){}clone(){return new n}},J_=class n extends Ki{view;kind=Zt.RestoreView;constructor(o){super(),this.view=o}visitExpression(o,e){typeof this.view!="number"&&this.view.visitExpression(o,e)}isEquivalent(o){return!(o instanceof n)||typeof o.view!=typeof this.view?!1:typeof this.view=="number"?this.view===o.view:this.view.isEquivalent(o.view)}isConstant(){return!1}transformInternalExpressions(o,e){typeof this.view!="number"&&(this.view=zt(this.view,o,e))}clone(){return new n(this.view instanceof Ui?this.view.clone():this.view)}},$1=class n extends Ki{expr;kind=Zt.ResetView;constructor(o){super(),this.expr=o}visitExpression(o,e){this.expr.visitExpression(o,e)}isEquivalent(o){return o instanceof n&&this.expr.isEquivalent(o.expr)}isConstant(){return!1}transformInternalExpressions(o,e){this.expr=zt(this.expr,o,e)}clone(){return new n(this.expr.clone())}},H1=class n extends Ki{target;value;kind=Zt.TwoWayBindingSet;constructor(o,e){super(),this.target=o,this.value=e}visitExpression(o,e){this.target.visitExpression(o,e),this.value.visitExpression(o,e)}isEquivalent(o){return this.target.isEquivalent(o.target)&&this.value.isEquivalent(o.value)}isConstant(){return!1}transformInternalExpressions(o,e){this.target=zt(this.target,o,e),this.value=zt(this.value,o,e)}clone(){return new n(this.target,this.value)}},wd=class n extends Ki{xref;kind=Zt.ReadVariable;name=null;constructor(o){super(),this.xref=o}visitExpression(){}isEquivalent(o){return o instanceof n&&o.xref===this.xref}isConstant(){return!1}transformInternalExpressions(){}clone(){let o=new n(this.xref);return o.name=this.name,o}},iu=class n extends Ki{kind=Zt.PureFunctionExpr;[lu]=!0;[g0]=!0;varOffset=null;body;args;fn=null;constructor(o,e){super(),this.body=o,this.args=e}visitExpression(o,e){this.body?.visitExpression(o,e);for(let t of this.args)t.visitExpression(o,e)}isEquivalent(o){return!(o instanceof n)||o.args.length!==this.args.length?!1:o.body!==null&&this.body!==null&&o.body.isEquivalent(this.body)&&o.args.every((e,t)=>e.isEquivalent(this.args[t]))}isConstant(){return!1}transformInternalExpressions(o,e){this.body!==null?this.body=zt(this.body,o,e|Qn.InChildOperation):this.fn!==null&&(this.fn=zt(this.fn,o,e));for(let t=0;t<this.args.length;t++)this.args[t]=zt(this.args[t],o,e)}clone(){let o=new n(this.body?.clone()??null,this.args.map(e=>e.clone()));return o.fn=this.fn?.clone()??null,o.varOffset=this.varOffset,o}},xm=class n extends Ki{index;kind=Zt.PureFunctionParameterExpr;constructor(o){super(),this.index=o}visitExpression(){}isEquivalent(o){return o instanceof n&&o.index===this.index}isConstant(){return!0}transformInternalExpressions(){}clone(){return new n(this.index)}},ou=class n extends Ki{target;targetSlot;name;args;kind=Zt.PipeBinding;[lu]=!0;[g0]=!0;varOffset=null;constructor(o,e,t,i){super(),this.target=o,this.targetSlot=e,this.name=t,this.args=i}visitExpression(o,e){for(let t of this.args)t.visitExpression(o,e)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(o,e){for(let t=0;t<this.args.length;t++)this.args[t]=zt(this.args[t],o,e)}clone(){let o=new n(this.target,this.targetSlot,this.name,this.args.map(e=>e.clone()));return o.varOffset=this.varOffset,o}},e0=class n extends Ki{target;targetSlot;name;args;numArgs;kind=Zt.PipeBindingVariadic;[lu]=!0;[g0]=!0;varOffset=null;constructor(o,e,t,i,r){super(),this.target=o,this.targetSlot=e,this.name=t,this.args=i,this.numArgs=r}visitExpression(o,e){this.args.visitExpression(o,e)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(o,e){this.args=zt(this.args,o,e)}clone(){let o=new n(this.target,this.targetSlot,this.name,this.args.clone(),this.numArgs);return o.varOffset=this.varOffset,o}},Bh=class n extends Ki{receiver;name;kind=Zt.SafePropertyRead;constructor(o,e){super(),this.receiver=o,this.name=e}get index(){return this.name}visitExpression(o,e){this.receiver.visitExpression(o,e)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(o,e){this.receiver=zt(this.receiver,o,e)}clone(){return new n(this.receiver.clone(),this.name)}},zh=class n extends Ki{receiver;index;kind=Zt.SafeKeyedRead;constructor(o,e,t){super(t),this.receiver=o,this.index=e}visitExpression(o,e){this.receiver.visitExpression(o,e),this.index.visitExpression(o,e)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(o,e){this.receiver=zt(this.receiver,o,e),this.index=zt(this.index,o,e)}clone(){return new n(this.receiver.clone(),this.index.clone(),this.sourceSpan)}},ru=class n extends Ki{receiver;args;kind=Zt.SafeInvokeFunction;constructor(o,e){super(),this.receiver=o,this.args=e}visitExpression(o,e){this.receiver.visitExpression(o,e);for(let t of this.args)t.visitExpression(o,e)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(o,e){this.receiver=zt(this.receiver,o,e);for(let t=0;t<this.args.length;t++)this.args[t]=zt(this.args[t],o,e)}clone(){return new n(this.receiver.clone(),this.args.map(o=>o.clone()))}},jh=class n extends Ki{guard;expr;kind=Zt.SafeTernaryExpr;constructor(o,e){super(),this.guard=o,this.expr=e}visitExpression(o,e){this.guard.visitExpression(o,e),this.expr.visitExpression(o,e)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(o,e){this.guard=zt(this.guard,o,e),this.expr=zt(this.expr,o,e)}clone(){return new n(this.guard.clone(),this.expr.clone())}},t0=class n extends Ki{kind=Zt.EmptyExpr;visitExpression(o,e){}isEquivalent(o){return o instanceof n}isConstant(){return!0}clone(){return new n}transformInternalExpressions(){}},Fc=class n extends Ki{expr;xref;kind=Zt.AssignTemporaryExpr;name=null;constructor(o,e){super(),this.expr=o,this.xref=e}visitExpression(o,e){this.expr.visitExpression(o,e)}isEquivalent(){return!1}isConstant(){return!1}transformInternalExpressions(o,e){this.expr=zt(this.expr,o,e)}clone(){let o=new n(this.expr.clone(),this.xref);return o.name=this.name,o}},bm=class n extends Ki{xref;kind=Zt.ReadTemporaryExpr;name=null;constructor(o){super(),this.xref=o}visitExpression(o,e){}isEquivalent(){return this.xref===this.xref}isConstant(){return!1}transformInternalExpressions(o,e){}clone(){let o=new n(this.xref);return o.name=this.name,o}},U1=class n extends Ki{slot;kind=Zt.SlotLiteralExpr;constructor(o){super(),this.slot=o}visitExpression(o,e){}isEquivalent(o){return o instanceof n&&o.slot===this.slot}isConstant(){return!0}clone(){return new n(this.slot)}transformInternalExpressions(){}},W1=class n extends Ki{expr;target;targetSlot;alias;kind=Zt.ConditionalCase;constructor(o,e,t,i=null){super(),this.expr=o,this.target=e,this.targetSlot=t,this.alias=i}visitExpression(o,e){this.expr!==null&&this.expr.visitExpression(o,e)}isEquivalent(o){return o instanceof n&&o.expr===this.expr}isConstant(){return!0}clone(){return new n(this.expr,this.target,this.targetSlot)}transformInternalExpressions(o,e){this.expr!==null&&(this.expr=zt(this.expr,o,e))}},n0=class n extends Ki{expr;kind=Zt.ConstCollected;constructor(o){super(),this.expr=o}transformInternalExpressions(o,e){this.expr=o(this.expr,e)}visitExpression(o,e){this.expr.visitExpression(o,e)}isEquivalent(o){return o instanceof n?this.expr.isEquivalent(o.expr):!1}isConstant(){return this.expr.isConstant()}clone(){return new n(this.expr)}},BT=class n extends Ki{parameters;body;kind=Zt.ArrowFunction;[lu]=!0;[g0]=!0;contextName=Ls;currentViewName="view";varOffset=null;ops;constructor(o,e){super(),this.parameters=o,this.body=e,this.ops=new Ke,this.ops.push([Vs(new kr(e,e.sourceSpan))])}visitExpression(o,e){for(let t of this.ops)fr(t,i=>{i.visitExpression(o,e)})}isEquivalent(o){return o instanceof n&&o.parameters.length===this.parameters.length&&o.parameters.every((e,t)=>e.isEquivalent(this.parameters[t]))&&o.body.isEquivalent(this.body)}isConstant(){return!1}transformInternalExpressions(o,e){for(let t of this.ops)nr(t,o,e|(Qn.InChildOperation|Qn.InArrowFunctionOperation))}clone(){let o=new n(this.parameters,this.body);return o.varOffset=this.varOffset,o.ops=this.ops,o}};function fr(n,o){nr(n,(e,t)=>(o(e,t),e),Qn.None)}var Qn=(function(n){return n[n.None=0]="None",n[n.InChildOperation=1]="InChildOperation",n[n.InArrowFunctionOperation=2]="InArrowFunctionOperation",n})(Qn||{});function Bk(n,o,e){for(let t=0;t<n.expressions.length;t++)n.expressions[t]=zt(n.expressions[t],o,e)}function nr(n,o,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 tr?Bk(n.expression,o,e):n.expression=zt(n.expression,o,e);break;case V.Property:case V.DomProperty:case V.Attribute:n.expression instanceof tr?Bk(n.expression,o,e):n.expression=zt(n.expression,o,e),n.sanitizer=n.sanitizer&&zt(n.sanitizer,o,e);break;case V.TwoWayProperty:n.expression=zt(n.expression,o,e),n.sanitizer=n.sanitizer&&zt(n.sanitizer,o,e);break;case V.I18nExpression:n.expression=zt(n.expression,o,e);break;case V.InterpolateText:Bk(n.interpolation,o,e);break;case V.Statement:G1(n.statement,o,e);break;case V.Variable:n.initializer=zt(n.initializer,o,e);break;case V.Conditional:for(let t of n.conditions)t.expr!==null&&(t.expr=zt(t.expr,o,e));n.processed!==null&&(n.processed=zt(n.processed,o,e)),n.contextValue!==null&&(n.contextValue=zt(n.contextValue,o,e));break;case V.Animation:case V.AnimationListener:case V.Listener:case V.TwoWayListener:for(let t of n.handlerOps)nr(t,o,e|Qn.InChildOperation);break;case V.ExtractedAttribute:n.expression=n.expression&&zt(n.expression,o,e),n.trustedValueFn=n.trustedValueFn&&zt(n.trustedValueFn,o,e);break;case V.RepeaterCreate:if(n.trackByOps===null)n.track=zt(n.track,o,e);else for(let t of n.trackByOps)nr(t,o,e|Qn.InChildOperation);n.trackByFn!==null&&(n.trackByFn=zt(n.trackByFn,o,e));break;case V.Repeater:n.collection=zt(n.collection,o,e);break;case V.Defer:n.loadingConfig!==null&&(n.loadingConfig=zt(n.loadingConfig,o,e)),n.placeholderConfig!==null&&(n.placeholderConfig=zt(n.placeholderConfig,o,e)),n.resolverFn!==null&&(n.resolverFn=zt(n.resolverFn,o,e));break;case V.I18nMessage:for(let[t,i]of n.params)n.params.set(t,zt(i,o,e));for(let[t,i]of n.postprocessingParams)n.postprocessingParams.set(t,zt(i,o,e));break;case V.DeferWhen:n.expr=zt(n.expr,o,e);break;case V.StoreLet:n.value=zt(n.value,o,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 zt(n,o,e){if(n instanceof Ki)n.transformInternalExpressions(o,e);else if(n instanceof vi)n.lhs=zt(n.lhs,o,e),n.rhs=zt(n.rhs,o,e);else if(n instanceof Qp)n.expr=zt(n.expr,o,e);else if(n instanceof Fs)n.receiver=zt(n.receiver,o,e);else if(n instanceof Md)n.receiver=zt(n.receiver,o,e),n.index=zt(n.index,o,e);else if(n instanceof cs){n.fn=zt(n.fn,o,e);for(let t=0;t<n.args.length;t++)n.args[t]=zt(n.args[t],o,e)}else if(n instanceof Pc)for(let t=0;t<n.entries.length;t++)n.entries[t]=zt(n.entries[t],o,e);else if(n instanceof Ql)for(let t of n.entries)t instanceof pm?t.expression=zt(t.expression,o,e):t.value=zt(t.value,o,e);else if(n instanceof Dc)n.condition=zt(n.condition,o,e),n.trueCase=zt(n.trueCase,o,e),n.falseCase!==null&&(n.falseCase=zt(n.falseCase,o,e));else if(n instanceof kh)n.expr=zt(n.expr,o,e);else if(n instanceof c1)n.expr=zt(n.expr,o,e);else if(n instanceof m1)for(let t=0;t<n.expressions.length;t++)n.expressions[t]=zt(n.expressions[t],o,e);else if(n instanceof C_)n.condition=zt(n.condition,o,e);else if(n instanceof g_)n.tag=zt(n.tag,o,e),n.template.expressions=n.template.expressions.map(t=>zt(t,o,e));else if(n instanceof su)if(Array.isArray(n.body))for(let t=0;t<n.body.length;t++)G1(n.body[t],o,e|Qn.InChildOperation);else n.body=zt(n.body,o,e|Qn.InChildOperation);else if(!(n instanceof si)){if(n instanceof v_)for(let t=0;t<n.expressions.length;t++)n.expressions[t]=zt(n.expressions[t],o,e);else if(n instanceof ql)n.expr=zt(n.expr,o,e);else if(n instanceof Xp)n.expression=zt(n.expression,o,e);else if(!(n instanceof Gl||n instanceof qp||n instanceof ma||n instanceof Th))throw new Error(`Unhandled expression kind: ${n.constructor.name}`)}return o(n,e)}function G1(n,o,e){if(n instanceof pa)n.expr=zt(n.expr,o,e);else if(n instanceof kr)n.value=zt(n.value,o,e);else if(n instanceof Hr)n.value!==void 0&&(n.value=zt(n.value,o,e));else if(n instanceof u1){n.condition=zt(n.condition,o,e);for(let t of n.trueCase)G1(t,o,e);for(let t of n.falseCase)G1(t,o,e)}else throw new Error(`Unhandled statement kind: ${n.constructor.name}`)}function jF(n){return n instanceof ma&&typeof n.value=="string"}var ua=class{slot=null},sW=new Set([V.Element,V.ElementStart,V.Container,V.ContainerStart,V.Template,V.RepeaterCreate,V.ConditionalCreate,V.ConditionalBranchCreate]);function ym(n){return sW.has(n.kind)}function lW(n,o,e,t,i,r){return Z(Z({kind:V.ElementStart,xref:o,tag:n,handle:new ua,attributes:null,localRefs:[],nonBindable:!1,namespace:e,i18nPlaceholder:t,startSourceSpan:i,wholeSourceSpan:r},dl),_n)}function $F(n,o,e,t,i,r,a,c){return Z(Z({kind:V.Template,xref:n,templateKind:o,attributes:null,tag:e,handle:new ua,functionNameSuffix:t,decls:null,vars:null,localRefs:[],nonBindable:!1,namespace:i,i18nPlaceholder:r,startSourceSpan:a,wholeSourceSpan:c},dl),_n)}function HF(n,o,e,t,i,r,a,c){return Z(Z({kind:V.ConditionalCreate,xref:n,templateKind:o,attributes:null,tag:e,handle:new ua,functionNameSuffix:t,decls:null,vars:null,localRefs:[],nonBindable:!1,namespace:i,i18nPlaceholder:r,startSourceSpan:a,wholeSourceSpan:c},dl),_n)}function UF(n,o,e,t,i,r,a,c){return Z(Z({kind:V.ConditionalBranchCreate,xref:n,templateKind:o,attributes:null,tag:e,handle:new ua,functionNameSuffix:t,decls:null,vars:null,localRefs:[],nonBindable:!1,namespace:i,i18nPlaceholder:r,startSourceSpan:a,wholeSourceSpan:c},dl),_n)}function cW(n,o,e,t,i,r,a,c,p,u){return Ye(Z(Z(Z({kind:V.RepeaterCreate,attributes:null,xref:n,handle:new ua,emptyView:o,track:t,trackByFn:null,trackByOps:null,tag:e,emptyTag:r,emptyAttributes:null,functionNameSuffix:"For",namespace:wr.HTML,nonBindable:!1,localRefs:[],decls:null,vars:null,varNames:i,usesComponentInstance:!1,i18nPlaceholder:a,emptyI18nPlaceholder:c,startSourceSpan:p,wholeSourceSpan:u},dl),_n),ps),{numSlotsUsed:o===null?2:3})}function dW(n,o){return Z({kind:V.ElementEnd,xref:n,sourceSpan:o},_n)}function mW(n){return Z({kind:V.DisableBindings,xref:n},_n)}function pW(n){return Z({kind:V.EnableBindings,xref:n},_n)}function WF(n,o,e,t){return Z(Z({kind:V.Text,xref:n,handle:new ua,initialValue:o,icuPlaceholder:e,sourceSpan:t},dl),_n)}function uW(n,o,e,t,i,r){return Z({kind:V.AnimationString,name:n,target:o,animationKind:e,expression:t,i18nMessage:null,securityContext:i,sanitizer:null,sourceSpan:r},_n)}function hW(n,o,e,t,i,r){let a=new Ke;return a.push(t),Z({kind:V.Animation,name:n,target:o,animationKind:e,handlerOps:a,handlerFnName:null,i18nMessage:null,securityContext:i,sanitizer:null,sourceSpan:r},_n)}function GE(n,o,e,t,i,r,a,c,p){let u=new Ke;return u.push(i),Z({kind:V.Listener,target:n,targetSlot:o,tag:t,hostListener:c,name:e,handlerOps:u,handlerFnName:null,consumesDollarEvent:!1,isLegacyAnimationListener:r!==null,legacyAnimationPhase:r,eventTarget:a,sourceSpan:p},_n)}function GF(n,o,e,t,i,r,a,c,p){let u=new Ke;return u.push(i),Z({kind:V.AnimationListener,target:n,targetSlot:o,tag:t,hostListener:c,name:e,animationKind:r,handlerOps:u,handlerFnName:null,consumesDollarEvent:!1,eventTarget:a,sourceSpan:p},_n)}function qF(n,o,e,t,i,r){let a=new Ke;return a.push(i),Z({kind:V.TwoWayListener,target:n,targetSlot:o,tag:t,name:e,handlerOps:a,handlerFnName:null,sourceSpan:r},_n)}function fW(n,o,e){return Z(Z({kind:V.Pipe,xref:n,handle:o,name:e},_n),dl)}function gW(n){return Z({kind:V.Namespace,active:n},_n)}function _W(n){return Z({kind:V.ProjectionDef,def:n},_n)}function vW(n,o,e,t,i){return Ye(Z(Z({kind:V.Projection,xref:n,handle:new ua,selector:o,i18nPlaceholder:e,fallbackView:t,projectionSlotIndex:0,attributes:null,localRefs:[],sourceSpan:i},_n),dl),{numSlotsUsed:t===null?1:2})}function al(n,o,e,t,i,r,a,c){return Z({kind:V.ExtractedAttribute,target:n,bindingKind:o,namespace:e,name:t,expression:i,i18nContext:r,i18nMessage:a,securityContext:c,trustedValueFn:null},_n)}function CW(n,o,e,t,i,r){return Ye(Z(Z({kind:V.Defer,xref:n,handle:new ua,mainView:o,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:i,flags:null,sourceSpan:r},_n),dl),{numSlotsUsed:2})}function rm(n,o,e,t){return Z({kind:V.DeferOn,defer:n,trigger:o,modifier:e,sourceSpan:t},_n)}function xW(n,o,e){return Z(Z({kind:V.DeclareLet,xref:n,declaredName:o,sourceSpan:e,handle:new ua},dl),_n)}function bW(n,o,e,t,i,r,a,c){return Z({kind:V.I18nMessage,xref:n,i18nContext:o,i18nBlock:e,message:t,messagePlaceholder:i,params:r,postprocessingParams:a,needsPostprocessing:c,subMessages:[]},_n)}function gx(n,o,e,t){return Z(Z({kind:V.I18nStart,xref:n,handle:new ua,root:e??n,message:o,messageIndex:null,subTemplateIndex:null,context:null,sourceSpan:t},_n),dl)}function _x(n,o){return Z({kind:V.I18nEnd,xref:n,sourceSpan:o},_n)}function yW(n,o,e,t){return Z({kind:V.IcuStart,xref:n,message:o,messagePlaceholder:e,context:null,sourceSpan:t},_n)}function SW(n){return Z({kind:V.IcuEnd,xref:n},_n)}function wW(n,o,e){return Z({kind:V.IcuPlaceholder,xref:n,name:o,strings:e,expressionPlaceholders:[]},_n)}function zk(n,o,e,t,i){if(e===null&&n!==Lp.Attr)throw new Error("AssertionError: i18nBlock must be provided for non-attribute contexts.");return Z({kind:V.I18nContext,contextKind:n,xref:o,i18nBlock:e,message:t,sourceSpan:i,params:new Map,postprocessingParams:new Map},_n)}function QF(n,o,e){return Z(Z({kind:V.I18nAttributes,xref:n,handle:o,target:e,i18nAttributesConfig:null},_n),dl)}function MW(n,o){return Z({kind:V.SourceLocation,templatePath:n,locations:o},_n)}function kW(n){return Z({kind:V.ControlCreate,sourceSpan:n},_n)}function TW(n,o,e,t,i,r){return Z(Z({kind:V.DomProperty,name:n,expression:o,bindingKind:e,i18nContext:t,securityContext:i,sanitizer:null,sourceSpan:r},ps),_n)}var XF="CTX_REF_MARKER",Ot=(function(n){return n[n.Tmpl=0]="Tmpl",n[n.Host=1]="Host",n[n.Both=2]="Both",n})(Ot||{}),is=(function(n){return n[n.Full=0]="Full",n[n.DomOnly=1]="DomOnly",n})(is||{}),q1=class{componentName;pool;mode;constructor(o,e,t){this.componentName=o,this.pool=e,this.mode=t}kind=Ot.Both;allocateXrefId(){return this.nextXrefId++}nextXrefId=0},i0=class extends q1{relativeContextFilePath;i18nUseExternalIds;deferMeta;allDeferrableDepsFn;relativeTemplatePath;enableDebugLocations;constructor(o,e,t,i,r,a,c,p,u){super(o,e,t),this.relativeContextFilePath=i,this.i18nUseExternalIds=r,this.deferMeta=a,this.allDeferrableDepsFn=c,this.relativeTemplatePath=p,this.enableDebugLocations=u,this.root=new sl(this,this.allocateXrefId(),null),this.views.set(this.root.xref,this.root)}kind=Ot.Tmpl;fnSuffix="Template";root;views=new Map;contentSelectors=null;allocateView(o){let e=new sl(this,this.allocateXrefId(),o);return this.views.set(e.xref,e),e}get units(){return this.views.values()}addConst(o,e){for(let i=0;i<this.consts.length;i++)if(this.consts[i].isEquivalent(o))return i;let t=this.consts.length;return this.consts.push(o),e&&this.constsInitializers.push(...e),t}consts=[];constsInitializers=[]},Q1=class{xref;constructor(o){this.xref=o}create=new Ke;update=new Ke;functions=new Set;fnName=null;vars=null;*ops(){for(let o of this.functions)for(let e of o.ops)yield e;for(let o of this.create)if(yield o,o.kind===V.Listener||o.kind===V.Animation||o.kind===V.AnimationListener||o.kind===V.TwoWayListener)for(let e of o.handlerOps)yield e;else if(o.kind===V.RepeaterCreate&&o.trackByOps!==null)for(let e of o.trackByOps)yield e;for(let o of this.update)yield o}},sl=class extends Q1{job;parent;constructor(o,e,t){super(e),this.job=o,this.parent=t}contextVariables=new Map;aliases=new Set;decls=null},X1=class extends q1{constructor(o,e,t){super(o,e,t),this.root=new zT(this)}kind=Ot.Host;fnSuffix="HostBindings";root;get units(){return[this.root]}},zT=class extends Q1{job;constructor(o){super(0),this.job=o}attributes=null};function EW(n){for(let o of n.units)for(let e of o.ops())nr(e,DW,Qn.None)}function DW(n){if(n instanceof cs&&n.fn instanceof Kr&&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 PW(n){let o=new Map;for(let e of n.units)for(let t of e.create)t.kind===V.I18nContext&&o.set(t.xref,t);for(let e of n.units)for(let t of e.update)t.kind===V.I18nExpression&&IW(o,t)&&Ke.insertAfter(oW(t.i18nOwner,t.handle,null),t)}function IW(n,o){if(o.next?.kind!==V.I18nExpression)return!0;let e=n.get(o.context),t=n.get(o.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:o.i18nOwner!==o.next.i18nOwner}function AW(n){for(let o of n.units){let e=o.update.head,t=[],i=null;for(let r of o.create){if(r.kind===V.I18nStart)i={blockXref:r.xref,lastSlotConsumer:r.xref};else if(r.kind===V.I18nEnd){for(let a of t)a.target=i.lastSlotConsumer,Ke.insertBefore(a,e);t.length=0,i=null}if(Qh(r))for(i!==null&&(i.lastSlotConsumer=r.xref);e.next!==null;){if(i!==null&&e.kind===V.I18nExpression&&e.usage===qh.I18nText&&e.i18nOwner===i.blockXref){let c=e;e=e.next,Ke.remove(c),t.push(c);continue}let a=!1;if(K_(e)&&e.target!==r.xref?a=!0:(e.kind===V.Statement||e.kind===V.Variable)&&fr(e,c=>{!a&&K_(c)&&c.target!==r.xref&&(a=!0)}),a)break;e=e.next}}}}function OW(n){if(!(!n.enableDebugLocations||n.relativeTemplatePath===null))for(let o of n.units){let e=[];for(let t of o.create)if(t.kind===V.ElementStart||t.kind===V.Element){let i=t.startSourceSpan.start;e.push({targetSlot:t.handle,offset:i.offset,line:i.line,column:i.col})}e.length>0&&o.create.push(MW(n.relativeTemplatePath,e))}}function KF(n){let o=new Map;for(let e of n.create)Qh(e)&&(o.set(e.xref,e),e.kind===V.RepeaterCreate&&e.emptyView!==null&&o.set(e.emptyView,e));return o}function NW(n){for(let o of n.units){let e=KF(o);for(let t of o.ops())switch(t.kind){case V.Attribute:FW(o,t,e);break;case V.Property:if(t.bindingKind!==Ht.LegacyAnimation&&t.bindingKind!==Ht.Animation){let i;t.i18nMessage!==null&&t.templateKind===null?i=Ht.I18n:t.isStructuralTemplateAttribute?i=Ht.Template:i=Ht.Property,Ke.insertBefore(al(t.target,i,null,t.name,null,null,null,t.securityContext),gh(e,t.target))}break;case V.TwoWayProperty:Ke.insertBefore(al(t.target,Ht.TwoWayProperty,null,t.name,null,null,null,t.securityContext),gh(e,t.target));break;case V.StyleProp:case V.ClassProp:t.expression instanceof t0&&Ke.insertBefore(al(t.target,Ht.Property,null,t.name,null,null,null,fi.STYLE),gh(e,t.target));break;case V.Listener:if(!t.isLegacyAnimationListener){let i=al(t.target,Ht.Property,null,t.name,null,null,null,fi.NONE);if(n.kind===Ot.Host)break;Ke.insertBefore(i,gh(e,t.target))}break;case V.TwoWayListener:if(n.kind!==Ot.Host){let i=al(t.target,Ht.Property,null,t.name,null,null,null,fi.NONE);Ke.insertBefore(i,gh(e,t.target))}break}}}function gh(n,o){let e=n.get(o);if(e===void 0)throw new Error("All attributes should have an element-like target.");return e}function FW(n,o,e){if(!(o.expression instanceof tr)&&o.isTextAttribute){let t=al(o.target,o.isStructuralTemplateAttribute?Ht.Template:Ht.Attribute,o.namespace,o.name,o.expression,o.i18nContext,o.i18nMessage,o.securityContext);if(n.job.kind===Ot.Host)n.create.push(t);else{let i=gh(e,o.target);Ke.insertBefore(t,i)}Ke.remove(o)}}var Q5="aria-";function YF(n){return n.startsWith(Q5)&&n.length>Q5.length}function RW(n,o){let e=n.get(o);if(e===void 0)throw new Error("All attributes should have an element-like target.");return e}function LW(n){let o=new Map;for(let e of n.units)for(let t of e.create)ym(t)&&o.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 Ht.Attribute:if(t.name==="ngNonBindable"){Ke.remove(t);let i=RW(o,t.target);i.nonBindable=!0}else if(t.name.startsWith("animate."))Ke.replace(t,q5(t.name,t.target,t.name==="animate.enter"?"enter":"leave",t.expression,t.securityContext,t.sourceSpan,0));else{let[i,r]=Sa(t.name);Ke.replace(t,G5(t.target,i,r,t.expression,t.securityContext,t.isTextAttribute,t.isStructuralTemplateAttribute,t.templateKind,t.i18nMessage,t.sourceSpan))}break;case Ht.Animation:Ke.replace(t,q5(t.name,t.target,t.name==="animate.enter"?"enter":"leave",t.expression,t.securityContext,t.sourceSpan,1));break;case Ht.Property:case Ht.LegacyAnimation:n.mode===is.DomOnly&&YF(t.name)?Ke.replace(t,G5(t.target,null,t.name,t.expression,t.securityContext,!1,t.isStructuralTemplateAttribute,t.templateKind,t.i18nMessage,t.sourceSpan)):n.kind===Ot.Host?Ke.replace(t,TW(t.name,t.expression,t.bindingKind,t.i18nContext,t.securityContext,t.sourceSpan)):Ke.replace(t,XU(t.target,t.name,t.expression,t.bindingKind,t.securityContext,t.isStructuralTemplateAttribute,t.templateKind,t.i18nContext,t.i18nMessage,t.sourceSpan));break;case Ht.TwoWayProperty:if(!(t.expression instanceof Ui))throw new Error(`Expected value of two-way property binding "${t.name}" to be an expression`);Ke.replace(t,KU(t.target,t.name,t.expression,t.securityContext,t.isStructuralTemplateAttribute,t.templateKind,t.i18nContext,t.i18nMessage,t.sourceSpan));break;case Ht.I18n:case Ht.ClassName:case Ht.StyleProperty:throw new Error(`Unhandled binding of kind ${Ht[t.bindingKind]}`)}}var X5=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]]),VW=256;function BW(n){for(let o of n.units)K5(o.create),K5(o.update)}function K5(n){let o=null;for(let e of n){if(e.kind!==V.Statement||!(e.statement instanceof pa)){o=null;continue}if(!(e.statement.expr instanceof cs)||!(e.statement.expr.fn instanceof qp)){o=null;continue}let t=e.statement.expr.fn.value;if(!X5.has(t)){o=null;continue}if(o!==null&&X5.get(o.instruction)===t&&o.length<VW){let i=o.expression.callFn(e.statement.expr.args,e.statement.expr.sourceSpan,e.statement.expr.pure);o.expression=i,o.op.statement=i.toStmt(),o.length++,Ke.remove(e)}else o={op:e,instruction:t,expression:e.statement.expr,length:1}}}function zW(n){for(let o of n.units)for(let e of o.update)(e.kind===V.Attribute||e.kind===V.StyleProp||e.kind==V.StyleMap||e.kind===V.ClassMap)&&e.expression instanceof tr&&e.expression.strings.length===2&&e.expression.strings.every(i=>i==="")&&(e.expression=e.expression.expressions[0])}function jW(n){for(let o of n.units)for(let e of o.ops()){if(e.kind!==V.Conditional)continue;let t,i=e.conditions.findIndex(c=>c.expr===null);if(i>=0){let c=e.conditions.splice(i,1)[0].targetSlot;t=new U1(c)}else t=Ee(-1);let r=e.test==null?null:new Fc(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 bm(r.xref);p.expr=new vi(st.Identical,u,p.expr)}else p.alias!==null&&(a??=n.allocateXrefId(),p.expr=new Fc(p.expr,a),e.contextValue=new bm(a));t=new Dc(p.expr,new U1(p.targetSlot),t)}}e.processed=t,e.conditions=[]}}var $W=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 ZF(n){let o=new Map([["svg",wr.SVG],["math",wr.Math]]);return n===null?wr.HTML:o.get(n)??wr.HTML}function HW(n){let o=new Map([["svg",wr.SVG],["math",wr.Math]]);for(let[e,t]of o.entries())if(t===n)return e;return null}function UW(n,o){return o===wr.HTML?n:`:${HW(o)}:${n}`}function $h(n){return Array.isArray(n)?Xi(n.map($h)):Ee(n)}function WW(n){let o=new Map;for(let e of n.units)for(let t of e.create)if(t.kind===V.ExtractedAttribute){let i=o.get(t.target)||new jT;o.set(t.target,i),i.add(t.bindingKind,t.name,t.expression,t.namespace,t.trustedValueFn),Ke.remove(t)}if(n instanceof i0)for(let e of n.units)for(let t of e.create)if(t.kind==V.Projection){let i=o.get(t.xref);if(i!==void 0){let r=$T(i);r.entries.length>0&&(t.attributes=n.pool.getConstLiteral(r,!0))}}else ym(t)&&(t.attributes=Y5(n,o,t.xref),t.kind===V.RepeaterCreate&&t.emptyView!==null&&(t.emptyAttributes=Y5(n,o,t.emptyView)));else if(n instanceof X1)for(let[e,t]of o.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 i=$T(t);i.entries.length>0&&(n.root.attributes=i)}}function Y5(n,o,e){let t=o.get(e);if(t!==void 0){let i=$T(t);if(i.entries.length>0)return n.addConst(i)}return null}var dh=Object.freeze([]),jT=class{known=new Map;byKind=new Map;propertyBindings=null;projectAs=null;get attributes(){return this.byKind.get(Ht.Attribute)??dh}get classes(){return this.byKind.get(Ht.ClassName)??dh}get styles(){return this.byKind.get(Ht.StyleProperty)??dh}get bindings(){return this.propertyBindings??dh}get template(){return this.byKind.get(Ht.Template)??dh}get i18n(){return this.byKind.get(Ht.I18n)??dh}isKnown(o,e){let t=this.known.get(o)??new Set;return this.known.set(o,t),t.has(e)?!0:(t.add(e),!1)}add(o,e,t,i,r){if(!(o===Ht.Attribute||o===Ht.ClassName||o===Ht.StyleProperty)&&this.isKnown(o,e))return;if(e==="ngProjectAs"){if(t===null||!(t instanceof ma)||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(o);if(c.push(...GW(i,e)),o===Ht.Attribute||o===Ht.StyleProperty){if(t===null)throw Error("Attribute, i18n attribute, & style element attributes must have a value");r!==null&&jF(t)?c.push(lH(r,new v_([new d1(t.value)],[]),void 0,t.sourceSpan)):c.push(t)}}arrayFor(o){return o===Ht.Property||o===Ht.TwoWayProperty?(this.propertyBindings??=[],this.propertyBindings):(this.byKind.has(o)||this.byKind.set(o,[]),this.byKind.get(o))}};function GW(n,o){let e=Ee(o);return n?[Ee(0),Ee(n),e]:[e]}function $T({attributes:n,bindings:o,classes:e,i18n:t,projectAs:i,styles:r,template:a}){let c=[...n];if(i!==null){let p=AE(i)[0];c.push(Ee(5),$h(p))}return e.length>0&&c.push(Ee(1),...e),r.length>0&&c.push(Ee(2),...r),o.length>0&&c.push(Ee(3),...o),a.length>0&&c.push(Ee(4),...a),t.length>0&&c.push(Ee(6),...t),Xi(c)}function qW(n,o){let e=n.get(o);if(e===void 0)throw new Error("All attributes should have an element-like target.");return e}function QW(n){let o=new Map;for(let e of n.units)for(let t of e.create)ym(t)&&o.set(t.xref,t);for(let e of n.units)for(let t of e.ops())if(t.kind===V.AnimationBinding){let i=XW(t);n.kind===Ot.Host?e.create.push(i):Ke.insertAfter(i,qW(o,t.target)),Ke.remove(t)}}function XW(n){if(n.animationBindingKind===0)return uW(n.name,n.target,n.name==="animate.enter"?"enter":"leave",n.expression,n.securityContext,n.sourceSpan);{let o=n.expression;return hW(n.name,n.target,n.name==="animate.enter"?"enter":"leave",[Vs(new kr(o,o.sourceSpan))],n.securityContext,n.sourceSpan)}}function KW(n){let o=new Map;for(let e of n.units){for(let t of e.create)t.kind===V.I18nAttributes&&o.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 tr))continue;let i=o.get(t.target);if(i===void 0)throw new Error("AssertionError: An i18n attribute binding instruction requires the owning element to have an I18nAttributes create instruction");if(i.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(zF(t.i18nContext,i.target,i.xref,i.handle,c,null,t.expression.i18nPlaceholders[a],X_.Creation,qh.I18nAttribute,t.name,t.sourceSpan))}Ke.replaceWithMany(t,r);break}}}function YW(n){let o=new Map;for(let i of n.units)for(let r of i.ops())switch(r.kind){case V.Binding:case V.Property:case V.Attribute:case V.ExtractedAttribute:if(r.i18nMessage===null)continue;if(!o.has(r.i18nMessage)){let a=zk(Lp.Attr,n.allocateXrefId(),null,r.i18nMessage,null);i.create.push(a),o.set(r.i18nMessage,a.xref)}r.i18nContext=o.get(r.i18nMessage);break}let e=new Map;for(let i of n.units)for(let r of i.create)switch(r.kind){case V.I18nStart:if(r.xref===r.root){let a=zk(Lp.RootI18n,n.allocateXrefId(),r.xref,r.message,null);i.create.push(a),r.context=a.xref,e.set(r.xref,a)}break}for(let i of n.units)for(let r of i.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 i of n.units)for(let r of i.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=zk(Lp.Icu,n.allocateXrefId(),t.root,r.message,null);i.create.push(a),r.context=a.xref}else r.context=t.context,e.get(t.xref).contextKind=Lp.Icu;break}}function ZW(n){let o=new Map;for(let e of n.units)for(let t of e.update.reversed())if(t.kind===V.Binding&&t.isTextAttribute){let i=o.get(t.target)||new Set;i.has(t.name)&&(t.name==="style"||t.name==="class")&&Ke.remove(t),i.add(t.name),o.set(t.target,i)}}function JW(n){for(let o of n.units)for(let e of o.create)e.kind===V.Defer&&(e.placeholderMinimumTime!==null&&(e.placeholderConfig=new n0($h([e.placeholderMinimumTime]))),(e.loadingMinimumTime!==null||e.loadingAfterTime!==null)&&(e.loadingConfig=new n0($h([e.loadingMinimumTime,e.loadingAfterTime]))))}function eG(n){let o=new Map;function e(i){if(o.has(i.xref))return o.get(i.xref);let r=new tG;for(let a of i.create)if(!(!ym(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 o.set(i.xref,r),r}function t(i,r,a){switch(r.trigger.kind){case to.Idle:case to.Never:case to.Immediate:case to.Timer:return;case to.Hover:case to.Interaction:case to.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(Qh(h)&&(ym(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):i,p=a!==null?-1:0;for(;c!==null;){let u=e(c);if(u.targets.has(r.trigger.targetName)){let{xref:h,slot:g}=u.targets.get(r.trigger.targetName);r.trigger.targetXref=h,r.trigger.targetView=c.xref,r.trigger.targetSlotViewSteps=p,r.trigger.targetSlot=g;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 i of n.units){let r=new Map;for(let a of i.create)switch(a.kind){case V.Defer:r.set(a.xref,a);break;case V.DeferOn:let c=r.get(a.defer);t(i,a,a.modifier==="hydrate"?c.mainView:c.placeholderView);break}}}var tG=class{targets=new Map},nG=new Map([[V.ElementEnd,[V.ElementStart,V.Element]],[V.ContainerEnd,[V.ContainerStart,V.Container]],[V.I18nEnd,[V.I18nStart,V.I18n]]]),iG=new Set([V.Pipe]);function oG(n){for(let o of n.units)for(let e of o.create){let t=nG.get(e.kind);if(t===void 0)continue;let[i,r]=t,a=e.prev;for(;a!==null&&iG.has(a.kind);)a=a.prev;a!==null&&a.kind===i&&(a.kind=r,Ke.remove(e))}}function rG(n){for(let o of n.units)for(let e of o.ops())nr(e,t=>mG(t,{job:n}),Qn.None),nr(e,pG,Qn.None)}function Ds(n){return n instanceof Qp?Ds(n.expr):n instanceof vi?Ds(n.lhs)||Ds(n.rhs):n instanceof Dc?n.falseCase&&Ds(n.falseCase)?!0:Ds(n.condition)||Ds(n.trueCase):n instanceof C_?Ds(n.condition):n instanceof Fc?Ds(n.expr):n instanceof Fs?Ds(n.receiver):n instanceof Md?Ds(n.receiver)||Ds(n.index):n instanceof ql?Ds(n.expr):n instanceof cs||n instanceof Pc||n instanceof Ql||n instanceof ru||n instanceof ou}function aG(n){let o=new Set;return zt(n,e=>(e instanceof Fc&&o.add(e.xref),e),Qn.None),o}function sG(n,o,e){return zt(n,t=>{if(t instanceof Fc&&o.has(t.xref)){let i=new bm(t.xref);return new Fc(i,i.xref)}return t},Qn.None),n}function mh(n,o,e){let t;if(Ds(n)){let i=e.job.allocateXrefId();t=[new Fc(n,i),new bm(i)]}else t=[n,n.clone()],sG(t[1],aG(t[0]));return new jh(t[0],o(t[1]))}function lG(n){return n instanceof Bh||n instanceof zh||n instanceof ru}function cG(n){return n instanceof Fs||n instanceof Md||n instanceof cs}function JF(n){return lG(n)||cG(n)}function dG(n){if(JF(n)&&n.receiver instanceof jh){let o=n.receiver;for(;o.expr instanceof jh;)o=o.expr;return o}return null}function mG(n,o){if(!JF(n))return n;let e=dG(n);if(e){if(n instanceof cs)return e.expr=e.expr.callFn(n.args),n.receiver;if(n instanceof Fs)return e.expr=e.expr.prop(n.name),n.receiver;if(n instanceof Md)return e.expr=e.expr.key(n.index),n.receiver;if(n instanceof ru)return e.expr=mh(e.expr,t=>t.callFn(n.args),o),n.receiver;if(n instanceof Bh)return e.expr=mh(e.expr,t=>t.prop(n.name),o),n.receiver;if(n instanceof zh)return e.expr=mh(e.expr,t=>t.key(n.index),o),n.receiver}else{if(n instanceof ru)return mh(n.receiver,t=>t.callFn(n.args),o);if(n instanceof Bh)return mh(n.receiver,t=>t.prop(n.name),o);if(n instanceof zh)return mh(n.receiver,t=>t.key(n.index),o)}return n}function pG(n){return n instanceof jh?new ql(new Dc(new vi(st.Equals,n.guard,Dh),Dh,n.expr)):n}var Z5="\uFFFD",uG="#",hG="*",fG="/",gG=":",_G="[",vG="]",CG="|";function xG(n){let o=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=bG(n,a);r.create.push(c),o.set(a.xref,c),t.set(a.xref,a);break;case V.I18nStart:e.set(a.xref,a);break}let i=null;for(let r of n.units)for(let a of r.create)switch(a.kind){case V.IcuStart:i=a,Ke.remove(a);let c=t.get(a.context);if(c.contextKind!==Lp.Icu)continue;let p=e.get(c.i18nBlock);if(p.context===c.xref)continue;let u=e.get(p.root),h=o.get(u.context);if(h===void 0)throw Error("AssertionError: ICU sub-message should belong to a root message.");let g=o.get(c.xref);g.messagePlaceholder=a.messagePlaceholder,h.subMessages.push(g.xref);break;case V.IcuEnd:i=null,Ke.remove(a);break;case V.IcuPlaceholder:if(i===null||i.context==null)throw Error("AssertionError: Unexpected ICU placeholder outside of i18n context");o.get(i.context).postprocessingParams.set(a.name,Ee(yG(a))),Ke.remove(a);break}}function bG(n,o,e){let t=J5(o.params),i=J5(o.postprocessingParams),r=[...o.params.values()].some(a=>a.length>1);return bW(n.allocateXrefId(),o.xref,o.i18nBlock,o.message,null,t,i,r)}function yG(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 o=n.expressionPlaceholders.map(xh);return n.strings.flatMap((e,t)=>[e,o[t]||""]).join("")}function J5(n){let o=new Map;for(let[e,t]of n){let i=SG(t);i!==null&&o.set(e,Ee(i))}return o}function SG(n){if(n.length===0)return null;let o=n.map(e=>xh(e));return o.length===1?o[0]:`${_G}${o.join(CG)}${vG}`}function xh(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 i=xh(Ye(Z({},n),{value:n.value.element,flags:n.flags&~ao.TemplateTag})),r=xh(Ye(Z({},n),{value:n.value.template,flags:n.flags&~ao.ElementTag}));return n.flags&ao.OpenTag&&n.flags&ao.CloseTag?`${r}${i}${r}`:n.flags&ao.CloseTag?`${i}${r}`:`${r}${i}`}if(n.flags&ao.OpenTag&&n.flags&ao.CloseTag)return`${xh(Ye(Z({},n),{flags:n.flags&~ao.CloseTag}))}${xh(Ye(Z({},n),{flags:n.flags&~ao.OpenTag}))}`;if(n.flags===ao.None)return`${n.value}`;let o="",e="";n.flags&ao.ElementTag?o=uG:n.flags&ao.TemplateTag&&(o=hG),o!==""&&(e=n.flags&ao.CloseTag?fG:"");let t=n.subTemplateIndex===null?"":`${gG}${n.subTemplateIndex}`;return`${Z5}${e}${o}${n.value}${t}${Z5}`}function wG(n){for(let o of n.units){let e=new Map;for(let i of o.create){if(Qh(i)){if(i.handle.slot===null)throw new Error("AssertionError: expected slots to have been allocated before generating advance() calls")}else continue;e.set(i.xref,i.handle.slot)}let t=0;for(let i of o.update){let r=null;if(K_(i)?r=i:fr(i,c=>{r===null&&K_(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");Ke.insertBefore(tW(c,r.sourceSpan),i),t=a}}}}function MG(n){for(let o of n.units)for(let e of o.update){if(e.kind!==V.StoreLet)continue;let t={kind:Zr.Identifier,name:null,identifier:e.declaredName,local:!0};Ke.replace(e,lm(n.allocateXrefId(),t,new Y_(e.target,e.value,e.sourceSpan),rl.None))}}function kG(n){let e=[],t=0;for(let i of n.units)for(let r of i.create)r.kind===V.Projection&&(e.push(r.selector),r.projectionSlotIndex=t++);if(e.length>0){let i=null;if(e.length>1||e[0]!=="*"){let r=e.map(a=>a==="*"?a:AE(a));i=n.pool.getConstLiteral($h(r),!0)}n.contentSelectors=n.pool.getConstLiteral($h(e),!0),n.root.create.prepend([_W(i)])}}function TG(n){n_(n.root,null)}function n_(n,o){let e=eN(n,o);for(let t of n.create)switch(t.kind){case V.ConditionalCreate:case V.ConditionalBranchCreate:case V.Template:n_(n.job.views.get(t.xref),e);break;case V.Projection:t.fallbackView!==null&&n_(n.job.views.get(t.fallbackView),e);break;case V.RepeaterCreate:n_(n.job.views.get(t.xref),e),t.emptyView&&n_(n.job.views.get(t.emptyView),e),t.trackByOps!==null&&t.trackByOps.prepend(i_(n,e,!1));break;case V.Animation:case V.AnimationListener:case V.Listener:case V.TwoWayListener:t.handlerOps.prepend(i_(n,e,!0));break}n.update.prepend(i_(n,e,!1));for(let t of n.functions)t.ops.prepend(i_(n,eN(n,o),!0))}function eN(n,o){let e={view:n.xref,viewContextVariable:{kind:Zr.Context,name:null,view:n.xref},contextVariables:new Map,aliases:n.aliases,references:[],letDeclarations:[],parent:o};for(let t of n.contextVariables.keys())e.contextVariables.set(t,{kind:Zr.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 i=0;i<t.localRefs.length;i++)e.references.push({name:t.localRefs[i].name,targetId:t.xref,targetSlot:t.handle,offset:i,variable:{kind:Zr.Identifier,name:null,identifier:t.localRefs[i].name,local:!1}});break;case V.DeclareLet:e.letDeclarations.push({targetId:t.xref,targetSlot:t.handle,variable:{kind:Zr.Identifier,name:null,identifier:t.declaredName,local:!1}});break}return e}function i_(n,o,e){let t=[];o.view!==n.xref&&t.push(lm(n.job.allocateXrefId(),o.viewContextVariable,new j1,rl.None));let i=n.job.views.get(o.view);for(let[r,a]of i.contextVariables){let c=new Cm(o.view),p=a===XF?c:new Fs(c,a);t.push(lm(n.job.allocateXrefId(),o.contextVariables.get(r),p,rl.None))}for(let r of i.aliases)t.push(lm(n.job.allocateXrefId(),r,r.expression.clone(),rl.AlwaysInline));for(let r of o.references)t.push(lm(n.job.allocateXrefId(),r.variable,new z1(r.targetId,r.targetSlot,r.offset),rl.None));if(o.view!==n.xref||e)for(let r of o.letDeclarations)t.push(lm(n.job.allocateXrefId(),r.variable,new Z_(r.targetId,r.targetSlot),rl.None));return o.parent!==null&&t.push(...i_(n,o.parent,!1)),t}function EG(n){for(let o of n.units)for(let e of o.ops())nr(e,t=>t instanceof n0?Ee(n.addConst(t.expr)):t,Qn.None)}var tN="style.",nN="class.",DG="style!",iN="class!",oN="!important";function PG(n){for(let o of n.root.update)if(o.kind===V.Binding&&o.bindingKind===Ht.Property)if(o.name.endsWith(oN)&&(o.name=o.name.substring(0,o.name.length-oN.length)),o.name.startsWith(tN)){o.bindingKind=Ht.StyleProperty,o.name=o.name.substring(tN.length),IG(o.name)||(o.name=AG(o.name));let{property:e,suffix:t}=jk(o.name);o.name=e,o.unit=t}else o.name.startsWith(DG)?(o.bindingKind=Ht.StyleProperty,o.name="style"):o.name.startsWith(nN)?(o.bindingKind=Ht.ClassName,o.name=jk(o.name.substring(nN.length)).property):o.name.startsWith(iN)&&(o.bindingKind=Ht.ClassName,o.name=jk(o.name.substring(iN.length)).property)}function IG(n){return n.startsWith("--")}function AG(n){return n.replace(/[a-z][A-Z]/g,o=>o.charAt(0)+"-"+o.charAt(1)).toLowerCase()}function jk(n){let o=n.indexOf("!important");o!==-1&&(n=o>0?n.substring(0,o):"");let e=null,t=n,i=n.lastIndexOf(".");return i>0&&(e=n.slice(i+1),t=n.substring(0,i)),{property:t,suffix:e}}function HT(n,o=!1){return cl(Object.keys(n).map(e=>({key:e,quoted:o,value:n[e]})))}var UT=class{visitText(o){return o.value}visitContainer(o){return o.children.map(e=>e.visit(this)).join("")}visitIcu(o){let e=Object.keys(o.cases).map(i=>`${i} {${o.cases[i].visit(this)}}`);return`{${o.expressionPlaceholder}, ${o.type}, ${e.join(" ")}}`}visitTagPlaceholder(o){return o.isVoid?this.formatPh(o.startName):`${this.formatPh(o.startName)}${o.children.map(e=>e.visit(this)).join("")}${this.formatPh(o.closeName)}`}visitPlaceholder(o){return this.formatPh(o.name)}visitBlockPlaceholder(o){return`${this.formatPh(o.startName)}${o.children.map(e=>e.visit(this)).join("")}${this.formatPh(o.closeName)}`}visitIcuPlaceholder(o,e){return this.formatPh(o.name)}formatPh(o){return`{${h0(o,!1)}}`}},OG=new UT;function e6(n){return n.visit(OG)}var kd=class{sourceSpan;i18n;constructor(o,e){this.sourceSpan=o,this.i18n=e}},au=class extends kd{value;tokens;constructor(o,e,t,i){super(e,i),this.value=o,this.tokens=t}visit(o,e){return o.visitText(this,e)}},$p=class extends kd{switchValue;type;cases;switchValueSourceSpan;constructor(o,e,t,i,r,a){super(i,a),this.switchValue=o,this.type=e,this.cases=t,this.switchValueSourceSpan=r}visit(o,e){return o.visitExpansion(this,e)}},K1=class{value;expression;sourceSpan;valueSourceSpan;expSourceSpan;constructor(o,e,t,i,r){this.value=o,this.expression=e,this.sourceSpan=t,this.valueSourceSpan=i,this.expSourceSpan=r}visit(o,e){return o.visitExpansionCase(this,e)}},WT=class extends kd{name;value;keySpan;valueSpan;valueTokens;constructor(o,e,t,i,r,a,c){super(t,c),this.name=o,this.value=e,this.keySpan=i,this.valueSpan=r,this.valueTokens=a}visit(o,e){return o.visitAttribute(this,e)}},el=class extends kd{name;attrs;directives;children;isSelfClosing;startSourceSpan;endSourceSpan;isVoid;constructor(o,e,t,i,r,a,c,p=null,u,h){super(a,h),this.name=o,this.attrs=e,this.directives=t,this.children=i,this.isSelfClosing=r,this.startSourceSpan=c,this.endSourceSpan=p,this.isVoid=u}visit(o,e){return o.visitElement(this,e)}},o0=class{value;sourceSpan;constructor(o,e){this.value=o,this.sourceSpan=e}visit(o,e){return o.visitComment(this,e)}},il=class extends kd{name;parameters;children;nameSpan;startSourceSpan;endSourceSpan;constructor(o,e,t,i,r,a,c=null,p){super(i,p),this.name=o,this.parameters=e,this.children=t,this.nameSpan=r,this.startSourceSpan=a,this.endSourceSpan=c}visit(o,e){return o.visitBlock(this,e)}},Va=class extends kd{componentName;tagName;fullName;attrs;directives;children;isSelfClosing;startSourceSpan;endSourceSpan;constructor(o,e,t,i,r,a,c,p,u,h=null,g){super(p,g),this.componentName=o,this.tagName=e,this.fullName=t,this.attrs=i,this.directives=r,this.children=a,this.isSelfClosing=c,this.startSourceSpan=u,this.endSourceSpan=h}visit(o,e){return o.visitComponent(this,e)}},GT=class{name;attrs;sourceSpan;startSourceSpan;endSourceSpan;constructor(o,e,t,i,r=null){this.name=o,this.attrs=e,this.sourceSpan=t,this.startSourceSpan=i,this.endSourceSpan=r}visit(o,e){return o.visitDirective(this,e)}},Y1=class{expression;sourceSpan;constructor(o,e){this.expression=o,this.sourceSpan=e}visit(o,e){return o.visitBlockParameter(this,e)}},Z1=class{name;value;sourceSpan;nameSpan;valueSpan;constructor(o,e,t,i,r){this.name=o,this.value=e,this.sourceSpan=t,this.nameSpan=i,this.valueSpan=r}visit(o,e){return o.visitLetDeclaration(this,e)}};function xo(n,o,e=null){let t=[],i=n.visit?r=>n.visit(r,e)||r.visit(n,e):r=>r.visit(n,e);return o.forEach(r=>{let a=i(r);a&&t.push(a)}),t}var r0={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"},t6="\uE500";r0.ngsp=t6;var qT=class{tokens;errors;nonNormalizedIcuExpressions;constructor(o,e,t){this.tokens=o,this.errors=e,this.nonNormalizedIcuExpressions=t}};function NG(n,o,e,t={}){let i=new XT(new L1(n,o),e,t);return i.tokenize(),new qT(UG(i.tokens),i.errors,i.nonNormalizedIcuExpressions)}var FG=/\r\n?/g;function ph(n){return`Unexpected character "${n===Yr?"EOF":String.fromCharCode(n)}"`}function rN(n){return`Unknown entity "${n}" - use the "&#<decimal>;" or "&#x<hex>;" syntax`}function RG(n,o){return`Unable to parse entity "${o}" - ${n} character reference entities must end with ";"`}var QT=(function(n){return n.HEX="hexadecimal",n.DEC="decimal",n})(QT||{}),LG=["@if","@else","@for","@switch","@case","@default","@empty","@defer","@placeholder","@loading","@error"],qg={start:"{{",end:"}}"},XT=class{_getTagDefinition;_cursor;_tokenizeIcu;_leadingTriviaCodePoints;_currentTokenStart=null;_currentTokenType=null;_expansionCaseStack=[];_openDirectiveCount=0;_inInterpolation=!1;_preserveLineEndings;_i18nNormalizeLineEndingsInICUs;_tokenizeBlocks;_tokenizeLet;_selectorlessEnabled;tokens=[];errors=[];nonNormalizedIcuExpressions=[];constructor(o,e,t){this._getTagDefinition=e,this._tokenizeIcu=t.tokenizeExpansionForms||!1,this._leadingTriviaCodePoints=t.leadingTriviaChars&&t.leadingTriviaChars.map(r=>r.codePointAt(0)||0);let i=t.range||{endPos:o.content.length,startPos:0,startLine:0,startCol:0};this._cursor=t.escapedString?new KT(o,i):new J1(o,i),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(o){return this._preserveLineEndings?o:o.replace(FG,`
|
||
`)}tokenize(){for(;this._cursor.peek()!==Yr;){let o=this._cursor.clone();try{this._attemptCharCode(wh)?this._attemptCharCode(TT)?this._attemptCharCode(kc)?this._consumeCdata(o):this._attemptCharCode(F1)?this._consumeComment(o):this._consumeDocType(o):this._attemptCharCode(tl)?this._consumeTagClose(o):this._consumeTagOpen(o):this._tokenizeLet&&this._cursor.peek()===ch&&!this._inInterpolation&&this._isLetStart()?this._consumeLetDeclaration(o):this._tokenizeBlocks&&this._isBlockStart()?this._consumeBlockStart(o):this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode(Ba)?this._consumeBlockEnd(o):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(5,8,()=>this._isTextEnd(),()=>this._isTagStart())}catch(e){this.handleError(e)}}this._beginToken(41),this._endToken([])}_getBlockName(){let o=!1,e=this._cursor.clone();return this._attemptCharCodeUntilFn(t=>G_(t)?!o:HG(t)?(o=!0,!1):!0),this._cursor.getChars(e).trim()}_consumeBlockStart(o){this._requireCharCode(ch),this._beginToken(24,o);let e=this._endToken([this._getBlockName()]);if(e.parts[0]==="default never"&&this._attemptCharCode(rs)){this._beginToken(25),this._endToken([]),this._beginToken(26),this._endToken([]);return}if(this._cursor.peek()===ja)if(this._cursor.advance(),this._consumeBlockParameters(),this._attemptCharCodeUntilFn(Bo),this._attemptCharCode(Sr))this._attemptCharCodeUntilFn(Bo);else{e.type=28;return}this._attemptCharCode(ol)?(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(o){this._beginToken(26,o),this._endToken([])}_consumeBlockParameters(){for(this._attemptCharCodeUntilFn(sN);this._cursor.peek()!==Sr&&this._cursor.peek()!==Yr;){this._beginToken(27);let o=this._cursor.clone(),e=null,t=0;for(;this._cursor.peek()!==rs&&this._cursor.peek()!==Yr||e!==null;){let i=this._cursor.peek();if(i===jp)this._cursor.advance();else if(i===e)e=null;else if(e===null&&l_(i))e=i;else if(i===ja&&e===null)t++;else if(i===Sr&&e===null){if(t===0)break;t>0&&t--}this._cursor.advance()}this._endToken([this._cursor.getChars(o)]),this._attemptCharCodeUntilFn(sN)}}_consumeLetDeclaration(o){if(this._requireStr("@let"),this._beginToken(29,o),G_(this._cursor.peek()))this._attemptCharCodeUntilFn(Bo);else{let i=this._endToken([this._cursor.getChars(o)]);i.type=32;return}let e=this._endToken([this._getLetDeclarationName()]);if(this._attemptCharCodeUntilFn(Bo),!this._attemptCharCode(Xr)){e.type=32;return}this._attemptCharCodeUntilFn(i=>Bo(i)&&!R1(i)),this._consumeLetDeclarationValue(),this._cursor.peek()===rs?(this._beginToken(31),this._cursor.advance(),this._endToken([])):(e.type=32,e.sourceSpan=this._cursor.getSpan(o))}_getLetDeclarationName(){let o=this._cursor.clone(),e=!1;return this._attemptCharCodeUntilFn(t=>vm(t)||t===fx||t===wm||e&&nl(t)?(e=!0,!1):!0),this._cursor.getChars(o).trim()}_consumeLetDeclarationValue(){let o=this._cursor.clone();for(this._beginToken(30,o);this._cursor.peek()!==Yr;){let e=this._cursor.peek();if(e===rs)break;l_(e)&&(this._cursor.advance(),this._attemptCharCodeUntilFn(t=>t===jp?(this._cursor.advance(),!1):t===e)),this._cursor.advance()}this._endToken([this._cursor.getChars(o)])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(jG(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===Ba){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(o,e=this._cursor.clone()){this._currentTokenStart=e,this._currentTokenType=o}_endToken(o,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:o,sourceSpan:(e??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};return this.tokens.push(t),this._currentTokenStart=null,this._currentTokenType=null,t}_createError(o,e){this._isInExpansionForm()&&(o+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`);let t=new sn(e,o);return this._currentTokenStart=null,this._currentTokenType=null,t}handleError(o){if(o instanceof a0&&(o=this._createError(o.msg,this._cursor.getSpan(o.cursor))),o instanceof sn)this.errors.push(o);else throw o}_attemptCharCode(o){return this._cursor.peek()===o?(this._cursor.advance(),!0):!1}_attemptCharCodeCaseInsensitive(o){return $G(this._cursor.peek(),o)?(this._cursor.advance(),!0):!1}_requireCharCode(o){let e=this._cursor.clone();if(!this._attemptCharCode(o))throw this._createError(ph(this._cursor.peek()),this._cursor.getSpan(e))}_attemptStr(o){let e=o.length;if(this._cursor.charsLeft()<e)return!1;let t=this._cursor.clone();for(let i=0;i<e;i++)if(!this._attemptCharCode(o.charCodeAt(i)))return this._cursor=t,!1;return!0}_attemptStrCaseInsensitive(o){for(let e=0;e<o.length;e++)if(!this._attemptCharCodeCaseInsensitive(o.charCodeAt(e)))return!1;return!0}_requireStr(o){let e=this._cursor.clone();if(!this._attemptStr(o))throw this._createError(ph(this._cursor.peek()),this._cursor.getSpan(e))}_attemptCharCodeUntilFn(o){for(;!o(this._cursor.peek());)this._cursor.advance()}_requireCharCodeUntilFn(o,e){let t=this._cursor.clone();if(this._attemptCharCodeUntilFn(o),this._cursor.diff(t)<e)throw this._createError(ph(this._cursor.peek()),this._cursor.getSpan(t))}_attemptUntilChar(o){for(;this._cursor.peek()!==o;)this._cursor.advance()}_readChar(){let o=String.fromCodePoint(this._cursor.peek());return this._cursor.advance(),o}_peekStr(o){let e=o.length;if(this._cursor.charsLeft()<e)return!1;let t=this._cursor.clone();for(let i=0;i<e;i++){if(t.peek()!==o.charCodeAt(i))return!1;t.advance()}return!0}_isBlockStart(){return this._cursor.peek()===ch&&LG.some(o=>this._peekStr(o))}_isLetStart(){return this._cursor.peek()===ch&&this._peekStr("@let")}_consumeEntity(o){this._beginToken(9);let e=this._cursor.clone();if(this._cursor.advance(),this._attemptCharCode(MF)){let t=this._attemptCharCode(OF)||this._attemptCharCode(JH),i=this._cursor.clone();if(this._attemptCharCodeUntilFn(BG),this._cursor.peek()!=rs){this._cursor.advance();let a=t?QT.HEX:QT.DEC;throw this._createError(RG(a,this._cursor.getChars(e)),this._cursor.getSpan())}let r=this._cursor.getChars(i);this._cursor.advance();try{let a=parseInt(r,t?16:10);this._endToken([String.fromCodePoint(a),this._cursor.getChars(e)])}catch{throw this._createError(rN(this._cursor.getChars(e)),this._cursor.getSpan())}}else{let t=this._cursor.clone();if(this._attemptCharCodeUntilFn(zG),this._cursor.peek()!=rs)this._beginToken(o,e),this._cursor=t,this._endToken(["&"]);else{let i=this._cursor.getChars(t);this._cursor.advance();let r=r0.hasOwnProperty(i)&&r0[i];if(!r)throw this._createError(rN(i),this._cursor.getSpan(e));this._endToken([r,`&${i};`])}}}_consumeRawText(o,e){this._beginToken(o?6:7);let t=[];for(;;){let i=this._cursor.clone(),r=e();if(this._cursor=i,r)break;o&&this._cursor.peek()===N1?(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(o){this._beginToken(10,o),this._requireCharCode(F1),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("-->")),this._beginToken(11),this._requireStr("-->"),this._endToken([])}_consumeCdata(o){this._beginToken(12,o),this._requireStr("CDATA["),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("]]>")),this._beginToken(13),this._requireStr("]]>"),this._endToken([])}_consumeDocType(o){this._beginToken(18,o);let e=this._cursor.clone();this._attemptUntilChar(Ps);let t=this._cursor.getChars(e);this._cursor.advance(),this._endToken([t])}_consumePrefixAndName(o){let e=this._cursor.clone(),t="";for(;this._cursor.peek()!==Sc&&!VG(this._cursor.peek());)this._cursor.advance();let i;this._cursor.peek()===Sc?(t=this._cursor.getChars(e),this._cursor.advance(),i=this._cursor.clone()):i=e,this._requireCharCodeUntilFn(o,t===""?0:1);let r=this._cursor.getChars(i);return[t,r]}_consumeTagOpen(o){let e,t,i,r;try{if(this._selectorlessEnabled&&UC(this._cursor.peek()))r=this._consumeComponentOpenStart(o),[i,t,e]=r.parts,t&&(i+=`:${t}`),e&&(i+=`:${e}`),this._attemptCharCodeUntilFn(Bo);else{if(!vm(this._cursor.peek()))throw this._createError(ph(this._cursor.peek()),this._cursor.getSpan(o));r=this._consumeTagOpenStart(o),t=r.parts[0],e=i=r.parts[1],this._attemptCharCodeUntilFn(Bo)}for(;!cN(this._cursor.peek());)if(this._selectorlessEnabled&&this._cursor.peek()===ch){let c=this._cursor.clone(),p=c.clone();p.advance(),UC(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,o),this._endToken(["<"]));return}throw c}let a=this._getTagDefinition(e).getContentType(t);a===yc.RAW_TEXT?this._consumeRawTextWithTagClose(r,i,!1):a===yc.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(r,i,!0)}_consumeRawTextWithTagClose(o,e,t){this._consumeRawText(t,()=>!this._attemptCharCode(wh)||!this._attemptCharCode(tl)||(this._attemptCharCodeUntilFn(Bo),!this._attemptStrCaseInsensitive(e))?!1:(this._attemptCharCodeUntilFn(Bo),this._attemptCharCode(Ps))),this._beginToken(o.type===33?36:3),this._requireCharCodeUntilFn(i=>i===Ps,3),this._cursor.advance(),this._endToken(o.parts)}_consumeTagOpenStart(o){this._beginToken(0,o);let e=this._consumePrefixAndName(Ep);return this._endToken(e)}_consumeComponentOpenStart(o){this._beginToken(33,o);let e=this._consumeComponentName();return this._endToken(e)}_consumeComponentName(){let o=this._cursor.clone();for(;lN(this._cursor.peek());)this._cursor.advance();let e=this._cursor.getChars(o),t="",i="";return this._cursor.peek()===Sc&&(this._cursor.advance(),[t,i]=this._consumePrefixAndName(Ep)),[e,t,i]}_consumeAttribute(){this._consumeAttributeName(),this._attemptCharCodeUntilFn(Bo),this._attemptCharCode(Xr)&&(this._attemptCharCodeUntilFn(Bo),this._consumeAttributeValue()),this._attemptCharCodeUntilFn(Bo)}_consumeAttributeName(){let o=this._cursor.peek();if(o===W_||o===U_)throw this._createError(ph(o),this._cursor.getSpan());this._beginToken(14);let e;if(this._openDirectiveCount>0){let i=0;e=r=>{if(this._openDirectiveCount>0){if(r===ja)i++;else if(r===Sr){if(i===0)return!0;i--}}return Ep(r)}}else if(o===kc){let i=0;e=r=>(r===kc?i++:r===bd&&i--,i<=0?Ep(r):R1(r))}else e=Ep;let t=this._consumePrefixAndName(e);this._endToken(t)}_consumeAttributeValue(){if(this._cursor.peek()===W_||this._cursor.peek()===U_){let o=this._cursor.peek();this._consumeQuote(o);let e=()=>this._cursor.peek()===o;this._consumeWithInterpolation(16,17,e,e),this._consumeQuote(o)}else{let o=()=>Ep(this._cursor.peek());this._consumeWithInterpolation(16,17,o,o)}}_consumeQuote(o){this._beginToken(15),this._requireCharCode(o),this._endToken([String.fromCodePoint(o)])}_consumeTagOpenEnd(){let o=this._attemptCharCode(tl)?2:1;this._beginToken(o),this._requireCharCode(Ps),this._endToken([])}_consumeComponentOpenEnd(){let o=this._attemptCharCode(tl)?35:34;this._beginToken(o),this._requireCharCode(Ps),this._endToken([])}_consumeTagClose(o){if(this._selectorlessEnabled){let t=o.clone();for(;t.peek()!==Ps&&!UC(t.peek());)t.advance();if(UC(t.peek())){this._beginToken(36,o);let i=this._consumeComponentName();this._attemptCharCodeUntilFn(Bo),this._requireCharCode(Ps),this._endToken(i);return}}this._beginToken(3,o),this._attemptCharCodeUntilFn(Bo);let e=this._consumePrefixAndName(Ep);this._attemptCharCodeUntilFn(Bo),this._requireCharCode(Ps),this._endToken(e)}_consumeExpansionFormStart(){this._beginToken(19),this._requireCharCode(ol),this._endToken([]),this._expansionCaseStack.push(19),this._beginToken(7);let o=this._readUntil(ya),e=this._processCarriageReturns(o);if(this._i18nNormalizeLineEndingsInICUs)this._endToken([e]);else{let i=this._endToken([o]);e!==o&&this.nonNormalizedIcuExpressions.push(i)}this._requireCharCode(ya),this._attemptCharCodeUntilFn(Bo),this._beginToken(7);let t=this._readUntil(ya);this._endToken([t]),this._requireCharCode(ya),this._attemptCharCodeUntilFn(Bo)}_consumeExpansionCaseStart(){this._beginToken(20);let o=this._readUntil(ol).trim();this._endToken([o]),this._attemptCharCodeUntilFn(Bo),this._beginToken(21),this._requireCharCode(ol),this._endToken([]),this._attemptCharCodeUntilFn(Bo),this._expansionCaseStack.push(21)}_consumeExpansionCaseEnd(){this._beginToken(22),this._requireCharCode(Ba),this._endToken([]),this._attemptCharCodeUntilFn(Bo),this._expansionCaseStack.pop()}_consumeExpansionFormEnd(){this._beginToken(23),this._requireCharCode(Ba),this._endToken([]),this._expansionCaseStack.pop()}_consumeWithInterpolation(o,e,t,i){this._beginToken(o);let r=[];for(;!t();){let a=this._cursor.clone();this._attemptStr(qg.start)?(this._endToken([this._processCarriageReturns(r.join(""))],a),r.length=0,this._consumeInterpolation(e,a,i),this._beginToken(o)):this._cursor.peek()===N1?(this._endToken([this._processCarriageReturns(r.join(""))]),r.length=0,this._consumeEntity(o),this._beginToken(o)):r.push(this._readChar())}this._inInterpolation=!1,this._endToken([this._processCarriageReturns(r.join(""))])}_consumeInterpolation(o,e,t){let i=[];this._beginToken(o,e),i.push(qg.start);let r=this._cursor.clone(),a=null,c=!1;for(;this._cursor.peek()!==Yr&&(t===null||!t());){let p=this._cursor.clone();if(this._isTagStart()){this._cursor=p,i.push(this._getProcessedChars(r,p)),this._endToken(i);return}if(a===null)if(this._attemptStr(qg.end)){i.push(this._getProcessedChars(r,p)),i.push(qg.end),this._endToken(i);return}else this._attemptStr("//")&&(c=!0);let u=this._cursor.peek();this._cursor.advance(),u===jp?this._cursor.advance():u===a?a=null:!c&&a===null&&l_(u)&&(a=u)}i.push(this._getProcessedChars(r,this._cursor)),this._endToken(i)}_consumeDirective(o,e){for(this._requireCharCode(ch),this._cursor.advance();lN(this._cursor.peek());)this._cursor.advance();this._beginToken(38,o);let t=this._cursor.getChars(e);if(this._endToken([t]),this._attemptCharCodeUntilFn(Bo),this._cursor.peek()===ja){for(this._openDirectiveCount++,this._beginToken(39),this._cursor.advance(),this._endToken([]),this._attemptCharCodeUntilFn(Bo);!cN(this._cursor.peek())&&this._cursor.peek()!==Sr;)this._consumeAttribute();if(this._attemptCharCodeUntilFn(Bo),this._openDirectiveCount--,this._cursor.peek()!==Sr){if(this._cursor.peek()===Ps||this._cursor.peek()===tl)return;throw this._createError(ph(this._cursor.peek()),this._cursor.getSpan(o))}this._beginToken(40),this._cursor.advance(),this._endToken([]),this._attemptCharCodeUntilFn(Bo)}}_getProcessedChars(o,e){return this._processCarriageReturns(e.getChars(o))}_isTextEnd(){return!!(this._isTagStart()||this._cursor.peek()===Yr||this._tokenizeIcu&&!this._inInterpolation&&(this.isExpansionFormStart()||this._cursor.peek()===Ba&&this._isInExpansionCase())||this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansion()&&(this._isBlockStart()||this._isLetStart()||this._cursor.peek()===Ba))}_isTagStart(){if(this._cursor.peek()===wh){let o=this._cursor.clone();o.advance();let e=o.peek();if(tu<=e&&e<=f0||Sm<=e&&e<=Gh||e===tl||e===TT)return!0}return!1}_readUntil(o){let e=this._cursor.clone();return this._attemptUntilChar(o),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()!==ol)return!1;let o=this._cursor.clone(),e=this._attemptStr(qg.start);return this._cursor=o,!e}};function Bo(n){return!G_(n)||n===Yr}function Ep(n){return G_(n)||n===Ps||n===wh||n===tl||n===W_||n===U_||n===Xr||n===Yr}function VG(n){return(n<tu||f0<n)&&(n<Sm||Gh<n)&&(n<jE||n>TF)}function BG(n){return n===rs||n===Yr||!iU(n)}function zG(n){return n===rs||n===Yr||!(vm(n)||nl(n))}function jG(n){return n!==Ba}function $G(n,o){return aN(n)===aN(o)}function aN(n){return n>=tu&&n<=f0?n-tu+Sm:n}function HG(n){return vm(n)||nl(n)||n===wm}function sN(n){return n!==rs&&Bo(n)}function UC(n){return n===wm||n>=Sm&&n<=Gh}function lN(n){return vm(n)||nl(n)||n===wm}function cN(n){return n===tl||n===Ps||n===wh||n===Yr}function UG(n){let o=[],e;for(let t=0;t<n.length;t++){let i=n[t];e&&e.type===5&&i.type===5||e&&e.type===16&&i.type===16?(e.parts[0]+=i.parts[0],e.sourceSpan.end=i.sourceSpan.end):(e=i,o.push(e))}return o}var J1=class n{state;file;input;end;constructor(o,e){if(o instanceof n){this.file=o.file,this.input=o.input,this.end=o.end;let t=o.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=o,this.input=o.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(o){return this.state.offset-o.state.offset}advance(){this.advanceState(this.state)}init(){this.updatePeek(this.state)}getSpan(o,e){o=o||this;let t=o;if(e)for(;this.diff(o)>0&&e.indexOf(o.peek())!==-1;)t===o&&(o=o.clone()),o.advance();let i=this.locationFromCursor(o),r=this.locationFromCursor(this),a=t!==o?this.locationFromCursor(t):i;return new gn(i,r,a)}getChars(o){return this.input.substring(o.state.offset,this.state.offset)}charAt(o){return this.input.charCodeAt(o)}advanceState(o){if(o.offset>=this.end)throw this.state=o,new a0('Unexpected character "EOF"',this);let e=this.charAt(o.offset);e===zp?(o.line++,o.column=0):R1(e)||o.column++,o.offset++,this.updatePeek(o)}updatePeek(o){o.peek=o.offset>=this.end?Yr:this.charAt(o.offset)}locationFromCursor(o){return new q_(o.file,o.state.offset,o.state.line,o.state.column)}},KT=class n extends J1{internalState;constructor(o,e){o instanceof n?(super(o),this.internalState=Z({},o.internalState)):(super(o,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(o){let e=o.clone(),t="";for(;e.internalState.offset<this.internalState.offset;)t+=String.fromCodePoint(e.peek()),e.advance();return t}processEscapeSequence(){let o=()=>this.internalState.peek;if(o()===jp)if(this.internalState=Z({},this.state),this.advanceState(this.internalState),o()===EF)this.state.peek=zp;else if(o()===DF)this.state.peek=zE;else if(o()===AF)this.state.peek=yF;else if(o()===PF)this.state.peek=BE;else if(o()===tU)this.state.peek=QH;else if(o()===$E)this.state.peek=SF;else if(o()===IF)if(this.advanceState(this.internalState),o()===ol){this.advanceState(this.internalState);let e=this.clone(),t=0;for(;o()!==Ba;)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(o()===OF){this.advanceState(this.internalState);let e=this.clone();this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(e,2)}else if(L5(o())){let e="",t=0,i=this.clone();for(;L5(o())&&t<3;)i=this.clone(),e+=String.fromCodePoint(o()),this.advanceState(this.internalState),t++;this.state.peek=parseInt(e,8),this.internalState=i.internalState}else R1(this.internalState.peek)?(this.advanceState(this.internalState),this.state=this.internalState):this.state.peek=this.internalState.peek}decodeHexDigits(o,e){let t=this.input.slice(o.internalState.offset,o.internalState.offset+e),i=parseInt(t,16);if(isNaN(i))throw o.state=o.internalState,new a0("Invalid hexadecimal escape sequence",o);return i}},a0=class extends Error{msg;cursor;constructor(o,e){super(o),this.msg=o,this.cursor=e,Object.setPrototypeOf(this,new.target.prototype)}},hr=class n extends sn{elementName;static create(o,e,t){return new n(o,e,t)}constructor(o,e,t){super(e,t),this.elementName=o}},ex=class{rootNodes;errors;constructor(o,e){this.rootNodes=o,this.errors=e}},WG=class{getTagDefinition;constructor(o){this.getTagDefinition=o}parse(o,e,t){let i=NG(o,e,this.getTagDefinition,t),r=new YT(i.tokens,this.getTagDefinition);return r.build(),new ex(r.rootNodes,[...i.errors,...r.errors])}},YT=class n{tokens;tagDefinitionResolver;_index=-1;_peek;_containerStack=[];rootNodes=[];errors=[];constructor(o,e){this.tokens=o,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 o of this._containerStack)o instanceof il&&this.errors.push(hr.create(o.name,o.sourceSpan,`Unclosed block "${o.name}"`))}_advance(){let o=this._peek;return this._index<this.tokens.length-1&&this._index++,this._peek=this.tokens[this._index],o}_advanceIf(o){return this._peek.type===o?this._advance():null}_consumeCdata(o){this._consumeText(this._advance()),this._advanceIf(13)}_consumeComment(o){let e=this._advanceIf(7),t=this._advanceIf(11),i=e!=null?e.parts[0].trim():null,r=t==null?o.sourceSpan:new gn(o.sourceSpan.start,t.sourceSpan.end,o.sourceSpan.fullStart);this._addToParent(new o0(i,r))}_consumeExpansion(o){let e=this._advance(),t=this._advance(),i=[];for(;this._peek.type===20;){let a=this._parseExpansionCase();if(!a)return;i.push(a)}if(this._peek.type!==23){this.errors.push(hr.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '}'."));return}let r=new gn(o.sourceSpan.start,this._peek.sourceSpan.end,o.sourceSpan.fullStart);this._addToParent(new $p(e.parts[0],t.parts[0],i,r,e.sourceSpan)),this._advance()}_parseExpansionCase(){let o=this._advance();if(this._peek.type!==21)return this.errors.push(hr.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '{'.")),null;let e=this._advance(),t=this._collectExpansionExpTokens(e);if(!t)return null;let i=this._advance();t.push({type:41,parts:[],sourceSpan:i.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(o.sourceSpan.start,i.sourceSpan.end,o.sourceSpan.fullStart),c=new gn(e.sourceSpan.start,i.sourceSpan.end,e.sourceSpan.fullStart);return new K1(o.parts[0],r.rootNodes,a,o.sourceSpan,c)}_collectExpansionExpTokens(o){let e=[],t=[21];for(;;){if((this._peek.type===19||this._peek.type===21)&&t.push(this._peek.type),this._peek.type===22)if(dN(t,21)){if(t.pop(),t.length===0)return e}else return this.errors.push(hr.create(null,o.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===23)if(dN(t,19))t.pop();else return this.errors.push(hr.create(null,o.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===41)return this.errors.push(hr.create(null,o.sourceSpan,"Invalid ICU message. Missing '}'.")),null;e.push(this._advance())}}_consumeText(o){let e=[o],t=o.sourceSpan,i=o.parts[0];if(i.length>0&&i[0]===`
|
||
`){let r=this._getContainer();r!=null&&r.children.length===0&&this._getTagDefinition(r)?.ignoreFirstLf&&(i=i.substring(1),e[0]={type:o.type,sourceSpan:o.sourceSpan,parts:[i]})}for(;this._peek.type===8||this._peek.type===5||this._peek.type===9;)o=this._advance(),e.push(o),o.type===8?i+=o.parts.join("").replace(/&([^;]+);/g,mN):o.type===9?i+=o.parts[0]:i+=o.parts.join("");if(i.length>0){let r=o.sourceSpan;this._addToParent(new au(i,new gn(t.start,r.end,t.fullStart,t.details),e))}}_closeVoidElement(){let o=this._getContainer();o!==null&&this._getTagDefinition(o)?.isVoid&&this._containerStack.pop()}_consumeElementStartTag(o){let e=[],t=[];this._consumeAttributesAndDirectives(e,t);let i=this._getElementFullName(o,this._getClosestElementLikeParent()),r=this._getTagDefinition(i),a=!1;this._peek.type===2?(this._advance(),a=!0,r?.canSelfClose||gT(i)!==null||r?.isVoid||this.errors.push(hr.create(i,o.sourceSpan,`Only void, custom and foreign elements can be self closed "${o.parts[1]}"`))):this._peek.type===1&&(this._advance(),a=!1);let c=this._peek.sourceSpan.fullStart,p=new gn(o.sourceSpan.start,c,o.sourceSpan.fullStart),u=new gn(o.sourceSpan.start,c,o.sourceSpan.fullStart),h=new el(i,e,t,[],a,p,u,void 0,r?.isVoid??!1),g=this._getContainer(),y=g!==null&&!!this._getTagDefinition(g)?.isClosedByChild(h.name);this._pushContainer(h,y),a?this._popContainer(i,el,p):o.type===4&&(this._popContainer(i,el,null),this.errors.push(hr.create(i,p,`Opening tag "${i}" not terminated.`)))}_consumeComponentStartTag(o){let e=o.parts[0],t=[],i=[];this._consumeAttributesAndDirectives(t,i);let r=this._getClosestElementLikeParent(),a=this._getComponentTagName(o,r),c=this._getComponentFullName(o,r),p=this._peek.type===35;this._advance();let u=this._peek.sourceSpan.fullStart,h=new gn(o.sourceSpan.start,u,o.sourceSpan.fullStart),g=new gn(o.sourceSpan.start,u,o.sourceSpan.fullStart),y=new Va(e,a,c,t,i,[],p,h,g,void 0),b=this._getContainer(),x=b!==null&&y.tagName!==null&&!!this._getTagDefinition(b)?.isClosedByChild(y.tagName);this._pushContainer(y,x),p?this._popContainer(c,Va,h):o.type===37&&(this._popContainer(c,Va,null),this.errors.push(hr.create(c,h,`Opening tag "${c}" not terminated.`)))}_consumeAttributesAndDirectives(o,e){for(;this._peek.type===14||this._peek.type===38;)this._peek.type===38?e.push(this._consumeDirective(this._peek)):o.push(this._consumeAttr(this._advance()))}_consumeComponentEndTag(o){let e=this._getComponentFullName(o,this._getClosestElementLikeParent());if(!this._popContainer(e,Va,o.sourceSpan)){let t=this._containerStack[this._containerStack.length-1],i;t instanceof Va&&t.componentName===o.parts[0]?i=`, did you mean "${t.fullName}"?`:i=". It may happen when the tag has already been closed by another tag.";let r=`Unexpected closing tag "${e}"${i}`;this.errors.push(hr.create(e,o.sourceSpan,r))}}_getTagDefinition(o){return typeof o=="string"?this.tagDefinitionResolver(o):o instanceof el?this.tagDefinitionResolver(o.name):o instanceof Va&&o.tagName!==null?this.tagDefinitionResolver(o.tagName):null}_pushContainer(o,e){e&&this._containerStack.pop(),this._addToParent(o),this._containerStack.push(o)}_consumeElementEndTag(o){let e=this._getElementFullName(o,this._getClosestElementLikeParent());if(this._getTagDefinition(e)?.isVoid)this.errors.push(hr.create(e,o.sourceSpan,`Void elements do not have end tags "${o.parts[1]}"`));else if(!this._popContainer(e,el,o.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(hr.create(e,o.sourceSpan,t))}}_popContainer(o,e,t){let i=!1;for(let r=this._containerStack.length-1;r>=0;r--){let a=this._containerStack[r];if(((a instanceof Va?a.fullName:a.name)===o||o===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),!i;(a instanceof il||!this._getTagDefinition(a)?.closedByParent)&&(i=!0)}return!1}_consumeAttr(o){let e=n1(o.parts[0],o.parts[1]),t=o.sourceSpan.end;this._peek.type===15&&this._advance();let i="",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?i+=h.parts.join("").replace(/&([^;]+);/g,mN):h.type===9?i+=h.parts[0]:i+=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 WT(e,i,new gn(o.sourceSpan.start,t,o.sourceSpan.fullStart),o.sourceSpan,u,r.length>0?r:void 0,void 0)}_consumeDirective(o){let e=[],t=o.sourceSpan.end,i=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?(i=this._peek.sourceSpan,this._advance()):this.errors.push(hr.create(null,o.sourceSpan,"Unterminated directive definition"))}let r=new gn(o.sourceSpan.start,t,o.sourceSpan.fullStart),a=new gn(r.start,i===null?o.sourceSpan.end:i.end,r.fullStart);return new GT(o.parts[0],e,a,r,i)}_consumeBlockOpen(o){let e=[];for(;this._peek.type===27;){let c=this._advance();e.push(new Y1(c.parts[0],c.sourceSpan))}this._peek.type===25&&this._advance();let t=this._peek.sourceSpan.fullStart,i=new gn(o.sourceSpan.start,t,o.sourceSpan.fullStart),r=new gn(o.sourceSpan.start,t,o.sourceSpan.fullStart),a=new il(o.parts[0],e,[],i,o.sourceSpan,r);this._pushContainer(a,!1)}_consumeBlockClose(o){let e=this._containerStack.length,t=this._containerStack[e-1];if(!this._popContainer(null,il,o.sourceSpan)){if(this._containerStack.length<e){let i=t instanceof Va?t.fullName:t.name;this.errors.push(hr.create(null,o.sourceSpan,`Unexpected closing block. The block may have been closed earlier. Did you forget to close the <${i}> element? If you meant to write the \`}\` character, you should use the "}" HTML entity instead.`));return}this.errors.push(hr.create(null,o.sourceSpan,'Unexpected closing block. The block may have been closed earlier. If you meant to write the `}` character, you should use the "}" HTML entity instead.'))}}_consumeIncompleteBlock(o){let e=[];for(;this._peek.type===27;){let c=this._advance();e.push(new Y1(c.parts[0],c.sourceSpan))}let t=this._peek.sourceSpan.fullStart,i=new gn(o.sourceSpan.start,t,o.sourceSpan.fullStart),r=new gn(o.sourceSpan.start,t,o.sourceSpan.fullStart),a=new il(o.parts[0],e,[],i,o.sourceSpan,r);this._pushContainer(a,!1),this._popContainer(null,il,null),this.errors.push(hr.create(o.parts[0],i,`Incomplete block "${o.parts[0]}". If you meant to write the @ character, you should use the "@" HTML entity instead.`))}_consumeLet(o){let e=o.parts[0],t,i;if(this._peek.type!==30){this.errors.push(hr.create(o.parts[0],o.sourceSpan,`Invalid @let declaration "${e}". Declaration must have a value.`));return}else t=this._advance();if(this._peek.type!==31){this.errors.push(hr.create(o.parts[0],o.sourceSpan,`Unterminated @let declaration "${e}". Declaration must be terminated with a semicolon.`));return}else i=this._advance();let r=i.sourceSpan.end,a=new gn(o.sourceSpan.start,r,o.sourceSpan.fullStart),c=o.sourceSpan.toString().lastIndexOf(e),p=o.sourceSpan.start.moveBy(c),u=new gn(p,o.sourceSpan.end),h=new Z1(e,t.parts[0],a,u,t.sourceSpan);this._addToParent(h)}_consumeIncompleteLet(o){let e=o.parts[0]??"",t=e?` "${e}"`:"";if(e.length>0){let i=o.sourceSpan.toString().lastIndexOf(e),r=o.sourceSpan.start.moveBy(i),a=new gn(r,o.sourceSpan.end),c=new gn(o.sourceSpan.start,o.sourceSpan.start.moveBy(0)),p=new Z1(e,"",o.sourceSpan,a,c);this._addToParent(p)}this.errors.push(hr.create(o.parts[0],o.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 o=this._containerStack.length-1;o>-1;o--){let e=this._containerStack[o];if(e instanceof el||e instanceof Va)return e}return null}_addToParent(o){let e=this._getContainer();e===null?this.rootNodes.push(o):e.children.push(o)}_getElementFullName(o,e){let t=this._getPrefix(o,e);return n1(t,o.parts[1])}_getComponentFullName(o,e){let t=o.parts[0],i=this._getComponentTagName(o,e);return i===null?t:i.startsWith(":")?t+i:`${t}:${i}`}_getComponentTagName(o,e){let t=this._getPrefix(o,e),i=o.parts[2];return!t&&!i?null:!t&&i?i:n1(t,i||"ng-component")}_getPrefix(o,e){let t,i;if(o.type===33||o.type===37||o.type===36?(t=o.parts[1],i=o.parts[2]):(t=o.parts[0],i=o.parts[1]),t=t||this._getTagDefinition(i)?.implicitNamespacePrefix||"",!t&&e){let r=e instanceof el?e.name:e.tagName;if(r!==null){let a=Sa(r)[1],c=this._getTagDefinition(a);c!==null&&!c.preventNamespaceInheritance&&(t=gT(r))}}return t}};function dN(n,o){return n.length>0&&n[n.length-1]===o}function mN(n,o){return r0[o]!==void 0?r0[o]||n:/^#x[a-f0-9]+$/i.test(o)?String.fromCodePoint(parseInt(o.slice(2),16)):/^#\d+$/.test(o)?String.fromCodePoint(parseInt(o.slice(1),10)):n}var n6="ngPreserveWhitespaces",pN=new Set(["pre","template","textarea","script","style"]),i6=` \f
|
||
\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`,GG=new RegExp(`[^${i6}]`),qG=new RegExp(`[${i6}]{2,}`,"g");function uN(n){return n.some(o=>o.name===n6)}function o6(n){return n.replace(new RegExp(t6,"g")," ")}var tx=class{preserveSignificantWhitespace;originalNodeMap;requireContext;icuExpansionDepth=0;constructor(o,e,t=!0){this.preserveSignificantWhitespace=o,this.originalNodeMap=e,this.requireContext=t}visitElement(o,e){if(pN.has(o.name)||uN(o.attrs)){let i=new el(o.name,Cc(this,o.attrs),Cc(this,o.directives),o.children,o.isSelfClosing,o.sourceSpan,o.startSourceSpan,o.endSourceSpan,o.isVoid,o.i18n);return this.originalNodeMap?.set(i,o),i}let t=new el(o.name,o.attrs,o.directives,Cc(this,o.children),o.isSelfClosing,o.sourceSpan,o.startSourceSpan,o.endSourceSpan,o.isVoid,o.i18n);return this.originalNodeMap?.set(t,o),t}visitAttribute(o,e){return o.name!==n6?o:null}visitText(o,e){let t=o.value.match(GG),i=e&&(e.prev instanceof $p||e.next instanceof $p);if(this.icuExpansionDepth>0&&this.preserveSignificantWhitespace)return o;if(t||i){let a=o.tokens.map(h=>h.type===5?YG(h):h);if(!this.preserveSignificantWhitespace&&a.length>0){let h=a[0];a.splice(0,1,QG(h,e));let g=a[a.length-1];a.splice(a.length-1,1,XG(g,e))}let c=a6(o.value),p=this.preserveSignificantWhitespace?c:KG(c,e),u=new au(p,o.sourceSpan,a,o.i18n);return this.originalNodeMap?.set(u,o),u}return null}visitComment(o,e){return o}visitExpansion(o,e){this.icuExpansionDepth++;let t;try{t=new $p(o.switchValue,o.type,Cc(this,o.cases),o.sourceSpan,o.switchValueSourceSpan,o.i18n)}finally{this.icuExpansionDepth--}return this.originalNodeMap?.set(t,o),t}visitExpansionCase(o,e){let t=new K1(o.value,Cc(this,o.expression),o.sourceSpan,o.valueSourceSpan,o.expSourceSpan);return this.originalNodeMap?.set(t,o),t}visitBlock(o,e){let t=new il(o.name,o.parameters,Cc(this,o.children),o.sourceSpan,o.nameSpan,o.startSourceSpan,o.endSourceSpan);return this.originalNodeMap?.set(t,o),t}visitBlockParameter(o,e){return o}visitLetDeclaration(o,e){return o}visitComponent(o,e){if(o.tagName&&pN.has(o.tagName)||uN(o.attrs)){let i=new Va(o.componentName,o.tagName,o.fullName,Cc(this,o.attrs),Cc(this,o.directives),o.children,o.isSelfClosing,o.sourceSpan,o.startSourceSpan,o.endSourceSpan,o.i18n);return this.originalNodeMap?.set(i,o),i}let t=new Va(o.componentName,o.tagName,o.fullName,o.attrs,o.directives,Cc(this,o.children),o.isSelfClosing,o.sourceSpan,o.startSourceSpan,o.endSourceSpan,o.i18n);return this.originalNodeMap?.set(t,o),t}visitDirective(o,e){return o}visit(o,e){if(this.requireContext&&!e)throw new Error("WhitespaceVisitor requires context. Visit via `visitAllWithSiblings` to get this context.");return!1}};function QG(n,o){return n.type!==5||!!o?.prev?n:r6(n,t=>t.trimStart())}function XG(n,o){return n.type!==5||!!o?.next?n:r6(n,t=>t.trimEnd())}function KG(n,o){let e=!o?.prev,t=!o?.next,i=e?n.trimStart():n;return t?i.trimEnd():i}function YG({type:n,parts:o,sourceSpan:e}){return{type:n,parts:[a6(o[0])],sourceSpan:e}}function r6({type:n,parts:o,sourceSpan:e},t){return{type:n,parts:[t(o[0])],sourceSpan:e}}function a6(n){return o6(n).replace(qG," ")}function Cc(n,o){let e=[];return o.forEach((t,i)=>{let r={prev:o[i-1],next:o[i+1]},a=t.visit(n,r);a&&e.push(a)}),e}var hn=(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})(hn||{}),Hp=(function(n){return n[n.Plain=0]="Plain",n[n.TemplateLiteralPart=1]="TemplateLiteralPart",n[n.TemplateLiteralEnd=2]="TemplateLiteralEnd",n})(Hp||{}),ZG=["var","let","as","null","undefined","true","false","if","else","this","typeof","void","in","instanceof"],s0=class{tokenize(o){return new ZT(o).scan()}},Bs=class{index;end;type;numValue;strValue;constructor(o,e,t,i,r){this.index=o,this.end=e,this.type=t,this.numValue=i,this.strValue=r}isCharacter(o){return this.type===hn.Character&&this.numValue===o}isNumber(){return this.type===hn.Number}isString(){return this.type===hn.String}isOperator(o){return this.type===hn.Operator&&this.strValue===o}isIdentifier(){return this.type===hn.Identifier}isPrivateIdentifier(){return this.type===hn.PrivateIdentifier}isKeyword(){return this.type===hn.Keyword}isKeywordLet(){return this.type===hn.Keyword&&this.strValue==="let"}isKeywordAs(){return this.type===hn.Keyword&&this.strValue==="as"}isKeywordNull(){return this.type===hn.Keyword&&this.strValue==="null"}isKeywordUndefined(){return this.type===hn.Keyword&&this.strValue==="undefined"}isKeywordTrue(){return this.type===hn.Keyword&&this.strValue==="true"}isKeywordFalse(){return this.type===hn.Keyword&&this.strValue==="false"}isKeywordThis(){return this.type===hn.Keyword&&this.strValue==="this"}isKeywordTypeof(){return this.type===hn.Keyword&&this.strValue==="typeof"}isKeywordVoid(){return this.type===hn.Keyword&&this.strValue==="void"}isKeywordIn(){return this.type===hn.Keyword&&this.strValue==="in"}isKeywordInstanceOf(){return this.type===hn.Keyword&&this.strValue==="instanceof"}isError(){return this.type===hn.Error}isRegExpBody(){return this.type===hn.RegExpBody}isRegExpFlags(){return this.type===hn.RegExpFlags}toNumber(){return this.type===hn.Number?this.numValue:-1}isTemplateLiteralPart(){return this.isString()&&this.kind===Hp.TemplateLiteralPart}isTemplateLiteralEnd(){return this.isString()&&this.kind===Hp.TemplateLiteralEnd}isTemplateLiteralInterpolationStart(){return this.isOperator("${")}toString(){switch(this.type){case hn.Character:case hn.Identifier:case hn.Keyword:case hn.Operator:case hn.PrivateIdentifier:case hn.String:case hn.Error:case hn.RegExpBody:case hn.RegExpFlags:return this.strValue;case hn.Number:return this.numValue.toString();default:return null}}},c_=class extends Bs{kind;constructor(o,e,t,i){super(o,e,hn.String,0,t),this.kind=i}};function Qg(n,o,e){return new Bs(n,o,hn.Character,e,String.fromCharCode(e))}function JG(n,o,e){return new Bs(n,o,hn.Identifier,0,e)}function eq(n,o,e){return new Bs(n,o,hn.PrivateIdentifier,0,e)}function tq(n,o,e){return new Bs(n,o,hn.Keyword,0,e)}function nm(n,o,e){return new Bs(n,o,hn.Operator,0,e)}function nq(n,o,e){return new Bs(n,o,hn.Number,e,"")}function iq(n,o,e){return new Bs(n,o,hn.Error,0,e)}function oq(n,o,e){return new Bs(n,o,hn.RegExpBody,0,e)}function rq(n,o,e){return new Bs(n,o,hn.RegExpFlags,0,e)}var Xg=new Bs(-1,-1,hn.Character,0,""),ZT=class{input;tokens=[];length;peek=0;index=-1;braceStack=[];constructor(o){this.input=o,this.length=o.length,this.advance()}scan(){let o=this.scanToken();for(;o!==null;)this.tokens.push(o),o=this.scanToken();return this.tokens}advance(){this.peek=++this.index>=this.length?Yr:this.input.charCodeAt(this.index)}scanToken(){let o=this.input,e=this.length,t=this.peek,i=this.index;for(;t<=wF;)if(++i>=e){t=Yr;break}else t=o.charCodeAt(i);if(this.peek=t,this.index=i,i>=e)return null;if(hN(t))return this.scanIdentifier();if(nl(t))return this.scanNumber(i);let r=i;switch(t){case Dp:return this.advance(),nl(this.peek)?this.scanNumber(r):this.peek!==Dp?Qg(r,this.index,Dp):(this.advance(),this.peek===Dp?(this.advance(),nm(r,this.index,"...")):this.error(`Unexpected character [${String.fromCharCode(t)}]`,0));case ja:case Sr:case kc:case bd:case ya:case Sc:case rs:return this.scanCharacter(r,t);case ol:return this.scanOpenBrace(r,t);case Ba:return this.scanCloseBrace(r,t);case W_:case U_:return this.scanString();case ET:return this.advance(),this.scanTemplateLiteralPart(r);case MF:return this.scanPrivateIdentifier();case kF:return this.scanComplexOperator(r,"+",Xr,"=");case F1:return this.scanComplexOperator(r,"-",Xr,"=");case tl:return this.isStartOfRegex()?this.scanRegex(i):this.scanComplexOperator(r,"/",Xr,"=");case XH:return this.scanComplexOperator(r,"%",Xr,"=");case eU:return this.scanOperator(r,"^");case N5:return this.scanStar(r);case F5:return this.scanQuestion(r);case wh:case Ps:return this.scanComplexOperator(r,String.fromCharCode(t),Xr,"=");case TT:return this.scanComplexOperator(r,"!",Xr,"=",Xr,"=");case Xr:return this.scanEquals(r);case N1:return this.scanComplexOperator(r,"&",N1,"&",Xr,"=");case R5:return this.scanComplexOperator(r,"|",R5,"|",Xr,"=");case NF:for(;G_(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(t)}]`,0)}scanCharacter(o,e){return this.advance(),Qg(o,this.index,e)}scanOperator(o,e){return this.advance(),nm(o,this.index,e)}scanOpenBrace(o,e){return this.braceStack.push("expression"),this.advance(),Qg(o,this.index,e)}scanCloseBrace(o,e){return this.advance(),this.braceStack.pop()==="interpolation"?(this.tokens.push(Qg(o,this.index,Ba)),this.scanTemplateLiteralPart(this.index)):Qg(o,this.index,e)}scanComplexOperator(o,e,t,i,r,a){this.advance();let c=e;return this.peek==t&&(this.advance(),c+=i),r!=null&&this.peek==r&&(this.advance(),c+=a),nm(o,this.index,c)}scanEquals(o){this.advance();let e="=";if(this.peek===Xr)this.advance(),e+="=";else if(this.peek===Ps)return this.advance(),e+=">",nm(o,this.index,e);return this.peek===Xr&&(this.advance(),e+="="),nm(o,this.index,e)}scanIdentifier(){let o=this.index;for(this.advance();fN(this.peek);)this.advance();let e=this.input.substring(o,this.index);return ZG.indexOf(e)>-1?tq(o,this.index,e):JG(o,this.index,e)}scanPrivateIdentifier(){let o=this.index;if(this.advance(),!hN(this.peek))return this.error("Invalid character [#]",-1);for(;fN(this.peek);)this.advance();let e=this.input.substring(o,this.index);return eq(o,this.index,e)}scanNumber(o){let e=this.index===o,t=!1;for(this.advance();;){if(!nl(this.peek))if(this.peek===wm){if(!nl(this.input.charCodeAt(this.index-1))||!nl(this.input.charCodeAt(this.index+1)))return this.error("Invalid numeric separator",0);t=!0}else if(this.peek===Dp)e=!1;else if(aq(this.peek)){if(this.advance(),sq(this.peek)&&this.advance(),!nl(this.peek))return this.error("Invalid exponent",-1);e=!1}else break;this.advance()}let i=this.input.substring(o,this.index);t&&(i=i.replace(/_/g,""));let r=e?cq(i):parseFloat(i);return nq(o,this.index,r)}scanString(){let o=this.index,e=this.peek;this.advance();let t="",i=this.index,r=this.input;for(;this.peek!=e;)if(this.peek==jp){let c=this.scanStringBackslash(t,i);if(typeof c!="string")return c;t=c,i=this.index}else{if(this.peek==Yr)return this.error("Unterminated quote",0);this.advance()}let a=r.substring(i,this.index);return this.advance(),new c_(o,this.index,t+a,Hp.Plain)}scanQuestion(o){this.advance();let e="?";return this.peek===F5?(e+="?",this.advance(),this.peek===Xr&&(e+="=",this.advance())):this.peek===Dp&&(e+=".",this.advance()),nm(o,this.index,e)}scanTemplateLiteralPart(o){let e="",t=this.index;for(;this.peek!==ET;)if(this.peek===jp){let r=this.scanStringBackslash(e,t);if(typeof r!="string")return r;e=r,t=this.index}else if(this.peek===fx){let r=this.index;if(this.advance(),this.peek===ol)return this.braceStack.push("interpolation"),this.tokens.push(new c_(o,r,e+this.input.substring(t,r),Hp.TemplateLiteralPart)),this.advance(),nm(r,this.index,this.input.substring(r,this.index))}else{if(this.peek===Yr)return this.error("Unterminated template literal",0);this.advance()}let i=this.input.substring(t,this.index);return this.advance(),new c_(o,this.index,e+i,Hp.TemplateLiteralEnd)}error(o,e){let t=this.index+e;return iq(t,this.index,`Lexer Error: ${o} at column ${t} in expression [${this.input}]`)}scanStringBackslash(o,e){o+=this.input.substring(e,this.index);let t;if(this.advance(),this.peek===IF){let i=this.input.substring(this.index+1,this.index+5);if(/^[0-9a-f]+$/i.test(i))t=parseInt(i,16);else return this.error(`Invalid unicode escape [\\u${i}]`,0);for(let r=0;r<5;r++)this.advance()}else t=lq(this.peek),this.advance();return o+=String.fromCharCode(t),o}scanStar(o){this.advance();let e="*";return this.peek===N5?(e+="*",this.advance(),this.peek===Xr&&(e+="=",this.advance())):this.peek===Xr&&(e+="=",this.advance()),nm(o,this.index,e)}isStartOfRegex(){if(this.tokens.length===0)return!0;let o=this.tokens[this.tokens.length-1];if(o.isOperator("!")){let e=this.tokens.length>1?this.tokens[this.tokens.length-2]:null;return e===null||e.type!==hn.Identifier&&!e.isCharacter(Sr)&&!e.isCharacter(bd)}return o.type===hn.Operator||o.isCharacter(ja)||o.isCharacter(kc)||o.isCharacter(ya)||o.isCharacter(Sc)}scanRegex(o){this.advance();let e=this.index,t=!1,i=!1;for(;;){let p=this.peek;if(p===Yr)return this.error("Unterminated regular expression",0);if(t)t=!1;else if(p===jp)t=!0;else if(p===kc)i=!0;else if(p===bd)i=!1;else if(p===tl&&!i)break;this.advance()}let r=this.input.substring(e,this.index);this.advance();let a=oq(o,this.index,r),c=this.scanRegexFlags(this.index);return c!==null?(this.tokens.push(a),c):a}scanRegexFlags(o){if(!vm(this.peek))return null;for(;vm(this.peek);)this.advance();return rq(o,this.index,this.input.substring(o,this.index))}};function hN(n){return tu<=n&&n<=f0||Sm<=n&&n<=Gh||n==wm||n==fx}function fN(n){return vm(n)||nl(n)||n==wm||n==fx}function aq(n){return n==nU||n==YH}function sq(n){return n==F1||n==kF}function lq(n){switch(n){case EF:return zp;case $E:return SF;case DF:return zE;case PF:return BE;case AF:return yF;default:return n}}function cq(n){let o=parseInt(n);if(isNaN(o))throw new Error("Invalid integer literal when parsing "+n);return o}var JT=class{strings;expressions;offsets;constructor(o,e,t){this.strings=o,this.expressions=e,this.offsets=t}},eE=class{templateBindings;warnings;errors;constructor(o,e,t){this.templateBindings=o,this.warnings=e,this.errors=t}};function sm(n){return n.start.toString()||"(unknown)"}var nx=class{_lexer;_supportsDirectPipeReferences;constructor(o,e=!1){this._lexer=o,this._supportsDirectPipeReferences=e}parseAction(o,e,t){let i=[];this._checkNoInterpolation(i,o,e);let{stripped:r}=this._stripComments(o),a=this._lexer.tokenize(r),c=new Op(o,e,t,a,1,i,0,this._supportsDirectPipeReferences).parseChain();return new as(c,o,sm(e),t,i)}parseBinding(o,e,t){let i=[],r=this._parseBindingAst(o,e,t,i);return new as(r,o,sm(e),t,i)}checkSimpleExpression(o){let e=new tE;return o.visit(e),e.errors}parseSimpleBinding(o,e,t){let i=[],r=this._parseBindingAst(o,e,t,i),a=this.checkSimpleExpression(r);return a.length>0&&i.push(bh(`Host binding expression cannot contain ${a.join(" ")}`,o,"",e)),new as(r,o,sm(e),t,i)}_parseBindingAst(o,e,t,i){this._checkNoInterpolation(i,o,e);let{stripped:r}=this._stripComments(o),a=this._lexer.tokenize(r);return new Op(o,e,t,a,0,i,0,this._supportsDirectPipeReferences).parseChain()}parseTemplateBindings(o,e,t,i,r){let a=this._lexer.tokenize(e),c=[];return new Op(e,t,r,a,0,c,0,this._supportsDirectPipeReferences).parseTemplateBindings({source:o,span:new As(i,i+o.length)})}parseInterpolation(o,e,t,i){let r=[],{strings:a,expressions:c,offsets:p}=this.splitInterpolation(o,e,r,i);if(c.length===0)return null;let u=[];for(let h=0;h<c.length;++h){let g=i?.[h*2+1]?.sourceSpan,y=c[h].text,{stripped:b,hasComments:x}=this._stripComments(y),M=this._lexer.tokenize(b);if(x&&b.trim().length===0&&M.length===0){r.push(bh("Interpolation expression cannot only contain a comment",o,`at column ${c[h].start} in`,e));continue}let w=new Op(g?y:o,g||e,t,M,0,r,p[h],this._supportsDirectPipeReferences).parseChain();u.push(w)}return this.createInterpolationAst(a.map(h=>h.text),u,o,sm(e),t,r)}parseInterpolationExpression(o,e,t){let{stripped:i}=this._stripComments(o),r=this._lexer.tokenize(i),a=[],c=new Op(o,e,t,r,0,a,0,this._supportsDirectPipeReferences).parseChain(),p=["",""];return this.createInterpolationAst(p,[c],o,sm(e),t,a)}createInterpolationAst(o,e,t,i,r,a){let c=new Yp(0,t.length),p=new u0(c,c.toAbsolute(r),o,e);return new as(p,t,i,r,a)}splitInterpolation(o,e,t,i){let r=[],a=[],c=[],p=i?dq(i):null,u=0,h=!1,g=!1,y="{{",b="}}";for(;u<o.length;)if(h){let x=u,M=x+y.length,w=this._getInterpolationEndIndex(o,b,M);if(w===-1){h=!1,g=!0;break}let S=w+b.length,E=o.substring(M,w);E.trim().length===0&&t.push(bh("Blank expressions are not allowed in interpolated strings",o,`at column ${u} in`,e)),a.push({text:E,start:x,end:S});let D=(p?.get(x)??x)+y.length;c.push(D),u=S,h=!1}else{let x=u;u=o.indexOf(y,u),u===-1&&(u=o.length);let M=o.substring(x,u);r.push({text:M,start:x,end:u}),h=!0}if(!h)if(g){let x=r[r.length-1];x.text+=o.substring(u),x.end=o.length}else r.push({text:o.substring(u),start:u,end:o.length});return new JT(r,a,c)}wrapLiteralPrimitive(o,e,t){let i=new Yp(0,o==null?0:o.length);return new as(new os(i,i.toAbsolute(t),o),o,typeof e=="string"?e:sm(e),t,[])}_stripComments(o){let e=this._commentStart(o);return e!=null?{stripped:o.substring(0,e),hasComments:!0}:{stripped:o,hasComments:!1}}_commentStart(o){let e=null;for(let t=0;t<o.length-1;t++){let i=o.charCodeAt(t),r=o.charCodeAt(t+1);if(i===tl&&r==tl&&e==null)return t;e===i?e=null:e==null&&l_(i)&&(e=i)}return null}_checkNoInterpolation(o,e,t){let i=-1,r=-1;for(let a of this._forEachUnquotedChar(e,0))if(i===-1)e.startsWith("{{")&&(i=a);else if(r=this._getInterpolationEndIndex(e,"}}",a),r>-1)break;i>-1&&r>-1&&o.push(bh("Got interpolation ({{}}) where expression was expected",e,`at column ${i} in`,t))}_getInterpolationEndIndex(o,e,t){for(let i of this._forEachUnquotedChar(o,t)){if(o.startsWith(e,i))return i;if(o.startsWith("//",i))return o.indexOf(e,i)}return-1}*_forEachUnquotedChar(o,e){let t=null,i=0;for(let r=e;r<o.length;r++){let a=o[r];l_(o.charCodeAt(r))&&(t===null||t===a)&&i%2===0?t=t===null?a:null:t===null&&(yield r),i=a==="\\"?i+1:0}}},o_=(function(n){return n[n.None=0]="None",n[n.Writable=1]="Writable",n})(o_||{}),gN=new Set(["d","g","i","m","s","u","v","y"]),Op=class{input;parseSourceSpan;absoluteOffset;tokens;parseFlags;errors;offset;supportsDirectPipeReferences;rparensExpected=0;rbracketsExpected=0;rbracesExpected=0;context=o_.None;sourceSpanCache=new Map;index=0;constructor(o,e,t,i,r,a,c,p){this.input=o,this.parseSourceSpan=e,this.absoluteOffset=t,this.tokens=i,this.parseFlags=r,this.errors=a,this.offset=c,this.supportsDirectPipeReferences=p}peek(o){let e=this.index+o;return e<this.tokens.length?this.tokens[e]:Xg}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(o,e){let t=this.currentEndIndex;if(e!==void 0&&e>this.currentEndIndex&&(t=e),o>t){let i=t;t=o,o=i}return new Yp(o,t)}sourceSpan(o,e){let t=`${o}@${this.inputIndex}:${e}`;return this.sourceSpanCache.has(t)||this.sourceSpanCache.set(t,this.span(o,e).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(t)}advance(){this.index++}withContext(o,e){this.context|=o;let t=e();return this.context^=o,t}consumeOptionalCharacter(o){return this.next.isCharacter(o)?(this.advance(),!0):!1}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(o){this.consumeOptionalCharacter(o)||this.error(`Missing expected ${String.fromCharCode(o)}`)}consumeOptionalOperator(o){return this.next.isOperator(o)?(this.advance(),!0):!1}isAssignmentOperator(o){return o.type===hn.Operator&&La.isAssignmentOperation(o.strValue)}expectOperator(o){this.consumeOptionalOperator(o)||this.error(`Missing expected operator ${o}`)}prettyPrintToken(o){return o===Xg?"end of input":`token ${o}`}expectIdentifierOrKeyword(){let o=this.next;return!o.isIdentifier()&&!o.isKeyword()?(o.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(o,"expected identifier or keyword"):this.error(`Unexpected ${this.prettyPrintToken(o)}, expected identifier or keyword`),null):(this.advance(),o.toString())}expectIdentifierOrKeywordOrString(){let o=this.next;return!o.isIdentifier()&&!o.isKeyword()&&!o.isString()?(o.isPrivateIdentifier()?this._reportErrorForPrivateIdentifier(o,"expected identifier, keyword or string"):this.error(`Unexpected ${this.prettyPrintToken(o)}, expected identifier, keyword, or string`),""):(this.advance(),o.toString())}parseChain(){let o=[],e=this.inputIndex;for(;this.index<this.tokens.length;){let t=this.parsePipe();if(o.push(t),this.consumeOptionalCharacter(rs))for(this.parseFlags&1||this.error("Binding expression cannot contain chained expression");this.consumeOptionalCharacter(rs););else if(this.index<this.tokens.length){let i=this.index;if(this.error(`Unexpected token '${this.next}'`),this.index===i)break}}if(o.length===0){let t=this.offset,i=this.offset+this.input.length;return new ba(this.span(t,i),this.sourceSpan(t,i))}return o.length==1?o[0]:new Ph(this.span(e),this.sourceSpan(e),o)}parsePipe(){let o=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,i=this.expectIdentifierOrKeyword(),r,a;i!==null?r=this.sourceSpan(t):(i="",a=this.next.index!==-1?this.next.index:this.input.length+this.offset,r=new Yp(a,a).toAbsolute(this.absoluteOffset));let c=[];for(;this.consumeOptionalCharacter(Sc);)c.push(this.parseExpression());let p;if(this.supportsDirectPipeReferences){let u=i.charCodeAt(0);p=u===wm||u>=Sm&&u<=Gh?t1.ReferencedDirectly:t1.ReferencedByName}else p=t1.ReferencedByName;e=new C1(this.span(o),this.sourceSpan(o,a),e,i,c,p,r)}while(this.consumeOptionalOperator("|"))}return e}parseExpression(){return this.parseConditional()}parseConditional(){let o=this.inputIndex,e=this.parseLogicalOr();if(this.consumeOptionalOperator("?")){let t=this.parsePipe(),i;if(this.consumeOptionalCharacter(Sc))i=this.parsePipe();else{let r=this.inputIndex,a=this.input.substring(o,r);this.error(`Conditional expression ${a} requires all 3 expressions`),i=new ba(this.span(o),this.sourceSpan(o))}return new v1(this.span(o),this.sourceSpan(o),e,t,i)}else return e}parseLogicalOr(){let o=this.inputIndex,e=this.parseLogicalAnd();for(;this.consumeOptionalOperator("||");){let t=this.parseLogicalAnd();e=new La(this.span(o),this.sourceSpan(o),"||",e,t)}return e}parseLogicalAnd(){let o=this.inputIndex,e=this.parseNullishCoalescing();for(;this.consumeOptionalOperator("&&");){let t=this.parseNullishCoalescing();e=new La(this.span(o),this.sourceSpan(o),"&&",e,t)}return e}parseNullishCoalescing(){let o=this.inputIndex,e=this.parseEquality();for(;this.consumeOptionalOperator("??");){let t=this.parseEquality();e=new La(this.span(o),this.sourceSpan(o),"??",e,t)}return e}parseEquality(){let o=this.inputIndex,e=this.parseRelational();for(;this.next.type==hn.Operator;){let t=this.next.strValue;switch(t){case"==":case"===":case"!=":case"!==":this.advance();let i=this.parseRelational();e=new La(this.span(o),this.sourceSpan(o),t,e,i);continue}break}return e}parseRelational(){let o=this.inputIndex,e=this.parseAdditive();for(;this.next.type==hn.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 i=this.parseAdditive();e=new La(this.span(o),this.sourceSpan(o),t,e,i);continue}break}return e}parseAdditive(){let o=this.inputIndex,e=this.parseMultiplicative();for(;this.next.type==hn.Operator;){let t=this.next.strValue;switch(t){case"+":case"-":this.advance();let i=this.parseMultiplicative();e=new La(this.span(o),this.sourceSpan(o),t,e,i);continue}break}return e}parseMultiplicative(){let o=this.inputIndex,e=this.parseExponentiation();for(;this.next.type==hn.Operator;){let t=this.next.strValue;switch(t){case"*":case"%":case"/":this.advance();let i=this.parseExponentiation();e=new La(this.span(o),this.sourceSpan(o),t,e,i);continue}break}return e}parseExponentiation(){let o=this.inputIndex,e=this.parsePrefix();for(;this.next.type==hn.Operator&&this.next.strValue==="**";){(e instanceof Sh||e instanceof T_||e instanceof E_||e instanceof D_)&&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 La(this.span(o),this.sourceSpan(o),"**",e,t)}return e}parsePrefix(){if(this.next.type==hn.Operator){let o=this.inputIndex,e=this.next.strValue,t;switch(e){case"+":return this.advance(),t=this.parsePrefix(),Sh.createPlus(this.span(o),this.sourceSpan(o),t);case"-":return this.advance(),t=this.parsePrefix(),Sh.createMinus(this.span(o),this.sourceSpan(o),t);case"!":return this.advance(),t=this.parsePrefix(),new T_(this.span(o),this.sourceSpan(o),t)}}else if(this.next.isKeywordTypeof()){let o=this.inputIndex;this.advance();let e=this.parsePrefix();return new E_(this.span(o),this.sourceSpan(o),e)}else if(this.next.isKeywordVoid()){let o=this.inputIndex;this.advance();let e=this.parsePrefix();return new D_(this.span(o),this.sourceSpan(o),e)}return this.parseCallChain()}parseCallChain(){let o=this.inputIndex,e=this.parsePrimary();for(;;)if(this.consumeOptionalCharacter(Dp))e=this.parseAccessMember(e,o,!1);else if(this.consumeOptionalOperator("?."))this.consumeOptionalCharacter(ja)?e=this.parseCall(e,o,!0):e=this.consumeOptionalCharacter(kc)?this.parseKeyedReadOrWrite(e,o,!0):this.parseAccessMember(e,o,!0);else if(this.consumeOptionalCharacter(kc))e=this.parseKeyedReadOrWrite(e,o,!1);else if(this.consumeOptionalCharacter(ja))e=this.parseCall(e,o,!1);else if(this.consumeOptionalOperator("!"))e=new P_(this.span(o),this.sourceSpan(o),e);else if(this.next.isTemplateLiteralEnd())e=this.parseNoInterpolationTaggedTemplateLiteral(e,o);else if(this.next.isTemplateLiteralPart())e=this.parseTaggedTemplateLiteral(e,o);else return e}parsePrimary(){let o=this.inputIndex;if(this.isArrowFunction())return this.parseArrowFunction(o);if(this.consumeOptionalCharacter(ja)){this.rparensExpected++;let e=this.parsePipe();return this.consumeOptionalCharacter(Sr)||(this.error("Missing closing parentheses"),this.consumeOptionalCharacter(Sr)),this.rparensExpected--,new O_(this.span(o),this.sourceSpan(o),e)}else{if(this.next.isKeywordNull())return this.advance(),new os(this.span(o),this.sourceSpan(o),null);if(this.next.isKeywordUndefined())return this.advance(),new os(this.span(o),this.sourceSpan(o),void 0);if(this.next.isKeywordTrue())return this.advance(),new os(this.span(o),this.sourceSpan(o),!0);if(this.next.isKeywordFalse())return this.advance(),new os(this.span(o),this.sourceSpan(o),!1);if(this.next.isKeywordIn())return this.advance(),new os(this.span(o),this.sourceSpan(o),"in");if(this.next.isKeywordThis())return this.advance(),new S_(this.span(o),this.sourceSpan(o));if(this.consumeOptionalCharacter(kc))return this.parseLiteralArray(o);if(this.next.isCharacter(ol))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMember(new Ic(this.span(o),this.sourceSpan(o)),o,!1);if(this.next.isNumber()){let e=this.next.toNumber();return this.advance(),new os(this.span(o),this.sourceSpan(o),e)}else{if(this.next.isTemplateLiteralEnd())return this.parseNoInterpolationTemplateLiteral();if(this.next.isTemplateLiteralPart())return this.parseTemplateLiteral();if(this.next.isString()&&this.next.kind===Hp.Plain){let e=this.next.toString();return this.advance(),new os(this.span(o),this.sourceSpan(o),e)}else return this.next.isPrivateIdentifier()?(this._reportErrorForPrivateIdentifier(this.next,null),new ba(this.span(o),this.sourceSpan(o))):this.next.isRegExpBody()?this.parseRegularExpressionLiteral():this.index>=this.tokens.length?(this.error(`Unexpected end of expression: ${this.input}`),new ba(this.span(o),this.sourceSpan(o))):(this.error(`Unexpected token ${this.next}`),new ba(this.span(o),this.sourceSpan(o)))}}}parseLiteralArray(o){this.rbracketsExpected++;let e=[];do if(this.next.isOperator("..."))e.push(this.parseSpreadElement());else if(!this.next.isCharacter(bd))e.push(this.parsePipe());else break;while(this.consumeOptionalCharacter(ya));return this.rbracketsExpected--,this.expectCharacter(bd),new k_(this.span(o),this.sourceSpan(o),e)}parseLiteralMap(){let o=[],e=[],t=this.inputIndex;if(this.expectCharacter(ol),!this.consumeOptionalCharacter(Ba)){this.rbracesExpected++;do{let i=this.inputIndex;if(this.next.isOperator("...")){this.advance(),o.push({kind:"spread",span:this.span(i),sourceSpan:this.sourceSpan(i)}),e.push(this.parsePipe());continue}let r=this.next.isString(),a=this.expectIdentifierOrKeywordOrString(),c=this.span(i),p=this.sourceSpan(i),u={kind:"property",key:a,quoted:r,span:c,sourceSpan:p};o.push(u),r?(this.expectCharacter(Sc),e.push(this.parsePipe())):this.consumeOptionalCharacter(Sc)?e.push(this.parsePipe()):(u.isShorthandInitialized=!0,e.push(new Mc(c,p,p,new Ic(c,p),a)))}while(this.consumeOptionalCharacter(ya)&&!this.next.isCharacter(Ba));this.rbracesExpected--,this.expectCharacter(Ba)}return new Jp(this.span(t),this.sourceSpan(t),o,e)}parseAccessMember(o,e,t){let i=this.inputIndex,r=this.withContext(o_.Writable,()=>{let c=this.expectIdentifierOrKeyword()??"";return c.length===0&&this.error("Expected identifier for property access",o.span.end),c}),a=this.sourceSpan(i);if(t)return this.isAssignmentOperator(this.next)?(this.advance(),this.error("The '?.' operator cannot be used in the assignment"),new ba(this.span(e),this.sourceSpan(e))):new w_(this.span(e),this.sourceSpan(e),a,o,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 ba(this.span(e),this.sourceSpan(e));let p=new Mc(this.span(e),this.sourceSpan(e),a,o,r);this.advance();let u=this.parseConditional();return new La(this.span(e),this.sourceSpan(e),c,p,u)}else return new Mc(this.span(e),this.sourceSpan(e),a,o,r)}parseCall(o,e,t){let i=this.inputIndex;this.rparensExpected++;let r=this.parseCallArguments(),a=this.span(i,this.inputIndex).toAbsolute(this.absoluteOffset);this.expectCharacter(Sr),this.rparensExpected--;let c=this.span(e),p=this.sourceSpan(e);return t?new b1(c,p,o,r,a):new Ih(c,p,o,r,a)}parseCallArguments(){if(this.next.isCharacter(Sr))return[];let o=[];do o.push(this.next.isOperator("...")?this.parseSpreadElement():this.parsePipe());while(this.consumeOptionalCharacter(ya));return o}parseSpreadElement(){this.next.isOperator("...")||this.error("Spread element must start with '...' operator");let o=this.inputIndex;this.advance();let e=this.parsePipe(),t=this.span(o),i=this.sourceSpan(o);return new x1(t,i,e)}expectTemplateBindingKey(){let o="",e=!1,t=this.currentAbsoluteOffset;do o+=this.expectIdentifierOrKeywordOrString(),e=this.consumeOptionalOperator("-"),e&&(o+="-");while(e);return{source:o,span:new As(t,t+o.length)}}parseTemplateBindings(o){let e=[];for(e.push(...this.parseDirectiveKeywordBindings(o));this.index<this.tokens.length;){let t=this.parseLetBinding();if(t)e.push(t);else{let i=this.expectTemplateBindingKey(),r=this.parseAsBinding(i);r?e.push(r):(i.source=o.source+i.source.charAt(0).toUpperCase()+i.source.substring(1),e.push(...this.parseDirectiveKeywordBindings(i)))}this.consumeStatementTerminator()}return new eE(e,[],this.errors)}parseKeyedReadOrWrite(o,e,t){return this.withContext(o_.Writable,()=>{this.rbracketsExpected++;let i=this.parsePipe();if(i instanceof ba&&this.error("Key access cannot be empty"),this.rbracketsExpected--,this.expectCharacter(bd),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 Zp(this.span(e),this.sourceSpan(e),o,i);this.advance();let c=this.parseConditional();return new La(this.span(e),this.sourceSpan(e),r,a,c)}}else return t?new M_(this.span(e),this.sourceSpan(e),o,i):new Zp(this.span(e),this.sourceSpan(e),o,i);return new ba(this.span(e),this.sourceSpan(e))})}parseDirectiveKeywordBindings(o){let e=[];this.consumeOptionalCharacter(Sc);let t=this.getDirectiveBoundTarget(),i=this.currentAbsoluteOffset,r=this.parseAsBinding(o);r||(this.consumeStatementTerminator(),i=this.currentAbsoluteOffset);let a=new As(o.span.start,i);return e.push(new uT(a,o,t)),r&&e.push(r),e}getDirectiveBoundTarget(){if(this.next===Xg||this.peekKeywordAs()||this.peekKeywordLet())return null;let o=this.parsePipe(),{start:e,end:t}=o.span,i=this.input.substring(e,t);return new as(o,i,sm(this.parseSourceSpan),this.absoluteOffset+e,this.errors)}parseAsBinding(o){if(!this.peekKeywordAs())return null;this.advance();let e=this.expectTemplateBindingKey();this.consumeStatementTerminator();let t=new As(o.span.start,this.currentAbsoluteOffset);return new N_(t,e,o)}parseLetBinding(){if(!this.peekKeywordLet())return null;let o=this.currentAbsoluteOffset;this.advance();let e=this.expectTemplateBindingKey(),t=null;this.consumeOptionalOperator("=")&&(t=this.expectTemplateBindingKey()),this.consumeStatementTerminator();let i=new As(o,this.currentAbsoluteOffset);return new N_(i,e,t)}parseNoInterpolationTaggedTemplateLiteral(o,e){let t=this.parseNoInterpolationTemplateLiteral();return new I_(this.span(e),this.sourceSpan(e),o,t)}parseNoInterpolationTemplateLiteral(){let o=this.next.strValue,e=this.inputIndex;this.advance();let t=this.span(e),i=this.sourceSpan(e);return new A_(t,i,[new y1(t,i,o)],[])}parseTaggedTemplateLiteral(o,e){let t=this.parseTemplateLiteral();return new I_(this.span(e),this.sourceSpan(e),o,t)}parseTemplateLiteral(){let o=[],e=[],t=this.inputIndex;for(;this.next!==Xg;){let i=this.next;if(i.isTemplateLiteralPart()||i.isTemplateLiteralEnd()){let r=this.inputIndex;if(this.advance(),o.push(new y1(this.span(r),this.sourceSpan(r),i.strValue)),i.isTemplateLiteralEnd())break}else if(i.isTemplateLiteralInterpolationStart()){this.advance(),this.rbracesExpected++;let r=this.parsePipe();r instanceof ba?this.error("Template literal interpolation cannot be empty"):e.push(r),this.rbracesExpected--}else this.advance()}return new A_(this.span(t),this.sourceSpan(t),o,e)}parseRegularExpressionLiteral(){let o=this.next;if(this.advance(),!o.isRegExpBody())return new ba(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];gN.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(gN,p=>`"${p}"`).join(", "),e.index+a)}}let t=o.index,i=e?e.end:o.end;return new w1(this.span(t,i),this.sourceSpan(t,i),o.strValue,e?e.strValue:null)}parseArrowFunction(o){let e;if(this.next.isIdentifier()){let i=this.next;this.advance(),e=[this.getArrowFunctionIdentifierArg(i)]}else this.next.isCharacter(ja)?(this.rparensExpected++,this.advance(),e=this.parseArrowFunctionParameters(),this.rparensExpected--):(e=[],this.error(`Unexpected token ${this.next}`));this.expectOperator("=>");let t;if(this.next.isCharacter(ol))this.error("Multi-line arrow functions are not supported. If you meant to return an object literal, wrap it with parentheses."),t=new ba(this.span(o),this.sourceSpan(o));else{let i=this.parseFlags;this.parseFlags=1,t=this.parseExpression(),this.parseFlags=i}return new S1(this.span(o),this.sourceSpan(o),e,t)}parseArrowFunctionParameters(){let o=[];if(!this.consumeOptionalCharacter(Sr))for(;this.next!==Xg;)if(this.next.isIdentifier()){let e=this.next;if(this.advance(),o.push(this.getArrowFunctionIdentifierArg(e)),this.consumeOptionalCharacter(Sr))break;this.expectCharacter(ya)}else{this.error(`Unexpected token ${this.next}`);break}return o}getArrowFunctionIdentifierArg(o){return new pT(o.strValue,this.span(o.index),this.sourceSpan(o.index))}isArrowFunction(){let o=this.index,e=this.tokens;if(o>e.length-2)return!1;if(e[o].isIdentifier()&&e[o+1].isOperator("=>"))return!0;if(e[o].isCharacter(ja)){let t=o+1;for(t;t<e.length&&!(!e[t].isIdentifier()&&!e[t].isCharacter(ya));t++);return t<e.length-1&&e[t].isCharacter(Sr)&&e[t+1].isOperator("=>")}return!1}consumeStatementTerminator(){this.consumeOptionalCharacter(rs)||this.consumeOptionalCharacter(ya)}error(o,e=this.index){this.errors.push(bh(o,this.input,this.getErrorLocationText(e),this.parseSourceSpan)),this.skip()}getErrorLocationText(o){return o<this.tokens.length?`at column ${this.tokens[o].index+1} in`:"at the end of the expression"}_reportErrorForPrivateIdentifier(o,e){let t=`Private identifiers are not supported. Unexpected private identifier: ${o}`;e!==null&&(t+=`, ${e}`),this.error(t)}skip(){let o=this.next;for(;this.index<this.tokens.length&&!o.isCharacter(rs)&&!o.isOperator("|")&&(this.rparensExpected<=0||!o.isCharacter(Sr))&&(this.rbracesExpected<=0||!o.isCharacter(Ba))&&(this.rbracketsExpected<=0||!o.isCharacter(bd))&&(!(this.context&o_.Writable)||!this.isAssignmentOperator(o));)this.next.isError()&&this.errors.push(bh(this.next.toString(),this.input,this.getErrorLocationText(this.next.index),this.parseSourceSpan)),this.advance(),o=this.next}};function bh(n,o,e,t){e.length>0&&(e=` ${e} `);let i=sm(t),r=`Parser Error: ${n}${e}[${o}] in ${i}`;return new sn(t,r)}var tE=class extends Ah{errors=[];visitPipe(){this.errors.push("pipes")}};function dq(n){let o=new Map,e=0,t=0,i=0;for(;i<n.length;){let r=n[i];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}o.set(t,e),i++}return o}function mq(n){return n.visit(new nE)}var nE=class{visitUnary(o,e){return`${o.operator}${o.expr.visit(this,e)}`}visitBinary(o,e){return`${o.left.visit(this,e)} ${o.operation} ${o.right.visit(this,e)}`}visitChain(o,e){return o.expressions.map(t=>t.visit(this,e)).join("; ")}visitConditional(o,e){return`${o.condition.visit(this,e)} ? ${o.trueExp.visit(this,e)} : ${o.falseExp.visit(this,e)}`}visitThisReceiver(){return"this"}visitImplicitReceiver(){return""}visitInterpolation(o,e){return uq(o.strings,o.expressions.map(t=>t.visit(this,e))).join("")}visitKeyedRead(o,e){return`${o.receiver.visit(this,e)}[${o.key.visit(this,e)}]`}visitLiteralArray(o,e){return`[${o.expressions.map(t=>t.visit(this,e)).join(", ")}]`}visitLiteralMap(o,e){return`{${pq(o.keys.map(t=>t.kind==="spread"?"...":t.quoted?`'${t.key}'`:t.key),o.values.map(t=>t.visit(this,e))).map(([t,i])=>`${t}: ${i}`).join(", ")}}`}visitLiteralPrimitive(o){if(o.value===null)return"null";switch(typeof o.value){case"number":case"boolean":return o.value.toString();case"undefined":return"undefined";case"string":return`'${o.value.replace(/'/g,"\\'")}'`;default:throw new Error(`Unsupported primitive type: ${o.value}`)}}visitPipe(o,e){return`${o.exp.visit(this,e)} | ${o.name}`}visitPrefixNot(o,e){return`!${o.expression.visit(this,e)}`}visitNonNullAssert(o,e){return`${o.expression.visit(this,e)}!`}visitPropertyRead(o,e){return o.receiver instanceof Ic||o.receiver instanceof S_?o.name:`${o.receiver.visit(this,e)}.${o.name}`}visitSafePropertyRead(o,e){return`${o.receiver.visit(this,e)}?.${o.name}`}visitSafeKeyedRead(o,e){return`${o.receiver.visit(this,e)}?.[${o.key.visit(this,e)}]`}visitCall(o,e){return`${o.receiver.visit(this,e)}(${o.args.map(t=>t.visit(this,e)).join(", ")})`}visitSafeCall(o,e){return`${o.receiver.visit(this,e)}?.(${o.args.map(t=>t.visit(this,e)).join(", ")})`}visitTypeofExpression(o,e){return`typeof ${o.expression.visit(this,e)}`}visitVoidExpression(o,e){return`void ${o.expression.visit(this,e)}`}visitRegularExpressionLiteral(o,e){return`/${o.body}/${o.flags||""}`}visitArrowFunction(o,e){let t;return o.parameters.length===1?t=o.parameters[0].name:t=`(${o.parameters.map(i=>i.name).join(", ")})`,`${t} => ${o.body.visit(this,e)}`}visitASTWithSource(o,e){return o.ast.visit(this,e)}visitTemplateLiteral(o,e){let t="";for(let i=0;i<o.elements.length;i++){t+=o.elements[i].visit(this,e);let r=i<o.expressions.length?o.expressions[i]:null;r!==null&&(t+="${"+r.visit(this,e)+"}")}return"`"+t+"`"}visitTemplateLiteralElement(o,e){return o.text}visitTaggedTemplateLiteral(o,e){return o.tag.visit(this,e)+o.template.visit(this,e)}visitSpreadElement(o,e){return`...${o.expression.visit(this,e)}`}visitParenthesizedExpression(o,e){return"("+o.expression.visit(this,e)+")"}};function pq(n,o){if(n.length!==o.length)throw new Error("Array lengths must match");return n.map((e,t)=>[e,o[t]])}function uq(n,o){let e=[];for(let t=0;t<Math.max(n.length,o.length);t++)t<n.length&&e.push(n[t]),t<o.length&&e.push(o[t]);return e}var vx="svg",Cx="math",iE=class{},hq="boolean",fq="number",gq="string",_q="object";function Kg(n){let o=n.toLowerCase(),[e,t]=Sa(o,!1);return e===vx||e===Cx?`:${e}:${t}`:t}var vq=["[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:|"],s6=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"})),Cq=Array.from(s6).reduce((n,[o,e])=>(n.set(o,e),n),new Map),Hh=class extends iE{_schema=new Map;_eventSchema=new Map;constructor(){super(),vq.forEach(o=>{let e=new Map,t=new Set,[i,r]=o.split("|"),a=r.split(","),[c,p]=i.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,g]of u)e.set(h,g);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),hq);break;case"#":e.set(h.substring(1),fq);break;case"%":e.set(h.substring(1),_q);break;default:e.set(h,gq)}})})}hasProperty(o,e,t){if(t.some(a=>a.name===_5.name))return!0;let i=Kg(o);if(i.includes("-")){if(D5(i)||fT(i))return!1;if(t.some(a=>a.name===g5.name))return!0}return(this._schema.get(i)||this._schema.get("unknown")).has(e)}hasElement(o,e){if(e.some(i=>i.name===_5.name))return!0;let t=Kg(o);return t.includes("-")&&(D5(t)||fT(t)||e.some(i=>i.name===g5.name))?!0:this._schema.has(t)}securityContext(o,e,t){t&&(e=this.getMappedPropName(e));let i=Kg(o);e=e.toLowerCase();let r=z$();return r[i+"|"+e]??r["*|"+e]??fi.NONE}getMappedPropName(o){return s6.get(o)??o}getDefaultComponentElementName(){return"ng-component"}validateProperty(o){return o.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event property '${o}' is disallowed for security reasons, please use (${o.slice(2)})=...
|
||
If '${o}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(o){return o.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event attribute '${o}' is disallowed for security reasons, please use (${o.slice(2)})=...`}:{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(o){let e=Kg(o),t=this._schema.get(e)||this._schema.get("unknown");return Array.from(t.keys()).map(i=>Cq.get(i)??i)}allKnownEventsOfElement(o){let e=Kg(o);return Array.from(this._eventSchema.get(e)??[])}normalizeAnimationStyleProperty(o){return fH(o)}normalizeAnimationStyleValue(o,e,t){let i="",r=t.toString().trim(),a=null;if(xq(o)&&t!==0&&t!=="0")if(typeof t=="number")i="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+i}}};function xq(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 Zn=class{closedByChildren={};contentType;closedByParent=!1;implicitNamespacePrefix;isVoid;ignoreFirstLf;canSelfClose;preventNamespaceInheritance;constructor({closedByChildren:o,implicitNamespacePrefix:e,contentType:t=yc.PARSABLE_DATA,closedByParent:i=!1,isVoid:r=!1,ignoreFirstLf:a=!1,preventNamespaceInheritance:c=!1,canSelfClose:p=!1}={}){o&&o.length>0&&o.forEach(u=>this.closedByChildren[u]=!0),this.isVoid=r,this.closedByParent=i||r,this.implicitNamespacePrefix=e||null,this.contentType=t,this.ignoreFirstLf=a,this.preventNamespaceInheritance=c,this.canSelfClose=p??r}isClosedByChild(o){return this.isVoid||o.toLowerCase()in this.closedByChildren}getContentType(o){return typeof this.contentType=="object"?(o===void 0?void 0:this.contentType[o])??this.contentType.default:this.contentType}},_N,uh;function oE(n){return uh||(_N=new Zn({canSelfClose:!0}),uh=Object.assign(Object.create(null),{base:new Zn({isVoid:!0}),meta:new Zn({isVoid:!0}),area:new Zn({isVoid:!0}),embed:new Zn({isVoid:!0}),link:new Zn({isVoid:!0}),img:new Zn({isVoid:!0}),input:new Zn({isVoid:!0}),param:new Zn({isVoid:!0}),hr:new Zn({isVoid:!0}),br:new Zn({isVoid:!0}),source:new Zn({isVoid:!0}),track:new Zn({isVoid:!0}),wbr:new Zn({isVoid:!0}),p:new Zn({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 Zn({closedByChildren:["tbody","tfoot"]}),tbody:new Zn({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new Zn({closedByChildren:["tbody"],closedByParent:!0}),tr:new Zn({closedByChildren:["tr"],closedByParent:!0}),td:new Zn({closedByChildren:["td","th"],closedByParent:!0}),th:new Zn({closedByChildren:["td","th"],closedByParent:!0}),col:new Zn({isVoid:!0}),svg:new Zn({implicitNamespacePrefix:"svg"}),foreignObject:new Zn({implicitNamespacePrefix:"svg",preventNamespaceInheritance:!0}),math:new Zn({implicitNamespacePrefix:"math"}),li:new Zn({closedByChildren:["li"],closedByParent:!0}),dt:new Zn({closedByChildren:["dt","dd"]}),dd:new Zn({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new Zn({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new Zn({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new Zn({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new Zn({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new Zn({closedByChildren:["optgroup"],closedByParent:!0}),option:new Zn({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new Zn({ignoreFirstLf:!0}),listing:new Zn({ignoreFirstLf:!0}),style:new Zn({contentType:yc.RAW_TEXT}),script:new Zn({contentType:yc.RAW_TEXT}),title:new Zn({contentType:{default:yc.ESCAPABLE_RAW_TEXT,svg:yc.PARSABLE_DATA}}),textarea:new Zn({contentType:yc.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})}),new Hh().allKnownElementNames().forEach(o=>{!uh[o]&&gT(o)===null&&(uh[o]=new Zn({canSelfClose:!1}))})),uh[n]??uh[n.toLowerCase()]??_N}var vN={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"},rE=class{_placeHolderNameCounts={};_signatureToName={};getStartTagPlaceholderName(o,e,t){let i=this._hashTag(o,e,t);if(this._signatureToName[i])return this._signatureToName[i];let r=o.toUpperCase(),a=vN[r]||`TAG_${r}`,c=this._generateUniqueName(t?a:`START_${a}`);return this._signatureToName[i]=c,c}getCloseTagPlaceholderName(o){let e=this._hashClosingTag(o);if(this._signatureToName[e])return this._signatureToName[e];let t=o.toUpperCase(),i=vN[t]||`TAG_${t}`,r=this._generateUniqueName(`CLOSE_${i}`);return this._signatureToName[e]=r,r}getPlaceholderName(o,e){let t=o.toUpperCase(),i=`PH: ${t}=${e}`;if(this._signatureToName[i])return this._signatureToName[i];let r=this._generateUniqueName(t);return this._signatureToName[i]=r,r}getUniquePlaceholder(o){return this._generateUniqueName(o.toUpperCase())}getStartBlockPlaceholderName(o,e){let t=this._hashBlock(o,e);if(this._signatureToName[t])return this._signatureToName[t];let i=this._generateUniqueName(`START_BLOCK_${this._toSnakeCase(o)}`);return this._signatureToName[t]=i,i}getCloseBlockPlaceholderName(o){let e=this._hashClosingBlock(o);if(this._signatureToName[e])return this._signatureToName[e];let t=this._generateUniqueName(`CLOSE_BLOCK_${this._toSnakeCase(o)}`);return this._signatureToName[e]=t,t}_hashTag(o,e,t){let i=`<${o}`,r=Object.keys(e).sort().map(c=>` ${c}=${e[c]}`).join(""),a=t?"/>":`></${o}>`;return i+r+a}_hashClosingTag(o){return this._hashTag(`/${o}`,{},!1)}_hashBlock(o,e){let t=e.length===0?"":` (${e.sort().join("; ")})`;return`@${o}${t} {}`}_hashClosingBlock(o){return this._hashBlock(`close_${o}`,[])}_toSnakeCase(o){return o.toUpperCase().replace(/[^A-Z0-9]/g,"_")}_generateUniqueName(o){if(!this._placeHolderNameCounts.hasOwnProperty(o))return this._placeHolderNameCounts[o]=1,o;let t=this._placeHolderNameCounts[o];return this._placeHolderNameCounts[o]=t+1,`${o}_${t}`}},bq=new nx(new s0);function yq(n,o){let e=new aE(bq,n,o);return(t,i,r,a,c)=>e.toI18nMessage(t,i,r,a,c)}function Sq(n,o){return o}var aE=class{_expressionParser;_retainEmptyTokens;_preserveExpressionWhitespace;constructor(o,e,t){this._expressionParser=o,this._retainEmptyTokens=e,this._preserveExpressionWhitespace=t}toI18nMessage(o,e="",t="",i="",r){let a={isIcu:o.length==1&&o[0]instanceof $p,icuDepth:0,placeholderRegistry:new rE,placeholderToContent:{},placeholderToMessage:{},visitNodeFn:r||Sq},c=xo(this,o,a);return new Ha(c,a.placeholderToContent,a.placeholderToMessage,e,t,i)}visitElement(o,e){return this._visitElementLike(o,e)}visitComponent(o,e){return this._visitElementLike(o,e)}visitDirective(o,e){throw new Error("Unreachable code")}visitAttribute(o,e){let t=o.valueTokens===void 0||o.valueTokens.length===1?new Wg(o.value,o.valueSpan||o.sourceSpan):this._visitTextWithInterpolation(o.valueTokens,o.valueSpan||o.sourceSpan,e,o.i18n);return e.visitNodeFn(o,t)}visitText(o,e){let t=o.tokens.length===1?new Wg(o.value,o.sourceSpan):this._visitTextWithInterpolation(o.tokens,o.sourceSpan,e,o.i18n);return e.visitNodeFn(o,t)}visitComment(o,e){return null}visitExpansion(o,e){e.icuDepth++;let t={},i=new O1(o.switchValue,o.type,t,o.sourceSpan);if(o.cases.forEach(c=>{t[c.value]=new Sd(c.expression.map(p=>p.visit(this,e)),c.expSourceSpan)}),e.icuDepth--,e.isIcu||e.icuDepth>0){let c=e.placeholderRegistry.getUniquePlaceholder(`VAR_${o.type}`);return i.expressionPlaceholder=c,e.placeholderToContent[c]={text:o.switchValue,sourceSpan:o.switchValueSourceSpan},e.visitNodeFn(o,i)}let r=e.placeholderRegistry.getPlaceholderName("ICU",o.sourceSpan.toString());e.placeholderToMessage[r]=this.toI18nMessage([o],"","","",void 0);let a=new Lh(i,r,o.sourceSpan);return e.visitNodeFn(o,a)}visitExpansionCase(o,e){throw new Error("Unreachable code")}visitBlock(o,e){let t=xo(this,o.children,e);if(o.name==="switch")return new Sd(t,o.sourceSpan);let i=o.parameters.map(p=>p.expression),r=e.placeholderRegistry.getStartBlockPlaceholderName(o.name,i),a=e.placeholderRegistry.getCloseBlockPlaceholderName(o.name);e.placeholderToContent[r]={text:o.startSourceSpan.toString(),sourceSpan:o.startSourceSpan},e.placeholderToContent[a]={text:o.endSourceSpan?o.endSourceSpan.toString():"}",sourceSpan:o.endSourceSpan??o.sourceSpan};let c=new gm(o.name,i,r,a,t,o.sourceSpan,o.startSourceSpan,o.endSourceSpan);return e.visitNodeFn(o,c)}visitBlockParameter(o,e){throw new Error("Unreachable code")}visitLetDeclaration(o,e){return null}_visitElementLike(o,e){let t=xo(this,o.children,e),i={},r=g=>{i[g.name]=g.value},a,c;o instanceof el?(a=o.name,c=oE(o.name).isVoid):(a=o.fullName,c=o.tagName?oE(o.tagName).isVoid:!1),o.attrs.forEach(r),o.directives.forEach(g=>g.attrs.forEach(r));let p=e.placeholderRegistry.getStartTagPlaceholderName(a,i,c);e.placeholderToContent[p]={text:o.startSourceSpan.toString(),sourceSpan:o.startSourceSpan};let u="";c||(u=e.placeholderRegistry.getCloseTagPlaceholderName(a),e.placeholderToContent[u]={text:`</${a}>`,sourceSpan:o.endSourceSpan??o.sourceSpan});let h=new fm(a,i,p,u,t,c,o.sourceSpan,o.startSourceSpan,o.endSourceSpan);return e.visitNodeFn(o,h)}_visitTextWithInterpolation(o,e,t,i){let r=[],a=!1;for(let c of o)switch(c.type){case 8:case 17:a=!0;let[p,u,h]=c.parts,g=Eq(u)||"INTERPOLATION",y=t.placeholderRegistry.getPlaceholderName(g,u);if(this._preserveExpressionWhitespace)t.placeholderToContent[y]={text:c.parts.join(""),sourceSpan:c.sourceSpan},r.push(new H_(u,y,c.sourceSpan));else{let b=this.normalizeExpression(c);t.placeholderToContent[y]={text:`${p}${b}${h}`,sourceSpan:c.sourceSpan},r.push(new H_(b,y,c.sourceSpan))}break;default:if(c.parts[0].length>0||this._retainEmptyTokens){let b=r[r.length-1];b instanceof Wg?(b.value+=c.parts[0],b.sourceSpan=new gn(b.sourceSpan.start,c.sourceSpan.end,b.sourceSpan.fullStart,b.sourceSpan.details)):r.push(new Wg(c.parts[0],c.sourceSpan))}else this._retainEmptyTokens&&r.push(new Wg(c.parts[0],c.sourceSpan));break}return a?(wq(r,i),new Sd(r,e)):r[0]}normalizeExpression(o){let e=o.parts[1],t=this._expressionParser.parseBinding(e,o.sourceSpan,o.sourceSpan.start.offset);return mq(t)}};function wq(n,o){if(o instanceof Ha&&(Mq(o),o=o.nodes[0]),o instanceof Sd){kq(o.children,n);for(let e=0;e<n.length;e++)n[e].sourceSpan=o.children[e].sourceSpan}}function Mq(n){let o=n.nodes;if(o.length!==1||!(o[0]instanceof Sd))throw new Error("Unexpected previous i18n message - expected it to consist of only a single `Container` node.")}function kq(n,o){if(n.length!==o.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 (${o.length} tokens):
|
||
${o.map(e=>`"${e.sourceSpan.toString()}"`).join(`
|
||
`)}
|
||
`.trim());if(n.some((e,t)=>o[t].constructor!==e.constructor))throw new Error("The types of the i18n message children changed between first and second pass.")}var Tq=/\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*("|')([\s\S]*?)\1[\s\S]*\)/g;function Eq(n){return n.split(Tq)[2]}var CN=new Set(["iframe|srcdoc","*|innerhtml","*|outerhtml","embed|src","iframe|src","object|codebase","object|data"]);function xN(n,o){return n=n.toLowerCase(),o=o.toLowerCase(),CN.has(n+"|"+o)||CN.has("*|"+o)}var Dq=n=>(o,e)=>{let t=n.get(o)??o;return t instanceof kd&&(e instanceof Lh&&t.i18n instanceof Ha&&(e.previousMessage=t.i18n),t.i18n=e),e},ix=class{keepI18nAttrs;enableI18nLegacyMessageIdFormat;preserveSignificantWhitespace;retainEmptyTokens;hasI18nMeta=!1;_errors=[];constructor(o=!1,e=!1,t=!0,i=!t){this.keepI18nAttrs=o,this.enableI18nLegacyMessageIdFormat=e,this.preserveSignificantWhitespace=t,this.retainEmptyTokens=i}_generateI18nMessage(o,e="",t){let{meaning:i,description:r,customId:a}=this._parseMetadata(e),p=yq(this.retainEmptyTokens,this.preserveSignificantWhitespace)(o,i,r,a,t);return this._setMessageId(p,e),this._setLegacyIds(p,e),p}visitAllWithErrors(o){let e=o.map(t=>t.visit(this,null));return new ex(e,this._errors)}visitElement(o){return this._visitElementLike(o),o}visitComponent(o,e){return this._visitElementLike(o),o}visitExpansion(o,e){let t,i=o.i18n;if(this.hasI18nMeta=!0,i instanceof Lh){let r=i.name;t=this._generateI18nMessage([o],i);let a=xF(t);a.name=r,e!==null&&(e.placeholderToMessage[r]=t)}else t=this._generateI18nMessage([o],e||i);return o.i18n=t,o}visitText(o){return o}visitAttribute(o){return o}visitComment(o){return o}visitExpansionCase(o){return o}visitBlock(o,e){return xo(this,o.children,e),o}visitBlockParameter(o,e){return o}visitLetDeclaration(o,e){return o}visitDirective(o,e){return o}_visitElementLike(o){let e;if(HH(o)){this.hasI18nMeta=!0;let t=[],i={};for(let r of o.attrs)if(r.name===vF){let a=o.i18n||r.value,c=new Map,p=this.preserveSignificantWhitespace?o.children:Cc(new tx(!1,c),o.children);e=this._generateI18nMessage(p,a,Dq(c)),e.nodes.length===0&&(e=void 0),o.i18n=e}else if(r.name.startsWith(kT)){let a=r.name.slice(kT.length),c;o instanceof Va?c=o.tagName===null?!1:xN(o.tagName,a):c=xN(o.name,a),c?this._reportError(r,`Translating attribute '${a}' is disallowed for security reasons.`):i[a]=r.value}else t.push(r);if(Object.keys(i).length)for(let r of t){let a=i[r.name];a!==void 0&&r.value&&(r.i18n=this._generateI18nMessage([r],r.i18n||a))}this.keepI18nAttrs||(o.attrs=t)}xo(this,o.children,e)}_parseMetadata(o){return typeof o=="string"?Aq(o):o instanceof Ha?o:{}}_setMessageId(o,e){o.id||(o.id=e instanceof Ha&&e.id||W$(o))}_setLegacyIds(o,e){if(this.enableI18nLegacyMessageIdFormat)o.legacyIds=[U$(o),cF(o)];else if(typeof e!="string"){let t=e instanceof Ha?e:e instanceof Lh?e.previousMessage:void 0;o.legacyIds=t?t.legacyIds:[]}}_reportError(o,e){this._errors.push(new sn(o.sourceSpan,e))}},Pq="|",Iq="@@";function Aq(n=""){let o,e,t;if(n=n.trim(),n){let i=n.indexOf(Iq),r=n.indexOf(Pq),a;[a,o]=i>-1?[n.slice(0,i),n.slice(i+2)]:[n,""],[e,t]=r>-1?[a.slice(0,r),a.slice(r+1)]:["",a]}return{customId:o,meaning:e,description:t}}function Oq(n){let o=[];return n.description?o.push({tagName:"desc",text:n.description}):o.push({tagName:"suppress",text:"{msgDescriptions}"}),n.meaning&&o.push({tagName:"meaning",text:n.meaning}),aH(o)}var Nq="goog.getMsg";function Fq(n,o,e,t){let i=Lq(o),r=[Ee(i)];Object.keys(t).length&&(r.push(HT(LE(t,!0),!0)),r.push(HT({original_code:cl(Object.keys(t).map(p=>({key:h0(p),quoted:!0,value:o.placeholders[p]?Ee(o.placeholders[p].sourceSpan.toString()):Ee(o.placeholderToMessage[p].nodes.map(u=>u.sourceSpan.toString()).join(""))})))})));let a=new Hr(e.name,Jn(Nq).callFn(r),Wl,ca.Final);a.addLeadingComment(Oq(o));let c=new pa(n.set(e));return[a,c]}var sE=class{formatPh(o){return`{$${h0(o)}}`}visitText(o){return o.value}visitContainer(o){return o.children.map(e=>e.visit(this)).join("")}visitIcu(o){return e6(o)}visitTagPlaceholder(o){return o.isVoid?this.formatPh(o.startName):`${this.formatPh(o.startName)}${o.children.map(e=>e.visit(this)).join("")}${this.formatPh(o.closeName)}`}visitPlaceholder(o){return this.formatPh(o.name)}visitBlockPlaceholder(o){return`${this.formatPh(o.startName)}${o.children.map(e=>e.visit(this)).join("")}${this.formatPh(o.closeName)}`}visitIcuPlaceholder(o,e){return this.formatPh(o.name)}},Rq=new sE;function Lq(n){return n.nodes.map(o=>o.visit(Rq,null)).join("")}function Vq(n,o,e){let{messageParts:t,placeHolders:i}=Bq(o),r=zq(o),a=i.map(u=>e[u.text]),c=cH(o,t,i,a,r),p=n.set(c);return[new pa(p)]}var lE=class{placeholderToMessage;pieces;constructor(o,e){this.placeholderToMessage=o,this.pieces=e}visitText(o){if(this.pieces[this.pieces.length-1]instanceof Vp)this.pieces[this.pieces.length-1].text+=o.value;else{let e=new gn(o.sourceSpan.fullStart,o.sourceSpan.end,o.sourceSpan.fullStart,o.sourceSpan.details);this.pieces.push(new Vp(o.value,e))}}visitContainer(o){o.children.forEach(e=>e.visit(this))}visitIcu(o){this.pieces.push(new Vp(e6(o),o.sourceSpan))}visitTagPlaceholder(o){this.pieces.push(this.createPlaceholderPiece(o.startName,o.startSourceSpan??o.sourceSpan)),o.isVoid||(o.children.forEach(e=>e.visit(this)),this.pieces.push(this.createPlaceholderPiece(o.closeName,o.endSourceSpan??o.sourceSpan)))}visitPlaceholder(o){this.pieces.push(this.createPlaceholderPiece(o.name,o.sourceSpan))}visitBlockPlaceholder(o){this.pieces.push(this.createPlaceholderPiece(o.startName,o.startSourceSpan??o.sourceSpan)),o.children.forEach(e=>e.visit(this)),this.pieces.push(this.createPlaceholderPiece(o.closeName,o.endSourceSpan??o.sourceSpan))}visitIcuPlaceholder(o){this.pieces.push(this.createPlaceholderPiece(o.name,o.sourceSpan,this.placeholderToMessage[o.name]))}createPlaceholderPiece(o,e,t){return new yh(h0(o,!1),e,t)}};function Bq(n){let o=[],e=new lE(n.placeholderToMessage,o);return n.nodes.forEach(t=>t.visit(e)),jq(o)}function zq(n){let o=n.nodes[0],e=n.nodes[n.nodes.length-1];return new gn(o.sourceSpan.fullStart,e.sourceSpan.end,o.sourceSpan.fullStart,o.sourceSpan.details)}function jq(n){let o=[],e=[];n[0]instanceof yh&&o.push($k(n[0].sourceSpan.start));for(let t=0;t<n.length;t++){let i=n[t];i instanceof Vp?o.push(i):(e.push(i),n[t-1]instanceof yh&&o.push($k(n[t-1].sourceSpan.end)))}return n[n.length-1]instanceof yh&&o.push($k(n[n.length-1].sourceSpan.end)),{messageParts:o,placeHolders:e}}function $k(n){return new Vp("",new gn(n,n))}var bN="ngI18nClosureMode",$q="i18n_",Hq="I18N_EXP_",yN="\uFFFD",Uq="MSG_";function SN(n){return`${Uq}${n}`.toUpperCase()}function Wq(n){return new Hr(n.name,void 0,Wl,void 0,n.sourceSpan)}function Gq(n){let o=n.relativeContextFilePath.replace(/[^A-Za-z0-9]/g,"_").toUpperCase()+"_",e=new Map,t=new Map,i=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===qh.I18nAttribute){let h=i.get(u.target)??[];h.push(u),i.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:g}=l6(n,o,r,u);if(u.i18nBlock!==null){let y=n.addConst(h,g);c.set(u.i18nBlock,y)}else{n.constsInitializers.push(...g),a.set(u.i18nContext,h);let y=e.get(u.i18nContext);if(y!==void 0)for(let b of y)b.expression=h.clone()}}Ke.remove(u)}for(let p of n.units)for(let u of p.create)if(ym(u)){let h=t.get(u.xref);if(h===void 0)continue;let g=i.get(u.xref);if(g===void 0)throw new Error("AssertionError: Could not find any i18n expressions associated with an I18nAttributes instruction");let y=new Set;g=g.filter(x=>{let M=y.has(x.name);return y.add(x.name),!M});let b=g.flatMap(x=>{let M=a.get(x.context);if(M===void 0)throw new Error("AssertionError: Could not find i18n expression's value");return[Ee(x.name),M]});h.i18nAttributesConfig=n.addConst(new Pc(b))}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 l6(n,o,e,t){let i=[],r=new Map;for(let u of t.subMessages){let h=e.get(u),{mainVar:g,statements:y}=l6(n,o,e,h);i.push(...y);let b=r.get(h.messagePlaceholder)??[];b.push(g),r.set(h.messagePlaceholder,b)}qq(t,r),t.params=new Map([...t.params.entries()].sort());let a=Jn(n.pool.uniqueName($q)),c=Kq(n.pool,t.message.id,o,n.i18nUseExternalIds),p;if(t.needsPostprocessing||t.postprocessingParams.size>0){let u=Object.fromEntries([...t.postprocessingParams.entries()].sort()),h=LE(u,!1),g=[];t.postprocessingParams.size>0&&g.push(HT(h,!0)),p=y=>jt(fe.i18nPostprocess).callFn([y,...g])}return i.push(...Qq(t.message,a,c,t.params,p)),{mainVar:a,statements:i}}function qq(n,o){for(let[e,t]of o)t.length===1?n.params.set(e,t[0]):(n.params.set(e,Ee(`${yN}${Hq}${e}${yN}`)),n.postprocessingParams.set(e,Xi(t)))}function Qq(n,o,e,t,i){let r=Object.fromEntries(t),a=[Wq(o),px(Xq(),Fq(o,n,e,r),Vq(o,n,LE(r,!1)))];return i&&a.push(new pa(o.set(i(o)))),a}function Xq(){return p0(Jn(bN)).notIdentical(Ee("undefined",NE)).and(Jn(bN))}function Kq(n,o,e,t){let i,r=e;if(t){let a=SN("EXTERNAL_"),c=n.uniqueName(r);i=`${a}${Ap(o)}$$${c}`}else{let a=SN(r);i=n.uniqueName(a)}return Jn(i)}function Yq(n){for(let o of n.units){let e=null,t=null,i=new Map,r=new Map,a=new Map;for(let c of o.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(i.set(c.xref,e),r.set(c.xref,t),c.icuPlaceholder!==null){let p=wW(n.allocateXrefId(),c.icuPlaceholder,[c.initialValue]);Ke.replace(c,p),a.set(c.xref,p)}else Ke.remove(c);break}for(let c of o.update)switch(c.kind){case V.InterpolateText:if(!i.has(c.target))continue;let p=i.get(c.target),u=r.get(c.target),h=a.get(c.target),g=u?u.context:p.context,y=u?X_.Postproccessing:X_.Creation,b=[];for(let x=0;x<c.interpolation.expressions.length;x++){let M=c.interpolation.expressions[x];b.push(zF(g,p.xref,p.xref,p.handle,M,h?.xref??null,c.interpolation.i18nPlaceholders[x]??null,y,qh.I18nText,"",M.sourceSpan??c.sourceSpan))}Ke.replaceWithMany(c,b),h!==void 0&&(h.strings=c.interpolation.strings);break}}}function Zq(n){for(let o of n.units)for(let e of o.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=Jq(e.localRefs);e.localRefs=n.addConst(t)}else e.localRefs=null;break}}function Jq(n){let o=[];for(let e of n)o.push(Ee(e.name),Ee(e.target));return Xi(o)}function eQ(n){for(let o of n.units){let e=wr.HTML;for(let t of o.create)t.kind===V.ElementStart&&t.namespace!==e&&(Ke.insertBefore(gW(t.namespace),t),e=t.namespace)}}function tQ(n){let o=[],e=0,t=0,i=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:i===0?i=39:i===39&&n.charCodeAt(e-1)!==92&&(i=0);break;case 34:i===0?i=34:i===34&&n.charCodeAt(e-1)!==92&&(i=0);break;case 58:!c&&t===0&&i===0&&(c=c6(n.substring(a,e-1).trim()),r=e);break;case 59:if(c&&r>0&&t===0&&i===0){let u=n.substring(r,e-1).trim();o.push(c,u),a=e,r=0,c=null}break}if(c&&r){let p=n.slice(r).trim();o.push(c,p)}return o}function c6(n){return n.replace(/[a-z][A-Z]/g,o=>o.charAt(0)+"-"+o.charAt(1)).toLowerCase()}function nQ(n){let o=new Map;for(let e of n.units)for(let t of e.create)ym(t)&&o.set(t.xref,t);for(let e of n.units)for(let t of e.create)if(t.kind===V.ExtractedAttribute&&t.bindingKind===Ht.Attribute&&jF(t.expression)){let i=o.get(t.target);if(i!==void 0&&(i.kind===V.Template||i.kind===V.ConditionalCreate||i.kind===V.ConditionalBranchCreate)&&i.templateKind===ss.Structural)continue;if(t.name==="style"){let r=tQ(t.expression.value);for(let a=0;a<r.length-1;a+=2)Ke.insertBefore(al(t.target,Ht.StyleProperty,null,r[a],Ee(r[a+1]),null,null,fi.STYLE),t);Ke.remove(t)}else if(t.name==="class"){let r=t.expression.value.trim().split(/\s+/g);for(let a of r)Ke.insertBefore(al(t.target,Ht.ClassName,null,a,null,null,null,fi.NONE),t);Ke.remove(t)}}}function iQ(n){r_(n.root,n.componentName,{index:0})}function r_(n,o,e){n.fnName===null&&(n.fnName=n.job.pool.uniqueName(Ap(`${o}_${n.job.fnSuffix}`),!1));let t=new Map;for(let i of n.ops())switch(i.kind){case V.Property:case V.DomProperty:i.bindingKind===Ht.LegacyAnimation&&(i.name="@"+i.name);break;case V.Animation:if(i.handlerFnName===null){let u=i.name.replace(".","");i.handlerFnName=`${n.fnName}_${u}_cb`,i.handlerFnName=Ap(i.handlerFnName)}break;case V.AnimationListener:if(i.handlerFnName!==null)break;if(!i.hostListener&&i.targetSlot.slot===null)throw new Error("Expected a slot to be assigned");let r=i.name.replace(".","");i.hostListener?i.handlerFnName=`${o}_${r}_HostBindingHandler`:i.handlerFnName=`${n.fnName}_${i.tag.replace("-","_")}_${r}_${i.targetSlot.slot}_listener`,i.handlerFnName=Ap(i.handlerFnName);break;case V.Listener:if(i.handlerFnName!==null)break;if(!i.hostListener&&i.targetSlot.slot===null)throw new Error("Expected a slot to be assigned");let a="";i.isLegacyAnimationListener&&(i.name=`@${i.name}.${i.legacyAnimationPhase}`,a="animation"),i.hostListener?i.handlerFnName=`${o}_${a}${i.name}_HostBindingHandler`:i.handlerFnName=`${n.fnName}_${i.tag.replace("-","_")}_${a}${i.name}_${i.targetSlot.slot}_listener`,i.handlerFnName=Ap(i.handlerFnName);break;case V.TwoWayListener:if(i.handlerFnName!==null)break;if(i.targetSlot.slot===null)throw new Error("Expected a slot to be assigned");i.handlerFnName=Ap(`${n.fnName}_${i.tag.replace("-","_")}_${i.name}_${i.targetSlot.slot}_listener`);break;case V.Variable:t.set(i.xref,oQ(i.variable,e));break;case V.RepeaterCreate:if(!(n instanceof sl))throw new Error("AssertionError: must be compiling a component");if(i.handle.slot===null)throw new Error("Expected slot to be assigned");if(i.emptyView!==null){let u=n.job.views.get(i.emptyView);r_(u,`${o}_${i.functionNameSuffix}Empty_${i.handle.slot+2}`,e)}r_(n.job.views.get(i.xref),`${o}_${i.functionNameSuffix}_${i.handle.slot+1}`,e);break;case V.Projection:if(!(n instanceof sl))throw new Error("AssertionError: must be compiling a component");if(i.handle.slot===null)throw new Error("Expected slot to be assigned");if(i.fallbackView!==null){let u=n.job.views.get(i.fallbackView);r_(u,`${o}_ProjectionFallback_${i.handle.slot}`,e)}break;case V.ConditionalCreate:case V.ConditionalBranchCreate:case V.Template:if(!(n instanceof sl))throw new Error("AssertionError: must be compiling a component");let c=n.job.views.get(i.xref);if(i.handle.slot===null)throw new Error("Expected slot to be assigned");let p=i.functionNameSuffix.length===0?"":`_${i.functionNameSuffix}`;r_(c,`${o}${p}_${i.handle.slot}`,e);break;case V.StyleProp:i.name=wN(rQ(i.name));break;case V.ClassProp:i.name=wN(i.name);break}for(let i of n.ops())fr(i,r=>{if(!(!(r instanceof wd)||r.name!==null)){if(!t.has(r.xref))throw new Error(`Variable ${r.xref} not yet named`);r.name=t.get(r.xref)}})}function oQ(n,o){if(n.name===null)switch(n.kind){case Zr.Context:n.name=`ctx_r${o.index++}`;break;case Zr.Identifier:let e=n.identifier===Ls?"i":"";n.name=`${n.identifier}_${e}r${++o.index}`;break;default:n.name=`_r${++o.index}`;break}return n.name}function rQ(n){return n.startsWith("--")?n:c6(n)}function wN(n){let o=n.indexOf("!important");return o>-1?n.substring(0,o):n}function aQ(n){for(let o of n.units){for(let e of o.functions)Hk(e.ops);for(let e of o.create)(e.kind===V.Listener||e.kind===V.Animation||e.kind===V.AnimationListener||e.kind===V.TwoWayListener)&&Hk(e.handlerOps);Hk(o.update)}}function Hk(n){for(let o of n){if(o.kind!==V.Statement||!(o.statement instanceof pa)||!(o.statement.expr instanceof j1))continue;let e=o.statement.expr.steps,t=!0;for(let i=o.next;i.kind!==V.ListEnd&&t;i=i.next)fr(i,(r,a)=>{if(!Nc(r))return r;if(t&&!(a&Qn.InChildOperation))switch(r.kind){case Zt.NextContext:r.steps+=e,Ke.remove(o),t=!1;break;case Zt.GetCurrentView:case Zt.Reference:case Zt.ContextLetReference:t=!1;break}})}}var sQ="ng-container";function lQ(n){for(let o of n.units){let e=new Set;for(let t of o.create)t.kind===V.ElementStart&&t.tag===sQ&&(t.kind=V.ContainerStart,e.add(t.xref)),t.kind===V.ElementEnd&&e.has(t.xref)&&(t.kind=V.ContainerEnd)}}function cQ(n,o){let e=n.get(o);if(e===void 0)throw new Error("All attributes should have an element-like target.");return e}function dQ(n){let o=new Map;for(let e of n.units)for(let t of e.create)ym(t)&&o.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&&Ke.insertAfter(mW(t.xref),t),(t.kind===V.ElementEnd||t.kind===V.ContainerEnd)&&cQ(o,t.xref).nonBindable&&Ke.insertBefore(pW(t.xref),t)}function wc(n){return o=>o.kind===n}function d_(n,o){return e=>e.kind===n&&o===e.expression instanceof tr}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 pQ(n){return(n.kind===V.Property||n.kind===V.TwoWayProperty)&&!(n.expression instanceof tr)}var uQ=[{test:n=>n.kind===V.Listener&&n.hostListener&&n.isLegacyAnimationListener},{test:mQ}],hQ=[{test:wc(V.StyleMap),transform:ox},{test:wc(V.ClassMap),transform:ox},{test:wc(V.StyleProp)},{test:wc(V.ClassProp)},{test:d_(V.Attribute,!0)},{test:d_(V.Property,!0)},{test:pQ},{test:d_(V.Attribute,!1)},{test:wc(V.Control)}],fQ=[{test:d_(V.DomProperty,!0)},{test:d_(V.DomProperty,!1)},{test:wc(V.Attribute)},{test:wc(V.StyleMap),transform:ox},{test:wc(V.ClassMap),transform:ox},{test:wc(V.StyleProp)},{test:wc(V.ClassProp)}],MN=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 gQ(n){for(let o of n.units){kN(o.create,uQ);let e=o.job.kind===Ot.Host?fQ:hQ;kN(o.update,e)}}function kN(n,o){let e=[],t=null;for(let i of n){let r=K_(i)?i.target:null;(!MN.has(i.kind)||r!==t&&t!==null&&r!==null)&&(Ke.insertBefore(TN(e,o),i),e=[],t=null),MN.has(i.kind)&&(e.push(i),Ke.remove(i),t=r??t)}n.push(TN(e,o))}function TN(n,o){let e=Array.from(o,()=>new Array);for(let t of n){let i=o.findIndex(r=>r.test(t));e[i].push(t)}return e.flatMap((t,i)=>{let r=o[i].transform;return r?r(t):t})}function ox(n){return n.slice(n.length-1)}function _Q(n){for(let o of n.units){let e=KF(o);for(let t of o.ops())if(t.kind===V.Binding){let i=CQ(e,t.target);vQ(t.name)&&i.kind===V.Projection&&Ke.remove(t)}}}function vQ(n){return n.toLowerCase()==="select"}function CQ(n,o){let e=n.get(o);if(e===void 0)throw new Error("All attributes should have an slottable target.");return e}function xQ(n){for(let o of n.units)bQ(o)}function bQ(n){for(let o of n.update)fr(o,(e,t)=>{if(!Nc(e)||e.kind!==Zt.PipeBinding)return;if(t&Qn.InChildOperation)throw new Error("AssertionError: pipe bindings should not appear in child expressions");if(o.target==null)throw new Error("AssertionError: expected slot handle to be assigned for pipe creation");yQ(n,o.target,e)})}function yQ(n,o,e){for(let t=n.create.head.next;t.kind!==V.ListEnd;t=t.next){if(!Qh(t)||t.xref!==o)continue;for(;t.next.kind===V.Pipe;)t=t.next;let i=fW(e.target,e.targetSlot,e.name);Ke.insertBefore(i,t.next);return}throw new Error(`AssertionError: unable to find insertion point for pipe ${e.name}`)}function SQ(n){for(let o of n.units)for(let e of o.update)nr(e,t=>!(t instanceof ou)||t.args.length<=4?t:new e0(t.target,t.targetSlot,t.name,Xi(t.args),t.args.length),Qn.None)}function wQ(n){d6(n.root,0)}function d6(n,o){let e=null;for(let t of n.create)switch(t.kind){case V.I18nStart:t.subTemplateIndex=o===0?null:o,e=t;break;case V.I18nEnd:e.subTemplateIndex===null&&(o=0),e=null;break;case V.ConditionalCreate:case V.ConditionalBranchCreate:case V.Template:o=WC(n.job.views.get(t.xref),e,t.i18nPlaceholder,o);break;case V.RepeaterCreate:let i=n.job.views.get(t.xref);o=WC(i,e,t.i18nPlaceholder,o),t.emptyView!==null&&(o=WC(n.job.views.get(t.emptyView),e,t.emptyI18nPlaceholder,o));break;case V.Projection:t.fallbackView!==null&&(o=WC(n.job.views.get(t.fallbackView),e,t.fallbackViewI18nPlaceholder,o));break}return o}function WC(n,o,e,t){if(e!==void 0){if(o===null)throw Error("Expected template with i18n placeholder to be in an i18n block.");t++,MQ(n,o)}return d6(n,t)}function MQ(n,o){if(n.create.head.next?.kind!==V.I18nStart){let e=n.job.allocateXrefId();Ke.insertAfter(gx(e,o.message,o.root,null),n.create.head),Ke.insertBefore(_x(e,null),n.create.tail)}}function kQ(n){for(let o of n.units)for(let e of o.ops())fr(e,t=>{if(!(t instanceof iu)||t.body===null)return;let i=new cE(t.args.length);t.fn=n.pool.getSharedConstant(i,t.body),t.body=null})}var cE=class extends b_{numArgs;constructor(o){super(),this.numArgs=o}keyOf(o){return o instanceof xm?`param(${o.index})`:super.keyOf(o)}toSharedConstantDeclaration(o,e){let t=[];for(let r=0;r<this.numArgs;r++)t.push(new Mr("a"+r,ls));let i=zt(e,r=>r instanceof xm?Jn("a"+r.index):r,Qn.None);return new Hr(o,new su(t,i),void 0,ca.Final)}};function TQ(n){for(let o of n.units)for(let e of o.update)nr(e,(t,i)=>i&Qn.InChildOperation?t:t instanceof Pc?EQ(t):t instanceof Ql?DQ(t):t,Qn.None)}function EQ(n){let o=[],e=[];for(let t of n.entries){if(t instanceof Xp){if(t.expression.isConstant())o.push(t);else{let i=e.length;e.push(t.expression),o.push(new Xp(new xm(i)))}continue}if(t.isConstant())o.push(t);else{let i=e.length;e.push(t),o.push(new xm(i))}}return new iu(Xi(o),e)}function DQ(n){let o=[],e=[];for(let t of n.entries){if(t instanceof pm){if(t.expression.isConstant())o.push(t);else{let i=e.length;e.push(t.expression),o.push(new pm(new xm(i)))}continue}if(t.value.isConstant())o.push(t);else{let i=e.length;e.push(t.value),o.push(new Eh(t.key,new xm(i),t.quoted))}}return new iu(new Ql(o),e)}function PQ(n){for(let o of n.units)for(let e of o.ops())nr(e,t=>t instanceof Th&&(t.flags===null||!t.flags.includes("g"))?n.pool.getSharedConstant(new dE,t):t,Qn.None)}var dE=class extends b_{toSharedConstantDeclaration(o,e){return new Hr(o,e,void 0,ca.Final)}};function IQ(n,o,e,t,i){return Mm(fe.element,n,o,e,t,i)}function AQ(n,o,e,t,i){return Mm(fe.elementStart,n,o,e,t,i)}function Mm(n,o,e,t,i,r){let a=[Ee(o)];return e!==null&&a.push(Ee(e)),i!==null?a.push(Ee(t),Ee(i)):t!==null&&a.push(Ee(t)),An(n,a,r)}function m6(n,o,e,t,i,r,a,c,p){let u=[Ee(o),e,Ee(t),Ee(i),Ee(r),Ee(a)];for(c!==null&&(u.push(Ee(c)),u.push(jt(fe.templateRefExtractor)));u[u.length-1].isEquivalent(Dh);)u.pop();return An(n,u,p)}function qE(n,o,e,t,i){let r=[Ee(o)];return e instanceof tr?r.push(Xh(e,i)):r.push(e),t!==null&&r.push(t),An(n,r,i)}function OQ(n){return An(fe.elementEnd,[],n)}function NQ(n,o,e,t){return Mm(fe.elementContainerStart,n,null,o,e,t)}function FQ(n,o,e,t){return Mm(fe.elementContainer,n,null,o,e,t)}function RQ(){return An(fe.elementContainerEnd,[],null)}function LQ(n,o,e,t,i,r,a,c){return m6(fe.templateCreate,n,o,e,t,i,r,a,c)}function VQ(){return An(fe.disableBindings,[],null)}function BQ(){return An(fe.enableBindings,[],null)}function zQ(n,o,e,t,i){let r=[Ee(n),o];return e!==null&&r.push(jt(e)),An(t?fe.syntheticHostListener:fe.listener,r,i)}function EN(n,o){return jt(fe.twoWayBindingSet).callFn([n,o])}function jQ(n,o,e){return An(fe.twoWayListener,[Ee(n),o],e)}function $Q(n,o){return An(fe.pipe,[Ee(n),Ee(o)],null)}function HQ(){return An(fe.namespaceHTML,[],null)}function UQ(){return An(fe.namespaceSVG,[],null)}function WQ(){return An(fe.namespaceMathML,[],null)}function GQ(n,o){return An(fe.advance,n>1?[Ee(n)]:[],o)}function qQ(n){return jt(fe.reference).callFn([Ee(n)])}function QQ(n){return jt(fe.nextContext).callFn(n===1?[]:[Ee(n)])}function XQ(){return jt(fe.getCurrentView).callFn([])}function KQ(n){return jt(fe.restoreView).callFn([n])}function YQ(n){return jt(fe.resetView).callFn([n])}function ZQ(n,o,e){let t=[Ee(n,null)];return o!==""&&t.push(Ee(o)),An(fe.text,t,e)}function JQ(n,o,e,t,i,r,a,c,p,u,h){let g=[Ee(n),Ee(o),e??Ee(null),Ee(t),Ee(i),Ee(r),a??Ee(null),c??Ee(null),p?jt(fe.deferEnableTimerScheduling):Ee(null),Ee(h)],y;for(;(y=g[g.length-1])!==null&&y instanceof ma&&y.value===null;)g.pop();return An(fe.defer,g,u)}var eX=new Map([[to.Idle,{none:fe.deferOnIdle,prefetch:fe.deferPrefetchOnIdle,hydrate:fe.deferHydrateOnIdle}],[to.Immediate,{none:fe.deferOnImmediate,prefetch:fe.deferPrefetchOnImmediate,hydrate:fe.deferHydrateOnImmediate}],[to.Timer,{none:fe.deferOnTimer,prefetch:fe.deferPrefetchOnTimer,hydrate:fe.deferHydrateOnTimer}],[to.Hover,{none:fe.deferOnHover,prefetch:fe.deferPrefetchOnHover,hydrate:fe.deferHydrateOnHover}],[to.Interaction,{none:fe.deferOnInteraction,prefetch:fe.deferPrefetchOnInteraction,hydrate:fe.deferHydrateOnInteraction}],[to.Viewport,{none:fe.deferOnViewport,prefetch:fe.deferPrefetchOnViewport,hydrate:fe.deferHydrateOnViewport}],[to.Never,{none:fe.deferHydrateNever,prefetch:fe.deferHydrateNever,hydrate:fe.deferHydrateNever}]]);function tX(n,o,e,t){let i=eX.get(n)?.[e];if(i===void 0)throw new Error(`Unable to determine instruction for trigger ${n}`);return An(i,o,t)}function nX(n){return An(fe.projectionDef,n?[n]:[],null)}function iX(n,o,e,t,i,r,a){let c=[Ee(n)];return(o!==0||e!==null||t!==null)&&(c.push(Ee(o)),e!==null&&c.push(e),t!==null&&(e===null&&c.push(Ee(null)),c.push(Jn(t),Ee(i),Ee(r)))),An(fe.projection,c,a)}function oX(n,o,e,t){let i=[Ee(n),Ee(o)];return e!==null&&i.push(Ee(e)),An(fe.i18nStart,i,t)}function rX(n,o,e,t,i,r,a,c){let p=[Ee(n),o,Ee(e),Ee(t),Ee(i),Ee(r)];for(a!==null&&(p.push(Ee(a)),p.push(jt(fe.templateRefExtractor)));p[p.length-1].isEquivalent(Dh);)p.pop();return An(fe.conditionalCreate,p,c)}function aX(n,o,e,t,i,r,a,c){let p=[Ee(n),o,Ee(e),Ee(t),Ee(i),Ee(r)];for(a!==null&&(p.push(Ee(a)),p.push(jt(fe.templateRefExtractor)));p[p.length-1].isEquivalent(Dh);)p.pop();return An(fe.conditionalBranchCreate,p,c)}function sX(n,o,e,t,i,r,a,c,p,u,h,g,y,b){let x=[Ee(n),Jn(o),Ee(e),Ee(t),Ee(i),Ee(r),a];return(c||p!==null)&&(x.push(Ee(c)),p!==null&&(x.push(Jn(p),Ee(u),Ee(h)),(g!==null||y!==null)&&x.push(Ee(g)),y!==null&&x.push(Ee(y)))),An(fe.repeaterCreate,x,b)}function lX(n,o){return An(fe.repeater,[n],o)}function cX(n,o,e){return n==="prefetch"?An(fe.deferPrefetchWhen,[o],e):n==="hydrate"?An(fe.deferHydrateWhen,[o],e):An(fe.deferWhen,[o],e)}function dX(n,o){return An(fe.declareLet,[Ee(n)],o)}function mX(n,o){return jt(fe.storeLet).callFn([n],o)}function pX(n){return jt(fe.readContextLet).callFn([Ee(n)])}function uX(n,o,e,t){let i=[Ee(n),Ee(o)];return e&&i.push(Ee(e)),An(fe.i18n,i,t)}function hX(n){return An(fe.i18nEnd,[],n)}function fX(n,o){let e=[Ee(n),Ee(o)];return An(fe.i18nAttributes,e,null)}function gX(n,o,e){return qE(fe.ariaProperty,n,o,null,e)}function _X(n,o,e,t){return qE(fe.property,n,o,e,t)}function vX(n){return An(fe.control,[],n)}function CX(n){return An(fe.controlCreate,[],n)}function xX(n,o,e,t){let i=[Ee(n),o];return e!==null&&i.push(e),An(fe.twoWayProperty,i,t)}function bX(n,o,e,t,i){let r=[Ee(n)];return o instanceof tr?r.push(Xh(o,i)):r.push(o),(e!==null||t!==null)&&r.push(e??Ee(null)),t!==null&&r.push(Ee(t)),An(fe.attribute,r,null)}function yX(n,o,e,t){let i=[Ee(n)];return o instanceof tr?i.push(Xh(o,t)):i.push(o),e!==null&&i.push(Ee(e)),An(fe.styleProp,i,t)}function SX(n,o,e){return An(fe.classProp,[Ee(n),o],e)}function wX(n,o){let e=n instanceof tr?Xh(n,o):n;return An(fe.styleMap,[e],o)}function MX(n,o){let e=n instanceof tr?Xh(n,o):n;return An(fe.classMap,[e],o)}function kX(n,o,e,t,i){return Mm(fe.domElement,n,o,e,t,i)}function TX(n,o,e,t,i){return Mm(fe.domElementStart,n,o,e,t,i)}function EX(n){return An(fe.domElementEnd,[],n)}function DX(n,o,e,t){return Mm(fe.domElementContainerStart,n,null,o,e,t)}function PX(n,o,e,t){return Mm(fe.domElementContainer,n,null,o,e,t)}function IX(){return An(fe.domElementContainerEnd,[],null)}function AX(n,o,e,t){let i=[Ee(n),o];return e!==null&&i.push(jt(e)),An(fe.domListener,i,t)}function OX(n,o,e,t,i,r,a,c){return m6(fe.domTemplate,n,o,e,t,i,r,a,c)}var DN=[fe.pipeBind1,fe.pipeBind2,fe.pipeBind3,fe.pipeBind4];function NX(n,o,e){if(e.length<1||e.length>DN.length)throw new Error("pipeBind() argument count out of bounds");let t=DN[e.length-1];return jt(t).callFn([Ee(n),Ee(o),...e])}function FX(n,o,e){return jt(fe.pipeBindV).callFn([Ee(n),Ee(o),e])}function RX(n,o,e){let t=p6(n,o);return YX(QX,[],t,e)}function LX(n,o){return An(fe.i18nExp,[n],o)}function VX(n,o){return An(fe.i18nApply,[Ee(n)],o)}function BX(n,o,e,t){return qE(fe.domProperty,n,o,e,t)}function zX(n,o,e,t){let i=[o];e!==null&&i.push(e);let r=n==="enter"?fe.animationEnter:fe.animationLeave;return An(r,i,t)}function jX(n,o,e,t){let r=[o instanceof tr?Xh(o,t):o];e!==null&&r.push(e);let a=n==="enter"?fe.animationEnter:fe.animationLeave;return An(a,r,t)}function $X(n,o,e,t){let i=[o],r=n==="enter"?fe.animationEnterListener:fe.animationLeaveListener;return An(r,i,t)}function HX(n,o,e){return An(fe.syntheticHostProperty,[Ee(n),o],e)}function UX(n,o,e){return QE(KX,[Ee(n),o],e,null)}function WX(n,o){return An(fe.attachSourceLocations,[Ee(n),o],null)}function GX(n,o,e){return jt(fe.arrowFunction).callFn([Ee(n),o,e])}function p6(n,o){if(n.length<1||o.length!==n.length-1)throw new Error("AssertionError: expected specific shape of args for strings/expressions in interpolation");let e=[];if(o.length===1&&n[0]===""&&n[1]==="")e.push(o[0]);else{let t;for(t=0;t<o.length;t++)e.push(Ee(n[t]),o[t]);e.push(Ee(n[t]))}return e}function Xh(n,o){let e=p6(n.strings,n.expressions);return QE(XX,[],e,o)}function An(n,o,e){let t=jt(n).callFn(o,e);return Vs(new pa(t,e))}function qX(n,o,e){let t=[n];return o!==null&&t.push(o),An(fe.conditional,t,e)}var QX={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}},XX={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}},KX={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 QE(n,o,e,t){let i=n.mapping(e.length),r=e.at(-1);if(e.length>1&&r instanceof ma&&r.value===""&&e.pop(),i<n.constant.length)return jt(n.constant[i]).callFn([...o,...e],t);if(n.variable!==null)return jt(n.variable).callFn([...o,Xi(e)],t);throw new Error("AssertionError: unable to call variadic function")}function YX(n,o,e,t){return Vs(QE(n,o,e,t).toStmt())}var ZX=new Map([["window",fe.resolveWindow],["document",fe.resolveDocument],["body",fe.resolveBody]]),JX=new Map([["class","className"],["for","htmlFor"],["formaction","formAction"],["innerHtml","innerHTML"],["readonly","readOnly"],["tabindex","tabIndex"]]);function eK(n){for(let o of n.units)tK(o,o.create),xx(o,o.update)}function tK(n,o){for(let e of o)switch(nr(e,t=>u6(n,t),Qn.None),e.kind){case V.Text:Ke.replace(e,ZQ(e.handle.slot,e.initialValue,e.sourceSpan));break;case V.ElementStart:Ke.replace(e,n.job.mode===is.DomOnly?TX(e.handle.slot,e.tag,e.attributes,e.localRefs,e.startSourceSpan):AQ(e.handle.slot,e.tag,e.attributes,e.localRefs,e.startSourceSpan));break;case V.Element:Ke.replace(e,n.job.mode===is.DomOnly?kX(e.handle.slot,e.tag,e.attributes,e.localRefs,e.wholeSourceSpan):IQ(e.handle.slot,e.tag,e.attributes,e.localRefs,e.wholeSourceSpan));break;case V.ElementEnd:Ke.replace(e,n.job.mode===is.DomOnly?EX(e.sourceSpan):OQ(e.sourceSpan));break;case V.ContainerStart:Ke.replace(e,n.job.mode===is.DomOnly?DX(e.handle.slot,e.attributes,e.localRefs,e.startSourceSpan):NQ(e.handle.slot,e.attributes,e.localRefs,e.startSourceSpan));break;case V.Container:Ke.replace(e,n.job.mode===is.DomOnly?PX(e.handle.slot,e.attributes,e.localRefs,e.wholeSourceSpan):FQ(e.handle.slot,e.attributes,e.localRefs,e.wholeSourceSpan));break;case V.ContainerEnd:Ke.replace(e,n.job.mode===is.DomOnly?IX():RQ());break;case V.I18nStart:Ke.replace(e,oX(e.handle.slot,e.messageIndex,e.subTemplateIndex,e.sourceSpan));break;case V.I18nEnd:Ke.replace(e,hX(e.sourceSpan));break;case V.I18n:Ke.replace(e,uX(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");Ke.replace(e,fX(e.handle.slot,e.i18nAttributesConfig));break;case V.Template:if(!(n instanceof sl))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);Ke.replace(e,e.templateKind===ss.Block||n.job.mode===is.DomOnly?OX(e.handle.slot,Jn(t.fnName),t.decls,t.vars,e.tag,e.attributes,e.localRefs,e.startSourceSpan):LQ(e.handle.slot,Jn(t.fnName),t.decls,t.vars,e.tag,e.attributes,e.localRefs,e.startSourceSpan));break;case V.DisableBindings:Ke.replace(e,VQ());break;case V.EnableBindings:Ke.replace(e,BQ());break;case V.Pipe:Ke.replace(e,$Q(e.handle.slot,e.name));break;case V.DeclareLet:Ke.replace(e,dX(e.handle.slot,e.sourceSpan));break;case V.AnimationString:Ke.replace(e,jX(e.animationKind,e.expression,e.sanitizer,e.sourceSpan));break;case V.Animation:let i=GC(n,e.handlerFnName,e.handlerOps,!1);Ke.replace(e,zX(e.animationKind,i,e.sanitizer,e.sourceSpan));break;case V.AnimationListener:let r=GC(n,e.handlerFnName,e.handlerOps,e.consumesDollarEvent);Ke.replace(e,$X(e.animationKind,r,null,e.sourceSpan));break;case V.Listener:let a=GC(n,e.handlerFnName,e.handlerOps,e.consumesDollarEvent),c=e.eventTarget?ZX.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.`);Ke.replace(e,n.job.mode===is.DomOnly&&!e.hostListener&&!e.isLegacyAnimationListener?AX(e.name,a,c,e.sourceSpan):zQ(e.name,a,c,e.hostListener&&e.isLegacyAnimationListener,e.sourceSpan));break;case V.TwoWayListener:Ke.replace(e,jQ(e.name,GC(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}`);Ke.replace(e,Vs(new Hr(e.variable.name,e.initializer,void 0,ca.Final)));break;case V.Namespace:switch(e.active){case wr.HTML:Ke.replace(e,HQ());break;case wr.SVG:Ke.replace(e,UQ());break;case wr.Math:Ke.replace(e,WQ());break}break;case V.Defer:let p=!!e.loadingMinimumTime||!!e.loadingAfterTime||!!e.placeholderMinimumTime;Ke.replace(e,JQ(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 to.Never:case to.Idle:case to.Immediate:break;case to.Timer:u=[Ee(e.trigger.delay)];break;case to.Viewport:e.modifier==="hydrate"?u=e.trigger.options?[e.trigger.options]:[]:(u=[Ee(e.trigger.targetSlot?.slot??null)],e.trigger.targetSlotViewSteps!==0?u.push(Ee(e.trigger.targetSlotViewSteps)):e.trigger.options&&u.push(Ee(null)),e.trigger.options&&u.push(e.trigger.options));break;case to.Interaction:case to.Hover:e.modifier==="hydrate"?u=[]:(u=[Ee(e.trigger.targetSlot?.slot??null)],e.trigger.targetSlotViewSteps!==0&&u.push(Ee(e.trigger.targetSlotViewSteps)));break;default:throw new Error(`AssertionError: Unsupported reification of defer trigger kind ${e.trigger.kind}`)}Ke.replace(e,tX(e.trigger.kind,u,e.modifier,e.sourceSpan));break;case V.ProjectionDef:Ke.replace(e,nX(e.def));break;case V.Projection:if(e.handle.slot===null)throw new Error("No slot was assigned for project instruction");let h=null,g=null,y=null;if(e.fallbackView!==null){if(!(n instanceof sl))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,g=D.decls,y=D.vars}Ke.replace(e,iX(e.handle.slot,e.projectionSlotIndex,e.attributes,h,g,y,e.sourceSpan));break;case V.ConditionalCreate:if(!(n instanceof sl))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);Ke.replace(e,rX(e.handle.slot,Jn(b.fnName),b.decls,b.vars,e.tag,e.attributes,e.localRefs,e.startSourceSpan));break;case V.ConditionalBranchCreate:if(!(n instanceof sl))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);Ke.replace(e,aX(e.handle.slot,Jn(x.fnName),x.decls,x.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 sl))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,S=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,S=D.decls,E=D.vars}Ke.replace(e,sX(e.handle.slot,M.fnName,e.decls,e.vars,e.tag,e.attributes,oK(n,e),e.usesComponentInstance,w,S,E,e.emptyTag,e.emptyAttributes,e.wholeSourceSpan));break;case V.SourceLocation:let O=Xi(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 Xi([Ee(D.slot),Ee(N),Ee(P),Ee(L)])}));Ke.replace(e,WX(e.templatePath,O));break;case V.ControlCreate:Ke.replace(e,CX(e.sourceSpan));break;case V.Statement:break;default:throw new Error(`AssertionError: Unsupported reification of create op ${V[e.kind]}`)}}function xx(n,o){for(let e of o)switch(nr(e,t=>u6(n,t),Qn.None),e.kind){case V.Advance:Ke.replace(e,GQ(e.delta,e.sourceSpan));break;case V.Property:Ke.replace(e,n.job.mode===is.DomOnly&&e.bindingKind!==Ht.LegacyAnimation&&e.bindingKind!==Ht.Animation?PN(e):nK(e));break;case V.Control:Ke.replace(e,iK(e));break;case V.TwoWayProperty:Ke.replace(e,xX(e.name,e.expression,e.sanitizer,e.sourceSpan));break;case V.StyleProp:Ke.replace(e,yX(e.name,e.expression,e.unit,e.sourceSpan));break;case V.ClassProp:Ke.replace(e,SX(e.name,e.expression,e.sourceSpan));break;case V.StyleMap:Ke.replace(e,wX(e.expression,e.sourceSpan));break;case V.ClassMap:Ke.replace(e,MX(e.expression,e.sourceSpan));break;case V.I18nExpression:Ke.replace(e,LX(e.expression,e.sourceSpan));break;case V.I18nApply:Ke.replace(e,VX(e.handle.slot,e.sourceSpan));break;case V.InterpolateText:Ke.replace(e,RX(e.interpolation.strings,e.interpolation.expressions,e.sourceSpan));break;case V.Attribute:Ke.replace(e,bX(e.name,e.expression,e.sanitizer,e.namespace,e.sourceSpan));break;case V.DomProperty:if(e.expression instanceof tr)throw new Error("not yet handled");e.bindingKind===Ht.LegacyAnimation||e.bindingKind===Ht.Animation?Ke.replace(e,HX(e.name,e.expression,e.sourceSpan)):Ke.replace(e,PN(e));break;case V.Variable:if(e.variable.name===null)throw new Error(`AssertionError: unnamed variable ${e.xref}`);Ke.replace(e,Vs(new Hr(e.variable.name,e.initializer,void 0,ca.Final)));break;case V.Conditional:if(e.processed===null)throw new Error("Conditional test was not set.");Ke.replace(e,qX(e.processed,e.contextValue,e.sourceSpan));break;case V.Repeater:Ke.replace(e,lX(e.collection,e.sourceSpan));break;case V.DeferWhen:Ke.replace(e,cX(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 PN(n){return BX(JX.get(n.name)??n.name,n.expression,n.sanitizer,n.sourceSpan)}function nK(n){return YF(n.name)?gX(n.name,n.expression,n.sourceSpan):_X(n.name,n.expression,n.sanitizer,n.sourceSpan)}function iK(n){return vX(n.sourceSpan)}function u6(n,o){if(!Nc(o))return o;switch(o.kind){case Zt.NextContext:return QQ(o.steps);case Zt.Reference:return qQ(o.targetSlot.slot+1+o.offset);case Zt.LexicalRead:throw new Error(`AssertionError: unresolved LexicalRead of ${o.name}`);case Zt.TwoWayBindingSet:throw new Error("AssertionError: unresolved TwoWayBindingSet");case Zt.RestoreView:if(typeof o.view=="number")throw new Error("AssertionError: unresolved RestoreView");return KQ(o.view);case Zt.ResetView:return YQ(o.expr);case Zt.GetCurrentView:return XQ();case Zt.ReadVariable:if(o.name===null)throw new Error(`Read of unnamed variable ${o.xref}`);return Jn(o.name);case Zt.ReadTemporaryExpr:if(o.name===null)throw new Error(`Read of unnamed temporary ${o.xref}`);return Jn(o.name);case Zt.AssignTemporaryExpr:if(o.name===null)throw new Error(`Assign of unnamed temporary ${o.xref}`);return Jn(o.name).set(o.expr);case Zt.PureFunctionExpr:if(o.fn===null)throw new Error("AssertionError: expected PureFunctions to have been extracted");return UX(o.varOffset,o.fn,o.args);case Zt.PureFunctionParameterExpr:throw new Error("AssertionError: expected PureFunctionParameterExpr to have been extracted");case Zt.PipeBinding:return NX(o.targetSlot.slot,o.varOffset,o.args);case Zt.PipeBindingVariadic:return FX(o.targetSlot.slot,o.varOffset,o.args);case Zt.SlotLiteralExpr:return Ee(o.slot.slot);case Zt.ContextLetReference:return pX(o.targetSlot.slot);case Zt.StoreLet:return mX(o.value,o.sourceSpan);case Zt.TrackContext:return Jn("this");case Zt.ArrowFunction:if(o.varOffset===null)throw new Error("AssertionError: variable offset was not assigned to arrow function");return GX(o.varOffset,n.job.pool.getSharedFunctionReference(rK(n,o),"arrowFn"),Jn(Ls));default:throw new Error(`AssertionError: Unsupported reification of ir.Expression kind: ${Zt[o.kind]}`)}}function GC(n,o,e,t){xx(n,e);let i=[];for(let a of e){if(a.kind!==V.Statement)throw new Error(`AssertionError: expected reified statements, but found op ${V[a.kind]}`);i.push(a.statement)}let r=[];return t&&r.push(new Mr("$event",ls)),um(r,i,void 0,void 0,o)}function oK(n,o){if(o.trackByFn!==null)return o.trackByFn;let e=[new Mr("$index",Gp),new Mr("$item",ls)],t;if(o.trackByOps===null)t=o.usesComponentInstance?um(e,[new kr(o.track)]):Rs(e,o.track);else{xx(n,o.trackByOps);let i=[];for(let r of o.trackByOps){if(r.kind!==V.Statement)throw new Error(`AssertionError: expected reified statements, but found op ${V[r.kind]}`);i.push(r.statement)}t=o.usesComponentInstance||i.length!==1||!(i[0]instanceof kr)?um(e,i):Rs(e,i[0].value)}return o.trackByFn=n.job.pool.getSharedFunctionReference(t,"_forTrack"),o.trackByFn}function rK(n,o){xx(n,o.ops);let e=[];for(let i of o.ops){if(i.kind!==V.Statement)throw new Error(`AssertionError: expected reified statements, but found op ${V[i.kind]}`);e.push(i.statement)}let t=e.length===1&&e[0]instanceof kr?e[0].value:e;return Rs([new Mr(o.contextName,ls),new Mr(o.currentViewName,ls)],Rs(o.parameters,t))}function aK(n){for(let o of n.units)for(let e of o.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 t0&&Ke.remove(e);break}}function sK(n){for(let o of n.units)for(let e of o.create)switch(e.kind){case V.I18nContext:Ke.remove(e);break;case V.I18nStart:e.context=null;break}}function lK(n){for(let o of n.units)for(let e of o.update){if(e.kind!==V.Variable||e.variable.kind!==Zr.Identifier||!(e.initializer instanceof Y_))continue;let t=e.variable.identifier,i=e;for(;i&&i.kind!==V.ListEnd;)nr(i,r=>r instanceof Kr&&r.name===t?Ee(void 0):r,Qn.None),i=i.prev}}function cK(n){for(let o of n.units){let e=new Set;for(let t of o.update)t.kind===V.I18nExpression&&e.add(t.i18nOwner);for(let t of o.create)switch(t.kind){case V.I18nAttributes:if(e.has(t.xref))continue;Ke.remove(t)}}}function dK(n){for(let o of n.units){for(let e of o.functions)m_(o,e.ops);m_(o,o.create),m_(o,o.update)}}function m_(n,o){let e=new Map;e.set(n.xref,Jn(Ls));for(let t of o)switch(t.kind){case V.Variable:t.variable.kind===Zr.Context&&e.set(t.variable.view,new wd(t.xref));break;case V.Animation:case V.AnimationListener:case V.Listener:case V.TwoWayListener:m_(n,t.handlerOps);break;case V.RepeaterCreate:t.trackByOps!==null&&m_(n,t.trackByOps);break}n===n.job.root&&e.set(n.xref,Jn(Ls));for(let t of o)nr(t,i=>{if(i instanceof Cm){if(!e.has(i.view))throw new Error(`No context found for reference to view ${i.view} from view ${n.xref}`);return e.get(i.view)}else return i},Qn.None)}function mK(n){for(let o of n.units)for(let e of o.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=o.fnName?.replace("_Template","");e.resolverFn=n.pool.getSharedFunctionReference(e.ownResolverFn,`${t}_Defer_${e.handle.slot}_DepsFn`,!1)}}}function pK(n){for(let o of n.units)IN(o.create),IN(o.update)}function IN(n){for(let o of n)(o.kind===V.Listener||o.kind===V.TwoWayListener||o.kind===V.AnimationListener)&&nr(o,e=>e instanceof Kr&&e.name==="$event"?((o.kind===V.Listener||o.kind===V.AnimationListener)&&(o.consumesDollarEvent=!0),new Gl(e.name)):e,Qn.InChildOperation)}function uK(n){let o=new Map,e=new Map;for(let t of n.units)for(let i of t.create)switch(i.kind){case V.I18nContext:o.set(i.xref,i);break;case V.ElementStart:e.set(i.xref,i);break}xc(n,n.root,o,e)}function xc(n,o,e,t,i){let r=null,a=new Map;for(let c of o.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");AN(c,r.i18nContext,r.i18nBlock,i),i&&c.i18nPlaceholder.closeName&&a.set(c.xref,i),i=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");ON(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");AN(c,r.i18nContext,r.i18nBlock,i),ON(c,r.i18nContext,r.i18nBlock,i),i=void 0}if(c.fallbackView!==null){let y=n.views.get(c.fallbackView);if(c.fallbackViewI18nPlaceholder===void 0)xc(n,y,e,t);else{if(r===null)throw Error("i18n tag placeholder should only occur inside an i18n block");qC(n,y,c.handle.slot,c.fallbackViewI18nPlaceholder,r.i18nContext,r.i18nBlock,i),xc(n,y,e,t),QC(n,y,c.handle.slot,c.fallbackViewI18nPlaceholder,r.i18nContext,r.i18nBlock,i),i=void 0}}break;case V.ConditionalCreate:case V.ConditionalBranchCreate:case V.Template:let u=n.views.get(c.xref);if(c.i18nPlaceholder===void 0)xc(n,u,e,t);else{if(r===null)throw Error("i18n tag placeholder should only occur inside an i18n block");c.templateKind===ss.Structural?xc(n,u,e,t,c):(qC(n,u,c.handle.slot,c.i18nPlaceholder,r.i18nContext,r.i18nBlock,i),xc(n,u,e,t),QC(n,u,c.handle.slot,c.i18nPlaceholder,r.i18nContext,r.i18nBlock,i),i=void 0)}break;case V.RepeaterCreate:if(i!==void 0)throw Error("AssertionError: Unexpected structural directive associated with @for block");let h=c.handle.slot+1,g=n.views.get(c.xref);if(c.i18nPlaceholder===void 0)xc(n,g,e,t);else{if(r===null)throw Error("i18n tag placeholder should only occur inside an i18n block");qC(n,g,h,c.i18nPlaceholder,r.i18nContext,r.i18nBlock,i),xc(n,g,e,t),QC(n,g,h,c.i18nPlaceholder,r.i18nContext,r.i18nBlock,i),i=void 0}if(c.emptyView!==null){let y=c.handle.slot+2,b=n.views.get(c.emptyView);if(c.emptyI18nPlaceholder===void 0)xc(n,b,e,t);else{if(r===null)throw Error("i18n tag placeholder should only occur inside an i18n block");qC(n,b,y,c.emptyI18nPlaceholder,r.i18nContext,r.i18nBlock,i),xc(n,b,e,t),QC(n,b,y,c.emptyI18nPlaceholder,r.i18nContext,r.i18nBlock,i),i=void 0}}break}}function AN(n,o,e,t){let{startName:i,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),Uh(o.params,i,c,e.subTemplateIndex,a)}function ON(n,o,e,t){let{closeName:i}=n.i18nPlaceholder;if(i){let r=ao.ElementTag|ao.CloseTag,a=n.handle.slot;t!==void 0&&(r|=ao.TemplateTag,a={element:a,template:t.handle.slot}),Uh(o.params,i,a,e.subTemplateIndex,r)}}function qC(n,o,e,t,i,r,a){let{startName:c,closeName:p}=t,u=ao.TemplateTag|ao.OpenTag;p||(u|=ao.CloseTag),a!==void 0&&Uh(i.params,c,a.handle.slot,r.subTemplateIndex,u),Uh(i.params,c,e,h6(n,r,o),u)}function QC(n,o,e,t,i,r,a){let{closeName:c}=t,p=ao.TemplateTag|ao.CloseTag;c&&(Uh(i.params,c,e,h6(n,r,o),p),a!==void 0&&Uh(i.params,c,a.handle.slot,r.subTemplateIndex,p))}function h6(n,o,e){for(let t of e.create)if(t.kind===V.I18nStart)return t.subTemplateIndex;return o.subTemplateIndex}function Uh(n,o,e,t,i){let r=n.get(o)??[];r.push({value:e,subTemplateIndex:t,flags:i}),n.set(o,r)}function hK(n){let o=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:o.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 i=new Map,r=a=>a.usage===qh.I18nText?a.i18nOwner:a.context;for(let a of n.units)for(let c of a.update)if(c.kind===V.I18nExpression){let p=i.get(r(c))||0,u=o.get(c.i18nOwner)??null,h={value:p,subTemplateIndex:u,flags:ao.ExpressionIndex};fK(c,h,e,t),i.set(r(c),p+1)}}function fK(n,o,e,t){if(n.i18nPlaceholder!==null){let i=e.get(n.context),r=n.resolutionTime===X_.Creation?i.params:i.postprocessingParams,a=r.get(n.i18nPlaceholder)||[];a.push(o),r.set(n.i18nPlaceholder,a)}n.icuPlaceholder!==null&&t.get(n.icuPlaceholder)?.expressionPlaceholders.push(o)}function gK(n){let o=new Map;for(let e of n.units)for(let t of e.ops())if(t.kind===V.ElementStart||t.kind===V.Template){let i=t.tag??"";switch(t.namespace){case wr.SVG:i=`:${vx}:${i}`;break;case wr.Math:i=`:${Cx}:${i}`;break}o.set(t.xref,i)}for(let e of n.units)for(let t of e.create)if(t.kind===V.ExtractedAttribute&&t.i18nContext!==null&&t.expression!==null){let i=o.get(t.target)??"",r=t.expression;switch(t.securityContext){case fi.HTML:r=jt(fe.sanitizeHtml).callFn([r]);break;case fi.STYLE:r=jt(fe.sanitizeStyle).callFn([r]);break;case fi.SCRIPT:r=jt(fe.sanitizeScript).callFn([r]);break;case fi.URL:r=jt(fe.sanitizeUrl).callFn([r]);break;case fi.RESOURCE_URL:r=jt(fe.sanitizeResourceUrl).callFn([r]);break;case fi.ATTRIBUTE_NO_BINDING:r=jt(fe.validateAttribute).callFn([r,Ee(i),Ee(t.name)]);break}t.expression=r}}function _K(n){for(let o of n.units){for(let e of o.functions)p_(o,e.ops,null);p_(o,o.create,null),p_(o,o.update,null)}}function p_(n,o,e){let t=new Map,i=new Map;for(let r of o)switch(r.kind){case V.Variable:switch(r.variable.kind){case Zr.Identifier:if(r.variable.local){if(i.has(r.variable.identifier))continue;i.set(r.variable.identifier,r.xref)}else if(t.has(r.variable.identifier))continue;t.set(r.variable.identifier,r.xref);break;case Zr.Alias:if(t.has(r.variable.identifier))continue;t.set(r.variable.identifier,r.xref);break;case Zr.SavedView:e={view:r.variable.view,variable:r.xref};break}break;case V.Animation:case V.AnimationListener:case V.Listener:case V.TwoWayListener:p_(n,r.handlerOps,e);break;case V.RepeaterCreate:r.trackByOps!==null&&p_(n,r.trackByOps,e);break}for(let r of o)r.kind===V.Listener||r.kind===V.TwoWayListener||r.kind===V.Animation||r.kind===V.AnimationListener||nr(r,a=>{if(a instanceof Kr)return i.has(a.name)?new wd(i.get(a.name)):t.has(a.name)?new wd(t.get(a.name)):new Fs(new Cm(n.job.root.xref),a.name);if(a instanceof J_&&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 wd(e.variable),a}else return a},Qn.None);for(let r of o)fr(r,a=>{if(a instanceof Kr)throw new Error(`AssertionError: no lexical reads should remain, but found read of ${a.name}`)})}var vK=new Map([[fi.HTML,fe.sanitizeHtml],[fi.RESOURCE_URL,fe.sanitizeResourceUrl],[fi.SCRIPT,fe.sanitizeScript],[fi.STYLE,fe.sanitizeStyle],[fi.URL,fe.sanitizeUrl],[fi.ATTRIBUTE_NO_BINDING,fe.validateAttribute]]),CK=new Map([[fi.HTML,fe.trustConstantHtml],[fi.RESOURCE_URL,fe.trustConstantResourceUrl]]);function xK(n){for(let o of n.units){if(n.kind!==Ot.Host){for(let e of o.create)if(e.kind===V.ExtractedAttribute){let t=CK.get(NN(e.securityContext))??null;e.trustedValueFn=t!==null?jt(t):null}}for(let e of o.update)switch(e.kind){case V.Property:case V.Attribute:case V.DomProperty:case V.TwoWayProperty:let t=null;Array.isArray(e.securityContext)&&e.securityContext.length===2&&e.securityContext.includes(fi.URL)&&e.securityContext.includes(fi.RESOURCE_URL)?t=fe.sanitizeUrlOrResourceUrl:t=vK.get(NN(e.securityContext))??null,e.sanitizer=t!==null?jt(t):null;break}}}function NN(n){if(Array.isArray(n)){if(n.length>1)throw Error("AssertionError: Ambiguous security context");return n[0]||fi.NONE}return n}function bK(n){for(let o of n.units){for(let e of o.functions)FN(n,o,e.ops)&&RN(o,e.ops,Jn(e.currentViewName));o.create.prepend([lm(o.job.allocateXrefId(),{kind:Zr.SavedView,name:null,view:o.xref},new VT,rl.None)]);for(let e of o.create)(e.kind===V.Listener||e.kind===V.TwoWayListener||e.kind===V.Animation||e.kind===V.AnimationListener)&&FN(n,o,e.handlerOps)&&RN(o,e.handlerOps,o.xref)}}function FN(n,o,e){let t=o!==n.root;if(!t)for(let i of e)fr(i,r=>{(r instanceof z1||r instanceof Z_)&&(t=!0)});return t}function RN(n,o,e){o.prepend([lm(n.job.allocateXrefId(),{kind:Zr.Context,name:null,view:n.xref},new J_(e),rl.None)]);for(let t of o)t.kind===V.Statement&&t.statement instanceof kr&&(t.statement.value=new $1(t.statement.value))}function yK(n){let o=new Map;for(let e of n.units){let t=0;for(let i of e.create)Qh(i)&&(i.handle.slot=t,o.set(i.xref,i.handle.slot),t+=i.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 i=n.views.get(t.xref);t.decls=i.decls}}function SK(n){let o=new Set,e=new Map;for(let t of n.units)for(let i of t.ops())i.kind===V.DeclareLet&&e.set(i.xref,i),fr(i,r=>{r instanceof Z_&&o.add(r.target)});for(let t of n.units)for(let i of t.update)nr(i,r=>r instanceof Y_&&!o.has(r.target)?(wK(r)||Ke.remove(e.get(r.target)),r.value):r,Qn.None)}function wK(n){let o=!1;return zt(n,e=>((e instanceof ou||e instanceof e0)&&(o=!0),e),Qn.None),o}function MK(n){let o=new Set;for(let e of n.units)for(let t of e.ops())fr(t,i=>{if(i instanceof vi)switch(i.operator){case st.Exponentiation:kK(i,o);break;case st.NullishCoalesce:TK(i,o);break;case st.And:case st.Or:EK(i,o)}});for(let e of n.units)for(let t of e.ops())nr(t,i=>i instanceof ql?o.has(i)?i:i.expr:i,Qn.None)}function kK(n,o){n.lhs instanceof ql&&n.lhs.expr instanceof Qp&&o.add(n.lhs)}function TK(n,o){n.lhs instanceof ql&&(LN(n.lhs.expr)||n.lhs.expr instanceof Dc)&&o.add(n.lhs),n.rhs instanceof ql&&(LN(n.rhs.expr)||n.rhs.expr instanceof Dc)&&o.add(n.rhs)}function EK(n,o){n.lhs instanceof ql&&n.lhs.expr instanceof vi&&n.lhs.expr.operator===st.NullishCoalesce&&o.add(n.lhs)}function LN(n){return n instanceof vi&&(n.operator===st.And||n.operator===st.Or)}function DK(n){for(let o of n.units)for(let e of o.update)if(e.kind===V.Binding)switch(e.bindingKind){case Ht.ClassName:if(e.expression instanceof tr)throw new Error("Unexpected interpolation in ClassName binding");Ke.replace(e,ZU(e.target,e.name,e.expression,e.sourceSpan));break;case Ht.StyleProperty:Ke.replace(e,YU(e.target,e.name,e.expression,e.unit,e.sourceSpan));break;case Ht.Property:case Ht.Template:e.name==="style"?Ke.replace(e,JU(e.target,e.expression,e.sourceSpan)):e.name==="class"&&Ke.replace(e,eW(e.target,e.expression,e.sourceSpan));break}}function PK(n){for(let o of n.units){o.create.prepend(u_(o.create)),o.update.prepend(u_(o.update));for(let e of o.functions)e.ops.prepend(u_(e.ops))}}function u_(n){let o=0,e=[];for(let t of n){let i=new Map;fr(t,(u,h)=>{h&Qn.InChildOperation||u instanceof bm&&i.set(u.xref,u)});let r=0,a=new Set,c=new Set,p=new Map;fr(t,(u,h)=>{h&Qn.InChildOperation||(u instanceof Fc?(a.has(u.xref)||(a.add(u.xref),p.set(u.xref,`tmp_${o}_${r++}`)),VN(p,u)):u instanceof bm&&(i.get(u.xref)===u&&(c.add(u.xref),r--),VN(p,u)))}),e.push(...Array.from(new Set(p.values())).map(u=>Vs(new Hr(u)))),o++,t.kind===V.Listener||t.kind===V.Animation||t.kind===V.AnimationListener||t.kind===V.TwoWayListener?t.handlerOps.prepend(u_(t.handlerOps)):t.kind===V.RepeaterCreate&&t.trackByOps!==null&&t.trackByOps.prepend(u_(t.trackByOps))}return e}function VN(n,o){let e=n.get(o.xref);if(e===void 0)throw new Error(`Found xref with unassigned name: ${o.xref}`);o.name=e}function IK(n){for(let o of n.units)for(let e of o.create)if(e.kind===V.RepeaterCreate)if(e.track instanceof Gl&&e.track.name==="$index")e.trackByFn=jt(fe.repeaterTrackByIndex);else if(e.track instanceof Gl&&e.track.name==="$item")e.trackByFn=jt(fe.repeaterTrackByIdentity);else if(AK(n.root.xref,e.track))e.usesComponentInstance=!0,e.track.receiver.receiver.view===o.xref?e.trackByFn=e.track.receiver:(e.trackByFn=jt(fe.componentInstance).callFn([]).prop(e.track.receiver.name),e.track=e.trackByFn);else{e.track=zt(e.track,i=>{if(i instanceof ou||i instanceof e0)throw new Error("Illegal State: Pipes are not allowed in this context");return i instanceof Cm?(e.usesComponentInstance=!0,new LT(i.view)):i},Qn.None);let t=new Ke;t.push(Vs(new kr(e.track,e.track.sourceSpan))),e.trackByOps=t}}function AK(n,o){if(!(o instanceof cs)||o.args.length===0||o.args.length>2||!(o.receiver instanceof Fs&&o.receiver.receiver instanceof Cm)||o.receiver.receiver.view!==n)return!1;let[e,t]=o.args;return!(e instanceof Gl)||e.name!=="$index"?!1:o.args.length===1?!0:!(!(t instanceof Gl)||t.name!=="$item")}function OK(n){for(let o of n.units)for(let e of o.create)e.kind===V.RepeaterCreate&&(e.track=zt(e.track,t=>{if(t instanceof Kr){if(e.varNames.$index.has(t.name))return Jn("$index");if(t.name===e.varNames.$implicit)return Jn("$item")}return t},Qn.None))}function NK(n){for(let o of n.units)for(let e of o.create)e.kind===V.TwoWayListener&&nr(e,t=>{if(!(t instanceof H1))return t;let{target:i,value:r}=t;if(i instanceof Fs||i instanceof Md)return EN(i,r).or(i.set(r));if(i instanceof wd)return EN(i,r);throw new Error("Unsupported expression in two-way action binding.")},Qn.InChildOperation)}function FK(n){for(let o of n.units){let e=0;for(let r of o.ops())Vk(r)&&(e+=RK(r));let t=r=>{Nc(r)&&(r instanceof iu||(W5(r)&&(r.varOffset=e),Vk(r)&&(e+=BN(r))))},i=r=>{!Nc(r)||!(r instanceof iu)||(W5(r)&&(r.varOffset=e),Vk(r)&&(e+=BN(r)))};for(let r of o.create)fr(r,t);for(let r of o.update)fr(r,t);for(let r of o.create)fr(r,i);for(let r of o.update)fr(r,i);o.vars=e}if(n instanceof i0)for(let o of n.units)for(let e of o.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 RK(n){let o;switch(n.kind){case V.Attribute:return o=1,n.expression instanceof tr&&!LK(n.expression)&&(o+=n.expression.expressions.length),o;case V.Property:case V.DomProperty:return o=1,n.expression instanceof tr&&(o+=n.expression.expressions.length),o;case V.Control:return 2;case V.TwoWayProperty:return 1;case V.StyleProp:case V.ClassProp:case V.StyleMap:case V.ClassMap:return o=2,n.expression instanceof tr&&(o+=n.expression.expressions.length),o;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 BN(n){switch(n.kind){case Zt.PureFunctionExpr:return 1+n.args.length;case Zt.PipeBinding:return 1+n.args.length;case Zt.PipeBindingVariadic:return 1+n.numArgs;case Zt.StoreLet:case Zt.ArrowFunction:return 1;default:throw new Error(`AssertionError: unhandled ConsumesVarsTrait expression ${n.constructor.name}`)}}function LK(n){return!(n.expressions.length!==1||n.strings.length!==2||n.strings[0]!==""||n.strings[1]!=="")}function VK(n){for(let o of n.units){for(let e of o.functions)Yg(e.ops);Yg(o.create),Yg(o.update);for(let e of o.create)e.kind===V.Listener||e.kind===V.Animation||e.kind===V.AnimationListener||e.kind===V.TwoWayListener?Yg(e.handlerOps):e.kind===V.RepeaterCreate&&e.trackByOps!==null&&Yg(e.trackByOps);for(let e of o.functions)Zg(e.ops,null),zN(e.ops);for(let e of o.create)e.kind===V.Listener||e.kind===V.Animation||e.kind===V.AnimationListener||e.kind===V.TwoWayListener?(Zg(e.handlerOps,XC),zN(e.handlerOps)):e.kind===V.RepeaterCreate&&e.trackByOps!==null&&Zg(e.trackByOps,XC);Zg(o.create,XC),Zg(o.update,XC)}}var $r=(function(n){return n[n.None=0]="None",n[n.ViewContextRead=1]="ViewContextRead",n[n.ViewContextWrite=2]="ViewContextWrite",n[n.SideEffectful=4]="SideEffectful",n})($r||{});function XC(n){return!(n&Qn.InArrowFunctionOperation)}function Yg(n){let o=new Map;for(let e of n)e.kind===V.Variable&&e.flags&rl.AlwaysInline&&(fr(e,t=>{if(Nc(t)&&XE(t)!==$r.None)throw new Error("AssertionError: A context-sensitive variable was marked AlwaysInline")}),o.set(e.xref,e)),nr(e,t=>t instanceof wd&&o.has(t.xref)?o.get(t.xref).initializer.clone():t,Qn.None);for(let e of o.values())Ke.remove(e)}function Zg(n,o){let e=new Map,t=new Map,i=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,BK(u,o)),zK(u,t,i,o)}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&$r.ViewContextWrite||h.fences&$r.SideEffectful){let g=Vs(u.initializer.toStmt());r.set(g,h),Ke.replace(u,g)}else jK(u,t),Ke.remove(u);r.delete(u),e.delete(u.xref),t.delete(u.xref);continue}h.fences&$r.ViewContextRead&&(a=!0)}let c=[];for(let[u,h]of t){let y=!!(e.get(u).flags&rl.AlwaysInline);h!==1||y||i.has(u)||c.push(u)}let p;for(;p=c.pop();){let u=e.get(p),h=r.get(u);if(!!(u.flags&rl.AlwaysInline))throw new Error("AssertionError: Found an 'AlwaysInline' variable after the always inlining pass.");for(let y=u.next;y.kind!==V.ListEnd;y=y.next){let b=r.get(y);if(b.variablesUsed.has(p)){if(!HK(u,y))break;if($K(p,u.initializer,y,h.fences)){b.variablesUsed.delete(p);for(let x of h.variablesUsed)b.variablesUsed.add(x);b.fences|=h.fences,e.delete(p),t.delete(p),r.delete(u),Ke.remove(u)}break}if(!f6(b.fences,h.fences))break}}}function XE(n){switch(n.kind){case Zt.NextContext:return $r.ViewContextRead|$r.ViewContextWrite;case Zt.RestoreView:return $r.ViewContextRead|$r.ViewContextWrite|$r.SideEffectful;case Zt.StoreLet:return $r.SideEffectful;case Zt.Reference:case Zt.ContextLetReference:return $r.ViewContextRead;default:return $r.None}}function BK(n,o){let e=$r.None,t=new Set;return fr(n,(i,r)=>{!Nc(i)||o!==null&&!o(r)||(i.kind===Zt.ReadVariable?t.add(i.xref):e|=XE(i))}),{fences:e,variablesUsed:t}}function zK(n,o,e,t){fr(n,(i,r)=>{if(!Nc(i)||t!==null&&!t(r)||i.kind!==Zt.ReadVariable)return;let a=o.get(i.xref);a!==void 0&&(o.set(i.xref,a+1),r&Qn.InChildOperation&&e.add(i.xref))})}function jK(n,o){fr(n,e=>{if(!Nc(e)||e.kind!==Zt.ReadVariable)return;let t=o.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`);o.set(e.xref,t-1)}})}function f6(n,o){if(n&$r.ViewContextWrite){if(o&$r.ViewContextRead)return!1}else if(n&$r.ViewContextRead&&o&$r.ViewContextWrite)return!1;return!0}function $K(n,o,e,t){let i=!1,r=!0;return nr(e,(a,c)=>{if(!Nc(a)||i||!r)return a;if(c&Qn.InChildOperation&&t&$r.ViewContextRead)return a;switch(a.kind){case Zt.ReadVariable:if(a.xref===n)return i=!0,o;break;default:let p=XE(a);r=r&&f6(p,t);break}return a},Qn.None),i}function HK(n,o){switch(n.variable.kind){case Zr.Identifier:return n.initializer instanceof Gl&&n.initializer.name===Ls;case Zr.Context:return o.kind===V.Variable;default:return!0}}function zN(n){let o=n.head.next,e=n.tail.prev;o!==null&&e!==null&&o.next===e&&o.kind===V.Statement&&o.statement instanceof pa&&o.statement.expr instanceof J_&&e.kind===V.Statement&&e.statement instanceof kr&&e.statement.value instanceof $1&&(Ke.remove(o),e.statement.value=e.statement.value.expr)}function UK(n){for(let o of n.units){let e=null,t=null;for(let i of o.create)switch(i.kind){case V.I18nStart:e=i;break;case V.I18nEnd:e=null;break;case V.IcuStart:e===null&&(t=n.allocateXrefId(),Ke.insertBefore(gx(t,i.message,void 0,null),i));break;case V.IcuEnd:t!==null&&(Ke.insertAfter(_x(t,null),i),t=null);break}}}function WK(n){for(let o of n.units){for(let e of o.create)e.kind!==V.Animation&&e.kind!==V.AnimationListener&&e.kind!==V.Listener&&e.kind!==V.TwoWayListener&&jN(o,e);for(let e of o.update)jN(o,e)}}function jN(n,o){nr(o,(e,t)=>{if(!(e instanceof su)||t&Qn.InChildOperation)return e;if(Array.isArray(e.body))throw new Error("AssertionError: unexpected multi-line arrow function");let i=new BT(e.params,e.body);return n.functions.add(i),i},Qn.None)}var GK=new Set(["formField"]);function qK(n){for(let o of n.units)QK(o)}function QK(n){for(let o of n.update)o.kind===V.Property&&GK.has(o.name)&&ZK(n,o)}var XK=new Set([V.Container,V.ContainerStart,V.ContainerEnd,V.Element,V.ElementStart,V.ElementEnd,V.Template]);function KK(n){return XK.has(n.kind)}function YK(n,o){let e=null;for(let t of n.create)!KK(t)||t.xref!==o||(e=t);return e}function ZK(n,o){let e=YK(n,o.target);if(e===null)throw new Error(`No create instruction found for control target ${o.target}`);let t=kW(o.sourceSpan);Ke.insertAfter(t,e),Ke.insertAfter(aW(o.target,o.sourceSpan),o)}var JK=[{kind:Ot.Tmpl,fn:_Q},{kind:Ot.Both,fn:PQ},{kind:Ot.Host,fn:PG},{kind:Ot.Tmpl,fn:eQ},{kind:Ot.Tmpl,fn:wQ},{kind:Ot.Tmpl,fn:UK},{kind:Ot.Both,fn:ZW},{kind:Ot.Both,fn:DK},{kind:Ot.Both,fn:LW},{kind:Ot.Tmpl,fn:qK},{kind:Ot.Both,fn:QW},{kind:Ot.Both,fn:NW},{kind:Ot.Tmpl,fn:YW},{kind:Ot.Both,fn:nQ},{kind:Ot.Tmpl,fn:aK},{kind:Ot.Both,fn:zW},{kind:Ot.Both,fn:gQ},{kind:Ot.Tmpl,fn:jW},{kind:Ot.Tmpl,fn:xQ},{kind:Ot.Tmpl,fn:JW},{kind:Ot.Tmpl,fn:SQ},{kind:Ot.Both,fn:WK},{kind:Ot.Both,fn:TQ},{kind:Ot.Tmpl,fn:kG},{kind:Ot.Tmpl,fn:MG},{kind:Ot.Tmpl,fn:TG},{kind:Ot.Tmpl,fn:bK},{kind:Ot.Both,fn:EW},{kind:Ot.Both,fn:pK},{kind:Ot.Tmpl,fn:OK},{kind:Ot.Tmpl,fn:lK},{kind:Ot.Both,fn:_K},{kind:Ot.Tmpl,fn:eG},{kind:Ot.Tmpl,fn:NK},{kind:Ot.Tmpl,fn:IK},{kind:Ot.Both,fn:dK},{kind:Ot.Both,fn:xK},{kind:Ot.Tmpl,fn:Zq},{kind:Ot.Both,fn:rG},{kind:Ot.Both,fn:MK},{kind:Ot.Both,fn:PK},{kind:Ot.Both,fn:VK},{kind:Ot.Both,fn:SK},{kind:Ot.Tmpl,fn:Yq},{kind:Ot.Tmpl,fn:KW},{kind:Ot.Tmpl,fn:cK},{kind:Ot.Tmpl,fn:AW},{kind:Ot.Tmpl,fn:PW},{kind:Ot.Tmpl,fn:yK},{kind:Ot.Tmpl,fn:uK},{kind:Ot.Tmpl,fn:hK},{kind:Ot.Tmpl,fn:xG},{kind:Ot.Tmpl,fn:Gq},{kind:Ot.Tmpl,fn:gK},{kind:Ot.Tmpl,fn:EG},{kind:Ot.Both,fn:WW},{kind:Ot.Tmpl,fn:sK},{kind:Ot.Both,fn:FK},{kind:Ot.Tmpl,fn:wG},{kind:Ot.Both,fn:iQ},{kind:Ot.Tmpl,fn:mK},{kind:Ot.Tmpl,fn:aQ},{kind:Ot.Tmpl,fn:lQ},{kind:Ot.Tmpl,fn:oG},{kind:Ot.Tmpl,fn:OW},{kind:Ot.Tmpl,fn:dQ},{kind:Ot.Both,fn:kQ},{kind:Ot.Both,fn:eK},{kind:Ot.Both,fn:BW}];function g6(n,o){for(let e of JK)(e.kind===o||e.kind===Ot.Both)&&e.fn(n)}function eY(n,o){let e=v6(n.root);return _6(n.root,o),e}function _6(n,o){for(let e of n.job.units){if(e.parent!==n.xref)continue;_6(e,o);let t=v6(e);o.statements.push(t.toDeclStmt(t.name))}}function v6(n){if(n.fnName===null)throw new Error(`AssertionError: view ${n.xref} is unnamed`);let o=[];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]}`);o.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=rx(1,o),i=rx(2,e);return um([new Mr(Wh,Gp),new Mr(Ls,ls)],[...t,...i],void 0,void 0,n.fnName)}function rx(n,o){return o.length===0?[]:[px(new vi(st.BitwiseAnd,Jn(Wh),Ee(n)),o)]}function tY(n){if(n.root.fnName===null)throw new Error("AssertionError: host binding function is unnamed");let o=[];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]}`);o.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(o.length===0&&e.length===0)return null;let t=rx(1,o),i=rx(2,e);return um([new Mr(Wh,Gp),new Mr(Ls,ls)],[...t,...i],void 0,void 0,n.root.fnName)}var Up=new Hh,Wp="ng-template",nY="animate.";function i1(n){return n instanceof Ha}function iY(n){return i1(n)&&n.nodes.length===1&&n.nodes[0]instanceof O1}function oY(n,o,e,t,i,r,a,c,p,u){let h=new i0(n,e,t,i,r,a,c,p,u);return Td(h.root,o),h}function rY(n,o,e){let t=new X1(n.componentName,e,is.DomOnly);for(let i of n.properties??[]){let r=Ht.Property;i.name.startsWith("attr.")&&(i.name=i.name.substring(5),r=Ht.Attribute),i.isLegacyAnimation&&(r=Ht.LegacyAnimation),i.isAnimation&&(r=Ht.Animation);let a=o.calcPossibleSecurityContexts(n.componentSelector,i.name,r===Ht.Attribute).filter(c=>c!==fi.NONE);aY(t,i,r,a)}for(let[i,r]of Object.entries(n.attributes)??[]){let a=o.calcPossibleSecurityContexts(n.componentSelector,i,!0).filter(c=>c!==fi.NONE);sY(t,i,r,a)}for(let i of n.events??[])lY(t,i);return t}function aY(n,o,e,t){let i,r=o.expression.ast;r instanceof u0?i=new tr(r.strings,r.expressions.map(a=>zn(a,n,o.sourceSpan)),[]):i=zn(r,n,o.sourceSpan),n.root.update.push(nu(n.root.xref,e,o.name,i,null,t,!1,!1,null,null,o.sourceSpan))}function sY(n,o,e,t){let i=nu(n.root.xref,Ht.Attribute,o,e,null,t,!0,!1,null,null,e.sourceSpan);n.root.update.push(i)}function lY(n,o){let e;if(o.type===$a.Animation)e=GF(n.root.xref,new ua,o.name,null,l0(n.root,o.handler,o.handlerSpan),o.name.endsWith("enter")?"enter":"leave",o.targetOrPhase,!0,o.sourceSpan);else{let[t,i]=o.type!==$a.LegacyAnimation?[null,o.targetOrPhase]:[o.targetOrPhase,null];e=GE(n.root.xref,new ua,o.name,null,l0(n.root,o.handler,o.handlerSpan),t,i,!0,o.sourceSpan)}n.root.create.push(e)}function Td(n,o){for(let e of o)if(e instanceof Ac)cY(n,e);else if(e instanceof Os)dY(n,e);else if(e instanceof Rh)mY(n,e);else if(e instanceof Rp)C6(n,e,null);else if(e instanceof Oh)x6(n,e,null);else if(e instanceof I1)pY(n,e);else if(e instanceof P1)uY(n,e);else if(e instanceof eu)hY(n,e);else if(e instanceof _F)gY(n,e);else if(e instanceof Fh)_Y(n,e);else if(e instanceof RE)CY(n,e);else if(!(e instanceof s_))throw new Error(`Unsupported template node: ${e.constructor.name}`)}function cY(n,o){if(o.i18n!==void 0&&!(o.i18n instanceof Ha||o.i18n instanceof fm))throw Error(`Unhandled i18n metadata type for element: ${o.i18n.constructor.name}`);let e=n.job.allocateXrefId(),[t,i]=Sa(o.name),r=lW(i,e,ZF(t),o.i18n instanceof fm?o.i18n:void 0,o.startSourceSpan,o.sourceSpan);n.create.push(r),bY(n,r,o),S6(r,o);let a=null;o.i18n instanceof Ha&&(a=n.job.allocateXrefId(),n.create.push(gx(a,o.i18n,void 0,o.startSourceSpan))),Td(n,o.children);let c=dW(e,o.endSourceSpan??o.startSourceSpan);n.create.push(c),a!==null&&Ke.insertBefore(_x(a,o.endSourceSpan??o.startSourceSpan),c)}function dY(n,o){if(o.i18n!==void 0&&!(o.i18n instanceof Ha||o.i18n instanceof fm))throw Error(`Unhandled i18n metadata type for template: ${o.i18n.constructor.name}`);let e=n.job.allocateView(n.xref),t=o.tagName,i="";o.tagName&&([i,t]=Sa(o.tagName));let r=o.i18n instanceof fm?o.i18n:void 0,a=ZF(i),c=t===null?"":UW(t,a),p=xY(o)?ss.NgTemplate:ss.Structural,u=$F(e.xref,p,t,c,a,r,o.startSourceSpan,o.sourceSpan);n.create.push(u),yY(n,u,o,p),S6(u,o),Td(e,o.children);for(let{name:h,value:g}of o.variables)e.contextVariables.set(h,g!==""?g:"$implicit");if(p===ss.NgTemplate&&o.i18n instanceof Ha){let h=n.job.allocateXrefId();Ke.insertAfter(gx(h,o.i18n,void 0,o.startSourceSpan),e.create.head),Ke.insertBefore(_x(h,o.endSourceSpan??o.startSourceSpan),e.create.tail)}}function mY(n,o){if(o.i18n!==void 0&&!(o.i18n instanceof fm))throw Error(`Unhandled i18n metadata type for element: ${o.i18n.constructor.name}`);let e=null;o.children.some(r=>!(r instanceof hx)&&(!(r instanceof Rp)||r.value.trim().length>0))&&(e=n.job.allocateView(n.xref),Td(e,o.children));let t=n.job.allocateXrefId(),i=vW(t,o.selector,o.i18n,e?.xref??null,o.sourceSpan);for(let r of o.attributes){let a=Up.securityContext(o.name,r.name,!0);n.update.push(nu(i.xref,Ht.Attribute,r.name,Ee(r.value),null,a,!0,!1,null,yd(r.i18n),r.sourceSpan))}n.create.push(i)}function C6(n,o,e){n.create.push(WF(n.job.allocateXrefId(),o.value,e,o.sourceSpan))}function x6(n,o,e){let t=o.value;if(t instanceof as&&(t=t.ast),!(t instanceof u0))throw new Error(`AssertionError: expected Interpolation for BoundText node, got ${t.constructor.name}`);if(o.i18n!==void 0&&!(o.i18n instanceof Sd))throw Error(`Unhandled i18n metadata type for text interpolation: ${o.i18n?.constructor.name}`);let i=o.i18n instanceof Sd?o.i18n.children.filter(a=>a instanceof H_).map(a=>a.name):[];if(i.length>0&&i.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(WF(r,"",e,o.sourceSpan)),n.update.push(QU(r,new tr(t.strings,t.expressions.map(a=>zn(a,n.job,null)),i),o.sourceSpan))}function pY(n,o){let e=null,t=[];for(let i=0;i<o.branches.length;i++){let r=o.branches[i],a=n.job.allocateView(n.xref),c=ax(n,a.xref,r);r.expressionAlias!==null&&a.contextVariables.set(r.expressionAlias.name,XF);let p;if(r.i18n!==void 0){if(!(r.i18n instanceof gm))throw Error(`Unhandled i18n metadata type for if block: ${r.i18n?.constructor.name}`);p=r.i18n}let h=(i===0?HF:UF)(a.xref,ss.Block,c,"Conditional",wr.HTML,p,r.startSourceSpan,r.sourceSpan);n.create.push(h),e===null&&(e=a.xref);let g=r.expression?zn(r.expression,n.job,null):null,y=new W1(g,h.xref,h.handle,r.expressionAlias);t.push(y),Td(a,r.children)}n.update.push(BF(e,null,t,o.sourceSpan))}function uY(n,o){if(o.groups.length===0)return;let e=null,t=[];for(let i=0;i<o.groups.length;i++){let r=o.groups[i],a=n.job.allocateView(n.xref),c=ax(n,a.xref,r),p;if(r.i18n!==void 0){if(!(r.i18n instanceof gm))throw Error(`Unhandled i18n metadata type for switch block: ${r.i18n?.constructor.name}`);p=r.i18n}let h=(i===0?HF:UF)(a.xref,ss.Block,c,"Case",wr.HTML,p,r.startSourceSpan,r.sourceSpan);n.create.push(h),e===null&&(e=a.xref);for(let g of r.cases){let y=g.expression?zn(g.expression,n.job,o.startSourceSpan):null,b=new W1(y,h.xref,h.handle);t.push(b)}Td(a,r.children)}n.update.push(BF(e,zn(o.expression,n.job,null),t,o.sourceSpan))}function KC(n,o,e,t,i){if(e!==void 0&&!(e instanceof gm))throw Error("Unhandled i18n metadata type for defer block");if(t===void 0)return null;let r=n.job.allocateView(n.xref);Td(r,t);let a=$F(r.xref,ss.Block,null,`Defer${o}`,wr.HTML,e,i,i);return n.create.push(a),a}function hY(n,o){let e=null;if(n.job.deferMeta.mode===0){if(!n.job.deferMeta.blocks.has(o))throw new Error("AssertionError: unable to find a dependency function for this deferred block");e=n.job.deferMeta.blocks.get(o)??null}let t=KC(n,"",o.i18n,o.children,o.sourceSpan),i=KC(n,"Loading",o.loading?.i18n,o.loading?.children,o.loading?.sourceSpan),r=KC(n,"Placeholder",o.placeholder?.i18n,o.placeholder?.children,o.placeholder?.sourceSpan),a=KC(n,"Error",o.error?.i18n,o.error?.children,o.error?.sourceSpan),c=n.job.allocateXrefId(),p=CW(c,t.xref,t.handle,e,n.job.allDeferrableDepsFn,o.sourceSpan);p.placeholderView=r?.xref??null,p.placeholderSlot=r?.handle??null,p.loadingSlot=i?.handle??null,p.errorSlot=a?.handle??null,p.placeholderMinimumTime=o.placeholder?.minimumTime??null,p.loadingMinimumTime=o.loading?.minimumTime??null,p.loadingAfterTime=o.loading?.afterTime??null,p.flags=fY(o),n.create.push(p);let u=[],h=[];Uk("hydrate",o.hydrateTriggers,u,h,n,c),Uk("none",o.triggers,u,h,n,c),Uk("prefetch",o.prefetchTriggers,u,h,n,c),u.some(y=>y.modifier==="none")||h.some(y=>y.modifier==="none")||u.push(rm(c,{kind:to.Idle},"none",null)),n.create.push(u),n.update.push(h)}function fY(n){return Object.keys(n.hydrateTriggers).length>0?1:null}function Uk(n,o,e,t,i,r){if(o.idle!==void 0){let a=rm(r,{kind:to.Idle},n,o.idle.sourceSpan);e.push(a)}if(o.immediate!==void 0){let a=rm(r,{kind:to.Immediate},n,o.immediate.sourceSpan);e.push(a)}if(o.timer!==void 0){let a=rm(r,{kind:to.Timer,delay:o.timer.delay},n,o.timer.sourceSpan);e.push(a)}if(o.hover!==void 0){let a=rm(r,{kind:to.Hover,targetName:o.hover.reference,targetXref:null,targetSlot:null,targetView:null,targetSlotViewSteps:null},n,o.hover.sourceSpan);e.push(a)}if(o.interaction!==void 0){let a=rm(r,{kind:to.Interaction,targetName:o.interaction.reference,targetXref:null,targetSlot:null,targetView:null,targetSlotViewSteps:null},n,o.interaction.sourceSpan);e.push(a)}if(o.viewport!==void 0){let a=rm(r,{kind:to.Viewport,targetName:o.viewport.reference,targetXref:null,targetSlot:null,targetView:null,targetSlotViewSteps:null,options:o.viewport.options?zn(o.viewport.options,i.job,o.viewport.sourceSpan):null},n,o.viewport.sourceSpan);e.push(a)}if(o.never!==void 0){let a=rm(r,{kind:to.Never},n,o.never.sourceSpan);e.push(a)}if(o.when!==void 0){if(o.when.value instanceof u0)throw new Error("Unexpected interpolation in defer block when trigger");let a=iW(r,zn(o.when.value,i.job,o.when.sourceSpan),n,o.when.sourceSpan);t.push(a)}}function gY(n,o){if(o.i18n instanceof Ha&&iY(o.i18n)){let e=n.job.allocateXrefId();n.create.push(yW(e,o.i18n,xF(o.i18n).name,null));for(let[t,i]of Object.entries(Z(Z({},o.vars),o.placeholders)))i instanceof Oh?x6(n,i,t):C6(n,i,t);n.create.push(SW(e))}else throw Error(`Unhandled i18n metadata type for ICU: ${o.i18n?.constructor.name}`)}function _Y(n,o){let e=n.job.allocateView(n.xref),t=`\u0275$index_${e.xref}`,i=`\u0275$count_${e.xref}`,r=new Set;e.contextVariables.set(o.item.name,o.item.value);for(let S of o.contextVariables)S.value==="$index"&&r.add(S.name),S.name==="$index"?e.contextVariables.set("$index",S.value).set(t,S.value):S.name==="$count"?e.contextVariables.set("$count",S.value).set(i,S.value):e.aliases.add({kind:Zr.Alias,name:null,identifier:S.name,expression:vY(S,t,i)});let a=zr(o.trackBy.span,o.sourceSpan),c=zn(o.trackBy,n.job,a);Td(e,o.children);let p=null,u=null;o.empty!==null&&(p=n.job.allocateView(n.xref),Td(p,o.empty.children),u=ax(n,p.xref,o.empty));let h={$index:r,$implicit:o.item.name};if(o.i18n!==void 0&&!(o.i18n instanceof gm))throw Error("AssertionError: Unhandled i18n metadata type or @for");if(o.empty?.i18n!==void 0&&!(o.empty.i18n instanceof gm))throw Error("AssertionError: Unhandled i18n metadata type or @empty");let g=o.i18n,y=o.empty?.i18n,b=ax(n,e.xref,o),x=cW(e.xref,p?.xref??null,b,c,h,u,g,y,o.startSourceSpan,o.sourceSpan);n.create.push(x);let M=zn(o.expression,n.job,zr(o.expression.span,o.sourceSpan)),w=nW(x.xref,x.handle,M,o.sourceSpan);n.update.push(w)}function vY(n,o,e){switch(n.value){case"$index":return new Kr(o);case"$count":return new Kr(e);case"$first":return new Kr(o).identical(Ee(0));case"$last":return new Kr(o).identical(new Kr(e).minus(Ee(1)));case"$even":return new Kr(o).modulo(Ee(2)).identical(Ee(0));case"$odd":return new Kr(o).modulo(Ee(2)).notIdentical(Ee(0));default:throw new Error(`AssertionError: unknown @for loop variable ${n.value}`)}}function CY(n,o){let e=n.job.allocateXrefId();n.create.push(xW(e,o.name,o.sourceSpan)),n.update.push(rW(e,o.name,zn(o.value,n.job,o.valueSpan),o.sourceSpan))}function zn(n,o,e){if(n instanceof as)return zn(n.ast,o,e);if(n instanceof Mc)return n.receiver instanceof Ic?new Kr(n.name):new Fs(zn(n.receiver,o,e),n.name,null,zr(n.span,e));if(n instanceof Ih){if(n.receiver instanceof Ic)throw new Error("Unexpected ImplicitReceiver");return new cs(zn(n.receiver,o,e),n.args.map(t=>zn(t,o,e)),void 0,zr(n.span,e))}else{if(n instanceof os)return Ee(n.value,void 0,zr(n.span,e));if(n instanceof Sh)switch(n.operator){case"+":return new Qp(f_.Plus,zn(n.expr,o,e),void 0,zr(n.span,e));case"-":return new Qp(f_.Minus,zn(n.expr,o,e),void 0,zr(n.span,e));default:throw new Error(`AssertionError: unknown unary operator ${n.operator}`)}else if(n instanceof La){let t=$W.get(n.operation);if(t===void 0)throw new Error(`AssertionError: unknown binary operator ${n.operation}`);return new vi(t,zn(n.left,o,e),zn(n.right,o,e),void 0,zr(n.span,e))}else{if(n instanceof S_)return new Cm(o.root.xref);if(n instanceof Zp)return new Md(zn(n.receiver,o,e),zn(n.key,o,e),void 0,zr(n.span,e));if(n instanceof Ph)throw new Error("AssertionError: Chain in unknown context");if(n instanceof Jp){let t=n.keys.map((i,r)=>{let a=zn(n.values[r],o,e);return i.kind==="spread"?new pm(a):new Eh(i.key,a,i.quoted)});return new Ql(t,void 0,zr(n.span,e))}else{if(n instanceof k_)return new Pc(n.expressions.map(t=>zn(t,o,e)));if(n instanceof v1)return new Dc(zn(n.condition,o,e),zn(n.trueExp,o,e),zn(n.falseExp,o,e),void 0,zr(n.span,e));if(n instanceof P_)return zn(n.expression,o,e);if(n instanceof C1)return new ou(o.allocateXrefId(),new ua,n.name,[zn(n.exp,o,e),...n.args.map(t=>zn(t,o,e))]);if(n instanceof M_)return new zh(zn(n.receiver,o,e),zn(n.key,o,e),zr(n.span,e));if(n instanceof w_)return new Bh(zn(n.receiver,o,e),n.name);if(n instanceof b1)return new ru(zn(n.receiver,o,e),n.args.map(t=>zn(t,o,e)));if(n instanceof ba)return new t0(zr(n.span,e));if(n instanceof T_)return sH(zn(n.expression,o,e),zr(n.span,e));if(n instanceof E_)return p0(zn(n.expression,o,e));if(n instanceof D_)return new c1(zn(n.expression,o,e),void 0,zr(n.span,e));if(n instanceof A_)return $N(n,o,e);if(n instanceof I_)return new g_(zn(n.tag,o,e),$N(n.template,o,e),void 0,zr(n.span,e));if(n instanceof O_)return new ql(zn(n.expression,o,e),void 0,zr(n.span,e));if(n instanceof w1)return new Th(n.body,n.flags,e);if(n instanceof x1)return new Xp(zn(n.expression,o,e));if(n instanceof S1)return wY(Rs(n.parameters.map(t=>new Mr(t.name,ls)),zn(n.body,o,e)));throw new Error(`Unhandled expression type "${n.constructor.name}" in file "${e?.start.file.url}"`)}}}}function $N(n,o,e){return new v_(n.elements.map(t=>new d1(t.text,zr(t.span,e))),n.expressions.map(t=>zn(t,o,e)),zr(n.span,e))}function mE(n,o,e,t){let i;return o instanceof u0?i=new tr(o.strings,o.expressions.map(r=>zn(r,n,null)),Object.keys(yd(e)?.placeholders??{})):o instanceof no?i=zn(o,n,null):i=Ee(o),i}var b6=new Map([[Di.Property,Ht.Property],[Di.TwoWay,Ht.TwoWayProperty],[Di.Attribute,Ht.Attribute],[Di.Class,Ht.ClassName],[Di.Style,Ht.StyleProperty],[Di.LegacyAnimation,Ht.LegacyAnimation],[Di.Animation,Ht.Animation]]);function xY(n){return Sa(n.tagName??"")[1]===Wp}function yd(n){if(n==null)return null;if(!(n instanceof Ha))throw Error(`Expected i18n meta to be a Message, but got: ${n.constructor.name}`);return n}function bY(n,o,e){let t=new Array,i=new Set;for(let r of e.attributes){let[a,c]=Sa(e.name),p=a;if(!a)switch(o.namespace){case wr.SVG:p=vx;break;case wr.Math:p=Cx;break}let u=Up.securityContext(p?`:${p}:${c}`:c,r.name,!0);t.push(nu(o.xref,Ht.Attribute,r.name,mE(n.job,r.value,r.i18n),null,u,!0,!1,null,yd(r.i18n),r.sourceSpan)),r.i18n&&i.add(r.name)}for(let r of e.inputs)i.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(nu(o.xref,b6.get(r.type),r.name,mE(n.job,c0(r.value),r.i18n),r.unit,r.securityContext,!1,!1,null,yd(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===$a.LegacyAnimation&&r.phase===null)throw Error("Animation listener should have a phase");r.type===$a.TwoWay?n.create.push(qF(o.xref,o.handle,r.name,o.tag,y6(n,r.handler,r.handlerSpan),r.sourceSpan)):r.type===$a.Animation?n.create.push(GF(o.xref,o.handle,r.name,o.tag,l0(n,r.handler,r.handlerSpan),r.name.endsWith("enter")?"enter":"leave",r.target,!1,r.sourceSpan)):n.create.push(GE(o.xref,o.handle,r.name,o.tag,l0(n,r.handler,r.handlerSpan),r.phase,r.target,!1,r.sourceSpan))}t.some(r=>r?.i18nMessage)!==null&&n.create.push(QF(n.job.allocateXrefId(),new ua,o.xref))}function yY(n,o,e,t){let i=new Array;for(let r of e.templateAttrs)if(r instanceof Nh){let a=Up.securityContext(Wp,r.name,!0);i.push(YC(n,o.xref,Di.Attribute,r.name,r.value,null,a,!0,t,yd(r.i18n),r.sourceSpan))}else i.push(YC(n,o.xref,r.type,r.name,c0(r.value),r.unit,r.securityContext,!0,t,yd(r.i18n),r.sourceSpan));for(let r of e.attributes){let a=Up.securityContext(Wp,r.name,!0);i.push(YC(n,o.xref,Di.Attribute,r.name,r.value,null,a,!1,t,yd(r.i18n),r.sourceSpan))}for(let r of e.inputs)i.push(YC(n,o.xref,r.type,r.name,c0(r.value),r.unit,r.securityContext,!1,t,yd(r.i18n),r.sourceSpan));n.create.push(i.filter(r=>r?.kind===V.ExtractedAttribute)),n.update.push(i.filter(r=>r?.kind===V.Binding));for(let r of e.outputs){if(r.type===$a.LegacyAnimation&&r.phase===null)throw Error("Animation listener should have a phase");if(t===ss.NgTemplate&&(r.type===$a.TwoWay?n.create.push(qF(o.xref,o.handle,r.name,o.tag,y6(n,r.handler,r.handlerSpan),r.sourceSpan)):n.create.push(GE(o.xref,o.handle,r.name,o.tag,l0(n,r.handler,r.handlerSpan),r.phase,r.target,!1,r.sourceSpan))),t===ss.Structural&&r.type!==$a.LegacyAnimation){let a=Up.securityContext(Wp,r.name,!1);n.create.push(al(o.xref,Ht.Property,null,r.name,null,null,null,a))}}i.some(r=>r?.i18nMessage)!==null&&n.create.push(QF(n.job.allocateXrefId(),new ua,o.xref))}function YC(n,o,e,t,i,r,a,c,p,u,h){let g=typeof i=="string";if(p===ss.Structural){if(!c)switch(e){case Di.Property:case Di.Class:case Di.Style:return al(o,Ht.Property,null,t,null,null,u,a);case Di.TwoWay:return al(o,Ht.TwoWayProperty,null,t,null,null,u,a)}if(!g&&(e===Di.Attribute||e===Di.LegacyAnimation||e===Di.Animation))return null}let y=b6.get(e);return p===ss.NgTemplate&&(e===Di.Class||e===Di.Style||e===Di.Attribute&&!g)&&(y=Ht.Property),nu(o,y,t,mE(n.job,i,u),r,a,g,c,p,u,h)}function l0(n,o,e){o=c0(o);let t=new Array,i=o instanceof Ph?o.expressions:[o];if(i.length===0)throw new Error("Expected listener to have non-empty expression list.");let r=i.map(c=>zn(c,n.job,e)),a=r.pop();return t.push(...r.map(c=>Vs(new pa(c,c.sourceSpan)))),t.push(Vs(new kr(a,a.sourceSpan))),t}function y6(n,o,e){o=c0(o);let t=new Array;if(o instanceof Ph)if(o.expressions.length===1)o=o.expressions[0];else throw new Error("Expected two-way listener to have a single expression.");let i=zn(o,n.job,e),r=new Kr("$event"),a=new H1(i,r);return t.push(Vs(new pa(a))),t.push(Vs(new kr(r))),t}function c0(n){return n instanceof as?n.ast:n}function S6(n,o){SY(n.localRefs);for(let{name:e,value:t}of o.references)n.localRefs.push({name:e,target:t})}function SY(n){if(!Array.isArray(n))throw new Error("AssertionError: expected an array")}function zr(n,o){if(o===null)return null;let e=o.start.moveBy(n.start),t=o.start.moveBy(n.end),i=o.fullStart.moveBy(n.start);return new gn(e,t,i)}function ax(n,o,e){let t=null;for(let i of e.children)if(!(i instanceof hx||i instanceof RE)){if(t!==null)return null;if(i instanceof Ac||i instanceof Os&&i.tagName!==null)t=i;else return null}if(t!==null){for(let r of t.attributes)if(!r.name.startsWith(nY)){let a=Up.securityContext(Wp,r.name,!0);n.update.push(nu(o,Ht.Attribute,r.name,Ee(r.value),null,a,!0,!1,null,yd(r.i18n),r.sourceSpan))}for(let r of t.inputs)if(r.type!==Di.LegacyAnimation&&r.type!==Di.Animation&&r.type!==Di.Attribute){let a=Up.securityContext(Wp,r.name,!0);n.create.push(al(o,Ht.Property,null,r.name,null,null,null,a))}let i=t instanceof Ac?t.name:t.tagName;return i===Wp?null:i}return null}function wY(n){let o=new Set(n.params.map(e=>e.name));return zt(n,e=>{if(e instanceof su)for(let t of e.params)o.add(t.name);else if(e instanceof Kr&&o.has(e.name))return Jn(e.name);return e},Qn.None)}var MY=!1;function kY(){return MY}function sx(n,o){return px(Jn(Wh).bitwiseAnd(Ee(n),null),o)}function TY(n){return(n.descendants?1:0)|(n.static?2:0)|(n.emitDistinctChangesOnly?4:0)}function EY(n,o){if(Array.isArray(n.predicate)){let e=[];return n.predicate.forEach(t=>{let i=t.split(",").map(r=>Ee(r.trim()));e.push(...i)}),o.getConstLiteral(Xi(e),!0)}else switch(n.predicate.forwardRef){case 0:case 2:return n.predicate.expression;case 1:return jt(fe.resolveForwardRef).callFn([n.predicate.expression])}}function w6(n,o,e){let t=[];return e!==void 0&&t.push(...e),n.isSignal&&t.push(new Fs(Jn(Ls),n.propertyName)),t.push(EY(n,o),Ee(TY(n))),n.read&&t.push(n.read),t}var KE=Symbol("queryAdvancePlaceholder");function M6(n){let o=[],e=0,t=()=>{e>0&&(o.unshift(jt(fe.queryAdvance).callFn(e===1?[]:[Ee(e)]).toStmt()),e=0)};for(let i=n.length-1;i>=0;i--){let r=n[i];r===KE?e++:(t(),o.unshift(r))}return t(),o}function DY(n,o,e){let t=[],i=[],r=bF(u=>i.push(u),VE),a=null,c=null;n.forEach(u=>{let h=w6(u,o);if(u.isSignal?(a??=jt(fe.viewQuerySignal),a=a.callFn(h)):(c??=jt(fe.viewQuery),c=c.callFn(h)),u.isSignal){i.push(KE);return}let g=r(),y=jt(fe.loadQuery).callFn([]),b=jt(fe.queryRefresh).callFn([g.set(y)]),x=Jn(Ls).prop(u.propertyName).set(u.first?g.prop("first"):g);i.push(b.and(x).toStmt())}),a!==null&&t.push(new pa(a)),c!==null&&t.push(new pa(c));let p=e?`${e}_Query`:null;return um([new Mr(Wh,Gp),new Mr(Ls,ls)],[sx(1,t),sx(2,M6(i))],Wl,null,p)}function PY(n,o,e){let t=[],i=[],r=bF(u=>i.push(u),VE),a=null,c=null;for(let u of n){let h=w6(u,o,[Jn("dirIndex")]);if(u.isSignal?(a??=jt(fe.contentQuerySignal),a=a.callFn(h)):(c??=jt(fe.contentQuery),c=c.callFn(h)),u.isSignal){i.push(KE);continue}let g=r(),y=jt(fe.loadQuery).callFn([]),b=jt(fe.queryRefresh).callFn([g.set(y)]),x=Jn(Ls).prop(u.propertyName).set(u.first?g.prop("first"):g);i.push(b.and(x).toStmt())}a!==null&&t.push(new pa(a)),c!==null&&t.push(new pa(c));let p=e?`${e}_ContentQueries`:null;return um([new Mr(Wh,Gp),new Mr(Ls,ls),new Mr("dirIndex",Gp)],[sx(1,t),sx(2,M6(i))],Wl,null,p)}var pE=class extends WG{constructor(){super(oE)}parse(o,e,t){return super.parse(o,e,t)}},ZC=".",IY="attr",Wk="animate",AY="class",OY="style",NY="*",Gk="animate-",uE=class{_exprParser;_schemaRegistry;errors;constructor(o,e,t){this._exprParser=o,this._schemaRegistry=e,this.errors=t}createBoundHostProperties(o,e){let t=[];for(let i of Object.keys(o)){let r=o[i];typeof r=="string"?this.parsePropertyBinding(i,r,!0,!1,e,e.start.offset,void 0,[],t,e):this._reportError(`Value of the host property binding "${i}" needs to be a string representing an expression but got "${r}" (${typeof r})`,e)}return t}createDirectiveHostEventAsts(o,e){let t=[];for(let i of Object.keys(o)){let r=o[i];typeof r=="string"?this.parseEvent(i,r,!1,e,e,[],t,e):this._reportError(`Value of the host listener "${i}" needs to be a string representing an expression but got "${r}" (${typeof r})`,e)}return t}parseInterpolation(o,e,t){let i=e.fullStart.offset;try{let r=this._exprParser.parseInterpolation(o,e,i,t);return r&&this.errors.push(...r.errors),r}catch(r){return this._reportError(`${r}`,e),this._exprParser.wrapLiteralPrimitive("ERROR",e,i)}}parseInterpolationExpression(o,e){let t=e.start.offset;try{let i=this._exprParser.parseInterpolationExpression(o,e,t);return i&&this.errors.push(...i.errors),i}catch(i){return this._reportError(`${i}`,e),this._exprParser.wrapLiteralPrimitive("ERROR",e,t)}}parseInlineTemplateBinding(o,e,t,i,r,a,c,p){let u=t.start.offset+NY.length,h=this._parseTemplateBindings(o,e,t,u,i);for(let g of h){let y=im(t,g.sourceSpan),b=g.key.source,x=im(t,g.key.span);if(g instanceof N_){let M=g.value?g.value.source:"$implicit",w=g.value?im(t,g.value.span):void 0;c.push(new hT(b,M,y,x,w))}else if(g.value){let M=p?y:t,w=im(t,g.value.ast.sourceSpan);this._parsePropertyAst(b,g.value,!1,M,x,w,r,a)}else r.push([b,""]),this.parseLiteralAttr(b,null,x,i,void 0,r,a,x)}}_parseTemplateBindings(o,e,t,i,r){try{let a=this._exprParser.parseTemplateBindings(o,e,t,i,r);return a.errors.forEach(c=>this.errors.push(c)),a.warnings.forEach(c=>{this._reportError(c,t,cm.WARNING)}),a.templateBindings}catch(a){return this._reportError(`${a}`,t),[]}}parseLiteralAttr(o,e,t,i,r,a,c,p){qk(o)?(o=o.substring(1),p!==void 0&&(p=im(p,new As(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,cm.ERROR),this._parseLegacyAnimation(o,e,t,i,p,r,a,c)):c.push(new _h(o,this._exprParser.wrapLiteralPrimitive(e,"",i),bc.LITERAL_ATTR,t,p,r))}parsePropertyBinding(o,e,t,i,r,a,c,p,u,h){o.length===0&&this._reportError("Property name is missing in binding",r);let g=!1;o.startsWith(Gk)?(g=!0,o=o.substring(Gk.length),h!==void 0&&(h=im(h,new As(h.start.offset+Gk.length,h.end.offset)))):qk(o)&&(g=!0,o=o.substring(1),h!==void 0&&(h=im(h,new As(h.start.offset+1,h.end.offset)))),g?this._parseLegacyAnimation(o,e,r,a,h,c,p,u):o.startsWith(`${Wk}${ZC}`)?this._parseAnimation(o,this.parseBinding(e,t,c||r,a),r,h,c,p,u):this._parsePropertyAst(o,this.parseBinding(e,t,c||r,a),i,r,h,c,p,u)}parsePropertyInterpolation(o,e,t,i,r,a,c,p){let u=this.parseInterpolation(e,i||t,p);return u?(this._parsePropertyAst(o,u,!1,t,c,i,r,a),!0):!1}_parsePropertyAst(o,e,t,i,r,a,c,p){c.push([o,e.source]),p.push(new _h(o,e,t?bc.TWO_WAY:bc.DEFAULT,i,r,a))}_parseAnimation(o,e,t,i,r,a,c){a.push([o,e.source]),c.push(new _h(o,e,bc.ANIMATION,t,i,r))}_parseLegacyAnimation(o,e,t,i,r,a,c,p){o.length===0&&this._reportError("Animation trigger is missing",t);let u=this.parseBinding(e||"undefined",!1,a||t,i);c.push([o,u.source]),p.push(new _h(o,u,bc.LEGACY_ANIMATION,t,r,a))}parseBinding(o,e,t,i){try{let r=e?this._exprParser.parseSimpleBinding(o,t,i):this._exprParser.parseBinding(o,t,i);return r&&this.errors.push(...r.errors),r}catch(r){return this._reportError(`${r}`,t),this._exprParser.wrapLiteralPrimitive("ERROR",t,i)}}createBoundElementProperty(o,e,t=!1,i=!0){if(e.isLegacyAnimation)return new k1(e.name,Di.LegacyAnimation,fi.NONE,e.expression,null,e.sourceSpan,e.keySpan,e.valueSpan);let r=null,a,c=null,p=e.name.split(ZC),u;if(p.length>1)if(p[0]==IY){c=p.slice(1).join(ZC),t||this._validatePropertyOrAttributeName(c,e.sourceSpan,!0),u=Qk(this._schemaRegistry,o,c,!0);let h=c.indexOf(":");if(h>-1){let g=c.substring(0,h),y=c.substring(h+1);c=n1(g,y)}a=Di.Attribute}else p[0]==AY?(c=p[1],a=Di.Class,u=[fi.NONE]):p[0]==OY?(r=p.length>2?p[2]:null,c=p[1],a=Di.Style,u=[fi.STYLE]):p[0]==Wk&&(c=e.name,a=Di.Animation,u=[fi.NONE]);if(c===null){let h=this._schemaRegistry.getMappedPropName(e.name);c=i?h:e.name,u=Qk(this._schemaRegistry,o,h,!1),a=e.type===bc.TWO_WAY?Di.TwoWay:Di.Property,t||this._validatePropertyOrAttributeName(h,e.sourceSpan,!1)}return new k1(c,a,u[0],e.expression,r,e.sourceSpan,e.keySpan,e.valueSpan)}parseEvent(o,e,t,i,r,a,c,p){o.length===0&&this._reportError("Event name is missing in binding",i),qk(o)?(o=o.slice(1),p!==void 0&&(p=im(p,new As(p.start.offset+1,p.end.offset))),this._parseLegacyAnimationEvent(o,e,i,r,c,p)):this._parseRegularEvent(o,e,t,i,r,a,c,p)}calcPossibleSecurityContexts(o,e,t){let i=this._schemaRegistry.getMappedPropName(e);return Qk(this._schemaRegistry,o,i,t)}parseEventListenerName(o){let[e,t]=gH(o,[null,o]);return{eventName:t,target:e}}parseLegacyAnimationEventName(o){let e=_H(o,[o,null]);return{eventName:e[0],phase:e[1]===null?null:e[1].toLowerCase()}}_parseLegacyAnimationEvent(o,e,t,i,r,a){let{eventName:c,phase:p}=this.parseLegacyAnimationEventName(o),u=this._parseAction(e,i);r.push(new M1(c,p,$a.LegacyAnimation,u,t,i,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(o,e,t,i,r,a,c,p){let{eventName:u,target:h}=this.parseEventListenerName(o),g=this.errors.length,y=this._parseAction(e,r),b=this.errors.length===g;a.push([o,y.source]),t&&b&&!this._isAllowedAssignmentEvent(y)&&this._reportError("Unsupported expression in a two-way binding",i);let x=$a.Regular;t&&(x=$a.TwoWay),o.startsWith(`${Wk}${ZC}`)&&(x=$a.Animation),c.push(new M1(u,h,x,y,i,r,p))}_parseAction(o,e){let t=e&&e.start?e.start.offset:0;try{let i=this._exprParser.parseAction(o,e,t);return i&&this.errors.push(...i.errors),!i||i.ast instanceof ba?(this._reportError("Empty expressions are not allowed",e),this._exprParser.wrapLiteralPrimitive("ERROR",e,t)):i}catch(i){return this._reportError(`${i}`,e),this._exprParser.wrapLiteralPrimitive("ERROR",e,t)}}_reportError(o,e,t=cm.ERROR){this.errors.push(new sn(e,o,t))}_validatePropertyOrAttributeName(o,e,t){let i=t?this._schemaRegistry.validateAttribute(o):this._schemaRegistry.validateProperty(o);i.error&&this._reportError(i.msg,e,cm.ERROR)}_isAllowedAssignmentEvent(o){return o instanceof as?this._isAllowedAssignmentEvent(o.ast):o instanceof P_?this._isAllowedAssignmentEvent(o.expression):o instanceof Ih&&o.args.length===1&&o.receiver instanceof Mc&&o.receiver.name==="$any"&&o.receiver.receiver instanceof Ic?this._isAllowedAssignmentEvent(o.args[0]):(o instanceof Mc||o instanceof Zp)&&!hE(o)}};function hE(n){return n instanceof w_||n instanceof M_?!0:n instanceof O_?hE(n.expression):n instanceof Mc||n instanceof Zp||n instanceof Ih?hE(n.receiver):!1}function qk(n){return n[0]=="@"}function Qk(n,o,e,t){let i,[r,a]=o?Sa(o,!1):[null,o],c=u=>{let[h,g]=Sa(u,!1),y=h??r,b=y?`:${y}:${g}`:g;return n.securityContext(b,e,t)},p=n.allKnownElementNames();return a===null?i=p.map(c):(i=[],Mh.parse(a).forEach(u=>{let h=u.element?[u.element]:p;if(u.element&&!n.hasElement(u.element,[])){let b=`:${vx}:${u.element}`,x=`:${Cx}:${u.element}`;n.hasElement(b,[])?h=[b]:n.hasElement(x,[])&&(h=[x])}let g=new Set(u.notSelectors.filter(b=>b.isElementSelector()).map(b=>b.element?.toLowerCase())),y=h.filter(b=>{let x=b.toLowerCase();return!g.has(x)&&!g.has(Sa(x)[1])});i.push(...y.map(c))})),i.length===0?[fi.NONE]:Array.from(new Set(i)).sort()}function im(n,o){let e=o.start-n.start.offset,t=o.end-n.end.offset;return new gn(n.start.moveBy(e),n.end.moveBy(t),n.fullStart.moveBy(e),n.details)}function FY(n){if(n==null||n.length===0||n[0]=="/")return!1;let o=n.match(RY);return o===null||o[1]=="package"||o[1]=="asset"}var RY=/^([^:/?#]+):/,LY="select",VY="link",BY="rel",zY="href",jY="stylesheet",$Y="style",HY=new Set([":svg:script","script"]),UY="ngNonBindable",WY="ngProjectAs";function k6(n){let o=null,e=null,t=null,i=!1,r="";for(let p of n.attrs){let u=p.name.toLowerCase();u==LY?o=p.value:u==zY?e=p.value:u==BY?t=p.value:p.name==UY?i=!0:p.name==WY&&p.value.length>0&&(r=p.value)}o||="*";let a=n.name.toLowerCase(),c=Is.OTHER;return fT(a)?c=Is.NG_CONTENT:$Y===a?c=Is.STYLE:HY.has(a)?c=Is.SCRIPT:a==VY&&t==jY&&(c=Is.STYLESHEET),new fE(c,o,e,i,r)}var Is=(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})(Is||{}),fE=class{type;selectAttr;hrefAttr;nonBindable;projectAs;constructor(o,e,t,i,r){this.type=o,this.selectAttr=e,this.hrefAttr=t,this.nonBindable=i,this.projectAs=r}},GY=/^\s*([0-9A-Za-z_$]*)\s+of\s+([\S\s]*)/,qY=/^track\s+([\S\s]*)/,QY=/^(as\s+)(.*)/,bx=/^else[^\S\r\n]+if/,XY=/^let\s+([\S\s]*)/,KY=/^[$A-Z_][0-9A-Z_$]*$/i,HN=/(\s*)(\S+)(\s*)/,h_=new Set(["$index","$first","$last","$even","$odd","$count"]);function UN(n){return n==="empty"}function WN(n){return n==="else"||bx.test(n)}function YY(n,o,e,t){let i=iZ(o),r=[],a=GN(n,i,t);a!==null&&r.push(new Bp(a.expression,xo(e,n.children,n.children),a.expressionAlias,n.sourceSpan,n.startSourceSpan,n.endSourceSpan,n.nameSpan,n.i18n));for(let g of o)if(bx.test(g.name)){let y=GN(g,i,t);if(y!==null){let b=xo(e,g.children,g.children);r.push(new Bp(y.expression,b,y.expressionAlias,g.sourceSpan,g.startSourceSpan,g.endSourceSpan,g.nameSpan,g.i18n))}}else if(g.name==="else"){let y=xo(e,g.children,g.children);r.push(new Bp(null,y,null,g.sourceSpan,g.startSourceSpan,g.endSourceSpan,g.nameSpan,g.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 I1(r,u,n.startSourceSpan,p,n.nameSpan),errors:i}}function ZY(n,o,e,t){let i=[],r=eZ(n,i,t),a=null,c=null;for(let p of o)p.name==="empty"?c!==null?i.push(new sn(p.sourceSpan,"@for loop can only have one @empty block")):p.parameters.length>0?i.push(new sn(p.sourceSpan,"@empty block cannot have parameters")):c=new z_(xo(e,p.children,p.children),p.sourceSpan,p.startSourceSpan,p.endSourceSpan,p.nameSpan,p.i18n):i.push(new sn(p.sourceSpan,`Unrecognized @for loop block "${p.name}"`));if(r!==null)if(r.trackBy===null)i.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);tZ(r.trackBy.expression,r.trackBy.keywordSpan,i),a=new Fh(r.itemName,r.expression,r.trackBy.expression,r.trackBy.keywordSpan,r.context,xo(e,n.children,n.children),c,u,n.sourceSpan,n.startSourceSpan,p,n.nameSpan,n.i18n)}return{node:a,errors:i}}function JY(n,o,e){let t=oZ(n),i=n.parameters.length>0?d0(n.parameters[0],e):e.parseBinding("",!1,n.sourceSpan,0),r=[],a=[],c=[],p=null,u=null;for(let g of n.children){if(!(g instanceof il))continue;if((g.name!=="case"||g.parameters.length===0)&&g.name!=="default"&&g.name!=="default never"){a.push(new A1(g.name,g.sourceSpan,g.nameSpan));continue}u!==null&&t.push(new sn(g.sourceSpan,'@default block with "never" parameter must be the last case in a switch'));let y=g.name==="case",b=null;if(y)b=d0(g.parameters[0],e);else if(g.name==="default never"){(g.children.length>0||g.endSourceSpan!==null&&g.endSourceSpan.start.offset!==g.endSourceSpan.end.offset)&&t.push(new sn(g.sourceSpan,'@default block with "never" parameter cannot have a body')),c.length>0&&t.push(new sn(g.sourceSpan,'A @case block with no body cannot be followed by a @default block with "never" parameter')),u=new wT(g.sourceSpan,g.startSourceSpan,g.endSourceSpan,g.nameSpan);continue}let x=new ST(b,g.sourceSpan,g.startSourceSpan,g.endSourceSpan,g.nameSpan);if(c.push(x),g.children.length===0&&g.endSourceSpan!==null&&g.endSourceSpan.start.offset===g.endSourceSpan.end.offset){p===null&&(p=g.sourceSpan);continue}let w=g.sourceSpan,S=g.startSourceSpan;p!==null&&(w=new gn(p.start,g.sourceSpan.end),S=new gn(p.start,g.startSourceSpan.end),p=null);let E=new B_(c,xo(o,g.children,g.children),w,S,g.endSourceSpan,g.nameSpan,g.i18n);r.push(E),c=[]}return{node:new P1(i,r,a,u,n.sourceSpan,n.startSourceSpan,n.endSourceSpan,n.nameSpan),errors:t}}function eZ(n,o,e){if(n.parameters.length===0)return o.push(new sn(n.startSourceSpan,"@for loop does not have an expression")),null;let[t,...i]=n.parameters,r=rZ(t,o)?.match(GY);if(!r||r[2].trim().length===0)return o.push(new sn(t.sourceSpan,'Cannot parse expression. @for loop expression must match the pattern "<identifier> of <expression>"')),null;let[,a,c]=r;h_.has(a)&&o.push(new sn(t.sourceSpan,`@for loop item name cannot be one of ${Array.from(h_).join(", ")}.`));let p=t.expression.split(" ")[0],u=new gn(t.sourceSpan.start,t.sourceSpan.start.moveBy(p.length)),h={itemName:new hm(a,"$implicit",u,u),trackBy:null,expression:d0(t,e,c),context:Array.from(h_,g=>{let y=new gn(n.startSourceSpan.end,n.startSourceSpan.end);return new hm(g,g,y,y)})};for(let g of i){let y=g.expression.match(XY);if(y!==null){let x=new gn(g.sourceSpan.start.moveBy(y[0].length-y[1].length),g.sourceSpan.end);nZ(g.sourceSpan,y[1],x,a,h.context,o);continue}let b=g.expression.match(qY);if(b!==null){if(h.trackBy!==null)o.push(new sn(g.sourceSpan,'@for loop can only have one "track" expression'));else{let x=d0(g,e,b[1]);x.ast instanceof ba&&o.push(new sn(n.startSourceSpan,'@for loop must have a "track" expression'));let M=new gn(g.sourceSpan.start,g.sourceSpan.start.moveBy(5));h.trackBy={expression:x,keywordSpan:M}}continue}o.push(new sn(g.sourceSpan,`Unrecognized @for loop parameter "${g.expression}"`))}return h}function tZ(n,o,e){let t=new gE;n.ast.visit(t),t.hasPipe&&e.push(new sn(o,"Cannot use pipes in track expressions"))}function nZ(n,o,e,t,i,r){let a=o.split(","),c=e.start;for(let p of a){let u=p.split("="),h=u.length===2?u[0].trim():"",g=u.length===2?u[1].trim():"";if(h.length===0||g.length===0)r.push(new sn(n,'Invalid @for loop "let" parameter. Parameter should match the pattern "<name> = <variable name>"'));else if(!h_.has(g))r.push(new sn(n,`Unknown "let" parameter variable "${g}". The allowed variables are: ${Array.from(h_).join(", ")}`));else if(h===t)r.push(new sn(n,`Invalid @for loop "let" parameter. Variable cannot be called "${t}"`));else if(i.some(y=>y.name===h))r.push(new sn(n,`Duplicate "let" parameter variable "${g}"`));else{let[,y,b]=u[0].match(HN)??[],x=y!==void 0&&u.length===2?new gn(c.moveBy(y.length),c.moveBy(y.length+b.length)):e,M;if(u.length===2){let[,S,E]=u[1].match(HN)??[];M=S!==void 0?new gn(c.moveBy(u[0].length+1+S.length),c.moveBy(u[0].length+1+S.length+E.length)):void 0}let w=new gn(x.start,M?.end??x.end);i.push(new hm(h,g,w,x,M))}c=c.moveBy(p.length+1)}}function iZ(n){let o=[],e=!1;for(let t=0;t<n.length;t++){let i=n[t];i.name==="else"?(e?o.push(new sn(i.startSourceSpan,"Conditional can only have one @else block")):n.length>1&&t<n.length-1?o.push(new sn(i.startSourceSpan,"@else block must be last inside the conditional")):i.parameters.length>0&&o.push(new sn(i.startSourceSpan,"@else block cannot have parameters")),e=!0):bx.test(i.name)||o.push(new sn(i.startSourceSpan,`Unrecognized conditional block @${i.name}`))}return o}function oZ(n){let o=[],e=!1;if(n.parameters.length!==1)return o.push(new sn(n.startSourceSpan,"@switch block must have exactly one parameter")),o;for(let t of n.children)if(!(t instanceof o0||t instanceof au&&t.value.trim().length===0)){if(!(t instanceof il)||t.name!=="case"&&t.name!=="default"&&t.name!=="default never"){o.push(new sn(t.sourceSpan,"@switch block can only contain @case and @default blocks"));continue}t.name==="default never"?(e&&o.push(new sn(t.startSourceSpan,"@switch block can only have one @default block")),e=!0):t.name==="default"?(e?o.push(new sn(t.startSourceSpan,"@switch block can only have one @default block")):t.parameters.length>0&&o.push(new sn(t.startSourceSpan,"@default block cannot have parameters")),e=!0):t.name==="case"&&t.parameters.length!==1&&o.push(new sn(t.startSourceSpan,"@case block must have exactly one parameter"))}return o}function d0(n,o,e){let t,i;return typeof e=="string"?(t=Math.max(0,n.expression.lastIndexOf(e)),i=t+e.length):(t=0,i=n.expression.length),o.parseBinding(n.expression.slice(t,i),!1,n.sourceSpan,n.sourceSpan.start.offset+t)}function GN(n,o,e){if(n.parameters.length===0)return o.push(new sn(n.startSourceSpan,"Conditional block does not have an expression")),null;let t=d0(n.parameters[0],e),i=null;for(let r=1;r<n.parameters.length;r++){let a=n.parameters[r],c=a.expression.match(QY);if(c===null)o.push(new sn(a.sourceSpan,`Unrecognized conditional parameter "${a.expression}"`));else if(n.name!=="if"&&!bx.test(n.name))o.push(new sn(a.sourceSpan,'"as" expression is only allowed on `@if` and `@else if` blocks'));else if(i!==null)o.push(new sn(a.sourceSpan,'Conditional can only have one "as" expression'));else{let p=c[2].trim();if(KY.test(p)){let u=a.sourceSpan.start.moveBy(c[1].length),h=new gn(u,u.moveBy(p.length));i=new hm(p,p,h,h)}else o.push(new sn(a.sourceSpan,'"as" expression must be a valid JavaScript identifier'))}}return{expression:t,expressionAlias:i}}function rZ(n,o){let e=n.expression,t=/^\s$/,i=0,r=0,a=e.length-1;for(let c=0;c<e.length;c++){let p=e[c];if(p==="(")r=c+1,i++;else{if(t.test(p))continue;break}}if(i===0)return e;for(let c=e.length-1;c>-1;c--){let p=e[c];if(p===")"){if(a=c,i--,i===0)break}else{if(t.test(p))continue;break}}return i!==0?(o.push(new sn(n.sourceSpan,"Unclosed parentheses in expression")),null):e.slice(r,a)}var gE=class extends Ah{hasPipe=!1;visitPipe(){this.hasPipe=!0}},aZ=/^\d+\.?\d*(ms|s)?$/,sZ=/^\s$/,qN=new Map([[ol,Ba],[kc,bd],[ja,Sr]]),za=(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})(za||{});function lZ({expression:n,sourceSpan:o},e,t){let i=n.indexOf("never"),r=new gn(o.start.moveBy(i),o.start.moveBy(i+5)),a=YE(n,o),c=ZE(n,o);i===-1?t.push(new sn(o,'Could not find "never" keyword in expression')):JE("never",e,t,new CT(r,o,a,null,c))}function Xk({expression:n,sourceSpan:o},e,t,i){let r=n.indexOf("when"),a=new gn(o.start.moveBy(r),o.start.moveBy(r+4)),c=YE(n,o),p=ZE(n,o);if(r===-1)i.push(new sn(o,'Could not find "when" keyword in expression'));else{let u=m0(n,r+1),h=e.parseBinding(n.slice(u),!1,o,o.start.offset+u);JE("when",t,i,new T1(h,o,c,a,p))}}function Kk({expression:n,sourceSpan:o},e,t,i,r){let a=n.indexOf("on"),c=new gn(o.start.moveBy(a),o.start.moveBy(a+2)),p=YE(n,o),u=ZE(n,o);if(a===-1)i.push(new sn(o,'Could not find "on" keyword in expression'));else{let h=m0(n,a+1),g=n.startsWith("hydrate");new _E(n,e,h,o,t,i,g?gZ:fZ,g,p,c,u).parse()}}function YE(n,o){return n.startsWith("prefetch")?new gn(o.start,o.start.moveBy(8)):null}function ZE(n,o){return n.startsWith("hydrate")?new gn(o.start,o.start.moveBy(7)):null}var _E=class{expression;bindingParser;start;span;triggers;errors;validator;isHydrationTrigger;prefetchSpan;onSourceSpan;hydrateSpan;index=0;tokens;constructor(o,e,t,i,r,a,c,p,u,h,g){this.expression=o,this.bindingParser=e,this.start=t,this.span=i,this.triggers=r,this.errors=a,this.validator=c,this.isHydrationTrigger=p,this.prefetchSpan=u,this.onSourceSpan=h,this.hydrateSpan=g,this.tokens=new s0().tokenize(o.slice(t))}parse(){for(;this.tokens.length>0&&this.index<this.tokens.length;){let o=this.token();if(!o.isIdentifier()){this.unexpectedToken(o);break}if(this.isFollowedByOrLast(ya))this.consumeTrigger(o,[]),this.advance();else if(this.isFollowedByOrLast(ja)){this.advance();let e=this.errors.length,t=this.consumeParameters();if(this.errors.length!==e)break;this.consumeTrigger(o,t),this.advance()}else this.index<this.tokens.length-1&&this.unexpectedToken(this.tokens[this.index+1]);this.advance()}}advance(){this.index++}isFollowedByOrLast(o){return this.index===this.tokens.length-1?!0:this.tokens[this.index+1].isCharacter(o)}token(){return this.tokens[Math.min(this.index,this.tokens.length-1)]}consumeTrigger(o,e){let t=this.span.start.moveBy(this.start+o.index-this.tokens[0].index),i=new gn(t,t.moveBy(o.strValue.length)),r=t.moveBy(this.token().end-o.index),a=o.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(o.toString()){case za.IDLE:this.trackTrigger("idle",cZ(e,i,h,p,c,u));break;case za.TIMER:this.trackTrigger("timer",dZ(e,i,h,this.prefetchSpan,this.onSourceSpan,this.hydrateSpan));break;case za.INTERACTION:this.trackTrigger("interaction",uZ(e,i,h,this.prefetchSpan,this.onSourceSpan,this.hydrateSpan,this.validator));break;case za.IMMEDIATE:this.trackTrigger("immediate",mZ(e,i,h,this.prefetchSpan,this.onSourceSpan,this.hydrateSpan));break;case za.HOVER:this.trackTrigger("hover",pZ(e,i,h,this.prefetchSpan,this.onSourceSpan,this.hydrateSpan,this.validator));break;case za.VIEWPORT:this.trackTrigger("viewport",hZ(this.start,this.isHydrationTrigger,this.bindingParser,e,i,h,this.prefetchSpan,this.onSourceSpan,this.hydrateSpan,this.validator));break;default:throw new Error(`Unrecognized trigger type "${o}"`)}}catch(g){this.error(o,g.message)}}consumeParameters(){let o=[];if(!this.token().isCharacter(ja))return this.unexpectedToken(this.token()),o;this.advance();let e=[],t=[];for(;this.index<this.tokens.length;){let i=this.token();if(i.isCharacter(Sr)&&e.length===0){t.length&&o.push({expression:this.tokenRangeText(t),start:t[0].index});break}if(i.type===hn.Character&&qN.has(i.numValue)&&e.push(qN.get(i.numValue)),e.length>0&&i.isCharacter(e[e.length-1])&&e.pop(),e.length===0&&i.isCharacter(ya)&&t.length>0){o.push({expression:this.tokenRangeText(t),start:t[0].index}),this.advance(),t=[];continue}t.push(i),this.advance()}return(!this.token().isCharacter(Sr)||e.length>0)&&this.error(this.token(),"Unexpected end of expression"),this.index<this.tokens.length-1&&!this.tokens[this.index+1].isCharacter(ya)&&this.unexpectedToken(this.tokens[this.index+1]),o}tokenRangeText(o){return o.length===0?"":this.expression.slice(this.start+o[0].index,this.start+o[o.length-1].end)}trackTrigger(o,e){JE(o,this.triggers,this.errors,e)}error(o,e){let t=this.span.start.moveBy(this.start+o.index),i=t.moveBy(o.end-o.index);this.errors.push(new sn(new gn(t,i),e))}unexpectedToken(o){this.error(o,`Unexpected token "${o}"`)}};function JE(n,o,e,t){o[n]?e.push(new sn(t.sourceSpan,`Duplicate "${n}" trigger is not allowed`)):o[n]=t}function cZ(n,o,e,t,i,r){if(n.length>0)throw new Error(`"${za.IDLE}" trigger cannot have parameters`);return new xT(o,e,t,i,r)}function dZ(n,o,e,t,i,r){if(n.length!==1)throw new Error(`"${za.TIMER}" trigger must have exactly one parameter`);let a=lx(n[0].expression);if(a===null)throw new Error(`Could not parse time value of trigger "${za.TIMER}"`);return new yT(a,o,e,t,i,r)}function mZ(n,o,e,t,i,r){if(n.length>0)throw new Error(`"${za.IMMEDIATE}" trigger cannot have parameters`);return new bT(o,e,t,i,r)}function pZ(n,o,e,t,i,r,a){return a(za.HOVER,n),new E1(n[0]?.expression??null,o,e,t,i,r)}function uZ(n,o,e,t,i,r,a){return a(za.INTERACTION,n),new D1(n[0]?.expression??null,o,e,t,i,r)}function hZ(n,o,e,t,i,r,a,c,p,u){u(za.VIEWPORT,t);let h,g;if(t.length===0)h=g=null;else if(!t[0].expression.startsWith("{"))h=t[0].expression,g=null;else{let y=e.parseBinding(t[0].expression,!1,r,r.start.offset+n+t[0].start);if(y.ast instanceof Jp){if(y.ast.keys.some(x=>x.kind==="spread"))throw new Error("Spread operator are not allowed in this context");if(y.ast.keys.some(x=>x.kind==="property"&&x.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 b=y.ast.keys.findIndex(x=>x.kind==="property"&&x.key==="trigger");if(b===-1)h=null,g=y.ast;else{let x=y.ast.values[b],M=(w,S)=>S!==b;if(!(x instanceof Mc)||!(x.receiver instanceof Ic))throw new Error('"trigger" option of the "viewport" trigger must be an identifier');h=x.name,g=new Jp(y.ast.span,y.ast.sourceSpan,y.ast.keys.filter(M),y.ast.values.filter(M))}}if(o&&h!==null)throw new Error('"viewport" hydration trigger cannot have a "trigger"');if(g){let y=vE.findDynamicNode(g);if(y!==null)throw new Error(`Options of the "viewport" trigger must be an object literal containing only literal values, but "${y.constructor.name}" was found`)}return new F_(h,g,i,r,a,c,p)}function fZ(n,o){if(o.length>1)throw new Error(`"${n}" trigger can only have zero or one parameters`)}function gZ(n,o){if(n===za.VIEWPORT){if(o.length>1)throw new Error(`Hydration trigger "${n}" cannot have more than one parameter`);return}if(o.length>0)throw new Error(`Hydration trigger "${n}" cannot have parameters`)}function m0(n,o=0){let e=!1;for(let t=o;t<n.length;t++)if(sZ.test(n[t]))e=!0;else if(e)return t;return-1}function lx(n){let o=n.match(aZ);if(!o)return null;let[e,t]=o;return parseFloat(e)*(t==="s"?1e3:1)}var vE=class n extends Ah{dynamicNode=null;static findDynamicNode(o){let e=new n;return e.visit(o),e.dynamicNode}visit(o){!(o instanceof as)&&!(o instanceof os)&&!(o instanceof k_)&&!(o instanceof Jp)?this.dynamicNode=o:super.visit(o)}},_Z=/^prefetch\s+when\s/,vZ=/^prefetch\s+on\s/,CZ=/^hydrate\s+when\s/,xZ=/^hydrate\s+on\s/,bZ=/^hydrate\s+never(\s*)$/,T6=/^minimum\s/,yZ=/^after\s/,SZ=/^when\s/,wZ=/^on\s/;function CE(n){return n==="placeholder"||n==="loading"||n==="error"}function MZ(n,o,e,t){let i=[],{placeholder:r,loading:a,error:c}=kZ(o,i,e),{triggers:p,prefetchTriggers:u,hydrateTriggers:h}=PZ(n,t,i),g=n.endSourceSpan,y=n.sourceSpan.end;if(o.length>0){let M=o[o.length-1];g=M.endSourceSpan,y=M.sourceSpan.end}let b=new gn(n.sourceSpan.start,y);return{node:new eu(xo(e,n.children,n.children),p,u,h,r,a,c,n.nameSpan,b,n.sourceSpan,n.startSourceSpan,g,n.i18n),errors:i}}function kZ(n,o,e){let t=null,i=null,r=null;for(let a of n)try{if(!CE(a.name)){o.push(new sn(a.startSourceSpan,`Unrecognized block "@${a.name}"`));break}switch(a.name){case"placeholder":t!==null?o.push(new sn(a.startSourceSpan,"@defer block can only have one @placeholder block")):t=TZ(a,e);break;case"loading":i!==null?o.push(new sn(a.startSourceSpan,"@defer block can only have one @loading block")):i=EZ(a,e);break;case"error":r!==null?o.push(new sn(a.startSourceSpan,"@defer block can only have one @error block")):r=DZ(a,e);break}}catch(c){o.push(new sn(a.startSourceSpan,c.message))}return{placeholder:t,loading:i,error:r}}function TZ(n,o){let e=null;for(let t of n.parameters)if(T6.test(t.expression)){if(e!=null)throw new Error('@placeholder block can only have one "minimum" parameter');let i=lx(t.expression.slice(m0(t.expression)));if(i===null)throw new Error('Could not parse time value of parameter "minimum"');e=i}else throw new Error(`Unrecognized parameter in @placeholder block: "${t.expression}"`);return new R_(xo(o,n.children,n.children),e,n.nameSpan,n.sourceSpan,n.startSourceSpan,n.endSourceSpan,n.i18n)}function EZ(n,o){let e=null,t=null;for(let i of n.parameters)if(yZ.test(i.expression)){if(e!=null)throw new Error('@loading block can only have one "after" parameter');let r=lx(i.expression.slice(m0(i.expression)));if(r===null)throw new Error('Could not parse time value of parameter "after"');e=r}else if(T6.test(i.expression)){if(t!=null)throw new Error('@loading block can only have one "minimum" parameter');let r=lx(i.expression.slice(m0(i.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: "${i.expression}"`);return new L_(xo(o,n.children,n.children),e,t,n.nameSpan,n.sourceSpan,n.startSourceSpan,n.endSourceSpan,n.i18n)}function DZ(n,o){if(n.parameters.length>0)throw new Error("@error block cannot have parameters");return new V_(xo(o,n.children,n.children),n.nameSpan,n.sourceSpan,n.startSourceSpan,n.endSourceSpan,n.i18n)}function PZ(n,o,e,t){let i={},r={},a={};for(let c of n.parameters)SZ.test(c.expression)?Xk(c,o,i,e):wZ.test(c.expression)?Kk(c,o,i,e):_Z.test(c.expression)?Xk(c,o,r,e):vZ.test(c.expression)?Kk(c,o,r,e):CZ.test(c.expression)?Xk(c,o,a,e):xZ.test(c.expression)?Kk(c,o,a,e):bZ.test(c.expression)?lZ(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:i,prefetchTriggers:r,hydrateTriggers:a}}var IZ=/^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/,QN=1,XN=2,KN=3,YN=4,ZN=5,AZ=6,Jg=7,om={BANANA_BOX:{start:"[(",end:")]"},PROPERTY:{start:"[",end:"]"},EVENT:{start:"(",end:")"}},Yk="*",OZ=new Set(["link","style","script","ng-template","ng-container","ng-content"]),NZ=new Set(["ngProjectAs","ngNonBindable"]);function FZ(n,o,e){let t=new xE(o,e),i=xo(t,n,n),r=o.errors.concat(t.errors),a={nodes:i,errors:r,styleUrls:t.styleUrls,styles:t.styles,ngContentSelectors:t.ngContentSelectors};return e.collectCommentNodes&&(a.commentNodes=t.commentNodes),a}var xE=class{bindingParser;options;errors=[];styles=[];styleUrls=[];ngContentSelectors=[];commentNodes=[];inI18nBlock=!1;processedNodes=new Set;constructor(o,e){this.bindingParser=o,this.options=e}visitElement(o){let e=i1(o.i18n);e&&(this.inI18nBlock&&this.reportError("Cannot mark an element as translatable inside of a translatable section. Please remove the nested i18n marker.",o.sourceSpan),this.inI18nBlock=!0);let t=k6(o);if(t.type===Is.SCRIPT)return null;if(t.type===Is.STYLE){let S=RZ(o);return S!==null&&this.styles.push(S),null}else if(t.type===Is.STYLESHEET&&FY(t.hrefAttr))return this.styleUrls.push(t.hrefAttr),null;let i=VH(o.name),{attributes:r,boundEvents:a,references:c,variables:p,templateVariables:u,elementHasInlineTemplate:h,parsedProperties:g,templateParsedProperties:y,i18nAttrsMeta:b}=this.prepareAttributes(o.attrs,i),x=this.extractDirectives(o),M;t.nonBindable?M=xo(JN,o.children).flat(1/0):M=xo(this,o.children,o.children);let w;if(t.type===Is.NG_CONTENT){let S=t.selectAttr,E=o.attrs.map(O=>this.visitAttribute(O));w=new Rh(S,E,M,o.isSelfClosing,o.sourceSpan,o.startSourceSpan,o.endSourceSpan,o.i18n),this.ngContentSelectors.push(S)}else if(i){let S=this.categorizePropertyAttributes(o.name,g,b);w=new Os(o.name,r,S.bound,a,x,[],M,c,p,o.isSelfClosing,o.sourceSpan,o.startSourceSpan,o.endSourceSpan,o.i18n)}else{let S=this.categorizePropertyAttributes(o.name,g,b);if(o.name==="ng-container")for(let E of S.bound)E.type===Di.Attribute&&this.reportError("Attribute bindings are not supported on ng-container. Use property bindings instead.",E.sourceSpan);w=new Ac(o.name,r,S.bound,a,x,M,c,o.isSelfClosing,o.sourceSpan,o.startSourceSpan,o.endSourceSpan,o.isVoid,o.i18n)}return h&&(w=this.wrapInTemplate(w,y,u,b,i,e)),e&&(this.inI18nBlock=!1),w}visitAttribute(o){return new Nh(o.name,o.value,o.sourceSpan,o.keySpan,o.valueSpan,o.i18n)}visitText(o){return this.processedNodes.has(o)?null:this._visitTextWithInterpolation(o.value,o.sourceSpan,o.tokens,o.i18n)}visitExpansion(o){if(!o.i18n)return null;if(!i1(o.i18n))throw new Error(`Invalid type "${o.i18n.constructor}" for "i18n" property of ${o.sourceSpan.toString()}. Expected a "Message"`);let e=o.i18n,t={},i={};return Object.keys(e.placeholders).forEach(r=>{let a=e.placeholders[r];if(r.startsWith($H)){let c=r.trim(),p=this.bindingParser.parseInterpolationExpression(a.text,a.sourceSpan);t[c]=new Oh(p,a.sourceSpan)}else i[r]=this._visitTextWithInterpolation(a.text,a.sourceSpan,null)}),new _F(t,i,o.sourceSpan,e)}visitExpansionCase(o){return null}visitComment(o){return this.options.collectCommentNodes&&this.commentNodes.push(new hx(o.value||"",o.sourceSpan)),null}visitLetDeclaration(o,e){let t=this.bindingParser.parseBinding(o.value,!1,o.valueSpan,o.valueSpan.start.offset);return t.errors.length===0&&t.ast instanceof ba&&this.reportError("@let declaration value cannot be empty",o.valueSpan),new RE(o.name,t,o.sourceSpan,o.nameSpan,o.valueSpan)}visitComponent(o){let e=i1(o.i18n);if(e&&(this.inI18nBlock&&this.reportError("Cannot mark a component as translatable inside of a translatable section. Please remove the nested i18n marker.",o.sourceSpan),this.inI18nBlock=!0),o.tagName!==null&&OZ.has(o.tagName))return this.reportError(`Tag name "${o.tagName}" cannot be used as a component tag`,o.startSourceSpan),null;let{attributes:t,boundEvents:i,references:r,templateVariables:a,elementHasInlineTemplate:c,parsedProperties:p,templateParsedProperties:u,i18nAttrsMeta:h}=this.prepareAttributes(o.attrs,!1);this.validateSelectorlessReferences(r);let g=this.extractDirectives(o),y;o.attrs.find(M=>M.name==="ngNonBindable")?y=xo(JN,o.children).flat(1/0):y=xo(this,o.children,o.children);let b=this.categorizePropertyAttributes(o.tagName,p,h),x=new s_(o.componentName,o.tagName,o.fullName,t,b.bound,i,g,y,r,o.isSelfClosing,o.sourceSpan,o.startSourceSpan,o.endSourceSpan,o.i18n);return c&&(x=this.wrapInTemplate(x,u,a,h,!1,e)),e&&(this.inI18nBlock=!1),x}visitDirective(){return null}visitBlockParameter(){return null}visitBlock(o,e){let t=Array.isArray(e)?e.indexOf(o):-1;if(t===-1)throw new Error("Visitor invoked incorrectly. Expecting visitBlock to be invoked siblings array as its context");if(this.processedNodes.has(o))return null;let i=null;switch(o.name){case"defer":i=MZ(o,this.findConnectedBlocks(t,e,CE),this,this.bindingParser);break;case"switch":i=JY(o,this,this.bindingParser);break;case"for":i=ZY(o,this.findConnectedBlocks(t,e,UN),this,this.bindingParser);break;case"if":i=YY(o,this.findConnectedBlocks(t,e,WN),this,this.bindingParser);break;default:let r;CE(o.name)?(r=`@${o.name} block can only be used after an @defer block.`,this.processedNodes.add(o)):UN(o.name)?(r=`@${o.name} block can only be used after an @for block.`,this.processedNodes.add(o)):WN(o.name)?(r=`@${o.name} block can only be used after an @if or @else if block.`,this.processedNodes.add(o)):r=`Unrecognized block @${o.name}.`,i={node:new A1(o.name,o.sourceSpan,o.nameSpan),errors:[new sn(o.sourceSpan,r)]};break}return this.errors.push(...i.errors),i.node}findConnectedBlocks(o,e,t){let i=[];for(let r=o+1;r<e.length;r++){let a=e[r];if(!(a instanceof o0)){if(a instanceof au&&a.value.trim().length===0){this.processedNodes.add(a);continue}if(!(a instanceof il)||!t(a.name))break;i.push(a),this.processedNodes.add(a)}}return i}categorizePropertyAttributes(o,e,t){let i=[],r=[];return e.forEach(a=>{let c=t[a.name];if(a.isLiteral)r.push(new Nh(a.name,a.expression.source||"",a.sourceSpan,a.keySpan,a.valueSpan,c));else{let p=a.name.toLowerCase().startsWith("attr.on"),u=this.bindingParser.createBoundElementProperty(o,a,!p,!1);i.push(_T.fromBoundElementProperty(u,c))}}),{bound:i,literal:r}}prepareAttributes(o,e){let t=[],i=[],r=[],a=[],c=[],p={},u=[],h=[],g=!1;for(let y of o){let b=!1,x=eF(y.name),M=!1;if(y.i18n&&(p[y.name]=y.i18n),x.startsWith(Yk)){g&&this.reportError("Can't have multiple template bindings on one element. Use only one attribute prefixed with *",y.sourceSpan),M=!0,g=!0;let w=y.value,S=x.substring(Yk.length),E=[],O=y.valueSpan?y.valueSpan.fullStart.offset:y.sourceSpan.fullStart.offset+y.name.length;this.bindingParser.parseInlineTemplateBinding(S,w,y.sourceSpan,O,[],u,E,!0),h.push(...E.map(D=>new hm(D.name,D.value,D.sourceSpan,D.keySpan,D.valueSpan)))}else b=this.parseAttribute(e,y,[],t,i,r,a);!b&&!M&&c.push(this.visitAttribute(y))}return{attributes:c,boundEvents:i,references:a,variables:r,templateVariables:h,elementHasInlineTemplate:g,parsedProperties:t,templateParsedProperties:u,i18nAttrsMeta:p}}parseAttribute(o,e,t,i,r,a,c){let p=eF(e.name),u=e.value,h=e.sourceSpan,g=e.valueSpan?e.valueSpan.fullStart.offset:h.fullStart.offset;function y(S,E,O){let D=e.name.length-p.length,N=S.start.moveBy(E.length+D),P=N.moveBy(O.length);return new gn(N,P,N,O)}let b=p.match(IZ);if(b){if(b[QN]!=null){let S=b[Jg],E=y(h,b[QN],S);this.bindingParser.parsePropertyBinding(S,u,!1,!1,h,g,e.valueSpan,t,i,E)}else if(b[XN])if(o){let S=b[Jg],E=y(h,b[XN],S);this.parseVariable(S,u,h,E,e.valueSpan,a)}else this.reportError('"let-" is only supported on ng-template elements.',h);else if(b[KN]){let S=b[Jg],E=y(h,b[KN],S);this.parseReference(S,u,h,E,e.valueSpan,c)}else if(b[YN]){let S=[],E=b[Jg],O=y(h,b[YN],E);this.bindingParser.parseEvent(E,u,!1,h,e.valueSpan||h,t,S,O),Zk(S,r)}else if(b[ZN]){let S=b[Jg],E=y(h,b[ZN],S);this.bindingParser.parsePropertyBinding(S,u,!1,!0,h,g,e.valueSpan,t,i,E),this.parseAssignmentEvent(S,u,h,e.valueSpan,t,r,E,g)}else if(b[AZ]){let S=y(h,"",p);this.bindingParser.parseLiteralAttr(p,u,h,g,e.valueSpan,t,i,S)}return!0}let x=null;if(p.startsWith(om.BANANA_BOX.start)?x=om.BANANA_BOX:p.startsWith(om.PROPERTY.start)?x=om.PROPERTY:p.startsWith(om.EVENT.start)&&(x=om.EVENT),x!==null&&p.endsWith(x.end)&&p.length>x.start.length+x.end.length){let S=p.substring(x.start.length,p.length-x.end.length),E=y(h,x.start,S);if(x.start===om.BANANA_BOX.start)this.bindingParser.parsePropertyBinding(S,u,!1,!0,h,g,e.valueSpan,t,i,E),this.parseAssignmentEvent(S,u,h,e.valueSpan,t,r,E,g);else if(x.start===om.PROPERTY.start)this.bindingParser.parsePropertyBinding(S,u,!1,!1,h,g,e.valueSpan,t,i,E);else{let O=[];this.bindingParser.parseEvent(S,u,!1,h,e.valueSpan||h,t,O,E),Zk(O,r)}return!0}let M=y(h,"",p);return this.bindingParser.parsePropertyInterpolation(p,u,h,e.valueSpan,t,i,M,e.valueTokens??null)}extractDirectives(o){let e=o instanceof Va?o.tagName:o.name,t=[],i=new Set;for(let r of o.directives){let a=!1;for(let b of r.attrs)b.name.startsWith(Yk)?(a=!0,this.reportError(`Shorthand template syntax "${b.name}" is not supported inside a directive context`,b.sourceSpan)):NZ.has(b.name)&&(a=!0,this.reportError(`Attribute "${b.name}" is not supported in a directive context`,b.sourceSpan));if(!a&&i.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:g}=this.prepareAttributes(r.attrs,!1);this.validateSelectorlessReferences(h);let{bound:y}=this.categorizePropertyAttributes(e,p,g);for(let b of y)b.type!==Di.Property&&b.type!==Di.TwoWay&&(a=!0,this.reportError("Binding is not supported in a directive context",b.sourceSpan));a||(i.add(r.name),t.push(new gF(r.name,c,y,u,h,r.sourceSpan,r.startSourceSpan,r.endSourceSpan,void 0)))}return t}filterAnimationAttributes(o){return o.filter(e=>!e.name.startsWith("animate."))}filterAnimationInputs(o){return o.filter(e=>e.type!==Di.Animation)}wrapInTemplate(o,e,t,i,r,a){let c=this.categorizePropertyAttributes("ng-template",e,i),p=[];c.literal.forEach(y=>p.push(y)),c.bound.forEach(y=>p.push(y));let u={attributes:[],inputs:[],outputs:[]};(o instanceof Ac||o instanceof s_)&&(u.attributes.push(...this.filterAnimationAttributes(o.attributes)),u.inputs.push(...this.filterAnimationInputs(o.inputs)),u.outputs.push(...o.outputs));let h=r&&a?void 0:o.i18n,g;return o instanceof s_?g=o.tagName:o instanceof Os?g=null:g=o.name,new Os(g,u.attributes,u.inputs,u.outputs,[],p,[o],[],t,!1,o.sourceSpan,o.startSourceSpan,o.endSourceSpan,h)}_visitTextWithInterpolation(o,e,t,i){let r=o6(o),a=this.bindingParser.parseInterpolation(r,e,t);return a?new Oh(a,e,i):new Rp(r,e)}parseVariable(o,e,t,i,r,a){o.indexOf("-")>-1?this.reportError('"-" is not allowed in variable names',t):o.length===0&&this.reportError("Variable does not have a name",t),a.push(new hm(o,e,t,i,r))}parseReference(o,e,t,i,r,a){o.indexOf("-")>-1?this.reportError('"-" is not allowed in reference names',t):o.length===0?this.reportError("Reference does not have a name",t):a.some(c=>c.name===o)&&this.reportError(`Reference "#${o}" is defined more than once`,t),a.push(new j_(o,e,t,i,r))}parseAssignmentEvent(o,e,t,i,r,a,c,p){let u=[];this.bindingParser.parseEvent(`${o}Change`,e,!0,t,i||t,r,u,c),Zk(u,a)}validateSelectorlessReferences(o){if(o.length===0)return;let e=new Set;for(let t of o)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(o,e,t=cm.ERROR){this.errors.push(new sn(e,o,t))}},bE=class{visitElement(o){let e=k6(o);if(e.type===Is.SCRIPT||e.type===Is.STYLE||e.type===Is.STYLESHEET)return null;let t=xo(this,o.children,null);return new Ac(o.name,xo(this,o.attrs),[],[],[],t,[],o.isSelfClosing,o.sourceSpan,o.startSourceSpan,o.endSourceSpan,o.isVoid)}visitComment(o){return null}visitAttribute(o){return new Nh(o.name,o.value,o.sourceSpan,o.keySpan,o.valueSpan,o.i18n)}visitText(o){return new Rp(o.value,o.sourceSpan)}visitExpansion(o){return null}visitExpansionCase(o){return null}visitBlock(o,e){let t=[new Rp(o.startSourceSpan.toString(),o.startSourceSpan),...xo(this,o.children)];return o.endSourceSpan!==null&&t.push(new Rp(o.endSourceSpan.toString(),o.endSourceSpan)),t}visitBlockParameter(o,e){return null}visitLetDeclaration(o,e){return new Rp(`@let ${o.name} = ${o.value};`,o.sourceSpan)}visitComponent(o,e){let t=xo(this,o.children,null);return new Ac(o.fullName,xo(this,o.attrs),[],[],[],t,[],o.isSelfClosing,o.sourceSpan,o.startSourceSpan,o.endSourceSpan,!1)}visitDirective(o,e){return null}},JN=new bE;function eF(n){return/^data-/i.test(n)?n.substring(5):n}function Zk(n,o){o.push(...n.map(e=>vT.fromParsedEvent(e)))}function RZ(n){return n.children.length!==1||!(n.children[0]instanceof au)?null:n.children[0].value}var LZ=[" ",`
|
||
`,"\r"," "];function VZ(n,o,e={}){let{preserveWhitespaces:t,enableI18nLegacyMessageIdFormat:i}=e,r=e.enableSelectorless??!1,a=cx(r),p=new pE().parse(n,o,Ye(Z({leadingTriviaChars:LZ},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),g=new ix(!t,i,e.preserveSignificantWhitespace,h),y=g.visitAllWithErrors(u);if(!e.alwaysAttemptHtmlToR3AstConversion&&y.errors&&y.errors.length>0){let D={preserveWhitespaces:t,errors:y.errors,nodes:[],styleUrls:[],styles:[],ngContentSelectors:[]};return e.collectCommentNodes&&(D.commentNodes=[]),D}u=y.rootNodes,t||(u=xo(new tx(!0,void 0,!1),u),g.hasI18nMeta&&(u=xo(new ix(!1,void 0,!0,h),u)));let{nodes:b,errors:x,styleUrls:M,styles:w,ngContentSelectors:S,commentNodes:E}=FZ(u,a,{collectCommentNodes:!!e.collectCommentNodes});x.push(...p.errors,...y.errors);let O={preserveWhitespaces:t,errors:x.length>0?x:null,nodes:b,styleUrls:M,styles:w,ngContentSelectors:S};return e.collectCommentNodes&&(O.commentNodes=E),O}var BZ=new Hh;function cx(n=!1){return new uE(new nx(new s0,n),BZ,[])}var E6="%COMP%",zZ=`_nghost-${E6}`,jZ=`_ngcontent-${E6}`;function D6(n,o,e){let t=new _m,i=AE(n.selector);return t.set("type",n.type.value),i.length>0&&t.set("selectors",vh(i)),n.queries.length>0&&t.set("contentQueries",PY(n.queries,o,n.name)),n.viewQueries.length&&t.set("viewQuery",DY(n.viewQueries,o,n.name)),t.set("hostBindings",XZ(n.host,n.typeSourceSpan,e,o,n.selector||"",n.name,t)),t.set("inputs",P5(n.inputs,!0)),t.set("outputs",P5(n.outputs)),n.exportAs!==null&&t.set("exportAs",Xi(n.exportAs.map(r=>Ee(r)))),n.isStandalone===!1&&t.set("standalone",Ee(!1)),n.isSignal&&t.set("signals",Ee(!0)),t}function P6(n,o){let e=[],t=o.providers,i=o.viewProviders;if(t||i){let r=[t||new Pc([])];i&&r.push(i),e.push(jt(fe.ProvidersFeature).callFn(r))}if(o.hostDirectives?.length&&e.push(jt(fe.HostDirectivesFeature).callFn([eJ(o.hostDirectives)])),o.usesInheritance&&e.push(jt(fe.InheritDefinitionFeature)),o.lifecycle.usesOnChanges&&e.push(jt(fe.NgOnChangesFeature)),o.controlCreate!==null&&e.push(jt(fe.ControlFeature).callFn([Ee(o.controlCreate.passThroughInput)])),"externalStyles"in o&&o.externalStyles?.length){let r=o.externalStyles.map(a=>Ee(a));e.push(jt(fe.ExternalStylesFeature).callFn([Xi(r)]))}e.length&&n.set("features",Xi(e))}function $Z(n,o,e){let t=D6(n,o,e);P6(t,n);let i=jt(fe.defineDirective).callFn([t.toLiteralMap()],void 0,!0),r=QZ(n);return{expression:i,type:r,statements:[]}}function HZ(n,o,e){let t=D6(n,o,e);P6(t,n);let i=n.selector&&Mh.parse(n.selector),r=i&&i[0];if(r){let x=r.getAttrs();x.length&&t.set("attrs",o.getConstLiteral(Xi(x.map(M=>M!=null?Ee(M):Ee(void 0))),!0))}let a=n.name,c=null;if(n.defer.mode===1&&n.defer.dependenciesFn!==null){let x=`${a}_DeferFn`;o.statements.push(new Hr(x,n.defer.dependenciesFn,void 0,ca.Final)),c=Jn(x)}let p=n.isStandalone&&!n.hasDirectiveDependencies?is.DomOnly:is.Full,u=oY(n.name,n.template.nodes,o,p,n.relativeContextFilePath,n.i18nUseExternalIds,n.defer,c,n.relativeTemplatePath,kY());g6(u,Ot.Tmpl);let h=eY(u,o);if(u.contentSelectors!==null&&t.set("ngContentSelectors",u.contentSelectors),t.set("decls",Ee(u.root.decls)),t.set("vars",Ee(u.root.vars)),u.consts.length>0&&(u.constsInitializers.length>0?t.set("consts",Rs([],[...u.constsInitializers,new kr(Xi(u.consts))])):t.set("consts",Xi(u.consts))),t.set("template",h),n.declarationListEmitMode!==3&&n.declarations.length>0)t.set("dependencies",WZ(Xi(n.declarations.map(x=>x.type)),n.declarationListEmitMode));else if(n.declarationListEmitMode===3){let x=[n.type.value];n.rawImports&&x.push(n.rawImports),t.set("dependencies",jt(fe.getComponentDepsFactory).callFn(x))}n.encapsulation===null&&(n.encapsulation=Pp.Emulated);let g=!!n.externalStyles?.length;if(n.styles&&n.styles.length){let M=(n.encapsulation==Pp.Emulated?JZ(n.styles,jZ,zZ):n.styles).reduce((w,S)=>(S.trim().length>0&&w.push(o.getConstLiteral(Ee(S))),w),[]);M.length>0&&(g=!0,t.set("styles",Xi(M)))}!g&&n.encapsulation===Pp.Emulated&&(n.encapsulation=Pp.None),n.encapsulation!==Pp.Emulated&&t.set("encapsulation",Ee(n.encapsulation)),n.animations!==null&&t.set("data",cl([{key:"animation",value:n.animations,quoted:!1}])),n.changeDetection!==null&&(typeof n.changeDetection=="number"&&n.changeDetection!==IE.Default?t.set("changeDetection",Ee(n.changeDetection)):typeof n.changeDetection=="object"&&t.set("changeDetection",n.changeDetection));let y=jt(fe.defineComponent).callFn([t.toLiteralMap()],void 0,!0),b=UZ(n);return{expression:y,type:b,statements:[]}}function UZ(n){let o=I6(n);return o.push(SE(n.template.ngContentSelectors)),o.push(da(Ee(n.isStandalone))),o.push(A6(n)),n.isSignal&&o.push(da(Ee(n.isSignal))),da(jt(fe.ComponentDeclaration,o))}function WZ(n,o){switch(o){case 0:return n;case 1:return Rs([],n);case 2:let e=n.prop("map").callFn([jt(fe.resolveForwardRef)]);return Rs([],e);case 3:throw new Error("Unsupported with an array of pre-resolved dependencies")}}function GZ(n){return da(Ee(n))}function yE(n){let o=Object.keys(n).map(e=>{let t=Array.isArray(n[e])?n[e][0]:n[e];return{key:e,value:Ee(t),quoted:!0}});return cl(o)}function SE(n){return n.length>0?da(Xi(n.map(o=>Ee(o)))):Ec}function I6(n){let o=n.selector!==null?n.selector.replace(/\n/g,""):null;return[ux(n.type.type,n.typeArgumentCount),o!==null?GZ(o):Ec,n.exportAs!==null?SE(n.exportAs):Ec,da(qZ(n)),da(yE(n.outputs)),SE(n.queries.map(e=>e.propertyName))]}function qZ(n){return cl(Object.keys(n.inputs).map(o=>{let e=n.inputs[o],t=[{key:"alias",value:Ee(e.bindingPropertyName),quoted:!0},{key:"required",value:Ee(e.required),quoted:!0}];return e.isSignal&&t.push({key:"isSignal",value:Ee(e.isSignal),quoted:!0}),{key:o,value:cl(t),quoted:!0}}))}function QZ(n){let o=I6(n);return o.push(Ec),o.push(da(Ee(n.isStandalone))),o.push(A6(n)),n.isSignal&&o.push(da(Ee(n.isSignal))),da(jt(fe.DirectiveDeclaration,o))}function XZ(n,o,e,t,i,r,a){let c=e.createBoundHostProperties(n.properties,o),p=e.createDirectiveHostEventAsts(n.listeners,o);n.specialAttributes.styleAttr&&(n.attributes.style=Ee(n.specialAttributes.styleAttr)),n.specialAttributes.classAttr&&(n.attributes.class=Ee(n.specialAttributes.classAttr));let u=rY({componentName:r,componentSelector:i,properties:c,events:p,attributes:n.attributes},e,t);g6(u,Ot.Host),a.set("hostAttrs",u.root.attributes);let h=u.root.vars;return h!==null&&h>0&&a.set("hostVars",Ee(h)),tY(u)}function KZ(n){let o={},e={},t={},i={};for(let r of Object.keys(n)){let a=n[r];if(r.startsWith("(")&&r.endsWith(")")){if(typeof a!="string")throw new Error("Event binding must be string");e[r.slice(1,-1)]=a}else if(r.startsWith("[")&&r.endsWith("]")){if(typeof a!="string")throw new Error("Property binding must be string");t[r.slice(1,-1)]=a}else switch(r){case"class":if(typeof a!="string")throw new Error("Class binding must be string");i.classAttr=a;break;case"style":if(typeof a!="string")throw new Error("Style binding must be string");i.styleAttr=a;break;default:typeof a=="string"?o[r]=Ee(a):o[r]=a}}return{attributes:o,listeners:e,properties:t,specialAttributes:i}}function YZ(n,o){let e=cx();return e.createDirectiveHostEventAsts(n.listeners,o),e.createBoundHostProperties(n.properties,o),ZZ(n,e,o),e.errors}function ZZ(n,o,e){for(let t in n.properties){let i=t.startsWith("attr."),r=i?t.slice(5):t;if(r.toLowerCase().startsWith("on")){let a=i?"attribute":"property",c=`(${r.slice(2)})=...`,p=`Binding to event ${a} '${r}' is disallowed for security reasons, please use ${c}`;i||(p+=`
|
||
If '${t}' is a directive input, make sure the directive is imported by the current module.`),o.errors.push(new sn(e,p))}}}function JZ(n,o,e){let t=new OT;return n.map(i=>t.shimCssText(i,o,e))}function A6(n){return n.hostDirectives?.length?da(Xi(n.hostDirectives.map(o=>cl([{key:"directive",value:p0(o.directive.type),quoted:!1},{key:"inputs",value:yE(o.inputs||{}),quoted:!1},{key:"outputs",value:yE(o.outputs||{}),quoted:!1}])))):Ec}function eJ(n){let o=[],e=!1;for(let t of n){if(!t.inputs&&!t.outputs)o.push(t.directive.type);else{let i=[{key:"directive",value:t.directive.type,quoted:!1}];if(t.inputs){let r=tF(t.inputs);r&&i.push({key:"inputs",value:r,quoted:!1})}if(t.outputs){let r=tF(t.outputs);r&&i.push({key:"outputs",value:r,quoted:!1})}o.push(cl(i))}t.isForwardReference&&(e=!0)}return e?new mm([],[new kr(Xi(o))]):Xi(o)}function tF(n){let o=[];for(let e in n)n.hasOwnProperty(e)&&o.push(Ee(e),Ee(n[e]));return o.length>0?Xi(o):null}var wE=class extends Ah{visit(o){o instanceof as?this.visit(o.ast):o.visit(this)}visitElement(o){this.visitAllTemplateNodes(o.attributes),this.visitAllTemplateNodes(o.inputs),this.visitAllTemplateNodes(o.outputs),this.visitAllTemplateNodes(o.directives),this.visitAllTemplateNodes(o.references),this.visitAllTemplateNodes(o.children)}visitTemplate(o){this.visitAllTemplateNodes(o.attributes),this.visitAllTemplateNodes(o.inputs),this.visitAllTemplateNodes(o.outputs),this.visitAllTemplateNodes(o.directives),this.visitAllTemplateNodes(o.templateAttrs),this.visitAllTemplateNodes(o.variables),this.visitAllTemplateNodes(o.references),this.visitAllTemplateNodes(o.children)}visitContent(o){this.visitAllTemplateNodes(o.children)}visitBoundAttribute(o){this.visit(o.value)}visitBoundEvent(o){this.visit(o.handler)}visitBoundText(o){this.visit(o.value)}visitIcu(o){Object.keys(o.vars).forEach(e=>this.visit(o.vars[e])),Object.keys(o.placeholders).forEach(e=>this.visit(o.placeholders[e]))}visitDeferredBlock(o){o.visitAll(this)}visitDeferredTrigger(o){o instanceof T1?this.visit(o.value):o instanceof F_&&o.options!==null&&this.visit(o.options)}visitDeferredBlockPlaceholder(o){this.visitAllTemplateNodes(o.children)}visitDeferredBlockError(o){this.visitAllTemplateNodes(o.children)}visitDeferredBlockLoading(o){this.visitAllTemplateNodes(o.children)}visitSwitchBlock(o){this.visit(o.expression),this.visitAllTemplateNodes(o.groups)}visitSwitchBlockCase(o){o.expression&&this.visit(o.expression)}visitSwitchBlockCaseGroup(o){this.visitAllTemplateNodes(o.cases),this.visitAllTemplateNodes(o.children)}visitSwitchExhaustiveCheck(o){}visitForLoopBlock(o){o.item.visit(this),this.visitAllTemplateNodes(o.contextVariables),this.visit(o.expression),this.visitAllTemplateNodes(o.children),o.empty?.visit(this)}visitForLoopBlockEmpty(o){this.visitAllTemplateNodes(o.children)}visitIfBlock(o){this.visitAllTemplateNodes(o.branches)}visitIfBlockBranch(o){o.expression&&this.visit(o.expression),o.expressionAlias?.visit(this),this.visitAllTemplateNodes(o.children)}visitLetDeclaration(o){this.visit(o.value)}visitComponent(o){this.visitAllTemplateNodes(o.attributes),this.visitAllTemplateNodes(o.inputs),this.visitAllTemplateNodes(o.outputs),this.visitAllTemplateNodes(o.directives),this.visitAllTemplateNodes(o.references),this.visitAllTemplateNodes(o.children)}visitDirective(o){this.visitAllTemplateNodes(o.attributes),this.visitAllTemplateNodes(o.inputs),this.visitAllTemplateNodes(o.outputs),this.visitAllTemplateNodes(o.references)}visitVariable(o){}visitReference(o){}visitTextAttribute(o){}visitText(o){}visitUnknownBlock(o){}visitAllTemplateNodes(o){for(let e of o)this.visit(e)}};var ME=class{directiveMatcher;constructor(o){this.directiveMatcher=o}bind(o){if(!o.template&&!o.host)throw new Error("Empty bound targets are not supported");let e=new Map,t=[],i=new Set,r=new Map,a=new Map,c=new Map,p=new Map,u=new Map,h=new Map,g=new Set,y=new Set,b=[];if(o.template){let x=dx.apply(o.template);tJ(x,c),kE.apply(o.template,this.directiveMatcher,e,t,i,r,a),mx.applyWithScope(o.template,x,p,u,h,g,y,b)}return o.host&&(e.set(o.host.node,o.host.directives),mx.applyWithScope(o.host.node,dx.apply(o.host.node),p,u,h,g,y,b)),new TE(o,e,t,i,r,a,p,u,h,c,g,y,b)}},dx=class n{parentScope;rootNode;namedEntities=new Map;elementLikeInScope=new Set;childScopes=new Map;isDeferred;constructor(o,e){this.parentScope=o,this.rootNode=e,this.isDeferred=o!==null&&o.isDeferred?!0:e instanceof eu}static newRootScope(){return new n(null,null)}static apply(o){let e=n.newRootScope();return e.ingest(o),e}ingest(o){o instanceof Os?(o.variables.forEach(e=>this.visitVariable(e)),o.children.forEach(e=>e.visit(this))):o instanceof Bp?(o.expressionAlias!==null&&this.visitVariable(o.expressionAlias),o.children.forEach(e=>e.visit(this))):o instanceof Fh?(this.visitVariable(o.item),o.contextVariables.forEach(e=>this.visitVariable(e)),o.children.forEach(e=>e.visit(this))):o instanceof B_||o instanceof z_||o instanceof eu||o instanceof V_||o instanceof R_||o instanceof L_||o instanceof Rh?o.children.forEach(e=>e.visit(this)):o instanceof $_||o.forEach(e=>e.visit(this))}visitElement(o){this.visitElementLike(o)}visitTemplate(o){o.directives.forEach(e=>e.visit(this)),o.references.forEach(e=>this.visitReference(e)),this.ingestScopedNode(o)}visitVariable(o){this.maybeDeclare(o)}visitReference(o){this.maybeDeclare(o)}visitDeferredBlock(o){this.ingestScopedNode(o),o.placeholder?.visit(this),o.loading?.visit(this),o.error?.visit(this)}visitDeferredBlockPlaceholder(o){this.ingestScopedNode(o)}visitDeferredBlockError(o){this.ingestScopedNode(o)}visitDeferredBlockLoading(o){this.ingestScopedNode(o)}visitSwitchBlock(o){o.groups.forEach(e=>e.visit(this))}visitSwitchBlockCase(o){}visitSwitchBlockCaseGroup(o){this.ingestScopedNode(o)}visitSwitchExhaustiveCheck(o){}visitForLoopBlock(o){this.ingestScopedNode(o),o.empty?.visit(this)}visitForLoopBlockEmpty(o){this.ingestScopedNode(o)}visitIfBlock(o){o.branches.forEach(e=>e.visit(this))}visitIfBlockBranch(o){this.ingestScopedNode(o)}visitContent(o){this.ingestScopedNode(o)}visitLetDeclaration(o){this.maybeDeclare(o)}visitComponent(o){this.visitElementLike(o)}visitDirective(o){o.references.forEach(e=>this.visitReference(e))}visitBoundAttribute(o){}visitBoundEvent(o){}visitBoundText(o){}visitText(o){}visitTextAttribute(o){}visitIcu(o){}visitDeferredTrigger(o){}visitUnknownBlock(o){}visitElementLike(o){o.directives.forEach(e=>e.visit(this)),o.references.forEach(e=>this.visitReference(e)),o.children.forEach(e=>e.visit(this)),this.elementLikeInScope.add(o)}maybeDeclare(o){this.namedEntities.has(o.name)||this.namedEntities.set(o.name,o)}lookup(o){return this.namedEntities.has(o)?this.namedEntities.get(o):this.parentScope!==null?this.parentScope.lookup(o):null}getChildScope(o){let e=this.childScopes.get(o);if(e===void 0)throw new Error(`Assertion error: child scope for ${o} not found`);return e}ingestScopedNode(o){let e=new n(this,o);e.ingest(o),this.childScopes.set(o,e)}},kE=class n{directiveMatcher;directives;eagerDirectives;missingDirectives;bindings;references;isInDeferBlock=!1;constructor(o,e,t,i,r,a){this.directiveMatcher=o,this.directives=e,this.eagerDirectives=t,this.missingDirectives=i,this.bindings=r,this.references=a}static apply(o,e,t,i,r,a,c){new n(e,t,i,r,a,c).ingest(o)}ingest(o){o.forEach(e=>e.visit(this))}visitElement(o){this.visitElementOrTemplate(o)}visitTemplate(o){this.visitElementOrTemplate(o)}visitDeferredBlock(o){let e=this.isInDeferBlock;this.isInDeferBlock=!0,o.children.forEach(t=>t.visit(this)),this.isInDeferBlock=e,o.placeholder?.visit(this),o.loading?.visit(this),o.error?.visit(this)}visitDeferredBlockPlaceholder(o){o.children.forEach(e=>e.visit(this))}visitDeferredBlockError(o){o.children.forEach(e=>e.visit(this))}visitDeferredBlockLoading(o){o.children.forEach(e=>e.visit(this))}visitSwitchBlock(o){o.groups.forEach(e=>e.visit(this))}visitSwitchBlockCase(o){}visitSwitchBlockCaseGroup(o){o.children.forEach(e=>e.visit(this))}visitSwitchExhaustiveCheck(o){}visitForLoopBlock(o){o.item.visit(this),o.contextVariables.forEach(e=>e.visit(this)),o.children.forEach(e=>e.visit(this)),o.empty?.visit(this)}visitForLoopBlockEmpty(o){o.children.forEach(e=>e.visit(this))}visitIfBlock(o){o.branches.forEach(e=>e.visit(this))}visitIfBlockBranch(o){o.expressionAlias?.visit(this),o.children.forEach(e=>e.visit(this))}visitContent(o){o.children.forEach(e=>e.visit(this))}visitComponent(o){if(this.directiveMatcher instanceof r1){let e=this.directiveMatcher.match(o.componentName);e.length>0?this.trackSelectorlessMatchesAndDirectives(o,e):this.missingDirectives.add(o.componentName)}o.directives.forEach(e=>e.visit(this)),o.children.forEach(e=>e.visit(this))}visitDirective(o){if(this.directiveMatcher instanceof r1){let e=this.directiveMatcher.match(o.name);e.length>0?this.trackSelectorlessMatchesAndDirectives(o,e):this.missingDirectives.add(o.name)}}visitElementOrTemplate(o){if(this.directiveMatcher instanceof o1){let e=[],t=WH(o);this.directiveMatcher.match(t,(i,r)=>e.push(...r)),this.trackSelectorBasedBindingsAndDirectives(o,e)}else o.references.forEach(e=>{e.value.trim()===""&&this.references.set(e,o)});o.directives.forEach(e=>e.visit(this)),o.children.forEach(e=>e.visit(this))}trackMatchedDirectives(o,e){e.length>0&&(this.directives.set(o,e),this.isInDeferBlock||this.eagerDirectives.push(...e))}trackSelectorlessMatchesAndDirectives(o,e){if(e.length===0)return;this.trackMatchedDirectives(o,e);let t=(i,r,a)=>{i[a].hasBindingPropertyName(r.name)&&this.bindings.set(r,i)};for(let i of e)o.inputs.forEach(r=>t(i,r,"inputs")),o.attributes.forEach(r=>t(i,r,"inputs")),o.outputs.forEach(r=>t(i,r,"outputs"));o.references.forEach(i=>this.references.set(i,{directive:e[0],node:o}))}trackSelectorBasedBindingsAndDirectives(o,e){this.trackMatchedDirectives(o,e),o.references.forEach(i=>{let r=null;if(i.value.trim()==="")r=e.find(a=>a.isComponent)||null;else if(r=e.find(a=>a.exportAs!==null&&a.exportAs.some(c=>c===i.value))||null,r===null)return;r!==null?this.references.set(i,{directive:r,node:o}):this.references.set(i,o)});let t=(i,r)=>{let a=e.find(p=>p[r].hasBindingPropertyName(i.name)),c=a!==void 0?a:o;this.bindings.set(i,c)};o.inputs.forEach(i=>t(i,"inputs")),o.attributes.forEach(i=>t(i,"inputs")),o instanceof Os&&o.templateAttrs.forEach(i=>t(i,"inputs")),o.outputs.forEach(i=>t(i,"outputs"))}visitVariable(o){}visitReference(o){}visitTextAttribute(o){}visitBoundAttribute(o){}visitBoundEvent(o){}visitBoundAttributeOrEvent(o){}visitText(o){}visitBoundText(o){}visitIcu(o){}visitDeferredTrigger(o){}visitUnknownBlock(o){}visitLetDeclaration(o){}},mx=class n extends wE{bindings;symbols;usedPipes;eagerPipes;deferBlocks;nestingLevel;scope;rootNode;level;visitNode=o=>o.visit(this);constructor(o,e,t,i,r,a,c,p,u){super(),this.bindings=o,this.symbols=e,this.usedPipes=t,this.eagerPipes=i,this.deferBlocks=r,this.nestingLevel=a,this.scope=c,this.rootNode=p,this.level=u}static applyWithScope(o,e,t,i,r,a,c,p){let u=o instanceof Os?o:null;new n(t,i,a,c,p,r,e,u,0).ingest(o)}ingest(o){if(o instanceof Os)o.variables.forEach(this.visitNode),o.children.forEach(this.visitNode),this.nestingLevel.set(o,this.level);else if(o instanceof Bp)o.expressionAlias!==null&&this.visitNode(o.expressionAlias),o.children.forEach(this.visitNode),this.nestingLevel.set(o,this.level);else if(o instanceof Fh)this.visitNode(o.item),o.contextVariables.forEach(e=>this.visitNode(e)),o.trackBy.visit(this),o.children.forEach(this.visitNode),this.nestingLevel.set(o,this.level);else if(o instanceof eu){if(this.scope.rootNode!==o)throw new Error(`Assertion error: resolved incorrect scope for deferred block ${o}`);this.deferBlocks.push([o,this.scope]),o.children.forEach(e=>e.visit(this)),this.nestingLevel.set(o,this.level)}else o instanceof B_||o instanceof z_||o instanceof V_||o instanceof R_||o instanceof L_||o instanceof Rh?(o.children.forEach(e=>e.visit(this)),this.nestingLevel.set(o,this.level)):o instanceof $_?this.nestingLevel.set(o,0):o.forEach(this.visitNode)}visitTemplate(o){o.inputs.forEach(this.visitNode),o.outputs.forEach(this.visitNode),o.directives.forEach(this.visitNode),o.templateAttrs.forEach(this.visitNode),o.references.forEach(this.visitNode),this.ingestScopedNode(o)}visitVariable(o){this.rootNode!==null&&this.symbols.set(o,this.rootNode)}visitReference(o){this.rootNode!==null&&this.symbols.set(o,this.rootNode)}visitDeferredBlock(o){this.ingestScopedNode(o),o.triggers.when?.value.visit(this),o.prefetchTriggers.when?.value.visit(this),o.hydrateTriggers.when?.value.visit(this),o.hydrateTriggers.never?.visit(this),o.placeholder&&this.visitNode(o.placeholder),o.loading&&this.visitNode(o.loading),o.error&&this.visitNode(o.error)}visitDeferredBlockPlaceholder(o){this.ingestScopedNode(o)}visitDeferredBlockError(o){this.ingestScopedNode(o)}visitDeferredBlockLoading(o){this.ingestScopedNode(o)}visitSwitchBlockCase(o){o.expression?.visit(this)}visitSwitchBlockCaseGroup(o){o.cases.forEach(e=>e.visit(this)),this.ingestScopedNode(o)}visitSwitchExhaustiveCheck(o){}visitForLoopBlock(o){o.expression.visit(this),this.ingestScopedNode(o),o.empty?.visit(this)}visitForLoopBlockEmpty(o){this.ingestScopedNode(o)}visitIfBlockBranch(o){o.expression?.visit(this),this.ingestScopedNode(o)}visitContent(o){this.ingestScopedNode(o)}visitLetDeclaration(o){super.visitLetDeclaration(o),this.rootNode!==null&&this.symbols.set(o,this.rootNode)}visitPipe(o,e){return this.usedPipes.add(o.name),this.scope.isDeferred||this.eagerPipes.add(o.name),super.visitPipe(o,e)}visitPropertyRead(o,e){return this.maybeMap(o,o.name),super.visitPropertyRead(o,e)}visitSafePropertyRead(o,e){return this.maybeMap(o,o.name),super.visitSafePropertyRead(o,e)}ingestScopedNode(o){let e=this.scope.getChildScope(o);new n(this.bindings,this.symbols,this.usedPipes,this.eagerPipes,this.deferBlocks,this.nestingLevel,e,o,this.level+1).ingest(o)}maybeMap(o,e){if(!(o.receiver instanceof Ic))return;let t=this.scope.lookup(e);t!==null&&this.bindings.set(o,t)}},TE=class{target;directives;eagerDirectives;missingDirectives;bindings;references;exprTargets;symbols;nestingLevel;scopedNodeEntities;usedPipes;eagerPipes;deferredBlocks;deferredScopes;constructor(o,e,t,i,r,a,c,p,u,h,g,y,b){this.target=o,this.directives=e,this.eagerDirectives=t,this.missingDirectives=i,this.bindings=r,this.references=a,this.exprTargets=c,this.symbols=p,this.nestingLevel=u,this.scopedNodeEntities=h,this.usedPipes=g,this.eagerPipes=y,this.deferredBlocks=b.map(x=>x[0]),this.deferredScopes=new Map(b)}getEntitiesInScope(o){return this.scopedNodeEntities.get(o)??new Set}getDirectivesOfNode(o){return this.directives.get(o)||null}getReferenceTarget(o){return this.references.get(o)||null}getConsumerOfBinding(o){return this.bindings.get(o)||null}getExpressionTarget(o){return this.exprTargets.get(o)||null}getDefinitionNodeOfSymbol(o){return this.symbols.get(o)||null}getNestingLevel(o){return this.nestingLevel.get(o)||0}getUsedDirectives(){let o=new Set;return this.directives.forEach(e=>e.forEach(t=>o.add(t))),Array.from(o.values())}getEagerlyUsedDirectives(){let o=new Set(this.eagerDirectives);return Array.from(o.values())}getUsedPipes(){return Array.from(this.usedPipes)}getEagerlyUsedPipes(){return Array.from(this.eagerPipes)}getDeferBlocks(){return this.deferredBlocks}getDeferredTriggerTarget(o,e){if(!(e instanceof D1)&&!(e instanceof F_)&&!(e instanceof E1))return null;let t=e.reference;if(t===null){let r=null;if(o.placeholder!==null){for(let a of o.placeholder.children)if(!(a instanceof hx)){if(r!==null)return null;a instanceof Ac&&(r=a)}}return r}let i=this.findEntityInScope(o,t);if(i instanceof j_&&this.getDefinitionNodeOfSymbol(i)!==o){let r=this.getReferenceTarget(i);if(r!==null)return this.referenceTargetToElement(r)}if(o.placeholder!==null){let r=this.findEntityInScope(o.placeholder,t),a=r instanceof j_?this.getReferenceTarget(r):null;if(a!==null)return this.referenceTargetToElement(a)}return null}isDeferred(o){for(let e of this.deferredBlocks){if(!this.deferredScopes.has(e))continue;let t=[this.deferredScopes.get(e)];for(;t.length>0;){let i=t.pop();if(i.elementLikeInScope.has(o))return!0;t.push(...i.childScopes.values())}}return!1}referencedDirectiveExists(o){return!this.missingDirectives.has(o)}findEntityInScope(o,e){let t=this.getEntitiesInScope(o);for(let i of t)if(i.name===e)return i;return null}referenceTargetToElement(o){return o instanceof Ac?o:o instanceof Os||o.node instanceof s_||o.node instanceof gF||o.node instanceof $_?null:this.referenceTargetToElement(o.node)}};function tJ(n,o){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 i=[n];for(;i.length>0;){let r=i.pop();for(let a of r.childScopes.values())i.push(a);t(r)}for(let[r,a]of e)o.set(r,new Set(a.values()))}var EE=class{},DE=class{jitEvaluator;FactoryTarget=xd;ResourceLoader=EE;elementSchemaRegistry=new Hh;constructor(o=new PT){this.jitEvaluator=o}compilePipe(o,e,t){let i={name:t.name,type:jr(t.type),typeArgumentCount:0,pipeName:t.pipeName,pure:t.pure,isStandalone:t.isStandalone},r=j5(i);return this.jitExpression(r.expression,o,e,[])}compilePipeDeclaration(o,e,t){let i=vJ(t),r=j5(i);return this.jitExpression(r.expression,o,e,[])}compileInjectable(o,e,t){let{expression:i,statements:r}=I5({name:t.name,type:jr(t.type),typeArgumentCount:t.typeArgumentCount,providedIn:sF(t.providedIn),useClass:hh(t,"useClass"),useFactory:aF(t,"useFactory"),useValue:hh(t,"useValue"),useExisting:hh(t,"useExisting"),deps:t.deps?.map(R6)},!0);return this.jitExpression(i,o,e,r)}compileInjectableDeclaration(o,e,t){let{expression:i,statements:r}=I5({name:t.type.name,type:jr(t.type),typeArgumentCount:0,providedIn:sF(t.providedIn),useClass:hh(t,"useClass"),useFactory:aF(t,"useFactory"),useValue:hh(t,"useValue"),useExisting:hh(t,"useExisting"),deps:t.deps?.map(lF)},!0);return this.jitExpression(i,o,e,r)}compileInjector(o,e,t){let i={type:jr(t.type),providers:t.providers&&t.providers.length>0?new si(t.providers):null,imports:t.imports.map(a=>new si(a))},r=z5(i);return this.jitExpression(r.expression,o,e,[])}compileInjectorDeclaration(o,e,t){let i=CJ(t),r=z5(i);return this.jitExpression(r.expression,o,e,[])}compileNgModule(o,e,t){let i={kind:dm.Global,type:jr(t.type),bootstrap:t.bootstrap.map(jr),declarations:t.declarations.map(jr),publicDeclarationTypes:null,imports:t.imports.map(jr),includeImportTypes:!0,exports:t.exports.map(jr),selectorScopeMode:V1.Inline,containsForwardDecls:!1,schemas:t.schemas?t.schemas.map(jr):null,id:t.id?new si(t.id):null},r=mU(i);return this.jitExpression(r.expression,o,e,[])}compileNgModuleDeclaration(o,e,t){let i=pU(t);return this.jitExpression(i,o,e,[])}compileDirective(o,e,t){let i=oF(t);return this.compileDirectiveFromMeta(o,e,i)}compileDirectiveDeclaration(o,e,t){let i=this.createParseSourceSpan("Directive",t.type.name,e),r=N6(t,i);return this.compileDirectiveFromMeta(o,e,r)}compileDirectiveFromMeta(o,e,t){let i=new f1,r=cx(),a=$Z(t,i,r);return this.jitExpression(a.expression,o,e,i.statements)}compileComponent(o,e,t){let{template:i,defer:r}=F6(t.template,t.name,e,t.preserveWhitespaces,void 0),a=Ye(Z(Z({},t),oF(t)),{selector:t.selector||this.elementSchemaRegistry.getDefaultComponentElementName(),template:i,declarations:t.declarations.map(rJ),declarationListEmitMode:0,defer:r,styles:[...t.styles,...i.styles],encapsulation:t.encapsulation,changeDetection:t.changeDetection??null,animations:t.animations!=null?new si(t.animations):null,viewProviders:t.viewProviders!=null?new si(t.viewProviders):null,relativeContextFilePath:"",i18nUseExternalIds:!0,relativeTemplatePath:null}),c=`ng:///${t.name}.js`;return this.compileComponentFromMeta(o,c,a)}compileComponentDeclaration(o,e,t){let i=this.createParseSourceSpan("Component",t.type.name,e),r=oJ(t,i,e);return this.compileComponentFromMeta(o,e,r)}compileComponentFromMeta(o,e,t){let i=new f1,r=cx(),a=HZ(t,i,r);return this.jitExpression(a.expression,o,e,i.statements)}compileFactory(o,e,t){let i=Ip({name:t.name,type:jr(t.type),typeArgumentCount:t.typeArgumentCount,deps:lJ(t.deps),target:t.target});return this.jitExpression(i.expression,o,e,i.statements)}compileFactoryDeclaration(o,e,t){let i=Ip({name:t.type.name,type:jr(t.type),typeArgumentCount:0,deps:Array.isArray(t.deps)?t.deps.map(lF):t.deps,target:t.target});return this.jitExpression(i.expression,o,e,i.statements)}createParseSourceSpan(o,e,t){return oU(o,e,t)}jitExpression(o,e,t,i){let r=[...i,new Hr("$def",o,void 0,ca.Exported)];return this.jitEvaluator.evaluateStatements(t,r,new AT(e),!0).$def}};function nF(n){return Ye(Z({},n),{isSignal:n.isSignal,predicate:O6(n.predicate),read:n.read?new si(n.read):null,static:n.static,emitDistinctChangesOnly:n.emitDistinctChangesOnly})}function iF(n){return{propertyName:n.propertyName,first:n.first??!1,predicate:O6(n.predicate),descendants:n.descendants??!1,read:n.read?new si(n.read):null,static:n.static??!1,emitDistinctChangesOnly:n.emitDistinctChangesOnly??!0,isSignal:!!n.isSignal}}function O6(n){return Array.isArray(n)?n:FE(new si(n),1)}function oF(n){let o=_J(n.inputs||[]),e=eT(n.outputs||[]),t=n.propMetadata,i={},r={};for(let c in t)t.hasOwnProperty(c)&&t[c].forEach(p=>{uJ(p)?i[c]={bindingPropertyName:p.alias||c,classPropertyName:c,required:p.required||!1,isSignal:!!p.isSignal,transformFunction:p.transform!=null?new si(p.transform):null}:hJ(p)&&(r[c]=p.alias||c)});let a=n.hostDirectives?.length?n.hostDirectives.map(c=>typeof c=="function"?{directive:jr(c),inputs:null,outputs:null,isForwardReference:!1}:{directive:jr(c.directive),isForwardReference:!1,inputs:c.inputs?eT(c.inputs):null,outputs:c.outputs?eT(c.outputs):null}):null;return Ye(Z({},n),{typeArgumentCount:0,typeSourceSpan:n.typeSourceSpan,type:jr(n.type),deps:null,host:Z({},dJ(n.propMetadata,n.typeSourceSpan,n.host)),inputs:Z(Z({},o),i),outputs:Z(Z({},e),r),queries:n.queries.map(nF),providers:n.providers!=null?new si(n.providers):null,viewQueries:n.viewQueries.map(nF),hostDirectives:a})}function N6(n,o){let e=n.hostDirectives?.length?n.hostDirectives.map(t=>({directive:jr(t.directive),isForwardReference:!1,inputs:t.inputs?rF(t.inputs):null,outputs:t.outputs?rF(t.outputs):null})):null;return{name:n.type.name,type:jr(n.type),typeSourceSpan:o,selector:n.selector??null,inputs:n.inputs?fJ(n.inputs):{},outputs:n.outputs??{},host:nJ(n.host),queries:(n.queries??[]).map(iF),viewQueries:(n.viewQueries??[]).map(iF),providers:n.providers!==void 0?new si(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??fF(n.version),isSignal:n.isSignal??!1,hostDirectives:e}}function nJ(n={}){return{attributes:iJ(n.attributes??{}),listeners:n.listeners??{},properties:n.properties??{},specialAttributes:{classAttr:n.classAttribute,styleAttr:n.styleAttribute}}}function rF(n){let o=null;for(let e=1;e<n.length;e+=2)o=o||{},o[n[e-1]]=n[e];return o}function iJ(n){let o={};for(let e of Object.keys(n))o[e]=new si(n[e]);return o}function oJ(n,o,e){let{template:t,defer:i}=F6(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(Jk(c));break;case"pipe":r.push(sJ(c));break}else(n.components||n.directives||n.pipes)&&(n.components&&r.push(...n.components.map(c=>Jk(c,!0))),n.directives&&r.push(...n.directives.map(c=>Jk(c))),n.pipes&&r.push(...aJ(n.pipes)));let a=r.some(({kind:c})=>c===Vh.Directive||c===Vh.NgModule);return Ye(Z({},N6(n,o)),{template:t,styles:n.styles??[],declarations:r,viewProviders:n.viewProviders!==void 0?new si(n.viewProviders):null,animations:n.animations!==void 0?new si(n.animations):null,defer:i,changeDetection:n.changeDetection??IE.Default,encapsulation:n.encapsulation??Pp.Emulated,declarationListEmitMode:2,relativeContextFilePath:"",i18nUseExternalIds:!0,relativeTemplatePath:null,hasDirectiveDependencies:a})}function rJ(n){return Ye(Z({},n),{type:new si(n.type)})}function Jk(n,o=null){return{kind:Vh.Directive,isComponent:o||n.kind==="component",selector:n.selector,type:new si(n.type),inputs:n.inputs??[],outputs:n.outputs??[],exportAs:n.exportAs??null}}function aJ(n){return n?Object.keys(n).map(o=>({kind:Vh.Pipe,name:o,type:new si(n[o])})):[]}function sJ(n){return{kind:Vh.Pipe,name:n.name,type:new si(n.type)}}function F6(n,o,e,t,i){let r=VZ(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 ${o}: ${p}`)}let c=new ME(null).bind({template:r.nodes});return{template:r,defer:cJ(c,i)}}function hh(n,o){if(n.hasOwnProperty(o))return FE(new si(n[o]),0)}function aF(n,o){if(n.hasOwnProperty(o))return new si(n[o])}function sF(n){let o=typeof n=="function"?new si(n):new ma(n??null);return FE(o,0)}function lJ(n){return n==null?null:n.map(R6)}function R6(n){let o=n.attribute!=null,e=n.token===null?null:new si(n.token),t=o?new si(n.attribute):e;return L6(t,o,n.host,n.optional,n.self,n.skipSelf)}function lF(n){let o=n.attribute??!1,e=n.token===null?null:new si(n.token);return L6(e,o,n.host??!1,n.optional??!1,n.self??!1,n.skipSelf??!1)}function L6(n,o,e,t,i,r){let a=o?Ee("unknown"):null;return{token:n,attributeNameType:a,host:e,optional:t,self:i,skipSelf:r}}function cJ(n,o){let e=n.getDeferBlocks(),t=new Map;for(let i=0;i<e.length;i++){let r=o?.[i];t.set(e[i],r?new si(r):null)}return{mode:0,blocks:t}}function dJ(n,o,e){let t=KZ(e||{});for(let r in n)n.hasOwnProperty(r)&&n[r].forEach(a=>{mJ(a)?t.properties[a.hostPropertyName||r]=TH("this",r):pJ(a)&&(t.listeners[a.eventName||r]=`${r}(${(a.args||[]).join(",")})`)});let i=YZ(t,o);if(i.length)throw new Error(i.map(r=>r.msg).join(`
|
||
`));return t}function mJ(n){return n.ngMetadataName==="HostBinding"}function pJ(n){return n.ngMetadataName==="HostListener"}function uJ(n){return n.ngMetadataName==="Input"}function hJ(n){return n.ngMetadataName==="Output"}function fJ(n){return Object.keys(n).reduce((o,e)=>{let t=n[e];return typeof t=="string"||Array.isArray(t)?o[e]=gJ(t):o[e]={bindingPropertyName:t.publicName,classPropertyName:e,transformFunction:t.transformFunction!==null?new si(t.transformFunction):null,required:t.isRequired,isSignal:t.isSignal},o},{})}function gJ(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 si(n[2]):null,required:!1,isSignal:!1}}function _J(n){return n.reduce((o,e)=>{if(typeof e=="string"){let[t,i]=V6(e);o[i]={bindingPropertyName:t,classPropertyName:i,required:!1,isSignal:!1,transformFunction:null}}else o[e.name]={bindingPropertyName:e.alias||e.name,classPropertyName:e.name,required:e.required||!1,isSignal:!1,transformFunction:e.transform!=null?new si(e.transform):null};return o},{})}function eT(n){return n.reduce((o,e)=>{let[t,i]=V6(e);return o[i]=t,o},{})}function V6(n){let[o,e]=n.split(":",2).map(t=>t.trim());return[e??o,o]}function vJ(n){return{name:n.type.name,type:jr(n.type),typeArgumentCount:0,pipeName:n.name,deps:null,pure:n.pure??!0,isStandalone:n.isStandalone??fF(n.version)}}function CJ(n){return{name:n.type.name,type:jr(n.type),providers:n.providers!==void 0&&n.providers.length>0?new si(n.providers):null,imports:n.imports!==void 0?n.imports.map(o=>new si(o)):[]}}function xJ(n){let o=n.ng||(n.ng={});o.\u0275compilerFacade=new DE}var PE=class{closedByParent=!1;implicitNamespacePrefix=null;isVoid=!1;ignoreFirstLf=!1;canSelfClose=!0;preventNamespaceInheritance=!1;requireExtraParent(o){return!1}isClosedByChild(o){return!1}getContentType(){return yc.PARSABLE_DATA}},g6e=new PE;var _6e=new sT("21.2.18");xJ(a_);function nD(n){let o=n.cloneNode(!0),e=o.querySelectorAll("[id]"),t=n.nodeName.toLowerCase();o.removeAttribute("id");for(let i=0;i<e.length;i++)e[i].removeAttribute("id");return t==="canvas"?j6(n,o):(t==="input"||t==="select"||t==="textarea")&&z6(n,o),B6("canvas",n,o,j6),B6("input, textarea, select",n,o,z6),o}function B6(n,o,e,t){let i=o.querySelectorAll(n);if(i.length){let r=e.querySelectorAll(n);for(let a=0;a<i.length;a++)t(i[a],r[a])}}var bJ=0;function z6(n,o){o.type!=="file"&&(o.value=n.value),o.type==="radio"&&o.name&&(o.name=`mat-clone-${o.name}-${bJ++}`)}function j6(n,o){let e=o.getContext("2d");if(e)try{e.drawImage(n,0,0)}catch{}}function lD(n){let o=n.getBoundingClientRect();return{top:o.top,right:o.right,bottom:o.bottom,left:o.left,width:o.width,height:o.height,x:o.x,y:o.y}}function iD(n,o,e){let{top:t,bottom:i,left:r,right:a}=n;return e>=t&&e<=i&&o>=r&&o<=a}function yJ(n,o){let e=o.left<n.left,t=o.left+o.width>n.right,i=o.top<n.top,r=o.top+o.height>n.bottom;return e||t||i||r}function C0(n,o,e){n.top+=o,n.bottom=n.top+n.height,n.left+=e,n.right=n.left+n.width}function $6(n,o,e,t){let{top:i,right:r,bottom:a,left:c,width:p,height:u}=n,h=p*o,g=u*o;return t>i-g&&t<a+g&&e>c-h&&e<r+h}var yx=class{_document;positions=new Map;constructor(o){this._document=o}clear(){this.positions.clear()}cache(o){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),o.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:lD(e)})})}handleScroll(o){let e=kp(o),t=this.positions.get(e);if(!t)return null;let i=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=i.top-r,p=i.left-a;return this.positions.forEach((u,h)=>{u.clientRect&&e!==h&&e.contains(h)&&C0(u.clientRect,c,p)}),i.top=r,i.left=a,{top:c,left:p}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function eR(n,o){let e=n.rootNodes;if(e.length===1&&e[0].nodeType===o.ELEMENT_NODE)return e[0];let t=o.createElement("div");return e.forEach(i=>t.appendChild(i)),t}function cD(n,o,e){for(let t in o)if(o.hasOwnProperty(t)){let i=o[t];i?n.setProperty(t,i,e?.has(t)?"important":""):n.removeProperty(t)}return n}function Kh(n,o){let e=o?"":"none";cD(n.style,{"touch-action":o?"":"none","-webkit-user-drag":o?"":"none","-webkit-tap-highlight-color":o?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function H6(n,o,e){cD(n.style,{position:o?"":"fixed",top:o?"":"0",opacity:o?"":"0",left:o?"":"-999em"},e)}function Sx(n,o){return o&&o!="none"?n+" "+o:n}function U6(n,o){n.style.width=`${o.width}px`,n.style.height=`${o.height}px`,n.style.transform=x0(o.left,o.top)}function x0(n,o){return`translate3d(${Math.round(n)}px, ${Math.round(o)}px, 0)`}var _0={capture:!0},eD={passive:!1,capture:!0},SJ=(()=>{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,i){},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})(),tR=(()=>{class n{_ngZone=f(Ai);_document=f(Qi);_styleLoader=f(sr);_renderer=f(md).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new We;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=Q([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new We;pointerUp=new We;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,eD)})}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(SJ),this._activeDragInstances.update(i=>[...i,e]),this._activeDragInstances().length===1)){let i=t.type.startsWith("touch"),r=c=>this.pointerUp.next(c),a=[["scroll",c=>this._scroll.next(c),_0],["selectstart",this._preventDefaultWhileDragging,eD]];i?a.push(["touchend",r,_0],["touchcancel",r,_0]):a.push(["mouseup",r,_0]),i||a.push(["mousemove",c=>this.pointerMove.next(c),eD]),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 i=t.indexOf(e);return i>-1?(t.splice(i,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 Rr(i=>this._ngZone.runOutsideAngular(()=>{let r=this._renderer.listen(e,"scroll",a=>{this._activeDragInstances().length&&i.next(a)},_0);return()=>{r()}}))),Wn(...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=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function W6(n){let o=n.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(n)*o}function wJ(n){let o=getComputedStyle(n),e=tD(o,"transition-property"),t=e.find(c=>c==="transform"||c==="all");if(!t)return 0;let i=e.indexOf(t),r=tD(o,"transition-duration"),a=tD(o,"transition-delay");return W6(r[i])+W6(a[i])}function tD(n,o){return n.getPropertyValue(o).split(",").map(t=>t.trim())}var MJ=new Set(["position"]),oD=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview}constructor(o,e,t,i,r,a,c,p,u,h){this._document=o,this._rootElement=e,this._direction=t,this._initialDomRect=i,this._previewTemplate=r,this._previewClass=a,this._pickupPositionOnPage=c,this._initialTransform=p,this._zIndex=u,this._renderer=h}attach(o){this._preview=this._createPreview(),o.appendChild(this._preview),G6(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(o){this._preview.style.transform=o}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(o){this._preview.classList.add(o)}getTransitionDuration(){return wJ(this._preview)}addEventListener(o,e){return this._renderer.listen(this._preview,o,e)}_createPreview(){let o=this._previewTemplate,e=this._previewClass,t=o?o.template:null,i;if(t&&o){let r=o.matchSize?this._initialDomRect:null,a=o.viewContainer.createEmbeddedView(t,o.context);a.detectChanges(),i=eR(a,this._document),this._previewEmbeddedView=a,o.matchSize?U6(i,r):i.style.transform=x0(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else i=nD(this._rootElement),U6(i,this._initialDomRect),this._initialTransform&&(i.style.transform=this._initialTransform);return cD(i.style,{"pointer-events":"none",margin:G6(i)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},MJ),Kh(i,!1),i.classList.add("cdk-drag-preview"),i.setAttribute("popover","manual"),i.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(r=>i.classList.add(r)):i.classList.add(e)),i}};function G6(n){return"showPopover"in n}var kJ={passive:!0},q6={passive:!1},TJ={passive:!1,capture:!0},EJ=800,Q6="cdk-drag-placeholder",X6=new Set(["position"]);function DJ(n,o,e={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let t=n.get(Si,null,{optional:!0})||n.get(md).createRenderer(null,null);return new rD(o,e,n.get(Qi),n.get(Ai),n.get(hd),n.get(tR),t)}var rD=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=Q(!1);_hasMoved=!1;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new We;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=Mo.EMPTY;_pointerUpSubscription=Mo.EMPTY;_scrollSubscription=Mo.EMPTY;_resizeSubscription=Mo.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(o){o!==this._disabled&&(this._disabled=o,this._toggleNativeDragInteractions(),this._handles.forEach(e=>Kh(e,o)))}_disabled=!1;beforeStarted=new We;started=new We;released=new We;ended=new We;entered=new We;exited=new We;dropped=new We;moved=this._moveEvents;data;constrainPosition;constructor(o,e,t,i,r,a,c){this._config=e,this._document=t,this._ngZone=i,this._viewportRuler=r,this._dragDropRegistry=a,this._renderer=c,this.withRootElement(o).withParent(e.parentDragRef||null),this._parentPositions=new yx(t),a.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(o){this._handles=o.map(t=>Ul(t)),this._handles.forEach(t=>Kh(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(o){return this._previewTemplate=o,this}withPlaceholderTemplate(o){return this._placeholderTemplate=o,this}withRootElement(o){let e=Ul(o);if(e!==this._rootElement){this._removeRootElementListeners();let t=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[t.listen(e,"mousedown",this._pointerDown,q6),t.listen(e,"touchstart",this._pointerDown,kJ),t.listen(e,"dragstart",this._nativeDragStart,q6)]),this._initialTransform=void 0,this._rootElement=e}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(o){return this._boundaryElement=o?Ul(o):null,this._resizeSubscription.unsubscribe(),o&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(o){return this._parentDragRef=o,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&&yJ(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let o=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),t=0,i=0;e.left<o.left?t=o.left-e.left:e.right>o.right&&(t=o.right-e.right),e.top<o.top?i=o.top-e.top:e.bottom>o.bottom&&(i=o.bottom-e.bottom);let r=this._activeTransform.x,a=this._activeTransform.y,c=r+t,p=a+i;this._rootElement.style.transform=x0(c,p),this._activeTransform={x:c,y:p},this._passiveTransform={x:c,y:p}}}disableHandle(o){!this._disabledHandles.has(o)&&this._handles.indexOf(o)>-1&&(this._disabledHandles.add(o),Kh(o,!0))}enableHandle(o){this._disabledHandles.has(o)&&(this._disabledHandles.delete(o),Kh(o,this.disabled))}withDirection(o){return this._direction=o,this}_withDropContainer(o){this._dropContainer=o}getFreeDragPosition(){let o=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:o.x,y:o.y}}setFreeDragPosition(o){return this._activeTransform={x:0,y:0},this._passiveTransform.x=o.x,this._passiveTransform.y=o.y,this._dropContainer||this._applyRootElementTransform(o.x,o.y),this}withPreviewContainer(o){return this._previewContainer=o,this}_sortFromLastPointerPosition(){let o=this._lastKnownPointerPosition;o&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(o),o)}_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=o=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(o);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,o)}else this.disabled||this._initializeDragSequence(this._rootElement,o)};_pointerMove=o=>{let e=this._getPointerPositionOnPage(o);if(!this._hasStartedDragging()){let i=Math.abs(e.x-this._pickupPositionOnPage.x),r=Math.abs(e.y-this._pickupPositionOnPage.y);if(i+r>=this._config.dragStartThreshold){let c=Date.now()>=this._dragStartTime+this._getDragStartDelay(o),p=this._dropContainer;if(!c){this._endDragSequence(o);return}(!p||!p.isDragging()&&!p.isReceiving())&&(o.cancelable&&o.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(o)))}return}o.cancelable&&o.preventDefault();let t=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(t),this._dropContainer)this._updateActiveDropContainer(t,e);else{let i=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,r=this._activeTransform;r.x=t.x-i.x+this._passiveTransform.x,r.y=t.y-i.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:o,distance:this._getDragDistance(t),delta:this._pointerDirectionDelta})})};_pointerUp=o=>{this._endDragSequence(o)};_endDragSequence(o){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:o}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(o),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(o);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:o})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(o){v0(o)&&(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",PJ,TJ)}),t){let i=this._rootElement,r=i.parentNode,a=this._placeholder=this._createPlaceholderElement(),c=this._marker=this._marker||this._document.createComment("");r.insertBefore(c,i),this._initialTransform=i.style.transform||"",this._preview=new oD(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)),H6(i,!1,X6),this._document.body.appendChild(r.replaceChild(a,i)),this.started.next({source:this,event:o}),t.start(),this._initialContainer=t,this._initialIndex=t.getItemIndex(this)}else this.started.next({source:this,event:o}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(t?t.getScrollableParents():[])}_initializeDragSequence(o,e){this._parentDragRef&&e.stopPropagation();let t=this.isDragging(),i=v0(e),r=!i&&e.button!==0,a=this._rootElement,c=kp(e),p=!i&&this._lastTouchEventTime&&this._lastTouchEventTime+EJ>Date.now(),u=i?xC(e):CC(e);if(c&&c.draggable&&e.type==="mousedown"&&e.preventDefault(),t||r||p||u)return;if(this._handles.length){let y=a.style;this._rootElementTapHighlight=y.webkitTapHighlightColor||"",y.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(y=>this._updateOnScroll(y)),this._boundaryElement&&(this._boundaryRect=lD(this._boundaryElement));let h=this._previewTemplate;this._pickupPositionInElement=h&&h.template&&!h.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,o,e);let g=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:g.x,y:g.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(o){H6(this._rootElement,!0,X6),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),i=this._getPointerPositionOnPage(o),r=this._getDragDistance(i),a=e._isOverContainer(i.x,i.y);this.ended.next({source:this,distance:r,dropPoint:i,event:o}),this.dropped.next({item:this,currentIndex:t,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:a,distance:r,dropPoint:i,event:o}),e.drop(this,t,this._initialIndex,this._initialContainer,a,r,i,o),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:o,y:e},{x:t,y:i}){let r=this._initialContainer._getSiblingContainerFromPosition(this,o,e);!r&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(o,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,o,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,i),this._dropContainer._sortItem(this,o,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(o,e):this._applyPreviewTransform(o-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let o=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(o.left,o.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(t=>{let i=c=>{(!c||this._preview&&kp(c)===this._preview.element&&c.propertyName==="transform")&&(a(),t(),clearTimeout(r))},r=setTimeout(i,e*1.5),a=this._preview.addEventListener("transitionend",i)}))}_createPlaceholderElement(){let o=this._placeholderTemplate,e=o?o.template:null,t;return e?(this._placeholderRef=o.viewContainer.createEmbeddedView(e,o.context),this._placeholderRef.detectChanges(),t=eR(this._placeholderRef,this._document)):t=nD(this._rootElement),t.style.pointerEvents="none",t.classList.add(Q6),t}_getPointerPositionInElement(o,e,t){let i=e===this._rootElement?null:e,r=i?i.getBoundingClientRect():o,a=v0(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-o.left+p,y:r.top-o.top+u}}_getPointerPositionOnPage(o){let e=this._getViewportScrollPosition(),t=v0(o)?o.touches[0]||o.changedTouches[0]||{pageX:0,pageY:0}:o,i=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=i,c.y=r,c.matrixTransform(a.inverse())}}return{x:i,y:r}}_getConstrainedPointerPosition(o){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:t,y:i}=this.constrainPosition?this.constrainPosition(o,this,this._initialDomRect,this._pickupPositionInElement):o;if(this.lockAxis==="x"||e==="x"?i=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,g=c.bottom-(u-a),y=c.left+r,b=c.right-(p-r);t=K6(t,y,b),i=K6(i,h,g)}return{x:t,y:i}}_updatePointerDirectionDelta(o){let{x:e,y:t}=o,i=this._pointerDirectionDelta,r=this._pointerPositionAtLastDirectionChange,a=Math.abs(e-r.x),c=Math.abs(t-r.y);return a>this._config.pointerDirectionChangeThreshold&&(i.x=e>r.x?1:-1,r.x=e),c>this._config.pointerDirectionChangeThreshold&&(i.y=t>r.y?1:-1,r.y=t),i}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let o=this._handles.length>0||!this.isDragging();o!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=o,Kh(this._rootElement,o))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(o=>o()),this._rootElementCleanups=void 0}_applyRootElementTransform(o,e){let t=1/this.scale,i=x0(o*t,e*t),r=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=r.transform&&r.transform!="none"?r.transform:""),r.transform=Sx(i,this._initialTransform)}_applyPreviewTransform(o,e){let t=this._previewTemplate?.template?void 0:this._initialTransform,i=x0(o,e);this._preview.setTransform(Sx(i,t))}_getDragDistance(o){let e=this._pickupPositionOnPage;return e?{x:o.x-e.x,y:o.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:o,y:e}=this._passiveTransform;if(o===0&&e===0||this.isDragging()||!this._boundaryElement)return;let t=this._rootElement.getBoundingClientRect(),i=this._boundaryElement.getBoundingClientRect();if(i.width===0&&i.height===0||t.width===0&&t.height===0)return;let r=i.left-t.left,a=t.right-i.right,c=i.top-t.top,p=t.bottom-i.bottom;i.width>t.width?(r>0&&(o+=r),a>0&&(o-=a)):o=0,i.height>t.height?(c>0&&(e+=c),p>0&&(e-=p)):e=0,(o!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:o})}_getDragStartDelay(o){let e=this.dragStartDelay;return typeof e=="number"?e:v0(o)?e.touch:e?e.mouse:0}_updateOnScroll(o){let e=this._parentPositions.handleScroll(o);if(e){let t=kp(o);this._boundaryRect&&t!==this._boundaryElement&&t.contains(this._boundaryElement)&&C0(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=_C(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(o,e){let t=this._previewContainer||"global";if(t==="parent")return o;if(t==="global"){let i=this._document;return e||i.fullscreenElement||i.webkitFullscreenElement||i.mozFullScreenElement||i.msFullscreenElement||i.body}return Ul(t)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=o=>{if(this._handles.length){let e=this._getTargetHandle(o);e&&!this._disabledHandles.has(e)&&!this.disabled&&o.preventDefault()}else this.disabled||o.preventDefault()};_getTargetHandle(o){return this._handles.find(e=>o.target&&(o.target===e||e.contains(o.target)))}_conditionallyInsertAnchor(o,e,t){if(o===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let i=this._anchor??=nD(this._placeholder);i.classList.remove(Q6),i.classList.add("cdk-drag-anchor"),i.style.transform="",t?t.before(i):Ul(e.element).appendChild(i)}}};function K6(n,o,e){return Math.max(o,Math.min(e,n))}function v0(n){return n.type[0]==="t"}function PJ(n){n.preventDefault()}function nR(n,o,e){let t=Y6(o,n.length-1),i=Y6(e,n.length-1);if(t===i)return;let r=n[t],a=i<t?-1:1;for(let c=t;c!==i;c+=a)n[c]=n[c+a];n[i]=r}function Y6(n,o){return Math.max(0,Math.min(o,n))}var wx=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(o){this._dragDropRegistry=o}_previousSwap={drag:null,delta:0,overlaps:!1};start(o){this.withItems(o)}sort(o,e,t,i){let r=this._itemPositions,a=this._getItemIndexFromPointerPosition(o,e,t,i);if(a===-1&&r.length>0)return null;let c=this.orientation==="horizontal",p=r.findIndex(w=>w.drag===o),u=r[a],h=r[p].clientRect,g=u.clientRect,y=p>a?1:-1,b=this._getItemOffsetPx(h,g,y),x=this._getSiblingOffsetPx(p,r,y),M=r.slice();return nR(r,p,a),r.forEach((w,S)=>{if(M[S]===w)return;let E=w.drag===o,O=E?b:x,D=E?o.getPlaceholderElement():w.drag.getRootElement();w.offset+=O;let N=Math.round(w.offset*(1/w.drag.scale));c?(D.style.transform=Sx(`translate3d(${N}px, 0, 0)`,w.initialTransform),C0(w.clientRect,0,O)):(D.style.transform=Sx(`translate3d(0, ${N}px, 0)`,w.initialTransform),C0(w.clientRect,O,0))}),this._previousSwap.overlaps=iD(g,e,t),this._previousSwap.drag=u.drag,this._previousSwap.delta=c?i.x:i.y,{previousIndex:p,currentIndex:a}}enter(o,e,t,i){let r=this._activeDraggables,a=r.indexOf(o),c=o.getPlaceholderElement();a>-1&&r.splice(a,1);let p=i==null||i<0?this._getItemIndexFromPointerPosition(o,e,t):i,u=r[p];if(u===o&&(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,o)}else this._element.appendChild(c),r.push(o);c.style.transform="",this._cacheItemPositions()}withItems(o){this._activeDraggables=o.slice(),this._cacheItemPositions()}withSortPredicate(o){this._sortPredicate=o}reset(){this._activeDraggables?.forEach(o=>{let e=o.getRootElement();if(e){let t=this._itemPositions.find(i=>i.drag===o)?.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(o){return this._getVisualItemPositions().findIndex(e=>e.drag===o)}getItemAtIndex(o){return this._getVisualItemPositions()[o]?.drag||null}updateOnScroll(o,e){this._itemPositions.forEach(({clientRect:t})=>{C0(t,o,e)}),this._itemPositions.forEach(({drag:t})=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(o){this._element=o}_cacheItemPositions(){let o=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let t=e.getVisibleElement();return{drag:e,offset:0,initialTransform:t.style.transform||"",clientRect:lD(t)}}).sort((e,t)=>o?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(o,e,t){let i=this.orientation==="horizontal",r=i?e.left-o.left:e.top-o.top;return t===-1&&(r+=i?e.width-o.width:e.height-o.height),r}_getSiblingOffsetPx(o,e,t){let i=this.orientation==="horizontal",r=e[o].clientRect,a=e[o+t*-1],c=r[i?"width":"height"]*t;if(a){let p=i?"left":"top",u=i?"right":"bottom";t===-1?c-=a.clientRect[p]-r[u]:c+=r[p]-a.clientRect[u]}return c}_shouldEnterAsFirstChild(o,e){if(!this._activeDraggables.length)return!1;let t=this._itemPositions,i=this.orientation==="horizontal";if(t[0].drag!==this._activeDraggables[0]){let a=t[t.length-1].clientRect;return i?o>=a.right:e>=a.bottom}else{let a=t[0].clientRect;return i?o<=a.left:e<=a.top}}_getItemIndexFromPointerPosition(o,e,t,i){let r=this.orientation==="horizontal",a=this._itemPositions.findIndex(({drag:c,clientRect:p})=>{if(c===o)return!1;if(i){let u=r?i.x:i.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,o)?-1:a}},aD=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(o,e){this._document=o,this._dragDropRegistry=e}start(o){let e=this._element.childNodes;this._relatedNodes=[];for(let t=0;t<e.length;t++){let i=e[t];this._relatedNodes.push([i,i.nextSibling])}this.withItems(o)}sort(o,e,t,i){let r=this._getItemIndexFromPointerPosition(o,e,t),a=this._previousSwap;if(r===-1||this._activeItems[r]===o)return null;let c=this._activeItems[r];if(a.drag===c&&a.overlaps&&a.deltaX===i.x&&a.deltaY===i.y)return null;let p=this.getItemIndex(o),u=o.getPlaceholderElement(),h=c.getRootElement();r>p?h.after(u):h.before(u),nR(this._activeItems,p,r);let g=this._getRootNode().elementFromPoint(e,t);return a.deltaX=i.x,a.deltaY=i.y,a.drag=c,a.overlaps=h===g||h.contains(g),{previousIndex:p,currentIndex:r}}enter(o,e,t,i){let r=this._activeItems.indexOf(o);r>-1&&this._activeItems.splice(r,1);let a=i==null||i<0?this._getItemIndexFromPointerPosition(o,e,t):i;a===-1&&(a=this._getClosestItemIndexToPointer(o,e,t));let c=this._activeItems[a];c&&!this._dragDropRegistry.isDragging(c)?(this._activeItems.splice(a,0,o),c.getRootElement().before(o.getPlaceholderElement())):(this._activeItems.push(o),this._element.appendChild(o.getPlaceholderElement()))}withItems(o){this._activeItems=o.slice()}withSortPredicate(o){this._sortPredicate=o}reset(){let o=this._element,e=this._previousSwap;for(let t=this._relatedNodes.length-1;t>-1;t--){let[i,r]=this._relatedNodes[t];i.parentNode===o&&i.nextSibling!==r&&(r===null?o.appendChild(i):r.parentNode===o&&o.insertBefore(i,r))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(o){return this._activeItems.indexOf(o)}getItemAtIndex(o){return this._activeItems[o]||null}updateOnScroll(){this._activeItems.forEach(o=>{this._dragDropRegistry.isDragging(o)&&o._sortFromLastPointerPosition()})}withElementContainer(o){o!==this._element&&(this._element=o,this._rootNode=void 0)}_getItemIndexFromPointerPosition(o,e,t){let i=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(t)),r=i?this._activeItems.findIndex(a=>{let c=a.getRootElement();return i===c||c.contains(i)}):-1;return r===-1||!this._sortPredicate(r,o)?-1:r}_getRootNode(){return this._rootNode||(this._rootNode=_C(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(o,e,t){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let i=1/0,r=-1;for(let a=0;a<this._activeItems.length;a++){let c=this._activeItems[a];if(c!==o){let{x:p,y:u}=c.getRootElement().getBoundingClientRect(),h=Math.hypot(e-p,t-u);h<i&&(i=h,r=a)}}return r}},Z6=.05,iR=.05,ml=(function(n){return n[n.NONE=0]="NONE",n[n.UP=1]="UP",n[n.DOWN=2]="DOWN",n})(ml||{}),Ua=(function(n){return n[n.NONE=0]="NONE",n[n.LEFT=1]="LEFT",n[n.RIGHT=2]="RIGHT",n})(Ua||{});function IJ(n,o){return new sD(o,n.get(tR),n.get(Qi),n.get(Ai),n.get(hd))}var sD=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new We;entered=new We;exited=new We;dropped=new We;sorted=new We;receivingStarted=new We;receivingStopped=new We;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=Mo.EMPTY;_verticalScrollDirection=ml.NONE;_horizontalScrollDirection=Ua.NONE;_scrollNode;_stopScrollTimers=new We;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(o,e,t,i,r){this._dragDropRegistry=e,this._ngZone=i,this._viewportRuler=r;let a=this.element=Ul(o);this._document=t,this.withOrientation("vertical").withElementContainer(a),e.registerDropContainer(this),this._parentPositions=new yx(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(o,e,t,i){this._draggingStarted(),i==null&&this.sortingDisabled&&(i=this._draggables.indexOf(o)),this._sortStrategy.enter(o,e,t,i),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:o,container:this,currentIndex:this.getItemIndex(o)})}exit(o){this._reset(),this.exited.next({item:o,container:this})}drop(o,e,t,i,r,a,c,p={}){this._reset(),this.dropped.next({item:o,currentIndex:e,previousIndex:t,container:this,previousContainer:i,isPointerOverContainer:r,distance:a,dropPoint:c,event:p})}withItems(o){let e=this._draggables;return this._draggables=o,o.forEach(t=>t._withDropContainer(this)),this.isDragging()&&(e.filter(i=>i.isDragging()).every(i=>o.indexOf(i)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(o){return this._direction=o,this._sortStrategy instanceof wx&&(this._sortStrategy.direction=o),this}connectedTo(o){return this._siblings=o.slice(),this}withOrientation(o){if(o==="mixed")this._sortStrategy=new aD(this._document,this._dragDropRegistry);else{let e=new wx(this._dragDropRegistry);e.direction=this._direction,e.orientation=o,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,t)=>this.sortPredicate(e,t,this)),this}withScrollableParents(o){let e=this._container;return this._scrollableElements=o.indexOf(e)===-1?[e,...o]:o.slice(),this}withElementContainer(o){if(o===this._container)return this;let e=Ul(this.element),t=this._scrollableElements.indexOf(this._container),i=this._scrollableElements.indexOf(o);return t>-1&&this._scrollableElements.splice(t,1),i>-1&&this._scrollableElements.splice(i,1),this._sortStrategy&&this._sortStrategy.withElementContainer(o),this._cachedShadowRoot=null,this._scrollableElements.unshift(o),this._container=o,this}getScrollableParents(){return this._scrollableElements}getItemIndex(o){return this._isDragging?this._sortStrategy.getItemIndex(o):this._draggables.indexOf(o)}getItemAtIndex(o){return this._isDragging?this._sortStrategy.getItemAtIndex(o):this._draggables[o]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(o,e,t,i){if(this.sortingDisabled||!this._domRect||!$6(this._domRect,Z6,e,t))return;let r=this._sortStrategy.sort(o,e,t,i);r&&this.sorted.next({previousIndex:r.previousIndex,currentIndex:r.currentIndex,container:this,item:o})}_startScrollingIfNecessary(o,e){if(this.autoScrollDisabled)return;let t,i=ml.NONE,r=Ua.NONE;if(this._parentPositions.positions.forEach((a,c)=>{c===this._document||!a.clientRect||t||$6(a.clientRect,Z6,o,e)&&([i,r]=AJ(c,a.clientRect,this._direction,o,e),(i||r)&&(t=c))}),!i&&!r){let{width:a,height:c}=this._viewportRuler.getViewportSize(),p={width:a,height:c,top:0,right:a,bottom:c,left:0};i=oR(p,e),r=rR(p,o),t=window}t&&(i!==this._verticalScrollDirection||r!==this._horizontalScrollDirection||t!==this._scrollNode)&&(this._verticalScrollDirection=i,this._horizontalScrollDirection=r,this._scrollNode=t,(i||r)&&t?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let o=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=o.msScrollSnapType||o.scrollSnapType||"",o.scrollSnapType=o.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 o=this._container.style;o.scrollSnapType=o.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),aC(0,qs).pipe(Ge(this._stopScrollTimers)).subscribe(()=>{let o=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===ml.UP?o.scrollBy(0,-e):this._verticalScrollDirection===ml.DOWN&&o.scrollBy(0,e),this._horizontalScrollDirection===Ua.LEFT?o.scrollBy(-e,0):this._horizontalScrollDirection===Ua.RIGHT&&o.scrollBy(e,0)})};_isOverContainer(o,e){return this._domRect!=null&&iD(this._domRect,o,e)}_getSiblingContainerFromPosition(o,e,t){return this._siblings.find(i=>i._canReceive(o,e,t))}_canReceive(o,e,t){if(!this._domRect||!iD(this._domRect,e,t)||!this.enterPredicate(o,this))return!1;let i=this._getShadowRoot().elementFromPoint(e,t);return i?i===this._container||this._container.contains(i):!1}_startReceiving(o,e){let t=this._activeSiblings;!t.has(o)&&e.every(i=>this.enterPredicate(i,this)||this._draggables.indexOf(i)>-1)&&(t.add(o),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:o,receiver:this,items:e}))}_stopReceiving(o){this._activeSiblings.delete(o),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:o,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(o=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(o);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let o=_C(this._container);this._cachedShadowRoot=o||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let o=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,o))}};function oR(n,o){let{top:e,bottom:t,height:i}=n,r=i*iR;return o>=e-r&&o<=e+r?ml.UP:o>=t-r&&o<=t+r?ml.DOWN:ml.NONE}function rR(n,o){let{left:e,right:t,width:i}=n,r=i*iR;return o>=e-r&&o<=e+r?Ua.LEFT:o>=t-r&&o<=t+r?Ua.RIGHT:Ua.NONE}function AJ(n,o,e,t,i){let r=oR(o,i),a=rR(o,t),c=ml.NONE,p=Ua.NONE;if(r){let u=n.scrollTop;r===ml.UP?u>0&&(c=ml.UP):n.scrollHeight-u>n.clientHeight&&(c=ml.DOWN)}if(a){let u=n.scrollLeft;e==="rtl"?a===Ua.RIGHT?u<0&&(p=Ua.RIGHT):n.scrollWidth+u>n.clientWidth&&(p=Ua.LEFT):a===Ua.LEFT?u>0&&(p=Ua.LEFT):n.scrollWidth-u>n.clientWidth&&(p=Ua.RIGHT)}return[c,p]}var OJ=(()=>{class n{_injector=f(rr);constructor(){}createDrag(e,t){return DJ(this._injector,e,t)}createDropList(e){return IJ(this._injector,e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var aR=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({providers:[OJ],imports:[fd]})}return n})();var NJ=[[["caption"]],[["colgroup"],["col"]],"*"],FJ=["caption","colgroup, col","*"];function RJ(n,o){n&1&&an(0,2)}function LJ(n,o){n&1&&(s(0,"thead",0),Fi(1,1),l(),s(2,"tbody",0),Fi(3,2)(4,3),l(),s(5,"tfoot",0),Fi(6,4),l())}function VJ(n,o){n&1&&Fi(0,1)(1,2)(2,3)(3,4)}var Xl=new cn("CDK_TABLE");var Tx=(()=>{class n{template=f(Ro);constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["","cdkCellDef",""]]})}return n})(),Ex=(()=>{class n{template=f(Ro);constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["","cdkHeaderCellDef",""]]})}return n})(),cR=(()=>{class n{template=f(Ro);constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["","cdkFooterCellDef",""]]})}return n})(),km=(()=>{class n{_table=f(Xl,{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=vt({type:n,selectors:[["","cdkColumnDef",""]],contentQueries:function(t,i,r){if(t&1&&Zi(r,Tx,5)(r,Ex,5)(r,cR,5),t&2){let a;mt(a=pt())&&(i.cell=a.first),mt(a=pt())&&(i.headerCell=a.first),mt(a=pt())&&(i.footerCell=a.first)}},inputs:{name:[0,"cdkColumnDef","name"],sticky:[2,"sticky","sticky",yt],stickyEnd:[2,"stickyEnd","stickyEnd",yt]}})}return n})(),kx=class{constructor(o,e){e.nativeElement.classList.add(...o._columnCssClassName)}},dR=(()=>{class n extends kx{constructor(){super(f(km),f(Jt))}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["cdk-header-cell"],["th","cdk-header-cell",""]],hostAttrs:["role","columnheader",1,"cdk-header-cell"],features:[di]})}return n})();var mR=(()=>{class n extends kx{constructor(){let e=f(km),t=f(Jt);super(e,t);let i=e._table?._getCellRole();i&&t.nativeElement.setAttribute("role",i)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["cdk-cell"],["td","cdk-cell",""]],hostAttrs:[1,"cdk-cell"],features:[di]})}return n})();var mD=(()=>{class n{template=f(Ro);_differs=f(pd);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 y0?e.headerCell.template:this instanceof pD?e.footerCell.template:e.cell.template}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,features:[Pn]})}return n})(),y0=(()=>{class n extends mD{_table=f(Xl,{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(Ro),f(pd))}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=vt({type:n,selectors:[["","cdkHeaderRowDef",""]],inputs:{columns:[0,"cdkHeaderRowDef","columns"],sticky:[2,"cdkHeaderRowDefSticky","sticky",yt]},features:[di,Pn]})}return n})(),pD=(()=>{class n extends mD{_table=f(Xl,{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(Ro),f(pd))}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=vt({type:n,selectors:[["","cdkFooterRowDef",""]],inputs:{columns:[0,"cdkFooterRowDef","columns"],sticky:[2,"cdkFooterRowDefSticky","sticky",yt]},features:[di,Pn]})}return n})(),Dx=(()=>{class n extends mD{_table=f(Xl,{optional:!0});when;constructor(){super(f(Ro),f(pd))}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["","cdkRowDef",""]],inputs:{columns:[0,"cdkRowDefColumns","columns"],when:[0,"cdkRowDefWhen","when"]},features:[di]})}return n})(),cu=(()=>{class n{_viewContainer=f(ro);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=vt({type:n,selectors:[["","cdkCellOutlet",""]]})}return n})(),uD=(()=>{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,i){t&1&&Fi(0,0)},dependencies:[cu],encapsulation:2})}return n})();var hD=(()=>{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,i){t&1&&Fi(0,0)},dependencies:[cu],encapsulation:2})}return n})(),pR=(()=>{class n{templateRef=f(Ro);_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=vt({type:n,selectors:[["ng-template","cdkNoDataRow",""]]})}return n})(),sR=["top","bottom","left","right"],dD=class{_isNativeHtmlTable;_stickCellCss;_isBrowser;_needsPositionStickyOnElement;direction;_positionListener;_tableInjector;_elemSizeCache=new WeakMap;_resizeObserver=globalThis?.ResizeObserver?new globalThis.ResizeObserver(o=>this._updateCachedSizes(o)):null;_updatedStickyColumnsParamsToReplay=[];_stickyColumnsReplayTimeout=null;_cachedCellWidths=[];_borderCellCss;_destroyed=!1;constructor(o,e,t=!0,i=!0,r,a,c){this._isNativeHtmlTable=o,this._stickCellCss=e,this._isBrowser=t,this._needsPositionStickyOnElement=i,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(o,e){(e.includes("left")||e.includes("right"))&&this._removeFromStickyColumnReplayQueue(o);let t=[];for(let i of o)i.nodeType===i.ELEMENT_NODE&&t.push(i,...Array.from(i.children));Ja({write:()=>{for(let i of t)this._removeStickyStyle(i,e)}},{injector:this._tableInjector})}updateStickyColumns(o,e,t,i=!0,r=!0){if(!o.length||!this._isBrowser||!(e.some(w=>w)||t.some(w=>w))){this._positionListener?.stickyColumnsUpdated({sizes:[]}),this._positionListener?.stickyEndColumnsUpdated({sizes:[]});return}let a=o[0],c=a.children.length,p=this.direction==="rtl",u=p?"right":"left",h=p?"left":"right",g=e.lastIndexOf(!0),y=t.indexOf(!0),b,x,M;r&&this._updateStickyColumnReplayQueue({rows:[...o],stickyStartStates:[...e],stickyEndStates:[...t]}),Ja({earlyRead:()=>{b=this._getCellWidths(a,i),x=this._getStickyStartColumnPositions(b,e),M=this._getStickyEndColumnPositions(b,t)},write:()=>{for(let w of o)for(let S=0;S<c;S++){let E=w.children[S];e[S]&&this._addStickyStyle(E,u,x[S],S===g),t[S]&&this._addStickyStyle(E,h,M[S],S===y)}this._positionListener&&b.some(w=>!!w)&&(this._positionListener.stickyColumnsUpdated({sizes:g===-1?[]:b.slice(0,g+1).map((w,S)=>e[S]?w:null)}),this._positionListener.stickyEndColumnsUpdated({sizes:y===-1?[]:b.slice(y).map((w,S)=>t[S+y]?w:null).reverse()}))}},{injector:this._tableInjector})}stickRows(o,e,t){if(!this._isBrowser)return;let i=t==="bottom"?o.slice().reverse():o,r=t==="bottom"?e.slice().reverse():e,a=[],c=[],p=[];Ja({earlyRead:()=>{for(let u=0,h=0;u<i.length;u++){if(!r[u])continue;a[u]=h;let g=i[u];p[u]=this._isNativeHtmlTable?Array.from(g.children):[g];let y=this._retrieveElementSize(g).height;h+=y,c[u]=y}},write:()=>{let u=r.lastIndexOf(!0);for(let h=0;h<i.length;h++){if(!r[h])continue;let g=a[h],y=h===u;for(let b of p[h])this._addStickyStyle(b,t,g,y)}t==="top"?this._positionListener?.stickyHeaderRowsUpdated({sizes:c,offsets:a,elements:p}):this._positionListener?.stickyFooterRowsUpdated({sizes:c,offsets:a,elements:p})}},{injector:this._tableInjector})}updateStickyFooterContainer(o,e){this._isNativeHtmlTable&&Ja({write:()=>{let t=o.querySelector("tfoot");t&&(e.some(i=>!i)?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(o,e){if(!o.classList.contains(this._stickCellCss))return;for(let i of e)o.style[i]="",o.classList.remove(this._borderCellCss[i]);sR.some(i=>e.indexOf(i)===-1&&o.style[i])?o.style.zIndex=this._getCalculatedZIndex(o):(o.style.zIndex="",this._needsPositionStickyOnElement&&(o.style.position=""),o.classList.remove(this._stickCellCss))}_addStickyStyle(o,e,t,i){o.classList.add(this._stickCellCss),i&&o.classList.add(this._borderCellCss[e]),o.style[e]=`${t}px`,o.style.zIndex=this._getCalculatedZIndex(o),this._needsPositionStickyOnElement&&(o.style.cssText+="position: -webkit-sticky; position: sticky; ")}_getCalculatedZIndex(o){let e={top:100,bottom:10,left:1,right:1},t=0;for(let i of sR)o.style[i]&&(t+=e[i]);return t?`${t}`:""}_getCellWidths(o,e=!0){if(!e&&this._cachedCellWidths.length)return this._cachedCellWidths;let t=[],i=o.children;for(let r=0;r<i.length;r++){let a=i[r];t.push(this._retrieveElementSize(a).width)}return this._cachedCellWidths=t,t}_getStickyStartColumnPositions(o,e){let t=[],i=0;for(let r=0;r<o.length;r++)e[r]&&(t[r]=i,i+=o[r]);return t}_getStickyEndColumnPositions(o,e){let t=[],i=0;for(let r=o.length;r>0;r--)e[r]&&(t[r]=i,i+=o[r]);return t}_retrieveElementSize(o){let e=this._elemSizeCache.get(o);if(e)return e;let t=o.getBoundingClientRect(),i={width:t.width,height:t.height};return this._resizeObserver&&(this._elemSizeCache.set(o,i),this._resizeObserver.observe(o,{box:"border-box"})),i}_updateStickyColumnReplayQueue(o){this._removeFromStickyColumnReplayQueue(o.rows),this._stickyColumnsReplayTimeout||this._updatedStickyColumnsParamsToReplay.push(o)}_removeFromStickyColumnReplayQueue(o){let e=new Set(o);for(let t of this._updatedStickyColumnsParamsToReplay)t.rows=t.rows.filter(i=>!e.has(i));this._updatedStickyColumnsParamsToReplay=this._updatedStickyColumnsParamsToReplay.filter(t=>!!t.rows.length)}_updateCachedSizes(o){let e=!1;for(let t of o){let i=t.borderBoxSize?.length?{width:t.borderBoxSize[0].inlineSize,height:t.borderBoxSize[0].blockSize}:{width:t.contentRect.width,height:t.contentRect.height};i.width!==this._elemSizeCache.get(t.target)?.width&&BJ(t.target)&&(e=!0),this._elemSizeCache.set(t.target,i)}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 BJ(n){return["cdk-cell","cdk-header-cell","cdk-footer-cell"].some(o=>n.classList.contains(o))}var b0=new cn("STICKY_POSITIONING_LISTENER");var fD=(()=>{class n{viewContainer=f(ro);elementRef=f(Jt);constructor(){let e=f(Xl);e._rowOutlet=this,e._outletAssigned()}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["","rowOutlet",""]]})}return n})(),gD=(()=>{class n{viewContainer=f(ro);elementRef=f(Jt);constructor(){let e=f(Xl);e._headerRowOutlet=this,e._outletAssigned()}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["","headerRowOutlet",""]]})}return n})(),_D=(()=>{class n{viewContainer=f(ro);elementRef=f(Jt);constructor(){let e=f(Xl);e._footerRowOutlet=this,e._outletAssigned()}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["","footerRowOutlet",""]]})}return n})(),vD=(()=>{class n{viewContainer=f(ro);elementRef=f(Jt);constructor(){let e=f(Xl);e._noDataRowOutlet=this,e._outletAssigned()}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["","noDataRowOutlet",""]]})}return n})(),CD=(()=>{class n{_differs=f(pd);_changeDetectorRef=f(X);_elementRef=f(Jt);_dir=f(es,{optional:!0});_platform=f(Es);_viewRepeater;_viewportRuler=f(hd);_injector=f(rr);_virtualScrollViewport=f(v4,{optional:!0,host:!0});_positionListener=f(b0,{optional:!0})||f(b0,{optional:!0,skipSelf:!0});_document=f(Qi);_data;_renderedRange;_onDestroy=new We;_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 We;_footerRowStickyUpdates=new We;_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 We;_dataStream=new We;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 _e;viewChange=new tn({start:0,end:Number.MAX_VALUE});_rowOutlet;_headerRowOutlet;_footerRowOutlet;_noDataRowOutlet;_contentColumnDefs;_contentRowDefs;_contentHeaderRowDefs;_contentFooterRowDefs;_noDataRow;constructor(){f(new hc("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,i)=>this.trackBy?this.trackBy(i.dataIndex,i.data):i)}ngOnInit(){this._setupStickyStyler(),this._viewportRuler.change().pipe(Ge(this._onDestroy)).subscribe(()=>{this._forceRecalculateCellWidths=!0})}ngAfterContentInit(){this._viewRepeater=this.recycleRows||this._virtualScrollEnabled()?new g4:new w4,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(),Yu(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,(i,r,a)=>this._getEmbeddedViewArgs(i.item,a),i=>i.item.data,i=>{i.operation===f4.INSERTED&&i.context&&this._renderCellTemplateForItem(i.record.item.rowDef,i.context)}),this._updateRowIndexContext(),e.forEachIdentityChange(i=>{let r=t.get(i.currentIndex);r.context.$implicit=i.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 i=lR(this._headerRowOutlet,"thead");i&&(i.style.display=e.length?"":"none")}let t=this._headerRowDefs.map(i=>i.sticky);this._stickyStyler.clearStickyPositioning(e,["top"]),this._stickyStyler.stickRows(e,t,"top"),this._headerRowDefs.forEach(i=>i.resetStickyChanged())}updateStickyFooterRowStyles(){let e=this._getRenderedRows(this._footerRowOutlet);if(this._isNativeHtmlTable){let i=lR(this._footerRowOutlet,"tfoot");i&&(i.style.display=e.length?"":"none")}let t=this._footerRowDefs.map(i=>i.sticky);this._stickyStyler.clearStickyPositioning(e,["bottom"]),this._stickyStyler.stickRows(e,t,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,t),this._footerRowDefs.forEach(i=>i.resetStickyChanged())}updateStickyColumnStyles(){let e=this._getRenderedRows(this._headerRowOutlet),t=this._getRenderedRows(this._rowOutlet),i=this._getRenderedRows(this._footerRowOutlet);(this._isNativeHtmlTable&&!this.fixedLayout||this._stickyColumnStylesNeedReset)&&(this._stickyStyler.clearStickyPositioning([...e,...t,...i],["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)}),i.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),i=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,i.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,i){return this._getRowDefs(e,t).map(a=>{let c=i&&i.has(a)?i.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(),Mx(this._getOwnDefs(this._contentColumnDefs),this._customColumnDefs).forEach(t=>{this._columnDefsByName.has(t.name),this._columnDefsByName.set(t.name,t)})}_cacheRowDefs(){this._headerRowDefs=Mx(this._getOwnDefs(this._contentHeaderRowDefs),this._customHeaderRowDefs),this._footerRowDefs=Mx(this._getOwnDefs(this._contentFooterRowDefs),this._customFooterRowDefs),this._rowDefs=Mx(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 i=this._headerRowDefs.reduce(e,!1);i&&this._forceRenderHeaderRows();let r=this._footerRowDefs.reduce(e,!1);return r&&this._forceRenderFooterRows(),t||i||r}_switchDataSource(e){this._data=[],Yu(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;Yu(this.dataSource)?e=this.dataSource.connect(this):jg(this.dataSource)?e=this.dataSource:Array.isArray(this.dataSource)&&(e=Nn(this.dataSource)),this._renderChangeSubscription=Lr([e,this.viewChange]).pipe(Ge(this._onDestroy)).subscribe(([t,i])=>{this._data=t||[],this._renderedRange=i,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 i=Array.from(t?.columns||[]).map(c=>{let p=this._columnDefsByName.get(c);return p}),r=i.map(c=>c.sticky),a=i.map(c=>c.stickyEnd);this._stickyStyler.updateStickyColumns(e,r,a,!this.fixedLayout||this._forceRecalculateCellWidths)}_getRenderedRows(e){let t=[];for(let i=0;i<e.viewContainer.length;i++){let r=e.viewContainer.get(i);t.push(r.rootNodes[0])}return t}_getRowDefs(e,t){if(this._rowDefs.length===1)return[this._rowDefs[0]];let i=[];if(this.multiTemplateDataRows)i=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&&i.push(r)}return i.length,i}_getEmbeddedViewArgs(e,t){let i=e.rowDef,r={$implicit:e.data};return{templateRef:i.template,context:r,index:t}}_renderRow(e,t,i,r={}){let a=e.viewContainer.createEmbeddedView(t.template,r,i);return this._renderCellTemplateForItem(t,r),a}_renderCellTemplateForItem(e,t){for(let i of this._getCellTemplates(e))cu.mostRecentCellOutlet&&cu.mostRecentCellOutlet._viewContainer.createEmbeddedView(i,t);this._changeDetectorRef.markForCheck()}_updateRowIndexContext(){let e=this._rowOutlet.viewContainer;for(let t=0,i=e.length;t<i;t++){let a=e.get(t).context;a.count=i,a.first=t===0,a.last=t===i-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 i=this._columnDefsByName.get(t);return e.extractCellTemplate(i)})}_forceRenderDataRows(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows()}_checkStickyStates(){let e=(t,i)=>t||i.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 dD(this._isNativeHtmlTable,this.stickyCssClass,this._platform.isBrowser,this.needsPositionStickyOnElement,e,this,t),(this._dir?this._dir.change:Nn()).pipe(Ge(this._onDestroy)).subscribe(i=>{this._stickyStyler.direction=i,this.updateStickyColumnStyles()})}_setupVirtualScrolling(e){let t=typeof requestAnimationFrame<"u"?qs:FO;this.viewChange.next({start:0,end:0}),e.renderedRangeStream.pipe(Qs(0,t),Ge(this._onDestroy)).subscribe(this.viewChange),e.attach({dataStream:this._dataStream,measureRangeSize:(i,r)=>this._measureRangeSize(i,r)}),Lr([e.renderedContentOffset,this._headerRowStickyUpdates]).pipe(Ge(this._onDestroy)).subscribe(([i,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=i!==0?Math.max(i-p,p):-p;for(let h of c)h.style.top=`${-u}px`}}}),Lr([e.renderedContentOffset,this._footerRowStickyUpdates]).pipe(Ge(this._onDestroy)).subscribe(([i,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=`${i+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 i=this._noDataRowOutlet.viewContainer;if(t){let r=i.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 i.clear();this._isShowingNoDataRow=t,this._changeDetectorRef.markForCheck()}_measureRangeSize(e,t){if(e.start>=e.end||t!=="vertical")return 0;let i=this.viewChange.value,r=this._rowOutlet.viewContainer;e.start<i.start||e.end>i.end;let a=e.start-i.start,c=e.end-e.start,p,u;for(let y=0;y<c;y++){let b=r.get(y+a);if(b&&b.rootNodes.length){p=u=b.rootNodes[0];break}}for(let y=c-1;y>-1;y--){let b=r.get(y+a);if(b&&b.rootNodes.length){u=b.rootNodes[b.rootNodes.length-1];break}}let h=p?.getBoundingClientRect?.(),g=u?.getBoundingClientRect?.();return h&&g?g.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,i,r){if(t&1&&Zi(r,pR,5)(r,km,5)(r,Dx,5)(r,y0,5)(r,pD,5),t&2){let a;mt(a=pt())&&(i._noDataRow=a.first),mt(a=pt())&&(i._contentColumnDefs=a),mt(a=pt())&&(i._contentRowDefs=a),mt(a=pt())&&(i._contentHeaderRowDefs=a),mt(a=pt())&&(i._contentFooterRowDefs=a)}},hostAttrs:[1,"cdk-table"],hostVars:2,hostBindings:function(t,i){t&2&&Ae("cdk-table-fixed-layout",i.fixedLayout)},inputs:{trackBy:"trackBy",dataSource:"dataSource",multiTemplateDataRows:[2,"multiTemplateDataRows","multiTemplateDataRows",yt],fixedLayout:[2,"fixedLayout","fixedLayout",yt],recycleRows:[2,"recycleRows","recycleRows",yt]},outputs:{contentChanged:"contentChanged"},exportAs:["cdkTable"],features:[fn([{provide:Xl,useExisting:n},{provide:b0,useValue:null}])],ngContentSelectors:FJ,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(t,i){t&1&&(ai(NJ),an(0),an(1,1),I(2,RJ,1,0),I(3,LJ,7,0)(4,VJ,4,0)),t&2&&(m(2),A(i._isServer?2:-1),m(),A(i._isNativeHtmlTable?3:4))},dependencies:[gD,fD,vD,_D],styles:[`.cdk-table-fixed-layout {
|
||
table-layout: fixed;
|
||
}
|
||
`],encapsulation:2})}return n})();function Mx(n,o){return n.concat(Array.from(o))}function lR(n,o){let e=o.toUpperCase(),t=n.viewContainer.element.nativeElement;for(;t;){let i=t.nodeType===1?t.nodeName:null;if(i===e)return t;if(i==="TABLE")break;t=t.parentNode}return null}var Px=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[yC]})}return n})();var uR=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[fd,_i,fd]})}return n})();var Xn=(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})(Xn||{}),pl="*";function xD(n,o){return{type:Xn.Trigger,name:n,definitions:o,options:{}}}function bD(n,o=null){return{type:Xn.Animate,styles:o,timings:n}}function hR(n,o=null){return{type:Xn.Sequence,steps:n,options:o}}function mu(n){return{type:Xn.Style,styles:n,offset:null}}function Ix(n,o,e){return{type:Xn.State,name:n,styles:o,options:e}}function yD(n,o,e=null){return{type:Xn.Transition,expr:n,animation:o,options:e}}var Rc=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(o=0,e=0){this.totalTime=o+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(o=>o()),this._onDoneFns=[])}onStart(o){this._originalOnStartFns.push(o),this._onStartFns.push(o)}onDone(o){this._originalOnDoneFns.push(o),this._onDoneFns.push(o)}onDestroy(o){this._onDestroyFns.push(o)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(o=>o()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(o=>o()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(o){this._position=this.totalTime?o*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(o){let e=o=="start"?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}},du=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(o){this.players=o;let e=0,t=0,i=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(()=>{++i==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(o=>o()),this._onDoneFns=[])}init(){this.players.forEach(o=>o.init())}onStart(o){this._onStartFns.push(o)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(o=>o()),this._onStartFns=[])}onDone(o){this._onDoneFns.push(o)}onDestroy(o){this._onDestroyFns.push(o)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(o=>o.play())}pause(){this.players.forEach(o=>o.pause())}restart(){this.players.forEach(o=>o.restart())}finish(){this._onFinish(),this.players.forEach(o=>o.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(o=>o.destroy()),this._onDestroyFns.forEach(o=>o()),this._onDestroyFns=[])}reset(){this.players.forEach(o=>o.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(o){let e=o*this.totalTime;this.players.forEach(t=>{let i=t.totalTime?Math.min(1,e/t.totalTime):1;t.setPosition(i)})}getPosition(){let o=this.players.reduce((e,t)=>e===null||t.totalTime>e.totalTime?t:e,null);return o!=null?o.getPosition():0}beforeDestroy(){this.players.forEach(o=>{o.beforeDestroy&&o.beforeDestroy()})}triggerCallback(o){let e=o=="start"?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}},Yh="!";function fR(n){return new Mi(3e3,!1)}function zJ(){return new Mi(3100,!1)}function jJ(){return new Mi(3101,!1)}function $J(n){return new Mi(3001,!1)}function HJ(n){return new Mi(3003,!1)}function UJ(n){return new Mi(3004,!1)}function _R(n,o){return new Mi(3005,!1)}function vR(){return new Mi(3006,!1)}function CR(){return new Mi(3007,!1)}function xR(n,o){return new Mi(3008,!1)}function bR(n){return new Mi(3002,!1)}function yR(n,o,e,t,i){return new Mi(3010,!1)}function SR(){return new Mi(3011,!1)}function wR(){return new Mi(3012,!1)}function MR(){return new Mi(3200,!1)}function kR(){return new Mi(3202,!1)}function TR(){return new Mi(3013,!1)}function ER(n){return new Mi(3014,!1)}function DR(n){return new Mi(3015,!1)}function PR(n){return new Mi(3016,!1)}function IR(n,o){return new Mi(3404,!1)}function WJ(n){return new Mi(3502,!1)}function AR(n){return new Mi(3503,!1)}function OR(){return new Mi(3300,!1)}function NR(n){return new Mi(3504,!1)}function FR(n){return new Mi(3301,!1)}function RR(n,o){return new Mi(3302,!1)}function LR(n){return new Mi(3303,!1)}function VR(n,o){return new Mi(3400,!1)}function BR(n){return new Mi(3401,!1)}function zR(n){return new Mi(3402,!1)}function jR(n,o){return new Mi(3505,!1)}function Dd(n){switch(n.length){case 0:return new Rc;case 1:return n[0];default:return new du(n)}}function kD(n,o,e=new Map,t=new Map){let i=[],r=[],a=-1,c=null;if(o.forEach(p=>{let u=p.get("offset"),h=u==a,g=h&&c||new Map;p.forEach((y,b)=>{let x=b,M=y;if(b!=="offset")switch(x=n.normalizePropertyName(x,i),M){case Yh:M=e.get(b);break;case pl:M=t.get(b);break;default:M=n.normalizeStyleValue(b,x,M,i);break}g.set(x,M)}),h||r.push(g),c=g,a=u}),i.length)throw WJ(i);return r}function Ax(n,o,e,t){switch(o){case"start":n.onStart(()=>t(e&&SD(e,"start",n)));break;case"done":n.onDone(()=>t(e&&SD(e,"done",n)));break;case"destroy":n.onDestroy(()=>t(e&&SD(e,"destroy",n)));break}}function SD(n,o,e){let t=e.totalTime,i=!!e.disabled,r=Ox(n.element,n.triggerName,n.fromState,n.toState,o||n.phaseName,t??n.totalTime,i),a=n._data;return a!=null&&(r._data=a),r}function Ox(n,o,e,t,i="",r=0,a){return{element:n,triggerName:o,fromState:e,toState:t,phaseName:i,totalTime:r,disabled:!!a}}function us(n,o,e){let t=n.get(o);return t||n.set(o,t=e),t}function TD(n){let o=n.indexOf(":"),e=n.substring(1,o),t=n.slice(o+1);return[e,t]}var GJ=typeof document>"u"?null:document.documentElement;function Nx(n){let o=n.parentNode||n.host||null;return o===GJ?null:o}function qJ(n){return n.substring(1,6)=="ebkit"}var pu=null,gR=!1;function $R(n){pu||(pu=QJ()||{},gR=pu.style?"WebkitAppearance"in pu.style:!1);let o=!0;return pu.style&&!qJ(n)&&(o=n in pu.style,!o&&gR&&(o="Webkit"+n.charAt(0).toUpperCase()+n.slice(1)in pu.style)),o}function QJ(){return typeof document<"u"?document.body:null}function ED(n,o){for(;o;){if(o===n)return!0;o=Nx(o)}return!1}function DD(n,o,e){if(e)return Array.from(n.querySelectorAll(o));let t=n.querySelector(o);return t?[t]:[]}var XJ=1e3,PD="{{",KJ="}}",ID="ng-enter",Fx="ng-leave",S0="ng-trigger",w0=".ng-trigger",AD="ng-animating",Rx=".ng-animating";function Lc(n){if(typeof n=="number")return n;let o=n.match(/^(-?[\.\d]+)(m?s)/);return!o||o.length<2?0:wD(parseFloat(o[1]),o[2])}function wD(n,o){return o==="s"?n*XJ:n}function M0(n,o,e){return n.hasOwnProperty("duration")?n:ZJ(n,o,e)}var YJ=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function ZJ(n,o,e){let t,i=0,r="";if(typeof n=="string"){let a=n.match(YJ);if(a===null)return o.push(fR(n)),{duration:0,delay:0,easing:""};t=wD(parseFloat(a[1]),a[2]);let c=a[3];c!=null&&(i=wD(parseFloat(c),a[4]));let p=a[5];p&&(r=p)}else t=n;if(!e){let a=!1,c=o.length;t<0&&(o.push(zJ()),a=!0),i<0&&(o.push(jJ()),a=!0),a&&o.splice(c,0,fR(n))}return{duration:t,delay:i,easing:r}}function HR(n){return n.length?n[0]instanceof Map?n:n.map(o=>new Map(Object.entries(o))):[]}function Kl(n,o,e){o.forEach((t,i)=>{let r=Lx(i);e&&!e.has(i)&&e.set(i,n.style[r]),n.style[r]=t})}function Tm(n,o){o.forEach((e,t)=>{let i=Lx(t);n.style[i]=""})}function Zh(n){return Array.isArray(n)?n.length==1?n[0]:hR(n):n}function UR(n,o,e){let t=o.params||{},i=OD(n);i.length&&i.forEach(r=>{t.hasOwnProperty(r)||e.push($J(r))})}var MD=new RegExp(`${PD}\\s*(.+?)\\s*${KJ}`,"g");function OD(n){let o=[];if(typeof n=="string"){let e;for(;e=MD.exec(n);)o.push(e[1]);MD.lastIndex=0}return o}function Jh(n,o,e){let t=`${n}`,i=t.replace(MD,(r,a)=>{let c=o[a];return c==null&&(e.push(HJ(a)),c=""),c.toString()});return i==t?n:i}var JJ=/-+([a-z0-9])/g;function Lx(n){return n.replace(JJ,(...o)=>o[1].toUpperCase())}function WR(n,o){return n===0||o===0}function GR(n,o,e){if(e.size&&o.length){let t=o[0],i=[];if(e.forEach((r,a)=>{t.has(a)||i.push(a),t.set(a,r)}),i.length)for(let r=1;r<o.length;r++){let a=o[r];i.forEach(c=>a.set(c,Vx(n,c)))}}return o}function hs(n,o,e){switch(o.type){case Xn.Trigger:return n.visitTrigger(o,e);case Xn.State:return n.visitState(o,e);case Xn.Transition:return n.visitTransition(o,e);case Xn.Sequence:return n.visitSequence(o,e);case Xn.Group:return n.visitGroup(o,e);case Xn.Animate:return n.visitAnimate(o,e);case Xn.Keyframes:return n.visitKeyframes(o,e);case Xn.Style:return n.visitStyle(o,e);case Xn.Reference:return n.visitReference(o,e);case Xn.AnimateChild:return n.visitAnimateChild(o,e);case Xn.AnimateRef:return n.visitAnimateRef(o,e);case Xn.Query:return n.visitQuery(o,e);case Xn.Stagger:return n.visitStagger(o,e);default:throw UJ(o.type)}}function Vx(n,o){return window.getComputedStyle(n)[o]}var KD=(()=>{class n{validateStyleProperty(e){return $R(e)}containsElement(e,t){return ED(e,t)}getParentElement(e){return Nx(e)}query(e,t,i){return DD(e,t,i)}computeStyle(e,t,i){return i||""}animate(e,t,i,r,a,c=[],p){return new Rc(i,r)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})(),hu=class{static NOOP=new KD},fu=class{};var eee=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"]),Hx=class extends fu{normalizePropertyName(o,e){return Lx(o)}normalizeStyleValue(o,e,t,i){let r="",a=t.toString().trim();if(eee.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&&i.push(_R(o,t))}return a+r}};var Ux="*";function tee(n,o){let e=[];return typeof n=="string"?n.split(/\s*,\s*/).forEach(t=>nee(t,e,o)):e.push(n),e}function nee(n,o,e){if(n[0]==":"){let p=iee(n,e);if(typeof p=="function"){o.push(p);return}n=p}let t=n.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(t==null||t.length<4)return e.push(DR(n)),o;let i=t[1],r=t[2],a=t[3];o.push(qR(i,a));let c=i==Ux&&a==Ux;r[0]=="<"&&!c&&o.push(qR(a,i))}function iee(n,o){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 o.push(PR(n)),"* => *"}}var Bx=new Set(["true","1"]),zx=new Set(["false","0"]);function qR(n,o){let e=Bx.has(n)||zx.has(n),t=Bx.has(o)||zx.has(o);return(i,r)=>{let a=n==Ux||n==i,c=o==Ux||o==r;return!a&&e&&typeof i=="boolean"&&(a=i?Bx.has(n):zx.has(n)),!c&&t&&typeof r=="boolean"&&(c=r?Bx.has(o):zx.has(o)),a&&c}}var i8=":self",oee=new RegExp(`s*${i8}s*,?`,"g");function o8(n,o,e,t){return new BD(n).build(o,e,t)}var QR="",BD=class{_driver;constructor(o){this._driver=o}build(o,e,t){let i=new zD(e);return this._resetContextStyleTimingState(i),hs(this,Zh(o),i)}_resetContextStyleTimingState(o){o.currentQuerySelector=QR,o.collectedStyles=new Map,o.collectedStyles.set(QR,new Map),o.currentTime=0}visitTrigger(o,e){let t=e.queryCount=0,i=e.depCount=0,r=[],a=[];return o.name.charAt(0)=="@"&&e.errors.push(vR()),o.definitions.forEach(c=>{if(this._resetContextStyleTimingState(e),c.type==Xn.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==Xn.Transition){let p=this.visitTransition(c,e);t+=p.queryCount,i+=p.depCount,a.push(p)}else e.errors.push(CR())}),{type:Xn.Trigger,name:o.name,states:r,transitions:a,queryCount:t,depCount:i,options:null}}visitState(o,e){let t=this.visitStyle(o.styles,e),i=o.options&&o.options.params||null;if(t.containsDynamicStyles){let r=new Set,a=i||{};t.styles.forEach(c=>{c instanceof Map&&c.forEach(p=>{OD(p).forEach(u=>{a.hasOwnProperty(u)||r.add(u)})})}),r.size&&e.errors.push(xR(o.name,[...r.values()]))}return{type:Xn.State,name:o.name,style:t,options:i?{params:i}:null}}visitTransition(o,e){e.queryCount=0,e.depCount=0;let t=hs(this,Zh(o.animation),e),i=tee(o.expr,e.errors);return{type:Xn.Transition,matchers:i,animation:t,queryCount:e.queryCount,depCount:e.depCount,options:uu(o.options)}}visitSequence(o,e){return{type:Xn.Sequence,steps:o.steps.map(t=>hs(this,t,e)),options:uu(o.options)}}visitGroup(o,e){let t=e.currentTime,i=0,r=o.steps.map(a=>{e.currentTime=t;let c=hs(this,a,e);return i=Math.max(i,e.currentTime),c});return e.currentTime=i,{type:Xn.Group,steps:r,options:uu(o.options)}}visitAnimate(o,e){let t=lee(o.timings,e.errors);e.currentAnimateTimings=t;let i,r=o.styles?o.styles:mu({});if(r.type==Xn.Keyframes)i=this.visitKeyframes(r,e);else{let a=o.styles,c=!1;if(!a){c=!0;let u={};t.easing&&(u.easing=t.easing),a=mu(u)}e.currentTime+=t.duration+t.delay;let p=this.visitStyle(a,e);p.isEmptyStep=c,i=p}return e.currentAnimateTimings=null,{type:Xn.Animate,timings:t,style:i,options:null}}visitStyle(o,e){let t=this._makeStyleAst(o,e);return this._validateStyleAst(t,e),t}_makeStyleAst(o,e){let t=[],i=Array.isArray(o.styles)?o.styles:[o.styles];for(let c of i)typeof c=="string"?c===pl?t.push(c):e.errors.push(bR(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(PD)>=0){r=!0;break}}}),{type:Xn.Style,styles:t,easing:a,offset:o.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(o,e){let t=e.currentAnimateTimings,i=e.currentTime,r=e.currentTime;t&&r>0&&(r-=t.duration+t.delay),o.styles.forEach(a=>{typeof a!="string"&&a.forEach((c,p)=>{let u=e.collectedStyles.get(e.currentQuerySelector),h=u.get(p),g=!0;h&&(r!=i&&r>=h.startTime&&i<=h.endTime&&(e.errors.push(yR(p,h.startTime,h.endTime,r,i)),g=!1),r=h.startTime),g&&u.set(p,{startTime:r,endTime:i}),e.options&&UR(c,e.options,e.errors)})})}visitKeyframes(o,e){let t={type:Xn.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(SR()),t;let i=1,r=0,a=[],c=!1,p=!1,u=0,h=o.steps.map(S=>{let E=this._makeStyleAst(S,e),O=E.offset!=null?E.offset:see(E.styles),D=0;return O!=null&&(r++,D=E.offset=O),p=p||D<0||D>1,c=c||D<u,u=D,a.push(D),E});p&&e.errors.push(wR()),c&&e.errors.push(MR());let g=o.steps.length,y=0;r>0&&r<g?e.errors.push(kR()):r==0&&(y=i/(g-1));let b=g-1,x=e.currentTime,M=e.currentAnimateTimings,w=M.duration;return h.forEach((S,E)=>{let O=y>0?E==b?1:y*E:a[E],D=O*w;e.currentTime=x+M.delay+D,M.duration=D,this._validateStyleAst(S,e),S.offset=O,t.styles.push(S)}),t}visitReference(o,e){return{type:Xn.Reference,animation:hs(this,Zh(o.animation),e),options:uu(o.options)}}visitAnimateChild(o,e){return e.depCount++,{type:Xn.AnimateChild,options:uu(o.options)}}visitAnimateRef(o,e){return{type:Xn.AnimateRef,animation:this.visitReference(o.animation,e),options:uu(o.options)}}visitQuery(o,e){let t=e.currentQuerySelector,i=o.options||{};e.queryCount++,e.currentQuery=o;let[r,a]=ree(o.selector);e.currentQuerySelector=t.length?t+" "+r:r,us(e.collectedStyles,e.currentQuerySelector,new Map);let c=hs(this,Zh(o.animation),e);return e.currentQuery=null,e.currentQuerySelector=t,{type:Xn.Query,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:a,animation:c,originalSelector:o.selector,options:uu(o.options)}}visitStagger(o,e){e.currentQuery||e.errors.push(TR());let t=o.timings==="full"?{duration:0,delay:0,easing:"full"}:M0(o.timings,e.errors,!0);return{type:Xn.Stagger,animation:hs(this,Zh(o.animation),e),timings:t,options:null}}};function ree(n){let o=!!n.split(/\s*,\s*/).find(e=>e==i8);return o&&(n=n.replace(oee,"")),n=n.replace(/@\*/g,w0).replace(/@\w+/g,e=>w0+"-"+e.slice(1)).replace(/:animating/g,Rx),[n,o]}function aee(n){return n?Z({},n):null}var zD=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(o){this.errors=o}};function see(n){if(typeof n=="string")return null;let o=null;if(Array.isArray(n))n.forEach(e=>{if(e instanceof Map&&e.has("offset")){let t=e;o=parseFloat(t.get("offset")),t.delete("offset")}});else if(n instanceof Map&&n.has("offset")){let e=n;o=parseFloat(e.get("offset")),e.delete("offset")}return o}function lee(n,o){if(n.hasOwnProperty("duration"))return n;if(typeof n=="number"){let r=M0(n,o).duration;return ND(r,0,"")}let e=n;if(e.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=ND(0,0,"");return r.dynamic=!0,r.strValue=e,r}let i=M0(e,o);return ND(i.duration,i.delay,i.easing)}function uu(n){return n?(n=Z({},n),n.params&&(n.params=aee(n.params))):n={},n}function ND(n,o,e){return{duration:n,delay:o,easing:e}}function YD(n,o,e,t,i,r,a=null,c=!1){return{type:1,element:n,keyframes:o,preStyleProps:e,postStyleProps:t,duration:i,delay:r,totalTime:i+r,easing:a,subTimeline:c}}var T0=class{_map=new Map;get(o){return this._map.get(o)||[]}append(o,e){let t=this._map.get(o);t||this._map.set(o,t=[]),t.push(...e)}has(o){return this._map.has(o)}clear(){this._map.clear()}},cee=1,dee=":enter",mee=new RegExp(dee,"g"),pee=":leave",uee=new RegExp(pee,"g");function r8(n,o,e,t,i,r=new Map,a=new Map,c,p,u=[]){return new jD().buildKeyframes(n,o,e,t,i,r,a,c,p,u)}var jD=class{buildKeyframes(o,e,t,i,r,a,c,p,u,h=[]){u=u||new T0;let g=new $D(o,e,u,i,r,h,[]);g.options=p;let y=p.delay?Lc(p.delay):0;g.currentTimeline.delayNextStep(y),g.currentTimeline.setStyles([a],null,g.errors,p),hs(this,t,g);let b=g.timelines.filter(x=>x.containsAnimation());if(b.length&&c.size){let x;for(let M=b.length-1;M>=0;M--){let w=b[M];if(w.element===e){x=w;break}}x&&!x.allowOnlyTimelineStyles()&&x.setStyles([c],null,g.errors,p)}return b.length?b.map(x=>x.buildKeyframes()):[YD(e,[],[],[],0,y,"",!1)]}visitTrigger(o,e){}visitState(o,e){}visitTransition(o,e){}visitAnimateChild(o,e){let t=e.subInstructions.get(e.element);if(t){let i=e.createSubContext(o.options),r=e.currentTimeline.currentTime,a=this._visitSubInstructions(t,i,i.options);r!=a&&e.transformIntoNewTimeline(a)}e.previousNode=o}visitAnimateRef(o,e){let t=e.createSubContext(o.options);t.transformIntoNewTimeline(),this._applyAnimationRefDelays([o.options,o.animation.options],e,t),this.visitReference(o.animation,t),e.transformIntoNewTimeline(t.currentTimeline.currentTime),e.previousNode=o}_applyAnimationRefDelays(o,e,t){for(let i of o){let r=i?.delay;if(r){let a=typeof r=="number"?r:Lc(Jh(r,i?.params??{},e.errors));t.delayNextStep(a)}}}_visitSubInstructions(o,e,t){let r=e.currentTimeline.currentTime,a=t.duration!=null?Lc(t.duration):null,c=t.delay!=null?Lc(t.delay):null;return a!==0&&o.forEach(p=>{let u=e.appendInstructionToTimeline(p,a,c);r=Math.max(r,u.duration+u.delay)}),r}visitReference(o,e){e.updateOptions(o.options,!0),hs(this,o.animation,e),e.previousNode=o}visitSequence(o,e){let t=e.subContextCount,i=e,r=o.options;if(r&&(r.params||r.delay)&&(i=e.createSubContext(r),i.transformIntoNewTimeline(),r.delay!=null)){i.previousNode.type==Xn.Style&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=Wx);let a=Lc(r.delay);i.delayNextStep(a)}o.steps.length&&(o.steps.forEach(a=>hs(this,a,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>t&&i.transformIntoNewTimeline()),e.previousNode=o}visitGroup(o,e){let t=[],i=e.currentTimeline.currentTime,r=o.options&&o.options.delay?Lc(o.options.delay):0;o.steps.forEach(a=>{let c=e.createSubContext(o.options);r&&c.delayNextStep(r),hs(this,a,c),i=Math.max(i,c.currentTimeline.currentTime),t.push(c.currentTimeline)}),t.forEach(a=>e.currentTimeline.mergeTimelineCollectedStyles(a)),e.transformIntoNewTimeline(i),e.previousNode=o}_visitTiming(o,e){if(o.dynamic){let t=o.strValue,i=e.params?Jh(t,e.params,e.errors):t;return M0(i,e.errors)}else return{duration:o.duration,delay:o.delay,easing:o.easing}}visitAnimate(o,e){let t=e.currentAnimateTimings=this._visitTiming(o.timings,e),i=e.currentTimeline;t.delay&&(e.incrementTime(t.delay),i.snapshotCurrentStyles());let r=o.style;r.type==Xn.Keyframes?this.visitKeyframes(r,e):(e.incrementTime(t.duration),this.visitStyle(r,e),i.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=o}visitStyle(o,e){let t=e.currentTimeline,i=e.currentAnimateTimings;!i&&t.hasCurrentStyleProperties()&&t.forwardFrame();let r=i&&i.easing||o.easing;o.isEmptyStep?t.applyEmptyStep(r):t.setStyles(o.styles,r,e.errors,e.options),e.previousNode=o}visitKeyframes(o,e){let t=e.currentAnimateTimings,i=e.currentTimeline.duration,r=t.duration,c=e.createSubContext().currentTimeline;c.easing=t.easing,o.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(i+r),e.previousNode=o}visitQuery(o,e){let t=e.currentTimeline.currentTime,i=o.options||{},r=i.delay?Lc(i.delay):0;r&&(e.previousNode.type===Xn.Style||t==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=Wx);let a=t,c=e.invokeQuery(o.selector,o.originalSelector,o.limit,o.includeSelf,!!i.optional,e.errors);e.currentQueryTotal=c.length;let p=null;c.forEach((u,h)=>{e.currentQueryIndex=h;let g=e.createSubContext(o.options,u);r&&g.delayNextStep(r),u===e.element&&(p=g.currentTimeline),hs(this,o.animation,g),g.currentTimeline.applyStylesToKeyframe();let y=g.currentTimeline.currentTime;a=Math.max(a,y)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(a),p&&(e.currentTimeline.mergeTimelineCollectedStyles(p),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=o}visitStagger(o,e){let t=e.parentContext,i=e.currentTimeline,r=o.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 g=h.currentTime;hs(this,o.animation,e),e.previousNode=o,t.currentStaggerTime=i.currentTime-g+(i.startTime-t.currentTimeline.startTime)}},Wx={},$D=class n{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Wx;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(o,e,t,i,r,a,c,p){this._driver=o,this.element=e,this.subInstructions=t,this._enterClassName=i,this._leaveClassName=r,this.errors=a,this.timelines=c,this.currentTimeline=p||new Gx(this._driver,e,0),c.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(o,e){if(!o)return;let t=o,i=this.options;t.duration!=null&&(i.duration=Lc(t.duration)),t.delay!=null&&(i.delay=Lc(t.delay));let r=t.params;if(r){let a=i.params;a||(a=this.options.params={}),Object.keys(r).forEach(c=>{(!e||!a.hasOwnProperty(c))&&(a[c]=Jh(r[c],a,this.errors))})}}_copyOptions(){let o={};if(this.options){let e=this.options.params;if(e){let t=o.params={};Object.keys(e).forEach(i=>{t[i]=e[i]})}}return o}createSubContext(o=null,e,t){let i=e||this.element,r=new n(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,t||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(o),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(o){return this.previousNode=Wx,this.currentTimeline=this.currentTimeline.fork(this.element,o),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(o,e,t){let i={duration:e??o.duration,delay:this.currentTimeline.currentTime+(t??0)+o.delay,easing:""},r=new HD(this._driver,o.element,o.keyframes,o.preStyleProps,o.postStyleProps,i,o.stretchStartingKeyframe);return this.timelines.push(r),i}incrementTime(o){this.currentTimeline.forwardTime(this.currentTimeline.duration+o)}delayNextStep(o){o>0&&this.currentTimeline.delayNextStep(o)}invokeQuery(o,e,t,i,r,a){let c=[];if(i&&c.push(this.element),o.length>0){o=o.replace(mee,"."+this._enterClassName),o=o.replace(uee,"."+this._leaveClassName);let p=t!=1,u=this._driver.query(this.element,o,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(ER(e)),c}},Gx=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(o,e,t,i){this._driver=o,this.element=e,this.startTime=t,this._elementTimelineStylesLookup=i,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(o){let e=this._keyframes.size===1&&this._pendingStyles.size;this.duration||e?(this.forwardTime(this.currentTime+o),e&&this.snapshotCurrentStyles()):this.startTime+=o}fork(o,e){return this.applyStylesToKeyframe(),new n(this._driver,o,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+=cee,this._loadKeyframe()}forwardTime(o){this.applyStylesToKeyframe(),this.duration=o,this._loadKeyframe()}_updateStyle(o,e){this._localTimelineStyles.set(o,e),this._globalTimelineStyles.set(o,e),this._styleSummary.set(o,{time:this.currentTime,value:e})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(o){o&&this._previousKeyframe.set("easing",o);for(let[e,t]of this._globalTimelineStyles)this._backFill.set(e,t||pl),this._currentKeyframe.set(e,pl);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(o,e,t,i){e&&this._previousKeyframe.set("easing",e);let r=i&&i.params||{},a=hee(o,this._globalTimelineStyles);for(let[c,p]of a){let u=Jh(p,r,t);this._pendingStyles.set(c,u),this._localTimelineStyles.has(c)||this._backFill.set(c,this._globalTimelineStyles.get(c)??pl),this._updateStyle(c,u)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((o,e)=>{this._currentKeyframe.set(e,o)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((o,e)=>{this._currentKeyframe.has(e)||this._currentKeyframe.set(e,o)}))}snapshotCurrentStyles(){for(let[o,e]of this._localTimelineStyles)this._pendingStyles.set(o,e),this._updateStyle(o,e)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let o=[];for(let e in this._currentKeyframe)o.push(e);return o}mergeTimelineCollectedStyles(o){o._styleSummary.forEach((e,t)=>{let i=this._styleSummary.get(t);(!i||e.time>i.time)&&this._updateStyle(t,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let o=new Set,e=new Set,t=this._keyframes.size===1&&this.duration===0,i=[];this._keyframes.forEach((c,p)=>{let u=new Map([...this._backFill,...c]);u.forEach((h,g)=>{h===Yh?o.add(g):h===pl&&e.add(g)}),t||u.set("offset",p/this.duration),i.push(u)});let r=[...o.values()],a=[...e.values()];if(t){let c=i[0],p=new Map(c);c.set("offset",0),p.set("offset",1),i=[c,p]}return YD(this.element,i,r,a,this.duration,this.startTime,this.easing,!1)}},HD=class extends Gx{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(o,e,t,i,r,a,c=!1){super(o,e,a.delay),this.keyframes=t,this.preStyleProps=i,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 o=this.keyframes,{delay:e,duration:t,easing:i}=this.timings;if(this._stretchStartingKeyframe&&e){let r=[],a=t+e,c=e/a,p=new Map(o[0]);p.set("offset",0),r.push(p);let u=new Map(o[0]);u.set("offset",XR(c)),r.push(u);let h=o.length-1;for(let g=1;g<=h;g++){let y=new Map(o[g]),b=y.get("offset"),x=e+b*t;y.set("offset",XR(x/a)),r.push(y)}t=a,e=0,i="",o=r}return YD(this.element,o,this.preStyleProps,this.postStyleProps,t,e,i,!0)}};function XR(n,o=3){let e=Math.pow(10,o-1);return Math.round(n*e)/e}function hee(n,o){let e=new Map,t;return n.forEach(i=>{if(i==="*"){t??=o.keys();for(let r of t)e.set(r,pl)}else for(let[r,a]of i)e.set(r,a)}),e}function KR(n,o,e,t,i,r,a,c,p,u,h,g,y){return{type:0,element:n,triggerName:o,isRemovalTransition:i,fromState:e,fromStyles:r,toState:t,toStyles:a,timelines:c,queriedElements:p,preStyleProps:u,postStyleProps:h,totalTime:g,errors:y}}var FD={},qx=class{_triggerName;ast;_stateStyles;constructor(o,e,t){this._triggerName=o,this.ast=e,this._stateStyles=t}match(o,e,t,i){return fee(this.ast.matchers,o,e,t,i)}buildStyles(o,e,t){let i=this._stateStyles.get("*");return o!==void 0&&(i=this._stateStyles.get(o?.toString())||i),i?i.buildStyles(e,t):new Map}build(o,e,t,i,r,a,c,p,u,h){let g=[],y=this.ast.options&&this.ast.options.params||FD,b=c&&c.params||FD,x=this.buildStyles(t,b,g),M=p&&p.params||FD,w=this.buildStyles(i,M,g),S=new Set,E=new Map,O=new Map,D=i==="void",N={params:a8(M,y),delay:this.ast.options?.delay},P=h?[]:r8(o,e,this.ast.animation,r,a,x,w,N,u,g),L=0;return P.forEach(se=>{L=Math.max(se.duration+se.delay,L)}),g.length?KR(e,this._triggerName,t,i,D,x,w,[],[],E,O,L,g):(P.forEach(se=>{let re=se.element,W=us(E,re,new Set);se.preStyleProps.forEach(ue=>W.add(ue));let $=us(O,re,new Set);se.postStyleProps.forEach(ue=>$.add(ue)),re!==e&&S.add(re)}),KR(e,this._triggerName,t,i,D,x,w,P,[...S.values()],E,O,L))}};function fee(n,o,e,t,i){return n.some(r=>r(o,e,t,i))}function a8(n,o){let e=Z({},o);return Object.entries(n).forEach(([t,i])=>{i!=null&&(e[t]=i)}),e}var UD=class{styles;defaultParams;normalizer;constructor(o,e,t){this.styles=o,this.defaultParams=e,this.normalizer=t}buildStyles(o,e){let t=new Map,i=a8(o,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((a,c)=>{a&&(a=Jh(a,i,e));let p=this.normalizer.normalizePropertyName(c,e);a=this.normalizer.normalizeStyleValue(c,p,a,e),t.set(c,a)})}),t}};function gee(n,o,e){return new WD(n,o,e)}var WD=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(o,e,t){this.name=o,this.ast=e,this._normalizer=t,e.states.forEach(i=>{let r=i.options&&i.options.params||{};this.states.set(i.name,new UD(i.style,r,t))}),YR(this.states,"true","1"),YR(this.states,"false","0"),e.transitions.forEach(i=>{this.transitionFactories.push(new qx(o,i,this.states))}),this.fallbackTransition=_ee(o,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(o,e,t,i){return this.transitionFactories.find(a=>a.match(o,e,t,i))||null}matchStyles(o,e,t){return this.fallbackTransition.buildStyles(o,e,t)}};function _ee(n,o,e){let t=[(a,c)=>!0],i={type:Xn.Sequence,steps:[],options:null},r={type:Xn.Transition,animation:i,matchers:t,options:null,queryCount:0,depCount:0};return new qx(n,r,o)}function YR(n,o,e){n.has(o)?n.has(e)||n.set(e,n.get(o)):n.has(e)&&n.set(o,n.get(e))}var vee=new T0,GD=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(o,e,t){this.bodyNode=o,this._driver=e,this._normalizer=t}register(o,e){let t=[],i=[],r=o8(this._driver,e,t,i);if(t.length)throw AR(t);this._animations.set(o,r)}_buildPlayer(o,e,t){let i=o.element,r=kD(this._normalizer,o.keyframes,e,t);return this._driver.animate(i,r,o.duration,o.delay,o.easing,[],!0)}create(o,e,t={}){let i=[],r=this._animations.get(o),a,c=new Map;if(r?(a=r8(this._driver,e,r,ID,Fx,new Map,new Map,t,vee,i),a.forEach(h=>{let g=us(c,h.element,new Map);h.postStyleProps.forEach(y=>g.set(y,null))})):(i.push(OR()),a=[]),i.length)throw NR(i);c.forEach((h,g)=>{h.forEach((y,b)=>{h.set(b,this._driver.computeStyle(g,b,pl))})});let p=a.map(h=>{let g=c.get(h.element);return this._buildPlayer(h,new Map,g)}),u=Dd(p);return this._playersById.set(o,u),u.onDestroy(()=>this.destroy(o)),this.players.push(u),u}destroy(o){let e=this._getPlayer(o);e.destroy(),this._playersById.delete(o);let t=this.players.indexOf(e);t>=0&&this.players.splice(t,1)}_getPlayer(o){let e=this._playersById.get(o);if(!e)throw FR(o);return e}listen(o,e,t,i){let r=Ox(e,"","","");return Ax(this._getPlayer(o),t,r,i),()=>{}}command(o,e,t,i){if(t=="register"){this.register(o,i[0]);return}if(t=="create"){let a=i[0]||{};this.create(o,e,a);return}let r=this._getPlayer(o);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(i[0]));break;case"destroy":this.destroy(o);break}}},ZR="ng-animate-queued",Cee=".ng-animate-queued",RD="ng-animate-disabled",xee=".ng-animate-disabled",bee="ng-star-inserted",yee=".ng-star-inserted",See=[],s8={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},wee={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Yl="__ng_removed",E0=class{namespaceId;value;options;get params(){return this.options.params}constructor(o,e=""){this.namespaceId=e;let t=o&&o.hasOwnProperty("value"),i=t?o.value:o;if(this.value=kee(i),t){let r=o,{value:a}=r,c=rC(r,["value"]);this.options=c}else this.options={};this.options.params||(this.options.params={})}absorbOptions(o){let e=o.params;if(e){let t=this.options.params;Object.keys(e).forEach(i=>{t[i]==null&&(t[i]=e[i])})}}},k0="void",LD=new E0(k0),qD=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(o,e,t){this.id=o,this.hostElement=e,this._engine=t,this._hostClassName="ng-tns-"+o,ul(e,this._hostClassName)}listen(o,e,t,i){if(!this._triggers.has(e))throw RR(t,e);if(t==null||t.length==0)throw LR(e);if(!Tee(t))throw VR(t,e);let r=us(this._elementListeners,o,[]),a={name:e,phase:t,callback:i};r.push(a);let c=us(this._engine.statesByElement,o,new Map);return c.has(e)||(ul(o,S0),ul(o,S0+"-"+e),c.set(e,LD)),()=>{this._engine.afterFlush(()=>{let p=r.indexOf(a);p>=0&&r.splice(p,1),this._triggers.has(e)||c.delete(e)})}}register(o,e){return this._triggers.has(o)?!1:(this._triggers.set(o,e),!0)}_getTrigger(o){let e=this._triggers.get(o);if(!e)throw BR(o);return e}trigger(o,e,t,i=!0){let r=this._getTrigger(e),a=new D0(this.id,e,o),c=this._engine.statesByElement.get(o);c||(ul(o,S0),ul(o,S0+"-"+e),this._engine.statesByElement.set(o,c=new Map));let p=c.get(e),u=new E0(t,this.id);if(!(t&&t.hasOwnProperty("value"))&&p&&u.absorbOptions(p.options),c.set(e,u),p||(p=LD),!(u.value===k0)&&p.value===u.value){if(!Pee(p.params,u.params)){let M=[],w=r.matchStyles(p.value,p.params,M),S=r.matchStyles(u.value,u.params,M);M.length?this._engine.reportError(M):this._engine.afterFlush(()=>{Tm(o,w),Kl(o,S)})}return}let y=us(this._engine.playersByElement,o,[]);y.forEach(M=>{M.namespaceId==this.id&&M.triggerName==e&&M.queued&&M.destroy()});let b=r.matchTransition(p.value,u.value,o,u.params),x=!1;if(!b){if(!i)return;b=r.fallbackTransition,x=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:o,triggerName:e,transition:b,fromState:p,toState:u,player:a,isFallbackTransition:x}),x||(ul(o,ZR),a.onStart(()=>{ef(o,ZR)})),a.onDone(()=>{let M=this.players.indexOf(a);M>=0&&this.players.splice(M,1);let w=this._engine.playersByElement.get(o);if(w){let S=w.indexOf(a);S>=0&&w.splice(S,1)}}),this.players.push(a),y.push(a),a}deregister(o){this._triggers.delete(o),this._engine.statesByElement.forEach(e=>e.delete(o)),this._elementListeners.forEach((e,t)=>{this._elementListeners.set(t,e.filter(i=>i.name!=o))})}clearElementCache(o){this._engine.statesByElement.delete(o),this._elementListeners.delete(o);let e=this._engine.playersByElement.get(o);e&&(e.forEach(t=>t.destroy()),this._engine.playersByElement.delete(o))}_signalRemovalForInnerTriggers(o,e){let t=this._engine.driver.query(o,w0,!0);t.forEach(i=>{if(i[Yl])return;let r=this._engine.fetchNamespacesByElement(i);r.size?r.forEach(a=>a.triggerLeaveAnimation(i,e,!1,!0)):this.clearElementCache(i)}),this._engine.afterFlushAnimationsDone(()=>t.forEach(i=>this.clearElementCache(i)))}triggerLeaveAnimation(o,e,t,i){let r=this._engine.statesByElement.get(o),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(o,u,k0,i);h&&c.push(h)}}),c.length)return this._engine.markElementAsRemoved(this.id,o,!0,e,a),t&&Dd(c).onDone(()=>this._engine.processLeaveNode(o)),!0}return!1}prepareLeaveAnimationListeners(o){let e=this._elementListeners.get(o),t=this._engine.statesByElement.get(o);if(e&&t){let i=new Set;e.forEach(r=>{let a=r.name;if(i.has(a))return;i.add(a);let p=this._triggers.get(a).fallbackTransition,u=t.get(a)||LD,h=new E0(k0),g=new D0(this.id,a,o);this._engine.totalQueuedPlayers++,this._queue.push({element:o,triggerName:a,transition:p,fromState:u,toState:h,player:g,isFallbackTransition:!0})})}}removeNode(o,e){let t=this._engine;if(o.childElementCount&&this._signalRemovalForInnerTriggers(o,e),this.triggerLeaveAnimation(o,e,!0))return;let i=!1;if(t.totalAnimations){let r=t.players.length?t.playersByQueriedElement.get(o):[];if(r&&r.length)i=!0;else{let a=o;for(;a=a.parentNode;)if(t.statesByElement.get(a)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(o),i)t.markElementAsRemoved(this.id,o,!1,e);else{let r=o[Yl];(!r||r===s8)&&(t.afterFlush(()=>this.clearElementCache(o)),t.destroyInnerAnimations(o),t._onRemovalComplete(o,e))}}insertNode(o,e){ul(o,this._hostClassName)}drainQueuedTransitions(o){let e=[];return this._queue.forEach(t=>{let i=t.player;if(i.destroyed)return;let r=t.element,a=this._elementListeners.get(r);a&&a.forEach(c=>{if(c.name==t.triggerName){let p=Ox(r,t.triggerName,t.fromState.value,t.toState.value);p._data=o,Ax(t.player,c.phase,p,c.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):e.push(t)}),this._queue=[],e.sort((t,i)=>{let r=t.transition.ast.depCount,a=i.transition.ast.depCount;return r==0||a==0?r-a:this._engine.driver.containsElement(t.element,i.element)?1:-1})}destroy(o){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,o)}},QD=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=(o,e)=>{};_onRemovalComplete(o,e){this.onRemovalComplete(o,e)}constructor(o,e,t){this.bodyNode=o,this.driver=e,this._normalizer=t}get queuedPlayers(){let o=[];return this._namespaceList.forEach(e=>{e.players.forEach(t=>{t.queued&&o.push(t)})}),o}createNamespace(o,e){let t=new qD(o,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[o]=t}_balanceNamespaceList(o,e){let t=this._namespaceList,i=this.namespacesByHostElement;if(t.length-1>=0){let a=!1,c=this.driver.getParentElement(e);for(;c;){let p=i.get(c);if(p){let u=t.indexOf(p);t.splice(u+1,0,o),a=!0;break}c=this.driver.getParentElement(c)}a||t.unshift(o)}else t.push(o);return i.set(e,o),o}register(o,e){let t=this._namespaceLookup[o];return t||(t=this.createNamespace(o,e)),t}registerTrigger(o,e,t){let i=this._namespaceLookup[o];i&&i.register(e,t)&&this.totalAnimations++}destroy(o,e){o&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let t=this._fetchNamespace(o);this.namespacesByHostElement.delete(t.hostElement);let i=this._namespaceList.indexOf(t);i>=0&&this._namespaceList.splice(i,1),t.destroy(e),delete this._namespaceLookup[o]}))}_fetchNamespace(o){return this._namespaceLookup[o]}fetchNamespacesByElement(o){let e=new Set,t=this.statesByElement.get(o);if(t){for(let i of t.values())if(i.namespaceId){let r=this._fetchNamespace(i.namespaceId);r&&e.add(r)}}return e}trigger(o,e,t,i){if(jx(e)){let r=this._fetchNamespace(o);if(r)return r.trigger(e,t,i),!0}return!1}insertNode(o,e,t,i){if(!jx(e))return;let r=e[Yl];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let a=this.collectedLeaveElements.indexOf(e);a>=0&&this.collectedLeaveElements.splice(a,1)}if(o){let a=this._fetchNamespace(o);a&&a.insertNode(e,t)}i&&this.collectEnterElement(e)}collectEnterElement(o){this.collectedEnterElements.push(o)}markElementAsDisabled(o,e){e?this.disabledNodes.has(o)||(this.disabledNodes.add(o),ul(o,RD)):this.disabledNodes.has(o)&&(this.disabledNodes.delete(o),ef(o,RD))}removeNode(o,e,t){if(jx(e)){let i=o?this._fetchNamespace(o):null;i?i.removeNode(e,t):this.markElementAsRemoved(o,e,!1,t);let r=this.namespacesByHostElement.get(e);r&&r.id!==o&&r.removeNode(e,t)}else this._onRemovalComplete(e,t)}markElementAsRemoved(o,e,t,i,r){this.collectedLeaveElements.push(e),e[Yl]={namespaceId:o,setForRemoval:i,hasAnimation:t,removedBeforeQueried:!1,previousTriggersValues:r}}listen(o,e,t,i,r){return jx(e)?this._fetchNamespace(o).listen(e,t,i,r):()=>{}}_buildInstruction(o,e,t,i,r){return o.transition.build(this.driver,o.element,o.fromState.value,o.toState.value,t,i,o.fromState.options,o.toState.options,e,r)}destroyInnerAnimations(o){let e=this.driver.query(o,w0,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(o,Rx,!0),e.forEach(t=>this.finishActiveQueriedAnimationOnElement(t)))}destroyActiveAnimationsForElement(o){let e=this.playersByElement.get(o);e&&e.forEach(t=>{t.queued?t.markedForDestroy=!0:t.destroy()})}finishActiveQueriedAnimationOnElement(o){let e=this.playersByQueriedElement.get(o);e&&e.forEach(t=>t.finish())}whenRenderingDone(){return new Promise(o=>{if(this.players.length)return Dd(this.players).onDone(()=>o());o()})}processLeaveNode(o){let e=o[Yl];if(e&&e.setForRemoval){if(o[Yl]=s8,e.namespaceId){this.destroyInnerAnimations(o);let t=this._fetchNamespace(e.namespaceId);t&&t.clearElementCache(o)}this._onRemovalComplete(o,e.setForRemoval)}o.classList?.contains(RD)&&this.markElementAsDisabled(o,!1),this.driver.query(o,xee,!0).forEach(t=>{this.markElementAsDisabled(t,!1)})}flush(o=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((t,i)=>this._balanceNamespaceList(t,i)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let t=0;t<this.collectedEnterElements.length;t++){let i=this.collectedEnterElements[t];ul(i,bee)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let t=[];try{e=this._flushAnimations(t,o)}finally{for(let i=0;i<t.length;i++)t[i]()}}else for(let t=0;t<this.collectedLeaveElements.length;t++){let i=this.collectedLeaveElements[t];this.processLeaveNode(i)}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?Dd(e).onDone(()=>{t.forEach(i=>i())}):t.forEach(i=>i())}}reportError(o){throw zR(o)}_flushAnimations(o,e){let t=new T0,i=[],r=new Map,a=[],c=new Map,p=new Map,u=new Map,h=new Set;this.disabledNodes.forEach(he=>{h.add(he);let j=this.driver.query(he,Cee,!0);for(let J=0;J<j.length;J++)h.add(j[J])});let g=this.bodyNode,y=Array.from(this.statesByElement.keys()),b=t8(y,this.collectedEnterElements),x=new Map,M=0;b.forEach((he,j)=>{let J=ID+M++;x.set(j,J),he.forEach(le=>ul(le,J))});let w=[],S=new Set,E=new Set;for(let he=0;he<this.collectedLeaveElements.length;he++){let j=this.collectedLeaveElements[he],J=j[Yl];J&&J.setForRemoval&&(w.push(j),S.add(j),J.hasAnimation?this.driver.query(j,yee,!0).forEach(le=>S.add(le)):E.add(j))}let O=new Map,D=t8(y,Array.from(S));D.forEach((he,j)=>{let J=Fx+M++;O.set(j,J),he.forEach(le=>ul(le,J))}),o.push(()=>{b.forEach((he,j)=>{let J=x.get(j);he.forEach(le=>ef(le,J))}),D.forEach((he,j)=>{let J=O.get(j);he.forEach(le=>ef(le,J))}),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(J=>{let le=J.player,ce=J.element;if(N.push(le),this.collectedEnterElements.length){let Ne=ce[Yl];if(Ne&&Ne.setForMove){if(Ne.previousTriggersValues&&Ne.previousTriggersValues.has(J.triggerName)){let Qe=Ne.previousTriggersValues.get(J.triggerName),ct=this.statesByElement.get(J.element);if(ct&&ct.has(J.triggerName)){let At=ct.get(J.triggerName);At.value=Qe,ct.set(J.triggerName,At)}}le.destroy();return}}let De=!g||!this.driver.containsElement(g,ce),He=O.get(ce),et=x.get(ce),Ze=this._buildInstruction(J,t,et,He,De);if(Ze.errors&&Ze.errors.length){P.push(Ze);return}if(De){le.onStart(()=>Tm(ce,Ze.fromStyles)),le.onDestroy(()=>Kl(ce,Ze.toStyles)),i.push(le);return}if(J.isFallbackTransition){le.onStart(()=>Tm(ce,Ze.fromStyles)),le.onDestroy(()=>Kl(ce,Ze.toStyles)),i.push(le);return}let ye=[];Ze.timelines.forEach(Ne=>{Ne.stretchStartingKeyframe=!0,this.disabledNodes.has(Ne.element)||ye.push(Ne)}),Ze.timelines=ye,t.append(ce,Ze.timelines);let q={instruction:Ze,player:le,element:ce};a.push(q),Ze.queriedElements.forEach(Ne=>us(c,Ne,[]).push(le)),Ze.preStyleProps.forEach((Ne,Qe)=>{if(Ne.size){let ct=p.get(Qe);ct||p.set(Qe,ct=new Set),Ne.forEach((At,Yn)=>ct.add(Yn))}}),Ze.postStyleProps.forEach((Ne,Qe)=>{let ct=u.get(Qe);ct||u.set(Qe,ct=new Set),Ne.forEach((At,Yn)=>ct.add(Yn))})});if(P.length){let he=[];P.forEach(j=>{he.push(jR(j.triggerName,j.errors))}),N.forEach(j=>j.destroy()),this.reportError(he)}let L=new Map,se=new Map;a.forEach(he=>{let j=he.element;t.has(j)&&(se.set(j,j),this._beforeAnimationBuild(he.player.namespaceId,he.instruction,L))}),i.forEach(he=>{let j=he.element;this._getPreviousPlayers(j,!1,he.namespaceId,he.triggerName,null).forEach(le=>{us(L,j,[]).push(le),le.destroy()})});let re=w.filter(he=>n8(he,p,u)),W=new Map;e8(W,this.driver,E,u,pl).forEach(he=>{n8(he,p,u)&&re.push(he)});let ue=new Map;b.forEach((he,j)=>{e8(ue,this.driver,new Set(he),p,Yh)}),re.forEach(he=>{let j=W.get(he),J=ue.get(he);W.set(he,new Map([...j?.entries()??[],...J?.entries()??[]]))});let be=[],me=[],Pe={};a.forEach(he=>{let{element:j,player:J,instruction:le}=he;if(t.has(j)){if(h.has(j)){J.onDestroy(()=>Kl(j,le.toStyles)),J.disabled=!0,J.overrideTotalTime(le.totalTime),i.push(J);return}let ce=Pe;if(se.size>1){let He=j,et=[];for(;He=He.parentNode;){let Ze=se.get(He);if(Ze){ce=Ze;break}et.push(He)}et.forEach(Ze=>se.set(Ze,ce))}let De=this._buildAnimation(J.namespaceId,le,L,r,ue,W);if(J.setRealPlayer(De),ce===Pe)be.push(J);else{let He=this.playersByElement.get(ce);He&&He.length&&(J.parentPlayer=Dd(He)),i.push(J)}}else Tm(j,le.fromStyles),J.onDestroy(()=>Kl(j,le.toStyles)),me.push(J),h.has(j)&&i.push(J)}),me.forEach(he=>{let j=r.get(he.element);if(j&&j.length){let J=Dd(j);he.setRealPlayer(J)}}),i.forEach(he=>{he.parentPlayer?he.syncPlayerEvents(he.parentPlayer):he.destroy()});for(let he=0;he<w.length;he++){let j=w[he],J=j[Yl];if(ef(j,Fx),J&&J.hasAnimation)continue;let le=[];if(c.size){let De=c.get(j);De&&De.length&&le.push(...De);let He=this.driver.query(j,Rx,!0);for(let et=0;et<He.length;et++){let Ze=c.get(He[et]);Ze&&Ze.length&&le.push(...Ze)}}let ce=le.filter(De=>!De.destroyed);ce.length?Eee(this,j,ce):this.processLeaveNode(j)}return w.length=0,be.forEach(he=>{this.players.push(he),he.onDone(()=>{he.destroy();let j=this.players.indexOf(he);this.players.splice(j,1)}),he.play()}),be}afterFlush(o){this._flushFns.push(o)}afterFlushAnimationsDone(o){this._whenQuietFns.push(o)}_getPreviousPlayers(o,e,t,i,r){let a=[];if(e){let c=this.playersByQueriedElement.get(o);c&&(a=c)}else{let c=this.playersByElement.get(o);if(c){let p=!r||r==k0;c.forEach(u=>{u.queued||!p&&u.triggerName!=i||a.push(u)})}}return(t||i)&&(a=a.filter(c=>!(t&&t!=c.namespaceId||i&&i!=c.triggerName))),a}_beforeAnimationBuild(o,e,t){let i=e.triggerName,r=e.element,a=e.isRemovalTransition?void 0:o,c=e.isRemovalTransition?void 0:i;for(let p of e.timelines){let u=p.element,h=u!==r,g=us(t,u,[]);this._getPreviousPlayers(u,h,a,c,e.toState).forEach(b=>{let x=b.getRealPlayer();x.beforeDestroy&&x.beforeDestroy(),b.destroy(),g.push(b)})}Tm(r,e.fromStyles)}_buildAnimation(o,e,t,i,r,a){let c=e.triggerName,p=e.element,u=[],h=new Set,g=new Set,y=e.timelines.map(x=>{let M=x.element;h.add(M);let w=M[Yl];if(w&&w.removedBeforeQueried)return new Rc(x.duration,x.delay);let S=M!==p,E=Dee((t.get(M)||See).map(L=>L.getRealPlayer())).filter(L=>{let se=L;return se.element?se.element===M:!1}),O=r.get(M),D=a.get(M),N=kD(this._normalizer,x.keyframes,O,D),P=this._buildPlayer(x,N,E);if(x.subTimeline&&i&&g.add(M),S){let L=new D0(o,c,M);L.setRealPlayer(P),u.push(L)}return P});u.forEach(x=>{us(this.playersByQueriedElement,x.element,[]).push(x),x.onDone(()=>Mee(this.playersByQueriedElement,x.element,x))}),h.forEach(x=>ul(x,AD));let b=Dd(y);return b.onDestroy(()=>{h.forEach(x=>ef(x,AD)),Kl(p,e.toStyles)}),g.forEach(x=>{us(i,x,[]).push(b)}),b}_buildPlayer(o,e,t){return e.length>0?this.driver.animate(o.element,e,o.duration,o.delay,o.easing,t):new Rc(o.duration,o.delay)}},D0=class{namespaceId;triggerName;element;_player=new Rc;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(o,e,t){this.namespaceId=o,this.triggerName=e,this.element=t}setRealPlayer(o){this._containsRealPlayer||(this._player=o,this._queuedCallbacks.forEach((e,t)=>{e.forEach(i=>Ax(o,t,void 0,i))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(o.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(o){this.totalTime=o}syncPlayerEvents(o){let e=this._player;e.triggerCallback&&o.onStart(()=>e.triggerCallback("start")),o.onDone(()=>this.finish()),o.onDestroy(()=>this.destroy())}_queueEvent(o,e){us(this._queuedCallbacks,o,[]).push(e)}onDone(o){this.queued&&this._queueEvent("done",o),this._player.onDone(o)}onStart(o){this.queued&&this._queueEvent("start",o),this._player.onStart(o)}onDestroy(o){this.queued&&this._queueEvent("destroy",o),this._player.onDestroy(o)}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(o){this.queued||this._player.setPosition(o)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(o){let e=this._player;e.triggerCallback&&e.triggerCallback(o)}};function Mee(n,o,e){let t=n.get(o);if(t){if(t.length){let i=t.indexOf(e);t.splice(i,1)}t.length==0&&n.delete(o)}return t}function kee(n){return n??null}function jx(n){return n&&n.nodeType===1}function Tee(n){return n=="start"||n=="done"}function JR(n,o){let e=n.style.display;return n.style.display=o??"none",e}function e8(n,o,e,t,i){let r=[];e.forEach(p=>r.push(JR(p)));let a=[];t.forEach((p,u)=>{let h=new Map;p.forEach(g=>{let y=o.computeStyle(u,g,i);h.set(g,y),(!y||y.length==0)&&(u[Yl]=wee,a.push(u))}),n.set(u,h)});let c=0;return e.forEach(p=>JR(p,r[c++])),a}function t8(n,o){let e=new Map;if(n.forEach(c=>e.set(c,[])),o.length==0)return e;let t=1,i=new Set(o),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:i.has(u)?p=t:p=a(u),r.set(c,p),p}return o.forEach(c=>{let p=a(c);p!==t&&e.get(p).push(c)}),e}function ul(n,o){n.classList?.add(o)}function ef(n,o){n.classList?.remove(o)}function Eee(n,o,e){Dd(e).onDone(()=>n.processLeaveNode(o))}function Dee(n){let o=[];return l8(n,o),o}function l8(n,o){for(let e=0;e<n.length;e++){let t=n[e];t instanceof du?l8(t.players,o):o.push(t)}}function Pee(n,o){let e=Object.keys(n),t=Object.keys(o);if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let r=e[i];if(!o.hasOwnProperty(r)||n[r]!==o[r])return!1}return!0}function n8(n,o,e){let t=e.get(n);if(!t)return!1;let i=o.get(n);return i?t.forEach(r=>i.add(r)):o.set(n,t),e.delete(n),!0}var tf=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(o,e)=>{};constructor(o,e,t){this._driver=e,this._normalizer=t,this._transitionEngine=new QD(o.body,e,t),this._timelineEngine=new GD(o.body,e,t),this._transitionEngine.onRemovalComplete=(i,r)=>this.onRemovalComplete(i,r)}registerTrigger(o,e,t,i,r){let a=o+"-"+i,c=this._triggerCache[a];if(!c){let p=[],u=[],h=o8(this._driver,r,p,u);if(p.length)throw IR(i,p);c=gee(i,h,this._normalizer),this._triggerCache[a]=c}this._transitionEngine.registerTrigger(e,i,c)}register(o,e){this._transitionEngine.register(o,e)}destroy(o,e){this._transitionEngine.destroy(o,e)}onInsert(o,e,t,i){this._transitionEngine.insertNode(o,e,t,i)}onRemove(o,e,t){this._transitionEngine.removeNode(o,e,t)}disableAnimations(o,e){this._transitionEngine.markElementAsDisabled(o,e)}process(o,e,t,i){if(t.charAt(0)=="@"){let[r,a]=TD(t),c=i;this._timelineEngine.command(r,e,a,c)}else this._transitionEngine.trigger(o,e,t,i)}listen(o,e,t,i,r){if(t.charAt(0)=="@"){let[a,c]=TD(t);return this._timelineEngine.listen(a,e,c,r)}return this._transitionEngine.listen(o,e,t,i,r)}flush(o=-1){this._transitionEngine.flush(o)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(o){this._transitionEngine.afterFlushAnimationsDone(o)}};function Iee(n,o){let e=null,t=null;return Array.isArray(o)&&o.length?(e=VD(o[0]),o.length>1&&(t=VD(o[o.length-1]))):o instanceof Map&&(e=VD(o)),e||t?new Aee(n,e,t):null}var Aee=(()=>{class n{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,t,i){this._element=e,this._startStyles=t,this._endStyles=i;let r=n.initialStylesByElement.get(e);r||n.initialStylesByElement.set(e,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&Kl(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Kl(this._element,this._initialStyles),this._endStyles&&(Kl(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(n.initialStylesByElement.delete(this._element),this._startStyles&&(Tm(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Tm(this._element,this._endStyles),this._endStyles=null),Kl(this._element,this._initialStyles),this._state=3)}}return n})();function VD(n){let o=null;return n.forEach((e,t)=>{Oee(t)&&(o=o||new Map,o.set(t,e))}),o}function Oee(n){return n==="display"||n==="position"}var Qx=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(o,e,t,i){this.element=o,this.keyframes=e,this.options=t,this._specialStyles=i,this._duration=t.duration,this._delay=t.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(o=>o()),this._onDoneFns=[])}init(){this._buildPlayer()&&this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return this.domPlayer;this._initialized=!0;let o=this.keyframes,e=this._triggerWebAnimation(this.element,o,this.options);if(!e)return this._onFinish(),null;this.domPlayer=e,this._finalKeyframe=o.length?o[o.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(o){let e=[];return o.forEach(t=>{e.push(Object.fromEntries(t))}),e}_triggerWebAnimation(o,e,t){let i=this._convertKeyframesToObject(e);try{return o.animate(i,t)}catch{return null}}onStart(o){this._originalOnStartFns.push(o),this._onStartFns.push(o)}onDone(o){this._originalOnDoneFns.push(o),this._onDoneFns.push(o)}onDestroy(o){this._onDestroyFns.push(o)}play(){let o=this._buildPlayer();o&&(this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),o.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(o=>o()),this._onDestroyFns=[])}setPosition(o){this.domPlayer||this.init(),this.domPlayer&&(this.domPlayer.currentTime=o*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 o=new Map;this.hasStarted()&&this._finalKeyframe.forEach((t,i)=>{i!=="offset"&&o.set(i,this._finished?t:Vx(this.element,i))}),this.currentSnapshot=o}triggerCallback(o){let e=o==="start"?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}},Xx=class{validateStyleProperty(o){return!0}validateAnimatableStyleProperty(o){return!0}containsElement(o,e){return ED(o,e)}getParentElement(o){return Nx(o)}query(o,e,t){return DD(o,e,t)}computeStyle(o,e,t){return Vx(o,e)}animate(o,e,t,i,r,a=[]){let c=i==0?"both":"forwards",p={duration:t,delay:i,fill:c};r&&(p.easing=r);let u=new Map,h=a.filter(b=>b instanceof Qx);WR(t,i)&&h.forEach(b=>{b.currentSnapshot.forEach((x,M)=>u.set(M,x))});let g=HR(e).map(b=>new Map(b));g=GR(o,g,u);let y=Iee(o,g);return new Qx(o,g,p,y)}};var $x="@",c8="@.disabled",Kx=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(o,e,t,i){this.namespaceId=o,this.delegate=e,this.engine=t,this._onDestroy=i}get data(){return this.delegate.data}destroyNode(o){this.delegate.destroyNode?.(o)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(o,e){return this.delegate.createElement(o,e)}createComment(o){return this.delegate.createComment(o)}createText(o){return this.delegate.createText(o)}appendChild(o,e){this.delegate.appendChild(o,e),this.engine.onInsert(this.namespaceId,e,o,!1)}insertBefore(o,e,t,i=!0){this.delegate.insertBefore(o,e,t),this.engine.onInsert(this.namespaceId,e,o,i)}removeChild(o,e,t,i){if(i){this.delegate.removeChild(o,e,t,i);return}this.parentNode(e)&&this.engine.onRemove(this.namespaceId,e,this.delegate)}selectRootElement(o,e){return this.delegate.selectRootElement(o,e)}parentNode(o){return this.delegate.parentNode(o)}nextSibling(o){return this.delegate.nextSibling(o)}setAttribute(o,e,t,i){this.delegate.setAttribute(o,e,t,i)}removeAttribute(o,e,t){this.delegate.removeAttribute(o,e,t)}addClass(o,e){this.delegate.addClass(o,e)}removeClass(o,e){this.delegate.removeClass(o,e)}setStyle(o,e,t,i){this.delegate.setStyle(o,e,t,i)}removeStyle(o,e,t){this.delegate.removeStyle(o,e,t)}setProperty(o,e,t){e.charAt(0)==$x&&e==c8?this.disableAnimations(o,!!t):this.delegate.setProperty(o,e,t)}setValue(o,e){this.delegate.setValue(o,e)}listen(o,e,t,i){return this.delegate.listen(o,e,t,i)}disableAnimations(o,e){this.engine.disableAnimations(o,e)}},XD=class extends Kx{factory;constructor(o,e,t,i,r){super(e,t,i,r),this.factory=o,this.namespaceId=e}setProperty(o,e,t){e.charAt(0)==$x?e.charAt(1)=="."&&e==c8?(t=t===void 0?!0:!!t,this.disableAnimations(o,t)):this.engine.process(this.namespaceId,o,e.slice(1),t):this.delegate.setProperty(o,e,t)}listen(o,e,t,i){if(e.charAt(0)==$x){let r=Nee(o),a=e.slice(1),c="";return a.charAt(0)!=$x&&([a,c]=Fee(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(o,e,t,i)}};function Nee(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}function Fee(n){let o=n.indexOf("."),e=n.substring(0,o),t=n.slice(o+1);return[e,t]}var Yx=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(o,e,t){this.delegate=o,this.engine=e,this._zone=t,e.onRemovalComplete=(i,r)=>{r?.removeChild(null,i)}}createRenderer(o,e){let i=this.delegate.createRenderer(o,e);if(!o||!e?.data?.animation){let u=this._rendererCache,h=u.get(i);if(!h){let g=()=>u.delete(i);h=new Kx("",i,this.engine,g),u.set(i,h)}return h}let r=e.id,a=e.id+"-"+this._currentId;this._currentId++,this.engine.register(a,o);let c=u=>{Array.isArray(u)?u.forEach(c):this.engine.registerTrigger(r,a,o,u.name,u)};return e.data.animation.forEach(c),new XD(this,a,i,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(o,e,t){if(o>=0&&o<this._microtaskId){this._zone.run(()=>e(t));return}let i=this._animationCallbacksBuffer;i.length==0&&queueMicrotask(()=>{this._zone.run(()=>{i.forEach(r=>{let[a,c]=r;a(c)}),this._animationCallbacksBuffer=[]})}),i.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(o){this.engine.flush(),this.delegate.componentReplaced?.(o)}};var Lee=(()=>{class n extends tf{constructor(e,t,i){super(e,t,i)}ngOnDestroy(){this.flush()}static \u0275fac=function(t){return new(t||n)(ge(Qi),ge(hu),ge(fu))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();function Vee(){return new Hx}function Bee(){return new Yx(f(r4),f(tf),f(Ai))}var m8=[{provide:fu,useFactory:Vee},{provide:tf,useClass:Lee},{provide:md,useFactory:Bee}],zee=[{provide:hu,useClass:KD},{provide:Tk,useValue:"NoopAnimations"},...m8],d8=[{provide:hu,useFactory:()=>new Xx},{provide:Tk,useFactory:()=>"BrowserAnimations"},...m8],p8=(()=>{class n{static withConfig(e){return{ngModule:n,providers:e.disableAnimations?zee:d8}}static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({providers:d8,imports:[fC]})}return n})();function jee(n,o){return typeof n>"u"?typeof o>"u"?n:o:n}function tP(n,o){return n=jee(n,o),typeof n=="function"?function(){for(var t=arguments,i=arguments.length,r=Array(i),a=0;a<i;a++)r[a]=t[a];return!!n.apply(this,r)}:n?function(){return!0}:function(){return!1}}var ZD=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},h8=function(n){return n!=null&&(typeof n>"u"?"undefined":ZD(n))==="object"&&n.nodeType===1&&ZD(n.style)==="object"&&ZD(n.ownerDocument)==="object"};function f8(n,o){if(o=oP(o,!0),!h8(o))return-1;for(var e=0;e<n.length;e++)if(n[e]===o)return e;return-1}function nP(n,o){return f8(n,o)!==-1}function $ee(n,o){for(var e=0;e<o.length;e++)nP(n,o[e])||n.push(o[e]);return o}function Hee(n){for(var o=arguments,e=[],t=arguments.length-1;t-- >0;)e[t]=o[t+1];return e=e.map(oP),$ee(n,e)}function Uee(n){for(var o=arguments,e=[],t=arguments.length-1;t-- >0;)e[t]=o[t+1];return e.map(oP).reduce(function(i,r){var a=f8(n,r);return a!==-1?i.concat(n.splice(a,1)):i},[])}function oP(n,o){if(typeof n=="string")try{return document.querySelector(n)}catch(e){throw e}if(!h8(n)&&!o)throw new TypeError(n+" is not a DOM element.");return n}function Wee(n,o){o=o||{};var e=tP(o.allowUpdate,!0);return function(i){if(i=i||window.event,n.target=i.target||i.srcElement||i.originalTarget,n.element=this,n.type=i.type,!!e(i)){if(i.targetTouches)n.x=i.targetTouches[0].clientX,n.y=i.targetTouches[0].clientY,n.pageX=i.targetTouches[0].pageX,n.pageY=i.targetTouches[0].pageY,n.screenX=i.targetTouches[0].screenX,n.screenY=i.targetTouches[0].screenY;else{if(i.pageX===null&&i.clientX!==null){var r=i.target&&i.target.ownerDocument||document,a=r.documentElement,c=r.body;n.pageX=i.clientX+(a&&a.scrollLeft||c&&c.scrollLeft||0)-(a&&a.clientLeft||c&&c.clientLeft||0),n.pageY=i.clientY+(a&&a.scrollTop||c&&c.scrollTop||0)-(a&&a.clientTop||c&&c.clientTop||0)}else n.pageX=i.pageX,n.pageY=i.pageY;n.x=i.clientX,n.y=i.clientY,n.screenX=i.screenX,n.screenY=i.screenY}n.clientX=n.x,n.clientY=n.y}}}function Gee(){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 o={};return Object.defineProperties(o,n),o}function g8(n){if(n===window)return Gee();try{var o=n.getBoundingClientRect();return o.x===void 0&&(o.x=o.left,o.y=o.top),o}catch{throw new TypeError("Can't call getBoundingClientRect on "+n)}}function qee(n,o){var e=g8(o);return n.y>e.top&&n.y<e.bottom&&n.x>e.left&&n.x<e.right}var iP=void 0;typeof Object.create!="function"?iP=(function(n){var o=function(){};return function(e,t){if(e!==Object(e)&&e!==null)throw TypeError("Argument must be an object, or null");o.prototype=e||{};var i=new o;return o.prototype=null,t!==n&&Object.defineProperties(i,t),e===null&&(i.__proto__=null),i}})():iP=Object.create;var Qee=iP,gu=["altKey","button","buttons","clientX","clientY","ctrlKey","metaKey","movementX","movementY","offsetX","offsetY","pageX","pageY","region","relatedTarget","screenX","screenY","shiftKey","which","x","y"];function Xee(n){var o={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<gu.length;a++)o[gu[a]]=r[gu[a]]}var t=(function(){if(MouseEvent)return function(a,c,p){var u=new MouseEvent("mousemove",JD(o,c));return eP(u,p),a.dispatchEvent(u)};if(typeof document.createEvent=="function")return function(a,c,p){var u=JD(o,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),eP(h,p),a.dispatchEvent(h)};if(typeof document.createEventObject=="function")return function(a,c,p){var u=document.createEventObject(),h=JD(o,c);for(var g in h)u[g]=h[g];return eP(u,p),a.dispatchEvent(u)}})();function i(){n&&n.removeEventListener("mousemove",e,!1),o=null}return{destroy:i,dispatch:t}}function JD(n,o){o=o||{};for(var e=Qee(n),t=0;t<gu.length;t++)o[gu[t]]!==void 0&&(e[gu[t]]=o[gu[t]]);return e}function eP(n,o){console.log("data ",o),n.data=o||{},n.dispatched="mousemove"}var I0=["webkit","moz","ms","o"],P0=(function(){if(typeof window>"u")return function(){};for(var n=0,o=I0.length;n<o&&!window.requestAnimationFrame;++n)window.requestAnimationFrame=window[I0[n]+"RequestAnimationFrame"];if(!window.requestAnimationFrame){var e=0;window.requestAnimationFrame=function(t){var i=new Date().getTime(),r=Math.max(0,16-i-e),a=window.setTimeout(function(){return t(i+r)},r);return e=i+r,a}}return window.requestAnimationFrame.bind(window)})(),nf=(function(){if(typeof window>"u")return function(){};for(var n=0,o=I0.length;n<o&&!window.cancelAnimationFrame;++n)window.cancelAnimationFrame=window[I0[n]+"CancelAnimationFrame"]||window[I0[n]+"CancelRequestAnimationFrame"];return window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){window.clearTimeout(e)}),window.cancelAnimationFrame.bind(window)})();function Kee(n,o){o===void 0&&(o={});var e=this,t=4,i=!1;if(typeof o.margin!="object"){var r=o.margin||-1;this.margin={left:r,right:r,top:r,bottom:r}}else this.margin=o.margin;this.scrollWhenOutside=o.scrollWhenOutside||!1;var a={},c=Wee(a),p=Xee(),u=!1;window.addEventListener("mousemove",c,!1),window.addEventListener("touchmove",c,!1),isNaN(o.maxSpeed)||(t=o.maxSpeed),typeof t!="object"&&(t={left:t,right:t,top:t,bottom:t}),this.autoScroll=tP(o.autoScroll),this.syncMove=tP(o.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",x,!0),n=[],$&&S()},this.add=function(){for(var $=[],ue=arguments.length;ue--;)$[ue]=arguments[ue];return Hee.apply(void 0,[n].concat($)),this},this.remove=function(){for(var $=[],ue=arguments.length;ue--;)$[ue]=arguments[ue];return Uee.apply(void 0,[n].concat($))};var h=null,g;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 i}}});var y=null,b;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",x,!0);function x($){for(var ue=0;ue<n.length;ue++)if(n[ue]===$.target){i=!0;break}i&&P0(function(){return i=!1})}function M(){u=!0}function w(){u=!1,S()}function S(){nf(b),nf(g)}function E(){u=!1}function O($){if(!$)return null;if(y===$||nP(n,$))return $;for(;$=$.parentNode;)if(nP(n,$))return $;return null}function D(){for(var $=null,ue=0;ue<n.length;ue++)u8(a,n[ue])&&($=n[ue]);return $}function N($){if(e.autoScroll()&&!$.dispatched){var ue=$.target,be=document.body;y&&!u8(a,y)&&(e.scrollWhenOutside||(y=null)),ue&&ue.parentNode===be?ue=D():(ue=O(ue),ue||(ue=D())),ue&&ue!==y&&(y=ue),h&&(nf(g),g=P0(P)),y&&(nf(b),b=P0(L))}}function P(){se(h),nf(g),g=P0(P)}function L(){y&&(se(y),nf(b),b=P0(L))}function se($){var ue=g8($),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&&re($,me),be&&W($,be)})}function re($,ue){$===window?window.scrollTo($.pageXOffset,$.pageYOffset+ue):$.scrollTop+=ue}function W($,ue){$===window?window.scrollTo($.pageXOffset+ue,$.pageYOffset):$.scrollLeft+=ue}}function Yee(n,o){return new Kee(n,o)}function u8(n,o,e){return e?n.y>e.top&&n.y<e.bottom&&n.x>e.left&&n.x<e.right:qee(n,o)}var _8=Yee;var Zee=(()=>{class n{constructor(){this.currentDrag=new We}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),Jee=(()=>{class n{constructor(){this.elementRef=f(Jt)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275dir=vt({type:n,selectors:[["","mwlDraggableScrollContainer",""]]})}}return n})();function ete(n,o,e){e&&e.split(" ").forEach(t=>n.addClass(o.nativeElement,t))}function tte(n,o,e){e&&e.split(" ").forEach(t=>n.removeClass(o.nativeElement,t))}var v8=(()=>{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 _e,this.dragStart=new _e,this.ghostElementCreated=new _e,this.dragging=new _e,this.dragEnd=new _e,this.pointerDown$=new We,this.pointerMove$=new We,this.pointerUp$=new We,this.eventListenerSubscriptions={},this.destroy$=new We,this.timeLongPress={timerBegin:0,timerEnd:0},this.element=f(Jt),this.renderer=f(Si),this.draggableHelper=f(Zee),this.zone=f(Ai),this.vcr=f(ro),this.scrollContainer=f(Jee,{optional:!0}),this.document=f(Qi)}ngOnInit(){this.checkEventListeners();let e=this.pointerDown$.pipe(ci(()=>this.canDrag()),dc(t=>{t.event.stopPropagation&&!this.scrollContainer&&t.event.stopPropagation();let i=this.renderer.createElement("style");this.renderer.setAttribute(i,"type","text/css"),this.renderer.appendChild(i,this.renderer.createText(`
|
||
body * {
|
||
-moz-user-select: none;
|
||
-ms-user-select: none;
|
||
-webkit-user-select: none;
|
||
user-select: none;
|
||
}
|
||
`)),requestAnimationFrame(()=>{this.document.head.appendChild(i)});let r=this.getScrollPosition(),a=new Rr(b=>{let x=this.scrollContainer?this.scrollContainer.elementRef.nativeElement:"window";return this.renderer.listen(x,"scroll",M=>b.next(M))}).pipe(gi(r),Bt(()=>this.getScrollPosition())),c=new We,p=new Xd;this.dragPointerDown.observers.length>0&&this.zone.run(()=>{this.dragPointerDown.next({x:0,y:0})});let u=Wn(this.pointerUp$,this.pointerDown$,p,this.destroy$).pipe($l()),h=Lr([this.pointerMove$,a]).pipe(Bt(([b,x])=>({currentDrag$:c,transformX:b.clientX-t.clientX,transformY:b.clientY-t.clientY,clientX:b.clientX,clientY:b.clientY,scrollLeft:x.left,scrollTop:x.top,target:b.event.target})),Bt(b=>(this.dragSnapGrid.x&&(b.transformX=Math.round(b.transformX/this.dragSnapGrid.x)*this.dragSnapGrid.x),this.dragSnapGrid.y&&(b.transformY=Math.round(b.transformY/this.dragSnapGrid.y)*this.dragSnapGrid.y),b)),Bt(b=>(this.dragAxis.x||(b.transformX=0),this.dragAxis.y||(b.transformY=0),b)),Bt(b=>{let x=b.scrollLeft-r.left,M=b.scrollTop-r.top;return Ye(Z({},b),{x:b.transformX+x,y:b.transformY+M})}),ci(({x:b,y:x,transformX:M,transformY:w})=>!this.validateDrag||this.validateDrag({x:b,y:x,transform:{x:M,y:w}})),Ge(u),$l()),g=h.pipe(Fo(1),$l()),y=h.pipe(HO(1),$l());return g.subscribe(({clientX:b,clientY:x,x:M,y:w})=>{if(this.dragStart.observers.length>0&&this.zone.run(()=>{this.dragStart.next({cancelDrag$:p})}),this.scroller=_8([this.scrollContainer?this.scrollContainer.elementRef.nativeElement:this.document.defaultView],Ye(Z({},this.autoScroll),{autoScroll(){return!0}})),ete(this.renderer,this.element,this.dragActiveClass),this.ghostDragEnabled){let S=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:`${S.top}px`,left:`${S.left}px`,width:`${S.width}px`,height:`${S.height}px`,cursor:this.dragCursor,margin:"0",willChange:"transform",pointerEvents:"none"}),this.ghostElementTemplate){let O=this.vcr.createEmbeddedView(this.ghostElementTemplate);E.innerHTML="",O.rootNodes.filter(D=>D instanceof Node).forEach(D=>{E.appendChild(D)}),y.subscribe(()=>{this.vcr.remove(this.vcr.indexOf(O))})}this.ghostElementCreated.observers.length>0&&this.zone.run(()=>{this.ghostElementCreated.emit({clientX:b-M,clientY:x-w,element:E})}),y.subscribe(()=>{E.parentElement.removeChild(E),this.ghostElement=null,this.renderer.setStyle(this.element.nativeElement,"visibility","")})}this.draggableHelper.currentDrag.next(c)}),y.pipe(dc(b=>{let x=p.pipe(VO(),Fo(1),Bt(M=>Ye(Z({},b),{dragCancelled:M>0})));return p.complete(),x})).subscribe(({x:b,y:x,dragCancelled:M})=>{this.scroller.destroy(),this.dragEnd.observers.length>0&&this.zone.run(()=>{this.dragEnd.next({x:b,y:x,dragCancelled:M})}),tte(this.renderer,this.element,this.dragActiveClass),c.complete()}),Wn(u,y).pipe(Fo(1)).subscribe(()=>{requestAnimationFrame(()=>{this.document.head.removeChild(i)})}),h}),$l());Wn(e.pipe(Fo(1),Bt(t=>[,t])),e.pipe(sC())).pipe(ci(([t,i])=>t?t.x!==i.x||t.y!==i.y:!0),Bt(([t,i])=>i)).subscribe(({x:t,y:i,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:i})}),requestAnimationFrame(()=>{if(this.ghostElement){let g=`translate3d(${p}px, ${u}px, 0px)`;this.setElementStyles(this.ghostElement,{transform:g,"-webkit-transform":g,"-ms-transform":g,"-moz-transform":g,"-o-transform":g})}}),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",i=>{this.onMouseDown(i)}),this.eventListenerSubscriptions.mouseup=this.renderer.listen("document","mouseup",i=>{this.onMouseUp(i)}),this.eventListenerSubscriptions.touchstart=this.renderer.listen(this.element.nativeElement,"touchstart",i=>{this.onTouchStart(i)}),this.eventListenerSubscriptions.touchend=this.renderer.listen("document","touchend",i=>{this.onTouchEnd(i)}),this.eventListenerSubscriptions.touchcancel=this.renderer.listen("document","touchcancel",i=>{this.onTouchEnd(i)}),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,i,r;if(this.touchStartLongPress&&(this.timeLongPress.timerBegin=Date.now(),i=!1,r=this.hasScrollbar(),t=this.getScrollPosition()),!this.eventListenerSubscriptions.touchmove){let a=No(this.document,"contextmenu").subscribe(p=>{p.preventDefault()}),c=No(this.document,"touchmove",{passive:!1}).subscribe(p=>{this.touchStartLongPress&&!i&&r&&(i=this.shouldBeginDrag(e,p,t)),(!this.touchStartLongPress||!r||i)&&(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(i=>{this.renderer.setStyle(e,i,t[i])})}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,i){let r=this.getScrollPosition(),a={top:Math.abs(r.top-i.top),left:Math.abs(r.left-i.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,i=e.scrollHeight>e.clientHeight;return t||i}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275dir=vt({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:[Pn]})}}return n})();var Zx=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275mod=Gt({type:n})}static{this.\u0275inj=Wt({})}}return n})();var A0=class{constructor(o){this.rawFile=o;let e=o instanceof HTMLInputElement?o.value:o;this[`_createFrom${typeof e=="string"?"FakePath":"Object"}`](e)}_createFromFakePath(o){this.lastModifiedDate=void 0,this.size=void 0,this.type=`like/${o.slice(o.lastIndexOf(".")+1).toLowerCase()}`,this.name=o.slice(o.lastIndexOf("/")+o.lastIndexOf("\\")+2)}_createFromObject(o){this.size=o.size,this.type=o.type,this.name=o.name}},rP=class{constructor(o,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=o,this.some=e,this.options=t,this.file=new A0(e),this._file=e,o.options&&(this.method=o.options.method||"POST",this.alias=o.options.itemAlias||"file"),this.url=o.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(o){return{form:o}}onProgress(o){return{progress:o}}onSuccess(o,e,t){return{response:o,status:e,headers:t}}onError(o,e,t){return{response:o,status:e,headers:t}}onCancel(o,e,t){return{response:o,status:e,headers:t}}onComplete(o,e,t){return{response:o,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(o){this.onBuildForm(o)}_onProgress(o){this.progress=o,this.onProgress(o)}_onSuccess(o,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(o,e,t)}_onError(o,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(o,e,t)}_onCancel(o,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(o,e,t)}_onComplete(o,e,t){this.onComplete(o,e,t),this.uploader.options.removeAfterUpload&&this.remove()}_prepareToUploading(){this.index=this.index||++this.uploader._nextIndex,this.isReady=!0}},ite=(()=>{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"},i=e.split(".");if(i.length<2)return"application";let r=i[i.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 ote(n){return File&&n instanceof File}var Wa=class{constructor(o){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(o),this.response=new _e}setOptions(o){this.options=Object.assign(this.options,o),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(o,e,t){let i=e,r=[];for(let u of o)r.push(u);let a=this._getFilters(t),c=this.queue.length,p=[];r.map(u=>{i||(i=this.options);let h=new A0(u);if(this._isValidFile(h,a,i)){let g=new rP(this,u,i);p.push(g),this.queue.push(g),this._onAfterAddingFile(g)}else if(this._failFilterIndex){let g=a[this._failFilterIndex];this._onWhenAddingFileFailed(h,g,i)}}),this.queue.length!==c&&(this._onAfterAddingAll(p),this.progress=this._getTotalProgress()),this._render(),this.options.autoUpload&&this.uploadAll()}removeFromQueue(o){let e=this.getIndexOfItem(o),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(o){let e=this.getIndexOfItem(o),t=this.queue[e],i=this.options.isHTML5?"_xhrTransport":"_iframeTransport";t._prepareToUploading(),!this.isUploading&&(this.isUploading=!0,this[i](t))}cancelItem(o){let e=this.getIndexOfItem(o),t=this.queue[e],i=this.options.isHTML5?t._xhr:t._form;t&&t.isUploading&&i.abort()}uploadAll(){let o=this.getNotUploadedItems().filter(e=>!e.isUploading);o.length&&(o.map(e=>e._prepareToUploading()),o[0].upload())}cancelAll(){this.getNotUploadedItems().map(e=>e.cancel())}isFile(o){return ote(o)}isFileLikeObject(o){return o instanceof A0}getIndexOfItem(o){return typeof o=="number"?o:this.queue.indexOf(o)}getNotUploadedItems(){return this.queue.filter(o=>!o.isUploaded)}getReadyItems(){return this.queue.filter(o=>o.isReady&&!o.isUploading).sort((o,e)=>o.index-e.index)}onAfterAddingAll(o){return{fileItems:o}}onBuildItemForm(o,e){return{fileItem:o,form:e}}onAfterAddingFile(o){return{fileItem:o}}onWhenAddingFileFailed(o,e,t){return{item:o,filter:e,options:t}}onBeforeUploadItem(o){return{fileItem:o}}onProgressItem(o,e){return{fileItem:o,progress:e}}onProgressAll(o){return{progress:o}}onSuccessItem(o,e,t,i){return{item:o,response:e,status:t,headers:i}}onErrorItem(o,e,t,i){return{item:o,response:e,status:t,headers:i}}onCancelItem(o,e,t,i){return{item:o,response:e,status:t,headers:i}}onCompleteItem(o,e,t,i){return{item:o,response:e,status:t,headers:i}}onCompleteAll(){}_mimeTypeFilter(o){return!(o?.type&&this.options.allowedMimeType&&this.options.allowedMimeType?.indexOf(o.type)===-1)}_fileSizeFilter(o){return!(this.options.maxFileSize&&o.size>this.options.maxFileSize)}_fileTypeFilter(o){return!(this.options.allowedFileType&&this.options.allowedFileType.indexOf(ite.getMimeClass(o))===-1)}_onErrorItem(o,e,t,i){o._onError(e,t,i),this.onErrorItem(o,e,t,i)}_onCompleteItem(o,e,t,i){o._onComplete(e,t,i),this.onCompleteItem(o,e,t,i);let r=this.getReadyItems()[0];if(this.isUploading=!1,r){r.upload();return}this.onCompleteAll(),this.progress=this._getTotalProgress(),this._render()}_headersGetter(o){return e=>e?o[e.toLowerCase()]||void 0:o}_xhrTransport(o){let e=this,t=o._xhr=new XMLHttpRequest,i;if(this._onBeforeUploadItem(o),typeof o._file.size!="number")throw new TypeError("The file specified is no longer valid");if(this.options.disableMultipart)this.options.formatDataFunction&&(i=this.options.formatDataFunction(o));else{i=new FormData,this._onBuildItemForm(o,i);let r=()=>i.append(o.alias,o._file,o.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&&o.file?.name&&(c=c.replace("{{file_name}}",o.file.name)),i.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(o,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](o,a,t.status,r),this._onCompleteItem(o,a,t.status,r)},t.onerror=()=>{let r=this._parseHeaders(t.getAllResponseHeaders()),a=this._transformResponse(t.response,r);this._onErrorItem(o,a,t.status,r),this._onCompleteItem(o,a,t.status,r)},t.onabort=()=>{let r=this._parseHeaders(t.getAllResponseHeaders()),a=this._transformResponse(t.response,r);this._onCancelItem(o,a,t.status,r),this._onCompleteItem(o,a,t.status,r)},o.method&&o.url&&t.open(o.method,o.url,!0),t.withCredentials=o.withCredentials,this.options.headers)for(let r of this.options.headers)t.setRequestHeader(r.name,r.value);if(o.headers.length)for(let r of o.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?i.then(r=>t.send(JSON.stringify(r))):t.send(i),this._render()}_getTotalProgress(o=0){if(this.options.removeAfterUpload)return o;let e=this.getNotUploadedItems().length,t=e?this.queue.length-e:this.queue.length,i=100/this.queue.length,r=o*i/100;return Math.round(t*i+r)}_getFilters(o){if(!o)return this.options?.filters||[];if(Array.isArray(o))return o;if(typeof o=="string"){let e=o.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(o,e,t){return this._failFilterIndex=-1,e.length?e.every(i=>(this._failFilterIndex&&this._failFilterIndex++,i.fn.call(this,o,t))):!0}_isSuccessCode(o){return o>=200&&o<300||o===304}_transformResponse(o,e){return o}_parseHeaders(o){let e={},t,i,r;return o&&o.split(`
|
||
`).map(a=>{r=a.indexOf(":"),t=a.slice(0,r).trim().toLowerCase(),i=a.slice(r+1).trim(),t&&(e[t]=e[t]?e[t]+", "+i:i)}),e}_onWhenAddingFileFailed(o,e,t){this.onWhenAddingFileFailed(o,e,t)}_onAfterAddingFile(o){this.onAfterAddingFile(o)}_onAfterAddingAll(o){this.onAfterAddingAll(o)}_onBeforeUploadItem(o){o._onBeforeUpload(),this.onBeforeUploadItem(o)}_onBuildItemForm(o,e){o._onBuildForm(e),this.onBuildItemForm(o,e)}_onProgressItem(o,e){let t=this._getTotalProgress(e);this.progress=t,o._onProgress(e),this.onProgressItem(o,e),this.onProgressAll(t),this._render()}_onSuccessItem(o,e,t,i){o._onSuccess(e,t,i),this.onSuccessItem(o,e,t,i)}_onCancelItem(o,e,t,i){o._onCancel(e,t,i),this.onCancelItem(o,e,t,i)}};var Vc=(()=>{class n{constructor(e){this.onFileSelected=new _e,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(),i=this.getFilters();this.uploader?.addToQueue(e,t,i),this.onFileSelected.emit(e),this.isEmptyAfterSelection()&&(this.element.nativeElement.value="")}}return n.\u0275fac=function(e){return new(e||n)(at(Jt))},n.\u0275dir=vt({type:n,selectors:[["","ng2FileSelect",""]],hostBindings:function(e,t){e&1&&_("change",function(){return t.onChange()})},inputs:{uploader:"uploader"},outputs:{onFileSelected:"onFileSelected"},standalone:!1}),n})(),hl=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=Gt({type:n}),n.\u0275inj=Wt({imports:[ne]}),n})();var _u=class{visible;error;clear;constructor(o,e,t=!1){this.visible=o,this.error=e,this.clear=t}},io=(()=>{class n{state=new tn(new _u(!1));constructor(){}setError(e){this.state.next(new _u(!1,e.error))}clear(){this.state.next(new _u(!1,null,!0))}activate(){this.state.next(new _u(!0))}deactivate(){this.state.next(new _u(!1))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();function rte(n,o){n&1&&(s(0,"div",1),R(1,"mat-spinner",3),l())}function ate(n,o){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),_("click",function(){k(e);let i=v(2);return T(i.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 ste(n,o){if(n&1&&(s(0,"div",0),I(1,rte,2,0,"div",1),I(2,ate,13,1,"div",2),l()),n&2){let e=v();m(),A(e.visible()&&!e.error()?1:-1),m(),A(e.error()?2:-1)}}var Em=(()=>{class n{progressService=f(io);router=f(_t);visible=Q(!1);error=Q(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,i){t&1&&I(0,ste,3,2,"div",0),t&2&&A(i.visible()||i.error()?0:-1)},dependencies:[ne,dn,qn,oe,de,G,pe,ht,Mt,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 Jx=(()=>{class n{document;router=f(_t);controllerService=f(nt);progressService=f(io);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)(at(Qi))};static \u0275cmp=F({type:n,selectors:[["app-bundled-controller-finder"]],decls:1,vars:0,template:function(t,i){t&1&&R(0,"app-progress")},dependencies:[Em],encapsulation:2,changeDetection:0})}return n})();var lte=["mat-menu-item",""],cte=[[["mat-icon"],["","matMenuItemIcon",""]],"*"],dte=["mat-icon, [matMenuItemIcon]","*"];function mte(n,o){n&1&&(ti(),s(0,"svg",2),R(1,"polygon",3),l())}var pte=["*"];function ute(n,o){if(n&1){let e=z();Co(0,"div",0),cC("click",function(){k(e);let i=v();return T(i.closed.emit("click"))})("animationstart",function(i){k(e);let r=v();return T(r._onAnimationStart(i.animationName))})("animationend",function(i){k(e);let r=v();return T(r._onAnimationDone(i.animationName))})("animationcancel",function(i){k(e);let r=v();return T(r._onAnimationDone(i.animationName))}),Co(1,"div",1),an(2),ko()()}if(n&2){let e=v();ar(e._classList),Ae("mat-menu-panel-animations-disabled",e._animationsDisabled)("mat-menu-panel-exit-animation",e._panelAnimationState==="void")("mat-menu-panel-animating",e._isAnimating()),Jo("id",e.panelId),Qt("aria-label",e.ariaLabel||null)("aria-labelledby",e.ariaLabelledby||null)("aria-describedby",e.ariaDescribedby||null)}}var sP=new cn("MAT_MENU_PANEL"),tt=(()=>{class n{_elementRef=f(Jt);_document=f(Qi);_focusMonitor=f(Fa);_parentMenu=f(sP,{optional:!0});_changeDetectorRef=f(X);role="menuitem";disabled=!1;disableRipple=!1;_hovered=new We;_focused=new We;_highlighted=!1;_triggersSubmenu=!1;constructor(){f(sr).load(la),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 i=0;i<t.length;i++)t[i].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,i){t&1&&_("click",function(a){return i._checkDisabled(a)})("mouseenter",function(){return i._handleMouseEnter()}),t&2&&(Qt("role",i.role)("tabindex",i._getTabIndex())("aria-disabled",i.disabled)("disabled",i.disabled||null),Ae("mat-mdc-menu-item-highlighted",i._highlighted)("mat-mdc-menu-item-submenu-trigger",i._triggersSubmenu))},inputs:{role:"role",disabled:[2,"disabled","disabled",yt],disableRipple:[2,"disableRipple","disableRipple",yt]},exportAs:["matMenuItem"],attrs:lte,ngContentSelectors:dte,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,i){t&1&&(ai(cte),an(0),s(1,"span",0),an(2,1),l(),R(3,"div",1),I(4,mte,2,0,":svg:svg",2)),t&2&&(m(3),C("matRippleDisabled",i.disableRipple||i.disabled)("matRippleTrigger",i._getHostElement()),m(),A(i._triggersSubmenu?4:-1))},dependencies:[Zs],encapsulation:2,changeDetection:0})}return n})();var b8=new cn("MatMenuContent"),y8=(()=>{class n{_template=f(Ro);_appRef=f(XO);_injector=f(rr);_viewContainerRef=f(ro);_document=f(Qi);_changeDetectorRef=f(X);_portal;_outlet;_attached=new We;constructor(){}attach(e={}){this._portal||(this._portal=new gd(this._template,this._viewContainerRef)),this.detach(),this._outlet||(this._outlet=new b4(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=vt({type:n,selectors:[["ng-template","matMenuContent",""]],features:[fn([{provide:b8,useExisting:n}])]})}return n})(),hte=new cn("mat-menu-default-options",{providedIn:"root",factory:()=>({overlapTrigger:!1,xPosition:"after",yPosition:"below",backdropClass:"cdk-overlay-transparent-backdrop"})}),aP="_mat-menu-enter",eb="_mat-menu-exit",Kn=(()=>{class n{_elementRef=f(Jt);_changeDetectorRef=f(X);_injector=f(rr);_keyManager;_xPosition;_yPosition;_firstItemFocusRef;_exitFallbackTimeout;_animationsDisabled=er();_allItems;_directDescendantItems=new Hl;_classList={};_panelAnimationState="void";_animationDone=new We;_isAnimating=Q(!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,i=Z({},this._classList);t&&t.length&&t.split(" ").forEach(r=>{i[r]=!1}),this._previousPanelClass=e,e&&e.length&&(e.split(" ").forEach(r=>{i[r]=!0}),this._elementRef.nativeElement.className=""),this._classList=i}_previousPanelClass;get classList(){return this.panelClass}set classList(e){this.panelClass=e}closed=new _e;close=this.closed;panelId=f(To).getId("mat-menu-panel-");constructor(){let e=f(hte);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 Yd(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd(),this._keyManager.tabOut.subscribe(()=>this.closed.emit("tab")),this._directDescendantItems.changes.pipe(gi(this._directDescendantItems),Vn(e=>Wn(...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 i=e.toArray(),r=Math.max(0,Math.min(i.length-1,t.activeItemIndex||0));i[r]&&!i[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(gi(this._directDescendantItems),Vn(t=>Wn(...t.map(i=>i._hovered))))}addItem(e){}removeItem(e){}_handleKeydown(e){let t=e.keyCode,i=this._keyManager;switch(t){case 27:xa(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)&&i.setFocusOrigin("keyboard"),i.onKeydown(e);return}}focusFirstItem(e="program"){this._firstItemFocusRef?.destroy(),this._firstItemFocusRef=Ja(()=>{let t=this._resolvePanel();if(!t||!t.contains(document.activeElement)){let i=this._keyManager;i.setFocusOrigin(e).setFirstItemActive(),!i.activeItem&&t&&t.focus()}},{injector:this._injector})}resetActiveItem(){this._keyManager.setActiveItem(-1)}setElevation(e){}setPositionClasses(e=this.xPosition,t=this.yPosition){this._classList=Ye(Z({},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===eb;(t||e===aP)&&(t&&(clearTimeout(this._exitFallbackTimeout),this._exitFallbackTimeout=void 0),this._animationDone.next(t?"void":"enter"),this._isAnimating.set(!1))}_onAnimationStart(e){(e===aP||e===eb)&&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(eb),200));this._animationsDisabled&&setTimeout(()=>{this._onAnimationDone(e?aP:eb)}),this._changeDetectorRef.markForCheck()}_updateDirectDescendants(){this._allItems.changes.pipe(gi(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,i,r){if(t&1&&Zi(r,b8,5)(r,tt,5)(r,tt,4),t&2){let a;mt(a=pt())&&(i.lazyContent=a.first),mt(a=pt())&&(i._allItems=a),mt(a=pt())&&(i.items=a)}},viewQuery:function(t,i){if(t&1&&In(Ro,5),t&2){let r;mt(r=pt())&&(i.templateRef=r.first)}},hostVars:3,hostBindings:function(t,i){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",yt],hasBackdrop:[2,"hasBackdrop","hasBackdrop",e=>e==null?null:yt(e)],panelClass:[0,"class","panelClass"],classList:"classList"},outputs:{closed:"closed",close:"close"},exportAs:["matMenu"],features:[fn([{provide:sP,useExisting:n}])],ngContentSelectors:pte,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,i){t&1&&(ai(),Qu(0,ute,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: transparent;
|
||
}
|
||
.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: 0.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})(),fte=new cn("mat-menu-scroll-strategy",{providedIn:"root",factory:()=>{let n=f(rr);return()=>SC(n)}});var of=new WeakMap,gte=(()=>{class n{_canHaveBackdrop;_element=f(Jt);_viewContainerRef=f(ro);_menuItemInstance=f(tt,{optional:!0,self:!0});_dir=f(es,{optional:!0});_focusMonitor=f(Fa);_ngZone=f(Ai);_injector=f(rr);_scrollStrategy=f(fte);_changeDetectorRef=f(X);_animationsDisabled=er();_portal;_overlayRef=null;_menuOpen=!1;_closingActionsSubscription=Mo.EMPTY;_menuCloseSubscription=Mo.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(sP,{optional:!0});this._parentMaterialMenu=t instanceof Kn?t:void 0}ngOnDestroy(){this._menu&&this._ownsMenu(this._menu)&&of.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 i=of.get(t);of.set(t,this),i&&i!==this&&i._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 Kn&&(t._setIsOpen(!0),t._directDescendantItems.changes.pipe(Ge(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,i=this._menu;!t||!this.menuOpen||(this._closingActionsSubscription.unsubscribe(),this._pendingRemoval?.unsubscribe(),i instanceof Kn&&this._ownsMenu(i)?(this._pendingRemoval=i._animationDone.pipe(Fo(1)).subscribe(()=>{t.detach(),of.has(i)||i.lazyContent?.detach()}),i._setIsOpen(!1)):(t.detach(),i?.lazyContent?.detach()),i&&this._ownsMenu(i)&&of.delete(i),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=kC(this._injector,t),this._overlayRef.keydownEvents().subscribe(i=>{this._menu instanceof Kn&&this._menu._handleKeydown(i)})}return this._overlayRef}_getOverlayConfig(e){return new wC({positionStrategy:MC(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(i=>{this._ngZone.run(()=>{let r=i.connectionPair.overlayX==="start"?"after":"before",a=i.connectionPair.overlayY==="top"?"below":"above";e.setPositionClasses(r,a)})})}_setPosition(e,t){let[i,r]=e.xPosition==="before"?["end","start"]:["start","end"],[a,c]=e.yPosition==="above"?["bottom","top"]:["top","bottom"],[p,u]=[a,c],[h,g]=[i,r],y=0;if(this._triggersSubmenu()){if(g=i=e.xPosition==="before"?"start":"end",r=h=i==="end"?"start":"end",this._parentMaterialMenu){if(this._parentInnerPadding==null){let b=this._parentMaterialMenu.items.first;this._parentInnerPadding=b?b._getHostElement().offsetTop:0}y=a==="bottom"?this._parentInnerPadding:-this._parentInnerPadding}}else e.overlapTrigger||(p=a==="top"?"bottom":"top",u=c==="top"?"bottom":"top");t.withPositions([{originX:i,originY:p,overlayX:h,overlayY:a,offsetY:y},{originX:r,originY:p,overlayX:g,overlayY:a,offsetY:y},{originX:i,originY:u,overlayX:h,overlayY:c,offsetY:-y},{originX:r,originY:u,overlayX:g,overlayY:c,offsetY:-y}])}_menuClosingActions(){let e=this._getOutsideClickStream(this._overlayRef),t=this._overlayRef.detachments(),i=this._parentMaterialMenu?this._parentMaterialMenu.closed:Nn(),r=this._parentMaterialMenu?this._parentMaterialMenu._hovered().pipe(ci(a=>this._menuOpen&&a!==this._menuItemInstance)):Nn();return Wn(e,i,r,t)}_getPortal(e){return(!this._portal||this._portal.templateRef!==e.templateRef)&&(this._portal=new gd(e.templateRef,this._viewContainerRef)),this._portal}_ownsMenu(e){return of.get(e)===this}_triggerIsAriaDisabled(){return yt(this._element.nativeElement.getAttribute("aria-disabled"))}static \u0275fac=function(t){qO()};static \u0275dir=vt({type:n})}return n})(),Fn=(()=>{class n extends gte{_cleanupTouchstart;_hoverSubscription=Mo.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 _e;onMenuOpen=this.menuOpened;menuClosed=new _e;onMenuClose=this.menuClosed;constructor(){super(!0);let e=f(Si);this._cleanupTouchstart=e.listen(this._element.nativeElement,"touchstart",t=>{xC(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=vt({type:n,selectors:[["","mat-menu-trigger-for",""],["","matMenuTriggerFor",""]],hostAttrs:[1,"mat-mdc-menu-trigger"],hostVars:3,hostBindings:function(t,i){t&1&&_("click",function(a){return i._handleClick(a)})("mousedown",function(a){return i._handleMousedown(a)})("keydown",function(a){return i._handleKeydown(a)}),t&2&&Qt("aria-haspopup",i.menu?"menu":null)("aria-expanded",i.menuOpen)("aria-controls",i.menuOpen?i.menu==null?null:i.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:[di]})}return n})();var qe=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[_c,th,_i,fd]})}return n})();var _te=[[["caption"]],[["colgroup"],["col"]],"*"],vte=["caption","colgroup, col","*"];function Cte(n,o){n&1&&an(0,2)}function xte(n,o){n&1&&(s(0,"thead",0),Fi(1,1),l(),s(2,"tbody",2),Fi(3,3)(4,4),l(),s(5,"tfoot",0),Fi(6,5),l())}function bte(n,o){n&1&&Fi(0,1)(1,3)(2,4)(3,5)}var Cn=(()=>{class n extends CD{stickyCssClass="mat-mdc-table-sticky";needsPositionStickyOnElement=!1;static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||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,i){t&2&&Ae("mat-table-fixed-layout",i.fixedLayout)},exportAs:["matTable"],features:[fn([{provide:CD,useExisting:n},{provide:Xl,useExisting:n},{provide:b0,useValue:null}]),di],ngContentSelectors:vte,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["role","rowgroup",1,"mdc-data-table__content"],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(t,i){t&1&&(ai(_te),an(0),an(1,1),I(2,Cte,1,0),I(3,xte,7,0)(4,bte,4,0)),t&2&&(m(2),A(i._isServer?2:-1),m(),A(i._isNativeHtmlTable?3:4))},dependencies:[gD,fD,vD,_D],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})(),xn=(()=>{class n extends Tx{static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275dir=vt({type:n,selectors:[["","matCellDef",""]],features:[fn([{provide:Tx,useExisting:n}]),di]})}return n})(),bn=(()=>{class n extends Ex{static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275dir=vt({type:n,selectors:[["","matHeaderCellDef",""]],features:[fn([{provide:Ex,useExisting:n}]),di]})}return n})();var yn=(()=>{class n extends km{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(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275dir=vt({type:n,selectors:[["","matColumnDef",""]],inputs:{name:[0,"matColumnDef","name"]},features:[fn([{provide:km,useExisting:n}]),di]})}return n})(),Sn=(()=>{class n extends dR{static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275dir=vt({type:n,selectors:[["mat-header-cell"],["th","mat-header-cell",""]],hostAttrs:["role","columnheader",1,"mat-mdc-header-cell","mdc-data-table__header-cell"],features:[di]})}return n})();var wn=(()=>{class n extends mR{static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275dir=vt({type:n,selectors:[["mat-cell"],["td","mat-cell",""]],hostAttrs:[1,"mat-mdc-cell","mdc-data-table__cell"],features:[di]})}return n})();var Mn=(()=>{class n extends y0{static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275dir=vt({type:n,selectors:[["","matHeaderRowDef",""]],inputs:{columns:[0,"matHeaderRowDef","columns"],sticky:[2,"matHeaderRowDefSticky","sticky",yt]},features:[fn([{provide:y0,useExisting:n}]),di]})}return n})();var kn=(()=>{class n extends Dx{static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275dir=vt({type:n,selectors:[["","matRowDef",""]],inputs:{columns:[0,"matRowDefColumns","columns"],when:[0,"matRowDefWhen","when"]},features:[fn([{provide:Dx,useExisting:n}]),di]})}return n})(),Tn=(()=>{class n extends uD{static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||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:uD,useExisting:n}]),di],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,i){t&1&&Fi(0,0)},dependencies:[cu],encapsulation:2})}return n})();var En=(()=>{class n extends hD{static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||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:hD,useExisting:n}]),di],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,i){t&1&&Fi(0,0)},dependencies:[cu],encapsulation:2})}return n})();var pn=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[Px,_i]})}return n})(),yte=9007199254740991,_r=class extends ud{_data;_renderData=new tn([]);_filter=new tn("");_internalPageChanges=new We;_renderChangesSubscription=null;filteredData;get data(){return this._data.value}set data(o){o=Array.isArray(o)?o:[],this._data.next(o),this._renderChangesSubscription||this._filterData(o)}get filter(){return this._filter.value}set filter(o){this._filter.next(o),this._renderChangesSubscription||this._filterData(this.data)}get sort(){return this._sort}set sort(o){this._sort=o,this._updateChangeSubscription()}_sort;get paginator(){return this._paginator}set paginator(o){this._paginator=o,this._updateChangeSubscription()}_paginator;sortingDataAccessor=(o,e)=>{let t=o[e];if(u4(t)){let i=Number(t);return i<yte?i:t}return t};sortData=(o,e)=>{let t=e.active,i=e.direction;return!t||i==""?o:o.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 g=0;return c!=null&&p!=null?c>p?g=1:c<p&&(g=-1):c!=null?g=1:p!=null&&(g=-1),g*(i=="asc"?1:-1)})};filterPredicate=(o,e)=>{let t=e.trim().toLowerCase();return Object.values(o).some(i=>`${i}`.toLowerCase().includes(t))};constructor(o=[]){super(),this._data=new tn(o),this._updateChangeSubscription()}_updateChangeSubscription(){let o=this._sort?Wn(this._sort.sortChange,this._sort.initialized):Nn(null),e=this._paginator?Wn(this._paginator.page,this._internalPageChanges,this._paginator.initialized):Nn(null),t=this._data,i=Lr([t,this._filter]).pipe(Bt(([c])=>this._filterData(c))),r=Lr([i,o]).pipe(Bt(([c])=>this._orderData(c))),a=Lr([r,e]).pipe(Bt(([c])=>this._pageData(c)));this._renderChangesSubscription?.unsubscribe(),this._renderChangesSubscription=a.subscribe(c=>this._renderData.next(c))}_filterData(o){return this.filteredData=this.filter==null||this.filter===""?o:o.filter(e=>this.filterPredicate(e,this.filter)),this.paginator&&this._updatePaginator(this.filteredData.length),this.filteredData}_orderData(o){return this.sort?this.sortData(o.slice(),this.sort):o}_pageData(o){if(!this.paginator)return o;let e=this.paginator.pageIndex*this.paginator.pageSize;return o.slice(e,e+this.paginator.pageSize)}_updatePaginator(o){Promise.resolve().then(()=>{let e=this.paginator;if(e&&(e.length=o,e.pageIndex>0)){let t=Math.ceil(e.length/e.pageSize)-1||0,i=Math.min(e.pageIndex,t);i!==e.pageIndex&&(e.pageIndex=i,this._internalPageChanges.next())}})}connect(){return this._renderChangesSubscription||this._updateChangeSubscription(),this._renderData}disconnect(){this._renderChangesSubscription?.unsubscribe(),this._renderChangesSubscription=null}};var S8=(()=>{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,i){},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})(),Ste={passive:!0},w8=(()=>{class n{_platform=f(Es);_ngZone=f(Ai);_renderer=f(md).createRenderer(null,null);_styleLoader=f(sr);_monitoredElements=new Map;constructor(){}monitor(e){if(!this._platform.isBrowser)return Uu;this._styleLoader.load(S8);let t=Ul(e),i=this._monitoredElements.get(t);if(i)return i.subject;let r=new We,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,Ste)));return this._monitoredElements.set(t,{subject:r,unlisten:p}),r}stopMonitoring(e){let t=Ul(e),i=this._monitoredElements.get(t);i&&(i.unlisten(),i.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=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Bc=(()=>{class n{_elementRef=f(Jt);_platform=f(Es);_ngZone=f(Ai);_renderer=f(Si);_resizeEvents=new We;_previousValue;_initialHeight;_destroyed=new We;_listenerCleanups;_minRows;_maxRows;_enabled=!0;_previousMinRows=-1;_textareaElement;get minRows(){return this._minRows}set minRows(e){this._minRows=bC(e),this._setMinHeight()}get maxRows(){return this._maxRows}set maxRows(e){this._maxRows=bC(e),this._setMaxHeight()}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&((this._enabled=e)?this.resizeToFitContent(!0):this.reset())}get placeholder(){return this._textareaElement.placeholder}set placeholder(e){this._cachedPlaceholderHeight=void 0,e?this._textareaElement.setAttribute("placeholder",e):this._textareaElement.removeAttribute("placeholder"),this._cacheTextareaPlaceholderHeight()}_cachedLineHeight;_cachedPlaceholderHeight;_document=f(Qi);_hasFocus=!1;_isViewInited=!1;constructor(){f(sr).load(S8),this._textareaElement=this._elementRef.nativeElement}_setMinHeight(){let e=this.minRows&&this._cachedLineHeight?`${this.minRows*this._cachedLineHeight}px`:null;e&&(this._textareaElement.style.minHeight=e)}_setMaxHeight(){let e=this.maxRows&&this._cachedLineHeight?`${this.maxRows*this._cachedLineHeight}px`:null;e&&(this._textareaElement.style.maxHeight=e)}ngAfterViewInit(){this._platform.isBrowser&&(this._initialHeight=this._textareaElement.style.height,this.resizeToFitContent(),this._ngZone.runOutsideAngular(()=>{this._listenerCleanups=[this._renderer.listen("window","resize",()=>this._resizeEvents.next()),this._renderer.listen(this._textareaElement,"focus",this._handleFocusEvent),this._renderer.listen(this._textareaElement,"blur",this._handleFocusEvent)],this._resizeEvents.pipe(Qs(16)).subscribe(()=>{this._cachedLineHeight=this._cachedPlaceholderHeight=void 0,this.resizeToFitContent(!0)})}),this._isViewInited=!0,this.resizeToFitContent(!0))}ngOnDestroy(){this._listenerCleanups?.forEach(e=>e()),this._resizeEvents.complete(),this._destroyed.next(),this._destroyed.complete()}_cacheTextareaLineHeight(){if(this._cachedLineHeight)return;let e=this._textareaElement.cloneNode(!1),t=e.style;e.rows=1,t.position="absolute",t.visibility="hidden",t.border="none",t.padding="0",t.height="",t.minHeight="",t.maxHeight="",t.top=t.bottom=t.left=t.right="auto",t.overflow="hidden",this._textareaElement.parentNode.appendChild(e),this._cachedLineHeight=e.clientHeight,e.remove(),this._setMinHeight(),this._setMaxHeight()}_measureScrollHeight(){let e=this._textareaElement,t=e.style.marginBottom||"",i=this._platform.FIREFOX,r=this._hasFocus,a=i?"cdk-textarea-autosize-measuring-firefox":"cdk-textarea-autosize-measuring";r&&(e.style.marginBottom=`${e.clientHeight}px`),e.classList.add(a);let c=e.scrollHeight-4;return e.classList.remove(a),r&&(e.style.marginBottom=t),c}_cacheTextareaPlaceholderHeight(){if(!this._isViewInited||this._cachedPlaceholderHeight!=null)return;if(!this.placeholder){this._cachedPlaceholderHeight=0;return}let e=this._textareaElement.value;this._textareaElement.value=this._textareaElement.placeholder,this._cachedPlaceholderHeight=this._measureScrollHeight(),this._textareaElement.value=e}_handleFocusEvent=e=>{this._hasFocus=e.type==="focus"};ngDoCheck(){this._platform.isBrowser&&this.resizeToFitContent()}resizeToFitContent(e=!1){if(!this._enabled||(this._cacheTextareaLineHeight(),this._cacheTextareaPlaceholderHeight(),!this._cachedLineHeight))return;let t=this._elementRef.nativeElement,i=t.value;if(!e&&this._minRows===this._previousMinRows&&i===this._previousValue)return;let r=this._measureScrollHeight(),a=Math.max(r,this._cachedPlaceholderHeight||0);t.style.height=`${a}px`,this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame<"u"?requestAnimationFrame(()=>this._scrollToCaretPosition(t)):setTimeout(()=>this._scrollToCaretPosition(t))}),this._previousValue=i,this._previousMinRows=this._minRows}reset(){this._initialHeight!==void 0&&(this._textareaElement.style.height=this._initialHeight)}_noopInputHandler(){}_scrollToCaretPosition(e){let{selectionStart:t,selectionEnd:i}=e;!this._destroyed.isStopped&&this._hasFocus&&e.setSelectionRange(t,i)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["textarea","cdkTextareaAutosize",""]],hostAttrs:["rows","1",1,"cdk-textarea-autosize"],hostBindings:function(t,i){t&1&&_("input",function(){return i._noopInputHandler()})},inputs:{minRows:[0,"cdkAutosizeMinRows","minRows"],maxRows:[0,"cdkAutosizeMaxRows","maxRows"],enabled:[2,"cdkTextareaAutosize","enabled",yt],placeholder:"placeholder"},exportAs:["cdkTextareaAutosize"]})}return n})(),M8=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({})}return n})();var k8=new cn("MAT_INPUT_VALUE_ACCESSOR");var wte=["button","checkbox","file","hidden","image","radio","range","reset","submit"],Mte=new cn("MAT_INPUT_CONFIG"),Te=(()=>{class n{_elementRef=f(Jt);_platform=f(Es);ngControl=f(EC,{optional:!0,self:!0});_autofillMonitor=f(w8);_ngZone=f(Ai);_formField=f(rh,{optional:!0});_renderer=f(Si);_uid=f(To).getId("mat-input-");_previousNativeValue;_inputValueAccessor;_signalBasedValueAccessor;_previousPlaceholder=null;_errorStateTracker;_config=f(Mte,{optional:!0});_cleanupIosKeyup;_cleanupWebkitWheel;_isServer=!1;_isNativeSelect=!1;_isTextarea=!1;_isInFormField=!1;focused=!1;stateChanges=new We;controlType="mat-input";autofilled=!1;get disabled(){return this._disabled}set disabled(e){this._disabled=FC(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(je.required)??!1}set required(e){this._required=FC(e)}_required;get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&Ik().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=FC(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=>Ik().has(e));constructor(){let e=f(Gn,{optional:!0}),t=f(Ft,{optional:!0}),i=f(Cd),r=f(k8,{optional:!0,self:!0}),a=this._elementRef.nativeElement,c=a.nodeName.toLowerCase();r?QO(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 VC(i,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&&ur(()=>{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(){wte.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=vt({type:n,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:21,hostBindings:function(t,i){t&1&&_("focus",function(){return i._focusChanged(!0)})("blur",function(){return i._focusChanged(!1)})("input",function(){return i._onInput()}),t&2&&(Jo("id",i.id)("disabled",i.disabled&&!i.disabledInteractive)("required",i.required),Qt("name",i.name||null)("readonly",i._getReadonlyAttribute())("aria-disabled",i.disabled&&i.disabledInteractive?"true":null)("aria-invalid",i.empty&&i.required?null:i.errorState)("aria-required",i.required)("id",i.id),Ae("mat-input-server",i._isServer)("mat-mdc-form-field-textarea-control",i._isInFormField&&i._isTextarea)("mat-mdc-form-field-input-control",i._isInFormField)("mat-mdc-input-disabled-interactive",i.disabledInteractive)("mdc-text-field__input",i._isInFormField)("mat-mdc-native-select-inline",i._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",yt]},exportAs:["matInput"],features:[fn([{provide:LC,useExisting:n}]),Pn]})}return n})(),Se=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[we,we,M8,_i]})}return n})();var Pm=(()=>{class n{data;dialogRef=f(Ie);templateName=Q("");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)(at(Ct))};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,i){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),_("click",function(){return i.onNoClick()}),d(6,"No, cancel"),l(),s(7,"button",4),_("click",function(){return i.onYesClick()}),d(8,"Yes, delete!"),l()()),t&2&&(m(3),ee("Are you sure you want to delete template ",i.templateName(),"?"))},dependencies:[ve,Le,Ve,G,pe],encapsulation:2,changeDetection:0})}return n})();var kte=(n,o)=>o.compute_id;function Tte(n,o){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 Ete(n,o){if(n&1){let e=z();s(0,"button",13),_("click",function(){k(e);let i=v();return T(i.openAddDialog())}),s(1,"mat-icon"),d(2,"add_circle_outline"),l()()}}function Dte(n,o){n&1&&(s(0,"div",10),d(1,"Loading..."),l())}function Pte(n,o){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 Ite(n,o){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 Ate(n,o){n&1&&(s(0,"span",21),d(1,"Offline"),l())}function Ote(n,o){if(n&1){let e=z();s(0,"button",24),_("click",function(i){return i.stopPropagation()}),s(1,"mat-icon"),d(2,"more_vert"),l()(),s(3,"mat-menu",25,0)(5,"button",26),_("click",function(){k(e);let i=v().$implicit,r=v(2);return T(r.openEditDialog(i))}),s(6,"mat-icon"),d(7,"edit"),l(),s(8,"span"),d(9,"Edit"),l()(),s(10,"button",26),_("click",function(){k(e);let i=v().$implicit,r=v(2);return T(r.connectCompute(i))}),s(11,"mat-icon"),d(12,"link"),l(),s(13,"span"),d(14,"Connect"),l()(),s(15,"button",26),_("click",function(){k(e);let i=v().$implicit,r=v(2);return T(r.deleteCompute(i))}),s(16,"mat-icon"),d(17,"delete"),l(),s(18,"span"),d(19,"Delete"),l()()()}if(n&2){let e=ke(4);C("matMenuTriggerFor",e)}}function Nte(n,o){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),I(9,Ite,12,3)(10,Ate,2,0,"span",21),l(),I(11,Ote,20,1),l()),n&2){let e=o.$implicit,t=v(2);m(),Yt("color",t.getStatusColor(e)),C("matTooltip",e.connected?"Connected":"Disconnected"),m(),ee(" ",t.getStatusIcon(e)," "),m(3),B(e.name||e.compute_id),m(2),B(t.formatHost(e)),m(2),A(e.connected?9:10),m(2),A(e.compute_id!=="local"?11:-1)}}function Fte(n,o){if(n&1&&(s(0,"nav",12),K(1,Nte,12,8,"div",15,kte),l()),n&2){let e=v();m(),Y(e.computes())}}var Rte=(n,o)=>o.key;function Lte(n,o){if(n&1&&(s(0,"mat-option",6),d(1),l()),n&2){let e=o.$implicit;C("value",e.key),m(),B(e.name)}}function Vte(n,o){n&1&&(s(0,"mat-error"),d(1,"You must select a protocol"),l())}function Bte(n,o){n&1&&(s(0,"mat-error"),d(1,"You must enter a host"),l())}function zte(n,o){n&1&&(s(0,"mat-error"),d(1,"You must enter a port"),l())}function jte(n,o){n&1&&(s(0,"mat-error"),d(1,"Port must be between 1 and 65535"),l())}var E8=(()=>{class n{route=f(lt);controllerService=f(nt);computeService=f(Eo);notificationService=f(Js);toasterService=f(ie);dialog=f(it);cd=f(X);controller;_computes=Q([]);computes=$t(()=>[...this._computes()].sort((t,i)=>t.compute_id==="local"?-1:i.compute_id==="local"?1:(t.name||"").localeCompare(i.name||"")));displayedColumns=["status","name","host","connected","cpu","memory","disk","actions"];loading=Q(!0);subscription=new Mo;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 i=this.notificationService.getCachedComputes();this._computes.set(i),this.loading.set(!1),this.cd.markForCheck()}else this.loadComputes();this.subscription.add(this.notificationService.computeNotificationEmitter.subscribe(i=>{this.handleComputeNotification(i)})),this.subscription.add(this.notificationService.computeCacheUpdated.subscribe(i=>{this._computes.set(i),this.loading.set(!1),this.cd.markForCheck()}))},t=>{let i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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(i=>i.compute_id===e.event.compute_id?e.event:i));break;case"compute.deleted":this._computes.update(t=>t.filter(i=>i.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(T8,{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:i=>{let r=i.error?.message||i.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(T8,{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 i=t.error?.message||t.message||"Failed to load compute details";this.toasterService.error(i),this.cd.markForCheck()}})}deleteCompute(e){this.dialog.open(Pm,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],autoFocus:!1,disableClose:!0,data:{templateName:e.name||e.compute_id}}).afterClosed().subscribe(i=>{i&&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 i=this.computes().map(r=>r.compute_id===t.compute_id?t:r);this._computes.set(i),this.cd.markForCheck()},error:()=>{this.loadComputes()}})},error:t=>{let i=t.error?.message||t.message||"Failed to connect compute";this.toasterService.error(i),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,i){t&1&&(s(0,"div",1)(1,"header",2),I(2,Tte,3,1,"button",3),s(3,"h1",4),d(4,"Computes"),l(),I(5,Ete,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()(),I(12,Dte,2,0,"div",10),I(13,Pte,5,0,"div",11),I(14,Fte,3,0,"nav",12),l()()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.controller?5:-1),m(7),A(i.loading()?12:-1),m(),A(!i.loading()&&!i.computes().length?13:-1),m(),A(!i.loading()&&i.computes().length?14:-1))},dependencies:[ne,dt,vn,G,ze,oe,de,qe,Kn,tt,Fn,pn,ht,Mt,ve,we,Se,gt,Et],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})(),T8=(()=>{class n{dialogRef=f(Ie);data=f(Ct);protocols=[{key:"http",name:"HTTP"},{key:"https",name:"HTTPS"}];computeForm=new Ho({name:new $e(""),protocol:new $e("http",[je.required]),host:new $e("",[je.required]),port:new $e(3080,[je.required,je.min(1),je.max(65535)]),user:new $e("gns3"),password:new $e("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,i){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),K(12,Lte,2,2,"mat-option",6,Rte),l(),I(14,Vte,2,0,"mat-error"),l(),s(15,"mat-form-field",3)(16,"mat-label"),d(17,"Host"),l(),R(18,"input",7),I(19,Bte,2,0,"mat-error"),l(),s(20,"mat-form-field",3)(21,"mat-label"),d(22,"Port"),l(),R(23,"input",8),I(24,zte,2,0,"mat-error"),I(25,jte,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),_("click",function(){return i.onCancelClick()}),d(36,"Cancel"),l(),s(37,"button",13),_("click",function(){return i.onSaveClick()}),d(38),l()()()),t&2&&(m(),B(i.isEditMode?"Edit Compute":"Add Compute"),m(),C("formGroup",i.computeForm),m(10),Y(i.protocols),m(2),A(i.computeForm.get("protocol").hasError("required")?14:-1),m(5),A(i.computeForm.get("host").hasError("required")?19:-1),m(5),A(i.computeForm.get("port").hasError("required")?24:-1),m(),A(i.computeForm.get("port").hasError("min")||i.computeForm.get("port").hasError("max")?25:-1),m(12),C("disabled",i.computeForm.invalid),m(),ee(" ",i.isEditMode?"Update":"Add"," "))},dependencies:[ne,Et,rt,Nt,Uo,Dt,ot,Ft,Vt,ve,Le,Ve,St,G,pe,we,Me,Xe,ni,Se,Te,gt,Pt,ft],encapsulation:2,changeDetection:0})}return n})();var $te=["*"];var Hte=[[["","mat-card-avatar",""],["","matCardAvatar",""]],[["mat-card-title"],["mat-card-subtitle"],["","mat-card-title",""],["","mat-card-subtitle",""],["","matCardTitle",""],["","matCardSubtitle",""]],"*"],Ute=["[mat-card-avatar], [matCardAvatar]",`mat-card-title, mat-card-subtitle,
|
||
[mat-card-title], [mat-card-subtitle],
|
||
[matCardTitle], [matCardSubtitle]`,"*"],Wte=new cn("MAT_CARD_CONFIG"),On=(()=>{class n{appearance;constructor(){let e=f(Wte,{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,i){t&2&&Ae("mat-mdc-card-outlined",i.appearance==="outlined")("mdc-card--outlined",i.appearance==="outlined")("mat-mdc-card-filled",i.appearance==="filled")("mdc-card--filled",i.appearance==="filled")},inputs:{appearance:"appearance"},exportAs:["matCard"],ngContentSelectors:$te,decls:1,vars:0,template:function(t,i){t&1&&(ai(),an(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 transparent;
|
||
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})(),zc=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["mat-card-title"],["","mat-card-title",""],["","matCardTitle",""]],hostAttrs:[1,"mat-mdc-card-title"]})}return n})();var fl=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["mat-card-content"]],hostAttrs:[1,"mat-mdc-card-content"]})}return n})();var tb=(()=>{class n{align="start";static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["mat-card-actions"]],hostAttrs:[1,"mat-mdc-card-actions","mdc-card__actions"],hostVars:2,hostBindings:function(t,i){t&2&&Ae("mat-mdc-card-actions-align-end",i.align==="end")},inputs:{align:"align"},exportAs:["matCardActions"]})}return n})(),jc=(()=>{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:Ute,decls:4,vars:0,consts:[[1,"mat-mdc-card-header-text"]],template:function(t,i){t&1&&(ai(Hte),an(0),Co(1,"div",0),an(2,1),ko(),an(3,2))},encapsulation:2,changeDetection:0})}return n})();var kt=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[_i]})}return n})();var Im=(()=>{class n{dataChange=new tn([]);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=te({token:n,factory:n.\u0275fac})}return n})();var D8=(n,o)=>o.key;function Gte(n,o){n&1&&(s(0,"mat-error"),d(1,"You must enter a value"),l())}function qte(n,o){if(n&1&&(s(0,"mat-option",9),d(1),l()),n&2){let e=o.$implicit;C("value",e.key),m(),ee(" ",e.name," ")}}function Qte(n,o){if(n&1&&(s(0,"mat-option",9),d(1),l()),n&2){let e=o.$implicit;C("value",e.key),m(),ee(" ",e.name," ")}}var nb=(()=>{class n{controllerService=f(nt);controllerDatabase=f(Im);route=f(lt);router=f(_t);toasterService=f(ie);cdr=f(X);controllerOptionsVisibility=Q(!1);controllerIp;controllerPort;projectId;protocols=[{key:"http:",name:"HTTP"},{key:"https:",name:"HTTPS"}];locations=[{key:"local",name:"Local"},{key:"remote",name:"Remote"}];controllerForm=new Ho({name:new $e("",[je.required]),location:new $e(""),protocol:new $e("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(i=>i.host===this.controllerIp&&i.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 H4;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 i=t.error?.message||t.message||"Failed to create controller";this.toasterService.error(i),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,i){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),I(10,Gte,2,0,"mat-error"),l(),s(11,"mat-form-field")(12,"mat-select",8),K(13,qte,2,2,"mat-option",9,D8),l()(),s(15,"mat-form-field")(16,"mat-select",10),K(17,Qte,2,2,"mat-option",9,D8),l()()()(),s(19,"div",11)(20,"button",12),_("click",function(){return i.createController()}),d(21,"Add controller"),l()()()()),t&2&&(C("hidden",!i.controllerOptionsVisibility()),m(7),C("formGroup",i.controllerForm),m(3),A(i.controllerForm.get("name").hasError("required")?10:-1),m(3),Y(i.locations),m(4),Y(i.protocols))},dependencies:[ne,Et,rt,Nt,Dt,ot,Ft,Vt,dt,kt,On,we,Me,ni,Se,Te,gt,Pt,ft,Vo,G,pe],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var lP=new cn("CdkAccordion"),P8=(()=>{class n{_stateChanges=new We;_openCloseAllActions=new We;id=f(To).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=vt({type:n,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:[2,"multi","multi",yt]},exportAs:["cdkAccordion"],features:[fn([{provide:lP,useExisting:n}]),Pn]})}return n})(),I8=(()=>{class n{accordion=f(lP,{optional:!0,skipSelf:!0});_changeDetectorRef=f(X);_expansionDispatcher=f(oh);_openCloseAllSubscription=Mo.EMPTY;closed=new _e;opened=new _e;destroyed=new _e;expandedChange=new _e;id=f(To).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=Q(!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=vt({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:[2,"expanded","expanded",yt],disabled:[2,"disabled","disabled",yt]},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[fn([{provide:lP,useValue:void 0}])]})}return n})(),ib=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({})}return n})();var Xte=["body"],Kte=["bodyWrapper"],Yte=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],Zte=["mat-expansion-panel-header","*","mat-action-row"];function Jte(n,o){}var ene=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],tne=["mat-panel-title","mat-panel-description","*"];function nne(n,o){n&1&&(Co(0,"span",1),ti(),Co(1,"svg",2),ks(2,"path",3),ko()())}var cP=new cn("MAT_ACCORDION"),A8=new cn("MAT_EXPANSION_PANEL"),ine=(()=>{class n{_template=f(Ro);_expansionPanel=f(A8,{optional:!0});constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]})}return n})(),O8=new cn("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),Pd=(()=>{class n extends I8{_viewContainerRef=f(ro);_animationsDisabled=er();_document=f(Qi);_ngZone=f(Ai);_elementRef=f(Jt);_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 _e;afterCollapse=new _e;_inputChanges=new We;accordion=f(cP,{optional:!0,skipSelf:!0});_lazyContent;_body;_bodyWrapper;_portal;_headerId=f(To).getId("mat-expansion-panel-header-");constructor(){super();let e=f(O8,{optional:!0});this._expansionDispatcher=f(oh),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(gi(null),ci(()=>this.expanded&&!this._portal),Fo(1)).subscribe(()=>{this._portal=new gd(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,i,r){if(t&1&&Zi(r,ine,5),t&2){let a;mt(a=pt())&&(i._lazyContent=a.first)}},viewQuery:function(t,i){if(t&1&&In(Xte,5)(Kte,5),t&2){let r;mt(r=pt())&&(i._body=r.first),mt(r=pt())&&(i._bodyWrapper=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:4,hostBindings:function(t,i){t&2&&Ae("mat-expanded",i.expanded)("mat-expansion-panel-spacing",i._hasSpacing())},inputs:{hideToggle:[2,"hideToggle","hideToggle",yt],togglePosition:"togglePosition"},outputs:{afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[fn([{provide:cP,useValue:void 0},{provide:A8,useExisting:n}]),di,Pn],ngContentSelectors:Zte,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,i){t&1&&(ai(Yte),an(0),s(1,"div",2,0)(3,"div",3,1)(5,"div",4),an(6,1),Ce(7,Jte,0,0,"ng-template",5),l(),an(8,2),l()()),t&2&&(m(),Qt("inert",i.expanded?null:""),m(2),C("id",i.id),Qt("aria-labelledby",i._headerId),m(4),C("cdkPortalOutlet",i._portal))},dependencies:[Zu],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 Id=(()=>{class n{panel=f(Pd,{host:!0});_element=f(Jt);_focusMonitor=f(Fa);_changeDetectorRef=f(X);_parentChangeSubscription=Mo.EMPTY;constructor(){f(sr).load(la);let e=this.panel,t=f(O8,{optional:!0}),i=f(new hc("tabindex"),{optional:!0}),r=e.accordion?e.accordion._stateChanges.pipe(ci(a=>!!(a.hideToggle||a.togglePosition))):Uu;this.tabIndex=parseInt(i||"")||0,this._parentChangeSubscription=Wn(e.opened,e.closed,r,e._inputChanges.pipe(ci(a=>!!(a.hideToggle||a.disabled||a.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),e.closed.pipe(ci(()=>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:xa(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,i){t&1&&_("click",function(){return i._toggle()})("keydown",function(a){return i._keydown(a)}),t&2&&(Qt("id",i.panel._headerId)("tabindex",i.disabled?-1:i.tabIndex)("aria-controls",i._getPanelId())("aria-expanded",i._isExpanded())("aria-disabled",i.panel.disabled),Yt("height",i._getHeaderHeight()),Ae("mat-expanded",i._isExpanded())("mat-expansion-toggle-indicator-after",i._getTogglePosition()==="after")("mat-expansion-toggle-indicator-before",i._getTogglePosition()==="before"))},inputs:{expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight",tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:Lo(e)]},ngContentSelectors:tne,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,i){t&1&&(ai(ene),Co(0,"span",0),an(1),an(2,1),an(3,2),ko(),I(4,nne,3,0,"span",1)),t&2&&(Ae("mat-content-hide-toggle",!i._showToggle()),m(4),A(i._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})(),ob=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["mat-panel-description"]],hostAttrs:[1,"mat-expansion-panel-header-description"]})}return n})(),Am=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]})}return n})(),Om=(()=>{class n extends P8{_keyManager;_ownHeaders=new Hl;_headers;hideToggle=!1;displayMode="default";togglePosition="after";ngAfterContentInit(){this._headers.changes.pipe(gi(this._headers)).subscribe(e=>{this._ownHeaders.reset(e.filter(t=>t.panel.accordion===this)),this._ownHeaders.notifyOnChanges()}),this._keyManager=new Yd(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(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275dir=vt({type:n,selectors:[["mat-accordion"]],contentQueries:function(t,i,r){if(t&1&&Zi(r,Id,5),t&2){let a;mt(a=pt())&&(i._headers=a)}},hostAttrs:[1,"mat-accordion"],hostVars:2,hostBindings:function(t,i){t&2&&Ae("mat-accordion-multi",i.multi)},inputs:{hideToggle:[2,"hideToggle","hideToggle",yt],displayMode:"displayMode",togglePosition:"togglePosition"},exportAs:["matAccordion"],features:[fn([{provide:cP,useExisting:n}]),di]})}return n})(),gl=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[ib,Ju,_i]})}return n})();var ab=(()=>{class n{httpClient=f(Ks);sanitizer=f(xr);toasterService=f(ie);cd=f(X);thirdpartylicenses=Q("");releasenotes=Q("");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,i){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),_("click",function(){return i.goToDocumentation()}),d(38," Go to documentation "),l()()()),t&2&&(m(31),C("innerHTML",i.thirdpartylicenses(),wp),m(5),C("innerHTML",i.releasenotes(),wp))},dependencies:[G,pe,gl,Om,Pd,Id,Am,eo,i5,Zd],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 sb=(()=>{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=te({token:n,factory:n.\u0275fac})}return n})();var lb=(()=>{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 ki.solarputty_download_url&&(t.resource=ki.solarputty_download_url,e.push(t)),e}getForLinux(){return[]}getForDarwin(){return[]}static \u0275fac=function(t){return new(t||n)(ge(sb))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var cb=(()=>{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(lb))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var ane=(n,o)=>({hidden:n,lightTheme:o}),sne=/<a href="(.*)">(.*)<\/a><br\/>(.*)<br\/>\s*<button><a .*>(.*)<\/a>\s*<\/button>/i,db=(()=>{class n{httpClient=f(Ks);themeService=f(pi);location=f(uC);isVisible=Q(!1);isLightThemeEnabled=Q(!1);adUrl=Q("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=Q("Network Config Generator makes it easy configure network devices, including VLANs without opening the CLI");buttonLabel=Q("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,""),i=sne.exec(t);this.adUrl.set(i[1].trim()),this.adBody.set(i[3].trim()),this.buttonLabel.set(i[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,i){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),_("click",function(){return i.hide()}),d(9,"close"),l()()),t&2&&(C("ngClass",aa(5,ane,!i.isVisible(),i.isLightThemeEnabled())),m(3),C("href",i.adUrl(),Na),m(),B(i.adBody()),m(2),C("href",i.adUrl(),Na),m(),B(i.buttonLabel()))},dependencies:[ne,Ji,oe,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 lne(n,o){if(n&1&&(Fe(0),d(1),Re()),n&2){let e=v();m(),B(e.buttonText())}}var mb=(()=>{class n{software;installedChanged=new _e;disabled=Q(!1);readyToInstall=Q(!0);buttonText=Q("");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:[Pn],decls:2,vars:2,consts:[["mat-button","","color","primary",3,"click","disabled"]],template:function(t,i){t&1&&(s(0,"button",0),_("click",function(){return i.install()}),I(1,lne,2,1,"ng-container"),l()),t&2&&(C("disabled",i.disabled()),m(),A(i.readyToInstall()?1:-1))},dependencies:[ne,G,pe],encapsulation:2,changeDetection:0})}return n})();function cne(n,o){n&1&&(s(0,"mat-header-cell"),d(1," Name "),l())}function dne(n,o){if(n&1&&(Fe(0),d(1),Re()),n&2){let e=v().$implicit;m(),ee(" ",e.name," ")}}function mne(n,o){n&1&&(Fe(0),R(1,"app-adbutler",13),Re())}function pne(n,o){if(n&1&&(s(0,"mat-cell"),I(1,dne,2,1,"ng-container"),I(2,mne,2,0,"ng-container"),l()),n&2){let e=o.$implicit;m(),A(e.type!=="adbutler"?1:-1),m(),A(e.type==="adbutler"?2:-1)}}function une(n,o){n&1&&R(0,"mat-header-cell")}function hne(n,o){if(n&1){let e=z();s(0,"app-install-software",16),_("installedChanged",function(i){k(e);let r=v(2);return T(r.onInstalled(i))}),l()}if(n&2){let e=v().$implicit;C("software",e)}}function fne(n,o){if(n&1&&(s(0,"mat-cell",14),I(1,hne,1,1,"app-install-software",15),l()),n&2){let e=o.$implicit;m(),A(e.type!=="adbutler"?1:-1)}}function gne(n,o){n&1&&R(0,"mat-header-row")}function _ne(n,o){n&1&&R(0,"mat-row")}var pb=(()=>{class n{dataSource=Q(null);displayedColumns=Q(["name","actions"]);installedSoftwareService=f(cb);changeDetectorRef=f(X);constructor(){}ngOnInit(){this.dataSource.set(new dP(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,i){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),Fe(8,6),Ce(9,cne,2,0,"mat-header-cell",7)(10,pne,3,2,"mat-cell",8),Re(),Fe(11,9),Ce(12,une,1,0,"mat-header-cell",7)(13,fne,2,1,"mat-cell",10),Re(),Ce(14,gne,1,0,"mat-header-row",11)(15,_ne,1,0,"mat-row",12),l()()()()),t&2&&(m(6),C("dataSource",i.dataSource()),m(8),C("matHeaderRowDef",i.displayedColumns()),m(),C("matRowDefColumns",i.displayedColumns()))},dependencies:[ne,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,db,mb],encapsulation:2,changeDetection:0})}return n})(),dP=class extends ud{installedSoftwareService;installed=new tn([]);constructor(o){super(),this.installedSoftwareService=o}connect(){return this.refresh(),this.installed}disconnect(){}refresh(){let o=this.installedSoftwareService.list();o.push({type:"adbutler"}),this.installed.next(o)}};var vne=["input"],Cne=["label"],xne=["*"],mP={color:"accent",clickAction:"check-indeterminate",disabledInteractive:!1},bne=new cn("mat-checkbox-default-options",{providedIn:"root",factory:()=>mP}),wa=(function(n){return n[n.Init=0]="Init",n[n.Checked=1]="Checked",n[n.Unchecked=2]="Unchecked",n[n.Indeterminate=3]="Indeterminate",n})(wa||{}),pP=class{source;checked},qt=(()=>{class n{_elementRef=f(Jt);_changeDetectorRef=f(X);_ngZone=f(Ai);_animationsDisabled=er();_options=f(bne,{optional:!0});focus(){this._inputElement.nativeElement.focus()}_createChangeEvent(e){let t=new pP;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 _e;indeterminateChange=new _e;value;disableRipple=!1;_inputElement;_labelElement;tabIndex;color;disabledInteractive;_onTouched=()=>{};_currentAnimationClass="";_currentCheckState=wa.Init;_controlValueAccessorChangeFn=()=>{};_validatorChangeFn=()=>{};constructor(){f(sr).load(la);let e=f(new hc("tabindex"),{optional:!0});this._options=this._options||mP,this.color=this._options.color||mP.color,this.tabIndex=e==null?0:parseInt(e)||0,this.id=this._uniqueId=f(To).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(wa.Indeterminate):this._transitionCheckState(this.checked?wa.Checked:wa.Unchecked),this.indeterminateChange.emit(e)),this._syncIndeterminate(e)}_indeterminate=Q(!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,i=this._getAnimationTargetElement();if(!(t===e||!i)&&(this._currentAnimationClass&&i.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(t,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){i.classList.add(this._currentAnimationClass);let r=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{i.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?wa.Checked:wa.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 wa.Init:if(t===wa.Checked)return this._animationClasses.uncheckedToChecked;if(t==wa.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case wa.Unchecked:return t===wa.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case wa.Checked:return t===wa.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case wa.Indeterminate:return t===wa.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,i){if(t&1&&In(vne,5)(Cne,5),t&2){let r;mt(r=pt())&&(i._inputElement=r.first),mt(r=pt())&&(i._labelElement=r.first)}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(t,i){t&2&&(Jo("id",i.id),Qt("tabindex",null)("aria-label",null)("aria-labelledby",null),ar(i.color?"mat-"+i.color:"mat-accent"),Ae("_mat-animation-noopable",i._animationsDisabled)("mdc-checkbox--disabled",i.disabled)("mat-mdc-checkbox-disabled",i.disabled)("mat-mdc-checkbox-checked",i.checked)("mat-mdc-checkbox-disabled-interactive",i.disabledInteractive))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",yt],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",yt],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",yt],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?void 0:Lo(e)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",yt],checked:[2,"checked","checked",yt],disabled:[2,"disabled","disabled",yt],indeterminate:[2,"indeterminate","indeterminate",yt]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[fn([{provide:_d,useExisting:dd(()=>n),multi:!0},{provide:TC,useExisting:n,multi:!0}]),Pn],ngContentSelectors:xne,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,i){if(t&1&&(ai(),s(0,"div",3),_("click",function(a){return i._preventBubblingFromLabel(a)}),s(1,"div",4,0)(3,"div",5),_("click",function(){return i._onTouchTargetClick()}),l(),s(4,"input",6,1),_("blur",function(){return i._onBlur()})("click",function(){return i._onInputClick()})("change",function(a){return i._onInteractionEvent(a)}),l(),R(6,"div",7),s(7,"div",8),ti(),s(8,"svg",9),R(9,"path",10),l(),Vr(),R(10,"div",11),l(),R(11,"div",12),l(),s(12,"label",13,2),an(14),l()()),t&2){let r=ke(2);C("labelPosition",i.labelPosition),m(4),Ae("mdc-checkbox--selected",i.checked),C("checked",i.checked)("indeterminate",i.indeterminate)("disabled",i.disabled&&!i.disabledInteractive)("id",i.inputId)("required",i.required)("tabIndex",i.disabled&&!i.disabledInteractive?-1:i.tabIndex),Qt("aria-label",i.ariaLabel||null)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby)("aria-checked",i.indeterminate?"mixed":null)("aria-controls",i.ariaControls)("aria-disabled",i.disabled&&i.disabledInteractive?!0:null)("aria-expanded",i.ariaExpanded)("aria-owns",i.ariaOwns)("name",i.name)("value",i.value),m(7),C("matRippleTrigger",r)("matRippleDisabled",i.disableRipple||i.disabled)("matRippleCentered",!0),m(),C("for",i.inputId)}},dependencies:[Zs,ah],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: transparent;
|
||
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: transparent;
|
||
}
|
||
@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: transparent;
|
||
}
|
||
|
||
.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: transparent;
|
||
}
|
||
|
||
.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: transparent;
|
||
}
|
||
.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: 0.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})(),Lt=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[qt,_i]})}return n})();var vl=(()=>{class n{httpController;controller_id="";constructor(e){this.httpController=e}login(e,t,i){let r=new s4().set("username",t).set("password",i),a={headers:new gC().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=te({token:n,factory:n.\u0275fac})}return n})();var ub=(()=>{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=te({token:n,factory:n.\u0275fac})}return n})();var Nm=(()=>{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(Js))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var yne=["usernameInput"];function Sne(n,o){n&1&&R(0,"mat-icon",3)}function wne(n,o){n&1&&R(0,"mat-icon",4)}function Mne(n,o){n&1&&R(0,"mat-icon",9)}function kne(n,o){n&1&&R(0,"mat-icon",10)}function Tne(n,o){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),B(e.controllerName),m(2),B(e.controllerAddress)}}function Ene(n,o){n&1&&(s(0,"mat-error"),d(1," Username is required "),l())}function Dne(n,o){n&1&&(s(0,"mat-error"),d(1," Password is required "),l())}function Pne(n,o){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 Ine(n,o){n&1&&R(0,"mat-progress-spinner",24)}function Ane(n,o){n&1&&(s(0,"span"),d(1,"Login"),l())}function One(n,o){n&1&&R(0,"mat-icon",29)}function Nne(n,o){n&1&&R(0,"mat-icon",30)}var hb=(()=>{class n{loginService=f(vl);controllerService=f(nt);controllerDatabase=f(Im);route=f(lt);router=f(_t);toasterService=f(ie);versionService=f(ub);themeService=f(pi);connectionManager=f(Nm);cd=f(X);controller;returnUrl=Q("");usernameInput;version=Q("");isLoading=Q(!1);hidePassword=Q(!0);isCapsLockOn=Q(!1);isRememberMeChecked=Q(!1);currentYear=new Date().getFullYear();isLightThemeEnabled=$t(()=>this.themeService.getActualTheme()==="light");loginForm=new DC({username:new fc("",{nonNullable:!0,validators:[je.required]}),password:new fc("",{nonNullable:!0,validators:[je.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:i=>{this.version.set(i.version)},error:i=>{let r=i.error?.message||i.message||"Failed to load version";this.toasterService.error(r),this.cd.markForCheck()}})},t=>{let i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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 i=>{let r=this.controller;r.authToken=i.access_token,i.refresh_token&&localStorage.setItem(`refresh_token_${r.id}`,i.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:i=>{this.isLoading.set(!1);let r=i.error?.message||i.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,i){if(t&1&&In(yne,5),t&2){let r;mt(r=pt())&&(i.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,i){t&1&&(s(0,"div",1)(1,"a",2),I(2,Sne,1,0,"mat-icon",3),I(3,wne,1,0,"mat-icon",4),l(),s(4,"div",5)(5,"mat-card",6)(6,"div",7)(7,"div",8),I(8,Mne,1,0,"mat-icon",9),I(9,kne,1,0,"mat-icon",10),s(10,"div",11)(11,"h1"),d(12,"GNS3"),l(),s(13,"h6"),d(14),l()()()(),I(15,Tne,8,2,"div",12),s(16,"form",13),_("ngSubmit",function(){return i.login()}),s(17,"mat-form-field",14)(18,"mat-icon",15),d(19,"person"),l(),R(20,"input",16,0),I(22,Ene,2,0,"mat-error"),l(),s(23,"mat-form-field",14)(24,"mat-icon",15),d(25,"lock"),l(),s(26,"input",17),_("keyup",function(a){return i.onCapsLock(a)}),l(),s(27,"mat-icon",18),_("click",function(){return i.togglePasswordVisibility()}),d(28),l(),I(29,Dne,2,0,"mat-error"),l(),I(30,Pne,5,0,"div",19),s(31,"div",20)(32,"mat-checkbox",21),_("change",function(a){return i.onRememberMeChange(a.checked)}),d(33," Remember me "),l()(),s(34,"div",22)(35,"button",23),I(36,Ine,1,0,"mat-progress-spinner",24)(37,Ane,2,0,"span"),l()()()(),s(38,"div",25)(39,"a",26),R(40,"mat-icon",27),l(),s(41,"a",28),I(42,One,1,0,"mat-icon",29),I(43,Nne,1,0,"mat-icon",30),l()(),s(44,"div",31),d(45),l()()()),t&2&&(m(2),A(i.isLightThemeEnabled()?-1:2),m(),A(i.isLightThemeEnabled()?3:-1),m(5),A(i.isLightThemeEnabled()?-1:8),m(),A(i.isLightThemeEnabled()?9:-1),m(5),ee("v",i.version()),m(),A(i.controllerName?15:-1),m(),C("formGroup",i.loginForm),m(6),A(i.loginForm.controls.username.hasError("required")?22:-1),m(4),C("type",i.hidePassword()?"password":"text"),m(2),ee(" ",i.hidePassword()?"visibility_off":"visibility"," "),m(),A(i.loginForm.controls.password.hasError("required")?29:-1),m(),A(i.isCapsLockOn()?30:-1),m(2),C("checked",i.isRememberMeChecked()),m(3),C("disabled",i.isLoading()),m(),A(i.isLoading()?36:37),m(6),A(i.isLightThemeEnabled()?-1:42),m(),A(i.isLightThemeEnabled()?43:-1),m(2),mi("GNS3 Web-UI \xA92018-",i.currentYear," v",i.version()))},dependencies:[ne,Et,rt,Nt,Dt,ot,Ft,Vt,dt,vn,kt,On,we,Me,ni,ts,Ti,Se,Te,Lt,qt,G,pe,oe,de,dn,qn],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 N8=(()=>{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,i){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 fb=(()=>{class n{route=f(lt);controllerId=Q("");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,i){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/"+i.controllerId()+"/preferences"),m(7),C("routerLink","/controller/"+i.controllerId()+"/preferences/builtin/ethernet-hubs"),m(4),C("routerLink","/controller/"+i.controllerId()+"/preferences/builtin/ethernet-switches"),m(4),C("routerLink","/controller/"+i.controllerId()+"/preferences/builtin/cloud-nodes"))},dependencies:[ne,dt,vn,G,ze,oe,de,eo,Zd],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 Fne=["input"],Rne=["formField"],Lne=["*"],gb=class{source;value;constructor(o,e){this.source=o,this.value=e}},Vne={provide:_d,useExisting:dd(()=>yo),multi:!0},F8=new cn("MatRadioGroup"),Bne=new cn("mat-radio-default-options",{providedIn:"root",factory:()=>({color:"accent",disabledInteractive:!1})}),yo=(()=>{class n{_changeDetector=f(X);_value=null;_name=f(To).getId("mat-radio-group-");_selected=null;_isInitialized=!1;_labelPosition="after";_disabled=!1;_required=!1;_buttonChanges;_controlValueAccessorChangeFn=()=>{};onTouched=()=>{};change=new _e;_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 gb(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=vt({type:n,selectors:[["mat-radio-group"]],contentQueries:function(t,i,r){if(t&1&&Zi(r,fo,5),t&2){let a;mt(a=pt())&&(i._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",yt],required:[2,"required","required",yt],disabledInteractive:[2,"disabledInteractive","disabledInteractive",yt]},outputs:{change:"change"},exportAs:["matRadioGroup"],features:[fn([Vne,{provide:F8,useExisting:n}])]})}return n})(),fo=(()=>{class n{_elementRef=f(Jt);_changeDetector=f(X);_focusMonitor=f(Fa);_radioDispatcher=f(oh);_defaultOptions=f(Bne,{optional:!0});_ngZone=f(Ai);_renderer=f(Si);_uniqueId=f(To).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 _e;radioGroup;get inputId(){return`${this.id||this._uniqueId}-input`}_checked=!1;_disabled=!1;_required=!1;_value=null;_removeUniqueSelectionListener=()=>{};_previousTabIndex;_inputElement;_rippleTrigger;_noopAnimations=er();_injector=f(rr);constructor(){f(sr).load(la);let e=f(F8,{optional:!0}),t=f(new hc("tabindex"),{optional:!0});this.radioGroup=e,this._disabledInteractive=this._defaultOptions?.disabledInteractive??!1,t&&(this.tabIndex=Lo(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 gb(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 i=this._inputElement?.nativeElement;i&&(i.setAttribute("tabindex",t+""),this._previousTabIndex=t,Ja(()=>{queueMicrotask(()=>{e&&e.selected&&e.selected!==this&&document.activeElement===i&&(e.selected?._inputElement.nativeElement.focus(),document.activeElement===i&&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,i){if(t&1&&In(Fne,5)(Rne,7,Jt),t&2){let r;mt(r=pt())&&(i._inputElement=r.first),mt(r=pt())&&(i._rippleTrigger=r.first)}},hostAttrs:[1,"mat-mdc-radio-button"],hostVars:19,hostBindings:function(t,i){t&1&&_("focus",function(){return i._inputElement.nativeElement.focus()}),t&2&&(Qt("id",i.id)("tabindex",null)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),Ae("mat-primary",i.color==="primary")("mat-accent",i.color==="accent")("mat-warn",i.color==="warn")("mat-mdc-radio-checked",i.checked)("mat-mdc-radio-disabled",i.disabled)("mat-mdc-radio-disabled-interactive",i.disabledInteractive)("_mat-animation-noopable",i._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",yt],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:Lo(e)],checked:[2,"checked","checked",yt],value:"value",labelPosition:"labelPosition",disabled:[2,"disabled","disabled",yt],required:[2,"required","required",yt],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",yt]},outputs:{change:"change"},exportAs:["matRadioButton"],ngContentSelectors:Lne,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,i){t&1&&(ai(),s(0,"div",2,0)(2,"div",3)(3,"div",4),_("click",function(a){return i._onTouchTargetClick(a)}),l(),s(4,"input",5,1),_("change",function(a){return i._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),an(12),l()()),t&2&&(C("labelPosition",i.labelPosition),m(2),Ae("mdc-radio--disabled",i.disabled),m(2),C("id",i.inputId)("checked",i.checked)("disabled",i.disabled&&!i.disabledInteractive)("required",i.required),Qt("name",i.name)("value",i.value)("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby)("aria-disabled",i.disabled&&i.disabledInteractive?"true":null),m(5),C("matRippleTrigger",i._rippleTrigger.nativeElement)("matRippleDisabled",i._isRippleDisabled())("matRippleCentered",!0),m(2),C("for",i.inputId))},dependencies:[Zs,ah],styles:[`.mat-mdc-radio-button {
|
||
-webkit-tap-highlight-color: transparent;
|
||
}
|
||
.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: 0.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: 0.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: 0.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})(),oo=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[_c,fo,_i]})}return n})();var _b,zne=new Uint8Array(16);function hP(){if(!_b&&(_b=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!_b))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _b(zne)}var R8=/^(?:[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 jne(n){return typeof n=="string"&&R8.test(n)}var L8=jne;var ha=[];for(vb=0;vb<256;++vb)ha.push((vb+256).toString(16).substr(1));var vb;function $ne(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=(ha[n[o+0]]+ha[n[o+1]]+ha[n[o+2]]+ha[n[o+3]]+"-"+ha[n[o+4]]+ha[n[o+5]]+"-"+ha[n[o+6]]+ha[n[o+7]]+"-"+ha[n[o+8]]+ha[n[o+9]]+"-"+ha[n[o+10]]+ha[n[o+11]]+ha[n[o+12]]+ha[n[o+13]]+ha[n[o+14]]+ha[n[o+15]]).toLowerCase();if(!L8(e))throw TypeError("Stringified UUID is invalid");return e}var V8=$ne;function Hne(n,o,e){n=n||{};var t=n.random||(n.rng||hP)();if(t[6]=t[6]&15|64,t[8]=t[8]&63|128,o){e=e||0;for(var i=0;i<16;++i)o[e+i]=t[i];return o}return V8(t)}var Li=Hne;var Tr=(()=>{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=te({token:n,factory:n.\u0275fac})}return n})();var Ma=(()=>{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:[],extra_configs:[],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=te({token:n,factory:n.\u0275fac})}return n})();function Une(n,o){if(n&1){let e=z();s(0,"button",14),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var Cb=(()=>{class n{route=f(lt);controllerService=f(nt);builtInTemplatesService=f(Tr);router=f(_t);toasterService=f(ie);templateMocksService=f(Ma);formBuilder=f(Bn);computeService=f(Eo);cd=f(X);controller;templateName="";formGroup;isLocalComputerChosen=!0;constructor(){this.formGroup=this.formBuilder.group({templateName:new $e("",je.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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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=Li(),e.name=this.formGroup.get("templateName").value,e.compute_id="local",this.builtInTemplatesService.addTemplate(this.controller,e).subscribe({next:()=>{this.goBack()},error:i=>{let r=i.error?.message||i.message||"Failed to add cloud node template";this.toasterService.error(r),this.cd.markForCheck()}})},error:t=>{let i=t.error?.message||t.message||"Failed to load template";this.toasterService.error(i),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,i){t&1&&(s(0,"div",0)(1,"header",1),I(2,Une,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),_("click",function(){return i.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),_("click",function(){return i.goBack()}),d(17,"Cancel"),l(),s(18,"button",13),_("click",function(){return i.addTemplate()}),d(19," Add template "),l()()()()),t&2&&(m(2),A(i.controller?2:-1),m(6),C("checked",!0),m(2),C("formGroup",i.formGroup))},dependencies:[ne,Je,rt,Nt,Dt,ot,Et,Ft,Vt,dt,oe,de,G,pe,ze,kt,oo,yo,fo,we,Me,Xe,Se,Te],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 Gne=["*",[["mat-chip-avatar"],["","matChipAvatar",""]],[["mat-chip-trailing-icon"],["","matChipRemove",""],["","matChipTrailingIcon",""]]],qne=["*","mat-chip-avatar, [matChipAvatar]","mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"];function Qne(n,o){n&1&&(s(0,"span",3),an(1,1),l())}function Xne(n,o){n&1&&(s(0,"span",6),an(1,2),l())}var Kne=`.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: transparent;
|
||
}
|
||
.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;
|
||
}
|
||
`,Yne=[[["","matChipEdit",""]],[["mat-chip-avatar"],["","matChipAvatar",""]],[["","matChipEditInput",""]],"*",[["mat-chip-trailing-icon"],["","matChipRemove",""],["","matChipTrailingIcon",""]]],Zne=["[matChipEdit]","mat-chip-avatar, [matChipAvatar]","[matChipEditInput]","*","mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"];function Jne(n,o){n&1&&R(0,"span",0)}function eie(n,o){n&1&&(s(0,"span",1),an(1),l())}function tie(n,o){n&1&&(s(0,"span",3),an(1,1),l())}function nie(n,o){n&1&&an(0,2)}function iie(n,o){n&1&&R(0,"span",7)}function oie(n,o){if(n&1&&I(0,nie,1,0)(1,iie,1,0,"span",7),n&2){let e=v();A(e.contentEditInput?0:1)}}function rie(n,o){n&1&&an(0,3)}function aie(n,o){n&1&&(s(0,"span",6),an(1,4),l())}var H8=["*"],sie=`.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;
|
||
}
|
||
`,U8=new cn("mat-chips-default-options",{providedIn:"root",factory:()=>({separatorKeyCodes:[13]})}),B8=new cn("MatChipAvatar"),z8=new cn("MatChipTrailingIcon"),j8=new cn("MatChipEdit"),gP=new cn("MatChipRemove"),CP=new cn("MatChip"),W8=(()=>{class n{_elementRef=f(Jt);_parentChip=f(CP);_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(sr).load(la),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=vt({type:n,selectors:[["","matChipContent",""]],hostAttrs:[1,"mat-mdc-chip-action","mdc-evolution-chip__action","mdc-evolution-chip__action--presentational"],hostVars:8,hostBindings:function(t,i){t&2&&(Qt("disabled",i._getDisabledAttribute())("aria-disabled",i.disabled),Ae("mdc-evolution-chip__action--primary",i._isPrimary)("mdc-evolution-chip__action--secondary",!i._isPrimary)("mdc-evolution-chip__action--trailing",!i._isPrimary&&!i._isLeading))},inputs:{disabled:[2,"disabled","disabled",yt],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?-1:Lo(e)],_allowFocusWhenDisabled:"_allowFocusWhenDisabled"}})}return n})(),xP=(()=>{class n extends W8{_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(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275dir=vt({type:n,selectors:[["","matChipAction",""]],hostVars:3,hostBindings:function(t,i){t&1&&_("click",function(a){return i._handleClick(a)})("keydown",function(a){return i._handleKeydown(a)}),t&2&&(Qt("tabindex",i._getTabindex()),Ae("mdc-evolution-chip__action--presentational",!1))},features:[di]})}return n})();var hi=(()=>{class n extends xP{_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(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275dir=vt({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,i){t&2&&Qt("aria-hidden",null)},features:[fn([{provide:gP,useExisting:n}]),di]})}return n})(),ei=(()=>{class n{_changeDetectorRef=f(X);_elementRef=f(Jt);_tagName=f(e4);_ngZone=f(Ai);_focusMonitor=f(Fa);_globalRippleOptions=f(j4,{optional:!0});_document=f(Qi);_onFocus=new We;_onBlur=new We;_isBasicChip=!1;role=null;_hasFocusInternal=!1;_pendingFocus=!1;_actionChanges;_animationsDisabled=er();_allLeadingIcons;_allTrailingIcons;_allEditIcons;_allRemoveIcons;_hasFocus(){return this._hasFocusInternal}id=f(To).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 _e;destroyed=new _e;basicChipAttrName="mat-basic-chip";leadingIcon;editIcon;trailingIcon;removeIcon;primaryAction;_rippleLoader=f($4);_injector=f(rr);constructor(){let e=f(sr);e.load(la),e.load(IC),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=Wn(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 i=t._elementRef.nativeElement;return i===e||i.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,i,r){if(t&1&&Zi(r,B8,5)(r,j8,5)(r,z8,5)(r,gP,5)(r,B8,5)(r,z8,5)(r,j8,5)(r,gP,5),t&2){let a;mt(a=pt())&&(i.leadingIcon=a.first),mt(a=pt())&&(i.editIcon=a.first),mt(a=pt())&&(i.trailingIcon=a.first),mt(a=pt())&&(i.removeIcon=a.first),mt(a=pt())&&(i._allLeadingIcons=a),mt(a=pt())&&(i._allTrailingIcons=a),mt(a=pt())&&(i._allEditIcons=a),mt(a=pt())&&(i._allRemoveIcons=a)}},viewQuery:function(t,i){if(t&1&&In(xP,5),t&2){let r;mt(r=pt())&&(i.primaryAction=r.first)}},hostAttrs:[1,"mat-mdc-chip"],hostVars:31,hostBindings:function(t,i){t&1&&_("keydown",function(a){return i._handleKeydown(a)}),t&2&&(Jo("id",i.id),Qt("role",i.role)("aria-label",i.ariaLabel),ar("mat-"+(i.color||"primary")),Ae("mdc-evolution-chip",!i._isBasicChip)("mdc-evolution-chip--disabled",i.disabled)("mdc-evolution-chip--with-trailing-action",i._hasTrailingIcon())("mdc-evolution-chip--with-primary-graphic",i.leadingIcon)("mdc-evolution-chip--with-primary-icon",i.leadingIcon)("mdc-evolution-chip--with-avatar",i.leadingIcon)("mat-mdc-chip-with-avatar",i.leadingIcon)("mat-mdc-chip-highlighted",i.highlighted)("mat-mdc-chip-disabled",i.disabled)("mat-mdc-basic-chip",i._isBasicChip)("mat-mdc-standard-chip",!i._isBasicChip)("mat-mdc-chip-with-trailing-icon",i._hasTrailingIcon())("_mat-animation-noopable",i._animationsDisabled))},inputs:{role:"role",id:"id",ariaLabel:[0,"aria-label","ariaLabel"],ariaDescription:[0,"aria-description","ariaDescription"],value:"value",color:"color",removable:[2,"removable","removable",yt],highlighted:[2,"highlighted","highlighted",yt],disableRipple:[2,"disableRipple","disableRipple",yt],disabled:[2,"disabled","disabled",yt]},outputs:{removed:"removed",destroyed:"destroyed"},exportAs:["matChip"],features:[fn([{provide:CP,useExisting:n}])],ngContentSelectors:qne,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,i){t&1&&(ai(Gne),R(0,"span",0),s(1,"span",1)(2,"span",2),I(3,Qne,2,0,"span",3),s(4,"span",4),an(5),R(6,"span",5),l()()(),I(7,Xne,2,0,"span",6)),t&2&&(m(3),A(i.leadingIcon?3:-1),m(4),A(i._hasTrailingIcon()?7:-1))},dependencies:[W8],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: transparent;
|
||
}
|
||
.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 fP=(()=>{class n{_elementRef=f(Jt);_document=f(Qi);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=vt({type:n,selectors:[["span","matChipEditInput",""]],hostAttrs:["role","textbox","tabindex","-1","contenteditable","true",1,"mat-chip-edit-input"]})}return n})(),lie=(()=>{class n extends ei{basicChipAttrName="mat-basic-chip-row";_renderer=f(Si);_cleanupMousedown;_editStartPending=!1;editable=!1;edited=new _e;defaultEditInput;contentEditInput;_alreadyFocused=!1;_isEditing=!1;constructor(){super(),this.role="row",this._onBlur.pipe(Ge(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,Ja(()=>{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,i,r){if(t&1&&Zi(r,fP,5),t&2){let a;mt(a=pt())&&(i.contentEditInput=a.first)}},viewQuery:function(t,i){if(t&1&&In(fP,5),t&2){let r;mt(r=pt())&&(i.defaultEditInput=r.first)}},hostAttrs:[1,"mat-mdc-chip","mat-mdc-chip-row","mdc-evolution-chip"],hostVars:29,hostBindings:function(t,i){t&1&&_("focus",function(){return i._handleFocus()})("click",function(a){return i._hasInteractiveActions()?i._handleClick(a):null})("dblclick",function(a){return i._handleDoubleclick(a)}),t&2&&(Jo("id",i.id),Qt("tabindex",i.disabled?null:-1)("aria-label",null)("aria-description",null)("role",i.role),Ae("mat-mdc-chip-with-avatar",i.leadingIcon)("mat-mdc-chip-disabled",i.disabled)("mat-mdc-chip-editing",i._isEditing)("mat-mdc-chip-editable",i.editable)("mdc-evolution-chip--disabled",i.disabled)("mdc-evolution-chip--with-leading-action",i._hasLeadingActionIcon())("mdc-evolution-chip--with-trailing-action",i._hasTrailingIcon())("mdc-evolution-chip--with-primary-graphic",i.leadingIcon)("mdc-evolution-chip--with-primary-icon",i.leadingIcon)("mdc-evolution-chip--with-avatar",i.leadingIcon)("mat-mdc-chip-highlighted",i.highlighted)("mat-mdc-chip-with-trailing-icon",i._hasTrailingIcon()))},inputs:{editable:"editable"},outputs:{edited:"edited"},features:[fn([{provide:ei,useExisting:n},{provide:CP,useExisting:n}]),di],ngContentSelectors:Zne,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,i){t&1&&(ai(Yne),I(0,Jne,1,0,"span",0),I(1,eie,2,0,"span",1),s(2,"span",2),I(3,tie,2,0,"span",3),s(4,"span",4),I(5,oie,2,1)(6,rie,1,0),R(7,"span",5),l()(),I(8,aie,2,0,"span",6)),t&2&&(A(i._isEditing?-1:0),m(),A(i._hasLeadingActionIcon()?1:-1),m(),C("disabled",i.disabled),Qt("aria-description",i.ariaDescription)("aria-label",i.ariaLabel),m(),A(i.leadingIcon?3:-1),m(2),A(i._isEditing?5:6),m(3),A(i._hasTrailingIcon()?8:-1))},dependencies:[xP,fP],styles:[Kne],encapsulation:2,changeDetection:0})}return n})(),bP=(()=>{class n{_elementRef=f(Jt);_changeDetectorRef=f(X);_dir=f(es,{optional:!0});_lastDestroyedFocusedChipIndex=null;_keyManager;_destroyed=new We;_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 Hl;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(gi(null),Vn(()=>Wn(...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(gi(this._chips)).subscribe(e=>{let t=[];e.forEach(i=>i._getActions().forEach(r=>t.push(r))),this._chipActions.reset(t),this._chipActions.notifyOnChanges()}),this._keyManager=new Yd(this._chipActions).withVerticalOrientation().withHorizontalOrientation(this._dir?this._dir.value:"ltr").withHomeAndEnd().skipPredicate(e=>this._skipPredicate(e)),this.chipFocusChanges.pipe(Ge(this._destroyed)).subscribe(({chip:e})=>{let t=e._getSourceAction(document.activeElement);t&&this._keyManager.updateActiveItem(t)}),this._dir?.change.pipe(Ge(this._destroyed)).subscribe(e=>this._keyManager.withHorizontalOrientation(e))}_skipPredicate(e){return e.disabled}_trackChipSetChanges(){this._chips.changes.pipe(gi(null),Ge(this._destroyed)).subscribe(()=>{this.disabled&&Promise.resolve().then(()=>this._syncChipsState()),this._redirectDestroyedChipFocus()})}_trackDestroyedFocusedChip(){this.chipDestroyedChanges.pipe(Ge(this._destroyed)).subscribe(e=>{let i=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(i)&&c&&(this._lastDestroyedFocusedChipIndex=i)})}_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,i,r){if(t&1&&Zi(r,ei,5),t&2){let a;mt(a=pt())&&(i._chips=a)}},hostAttrs:[1,"mat-mdc-chip-set","mdc-evolution-chip-set"],hostVars:1,hostBindings:function(t,i){t&1&&_("keydown",function(a){return i._handleKeydown(a)}),t&2&&Qt("role",i.role)},inputs:{disabled:[2,"disabled","disabled",yt],role:"role",tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:Lo(e)]},ngContentSelectors:H8,decls:2,vars:0,consts:[["role","presentation",1,"mdc-evolution-chip-set__chips"]],template:function(t,i){t&1&&(ai(),Co(0,"div",0),an(1),ko())},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 _P=class{source;value;constructor(o,e){this.source=o,this.value=e}},Ci=(()=>{class n extends bP{ngControl=f(EC,{optional:!0,self:!0});controlType="mat-chip-grid";_chipInput;_defaultRole="grid";_errorStateTracker;_uid=f(To).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(je.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 _e;valueChange=new _e;_chips=void 0;stateChanges=new We;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}constructor(){super();let e=f(Gn,{optional:!0}),t=f(Ft,{optional:!0}),i=f(Cd);this.ngControl&&(this.ngControl.valueAccessor=this),this._errorStateTracker=new VC(i,this.ngControl,t,e,this.stateChanges)}ngAfterContentInit(){this.chipBlurChanges.pipe(Ge(this._destroyed)).subscribe(()=>{this._blur(),this.stateChanges.next()}),Wn(this.chipFocusChanges,this._chips.changes).pipe(Ge(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,i=this._keyManager.activeItem;if(t===9)this._chipInput?.focused&&xa(e,"shiftKey")&&this._chips.length&&!this._chips.last.disabled?(e.preventDefault(),i?this._keyManager.setActiveItem(i):this._focusLastChip()):super._allowFocusEscape();else if(!this._chipInput?.focused)if((t===38||t===40)&&i){let r=this._chipActions.filter(p=>p._isPrimary===i._isPrimary&&!this._skipPredicate(p)),a=r.indexOf(i),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 _P(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,i,r){if(t&1&&Zi(r,lie,5),t&2){let a;mt(a=pt())&&(i._chips=a)}},hostAttrs:[1,"mat-mdc-chip-set","mat-mdc-chip-grid","mdc-evolution-chip-set"],hostVars:10,hostBindings:function(t,i){t&1&&_("focus",function(){return i.focus()})("blur",function(){return i._blur()}),t&2&&(Qt("role",i.role)("tabindex",i.disabled||i._chips&&i._chips.length===0?-1:i.tabIndex)("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState),Ae("mat-mdc-chip-list-disabled",i.disabled)("mat-mdc-chip-list-invalid",i.errorState)("mat-mdc-chip-list-required",i.required))},inputs:{disabled:[2,"disabled","disabled",yt],placeholder:"placeholder",required:[2,"required","required",yt],value:"value",errorStateMatcher:"errorStateMatcher"},outputs:{change:"change",valueChange:"valueChange"},features:[fn([{provide:LC,useExisting:n}]),di],ngContentSelectors:H8,decls:2,vars:0,consts:[["role","presentation",1,"mdc-evolution-chip-set__chips"]],template:function(t,i){t&1&&(ai(),Co(0,"div",0),an(1),ko())},styles:[sie],encapsulation:2,changeDetection:0})}return n})(),xi=(()=>{class n{_elementRef=f(Jt);focused=!1;get chipGrid(){return this._chipGrid}set chipGrid(e){e&&(this._chipGrid=e,this._chipGrid.registerInput(this))}_chipGrid;addOnBlur=!1;separatorKeyCodes;chipEnd=new _e;placeholder="";id=f(To).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(U8),t=f(rh,{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 i,r;typeof t=="number"?(i=t,r=null):(i=t.keyCode,r=t.modifiers);let a=r?.length?xa(e,...r):!xa(e);if(i===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=vt({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,i){t&1&&_("keydown",function(a){return i._keydown(a)})("blur",function(){return i._blur()})("focus",function(){return i._focus()})("input",function(){return i._onInput()}),t&2&&(Jo("id",i.id),Qt("disabled",i.disabled&&!i.disabledInteractive?"":null)("placeholder",i.placeholder||null)("aria-invalid",i._chipGrid&&i._chipGrid.ngControl?i._chipGrid.ngControl.invalid:null)("aria-required",i._chipGrid&&i._chipGrid.required||null)("aria-disabled",i.disabled&&i.disabledInteractive?"true":null)("readonly",i._getReadonlyAttribute())("required",i._chipGrid&&i._chipGrid.required||null))},inputs:{chipGrid:[0,"matChipInputFor","chipGrid"],addOnBlur:[2,"matChipInputAddOnBlur","addOnBlur",yt],separatorKeyCodes:[0,"matChipInputSeparatorKeyCodes","separatorKeyCodes"],placeholder:"placeholder",id:"id",disabled:[2,"disabled","disabled",yt],readonly:[2,"readonly","readonly",yt],disabledInteractive:[2,"matChipInputDisabledInteractive","disabledInteractive",yt]},outputs:{chipEnd:"matChipInputTokenEnd"},exportAs:["matChipInput","matChipInputFor"],features:[Pn]})}return n})();var oi=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({providers:[Cd,{provide:U8,useValue:{separatorKeyCodes:[13]}}],imports:[_c,_i]})}return n})();var ka=(()=>{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=te({token:n,factory:n.\u0275fac})}return n})();var Wi=(()=>{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,i)=>`${e} must be between ${t} and ${i}`,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 i=e!=null&&e.trim()!=="";return{isValid:i,errorMessage:i?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),i=!isNaN(t)&&t>=0&&t===parseFloat(e);return{isValid:i,errorMessage:i?void 0:this.errorMessages.portInvalid}}createIntegerValidator(e,t){return i=>{if(!i||i.trim()==="")return{isValid:!1,errorMessage:`${e} is required`};let r=parseInt(i,10),a=!isNaN(r)&&r>=t&&r===parseFloat(i),c=t===0?"non-negative":`positive (>= ${t})`;return{isValid:a,errorMessage:a?void 0:`${e} must be a ${c} integer`}}}validatePortRange(e,t=0,i=65535){let r=this.validatePort(e);if(!r.isValid)return r;let a=parseInt(e,10),c=a>=t&&a<=i;return{isValid:c,errorMessage:c?void 0:this.errorMessages.portOutOfRange(t,i)}}validatePositiveInteger(e,t="Value"){if(!e||e.trim()==="")return{isValid:!1,errorMessage:this.errorMessages.required(t)};let i=parseInt(e,10),r=!isNaN(i)&&i>=1&&i===parseFloat(e);return{isValid:r,errorMessage:r?void 0:this.errorMessages.numberTooSmall(t,1)}}validateNumberRange(e,t,i,r="Value"){if(!e||e.trim()==="")return{isValid:!1,errorMessage:this.errorMessages.required(r)};let a=parseFloat(e),c=!isNaN(a)&&a>=t&&a<=i;return{isValid:c,errorMessage:c?void 0:this.errorMessages.numberOutOfRange(r,t,i)}}validateAtmVcMapping(e){if(!e||e.trim()==="")return{isValid:!1,errorMessage:this.errorMessages.required("Mapping")};let i=/^([0-9]*):([0-9]*):([0-9]*)$/.test(e);return{isValid:i,errorMessage:i?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[i,r]=t,a=this.validatePort(i),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[i,r]=t;if(!this.validatePort(i).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 i=/^((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:i,errorMessage:i?void 0:"Invalid IP address format"}}validateUnique(e,t,i){let r=i!==void 0?t.includes(e)&&e!==i: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 i=/^([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:i,errorMessage:i?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,i="Field",r){if(!e||e.trim()==="")return{isValid:!1,errorMessage:this.errorMessages.required(i)};let a=t.test(e);return{isValid:a,errorMessage:a?void 0:r||this.errorMessages.formatInvalid(i,t.toString())}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var yP=(()=>{class n{base=f(Wi);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[i,r]=t;return this.base.validatePort(i).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,i,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 g=this.validateDestinationPort(i);if(!g.isValid)return g;let y=this.validateDestinationVci(r);if(!y.isValid)return y;if(!p){let b=this.validateSourceVpi(a);if(!b.isValid)return b;let x=this.validateDestinationVpi(c);if(!x.isValid)return x}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,i){return i?this.validateVpMapping(e):this.validateVcMapping(e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var R0=(()=>{class n{base=f(Wi);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=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var L0=(()=>{class n{base=f(Wi);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 i=parseInt(e,10);return isNaN(i)||i<0||i!==parseFloat(e)?{isValid:!1,errorMessage:`Adapters must be a non-negative integer (0-${t})`}:i>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 i=e.split(`
|
||
`);for(let r=0;r<i.length;r++){let a=i[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}}validateExtraConfigs(e){let t=new Set;for(let i=0;i<e.length;i++){let r=(e[i].target||"").trim(),a=(e[i].content||"").trim(),c=i+1;if(!r){if(a)return{isValid:!1,errorMessage:`Extra files, row ${c}: file content requires a container target path`};continue}if(!r.startsWith("/"))return{isValid:!1,errorMessage:`Extra files, row ${c}: target "${r}" must be an absolute path (e.g., /firstboot.cfg)`};if(r.split("/").includes(".."))return{isValid:!1,errorMessage:`Extra files, row ${c}: target "${r}" must not contain '..'`};if(t.has(r))return{isValid:!1,errorMessage:`Extra files, row ${c}: duplicate target path "${r}"`};t.add(r)}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=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var V0=(()=>{class n{base=f(Wi);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 i=parseInt(e,10);return isNaN(i)||i<0||i!==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 i=parseInt(e,10);return isNaN(i)||i<0||i!==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 i=this.validateRam(e);if(!i.isValid)return i;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 i=this.validateNvram(e);if(!i.isValid)return i;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 i=parseInt(e,10);return isNaN(i)||i<0||i!==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 i=parseInt(e,10);return isNaN(i)||i<0||i!==parseFloat(e)?{isValid:!1,errorMessage:`${t} must be a non-negative integer`}:{isValid:!0}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var B0=(()=>{class n{base=f(Wi);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 i=parseInt(e,10);return isNaN(i)||i<0||i!==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 i=parseInt(e,10);return isNaN(i)||i<0||i!==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=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var SP=(()=>{class n{base=f(Wi);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=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var cie=1,Cl=(()=>{class n{httpController;symbols=new tn([]);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 i=`${e.host}:${e.port}:${t}`;if(!this.dimensionsCache.has(i)){let r=encodeURI(t);this.dimensionsCache.set(i,this.httpController.get(e,`/symbols/${r}/dimensions`).pipe(Sp(1)))}return this.dimensionsCache.get(i)}getSymbolBlobUrl(e,t){return this.blobUrlCache.has(t)||this.blobUrlCache.set(t,this.httpController.getBlob(e,t).pipe(Bt(i=>URL.createObjectURL(i)),Sp(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,i){return this.cache=null,this.cachedControllerKey="",this.httpController.post(e,`/symbols/${t}/raw`,i)}addFile(e,t,i){return this.cache=null,this.cachedControllerKey="",this.httpController.postBlob(e,`/symbols/${t}/raw`,i)}delete(e,t){this.cache=null,this.cachedControllerKey="";let i=encodeURI(t);return this.httpController.delete(e,`/symbols/${i}`)}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(Sp(cie))),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(Bt(i=>i.filter(r=>r.builtin)),Sp(1))),this.builtinCache}listCustomSymbols(e){return this.load(e).pipe(Bt(t=>t.filter(i=>!i.builtin)))}raw(e,t){let i=encodeURI(t);return this.httpController.getText(e,`/symbols/${i}/raw`)}getSymbolFromTemplate(e,t){return`${e.protocol}//${e.host}:${e.port}/${ki.current_version}/symbols/${t.symbol}/raw`}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var G8=(()=>{class n{transform(e,t){return e?t?(t=t.toLowerCase(),e.filter(i=>i.filename.toLowerCase().includes(t))):e:[]}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Br({name:"filenamefilter",type:n,pure:!0})}return n})();var Ga=(()=>{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)(at(Ie),at(Ct))};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,i){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),_("click",function(){return i.onNoClick()}),s(11,"mat-icon",8),d(12,"close"),l(),s(13,"span"),d(14),l()(),s(15,"button",9),_("click",function(){return i.onYesClick()}),s(16,"mat-icon",8),d(17,"check_circle"),l(),s(18,"span"),d(19),l()()()()),t&2&&(m(5),B(i.title),m(3),B(i.data.message),m(6),B(i.cancelButtonText),m(5),B(i.confirmButtonText))},dependencies:[ne,oe,de,G,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 die=(n,o)=>o.symbol_id;function mie(n,o){if(n&1&&(s(0,"p",16),d(1),l()),n&2){let e=v(2);Ae("success",e.uploadSuccess())("error",!e.uploadSuccess()),m(),ee(" ",e.uploadStatus()," ")}}function pie(n,o){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),_("change",function(i){k(e);let r=v();return T(r.uploadSymbolFile(i))}),l(),s(13,"button",14),_("click",function(){k(e);let i=ke(12);return T(i.click())}),s(14,"mat-icon"),d(15,"add"),l(),d(16," Choose File to Upload "),l(),I(17,mie,2,5,"p",15),l()}if(n&2){let e=v();m(17),A(e.uploadStatus()?17:-1)}}function uie(n,o){n&1&&(s(0,"div",23),d(1,"Loading symbols..."),l())}function hie(n,o){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 fie(n,o){if(n&1){let e=z();s(0,"div",27),_("click",function(){let i=k(e).$implicit,r=v(3);return T(r.toggleSelection(i.symbol_id))}),R(1,"img",28),s(2,"span",29),d(3),l()()}if(n&2){let e=o.$implicit,t=v(3);Ae("selected",t.isSymbolSelected(e.symbol_id)),m(),C("src",t.getImageSource(e.symbol_id),Na)("alt",e.symbol_id),m(2),B(e.symbol_id)}}function gie(n,o){if(n&1&&(s(0,"div",25),K(1,fie,4,5,"div",26,die),l()),n&2){let e=v(2);m(),Y(e.customSymbols())}}function _ie(n,o){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),_("click",function(){k(e);let i=v();return T(i.deleteSelectedSymbols())}),s(6,"mat-icon"),d(7,"delete"),l(),d(8),l(),s(9,"button",21),_("click",function(){k(e);let i=v();return T(i.selectAllCustom())}),d(10,"Select all"),l(),s(11,"button",22),_("click",function(){k(e);let i=v();return T(i.clearSelection())}),d(12,"Clear"),l()()(),I(13,uie,2,0,"div",23)(14,hie,5,0,"div",24)(15,gie,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),A(e.isLoading()?13:e.customSymbols().length===0?14:15)}}var q8=(()=>{class n{dialogRef=f(Ie);cd=f(X);symbolService=f(Cl);toasterService=f(ie);data=f(Ct);controller=Q(void 0);activeTab=Q(0);symbolsUpdated=new _e;uploadStatus=Q("");uploadSuccess=Q(!1);customSymbols=Q([]);selectedForDeletion=Q(new Set);isLoading=Q(!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(i=>!i.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 i=Array.from(t.values());Yi(i.map(r=>this.symbolService.getSymbolBlobUrl(this.controller(),r))).subscribe({next:r=>{i.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(),i=new Set(t);i.has(e)?i.delete(e):i.add(e),this.selectedForDeletion.set(i),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(i=>this.selectedForDeletion().has(i.symbol_id));if(e.length===0)return;let t=e.map(i=>this.symbolService.delete(this.controller(),i.symbol_id));Yi(t).subscribe({next:()=>{this.selectedForDeletion.set(new Set),this.loadCustomSymbols(),this.symbolsUpdated.emit()},error:i=>{let r=i.error?.message||i.message||"Failed to delete symbols";this.toasterService.error(r),this.cd.markForCheck()}})}uploadSymbolFile(e){let t=e.target,i=t.files[0];if(!i)return;let r=i.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(i)}else if(a==="png"||a==="jpg"||a==="jpeg"||a==="gif"){let c=new Blob([i],{type:i.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([i],{type:i.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,i){t&1&&(s(0,"h2",1),d(1,"Symbols Manager"),l(),s(2,"mat-dialog-content",2)(3,"mat-tab-group",3),uc("selectedIndexChange",function(a){return pc(i.activeTab,a)||(i.activeTab=a),a}),_("selectedIndexChange",function(a){return i.onTabChange(a)}),s(4,"mat-tab",4),Ce(5,pie,18,1,"ng-template",5),l(),s(6,"mat-tab",6),Ce(7,_ie,16,3,"ng-template",5),l()()(),s(8,"mat-dialog-actions",7)(9,"button",8),_("click",function(){return i.onCloseClick()}),d(10,"Close"),l()()),t&2&&(m(3),mc("selectedIndex",i.activeTab))},dependencies:[ne,G,pe,oe,de,ve,Le,Ve,St,ho,r5,Wo,Go,ht,Mt],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 go=(()=>{class n{configs=new Map;constructor(){this.registerDefaultConfigs()}registerDefaultConfigs(){let e={panelClass:["base-dialog-panel"]},t={panelClass:["base-dialog-panel","configurator-dialog-panel"]},i={panelClass:["base-dialog-panel","simple-dialog-panel"]};this.configs.set("changeSymbol",Ye(Z({},t),{panelClass:["base-dialog-panel","configurator-dialog-panel","change-symbol-dialog-panel"]})),this.configs.set("templateSymbol",Ye(Z({},t),{panelClass:["base-dialog-panel","configurator-dialog-panel","change-symbol-dialog-panel"]})),this.configs.set("symbolsManager",Ye(Z({},t),{panelClass:["base-dialog-panel","configurator-dialog-panel"]})),this.configs.set("confirmation",{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"]}),this.configs.set("editController",Ye(Z({},e),{panelClass:["base-dialog-panel","edit-controller-dialog-panel"]})),this.configs.set("addController",Ye(Z({},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",Ye(Z({},t),{panelClass:["base-dialog-panel","configurator-dialog-panel","edit-project-dialog-panel"]})),this.configs.set("addAce",Ye(Z({},t),{panelClass:["base-dialog-panel","configurator-dialog-panel","add-ace-dialog-panel"]})),this.configs.set("newTemplate",Ye(Z({},t),{panelClass:["base-dialog-panel","configurator-dialog-panel","new-template-dialog-panel"]})),this.configs.set("nodesMenuConfirmation",Ye(Z({},i),{panelClass:["base-dialog-panel","simple-dialog-panel","nodes-menu-confirmation-dialog-panel"]})),this.configs.set("startCapture",Ye(Z({},i),{panelClass:["base-dialog-panel","simple-dialog-panel"]})),this.configs.set("linkStyleEditor",Ye(Z({},i),{panelClass:["base-dialog-panel","simple-dialog-panel"]})),this.configs.set("packetFilters",Ye(Z({},i),{panelClass:["base-dialog-panel","simple-dialog-panel"]})),this.configs.set("helpDialog",Ye(Z({},i),{panelClass:["base-dialog-panel","simple-dialog-panel"]}))}getConfig(e){let t=this.configs.get(e);return t?Z({},t):(console.warn(`DialogConfigService: No config found for "${e}", using base config`),{panelClass:["base-dialog-panel"]})}openConfig(e,t){let i=this.getConfig(e);return t?Z(Z({},i),t):i}registerConfig(e,t){this.configs.set(e,t)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var vie=(n,o,e)=>({buttonSelected:n,"in-delete-mode":o,"delete-selected":e}),Cie=n=>({imageSelected:n}),xie=(n,o)=>o.theme,bie=(n,o)=>o.symbol_id;function yie(n,o){if(n&1){let e=z();s(0,"mat-radio-group",12)(1,"mat-radio-button",13),_("click",function(){k(e);let i=v();return T(i.setFilter("all"))}),d(2,"All symbols"),l(),s(3,"mat-radio-button",14),_("click",function(){k(e);let i=v();return T(i.setFilter("builtin"))}),d(4,"Built-in symbols"),l(),s(5,"mat-radio-button",15),_("click",function(){k(e);let i=v();return T(i.setFilter("custom"))}),d(6,"Custom symbols"),l()(),s(7,"button",16),_("click",function(){k(e);let i=v();return T(i.openSymbolsManager())}),s(8,"mat-icon"),d(9,"settings"),l(),d(10," Symbols Manager "),l()}}function Sie(n,o){if(n&1){let e=z();s(0,"div",1)(1,"button",17),_("click",function(){k(e);let i=v();return T(i.deleteSelectedSymbols())}),s(2,"mat-icon"),d(3,"delete"),l(),d(4),l(),s(5,"span",18),d(6),l(),s(7,"button",19),_("click",function(){k(e);let i=v();return T(i.selectAllVisible())}),d(8,"Select all"),l(),s(9,"button",20),_("click",function(){k(e);let i=v();return T(i.clearSelection())}),d(10,"Clear"),l(),s(11,"button",16),_("click",function(){k(e);let i=v();return T(i.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 wie(n,o){if(n&1){let e=z();s(0,"div",23)(1,"div",24)(2,"button",25),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.isDeleteMode()&&r.canDeleteSymbol(i)?r.toggleSelection(i.symbol_id):r.setSelected(i.symbol_id))}),R(3,"img",26),l()()()}if(n&2){let e=o.$implicit,t=v(2);m(),Ae("delete-mode",t.isDeleteMode()),m(),C("ngClass",mC(5,vie,t.isSelected===e.symbol_id,t.isDeleteMode(),t.isDeleteMode()&&t.isSymbolSelected(e.symbol_id))),m(),C("ngClass",un(9,Cie,t.isSelected===e.symbol_id))("src",t.getImageSourceForTemplate(e.symbol_id),Na)}}function Mie(n,o){if(n&1){let e=z();s(0,"mat-expansion-panel",11)(1,"mat-expansion-panel-header",21),_("click",function(){let i=k(e).$implicit,r=v();return T(r.toggleTheme(i.theme))}),s(2,"mat-panel-title"),d(3),l(),s(4,"mat-panel-description"),d(5),l()(),s(6,"div",22),K(7,wie,4,11,"div",23,bie),nn(9,"filenamefilter"),l()()}if(n&2){let e=o.$implicit,t=v();C("expanded",t.isThemeExpanded(e.theme)),m(3),ee(" ",e.theme," "),m(2),ee(" ",e.symbols.length," symbols "),m(2),Y(sa(9,3,e.symbols,t.searchText()))}}var Fm=(()=>{class n{symbolService=f(Cl);toasterService=f(ie);cd=f(X);dialog=f(it);dialogConfig=f(go);controller=ae(void 0);symbol=ae(void 0);symbolChanged=new _e;symbols=[];filteredSymbols=[];symbolGroups=[];isSelected="";selectedForDeletion=Q(new Set);searchText=U("");expandedThemes=Q([]);zoomLevel=Q(1);isDeleteMode=Q(!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(i=>i!==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 i=Array.from(t.values());Yi(i.map(r=>this.symbolService.getSymbolBlobUrl(this.controller(),r))).subscribe({next:r=>{i.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 i=t.theme||"Other";e.has(i)||e.set(i,[]),e.get(i).push(t)}this.symbolGroups=Array.from(e.entries()).map(([t,i])=>({theme:t,symbols:i})).sort((t,i)=>t.theme.localeCompare(i.theme))}getImageSourceForTemplate(e){return this.symbolBlobUrls.get(e)||""}canDeleteSymbol(e){return!e.builtin}deleteSymbol(e,t){t.stopPropagation();let i={title:"Delete Symbol",message:`Are you sure you want to delete the symbol "${e.symbol_id}"?`,confirmButtonText:"Delete",cancelButtonText:"Cancel"};this.dialog.open(Ga,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:i}).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(),i=new Set(t);i.has(e)?i.delete(e):i.add(e),this.selectedForDeletion.set(i),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(i=>!i.builtin),t=new Set(e.map(i=>i.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 i={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(Ga,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:i}).afterClosed().subscribe(a=>{if(a){let c=e.map(p=>this.symbolService.delete(this.controller(),p.symbol_id));Yi(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(q8,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,i){t&1&&(s(0,"div",0),I(1,yie,11,0)(2,Sie,13,3,"div",1),l(),s(3,"form")(4,"mat-form-field",2)(5,"input",3),_("input",function(a){return i.searchText.set(a.target.value)}),l()()(),s(6,"div",4)(7,"button",5),_("click",function(){return i.zoomOut()}),s(8,"mat-icon"),d(9,"remove"),l()(),s(10,"span",6),d(11),l(),s(12,"button",7),_("click",function(){return i.zoomIn()}),s(13,"mat-icon"),d(14,"add"),l()(),s(15,"button",8),_("click",function(){return i.resetZoom()}),d(16,"Reset"),l()(),s(17,"div",9)(18,"mat-accordion",10),K(19,Mie,10,6,"mat-expansion-panel",11,xie),l()()),t&2&&(m(),A(i.isDeleteMode()?2:1),m(4),C("value",i.searchText()),m(2),C("disabled",i.zoomLevel()<=.5),m(4),ee("",i.Math.round(i.zoomLevel()*100),"%"),m(),C("disabled",i.zoomLevel()>=2),m(3),C("disabled",i.zoomLevel()===1),m(2),Yt("--zoom-level",i.zoomLevel()),m(2),Y(i.symbolGroups))},dependencies:[ne,Ji,Je,rt,ot,Gn,G,pe,ze,oe,de,Se,Te,Me,oo,yo,fo,gl,Om,Pd,Id,Am,ob,ve,ht,Mt,G8],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 Jr=(()=>{class n{dialogRef=f(Ie);cd=f(X);controller;symbol="";constructor(){let e=f(Ct);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,i){t&1&&(s(0,"h1",0),d(1,"Select symbol"),l(),s(2,"div",1)(3,"app-symbols",2),_("symbolChanged",function(a){return i.symbolChanged(a)}),l()(),s(4,"div",3)(5,"button",4),_("click",function(){return i.onCloseClick()}),d(6,"Cancel"),l(),s(7,"button",5),_("click",function(){return i.onSelectClick()}),d(8,"Choose symbol"),l()()),t&2&&(m(3),C("controller",i.controller)("symbol",i.symbol))},dependencies:[ve,Le,Ve,G,pe,Fm],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 kie(n,o){if(n&1){let e=z();s(0,"button",6),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function Tie(n,o){if(n&1){let e=z();s(0,"mat-chip",29),_("removed",function(){let i=k(e).$implicit,r=v(3);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",30),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function Eie(n,o){if(n&1&&(s(0,"mat-option",25),d(1),l()),n&2){let e=o.$implicit;C("value",e[1]),m(),B(e[0])}}function Die(n,o){if(n&1&&(s(0,"mat-option",25),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Pie(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.name.set(i.target.value))}),l()(),s(5,"mat-form-field",16)(6,"mat-label"),d(7,"Default name format"),l(),s(8,"input",18),_("input",function(i){k(e);let r=v(2);return T(r.defaultNameFormat.set(i.target.value))}),l()(),s(9,"div",19)(10,"mat-form-field",20)(11,"mat-label"),d(12,"Symbol"),l(),s(13,"input",21),_("input",function(i){k(e);let r=v(2);return T(r.symbol.set(i.target.value))}),l()(),s(14,"button",22),_("click",function(){k(e);let i=v(2);return T(i.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),K(21,Tie,4,1,"mat-chip",null,Oe),l(),s(23,"input",23),_("matChipInputTokenEnd",function(i){k(e);let r=v(2);return T(r.addTag(i))}),l()(),s(24,"mat-form-field",16)(25,"mat-label"),d(26,"Category"),l(),s(27,"mat-select",24),_("selectionChange",function(i){k(e);let r=v(2);return T(r.category.set(i.value))}),K(28,Eie,2,2,"mat-option",25,Ni),l()(),s(30,"mat-form-field",16)(31,"mat-label"),d(32,"Console type"),l(),s(33,"mat-select",24),_("selectionChange",function(i){k(e);let r=v(2);return T(r.consoleType.set(i.value))}),K(34,Die,2,2,"mat-option",25,Oe),l()(),s(36,"mat-form-field",16)(37,"mat-label"),d(38,"Console host"),l(),s(39,"input",26),_("input",function(i){k(e);let r=v(2);return T(r.consoleHost.set(i.target.value))}),l()(),s(40,"mat-form-field",16)(41,"mat-label"),d(42,"Console port"),l(),s(43,"input",27),_("input",function(i){k(e);let r=v(2);return T(r.consolePort.set(+i.target.value))}),l()(),s(44,"mat-form-field",16)(45,"mat-label"),d(46,"Console HTTP path"),l(),s(47,"input",28),_("input",function(i){k(e);let r=v(2);return T(r.consoleHttpPath.set(i.target.value))}),l()()()}if(n&2){let e=ke(20),t=v(2);m(4),C("value",t.name()),m(4),C("value",t.defaultNameFormat()),m(5),C("value",t.symbol()),m(8),Y(t.tags()),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.category()),m(),Y(t.categories),m(5),C("value",t.consoleType()),m(),Y(t.consoleTypes),m(5),C("value",t.consoleHost()),m(4),C("value",t.consolePort()),m(4),C("value",t.consoleHttpPath())}}function Iie(n,o){n&1&&(s(0,"th",41),d(1,"Interface"),l())}function Aie(n,o){if(n&1&&(s(0,"td",42),d(1),l()),n&2){let e=o.$implicit;m(),B(e.name)}}function Oie(n,o){n&1&&(s(0,"th",41),d(1,"Actions"),l())}function Nie(n,o){if(n&1){let e=z();s(0,"td",42)(1,"button",43),_("click",function(){let i=k(e).$implicit,r=v(3);return T(r.onDeleteEthernetInterface(i))}),s(2,"mat-icon",44),d(3,"delete"),l()()()}}function Fie(n,o){n&1&&R(0,"tr",45)}function Rie(n,o){n&1&&R(0,"tr",46)}function Lie(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.ethernetInterface.set(i.target.value))}),l()(),s(6,"button",33),_("click",function(){k(e);let i=v(2);return T(i.onAddEthernetInterface())}),d(7,"Add"),l()(),s(8,"table",34),Fe(9,35),Ce(10,Iie,2,0,"th",36)(11,Aie,2,1,"td",37),Re(),Fe(12,38),Ce(13,Oie,2,0,"th",36)(14,Nie,4,0,"td",37),Re(),Ce(15,Fie,1,0,"tr",39)(16,Rie,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 Vie(n,o){n&1&&(s(0,"th",41),d(1,"Interface"),l())}function Bie(n,o){if(n&1&&(s(0,"td",42),d(1),l()),n&2){let e=o.$implicit;m(),B(e.name)}}function zie(n,o){n&1&&(s(0,"th",41),d(1,"Actions"),l())}function jie(n,o){if(n&1){let e=z();s(0,"td",42)(1,"button",43),_("click",function(){let i=k(e).$implicit,r=v(3);return T(r.onDeleteTapInterface(i))}),s(2,"mat-icon",44),d(3,"delete"),l()()()}}function $ie(n,o){n&1&&R(0,"tr",45)}function Hie(n,o){n&1&&R(0,"tr",46)}function Uie(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.tapInterface.set(i.target.value))}),l()(),s(6,"button",33),_("click",function(){k(e);let i=v(2);return T(i.onAddTapInterface())}),d(7,"Add"),l()(),s(8,"table",34),Fe(9,35),Ce(10,Vie,2,0,"th",36)(11,Bie,2,1,"td",37),Re(),Fe(12,38),Ce(13,zie,2,0,"th",36)(14,jie,4,0,"td",37),Re(),Ce(15,$ie,1,0,"tr",39)(16,Hie,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 Wie(n,o){n&1&&(s(0,"th",41),d(1,"Name"),l())}function Gie(n,o){if(n&1&&(s(0,"td",42),d(1),l()),n&2){let e=o.$implicit;m(),B(e.name)}}function qie(n,o){n&1&&(s(0,"th",41),d(1,"Local port"),l())}function Qie(n,o){if(n&1&&(s(0,"td",42),d(1),l()),n&2){let e=o.$implicit;m(),B(e.lport)}}function Xie(n,o){n&1&&(s(0,"th",41),d(1,"Remote host"),l())}function Kie(n,o){if(n&1&&(s(0,"td",42),d(1),l()),n&2){let e=o.$implicit;m(),B(e.rhost)}}function Yie(n,o){n&1&&(s(0,"th",41),d(1,"Remote port"),l())}function Zie(n,o){if(n&1&&(s(0,"td",42),d(1),l()),n&2){let e=o.$implicit;m(),B(e.rport)}}function Jie(n,o){n&1&&(s(0,"th",41),d(1,"Actions"),l())}function eoe(n,o){if(n&1){let e=z();s(0,"td",42)(1,"button",60),_("click",function(){let i=k(e).$implicit,r=v(3);return T(r.deleteUdpInterface(i))}),s(2,"mat-icon",61),d(3,"delete"),l()()()}}function toe(n,o){n&1&&R(0,"tr",45)}function noe(n,o){n&1&&R(0,"tr",46)}function ioe(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.newPortName.set(i.target.value))}),l()(),s(6,"mat-form-field",49)(7,"mat-label"),d(8,"Remote host"),l(),s(9,"input",51),_("input",function(i){k(e);let r=v(2);return T(r.newPortRhost.set(i.target.value))}),l()(),s(10,"mat-form-field",49)(11,"mat-label"),d(12,"Local port"),l(),s(13,"input",52),_("input",function(i){k(e);let r=v(2);return T(r.newPortLport.set(+i.target.value))}),l()(),s(14,"mat-form-field",49)(15,"mat-label"),d(16,"Remote port"),l(),s(17,"input",53),_("input",function(i){k(e);let r=v(2);return T(r.newPortRport.set(+i.target.value))}),l()()(),s(18,"div",54)(19,"button",55),_("click",function(){k(e);let i=v(2);return T(i.onAddUdpInterface())}),d(20,"Add"),l()(),s(21,"table",34),Fe(22,35),Ce(23,Wie,2,0,"th",36)(24,Gie,2,1,"td",37),Re(),Fe(25,56),Ce(26,qie,2,0,"th",36)(27,Qie,2,1,"td",37),Re(),Fe(28,57),Ce(29,Xie,2,0,"th",36)(30,Kie,2,1,"td",37),Re(),Fe(31,58),Ce(32,Yie,2,0,"th",36)(33,Zie,2,1,"td",37),Re(),Fe(34,59),Ce(35,Jie,2,0,"th",36)(36,eoe,4,0,"td",37),Re(),Ce(37,toe,1,0,"tr",39)(38,noe,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 ooe(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.usage.set(i.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.usage())}}function roe(n,o){if(n&1){let e=z();s(0,"main",5)(1,"section",7)(2,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("general"))}),s(3,"h3",9),d(4,"General"),l(),s(5,"mat-icon",10),d(6),l()(),I(7,Pie,48,10,"form",11),l(),s(8,"section",7)(9,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("ethernet"))}),s(10,"h3",9),d(11,"Ethernet interfaces"),l(),s(12,"mat-icon",10),d(13),l()(),I(14,Lie,17,4,"div",11),l(),s(15,"section",7)(16,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("tap"))}),s(17,"h3",9),d(18,"TAP interfaces"),l(),s(19,"mat-icon",10),d(20),l()(),I(21,Uie,17,4,"div",11),l(),s(22,"section",7)(23,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("udp"))}),s(24,"h3",9),d(25,"UDP tunnels"),l(),s(26,"mat-icon",10),d(27),l()(),I(28,ioe,39,7,"div",11),l(),s(29,"section",7)(30,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("usage"))}),s(31,"h3",9),d(32,"Usage"),l(),s(33,"mat-icon",10),d(34),l()(),I(35,ooe,5,1,"div",12),l(),s(36,"div",13)(37,"button",14),_("click",function(){k(e);let i=v();return T(i.goBack())}),d(38,"Cancel"),l(),s(39,"button",15),_("click",function(){k(e);let i=v();return T(i.onSave())}),d(40,"Save"),l()()()}if(n&2){let e=v();m(6),B(e.generalExpanded?"expand_less":"expand_more"),m(),A(e.generalExpanded?7:-1),m(6),B(e.ethernetExpanded?"expand_less":"expand_more"),m(),A(e.ethernetExpanded?14:-1),m(6),B(e.tapExpanded?"expand_less":"expand_more"),m(),A(e.tapExpanded?21:-1),m(6),B(e.udpExpanded?"expand_less":"expand_more"),m(),A(e.udpExpanded?28:-1),m(6),B(e.usageExpanded?"expand_less":"expand_more"),m(),A(e.usageExpanded?35:-1)}}var xb=(()=>{class n{route=f(lt);controllerService=f(nt);builtInTemplatesService=f(Tr);toasterService=f(ie);builtInTemplatesConfigurationService=f(ka);validationService=f(R0);router=f(_t);cd=f(X);dialog=f(it);dialogConfig=f(go);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(i=>{this.controller=i,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()}})},i=>{let r=i.error?.message||i.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 i=this.portsMappingEthernet.map(a=>a.name),r=this.validationService.validateUniqueInterface(e,i);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 i=this.portsMappingTap.map(a=>a.name),r=this.validationService.validateUniqueInterface(e,i);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 i=this.validationService.validateRemoteConsolePort(this.consolePort().toString());if(!i.isValid){this.toasterService.error(i.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 i=this.validationService.validateRemoteConsoleHost(this.consoleHost());if(!i.isValid){this.toasterService.error(i.errorMessage||"Invalid remote console host");return}}if(this.consoleHttpPath()){let i=this.validationService.validateRemoteConsoleHttpPath(this.consoleHttpPath());if(!i.isValid){this.toasterService.error(i.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:i=>{let r=i.error?.message||i.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(Jr,e).afterClosed().subscribe(i=>{i&&this.symbol.set(i)})}addTag(e){let t=(e.value||"").trim(),i=this.tags();t&&this.tags.set([...i,t]),e.chipInput&&e.chipInput.clear()}removeTag(e){let t=this.tags(),i=t.indexOf(e);if(i>=0){let r=[...t];r.splice(i,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,i){t&1&&(s(0,"div",1)(1,"header",2),I(2,kie,3,0,"button",3),s(3,"h1",4),d(4,"Cloud node template configuration"),l()(),I(5,roe,41,10,"main",5),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.cloudNodeTemplate?5:-1))},dependencies:[ne,Je,rt,ot,Gn,dt,oe,de,G,pe,ze,we,Me,Xe,Se,Te,gt,Pt,ft,oi,ei,Ci,xi,hi,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,ht,Mt],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 bl=(()=>{class n{httpController;newTemplateCreated=new We;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=te({token:n,factory:n.\u0275fac})}return n})();var Vi=(()=>{class n{controller=ae(void 0);deleteEvent=new _e;templateService=f(bl);dialog=f(it);toasterService=f(ie);deleteItem(e,t){this.dialog.open(Pm,{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,i){},dependencies:[ve],encapsulation:2,changeDetection:0})}return n})();var ta=(()=>{class n{textMessage=ae(void 0);emptyTemplatesListMessage=$t(()=>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,i){t&1&&(s(0,"div",0)(1,"mat-card",1)(2,"h6",2),d(3),l()()()),t&2&&(m(3),ee(" ",i.emptyTemplatesListMessage()," "))},dependencies:[kt,On],styles:[".header[_ngcontent-%COMP%]{text-align:center}"],changeDetection:0})}return n})();var aoe=(n,o)=>o.template_id;function soe(n,o){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 loe(n,o){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 coe(n,o){n&1&&R(0,"app-empty-templates-list")}function doe(n,o){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),_("click",function(i){return i.stopPropagation()}),s(6,"mat-icon"),d(7,"more_vert"),l()(),s(8,"mat-menu",14,1)(10,"button",15),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.deleteTemplate(i))}),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=o.$implicit,t=ke(9);C("routerLink",e.template_id),m(4),B(e.name),m(),C("matMenuTriggerFor",t),m(10),C("routerLink",e.template_id)}}function moe(n,o){if(n&1&&(s(0,"nav",8),K(1,doe,20,4,"div",10,aoe),l()),n&2){let e=v();m(),Y(e.cloudNodesTemplates)}}var bb=(()=>{class n{route=f(lt);controllerService=f(nt);builtInTemplatesService=f(Tr);toasterService=f(ie);cd=f(X);controller;cloudNodesTemplates=[];deleteComponent=Rt(Vi);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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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,i){t&1&&Xt(i.deleteComponent,Vi,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,i){t&1&&(s(0,"div",2)(1,"header",3),I(2,soe,3,1,"button",4),s(3,"h1",5),d(4,"Cloud nodes templates"),l(),I(5,loe,3,1,"button",6),l(),s(6,"main",7),I(7,coe,1,0,"app-empty-templates-list"),I(8,moe,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),_("deleteEvent",function(){return i.onDeleteEvent()}),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.controller?5:-1),m(2),A(i.cloudNodesTemplates.length?-1:7),m(),A(i.cloudNodesTemplates.length?8:-1),m(),C("controller",i.controller))},dependencies:[ne,dt,vn,G,ze,oe,de,eo,qe,Kn,tt,Fn,ht,Mt,Vi,ta],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 poe(n,o){if(n&1){let e=z();s(0,"button",15),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var yb=(()=>{class n{route=f(lt);controllerService=f(nt);builtInTemplatesService=f(Tr);router=f(_t);toasterService=f(ie);templateMocksService=f(Ma);formBuilder=f(Bn);computeService=f(Eo);cd=f(X);controller;templateName="";formGroup;isLocalComputerChosen=!0;constructor(){this.formGroup=this.formBuilder.group({templateName:new $e("",je.required),numberOfPorts:new $e(8,je.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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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=Li(),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 i=t.error?.message||t.message||"Failed to add ethernet hub template";this.toasterService.error(i),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,i){t&1&&(s(0,"div",0)(1,"header",1),I(2,poe,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),_("click",function(){return i.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),_("click",function(){return i.goBack()}),d(21,"Cancel"),l(),s(22,"button",14),_("click",function(){return i.addTemplate()}),d(23," Add template "),l()()()()),t&2&&(m(2),A(i.controller?2:-1),m(6),C("checked",!0),m(2),C("formGroup",i.formGroup))},dependencies:[ne,Je,rt,Nt,Uo,Dt,ot,gc,Et,Ft,Vt,dt,oe,de,G,pe,ze,kt,oo,yo,fo,we,Me,Xe,Se,Te],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 uoe(n,o){if(n&1){let e=z();s(0,"button",6),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function hoe(n,o){if(n&1){let e=z();s(0,"mat-chip",27),_("removed",function(){let i=k(e).$implicit,r=v(3);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",28),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function foe(n,o){if(n&1&&(s(0,"mat-option",25),d(1),l()),n&2){let e=o.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function goe(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.templateName.set(i.target.value))}),l()(),s(5,"mat-form-field",16)(6,"mat-label"),d(7,"Default name format"),l(),s(8,"input",18),_("input",function(i){k(e);let r=v(2);return T(r.defaultName.set(i.target.value))}),l()(),s(9,"div",19)(10,"mat-form-field",20)(11,"mat-label"),d(12,"Symbol"),l(),s(13,"input",21),_("input",function(i){k(e);let r=v(2);return T(r.symbol.set(i.target.value))}),l()(),s(14,"button",22),_("click",function(){k(e);let i=v(2);return T(i.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),K(21,hoe,4,1,"mat-chip",null,Oe),l(),s(23,"input",23),_("matChipInputTokenEnd",function(i){k(e);let r=v(2);return T(r.addTag(i))}),l()(),s(24,"mat-form-field",16)(25,"mat-label"),d(26,"Category"),l(),s(27,"mat-select",24),_("selectionChange",function(i){k(e);let r=v(2);return T(r.category.set(i.value))}),K(28,foe,2,2,"mat-option",25,Ni),l()(),s(30,"mat-form-field",16)(31,"mat-label"),d(32,"Number of ports"),l(),s(33,"input",26),_("input",function(i){k(e);let r=v(2);return T(r.numberOfPorts.set(+i.target.value))}),l()()()}if(n&2){let e=ke(20),t=v(2);m(4),C("value",t.templateName()),m(4),C("value",t.defaultName()),m(5),C("value",t.symbol()),m(8),Y(t.tags()),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.category()),m(),Y(t.categories),m(5),C("value",t.numberOfPorts())}}function _oe(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.usage.set(i.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.usage())}}function voe(n,o){if(n&1){let e=z();s(0,"main",5)(1,"section",7)(2,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("general"))}),s(3,"h3",9),d(4,"General settings"),l(),s(5,"mat-icon",10),d(6),l()(),I(7,goe,34,7,"form",11),l(),s(8,"section",7)(9,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("usage"))}),s(10,"h3",9),d(11,"Usage"),l(),s(12,"mat-icon",10),d(13),l()(),I(14,_oe,5,1,"div",12),l(),s(15,"div",13)(16,"button",14),_("click",function(){k(e);let i=v();return T(i.goBack())}),d(17,"Cancel"),l(),s(18,"button",15),_("click",function(){k(e);let i=v();return T(i.onSave())}),d(19,"Save"),l()()()}if(n&2){let e=v();m(6),B(e.generalSettingsExpanded()?"expand_less":"expand_more"),m(),A(e.generalSettingsExpanded()?7:-1),m(6),B(e.usageExpanded()?"expand_less":"expand_more"),m(),A(e.usageExpanded()?14:-1)}}var Sb=(()=>{class n{route=f(lt);controllerService=f(nt);builtInTemplatesService=f(Tr);toasterService=f(ie);builtInTemplatesConfigurationService=f(ka);validationService=f(Wi);router=f(_t);cd=f(X);dialog=f(it);dialogConfig=f(go);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(i=>{this.controller=i,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()}})},i=>{let r=i.error?.message||i.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 i=0;i<t;i++)this.ethernetHubTemplate.ports_mapping.push({name:`Ethernet${i}`,port_number:i});this.builtInTemplatesService.saveTemplate(this.controller,this.ethernetHubTemplate).subscribe({next:()=>{this.toasterService.success("Changes saved"),this.cd.markForCheck()},error:i=>{let r=i.error?.message||i.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(Jr,e).afterClosed().subscribe(i=>{i&&this.symbol.set(i)})}addTag(e){let t=(e.value||"").trim(),i=this.tags();t&&this.tags.set([...i,t]),e.chipInput&&e.chipInput.clear()}removeTag(e){let t=this.tags(),i=t.indexOf(e);if(i>=0){let r=[...t];r.splice(i,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,i){t&1&&(s(0,"div",1)(1,"header",2),I(2,uoe,3,0,"button",3),s(3,"h1",4),d(4,"Ethernet hub template configuration"),l()(),I(5,voe,20,4,"main",5),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.ethernetHubTemplate?5:-1))},dependencies:[ne,Je,rt,ot,Gn,dt,oe,de,G,pe,ze,we,Me,Xe,Se,Te,gt,Pt,ft,oi,ei,Ci,xi,hi],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 Coe=(n,o)=>o.template_id;function xoe(n,o){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 boe(n,o){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 yoe(n,o){n&1&&R(0,"app-empty-templates-list")}function Soe(n,o){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),_("click",function(i){return i.stopPropagation()}),s(6,"mat-icon"),d(7,"more_vert"),l()(),s(8,"mat-menu",14,1)(10,"button",15),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.deleteTemplate(i))}),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=o.$implicit,t=ke(9);C("routerLink",e.template_id),m(4),B(e.name),m(),C("matMenuTriggerFor",t),m(10),C("routerLink",e.template_id)}}function woe(n,o){if(n&1&&(s(0,"nav",8),K(1,Soe,20,4,"div",10,Coe),l()),n&2){let e=v();m(),Y(e.ethernetHubsTemplates)}}var wb=(()=>{class n{route=f(lt);controllerService=f(nt);builtInTemplatesService=f(Tr);toasterService=f(ie);cd=f(X);controller;ethernetHubsTemplates=[];deleteComponent=Rt(Vi);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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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,i){t&1&&Xt(i.deleteComponent,Vi,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,i){t&1&&(s(0,"div",2)(1,"header",3),I(2,xoe,3,1,"button",4),s(3,"h1",5),d(4,"Ethernet hubs templates"),l(),I(5,boe,3,1,"button",6),l(),s(6,"main",7),I(7,yoe,1,0,"app-empty-templates-list"),I(8,woe,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),_("deleteEvent",function(){return i.onDeleteEvent()}),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.controller?5:-1),m(2),A(i.ethernetHubsTemplates.length?-1:7),m(),A(i.ethernetHubsTemplates.length?8:-1),m(),C("controller",i.controller))},dependencies:[ne,dt,vn,G,ze,oe,de,eo,qe,Kn,tt,Fn,ht,Mt,Vi,ta],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 Moe(n,o){if(n&1){let e=z();s(0,"button",15),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var Mb=(()=>{class n{route=f(lt);controllerService=f(nt);builtInTemplatesService=f(Tr);router=f(_t);toasterService=f(ie);formBuilder=f(Bn);cd=f(X);controller;formGroup;isLocalComputerChosen=!0;constructor(){this.formGroup=this.formBuilder.group({templateName:new $e("",je.required),numberOfPorts:new $e(8,je.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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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:Li(),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 i=0;i<t;i++)e.ports_mapping.push({name:`Ethernet${i}`,port_number:i,ethertype:"0x8100",type:"access",vlan:1});this.builtInTemplatesService.addTemplate(this.controller,e).subscribe({next:()=>{this.toasterService.success("Template added successfully"),this.goBack()},error:i=>{let r=i.error?.message||i.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,i){t&1&&(s(0,"div",0)(1,"header",1),I(2,Moe,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),_("click",function(){return i.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),_("click",function(){return i.goBack()}),d(21,"Cancel"),l(),s(22,"button",14),_("click",function(){return i.addTemplate()}),d(23," Add template "),l()()()()),t&2&&(m(2),A(i.controller?2:-1),m(6),C("checked",!0),m(2),C("formGroup",i.formGroup))},dependencies:[ne,Je,rt,Nt,Uo,Dt,ot,gc,Et,Ft,Vt,dt,oe,de,G,pe,ze,oo,yo,fo,we,Me,Xe,Se,Te],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 koe(n,o){n&1&&(s(0,"th",19),d(1,"Port number"),l())}function Toe(n,o){if(n&1&&(s(0,"td",20),d(1),l()),n&2){let e=o.$implicit;m(),B(e.port_number)}}function Eoe(n,o){n&1&&(s(0,"th",19),d(1,"VLAN"),l())}function Doe(n,o){if(n&1&&(s(0,"td",20),d(1),l()),n&2){let e=o.$implicit;m(),B(e.vlan)}}function Poe(n,o){n&1&&(s(0,"th",19),d(1,"Type"),l())}function Ioe(n,o){if(n&1&&(s(0,"td",20),d(1),l()),n&2){let e=o.$implicit;m(),B(e.type)}}function Aoe(n,o){n&1&&(s(0,"th",19),d(1,"EtherType"),l())}function Ooe(n,o){if(n&1&&(s(0,"td",20),d(1),l()),n&2){let e=o.$implicit;m(),B(e.ethertype)}}function Noe(n,o){n&1&&(s(0,"th",19),d(1,"Actions"),l())}function Foe(n,o){if(n&1){let e=z();s(0,"td",20)(1,"button",21),_("click",function(){let i=k(e).$implicit,r=v();return T(r.delete(i))}),s(2,"mat-icon",22),d(3,"delete"),l()()()}}function Roe(n,o){n&1&&R(0,"tr",23)}function Loe(n,o){n&1&&R(0,"tr",24)}function Voe(n,o){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function Boe(n,o){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}var Ad=(()=>{class n{ethernetPorts=[];newPortNumber=U(0);newPortVlan=U(1);newPortType=U("access");newPortEthertype=U("0x8100");builtInTemplatesConfigurationService=f(ka);toasterService=f(ie);portTypes=Q([]);etherTypes=Q([]);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(i=>i.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,i){t&1&&(s(0,"div",0)(1,"table",1),Fe(2,2),Ce(3,koe,2,0,"th",3)(4,Toe,2,1,"td",4),Re(),Fe(5,5),Ce(6,Eoe,2,0,"th",3)(7,Doe,2,1,"td",4),Re(),Fe(8,6),Ce(9,Poe,2,0,"th",3)(10,Ioe,2,1,"td",4),Re(),Fe(11,7),Ce(12,Aoe,2,0,"th",3)(13,Ooe,2,1,"td",4),Re(),Fe(14,8),Ce(15,Noe,2,0,"th",3)(16,Foe,4,0,"td",4),Re(),Ce(17,Roe,1,0,"tr",9)(18,Loe,1,0,"tr",10),l(),s(19,"div",11)(20,"mat-form-field",12)(21,"input",13),_("input",function(a){return i.newPortNumber.set(+a.target.value)}),l()(),s(22,"mat-form-field",12)(23,"input",14),_("input",function(a){return i.newPortVlan.set(+a.target.value)}),l()(),s(24,"mat-form-field",12)(25,"mat-select",15),_("selectionChange",function(a){return i.newPortType.set(a.value)}),K(26,Voe,2,2,"mat-option",16,Oe),l()(),s(28,"mat-form-field",12)(29,"mat-select",17),_("selectionChange",function(a){return i.newPortEthertype.set(a.value)}),K(30,Boe,2,2,"mat-option",16,Oe),l()(),s(32,"button",18),_("click",function(){return i.onAdd()}),d(33,"Add"),l()()()),t&2&&(m(),C("dataSource",i.ethernetPorts),m(16),C("matHeaderRowDef",i.displayedColumns),m(),C("matRowDefColumns",i.displayedColumns),m(3),C("value",i.newPortNumber()),m(2),C("value",i.newPortVlan()),m(2),C("value",i.newPortType()),m(),Y(i.portTypes()),m(3),C("value",i.newPortEthertype()),m(),Y(i.etherTypes()))},dependencies:[ne,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,G,pe,ze,oe,de,we,Me,Se,Te,gt,Pt,ft,ht,Mt,Vo],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 zoe(n,o){if(n&1){let e=z();s(0,"button",7),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function joe(n,o){if(n&1){let e=z();s(0,"mat-chip",28),_("removed",function(){let i=k(e).$implicit,r=v(3);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",29),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function $oe(n,o){if(n&1&&(s(0,"mat-option",27),d(1),l()),n&2){let e=o.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function Hoe(n,o){if(n&1&&(s(0,"mat-option",27),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function Uoe(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.templateName.set(i.target.value))}),l()(),s(5,"mat-form-field",18)(6,"mat-label"),d(7,"Default name format"),l(),s(8,"input",20),_("input",function(i){k(e);let r=v(2);return T(r.defaultName.set(i.target.value))}),l()(),s(9,"div",21)(10,"mat-form-field",22)(11,"mat-label"),d(12,"Symbol"),l(),s(13,"input",23),_("input",function(i){k(e);let r=v(2);return T(r.symbol.set(i.target.value))}),l()(),s(14,"button",24),_("click",function(){k(e);let i=v(2);return T(i.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),K(21,joe,4,1,"mat-chip",null,Oe),l(),s(23,"input",25),_("matChipInputTokenEnd",function(i){k(e);let r=v(2);return T(r.addTag(i))}),l()(),s(24,"mat-form-field",18)(25,"mat-label"),d(26,"Category"),l(),s(27,"mat-select",26),_("selectionChange",function(i){k(e);let r=v(2);return T(r.category.set(i.value))}),K(28,$oe,2,2,"mat-option",27,Ni),l()(),s(30,"mat-form-field",18)(31,"mat-label"),d(32,"Console type"),l(),s(33,"mat-select",26),_("selectionChange",function(i){k(e);let r=v(2);return T(r.consoleType.set(i.value))}),K(34,Hoe,2,2,"mat-option",27,Oe),l()()()}if(n&2){let e=ke(20),t=v(2);m(4),C("value",t.templateName()),m(4),C("value",t.defaultName()),m(5),C("value",t.symbol()),m(8),Y(t.tags()),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.category()),m(),Y(t.categories),m(5),C("value",t.consoleType()),m(),Y(t.consoleTypes)}}function Woe(n,o){if(n&1&&R(0,"app-ports",13,1),n&2){let e=v(2);C("ethernetPorts",e.ethernetSwitchTemplate.ports_mapping)}}function Goe(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.usage.set(i.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.usage())}}function qoe(n,o){if(n&1){let e=z();s(0,"main",6)(1,"section",8)(2,"div",9),_("click",function(){k(e);let i=v();return T(i.toggleSection("general"))}),s(3,"h3",10),d(4,"General settings"),l(),s(5,"mat-icon",11),d(6),l()(),I(7,Uoe,36,7,"form",12),l(),s(8,"section",8)(9,"div",9),_("click",function(){k(e);let i=v();return T(i.toggleSection("ports"))}),s(10,"h3",10),d(11,"Port settings"),l(),s(12,"mat-icon",11),d(13),l()(),I(14,Woe,2,1,"app-ports",13),l(),s(15,"section",8)(16,"div",9),_("click",function(){k(e);let i=v();return T(i.toggleSection("usage"))}),s(17,"h3",10),d(18,"Usage"),l(),s(19,"mat-icon",11),d(20),l()(),I(21,Goe,5,1,"div",14),l(),s(22,"div",15)(23,"button",16),_("click",function(){k(e);let i=v();return T(i.goBack())}),d(24,"Cancel"),l(),s(25,"button",17),_("click",function(){k(e);let i=v();return T(i.onSave())}),d(26," Save "),l()()()}if(n&2){let e=v();m(6),B(e.generalSettingsExpanded()?"expand_less":"expand_more"),m(),A(e.generalSettingsExpanded()?7:-1),m(6),B(e.portsExpanded()?"expand_less":"expand_more"),m(),A(e.portsExpanded()?14:-1),m(6),B(e.usageExpanded()?"expand_less":"expand_more"),m(),A(e.usageExpanded()?21:-1)}}var kb=(()=>{class n{portsComponent;route=f(lt);controllerService=f(nt);builtInTemplatesService=f(Tr);toasterService=f(ie);builtInTemplatesConfigurationService=f(ka);router=f(_t);cd=f(X);dialog=f(it);dialogConfig=f(go);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(i=>{this.controller=i,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()}})},i=>{let r=i.error?.message||i.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(Jr,e).afterClosed().subscribe(i=>{i&&this.symbol.set(i)})}addTag(e){let t=(e.value||"").trim(),i=this.tags();t&&this.tags.set([...i,t]),e.chipInput&&e.chipInput.clear()}removeTag(e){let t=this.tags(),i=t.indexOf(e);if(i>=0){let r=[...t];r.splice(i,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,i){if(t&1&&In(Ad,5),t&2){let r;mt(r=pt())&&(i.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,i){t&1&&(s(0,"div",2)(1,"header",3),I(2,zoe,3,0,"button",4),s(3,"h1",5),d(4,"Ethernet switch template configuration"),l()(),I(5,qoe,27,6,"main",6),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.ethernetSwitchTemplate?5:-1))},dependencies:[ne,Je,rt,ot,Gn,dt,oe,de,G,pe,ze,we,Me,Xe,Se,Te,gt,Pt,ft,oi,ei,Ci,xi,hi,Ad],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 Qoe=(n,o)=>o.template_id;function Xoe(n,o){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 Koe(n,o){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 Yoe(n,o){n&1&&R(0,"app-empty-templates-list")}function Zoe(n,o){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),_("click",function(i){return i.stopPropagation()}),s(6,"mat-icon"),d(7,"more_vert"),l()(),s(8,"mat-menu",14,1)(10,"button",15),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.deleteTemplate(i))}),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=o.$implicit,t=ke(9);C("routerLink",e.template_id),m(4),B(e.name),m(),C("matMenuTriggerFor",t),m(10),C("routerLink",e.template_id)}}function Joe(n,o){if(n&1&&(s(0,"nav",8),K(1,Zoe,20,4,"div",10,Qoe),l()),n&2){let e=v();m(),Y(e.ethernetSwitchesTemplates)}}var Tb=(()=>{class n{route=f(lt);controllerService=f(nt);builtInTemplatesService=f(Tr);toasterService=f(ie);cd=f(X);controller;ethernetSwitchesTemplates=[];deleteComponent=Rt(Vi);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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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,i){t&1&&Xt(i.deleteComponent,Vi,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,i){t&1&&(s(0,"div",2)(1,"header",3),I(2,Xoe,3,1,"button",4),s(3,"h1",5),d(4,"Ethernet switches templates"),l(),I(5,Koe,3,1,"button",6),l(),s(6,"main",7),I(7,Yoe,1,0,"app-empty-templates-list"),I(8,Joe,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),_("deleteEvent",function(){return i.onDeleteEvent()}),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.controller?5:-1),m(2),A(i.ethernetSwitchesTemplates.length?-1:7),m(),A(i.ethernetSwitchesTemplates.length?8:-1),m(),C("controller",i.controller))},dependencies:[ne,dt,vn,G,ze,oe,de,eo,qe,Kn,tt,Fn,ht,Mt,Vi,ta],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 ere=["*"];function tre(n,o){n&1&&an(0)}var wP=(()=>{class n{_elementRef=f(Jt);constructor(){}focus(){this._elementRef.nativeElement.focus()}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["","cdkStepHeader",""]],hostAttrs:["role","tab"]})}return n})(),MP=(()=>{class n{template=f(Ro);constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["","cdkStepLabel",""]]})}return n})();var Cu={NUMBER:"number",EDIT:"edit",DONE:"done",ERROR:"error"},nre=new cn("STEPPER_GLOBAL_OPTIONS"),Eb=(()=>{class n{_stepperOptions;_stepper=f(af);_displayDefaultIndicatorType;stepLabel;_childForms;content;stepControl;get interacted(){return this._interacted()}set interacted(e){this._interacted.set(e)}_interacted=Q(!1);interactedStream=new _e;label;errorMessage;ariaLabel;ariaLabelledby;get state(){return this._state()}set state(e){this._state.set(e)}_state=Q(void 0);get editable(){return this._editable()}set editable(e){this._editable.set(e)}_editable=Q(!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=Q(null);index=Q(-1);isSelected=$t(()=>this._stepper.selectedIndex===this.index());indicatorType=$t(()=>{let e=this.isSelected(),t=this.completed,i=this._state()??Cu.NUMBER,r=this._editable();return this._showError()&&this.hasError&&!e?Cu.ERROR:this._displayDefaultIndicatorType?!t||e?Cu.NUMBER:r?Cu.EDIT:Cu.DONE:t&&!e?Cu.DONE:t&&e?i:r&&e?Cu.EDIT:i});isNavigable=$t(()=>{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=Q(null);_getDefaultError(){return this.interacted&&!!this.stepControl?.invalid}constructor(){let e=f(nre,{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,i,r){if(t&1&&Zi(r,MP,5)(r,M4,5),t&2){let a;mt(a=pt())&&(i.stepLabel=a.first),mt(a=pt())&&(i._childForms=a)}},viewQuery:function(t,i){if(t&1&&In(Ro,7),t&2){let r;mt(r=pt())&&(i.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",yt],optional:[2,"optional","optional",yt],completed:[2,"completed","completed",yt],hasError:[2,"hasError","hasError",yt]},outputs:{interactedStream:"interacted"},exportAs:["cdkStep"],features:[Pn],ngContentSelectors:ere,decls:1,vars:0,template:function(t,i){t&1&&(ai(),Qu(0,tre,1,0,"ng-template"))},encapsulation:2,changeDetection:0})}return n})(),af=(()=>{class n{_dir=f(es,{optional:!0});_changeDetectorRef=f(X);_elementRef=f(Jt);_destroyed=new We;_keyManager;_steps;steps=new Hl;_stepHeader;_sortedHeaders=new Hl;get linear(){return this._linear()}set linear(e){this._linear.set(e)}_linear=Q(!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=Q(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 _e;selectedIndexChange=new _e;_groupId=f(To).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(gi(this._steps),Ge(this._destroyed)).subscribe(e=>{this.steps.reset(e.filter(t=>t._stepper===this)),this.steps.forEach((t,i)=>t.index.set(i)),this.steps.notifyOnChanges()})}ngAfterViewInit(){if(this._stepHeader.changes.pipe(gi(this._stepHeader),Ge(this._destroyed)).subscribe(e=>{this._sortedHeaders.reset(e.toArray().sort((t,i)=>t._elementRef.nativeElement.compareDocumentPosition(i._elementRef.nativeElement)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),this._sortedHeaders.notifyOnChanges()}),this._keyManager=new Yd(this._sortedHeaders).withWrap().withHomeAndEnd().withVerticalOrientation(this._orientation==="vertical"),this._keyManager.updateActiveItem(this.selectedIndex),(this._dir?this._dir.change:Nn()).pipe(gi(this._layoutDirection()),Ge(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(),i=this._selectedIndex();this.selectionChange.emit({selectedIndex:e,previouslySelectedIndex:i,selectedStep:t[e],previouslySelectedStep:t[i]}),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=xa(e),i=e.keyCode,r=this._keyManager;r?.activeItemIndex!=null&&!t&&(i===32||i===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 i=t.stepControl;return(i?i.invalid||i.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=vC();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=vt({type:n,selectors:[["","cdkStepper",""]],contentQueries:function(t,i,r){if(t&1&&Zi(r,Eb,5)(r,wP,5),t&2){let a;mt(a=pt())&&(i._steps=a),mt(a=pt())&&(i._stepHeader=a)}},inputs:{linear:[2,"linear","linear",yt],selectedIndex:[2,"selectedIndex","selectedIndex",Lo],selected:"selected",orientation:"orientation"},outputs:{selectionChange:"selectionChange",selectedIndexChange:"selectedIndexChange"},exportAs:["cdkStepper"]})}return n})(),Q8=(()=>{class n{_stepper=f(af);type="submit";constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["button","cdkStepperNext",""]],hostVars:1,hostBindings:function(t,i){t&1&&_("click",function(){return i._stepper.next()}),t&2&&Jo("type",i.type)},inputs:{type:"type"}})}return n})(),X8=(()=>{class n{_stepper=f(af);type="button";constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["button","cdkStepperPrevious",""]],hostVars:1,hostBindings:function(t,i){t&1&&_("click",function(){return i._stepper.previous()}),t&2&&Jo("type",i.type)},inputs:{type:"type"}})}return n})(),K8=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[_i]})}return n})();var ire=(n,o,e)=>({index:n,active:o,optional:e});function ore(n,o){if(n&1&&Fi(0,2),n&2){let e=v();C("ngTemplateOutlet",e.iconOverrides[e.state])("ngTemplateOutletContext",mC(2,ire,e.index,e.active,e.optional))}}function rre(n,o){if(n&1&&(s(0,"span",7),d(1),l()),n&2){let e=v(2);m(),B(e._getDefaultTextForState(e.state))}}function are(n,o){if(n&1&&(s(0,"span",8),d(1),l()),n&2){let e=v(3);m(),B(e._intl.completedLabel)}}function sre(n,o){if(n&1&&(s(0,"span",8),d(1),l()),n&2){let e=v(3);m(),B(e._intl.editableLabel)}}function lre(n,o){if(n&1&&(I(0,are,2,1,"span",8)(1,sre,2,1,"span",8),s(2,"mat-icon",7),d(3),l()),n&2){let e=v(2);A(e.state==="done"?0:e.state==="edit"?1:-1),m(3),B(e._getDefaultTextForState(e.state))}}function cre(n,o){if(n&1&&I(0,rre,2,1,"span",7)(1,lre,4,2),n&2){let e,t=v();A((e=t.state)==="number"?0:1)}}function dre(n,o){n&1&&(s(0,"div",4),Fi(1,9),l()),n&2&&(m(),C("ngTemplateOutlet",o.template))}function mre(n,o){if(n&1&&(s(0,"div",4),d(1),l()),n&2){let e=v();m(),B(e.label)}}function pre(n,o){if(n&1&&(s(0,"div",5),d(1),l()),n&2){let e=v();m(),B(e._intl.optionalLabel)}}function ure(n,o){if(n&1&&(s(0,"div",6),d(1),l()),n&2){let e=v();m(),B(e.errorMessage)}}var Y8=["*"];function hre(n,o){}function fre(n,o){if(n&1&&(an(0),Ce(1,hre,0,0,"ng-template",0)),n&2){let e=v();m(),C("cdkPortalOutlet",e._portal)}}var gre=["animatedContainer"],Z8=n=>({steps:n}),J8=n=>({step:n});function _re(n,o){n&1&&an(0)}function vre(n,o){if(n&1&&(s(0,"div",5),Fi(1,9)(2,6),l()),n&2){let e=v(2),t=ke(6);m(),C("ngTemplateOutlet",e.headerPrefix()),m(),C("ngTemplateOutlet",t)("ngTemplateOutletContext",un(3,Z8,e.steps))}}function Cre(n,o){if(n&1&&Fi(0,6),n&2){let e=v(2),t=ke(6);C("ngTemplateOutlet",t)("ngTemplateOutletContext",un(2,Z8,e.steps))}}function xre(n,o){if(n&1&&(s(0,"div",10,2),Fi(2,9),l()),n&2){let e=o.$implicit,t=o.$index,i=v(2);ar("mat-horizontal-stepper-content-"+i._getAnimationDirection(t)),C("id",i._getStepContentId(t)),Qt("aria-labelledby",i._getStepLabelId(t))("inert",i.selectedIndex===t?null:""),m(2),C("ngTemplateOutlet",e.content)}}function bre(n,o){if(n&1&&(s(0,"div",3),I(1,vre,3,5,"div",5)(2,Cre,1,4,"ng-container",6),s(3,"div",7),K(4,xre,3,6,"div",8,Oe),l()()),n&2){let e=v();m(),A(e.headerPrefix()?1:2),m(3),Y(e.steps)}}function yre(n,o){if(n&1&&Fi(0,9),n&2){let e=v(2);C("ngTemplateOutlet",e.headerPrefix())}}function Sre(n,o){if(n&1&&(s(0,"div",11),Fi(1,6),s(2,"div",12,2)(4,"div",13)(5,"div",14),Fi(6,9),l()()()()),n&2){let e=o.$implicit,t=o.$index,i=o.$index,r=o.$count,a=v(2),c=ke(4);m(),C("ngTemplateOutlet",c)("ngTemplateOutletContext",un(11,J8,e)),m(),Ae("mat-stepper-vertical-line",i!==r-1)("mat-vertical-content-container-active",a.selectedIndex===t),Qt("inert",a.selectedIndex===t?null:"")("aria-label",a.ariaLabel),m(2),C("id",a._getStepContentId(t)),Qt("aria-labelledby",a._getStepLabelId(t)),m(2),C("ngTemplateOutlet",e.content)}}function wre(n,o){if(n&1&&(s(0,"div",4),I(1,yre,1,1,"ng-container",9),K(2,Sre,7,13,"div",11,Oe),l()),n&2){let e=v();m(),A(e.headerPrefix()?1:-1),m(),Y(e.steps)}}function Mre(n,o){if(n&1){let e=z();s(0,"mat-step-header",15),_("click",function(){let i=k(e).step;return T(i.select())})("keydown",function(i){k(e);let r=v();return T(r._onKeydown(i))}),l()}if(n&2){let e=o.step,t=v();Ae("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 kre(n,o){n&1&&R(0,"div",17)}function Tre(n,o){if(n&1&&(Fi(0,6),I(1,kre,1,0,"div",17)),n&2){let e=o.$implicit,t=o.$index,i=o.$count;v(2);let r=ke(4);C("ngTemplateOutlet",r)("ngTemplateOutletContext",un(3,J8,e)),m(),A(t!==i-1?1:-1)}}function Ere(n,o){if(n&1&&(s(0,"div",16),K(1,Tre,2,5,null,null,Oe),l()),n&2){let e=o.steps,t=v();Qt("aria-label",t.ariaLabel),m(),Y(e)}}var z0=(()=>{class n extends MP{static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275dir=vt({type:n,selectors:[["","matStepLabel",""]],features:[di]})}return n})(),Dre=(()=>{class n{changes=new We;optionalLabel="Optional";completedLabel="Completed";editableLabel="Editable";static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),kP=(()=>{class n extends wP{_intl=f(Dre);_focusMonitor=f(Fa);_intlSubscription;state;label;errorMessage;iconOverrides;index;selected=!1;active=!1;optional=!1;disableRipple=!1;color;constructor(){super();let e=f(sr);e.load(la),e.load(IC);let t=f(X);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 z0?null:this.label}_templateLabel(){return this.label instanceof z0?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,i){t&2&&(ar("mat-"+(i.color||"primary")),Ae("mat-step-header-empty-label",i._hasEmptyLabel()))},inputs:{state:"state",label:"label",errorMessage:"errorMessage",iconOverrides:"iconOverrides",index:"index",selected:"selected",active:"active",optional:"optional",disableRipple:"disableRipple",color:"color"},features:[di],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,i){if(t&1&&(R(0,"div",0),s(1,"div")(2,"div",1),I(3,ore,1,6,"ng-container",2)(4,cre,2,1),l()(),s(5,"div",3),I(6,dre,2,1,"div",4)(7,mre,2,1,"div",4),I(8,pre,2,1,"div",5),I(9,ure,2,1,"div",6),l()),t&2){let r;C("matRippleTrigger",i._getHostElement())("matRippleDisabled",i.disableRipple),m(),ar(Hi("mat-step-icon-state-",i.state," mat-step-icon")),Ae("mat-step-icon-selected",i.selected),m(2),A(i.iconOverrides&&i.iconOverrides[i.state]?3:4),m(2),Ae("mat-step-label-active",i.active)("mat-step-label-selected",i.selected)("mat-step-label-error",i.state=="error"),m(),A((r=i._templateLabel())?6:i._stringLabel()?7:-1,r),m(2),A(i._hasOptionalLabel()?8:-1),m(),A(i._hasErrorLabel()?9:-1)}},dependencies:[Zs,Hg,de],styles:[`.mat-step-header {
|
||
overflow: hidden;
|
||
outline: none;
|
||
cursor: pointer;
|
||
position: relative;
|
||
box-sizing: content-box;
|
||
-webkit-tap-highlight-color: transparent;
|
||
}
|
||
.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})(),Pre=(()=>{class n{templateRef=f(Ro);name;constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["ng-template","matStepperIcon",""]],inputs:{name:[0,"matStepperIcon","name"]}})}return n})(),Ire=(()=>{class n{_template=f(Ro);constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["ng-template","matStepContent",""]]})}return n})(),Zl=(()=>{class n extends Eb{_errorStateMatcher=f(Cd,{skipSelf:!0});_viewContainerRef=f(ro);_isSelected=Mo.EMPTY;stepLabel=void 0;color;_lazyContent;_portal;ngAfterContentInit(){this._isSelected=this._stepper.steps.changes.pipe(Vn(()=>this._stepper.selectionChange.pipe(Bt(e=>e.selectedStep===this),gi(this._stepper.selected===this)))).subscribe(e=>{e&&this._lazyContent&&!this._portal&&(this._portal=new gd(this._lazyContent._template,this._viewContainerRef))})}ngOnDestroy(){this._isSelected.unsubscribe()}isErrorState(e,t){let i=this._errorStateMatcher.isErrorState(e,t),r=!!(e&&e.invalid&&this.interacted);return i||r}static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275cmp=F({type:n,selectors:[["mat-step"]],contentQueries:function(t,i,r){if(t&1&&Zi(r,z0,5)(r,Ire,5),t&2){let a;mt(a=pt())&&(i.stepLabel=a.first),mt(a=pt())&&(i._lazyContent=a.first)}},hostAttrs:["hidden",""],inputs:{color:"color"},exportAs:["matStep"],features:[fn([{provide:Cd,useExisting:n},{provide:Eb,useExisting:n}]),di],ngContentSelectors:Y8,decls:1,vars:0,consts:[[3,"cdkPortalOutlet"]],template:function(t,i){t&1&&(ai(),Ce(0,fre,2,1,"ng-template"))},dependencies:[Zu],encapsulation:2,changeDetection:0})}return n})(),Jl=(()=>{class n extends af{_ngZone=f(Ai);_renderer=f(Si);_animationsDisabled=er();_cleanupTransition;_isAnimating=Q(!1);_stepHeader=void 0;_animatedContainers;_steps=void 0;steps=new Hl;_icons;animationDone=new _e;disableRipple=!1;color;labelPosition="end";headerPosition="top";ariaLabel=null;headerPrefix=ae(null);_iconOverrides={};get animationDuration(){return this._animationDuration}set animationDuration(e){this._animationDuration=/^\d+$/.test(e)?e+"ms":e}_animationDuration="";_isServer=!f(Es).isBrowser;constructor(){super();let t=f(Jt).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(Ge(this._destroyed)).subscribe(()=>this._stateChanged()),this.selectedIndexChange.pipe(Ge(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(gi(null),Ge(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 i=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");(i||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,i,r){if(t&1&&Zi(r,Zl,5)(r,Pre,5),t&2){let a;mt(a=pt())&&(i._steps=a),mt(a=pt())&&(i._icons=a)}},viewQuery:function(t,i){if(t&1&&In(kP,5)(gre,5),t&2){let r;mt(r=pt())&&(i._stepHeader=r),mt(r=pt())&&(i._animatedContainers=r)}},hostVars:14,hostBindings:function(t,i){t&2&&(Yt("--mat-stepper-animation-duration",i._getAnimationDuration()),Ae("mat-stepper-horizontal",i.orientation==="horizontal")("mat-stepper-vertical",i.orientation==="vertical")("mat-stepper-label-position-end",i.orientation==="horizontal"&&i.labelPosition=="end")("mat-stepper-label-position-bottom",i.orientation==="horizontal"&&i.labelPosition=="bottom")("mat-stepper-header-position-bottom",i.headerPosition==="bottom")("mat-stepper-animating",i._isAnimating()))},inputs:{disableRipple:"disableRipple",color:"color",labelPosition:"labelPosition",headerPosition:"headerPosition",ariaLabel:[0,"aria-label","ariaLabel"],headerPrefix:[1,"headerPrefix"],animationDuration:"animationDuration"},outputs:{animationDone:"animationDone"},exportAs:["matStepper","matVerticalStepper","matHorizontalStepper"],features:[fn([{provide:af,useExisting:n}]),di],ngContentSelectors:Y8,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,i){if(t&1&&(ai(),I(0,_re,1,0),I(1,bre,6,1,"div",3)(2,wre,4,1,"div",4),Ce(3,Mre,1,27,"ng-template",null,0,Kd)(5,Ere,3,1,"ng-template",null,1,Kd)),t&2){let r;A(i._isServer?0:-1),m(),A((r=i.orientation)==="horizontal"?1:r==="vertical"?2:-1)}},dependencies:[Hg,kP],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})(),eL=(()=>{class n extends Q8{static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275dir=vt({type:n,selectors:[["button","matStepperNext",""]],hostAttrs:[1,"mat-stepper-next"],hostVars:1,hostBindings:function(t,i){t&2&&Jo("type",i.type)},features:[di]})}return n})(),tL=(()=>{class n extends X8{static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275dir=vt({type:n,selectors:[["button","matStepperPrevious",""]],hostAttrs:[1,"mat-stepper-previous"],hostVars:1,hostBindings:function(t,i){t&2&&Jo("type",i.type)},features:[di]})}return n})(),yl=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({providers:[Cd],imports:[Ju,K8,oe,_c,Jl,kP,_i]})}return n})();var $c=(()=>{class n{getConsoleTypes(){return["telnet","ssh","vnc","http","https","docker_exec","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=te({token:n,factory:n.\u0275fac})}return n})();var fs=(()=>{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/${ki.compute_id}/docker/images`)}pullImage(e,t,i){return this.httpController.post(e,`/computes/${i}/docker/images/pull`,{image:t})}addTemplate(e,t){let i=this.prepareTemplate(t);return this.httpController.post(e,"/templates",i)}saveTemplate(e,t){let i=this.prepareTemplate(t);return this.httpController.put(e,`/templates/${t.template_id}`,i)}prepareTemplate(e){return Ye(Z({},e),{custom_adapters:e.custom_adapters||[]})}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Are=(n,o)=>o.image;function Ore(n,o){if(n&1&&(s(0,"mat-option",22),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e.image)}}function Nre(n,o){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),_("selectionChange",function(i){k(e);let r=v();return T(r.selectedImage=i.value)}),K(4,Ore,2,2,"mat-option",22,Are),l()()}if(n&2){let e=v();m(3),C("value",e.selectedImage),m(),Y(e.dockerImages)}}function Fre(n,o){if(n&1){let e=z();s(0,"mat-form-field",13)(1,"mat-label"),d(2,"Image name"),l(),s(3,"input",31),_("input",function(i){k(e);let r=v();return T(r.filename.set(i.target.value))}),l()()}if(n&2){let e=v();m(3),C("value",e.filename())}}function Rre(n,o){if(n&1&&(s(0,"mat-option",22),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Lre(n,o){if(n&1&&(s(0,"mat-option",22),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}var Db=(()=>{class n{route=f(lt);controllerService=f(nt);dockerService=f(fs);toasterService=f(ie);router=f(_t);templateMocksService=f(Ma);configurationService=f($c);computeService=f(Eo);cd=f(X);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:i=>{this.dockerTemplate=i,this.cd.markForCheck()},error:i=>{let r=i.error?.message||i.message||"Failed to load template";this.toasterService.error(r),this.cd.markForCheck()}}),this.dockerService.getImages(t).subscribe({next:i=>{this.dockerImages=i,this.cd.markForCheck()},error:i=>{let r=i.error?.message||i.message||"Failed to load docker images";this.toasterService.error(r),this.cd.markForCheck()}})},t=>{let i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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=Li(),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","","rows","1","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","12","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,i){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),_("click",function(){return i.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),_("click",function(){return i.setDiskImage("existingImage")}),d(17," Existing image "),l(),s(18,"mat-radio-button",12),_("click",function(){return i.setDiskImage("newImage")}),d(19," New image "),l()(),I(20,Nre,6,1,"mat-form-field",13),I(21,Fre,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),_("input",function(a){return i.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),_("input",function(a){return i.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),_("input",function(a){return i.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),_("selectionChange",function(a){return i.consoleType.set(a.value)}),K(48,Rre,2,2,"mat-option",22,Oe),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),_("selectionChange",function(a){return i.auxConsoleType.set(a.value)}),K(56,Lre,2,2,"mat-option",22,Oe),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),_("input",function(a){return i.environment.set(a.target.value)}),l()()()()()(),s(64,"div",27)(65,"button",28),_("click",function(){return i.goBack()}),d(66,"Cancel"),l(),s(67,"button",29),_("click",function(){return i.addTemplate()}),d(68," Add template "),l()()()()),t&2&&(m(6),C("linear",!0),m(),C("completed",i.isLocalComputerChosen),m(3),C("checked",!0),m(2),C("completed",i.selectedImage||i.filename()),m(4),C("checked",!i.newImageSelected),m(4),A(i.newImageSelected?-1:20),m(),A(i.newImageSelected?21:-1),m(),C("completed",i.templateName()),m(6),C("value",i.templateName()),m(),C("completed",i.adapters()),m(6),C("value",i.adapters()),m(),C("completed",i.startCommand()),m(5),C("value",i.startCommand()),m(),C("completed",i.consoleType()),m(5),C("value",i.consoleType()),m(),Y(i.consoleTypes),m(2),C("completed",i.auxConsoleType()),m(5),C("value",i.auxConsoleType()),m(),Y(i.auxConsoleTypes),m(7),C("value",i.environment()))},dependencies:[ne,Je,dt,oe,G,pe,kt,oo,yo,fo,we,Me,Xe,Se,Te,Bc,gt,Pt,ft,yl,Zl,Jl,Lt],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 Vre(n,o){if(n&1){let e=z();s(0,"button",12),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var Pb=(()=>{class n{route=f(lt);controllerService=f(nt);dockerService=f(fs);toasterService=f(ie);router=f(_t);formBuilder=f(Bn);cd=f(X);controller;templateName="";dockerTemplate;templateNameForm;constructor(){this.templateNameForm=this.formBuilder.group({templateName:new $e("",je.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(i=>{this.controller=i,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()}})},i=>{let r=i.error?.message||i.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=Li(),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,i){t&1&&(s(0,"div",0)(1,"header",1),I(2,Vre,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),_("click",function(){return i.goBack()}),d(14,"Cancel"),l(),s(15,"button",11),_("click",function(){return i.addTemplate()}),d(16," Copy template "),l()()()()),t&2&&(m(2),A(i.controller?2:-1),m(5),C("formGroup",i.templateNameForm))},dependencies:[ne,Je,rt,Nt,Dt,ot,Et,Ft,Vt,dt,oe,de,G,pe,ze,kt,we,Me,Xe,Se,Te],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,i){return this.httpController.get(e,`/projects/${t}/nodes/${i}`)}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,i,r,a,c){return c?this.httpController.post(e,`/projects/${t.project_id}/templates/${i.template_id}`,{x:Math.round(r),y:Math.round(a),compute_id:c}):this.httpController.post(e,`/projects/${t.project_id}/templates/${i.template_id}`,{x:Math.round(r),y:Math.round(a),compute_id:"local"})}updatePosition(e,t,i,r,a){let c=Math.round(r),p=Math.round(a);return t.snap_to_grid&&(c=Math.round((c+i.width/2)/t.grid_size)*t.grid_size,p=Math.round((p+i.height/2)/t.grid_size)*t.grid_size,c=Math.round(c-i.width/2),p=Math.round(p-i.height/2)),this.httpController.put(e,`/projects/${i.project_id}/nodes/${i.node_id}`,{x:c,y:p})}updateLabel(e,t,i){return this.httpController.put(e,`/projects/${t.project_id}/nodes/${t.node_id}`,{label:{rotation:i.rotation,style:i.style,text:i.text,x:Math.round(i.x),y:Math.round(i.y)}})}updateSymbol(e,t,i){return this.httpController.put(e,`/projects/${t.project_id}/nodes/${t.node_id}`,{symbol:i})}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 i=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:i,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,i,r,a){return this.httpController.post(e,`/projects/${t}/nodes/${i}/files/${encodeURIComponent(r)}`,a)}uploadNodeFileWithProgress(e,t,i,r,a){let p=`${e.protocol||location.protocol}//${e.host}:${e.port}/${ki.current_version}/projects/${t}/nodes/${i}/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(Bt(h=>h.type===Xu.UploadProgress?Math.round(100*h.loaded/(h.total||1)):h.type===Xu.Response?100:0),uo(h=>{let g=h.error?.message||h.message||"Failed to upload file";return $o(()=>new Error(g))}))}getNodeFiles(e,t,i,r){let a=`/projects/${t}/nodes/${i}/files`,c=r?`?path=${encodeURIComponent(r)}`:"";return this.httpController.get(e,`${a}${c}`)}getNodeFilesRecursive(e,t,i){return this.httpController.get(e,`/projects/${t}/nodes/${i}/files?recursive=true`)}deleteNodeFile(e,t,i,r){return this.httpController.delete(e,`/projects/${t}/nodes/${i}/files/${encodeURIComponent(r)}`)}getNodeFileContent(e,t,i,r){return this.httpController.get(e,`/projects/${t}/nodes/${i}/files/${encodeURIComponent(r)}`,{responseType:"text"})}saveNodeFileContent(e,t,i,r,a){return this.httpController.post(e,`/projects/${t}/nodes/${i}/files/${encodeURIComponent(r)}`,a)}downloadNodeFile(e,t,i,r){return this.httpController.getBlob(e,`/projects/${t}/nodes/${i}/files/${encodeURIComponent(r)}`)}async streamNodeFileToFile(e,t,i,r,a,c){let u=`${e.protocol||location.protocol}//${e.host}:${e.port}/${ki.current_version}/projects/${t}/nodes/${i}/files/${encodeURIComponent(r)}`,h={};e.authToken&&!e.tokenExpired&&(h.Authorization=`Bearer ${e.authToken}`);let g=await fetch(u,{headers:h});if(!g.ok)throw new Error(`Download failed: ${g.status}`);let y=g.body.getReader(),b=await a.createWritable(),x=0;try{for(;;){let{done:M,value:w}=await y.read();if(M)break;await b.write(w),x+=w.length,c?.(x)}}finally{await b.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,i){return this.httpController.post(e,`/projects/${t.project_id}/nodes/${t.node_id}/files/etc/network/interfaces`,i)}getStartupConfiguration(e,t){let i=`/projects/${t.project_id}/nodes/${t.node_id}`;return t.node_type==="vpcs"?i+="/files/startup.vpc":t.node_type==="iou"?i+="/files/startup-config.cfg":t.node_type==="dynamips"&&(i+=`/files/configs/i${t.properties.dynamips_id}_startup-config.cfg`),this.httpController.get(e,i,{responseType:"text"})}getPrivateConfiguration(e,t){let i=`/projects/${t.project_id}/nodes/${t.node_id}`;return t.node_type==="iou"?i+="/files/private-config.cfg":t.node_type==="dynamips"&&(i+=`/files/configs/i${t.properties.dynamips_id}_private-config.cfg`),this.httpController.get(e,i,{responseType:"text"})}saveConfiguration(e,t,i){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,i)}savePrivateConfiguration(e,t,i){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,i)}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(Ks))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Bre=(n,o)=>o.adapter_number;function zre(n,o){n&1&&(s(0,"mat-error"),d(1,"Invalid MAC address format"),l())}function jre(n,o){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),_("input",function(i){let r=k(e).$implicit,a=v();return T(a.onPortNameChange(r.adapter_number,i.target.value))}),l()(),s(5,"mat-form-field",15)(6,"input",17),_("input",function(i){let r=k(e).$implicit,a=v();return T(a.onMacAddressChange(r.adapter_number,i.target.value))}),l(),I(7,zre,2,0,"mat-error"),l(),s(8,"button",18),_("click",function(){let i=k(e).$implicit,r=v();return T(r.removeAdapter(i.adapter_number))}),s(9,"mat-icon"),d(10,"delete"),l()()()}if(n&2){let e=o.$implicit,t=o.$index,i=v();m(2),ee("Adapter ",e.adapter_number),m(2),C("name",Hi("port_name_",t))("placeholder",Hi("eth",e.adapter_number))("value",e.port_name),m(2),C("name",Hi("mac_address_",t))("value",e.mac_address),m(),A(e.mac_address&&!i.isMacAddressValid(e.mac_address)?7:-1)}}var sf=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(ie);dockerConfigurationService=f($c);validationService=f(Wi);cdr=f(X);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=>Ye(Z({},t),{port_name:t.port_name||"",mac_address:t.mac_address||""}))):this.node.ports.forEach((t,i)=>{e.push({adapter_number:i,port_name:t?.name||"",mac_address:""})}),this.adapters.set(e)):e.length>0&&this.adapters.update(t=>t.map(i=>Ye(Z({},i),{port_name:i.port_name||"",mac_address:i.mac_address||""})))}onMacAddressChange(e,t){this.adapters.update(i=>i.map(r=>r.adapter_number===e?Ye(Z({},r),{mac_address:t}):r)),this.cdr.markForCheck()}onPortNameChange(e,t){this.adapters.update(i=>i.map(r=>r.adapter_number===e?Ye(Z({},r),{port_name:t}):r)),this.cdr.markForCheck()}addAdapter(){let e=this.adapters().reduce((t,i)=>Math.max(t,i.adapter_number),-1);this.adapters.update(t=>[...t,{adapter_number:e+1,port_name:"",mac_address:""}])}removeAdapter(e){this.adapters.update(t=>t.filter(i=>i.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=>Ye(Z({},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"],["appearance","fill","subscriptSizing","dynamic",1,"adapter-field"],["matInput","",3,"input","value","name","placeholder"],["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,i){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(),K(12,jre,11,10,"div",7,Bre),l(),s(14,"div",8)(15,"button",9),_("click",function(){return i.addAdapter()}),s(16,"mat-icon"),d(17,"add"),l(),d(18," Add adapter "),l(),s(19,"div",10),d(20," Port names label each adapter in the topology (the in-container interface stays eth0, eth1\u2026). Deleting an adapter reduces the total number of adapters. "),l()()(),s(21,"div",11)(22,"button",12),_("click",function(){return i.onCancelClick()}),d(23,"Cancel"),l(),s(24,"button",13),_("click",function(){return i.onSaveClick()}),d(25,"Apply"),l()()),t&2&&(m(),ee("Configure custom adapters",i.node?" for node "+i.node.name:""),m(11),Y(i.adapters()))},dependencies:[ne,ve,Le,Ve,St,G,pe,ze,oe,de,ht,Mt,Se,Te,Me,ni,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%]{font-size:16px;font-weight:500;color:var(--mat-sys-on-surface);text-align:center}.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 $re(n,o){if(n&1){let e=z();s(0,"button",6),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function Hre(n,o){if(n&1&&(s(0,"mat-option",25),d(1),l()),n&2){let e=o.$implicit;C("value",e[1]),m(),B(e[0])}}function Ure(n,o){if(n&1){let e=z();s(0,"mat-chip",43),_("removed",function(){let i=k(e).$implicit,r=v(3);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",44),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function Wre(n,o){if(n&1&&(s(0,"mat-option",25),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Gre(n,o){if(n&1&&(s(0,"mat-option",25),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function qre(n,o){if(n&1&&(s(0,"mat-option",25),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Qre(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.name.set(i.target.value))}),l()(),s(6,"mat-form-field",17)(7,"mat-label"),d(8,"Default name format"),l(),s(9,"input",19),_("input",function(i){k(e);let r=v(2);return T(r.defaultNameFormat.set(i.target.value))}),l()()(),s(10,"div",20)(11,"mat-form-field",17)(12,"mat-label"),d(13,"Image"),l(),s(14,"input",21),_("input",function(i){k(e);let r=v(2);return T(r.image.set(i.target.value))}),l()(),s(15,"button",22),_("click",function(){k(e);let i=v(2);return T(i.pullImage())}),s(16,"mat-icon"),d(17,"cloud_download"),l(),d(18),l()(),s(19,"div",23)(20,"mat-form-field",17)(21,"mat-label"),d(22,"Category"),l(),s(23,"mat-select",24),_("selectionChange",function(i){k(e);let r=v(2);return T(r.category.set(i.value))}),K(24,Hre,2,2,"mat-option",25,Ni),l()(),s(26,"mat-form-field",26)(27,"mat-label"),d(28,"Symbol"),l(),s(29,"input",27),_("input",function(i){k(e);let r=v(2);return T(r.symbol.set(i.target.value))}),l()(),s(30,"button",28),_("click",function(){k(e);let i=v(2);return T(i.chooseSymbol())}),d(31,"Choose symbol"),l()(),s(32,"mat-form-field",17)(33,"mat-label"),d(34,"Tags"),l(),s(35,"mat-chip-grid",null,0),K(37,Ure,4,1,"mat-chip",null,Oe),l(),s(39,"input",29),_("matChipInputTokenEnd",function(i){k(e);let r=v(2);return T(r.addTag(i))}),l()(),s(40,"div",16)(41,"mat-form-field",17)(42,"mat-label"),d(43,"Adapters"),l(),s(44,"input",30),_("input",function(i){k(e);let r=v(2);return T(r.adaptersCount.set(+i.target.value))}),l()(),s(45,"mat-form-field",17)(46,"mat-label"),d(47,"Base MAC"),l(),s(48,"input",31),_("input",function(i){k(e);let r=v(2);return T(r.macAddress.set(i.target.value))}),l()(),s(49,"mat-form-field",17)(50,"mat-label"),d(51,"Maximum memory"),l(),s(52,"input",32),_("input",function(i){k(e);let r=v(2);return T(r.memory.set(i.target.value))}),l(),s(53,"span",33),d(54,"MB"),l()(),s(55,"mat-form-field",17)(56,"mat-label"),d(57,"Maximum CPUs"),l(),s(58,"input",34),_("input",function(i){k(e);let r=v(2);return T(r.cpus.set(i.target.value))}),l()(),s(59,"mat-form-field",17)(60,"mat-label"),d(61,"Console type"),l(),s(62,"mat-select",35),_("selectionChange",function(i){k(e);let r=v(2);return T(r.consoleType.set(i.value))}),K(63,Wre,2,2,"mat-option",25,Oe),l()(),s(65,"mat-form-field",17)(66,"mat-label"),d(67,"Auxiliary console type"),l(),s(68,"mat-select",36),_("selectionChange",function(i){k(e);let r=v(2);return T(r.auxConsoleType.set(i.value))}),K(69,Gre,2,2,"mat-option",25,Oe),l()(),s(71,"mat-form-field",17)(72,"mat-label"),d(73,"VNC console resolution"),l(),s(74,"mat-select",37),_("selectionChange",function(i){k(e);let r=v(2);return T(r.consoleResolution.set(i.value))}),K(75,qre,2,2,"mat-option",25,Oe),l()(),s(77,"mat-form-field",17)(78,"mat-label"),d(79,"HTTP port in the container"),l(),s(80,"input",38),_("input",function(i){k(e);let r=v(2);return T(r.consoleHttpPort.set(i.target.value))}),l()(),s(81,"mat-form-field",39)(82,"mat-label"),d(83,"HTTP path"),l(),s(84,"input",40),_("input",function(i){k(e);let r=v(2);return T(r.consoleHttpPath.set(i.target.value))}),l()(),s(85,"mat-checkbox",41),_("change",function(i){k(e);let r=v(2);return T(r.consoleAutoStart.set(i.checked))}),d(86," Auto start console "),l()(),s(87,"button",42),_("click",function(){k(e);let i=v(2);return T(i.editCustomAdapters())}),d(88," Edit network configuration "),l()()}if(n&2){let e=ke(36),t=v(2);m(5),C("value",t.name()),m(4),C("value",t.defaultNameFormat()),m(5),C("value",t.image()),m(),C("disabled",t.isPulling()||!t.image().trim()),m(3),ee(" ",t.isPulling()?"Pulling\u2026":"Pull image"," "),m(5),C("value",t.category()),m(),Y(t.categories),m(5),C("value",t.symbol()),m(8),Y(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(),Y(t.consoleTypes),m(5),C("value",t.auxConsoleType()),m(),Y(t.auxConsoleTypes),m(5),C("value",t.consoleResolution()),m(),Y(t.consoleResolutions),m(5),C("value",t.consoleHttpPort()),m(4),C("value",t.consoleHttpPath()),m(),C("checked",t.consoleAutoStart())}}function Xre(n,o){if(n&1){let e=z();s(0,"div",11)(1,"h6",45),d(2,"Start command"),l(),s(3,"mat-form-field",17)(4,"mat-label"),d(5,"Start command"),l(),s(6,"textarea",46),_("input",function(i){k(e);let r=v(2);return T(r.startCommand.set(i.target.value))}),l()(),s(7,"h6",45),d(8,"Environment"),l(),s(9,"mat-form-field",17)(10,"mat-label"),d(11,"Environment"),l(),s(12,"textarea",47),_("input",function(i){k(e);let r=v(2);return T(r.environment.set(i.target.value))}),l()(),s(13,"h6",45),d(14,"Extra volumes"),l(),s(15,"mat-form-field",17)(16,"mat-label"),d(17,"Extra volumes"),l(),s(18,"textarea",48),_("input",function(i){k(e);let r=v(2);return T(r.extraVolumes.set(i.target.value))}),l()(),s(19,"h6",45),d(20,"Extra hosts"),l(),s(21,"mat-form-field",17)(22,"mat-label"),d(23,"Extra hosts"),l(),s(24,"textarea",49),_("input",function(i){k(e);let r=v(2);return T(r.extraHosts.set(i.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 Kre(n,o){if(n&1){let e=z();s(0,"mat-form-field",17)(1,"mat-label"),d(2,"Container target path"),l(),s(3,"input",51),_("input",function(i){let r=k(e).$index,a=v(3);return T(a.updateExtraConfigTarget(r,i.target.value))}),l(),s(4,"button",52),_("click",function(){let i=k(e).$index,r=v(3);return T(r.removeExtraConfig(i))}),s(5,"mat-icon"),d(6,"delete"),l()()(),s(7,"mat-form-field",17)(8,"mat-label"),d(9,"File content"),l(),s(10,"textarea",53),_("input",function(i){let r=k(e).$index,a=v(3);return T(a.updateExtraConfigContent(r,i.target.value))}),l()()}if(n&2){let e=o.$implicit;m(3),C("value",e.target),m(7),C("value",e.content||"")}}function Yre(n,o){if(n&1){let e=z();s(0,"div",11)(1,"h6",45),d(2,"Configuration files"),l(),K(3,Kre,11,2,null,null,Ni),s(5,"button",50),_("click",function(){k(e);let i=v(2);return T(i.addExtraConfig())}),s(6,"mat-icon"),d(7,"add"),l(),d(8," Add configuration file "),l()()}if(n&2){let e=v(2);m(3),Y(e.extraConfigs())}}function Zre(n,o){if(n&1){let e=z();s(0,"div",12)(1,"mat-form-field",54)(2,"mat-label"),d(3,"Usage"),l(),s(4,"textarea",55),_("input",function(i){k(e);let r=v(2);return T(r.usage.set(i.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.usage())}}function Jre(n,o){if(n&1){let e=z();s(0,"main",5)(1,"section",7)(2,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("general"))}),s(3,"h3",9),d(4,"General settings"),l(),s(5,"mat-icon",10),d(6),l()(),I(7,Qre,89,19,"form",11),l(),s(8,"section",7)(9,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("advanced"))}),s(10,"h3",9),d(11,"Advanced"),l(),s(12,"mat-icon",10),d(13),l()(),I(14,Xre,25,4,"div",11),l(),s(15,"section",7)(16,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("extraFiles"))}),s(17,"h3",9),d(18,"Extra files"),l(),s(19,"mat-icon",10),d(20),l()(),I(21,Yre,9,0,"div",11),l(),s(22,"section",7)(23,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("usage"))}),s(24,"h3",9),d(25,"Usage"),l(),s(26,"mat-icon",10),d(27),l()(),I(28,Zre,5,1,"div",12),l(),s(29,"div",13)(30,"button",14),_("click",function(){k(e);let i=v();return T(i.goBack())}),d(31,"Cancel"),l(),s(32,"button",15),_("click",function(){k(e);let i=v();return T(i.onSave())}),d(33,"Save"),l()()()}if(n&2){let e=v();m(6),B(e.generalSettingsExpanded?"expand_less":"expand_more"),m(),A(e.generalSettingsExpanded?7:-1),m(6),B(e.advancedExpanded?"expand_less":"expand_more"),m(),A(e.advancedExpanded?14:-1),m(6),B(e.extraFilesExpanded?"expand_less":"expand_more"),m(),A(e.extraFilesExpanded?21:-1),m(6),B(e.usageExpanded?"expand_less":"expand_more"),m(),A(e.usageExpanded?28:-1)}}var Ib=(()=>{class n{route=f(lt);controllerService=f(nt);dockerService=f(fs);toasterService=f(ie);validationService=f(L0);configurationService=f($c);router=f(_t);cd=f(X);dialog=f(it);dialogConfig=f(go);controller;dockerTemplate;separatorKeysCodes=[13,188];generalSettingsExpanded=!1;advancedExpanded=!1;extraFilesExpanded=!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("");extraConfigs=Q([]);usage=U("");isPulling=Q(!1);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(i=>{this.controller=i,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.extraConfigs.set((r.extra_configs||[]).map(a=>({target:a.target||"",content:a.content??""}))),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()}})},i=>{let r=i.error?.message||i.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"extraFiles":this.extraFilesExpanded=!this.extraFilesExpanded;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 i=this.validationService.validateAdapters(this.adaptersCount().toString(),100);if(!i.isValid){this.toasterService.error(i.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 g=this.validationService.validateConsoleHttpPort(this.consoleHttpPort().toString());if(!g.isValid){this.toasterService.error(g.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}let u=this.validationService.validateExtraConfigs(this.extraConfigs());if(!u.isValid){this.toasterService.error(u.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(g=>g.trim()):[];let h=this.extraConfigs().filter(g=>(g.target||"").trim()).map(g=>({target:g.target.trim(),content:g.content??""}));this.dockerTemplate.extra_configs=h,this.extraConfigs.set(h),this.dockerTemplate.usage=this.usage(),this.dockerService.saveTemplate(this.controller,this.dockerTemplate).subscribe({next:g=>{this.toasterService.success("Changes saved")},error:g=>{let y=g.error?.message||g.message||"Failed to save template";this.toasterService.error(y),this.cd.markForCheck()}})}pullImage(){let e=this.image().trim();!e||this.isPulling()||(this.isPulling.set(!0),this.dockerService.pullImage(this.controller,e,this.dockerTemplate.compute_id).pipe($O(()=>{this.isPulling.set(!1),this.cd.markForCheck()})).subscribe({next:()=>{this.toasterService.success(`Docker image '${e}' updated`)},error:t=>{let i=t.error?.message||t.message||`Failed to pull Docker image '${e}'`;this.toasterService.error(i)}}))}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(sf,Ye(Z({},t),{data:{}})).componentInstance;r.adapters.set(e),r.saveHandler=a=>{this.dockerTemplate.custom_adapters=a.map(c=>Ye(Z({},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(Jr,e).afterClosed().subscribe(i=>{i&&this.symbol.set(i)})}addExtraConfig(){this.extraConfigs.update(e=>[...e,{target:"",content:""}])}removeExtraConfig(e){this.extraConfigs.update(t=>t.filter((i,r)=>r!==e))}updateExtraConfigTarget(e,t){this.extraConfigs.update(i=>i.map((r,a)=>a===e?Ye(Z({},r),{target:t}):r))}updateExtraConfigContent(e,t){this.extraConfigs.update(i=>i.map((r,a)=>a===e?Ye(Z({},r),{content:t}):r))}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"],[1,"docker-details__image-row"],["matInput","","type","text","placeholder","Docker image name",3,"input","value"],["mat-stroked-button","","type","button",1,"docker-details__pull-btn",3,"click","disabled"],[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","","rows","1","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","12","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","","rows","1","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","12","type","text","placeholder","Environment variables (one per line, KEY=VALUE format). Supports: %vm-name%, %vm-id%, %project-id%, %project-path%",3,"input","value"],["matInput","","rows","1","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","12","type","text","placeholder",`Container directories to persist, one per line (e.g., /data
|
||
/config)`,3,"input","value"],["matInput","","rows","1","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","12","type","text","placeholder","Hostname to IP mappings, one per line (e.g., gns3.com:192.168.100.10)",3,"input","value"],["mat-stroked-button","","type","button",1,"form-field",3,"click"],["matInput","","type","text","placeholder","/first_boot.cfg",3,"input","value"],["matSuffix","","mat-icon-button","","type","button","aria-label","Remove configuration file",3,"click"],["matInput","","rows","1","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","12","placeholder","File contents injected (read-only) into the container at the target path",3,"input","value"],[1,"preferences__usage-field--full"],["matInput","","rows","1","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","12","type","text",3,"input","value"]],template:function(t,i){t&1&&(s(0,"div",1)(1,"header",2),I(2,$re,3,0,"button",3),s(3,"h1",4),d(4,"Docker container template configuration"),l()(),I(5,Jre,34,8,"main",5),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.dockerTemplate?5:-1))},dependencies:[ne,Je,rt,ot,Gn,dt,oe,de,G,pe,ze,we,Me,Xe,Ti,Se,Te,Bc,gt,Pt,ft,oi,ei,Ci,xi,hi,Lt,qt],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__image-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px}.docker-details__image-row[_ngcontent-%COMP%] .form-field[_ngcontent-%COMP%]{flex:1}.docker-details__pull-btn[_ngcontent-%COMP%]{height:48px;margin-top:4px;white-space:nowrap}.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%], .docker-details__image-row[_ngcontent-%COMP%]{flex-direction:column}.docker-details__pull-btn[_ngcontent-%COMP%], .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 eae=(n,o)=>o.template_id;function tae(n,o){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 nae(n,o){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 iae(n,o){n&1&&R(0,"app-empty-templates-list")}function oae(n,o){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),_("click",function(i){return i.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),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.copyTemplate(i))}),s(16,"mat-icon"),d(17,"content_copy"),l(),s(18,"span"),d(19,"Copy"),l()(),s(20,"button",16),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.deleteTemplate(i))}),s(21,"mat-icon"),d(22,"delete"),l(),s(23,"span"),d(24,"Delete"),l()()()()}if(n&2){let e=o.$implicit,t=ke(9);C("routerLink",e.template_id),m(4),B(e.name),m(),C("matMenuTriggerFor",t),m(5),C("routerLink",e.template_id)}}function rae(n,o){if(n&1&&(s(0,"nav",8),K(1,oae,25,4,"div",10,eae),l()),n&2){let e=v();m(),Y(e.dockerTemplates)}}var $0=(()=>{class n{route=f(lt);controllerService=f(nt);dockerService=f(fs);toasterService=f(ie);router=f(_t);cd=f(X);controller;dockerTemplates=[];deleteComponent=Rt(Vi);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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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,i){t&1&&Xt(i.deleteComponent,Vi,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,i){t&1&&(s(0,"div",2)(1,"header",3),I(2,tae,3,1,"button",4),s(3,"h1",5),d(4,"Docker container templates"),l(),I(5,nae,3,1,"button",6),l(),s(6,"main",7),I(7,iae,1,0,"app-empty-templates-list"),I(8,rae,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),_("deleteEvent",function(){return i.onDeleteEvent()}),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.controller?5:-1),m(2),A(i.dockerTemplates.length?-1:7),m(),A(i.dockerTemplates.length?8:-1),m(),C("controller",i.controller))},dependencies:[ne,dt,vn,G,ze,oe,de,eo,qe,Kn,tt,Fn,ht,Mt,Vi,ta],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 Sl=(()=>{class n{countSource=new We;currentCount=this.countSource.asObservable();cancelItem=new We;currentCancelItemDetails=this.cancelItem.asObservable();messageSource=new tn("");currentMessage=this.messageSource.asObservable();computingSource=new tn(!1);currentComputing=this.computingSource.asObservable();constructor(){}processBarCount(e){this.countSource.next(e)}cancelFileUploading(e){this.cancelItem.next(e)}setMessage(e){this.messageSource.next(e)}setComputing(e){this.computingSource.next(e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function aae(n,o){n&1&&ks(0,"div",2)}var sae=new cn("MAT_PROGRESS_BAR_DEFAULT_OPTIONS");var Hc=(()=>{class n{_elementRef=f(Jt);_ngZone=f(Ai);_changeDetectorRef=f(X);_renderer=f(Si);_cleanupTransitionEnd;constructor(){let e=F4(),t=f(sae,{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=iL(e||0),this._changeDetectorRef.markForCheck()}_value=0;get bufferValue(){return this._bufferValue||0}set bufferValue(e){this._bufferValue=iL(e||0),this._changeDetectorRef.markForCheck()}_bufferValue=0;animationEnd=new _e;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,i){t&2&&(Qt("aria-valuenow",i._isIndeterminate()?null:i.value)("mode",i.mode),ar("mat-"+i.color),Ae("_mat-animation-noopable",i._isNoopAnimation)("mdc-linear-progress--animation-ready",!i._isNoopAnimation)("mdc-linear-progress--indeterminate",i._isIndeterminate()))},inputs:{color:"color",value:[2,"value","value",Lo],bufferValue:[2,"bufferValue","bufferValue",Lo],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,i){t&1&&(Co(0,"div",0),ks(1,"div",1),I(2,aae,1,0,"div",2),ko(),Co(3,"div",3),ks(4,"span",4),ko(),Co(5,"div",5),ks(6,"span",4),ko()),t&2&&(m(),Yt("flex-basis",i._getBufferBarFlexBasis()),m(),A(i.mode==="buffer"?2:-1),m(),Yt("transform",i._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 transparent;
|
||
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 iL(n,o=0,e=100){return Math.max(o,Math.min(e,n))}var gs=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[_i]})}return n})();var wl=(()=>{class n{data;_snackRef=f(t5);_US=f(Sl);uploadProgress=Q(0);label=Q("");isComputing=Q(!1);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()==null||this.uploadProgress()===100&&!this.isComputing())&&this.dismiss()}),this.subscription.add(this._US.currentMessage.subscribe(e=>this.label.set(e))),this.subscription.add(this._US.currentComputing.subscribe(e=>this.isComputing.set(e)))}dismiss(){this._snackRef.dismiss()}cancelItem(){this._US.cancelFileUploading(!0)}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(t){return new(t||n)(at(n5))};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,i){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),_("click",function(){return i.cancelItem()}),d(7,"Cancel"),l()()()),t&2&&(m(),mi("",i.label()?i.label():i.upload_file_type+" Uploading please wait"," .... ",i.uploadProgress(),"%"),m(3),C("value",i.uploadProgress()))},dependencies:[G,pe,gs,Hc],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 Rm=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 Lm=(()=>{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=te({token:n,factory:n.\u0275fac})}return n})();var _s=(()=>{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}/${ki.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/${ki.compute_id}/dynamips/auto_idlepc`,t)}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var lae=()=>[0,1,2,3,4,5,6],cae=()=>[0,1,2],dae=(n,o)=>o.filename;function mae(n,o){if(n&1){let e=z();s(0,"button",6),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function pae(n,o){if(n&1&&(s(0,"mat-option",20),d(1),l()),n&2){let e=o.$implicit;C("value",e.filename),m(),ee(" ",e.filename," ")}}function uae(n,o){if(n&1&&(s(0,"mat-option",20),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function hae(n,o){if(n&1&&(s(0,"mat-option",20),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function fae(n,o){if(n&1){let e=z();s(0,"mat-form-field",18)(1,"mat-label"),d(2,"Chassis"),l(),s(3,"mat-select",39),_("selectionChange",function(i){k(e);let r=v(2);return r.chassis.set(i.value),T(r.onChassisChosen())}),K(4,hae,2,2,"mat-option",20,Oe),l()()}if(n&2){let e=v(2);m(3),C("value",e.chassis()),m(),Y(e.chassisOptions()[e.platform()])}}function gae(n,o){if(n&1){let e=z();s(0,"mat-checkbox",40),_("change",function(i){k(e);let r=v(2);return T(r.isEtherSwitchRouter.set(i.checked))}),d(1," This is an EtherSwitch router "),l()}if(n&2){let e=v(2);C("checked",e.isEtherSwitchRouter())}}function _ae(n,o){n&1&&R(0,"mat-option",20)}function vae(n,o){if(n&1&&(s(0,"mat-option",20),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function Cae(n,o){if(n&1){let e=z();s(0,"mat-form-field",18)(1,"mat-label"),d(2),l(),s(3,"mat-select",41),_("selectionChange",function(i){k(e);let r=v().$implicit,a=v(3);return T(a.onAdapterChange(r,i.value))}),I(4,_ae,1,0,"mat-option",20),K(5,vae,2,2,"mat-option",20,Oe),l()()}if(n&2){let e=v().$implicit,t=v(3);m(2),ee("Slot ",e),m(),C("placeholder",Hi("Slot ",e))("value",t.networkAdaptersForTemplate()[e]||""),m(),A(t.adapterMatrix()[t.platform()][t.chassis()||""][e].length>1&&!t.adapterMatrix()[t.platform()][t.chassis()||""][e][0].startsWith("C7200")?4:-1),m(),Y(t.adapterMatrix()[t.platform()][t.chassis()||""][e])}}function xae(n,o){if(n&1&&I(0,Cae,7,5,"mat-form-field",18),n&2){let e=o.$implicit,t=v(3);A(t.adapterMatrix()[t.platform()][t.chassis()||""][e]?0:-1)}}function bae(n,o){n&1&&(s(0,"div",31),K(1,xae,1,1,null,null,Oe),l()),n&2&&(m(),Y(Tt(0,lae)))}function yae(n,o){if(n&1&&(s(0,"mat-option",20),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function Sae(n,o){if(n&1){let e=z();s(0,"mat-form-field",18)(1,"mat-label"),d(2),l(),s(3,"mat-select",41),_("selectionChange",function(i){k(e);let r=v().$implicit,a=v(3);return T(a.onWicChange(r,i.value))}),s(4,"mat-option",20),d(5),l(),K(6,yae,2,2,"mat-option",20,Oe),l()()}if(n&2){let e=v().$implicit,t=v(3);m(2),ee("WIC ",e),m(),C("placeholder",Hi("WIC ",e))("value",t.wicsForTemplate()[e]||""),m(2),ee(" ",""," "),m(),Y(t.wicMatrix()[t.platform()][e])}}function wae(n,o){if(n&1&&I(0,Sae,8,5,"mat-form-field",18),n&2){let e=o.$implicit,t=v(3);A(t.wicMatrix()[t.platform()]&&t.wicMatrix()[t.platform()][e]?0:-1)}}function Mae(n,o){n&1&&(s(0,"mat-step",32)(1,"div",10)(2,"div",31),K(3,wae,1,1,null,null,Oe),l()()()),n&2&&(m(3),Y(Tt(0,cae)))}function kae(n,o){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),_("click",function(){k(e);let i=v();return T(i.setControllerType("local"))}),d(7," Run this IOS router locally "),l()()()(),s(8,"mat-step",13)(9,"div",10)(10,"input",14,0),_("change",function(i){k(e);let r=v();return T(r.addImage(i))}),l(),s(12,"button",15),_("click",function(){k(e);let i=ke(11);return T(i.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),_("selectionChange",function(i){k(e);let r=v();return r.imageName.set(i.value),T(r.onImageChosen())}),K(21,pae,2,2,"mat-option",20,dae),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),_("input",function(i){k(e);let r=v();return T(r.templateName.set(i.target.value))}),l()(),s(30,"mat-form-field",18)(31,"mat-label"),d(32,"Platform"),l(),s(33,"mat-select",23),_("selectionChange",function(i){k(e);let r=v();return r.platform.set(i.value),T(r.onPlatformChosen())}),K(34,uae,2,2,"mat-option",20,Oe),l()(),I(36,fae,6,1,"mat-form-field",18),l(),I(37,gae,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),_("input",function(i){k(e);let r=v();return T(r.memory.set(i.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),I(52,bae,3,1,"div",31),l()(),I(53,Mae,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),_("input",function(i){k(e);let r=v();return T(r.idlepc.set(i.target.value))}),l()(),s(61,"button",35),_("click",function(){k(e);let i=v();return T(i.findIdlePC())}),d(62,"Idle-PC finder"),l()()()()()(),s(63,"div",36)(64,"button",37),_("click",function(){k(e);let i=v();return T(i.goBack())}),d(65,"Cancel"),l(),s(66,"button",38),_("click",function(){k(e);let i=v();return T(i.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(),Y(e.iosImages()),m(2),C("completed",e.namePlatformStepCompleted()),m(6),C("value",e.templateName()),m(4),C("value",e.platform()),m(),Y(e.platforms()),m(2),A(e.chassisOptions()[e.platform()]?36:-1),m(),A(e.platformsWithEtherSwitchRouterOption()[e.iosTemplate().platform]?37:-1),m(),C("completed",e.memoryStepCompleted()),m(6),C("value",e.memory()),m(4),C("href",e.ciscoUrl,Na),m(4),A(e.platform()&&e.adapterMatrix()[e.platform()]&&e.adapterMatrix()[e.platform()][e.chassis()||""]?52:-1),m(),A(e.platform()&&e.wicMatrix()[e.platform()]?53:-1),m(7),C("value",e.idlepc())}}var Ab=(()=>{class n{route=f(lt);controllerService=f(nt);iosService=f(_s);toasterService=f(ie);router=f(_t);templateMocksService=f(Ma);iosConfigurationService=f(Lm);computeService=f(Eo);uploadServiceService=f(Sl);progressService=f(io);snackBar=f(br);cd=f(X);controller=Q(void 0);iosTemplate=Q(new Rm);isEtherSwitchRouter=Q(!1);imageName=U("");templateName=U("");platform=U("");chassis=U("");memory=U("");idlepc=U("");iosImages=Q([]);platforms=Q([]);platformsWithEtherSwitchRouterOption=Q({});chassisOptions=Q({});defaultRam=Q({});networkAdaptersForTemplate=Q([]);wicsForTemplate=Q([]);adapterMatrix=Q({});wicMatrix=Q({});ciscoUrl="https://cfn.cloudapps.cisco.com/ITDIT/CFN/jsp/SearchBySoftware.jsp";uploader=Q(void 0);isLocalComputerChosen=Q(!0);subscription;imageStepCompleted=$t(()=>!!this.imageName());namePlatformStepCompleted=$t(()=>!!this.templateName()&&!!this.platform());memoryStepCompleted=$t(()=>!!this.memory());ngOnInit(){this.uploader.set(new Wa({url:""})),this.uploader().onAfterAddingFile=t=>{t.withCredentials=!1},this.uploader().onErrorItem=(t,i,r,a)=>{this.toasterService.error("An error occured: "+i)},this.uploader().onSuccessItem=(t,i,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:i=>{this.iosTemplate.set(i),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:i=>{let r=i.error?.message||i.message||"Failed to load template";this.toasterService.error(r),this.cd.markForCheck()}})},t=>{let i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),this.cd.markForCheck()})}fillDefaultSlots(){if(!this.platform())return;let t=this.adapterMatrix()[this.platform()];if(!t)return;let i=this.chassisOptions()[this.platform()];if(i&&!this.chassis())return;let r=i?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 i=e.target.files[0].name,r=this.iosService.getImagePath(this.controller(),i);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(wl,{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=Li(),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 i=t.error?.message||t.message||"Failed to add ios template";this.toasterService.error(i),this.cd.markForCheck()}})}else this.toasterService.error("Fill all required fields")}completeAdaptersData(e){let t=this.adapterMatrix();for(let i=0;i<=6;i++)t[e.platform][e.chassis||""][i]&&(this.networkAdaptersForTemplate()[i]===void 0?e[`slot${i}`]="":e[`slot${i}`]=this.networkAdaptersForTemplate()[i])}completeWicsData(e){let t=this.wicMatrix();for(let i=0;i<=3;i++)t[e.platform][i]&&(this.wicsForTemplate()[i]===void 0?e[`wic${i}`]="":e[`wic${i}`]=this.wicsForTemplate()[i])}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(Z({},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(i=>{let r=[...i];return r[e]=t,r})}onWicChange(e,t){this.wicsForTemplate.update(i=>{let r=[...i];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,i){t&1&&(s(0,"div",1)(1,"header",2),I(2,mae,3,0,"button",3),s(3,"h1",4),d(4,"New IOS router template"),l()(),I(5,kae,68,17,"main",5),l()),t&2&&(m(2),A(i.controller()?2:-1),m(3),A(i.iosTemplate()?5:-1))},dependencies:[ne,Je,dt,oe,de,G,pe,ze,kt,oo,yo,fo,we,Me,Xe,Ti,Se,Te,gt,Pt,ft,yl,Zl,Jl,hl,Vc],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 Tae(n,o){if(n&1){let e=z();s(0,"button",12),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var Ob=(()=>{class n{route=f(lt);controllerService=f(nt);iosService=f(_s);toasterService=f(ie);router=f(_t);formBuilder=f(Bn);cd=f(X);controller;templateName="";iosTemplate;formGroup;constructor(){this.formGroup=this.formBuilder.group({templateName:new $e("",je.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(i=>{this.controller=i,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()}})},i=>{let r=i.error?.message||i.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=Li(),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,i){t&1&&(s(0,"div",0)(1,"header",1),I(2,Tae,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),_("click",function(){return i.goBack()}),d(14,"Cancel"),l(),s(15,"button",11),_("click",function(){return i.addTemplate()}),d(16," Copy template "),l()()()()),t&2&&(m(2),A(i.controller?2:-1),m(5),C("formGroup",i.formGroup))},dependencies:[ne,Je,rt,Nt,Dt,ot,Et,Ft,Vt,dt,oe,de,G,pe,ze,kt,we,Me,Xe,Se,Te],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 Eae=()=>["c1700","c2600","c2691","c3600","c3725","c3745"],Dae=()=>[0,1,2,3,4,5,6],Pae=()=>[0,1,2];function Iae(n,o){if(n&1){let e=z();s(0,"button",6),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function Aae(n,o){if(n&1&&(s(0,"mat-option",23),d(1),l()),n&2){let e=o.$implicit;C("value",e[1]),m(),B(e[0])}}function Oae(n,o){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),B(e.iosTemplate.chassis)}}function Nae(n,o){if(n&1){let e=z();s(0,"mat-chip",35),_("removed",function(){let i=k(e).$implicit,r=v(3);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",36),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function Fae(n,o){if(n&1&&(s(0,"mat-option",23),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Rae(n,o){if(n&1&&(s(0,"mat-option",23),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Lae(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.templateName.set(i.target.value))}),l()(),s(6,"mat-form-field",17)(7,"mat-label"),d(8,"Default name format"),l(),s(9,"input",19),_("input",function(i){k(e);let r=v(2);return T(r.defaultName.set(i.target.value))}),l()()(),s(10,"div",20)(11,"mat-form-field",21)(12,"mat-label"),d(13,"Category"),l(),s(14,"mat-select",22),_("valueChange",function(i){k(e);let r=v(2);return T(r.iosTemplate.category=i)}),K(15,Aae,2,2,"mat-option",23,Oe),l()(),s(17,"mat-form-field",24)(18,"mat-label"),d(19,"Symbol"),l(),s(20,"input",25),_("input",function(i){k(e);let r=v(2);return T(r.symbol.set(i.target.value))}),l()(),s(21,"button",26),_("click",function(){k(e);let i=v(2);return T(i.chooseSymbol())}),d(22,"Choose symbol"),l()(),s(23,"div",27)(24,"span",28),d(25,"Platform"),l(),s(26,"span",29),d(27),l()(),I(28,Oae,5,1,"div",27),s(29,"mat-form-field",17)(30,"mat-label"),d(31,"Tags"),l(),s(32,"mat-chip-grid",null,0),K(34,Nae,4,1,"mat-chip",null,Oe),l(),s(36,"input",30),_("matChipInputTokenEnd",function(i){k(e);let r=v(2);return T(r.addTag(i))}),l()(),s(37,"mat-form-field",17)(38,"mat-label"),d(39,"IOS image path"),l(),s(40,"input",31),_("input",function(i){k(e);let r=v(2);return T(r.imagePath.set(i.target.value))}),l()(),s(41,"mat-form-field",17)(42,"mat-label"),d(43,"Initial startup-config"),l(),s(44,"input",32),_("input",function(i){k(e);let r=v(2);return T(r.initialConfig.set(i.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),_("input",function(i){k(e);let r=v(2);return T(r.iosTemplate.private_config=i.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),_("valueChange",function(i){k(e);let r=v(2);return T(r.iosTemplate.console_type=i)}),K(58,Fae,2,2,"mat-option",23,Oe),l()(),s(60,"mat-form-field",17)(61,"mat-label"),d(62,"Auxiliary console type"),l(),s(63,"mat-select",22),_("valueChange",function(i){k(e);let r=v(2);return T(r.iosTemplate.aux_type=i)}),K(64,Rae,2,2,"mat-option",23,Oe),l()()(),s(66,"mat-checkbox",34),_("change",function(i){k(e);let r=v(2);return T(r.iosTemplate.console_auto_start=i.checked)}),d(67,"Auto start console"),l()()}if(n&2){let e=ke(33),t=v(2);m(5),C("value",t.templateName()),m(4),C("value",t.defaultName()),m(5),C("value",t.iosTemplate.category),m(),Y(t.categories),m(5),C("value",t.symbol()),m(7),B(t.iosTemplate.platform),m(),A(t.iosTemplate.chassis?28:-1),m(6),Y(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(),Y(t.consoleTypes),m(5),C("value",t.iosTemplate.aux_type),m(),Y(t.consoleTypes),m(2),C("checked",t.iosTemplate.console_auto_start)}}function Vae(n,o){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),_("input",function(i){k(e);let r=v(3);return T(r.iomemory.set(i.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 Bae(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.ram.set(i.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),_("input",function(i){k(e);let r=v(2);return T(r.nvram.set(i.target.value))}),l(),s(14,"span",40),d(15,"KB"),l()(),I(16,Vae,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),_("input",function(i){k(e);let r=v(2);return T(r.disk0.set(i.target.value))}),l()(),s(24,"mat-form-field",17)(25,"mat-label"),d(26,"PCMCIA disk1"),l(),s(27,"input",43),_("input",function(i){k(e);let r=v(2);return T(r.disk1.set(i.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),A(Tt(5,Eae).includes(e.iosTemplate.platform)?16:-1),m(7),C("value",e.disk0()),m(4),C("value",e.disk1())}}function zae(n,o){n&1&&(s(0,"mat-option",23),d(1),l()),n&2&&(m(),B(""))}function jae(n,o){if(n&1&&(s(0,"mat-option",23),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function $ae(n,o){if(n&1){let e=z();s(0,"mat-form-field",17)(1,"mat-label"),d(2),l(),s(3,"mat-select",46),_("selectionChange",function(i){k(e);let r=v().$implicit,a=v(3);return T(a.networkAdaptersForTemplate[r]=i.value)}),I(4,zae,2,1,"mat-option",23),K(5,jae,2,2,"mat-option",23,Oe),l()()}if(n&2){let e=v().$implicit,t=v(3);m(2),ee("Slot ",e),m(),C("placeholder",Hi("Slot ",e))("value",t.networkAdaptersForTemplate[e]),m(),A(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(),Y(t.adapterMatrix[t.iosTemplate.platform][t.iosTemplate.chassis||""][e])}}function Hae(n,o){if(n&1&&I(0,$ae,7,5,"mat-form-field",17),n&2){let e=o.$implicit,t=v(3);A(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 Uae(n,o){if(n&1&&(s(0,"mat-option",23),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Wae(n,o){if(n&1){let e=z();s(0,"mat-form-field",17)(1,"mat-label"),d(2),l(),s(3,"mat-select",46),_("selectionChange",function(i){k(e);let r=v().$implicit,a=v(4);return T(a.wicsForTemplate[r]=i.value)}),s(4,"mat-option",23),d(5),l(),K(6,Uae,2,2,"mat-option",23,Oe),l()()}if(n&2){let e=v().$implicit,t=v(4);m(2),ee("WIC ",e),m(),C("placeholder",Hi("WIC ",e))("value",t.wicsForTemplate[e]),m(2),B(""),m(),Y(t.wicMatrix[t.iosTemplate.platform][e])}}function Gae(n,o){if(n&1&&I(0,Wae,8,5,"mat-form-field",17),n&2){let e=o.$implicit,t=v(4);A(t.wicMatrix[t.iosTemplate.platform]&&t.wicMatrix[t.iosTemplate.platform][e]?0:-1)}}function qae(n,o){n&1&&(s(0,"h6",37),d(1,"WICs"),l(),s(2,"div",38),K(3,Gae,1,1,null,null,Oe),l()),n&2&&(m(3),Y(Tt(0,Pae)))}function Qae(n,o){if(n&1&&(s(0,"div",11)(1,"h6",37),d(2,"Adapters"),l(),s(3,"div",38),K(4,Hae,1,1,null,null,Oe),l(),I(6,qae,5,1),l()),n&2){let e=v(2);m(4),Y(Tt(1,Dae)),m(2),A(e.wicMatrix[e.iosTemplate.platform]?6:-1)}}function Xae(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.systemId.set(i.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),_("input",function(i){k(e);let r=v(2);return T(r.baseMac.set(i.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),_("click",function(){k(e);let i=v(2);return T(i.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),_("input",function(i){k(e);let r=v(2);return T(r.idlepc.set(i.target.value))}),l()(),s(19,"button",49),_("click",function(){k(e);let i=v(2);return T(i.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),_("input",function(i){k(e);let r=v(2);return T(r.idlemax.set(i.target.value))}),l()(),s(26,"mat-form-field",17)(27,"mat-label"),d(28,"Idlesleep"),l(),s(29,"input",53),_("input",function(i){k(e);let r=v(2);return T(r.idlesleep.set(i.target.value))}),l()(),s(30,"mat-form-field",17)(31,"mat-label"),d(32,"Exec area"),l(),s(33,"input",54),_("input",function(i){k(e);let r=v(2);return T(r.execArea.set(i.target.value))}),l()()(),s(34,"div",16)(35,"mat-checkbox",34),_("change",function(i){k(e);let r=v(2);return T(r.mmap.set(i.checked))}),d(36,"Enable mmap support"),l(),s(37,"mat-checkbox",34),_("change",function(i){k(e);let r=v(2);return T(r.sparsemem.set(i.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 Kae(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.usage.set(i.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.usage())}}function Yae(n,o){if(n&1){let e=z();s(0,"main",5)(1,"section",7)(2,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("general"))}),s(3,"h3",9),d(4,"General settings"),l(),s(5,"mat-icon",10),d(6),l()(),I(7,Lae,68,14,"div",11),l(),s(8,"section",7)(9,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("memory"))}),s(10,"h3",9),d(11,"Memories and disks"),l(),s(12,"mat-icon",10),d(13),l()(),I(14,Bae,30,6,"div",11),l(),s(15,"section",7)(16,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("slots"))}),s(17,"h3",9),d(18,"Slots"),l(),s(19,"mat-icon",10),d(20),l()(),I(21,Qae,7,2,"div",11),l(),s(22,"section",7)(23,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("advanced"))}),s(24,"h3",9),d(25,"Advanced"),l(),s(26,"mat-icon",10),d(27),l()(),I(28,Xae,39,8,"div",11),l(),s(29,"section",7)(30,"div",8),_("click",function(){k(e);let i=v();return T(i.toggleSection("usage"))}),s(31,"h3",9),d(32,"Usage"),l(),s(33,"mat-icon",10),d(34),l()(),I(35,Kae,5,1,"div",12),l(),s(36,"div",13)(37,"button",14),_("click",function(){k(e);let i=v();return T(i.goBack())}),d(38,"Cancel"),l(),s(39,"button",15),_("click",function(){k(e);let i=v();return T(i.onSave())}),d(40,"Save"),l()()()}if(n&2){let e=v();m(6),B(e.generalSettingsExpanded?"expand_less":"expand_more"),m(),A(e.generalSettingsExpanded?7:-1),m(6),B(e.memoryExpanded?"expand_less":"expand_more"),m(),A(e.memoryExpanded?14:-1),m(6),B(e.slotsExpanded?"expand_less":"expand_more"),m(),A(e.slotsExpanded?21:-1),m(6),B(e.advancedExpanded?"expand_less":"expand_more"),m(),A(e.advancedExpanded?28:-1),m(6),B(e.usageExpanded?"expand_less":"expand_more"),m(),A(e.usageExpanded?35:-1)}}var Nb=(()=>{class n{route=f(lt);controllerService=f(nt);iosService=f(_s);toasterService=f(ie);iosConfigurationService=f(Lm);progressService=f(io);router=f(_t);cd=f(X);dialog=f(it);dialogConfig=f(go);validationService=f(V0);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(i=>{this.controller=i,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()}})},i=>{let r=i.error?.message||i.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 i="";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;i+=e[u]}r<2&&(i+=".")}this.iosTemplate.mac_addr=i,this.baseMac.set(i),this.toasterService.success(`Base MAC generated: ${i}`)}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 i=this.iosTemplate.platform,r=this.validationService.validateRamForPlatform(this.ram(),i);if(!r.isValid){this.toasterService.error(r.errorMessage);return}let a=this.validationService.validateNvramForPlatform(this.nvram(),i);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(Jr,e).afterClosed().subscribe(i=>{i&&(this.iosTemplate.symbol=i,this.symbol.set(i))})}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,i){t&1&&(s(0,"div",1)(1,"header",2),I(2,Iae,3,0,"button",3),s(3,"h1",4),d(4,"IOS router template configuration"),l()(),I(5,Yae,41,10,"main",5),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.iosTemplate?5:-1))},dependencies:[ne,Je,dt,oi,ei,Ci,xi,hi,we,Me,Xe,RC,Ti,Se,Te,gt,Pt,ft,G,pe,ze,oe,de,gl,Lt,qt],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 Zae=(n,o)=>o.template_id;function Jae(n,o){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 ese(n,o){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 tse(n,o){n&1&&R(0,"app-empty-templates-list")}function nse(n,o){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),_("click",function(i){return i.stopPropagation()}),s(6,"mat-icon"),d(7,"more_vert"),l()(),s(8,"mat-menu",14,1)(10,"button",15),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.deleteTemplate(i))}),s(11,"mat-icon"),d(12,"delete"),l(),s(13,"span"),d(14,"Delete"),l()(),s(15,"button",15),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.copyTemplate(i))}),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=o.$implicit,t=ke(9);C("routerLink",e.template_id),m(4),B(e.name),m(),C("matMenuTriggerFor",t),m(15),C("routerLink",e.template_id)}}function ise(n,o){if(n&1&&(s(0,"nav",8),K(1,nse,25,4,"div",10,Zae),l()),n&2){let e=v();m(),Y(e.iosTemplates)}}var Fb=(()=>{class n{route=f(lt);controllerService=f(nt);iosService=f(_s);toasterService=f(ie);router=f(_t);cd=f(X);controller;iosTemplates=[];deleteComponent=Rt(Vi);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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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,i){t&1&&Xt(i.deleteComponent,Vi,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,i){t&1&&(s(0,"div",2)(1,"header",3),I(2,Jae,3,1,"button",4),s(3,"h1",5),d(4,"IOS router templates"),l(),I(5,ese,3,1,"button",6),l(),s(6,"main",7),I(7,tse,1,0,"app-empty-templates-list"),I(8,ise,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),_("deleteEvent",function(){return i.onDeleteEvent()}),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.controller?5:-1),m(2),A(i.iosTemplates.length?-1:7),m(),A(i.iosTemplates.length?8:-1),m(),C("controller",i.controller))},dependencies:[ne,dt,vn,G,ze,oe,de,eo,qe,Kn,tt,Fn,ht,Mt,Vi,ta],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 Vm=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 vs=(()=>{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}/${ki.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=te({token:n,factory:n.\u0275fac})}return n})();var ose=(n,o)=>o.path;function rse(n,o){if(n&1){let e=z();s(0,"button",23),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function ase(n,o){if(n&1&&(s(0,"mat-option",18),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function sse(n,o){if(n&1&&(s(0,"mat-option",18),d(1),l()),n&2){let e=o.$implicit;C("value",e.path),m(),ee(" ",e.path," ")}}function lse(n,o){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),_("selectionChange",function(i){k(e);let r=v();return T(r.iouTemplate.update(a=>Ye(Z({},a),{path:i.value})))}),K(4,sse,2,2,"mat-option",18,ose),l()()}if(n&2){let e=v();m(3),C("value",e.iouTemplate().path),m(),Y(e.iouImages())}}function cse(n,o){if(n&1){let e=z();s(0,"div",19)(1,"input",25,0),_("change",function(i){k(e);let r=v();return T(r.uploadImageFile(i))}),l(),s(3,"button",26),_("click",function(){k(e);let i=ke(2);return T(i.click())}),d(4," Browse "),l(),s(5,"mat-form-field",27)(6,"mat-label"),d(7,"IOU image"),l(),s(8,"input",28),_("input",function(i){k(e);let r=v();return T(r.imageName.set(i.target.value))}),l()()()}if(n&2){let e=v();m(),C("uploader",e.uploader()),m(7),C("value",e.imageName())}}var Rb=(()=>{class n{route=f(lt);controllerService=f(nt);iouService=f(vs);toasterService=f(ie);router=f(_t);templateMocksService=f(Ma);computeService=f(Eo);uploadServiceService=f(Sl);snackBar=f(br);cd=f(X);controller=Q(void 0);iouTemplate=Q(new Vm);newImageSelected=Q(!1);types=Q(["L2 image","L3 image"]);iouImages=Q([]);uploader=Q(void 0);isLocalComputerChosen=Q(!0);subscription;templateName=U("");imageName=U("");selectedType=U("");nameStepCompleted=$t(()=>!!this.templateName());ngOnInit(){this.uploader.set(new Wa({url:""})),this.uploader().onAfterAddingFile=t=>{t.withCredentials=!1},this.uploader().onErrorItem=(t,i,r,a)=>{this.toasterService.error("An error occured: "+i)},this.uploader().onProgressItem=t=>{this.uploadServiceService.processBarCount(t.progress)},this.uploader().onSuccessItem=(t,i,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:i=>{this.iouTemplate.set(i)},error:()=>{this.toasterService.error("Failed to load IOU template"),this.cd.markForCheck()}})},t=>{let i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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 i=this.iouService.getImagePath(this.controller(),t);this.uploader().queue.forEach(a=>a.url=i);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(wl,{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=Li(),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 i=t.error?.message||t.message||"Failed to add iou template";this.toasterService.error(i),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,i){t&1&&(s(0,"div",1)(1,"header",2),I(2,rse,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),_("click",function(){return i.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),_("input",function(a){return i.templateName.set(a.target.value)}),l()()()(),s(18,"mat-step",15)(19,"div",12)(20,"mat-radio-group",9)(21,"mat-radio-button",10),_("click",function(){return i.setDiskImage("existingImage")}),d(22," Existing image "),l(),s(23,"mat-radio-button",16),_("click",function(){return i.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),_("selectionChange",function(a){return i.selectedType.set(a.value)}),K(29,ase,2,2,"mat-option",18,Oe),l()(),I(31,lse,6,1,"mat-form-field",13),I(32,cse,9,2,"div",19),l()()()(),s(33,"div",20)(34,"button",21),_("click",function(){return i.goBack()}),d(35,"Cancel"),l(),s(36,"button",22),_("click",function(){return i.addTemplate()}),d(37," Add template "),l()()()()),t&2&&(m(2),A(i.controller()?2:-1),m(5),C("linear",!0),m(),C("completed",i.isLocalComputerChosen()),m(2),C("checked",!0),m(2),C("completed",i.nameStepCompleted()),m(5),C("value",i.templateName()),m(4),C("checked",!i.newImageSelected()),m(2),C("checked",i.newImageSelected()),m(5),C("value",i.selectedType()),m(),Y(i.types()),m(2),A(i.newImageSelected()?-1:31),m(),A(i.newImageSelected()?32:-1))},dependencies:[ne,Je,dt,oe,de,G,pe,ze,kt,oo,yo,fo,we,Me,Xe,Se,Te,gt,Pt,ft,yl,Zl,Jl,hl,Vc],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 dse(n,o){if(n&1){let e=z();s(0,"button",12),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var Lb=(()=>{class n{route=f(lt);controllerService=f(nt);iouService=f(vs);toasterService=f(ie);router=f(_t);formBuilder=f(Bn);cd=f(X);controller;templateName="";iouTemplate;templateNameForm;constructor(){this.templateNameForm=this.formBuilder.group({templateName:new $e("",je.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(i=>{this.controller=i,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()}})},i=>{let r=i.error?.message||i.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=Li(),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,i){t&1&&(s(0,"div",0)(1,"header",1),I(2,dse,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),_("click",function(){return i.goBack()}),d(14,"Cancel"),l(),s(15,"button",11),_("click",function(){return i.addTemplate()}),d(16," Copy template "),l()()()()),t&2&&(m(2),A(i.controller?2:-1),m(5),C("formGroup",i.templateNameForm))},dependencies:[ne,Je,rt,Nt,Dt,ot,Et,Ft,Vt,dt,oe,de,G,pe,ze,kt,we,Me,Xe,Se,Te],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 lf=(()=>{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=te({token:n,factory:n.\u0275fac})}return n})();function mse(n,o){if(n&1){let e=z();s(0,"button",7),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function pse(n,o){if(n&1&&(s(0,"mat-option",24),d(1),l()),n&2){let e=o.$implicit;C("value",e[1]),m(),B(e[0])}}function use(n,o){if(n&1){let e=z();s(0,"mat-chip",36),_("removed",function(){let i=k(e).$implicit,r=v(3);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",37),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function hse(n,o){if(n&1&&(s(0,"mat-option",24),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function fse(n,o){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),_("input",function(i){k(e);let r=v(3);return T(r.ram.set(+i.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),_("input",function(i){k(e);let r=v(3);return T(r.nvram.set(+i.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 gse(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.templateName.set(i.target.value))}),l()(),s(6,"mat-form-field",18)(7,"mat-label"),d(8,"Default name format"),l(),s(9,"input",20),_("input",function(i){k(e);let r=v(2);return T(r.defaultName.set(i.target.value))}),l()()(),s(10,"div",21)(11,"mat-form-field",22)(12,"mat-label"),d(13,"Category"),l(),s(14,"mat-select",23),_("selectionChange",function(i){k(e);let r=v(2);return T(r.category.set(i.value))}),K(15,pse,2,2,"mat-option",24,Ni),l()(),s(17,"mat-form-field",25)(18,"mat-label"),d(19,"Symbol"),l(),s(20,"input",26),_("input",function(i){k(e);let r=v(2);return T(r.symbol.set(i.target.value))}),l()(),s(21,"button",27),_("click",function(){k(e);let i=v(2);return T(i.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),K(28,use,4,1,"mat-chip",null,Oe),l(),s(30,"input",28),_("matChipInputTokenEnd",function(i){k(e);let r=v(2);return T(r.addTag(i))}),l()(),s(31,"div",29)(32,"input",30,1),_("change",function(i){k(e);let r=v(2);return T(r.uploadImageFile(i))}),l(),s(34,"button",31),_("click",function(){k(e);let i=ke(33);return T(i.click())}),d(35," Browse "),l(),s(36,"mat-form-field",25)(37,"mat-label"),d(38,"IOU image path"),l(),s(39,"input",32),_("input",function(i){k(e);let r=v(2);return T(r.path.set(i.target.value))}),l()()(),s(40,"mat-form-field",18)(41,"mat-label"),d(42,"Startup config"),l(),s(43,"input",33),_("input",function(i){k(e);let r=v(2);return T(r.initialConfig.set(i.target.value))}),l()(),s(44,"mat-form-field",18)(45,"mat-label"),d(46,"Private config"),l(),s(47,"input",34),_("input",function(i){k(e);let r=v(2);return T(r.privateConfig.set(i.target.value))}),l()(),s(48,"mat-form-field",18)(49,"mat-label"),d(50,"Console type"),l(),s(51,"mat-select",23),_("selectionChange",function(i){k(e);let r=v(2);return T(r.consoleType.set(i.value))}),K(52,hse,2,2,"mat-option",24,Oe),l()(),s(54,"mat-checkbox",35),_("change",function(i){k(e);let r=v(2);return T(r.consoleAutoStart.set(i.checked))}),d(55," Auto start console "),l(),s(56,"mat-checkbox",35),_("change",function(i){k(e);let r=v(2);return T(r.l1Keepalives.set(i.checked))}),d(57," Enable Layer 1 keepalive messages "),l(),s(58,"mat-checkbox",35),_("change",function(i){k(e);let r=v(2);return T(r.useDefaultIouValues.set(i.checked))}),d(59," Use default IOU values for memories "),l(),I(60,fse,13,2,"div",17),l()}if(n&2){let e=ke(27),t=v(2);m(5),C("value",t.templateName()),m(4),C("value",t.defaultName()),m(5),C("value",t.category()),m(),Y(t.categories),m(5),C("value",t.symbol()),m(8),Y(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(),Y(t.consoleTypes),m(2),C("checked",t.consoleAutoStart()),m(2),C("checked",t.l1Keepalives()),m(2),C("checked",t.useDefaultIouValues()),m(2),A(t.useDefaultIouValues()?-1:60)}}function _se(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.ethernetAdapters.set(+i.target.value))}),l()(),s(5,"mat-form-field",18)(6,"mat-label"),d(7,"Serial adapters"),l(),s(8,"input",42),_("input",function(i){k(e);let r=v(2);return T(r.serialAdapters.set(+i.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.ethernetAdapters()),m(4),C("value",e.serialAdapters())}}function vse(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.usage.set(i.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.usage())}}function Cse(n,o){if(n&1){let e=z();s(0,"main",6)(1,"section",8)(2,"div",9),_("click",function(){k(e);let i=v();return T(i.toggleSection("general"))}),s(3,"h3",10),d(4,"General settings"),l(),s(5,"mat-icon",11),d(6),l()(),I(7,gse,61,14,"form",12),l(),s(8,"section",8)(9,"div",9),_("click",function(){k(e);let i=v();return T(i.toggleSection("network"))}),s(10,"h3",10),d(11,"Network"),l(),s(12,"mat-icon",11),d(13),l()(),I(14,_se,9,2,"form",12),l(),s(15,"section",8)(16,"div",9),_("click",function(){k(e);let i=v();return T(i.toggleSection("usage"))}),s(17,"h3",10),d(18,"Usage"),l(),s(19,"mat-icon",11),d(20),l()(),I(21,vse,5,1,"div",13),l(),s(22,"div",14)(23,"button",15),_("click",function(){k(e);let i=v();return T(i.goBack())}),d(24,"Cancel"),l(),s(25,"button",16),_("click",function(){k(e);let i=v();return T(i.onSave())}),d(26,"Save"),l()()()}if(n&2){let e=v();m(6),B(e.generalSettingsExpanded()?"expand_less":"expand_more"),m(),A(e.generalSettingsExpanded()?7:-1),m(6),B(e.networkExpanded()?"expand_less":"expand_more"),m(),A(e.networkExpanded()?14:-1),m(6),B(e.usageExpanded()?"expand_less":"expand_more"),m(),A(e.usageExpanded()?21:-1)}}var Vb=(()=>{class n{route=f(lt);controllerService=f(nt);iouService=f(vs);toasterService=f(ie);configurationService=f(lf);router=f(_t);cd=f(X);dialog=f(it);dialogConfig=f(go);validationService=f(B0);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(i=>{this.controller=i,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()}})},i=>{let r=i.error?.message||i.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:i=>{let r=i.error?.message||i.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(Jr,e).afterClosed().subscribe(i=>{i&&this.symbol.set(i)})}addTag(e){let t=(e.value||"").trim(),i=this.tags();t&&this.tags.set([...i,t]),e.chipInput&&e.chipInput.clear()}removeTag(e){let t=this.tags(),i=t.indexOf(e);if(i>=0){let r=[...t];r.splice(i,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,i){t&1&&(s(0,"div",2)(1,"header",3),I(2,mse,3,0,"button",4),s(3,"h1",5),d(4,"IOU device template configuration"),l()(),I(5,Cse,27,6,"main",6),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.iouTemplate?5:-1))},dependencies:[ne,Je,rt,ot,Gn,dt,oe,de,G,pe,ze,we,Me,Xe,Ti,Se,Te,gt,Pt,ft,oi,ei,Ci,xi,hi,Lt,qt],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 xse=(n,o)=>o.template_id;function bse(n,o){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 yse(n,o){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 Sse(n,o){n&1&&R(0,"app-empty-templates-list")}function wse(n,o){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),_("click",function(i){return i.stopPropagation()}),s(6,"mat-icon"),d(7,"more_vert"),l()(),s(8,"mat-menu",14,1)(10,"button",15),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.deleteTemplate(i))}),s(11,"mat-icon"),d(12,"delete"),l(),s(13,"span"),d(14,"Delete"),l()(),s(15,"button",15),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.copyTemplate(i))}),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=o.$implicit,t=ke(9);C("routerLink",e.template_id),m(4),B(e.name),m(),C("matMenuTriggerFor",t),m(15),C("routerLink",e.template_id)}}function Mse(n,o){if(n&1&&(s(0,"nav",8),K(1,wse,25,4,"div",10,xse),l()),n&2){let e=v();m(),Y(e.iouTemplates)}}var Bb=(()=>{class n{route=f(lt);controllerService=f(nt);iouService=f(vs);toasterService=f(ie);router=f(_t);cd=f(X);controller;iouTemplates=[];deleteComponent=Rt(Vi);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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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,i){t&1&&Xt(i.deleteComponent,Vi,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,i){t&1&&(s(0,"div",2)(1,"header",3),I(2,bse,3,1,"button",4),s(3,"h1",5),d(4,"IOU device templates"),l(),I(5,yse,3,1,"button",6),l(),s(6,"main",7),I(7,Sse,1,0,"app-empty-templates-list"),I(8,Mse,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),_("deleteEvent",function(){return i.onDeleteEvent()}),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.controller?5:-1),m(2),A(i.iouTemplates.length?-1:7),m(),A(i.iouTemplates.length?8:-1),m(),C("controller",i.controller))},dependencies:[ne,dt,vn,G,ze,oe,de,eo,qe,Kn,tt,Fn,ht,Mt,Vi,ta],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 zb=(()=>{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,i){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",Hi("/controller/",i.controllerId,"/projects")),m(7),C("routerLink",Hi("/controller/",i.controllerId,"/preferences/builtin")),m(4),C("routerLink",Hi("/controller/",i.controllerId,"/preferences/dynamips/templates")),m(4),C("routerLink",Hi("/controller/",i.controllerId,"/preferences/iou/templates")),m(4),C("routerLink",Hi("/controller/",i.controllerId,"/preferences/vpcs/templates")),m(4),C("routerLink",Hi("/controller/",i.controllerId,"/preferences/qemu/templates")),m(4),C("routerLink",Hi("/controller/",i.controllerId,"/preferences/docker/templates")))},dependencies:[ne,dt,vn,G,ze,oe,de,eo,Zd],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 kse=["panel"],Tse=["*"];function Ese(n,o){if(n&1&&(Co(0,"div",1,0),an(2),ko()),n&2){let e=o.id,t=v();ar(t._classList),Ae("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"),Jo("id",t.id),Qt("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e))}}var TP=class{source;option;constructor(o,e){this.source=o,this.option=e}},oL=new cn("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1,hasBackdrop:!1})}),Dr=(()=>{class n{_changeDetectorRef=f(X);_elementRef=f(Jt);_defaults=f(oL);_animationsDisabled=er();_activeOptionChanges=Mo.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 _e;opened=new _e;closed=new _e;optionActivated=new _e;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(To).getId("mat-autocomplete-");inertGroups;constructor(){let e=f(Es);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 A4(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 TP(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,i,r){if(t&1&&Zi(r,ft,5)(r,K4,5),t&2){let a;mt(a=pt())&&(i.options=a),mt(a=pt())&&(i.optionGroups=a)}},viewQuery:function(t,i){if(t&1&&In(Ro,7)(kse,5),t&2){let r;mt(r=pt())&&(i.template=r.first),mt(r=pt())&&(i.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",yt],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",yt],requireSelection:[2,"requireSelection","requireSelection",yt],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",yt],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",yt]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[fn([{provide:X4,useExisting:n}])],ngContentSelectors:Tse,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,i){t&1&&(ai(),Qu(0,Ese,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 Dse={provide:_d,useExisting:dd(()=>So),multi:!0};var Pse=new cn("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let n=f(rr);return()=>SC(n)}}),So=(()=>{class n{_environmentInjector=f(WO);_element=f(Jt);_injector=f(rr);_viewContainerRef=f(ro);_zone=f(Ai);_changeDetectorRef=f(X);_dir=f(es,{optional:!0});_formField=f(rh,{optional:!0,host:!0});_viewportRuler=f(hd);_scrollStrategy=f(Pse);_renderer=f(Si);_animationsDisabled=er();_defaults=f(oL,{optional:!0});_overlayRef=null;_portal;_componentDestroyed=!1;_initialized=new We;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue=null;_valueOnAttach=null;_valueOnLastKeydown=null;_positionStrategy;_manuallyFloatingLabel=!1;_closingActionsSubscription;_viewportSubscription=Mo.EMPTY;_breakpointObserver=f(AC);_handsetLandscapeSubscription=Mo.EMPTY;_canOpenOnNextFocus=!0;_valueBeforeAutoSelection;_pendingAutoselectedOption=null;_closeKeyEventStream=new We;_overlayPanelClass=x4(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&&NC(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return Wn(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(ci(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(ci(()=>this._overlayAttached)):Nn()).pipe(Bt(e=>e instanceof Y4?e:null))}optionSelections=LO(()=>{let e=this.autocomplete?this.autocomplete.options:null;return e?e.changes.pipe(gi(e),Vn(()=>Wn(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(Vn(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new Rr(e=>{let t=r=>{let a=kp(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)},i=[this._renderer.listen("document","click",t),this._renderer.listen("document","auxclick",t),this._renderer.listen("document","touchend",t)];return()=>{i.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,i=t.keyCode,r=xa(t);if(i===27&&!r&&t.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&i===13&&this.panelOpen&&!r)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){let a=this.autocomplete._keyManager.activeItem,c=i===38||i===40;i===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,i=t.value;if(t.type==="number"&&(i=i==""?null:parseFloat(i)),this._previousValue!==i){if(this._previousValue=i,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(i),!i)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);i!==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 vC()===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 Rr(i=>{Ja(()=>{i.next()},{injector:this._environmentInjector})}),t=this.autocomplete.options?.changes.pipe(yi(()=>this._positionStrategy.reapplyLastPosition()),jO(0))??Nn();return Wn(e,t).pipe(Vn(()=>this._zone.run(()=>{let i=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),i!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),Fo(1)).subscribe(i=>this._setValueAndClose(i))}_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,i=e?e.source:this._pendingAutoselectedOption;i?(this._clearPreviousSelectedOption(i),this._assignOptionValue(i.value),this._onChange(i.value),t._emitSelectEvent(i),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(i=>{i!==e&&i.selected&&i.deselect(t)})}_openPanelInternal(e=this._element.nativeElement.value){if(this._attachOverlay(e),this._floatLabel(),this._trackedModal){let t=this.autocomplete.id;Pk(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 gd(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),t=kC(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(vd.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 i=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&i!==this.panelOpen&&this._emitOpened()}_handlePanelKeydown=e=>{(e.keyCode===27&&!xa(e)||e.keyCode===38&&xa(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 wC({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=MC(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"}],i=this._aboveClass,r=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:i},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:i}],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 i=0;i<e.options.length;i++)if(!e.options.get(i).disabled){t=i;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,i=Z4(e,t.options,t.optionGroups);if(e===0&&i===1)t._setScrollTop(0);else if(t.panel){let r=t.options.toArray()[e];if(r){let a=r._getHostElement(),c=J4(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&&NC(this._trackedModal,"aria-owns",t),Pk(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(this._trackedModal){let e=this.autocomplete.id;NC(this._trackedModal,"aria-owns",e),this._trackedModal=null}}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(t,i){t&1&&_("focusin",function(){return i._handleFocus()})("blur",function(){return i._onTouched()})("input",function(a){return i._handleInput(a)})("keydown",function(a){return i._handleKeydown(a)})("click",function(){return i._handleClick()}),t&2&&Qt("autocomplete",i.autocompleteAttribute)("role",i.autocompleteDisabled?null:"combobox")("aria-autocomplete",i.autocompleteDisabled?null:"list")("aria-activedescendant",i.panelOpen&&i.activeOption?i.activeOption.id:null)("aria-expanded",i.autocompleteDisabled?null:i.panelOpen.toString())("aria-controls",i.autocompleteDisabled||!i.panelOpen||i.autocomplete==null?null:i.autocomplete.id)("aria-haspopup",i.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",yt]},exportAs:["matAutocompleteTrigger"],features:[fn([Dse]),Pn]})}return n})(),lr=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[th,Vo,fd,Vo,_i]})}return n})();var Bm=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 zm=(()=>{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=te({token:n,factory:n.\u0275fac})}return n})();var na=(()=>{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}/${ki.current_version}/images/upload/${t}`}getImages(e){return this.httpController.get(e,"/images?image_type=qemu")}createDiskImage(e,t,i,r,a){return this.httpController.post(e,`/projects/${t}/nodes/${i}/qemu/disk_image/${r}`,a)}addTemplate(e,t){let i=this.prepareTemplate(t);return this.httpController.post(e,"/templates",i)}saveTemplate(e,t){let i=this.prepareTemplate(t);return this.httpController.put(e,`/templates/${t.template_id}`,i)}prepareTemplate(e){return Ye(Z({},e),{custom_adapters:e.custom_adapters||[]})}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Ise=(n,o)=>o.filename;function Ase(n,o){if(n&1){let e=z();s(0,"button",31),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function Ose(n,o){if(n&1&&(s(0,"mat-option",18),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function Nse(n,o){if(n&1&&(s(0,"mat-option",18),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function Fse(n,o){if(n&1&&(s(0,"mat-option",18),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function Rse(n,o){if(n&1&&(s(0,"mat-option",18),d(1),l()),n&2){let e=o.$implicit;C("value",e.filename),m(),ee(" ",e.filename," ")}}function Lse(n,o){if(n&1){let e=z();s(0,"mat-form-field",14)(1,"mat-label"),d(2,"Disk image (hda)"),l(),s(3,"input",32),_("input",function(i){k(e);let r=v();return T(r.onDiskImageInput(i))}),l(),s(4,"mat-autocomplete",33,0),_("optionSelected",function(i){k(e);let r=v();return T(r.onDiskImageSelected(i.option.value))}),K(6,Rse,2,2,"mat-option",18,Ise),l()()}if(n&2){let e=ke(5),t=v();m(3),C("matAutocomplete",e),m(3),Y(t.filteredImages())}}function Vse(n,o){if(n&1){let e=z();s(0,"div",27)(1,"input",34,1),_("change",function(i){k(e);let r=v();return T(r.uploadImageFile(i))}),l(),s(3,"button",35),_("click",function(){k(e);let i=ke(2);return T(i.click())}),d(4," Browse "),l(),s(5,"mat-form-field",36)(6,"mat-label"),d(7,"Image name"),l(),s(8,"input",37),_("input",function(i){k(e);let r=v();return T(r.fileName.set(i.target.value))}),l()()()}if(n&2){let e=v();m(),C("uploader",e.uploader()),m(7),C("value",e.fileName())}}var jb=(()=>{class n{route=f(lt);controllerService=f(nt);qemuService=f(na);toasterService=f(ie);router=f(_t);templateMocksService=f(Ma);configurationService=f(zm);computeService=f(Eo);snackBar=f(br);uploadServiceService=f(Sl);cd=f(X);subscription;controller=Q(void 0);selectPlatform=Q([]);consoleTypes=Q([]);auxConsoleTypes=Q([]);newImageSelected=Q(!1);qemuImages=Q([]);selectedImage=Q(void 0);filteredImages=Q([]);chosenImage=Q("");qemuTemplate=Q(new Bm);uploader=Q(void 0);isLocalComputerChosen=Q(!0);templateName=U("");ramMemory=U(256);fileName=U("");selectedPlatform=U("");consoleType=U("");auxConsoleType=U("");nameStepCompleted=$t(()=>!!this.templateName());platformStepCompleted=$t(()=>!!this.ramMemory()&&!!this.selectedPlatform());consoleStepCompleted=$t(()=>!!this.consoleType());auxConsoleStepCompleted=$t(()=>!!this.auxConsoleType());ngOnInit(){this.uploader.set(new Wa({url:""})),this.uploader().onAfterAddingFile=t=>{t.withCredentials=!1},this.uploader().onErrorItem=(t,i,r,a)=>{this.toasterService.error("An error occured: "+i)},this.uploader().onSuccessItem=(t,i,r,a)=>{this.qemuService.getImages(this.controller()).subscribe(c=>{this.qemuImages.set(c),this.filteredImages.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:i=>{this.qemuTemplate.set(i)},error:()=>{this.toasterService.error("Failed to load QEMU template"),this.cd.markForCheck()}}),this.qemuService.getImages(this.controller()).subscribe({next:i=>{this.qemuImages.set(i),this.filteredImages.set(i)},error:i=>{let r=i.error?.message||i.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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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"),e==="newImage"&&this.selectedImage.set(void 0)}filterImages(e){let t=e.target.value.toLowerCase();return this.qemuImages().filter(i=>i.filename.toLowerCase().includes(t))}onDiskImageInput(e){this.filteredImages.set(this.filterImages(e)),this.selectedImage.set(void 0)}onDiskImageSelected(e){let t=this.qemuImages().find(i=>i.filename===e);this.selectedImage.set(t)}uploadImageFile(e){let t=e.target.files[0].name;this.fileName.set(t),this.chosenImage.set(t);let i=this.qemuService.getImagePath(this.controller(),t);this.uploader().queue.forEach(a=>a.url=i);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(wl,{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=Li(),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 i=t.error?.message||t.message||"Failed to add qemu template";this.toasterService.error(i),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:[["hdaAuto","matAutocomplete"],["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"],["matInput","","type","text","placeholder","Disk image (hda)",3,"input","matAutocomplete"],[3,"optionSelected"],["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,i){t&1&&(s(0,"div",2)(1,"header",3),I(2,Ase,3,0,"button",4),s(3,"h1",5),d(4,"New QEMU VM template"),l()(),s(5,"main",6)(6,"section",7)(7,"mat-vertical-stepper",8)(8,"mat-step",9)(9,"mat-radio-group",10)(10,"mat-radio-button",11),_("click",function(){return i.setControllerType("local")}),d(11," Run this QEMU VM locally "),l()()(),s(12,"mat-step",12)(13,"div",13)(14,"mat-form-field",14)(15,"mat-label"),d(16,"Template name"),l(),s(17,"input",15),_("input",function(a){return i.templateName.set(a.target.value)}),l()()()(),s(18,"mat-step",16)(19,"div",13)(20,"mat-form-field",14)(21,"mat-label"),d(22,"Platform"),l(),s(23,"mat-select",17),_("selectionChange",function(a){return i.selectedPlatform.set(a.value)}),K(24,Ose,2,2,"mat-option",18,Oe),l()(),s(26,"mat-form-field",14)(27,"mat-label"),d(28,"RAM"),l(),s(29,"input",19),_("input",function(a){return i.ramMemory.set(+a.target.value)}),l(),s(30,"span",20),d(31,"MB"),l()()()(),s(32,"mat-step",21)(33,"mat-form-field",14)(34,"mat-label"),d(35,"Console type"),l(),s(36,"mat-select",22),_("selectionChange",function(a){return i.consoleType.set(a.value)}),K(37,Nse,2,2,"mat-option",18,Oe),l()()(),s(39,"mat-step",23)(40,"mat-form-field",14)(41,"mat-label"),d(42,"Auxiliary console type"),l(),s(43,"mat-select",24),_("selectionChange",function(a){return i.auxConsoleType.set(a.value)}),K(44,Fse,2,2,"mat-option",18,Oe),l()()(),s(46,"mat-step",25)(47,"div",13)(48,"mat-radio-group",10)(49,"mat-radio-button",11),_("click",function(){return i.setDiskImage("existingImage")}),d(50," Existing image "),l(),s(51,"mat-radio-button",26),_("click",function(){return i.setDiskImage("newImage")}),d(52," New image "),l()(),I(53,Lse,8,1,"mat-form-field",14),I(54,Vse,9,2,"div",27),l()()()(),s(55,"div",28)(56,"button",29),_("click",function(){return i.goBack()}),d(57,"Cancel"),l(),s(58,"button",30),_("click",function(){return i.addTemplate()}),d(59," Add template "),l()()()()),t&2&&(m(2),A(i.controller()?2:-1),m(5),C("linear",!0),m(),C("completed",i.isLocalComputerChosen()),m(2),C("checked",!0),m(2),C("completed",i.nameStepCompleted()),m(5),C("value",i.templateName()),m(),C("completed",i.platformStepCompleted()),m(5),C("value",i.selectedPlatform()),m(),Y(i.selectPlatform()),m(5),C("value",i.ramMemory()),m(3),C("completed",i.consoleStepCompleted()),m(4),C("value",i.consoleType()),m(),Y(i.consoleTypes()),m(2),C("completed",i.auxConsoleStepCompleted()),m(4),C("value",i.auxConsoleType()),m(),Y(i.auxConsoleTypes()),m(5),C("checked",!i.newImageSelected()),m(2),C("checked",i.newImageSelected()),m(2),A(i.newImageSelected()?-1:53),m(),A(i.newImageSelected()?54:-1))},dependencies:[ne,Je,dt,oe,de,G,pe,ze,kt,oo,yo,fo,we,Me,Xe,Ti,Se,Te,gt,Pt,ft,lr,Dr,So,yl,Zl,Jl,hl,Vc],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 Bse(n,o){if(n&1){let e=z();s(0,"button",12),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var $b=(()=>{class n{route=f(lt);controllerService=f(nt);qemuService=f(na);toasterService=f(ie);router=f(_t);formBuilder=f(Bn);cd=f(X);controller;templateName="";qemuTemplate;nameForm;constructor(){this.nameForm=this.formBuilder.group({templateName:new $e("",je.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(i=>{this.controller=i,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()}})},i=>{let r=i.error?.message||i.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=Li(),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,i){t&1&&(s(0,"div",0)(1,"header",1),I(2,Bse,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),_("click",function(){return i.goBack()}),d(14,"Cancel"),l(),s(15,"button",11),_("click",function(){return i.addTemplate()}),d(16," Copy template "),l()()()()),t&2&&(m(2),A(i.controller?2:-1),m(5),C("formGroup",i.nameForm))},dependencies:[ne,Je,rt,Nt,Dt,ot,Et,Ft,Vt,dt,oe,de,G,pe,ze,kt,we,Me,Xe,Se,Te],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 Wc=(()=>{class n{httpController;constructor(e){this.httpController=e}getImages(e){return this.httpController.get(e,"/images")}getImagePath(e,t,i){return`${e.protocol}//${e.host}:${e.port}/${ki.current_version}/images/upload/${i}?install_appliances=${t}`}uploadedImage(e,t,i,r){return this.httpController.post(e,`/images/upload/${i}?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=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var jse=(n,o)=>o.adapter_number,$se=(n,o)=>o.value;function Hse(n,o){if(n&1&&(s(0,"mat-option",18),d(1),l()),n&2){let e=o.$implicit;C("value",e.value),m(),B(e.name)}}function Use(n,o){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v().$implicit,t=v();m(),B(t.getMacErrorMessage(e.mac_address))}}function Wse(n,o){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),_("input",function(i){let r=k(e).$implicit,a=v();return T(a.onPortNameChange(r.adapter_number,i.target.value))}),l()(),s(5,"mat-form-field",15)(6,"mat-select",17),_("selectionChange",function(i){let r=k(e).$implicit,a=v();return T(a.onAdapterTypeChange(r.adapter_number,i.value))}),K(7,Hse,2,2,"mat-option",18,$se),l()(),s(9,"mat-form-field",15)(10,"input",19),_("input",function(i){let r=k(e).$implicit,a=v();return T(a.onMacAddressChange(r.adapter_number,i.target.value))}),l(),I(11,Use,2,1,"mat-error"),l(),s(12,"button",20),_("click",function(){let i=k(e).$implicit,r=v();return T(r.delete(i))}),s(13,"mat-icon"),d(14,"delete"),l()()()}if(n&2){let e=o.$implicit,t=o.$index,i=v();m(2),ee("Adapter ",e.adapter_number),m(2),C("name",Hi("port_name_",t))("value",e.port_name),m(2),C("name",Hi("adapter_type_",t))("value",e.adapter_type),m(),Y(i.networkTypes),m(3),C("name",Hi("mac_address_",t))("value",e.mac_address),m(),A(e.mac_address&&!i.isValidMacAddress(e.mac_address)?11:-1)}}var Gc=(()=>{class n{data;dialogRef=f(Ie);cd=f(X);toasterService=f(ie);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(),i=(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(i/a),h=i%a;c=r.replace("{0}",String(u*a+h))}else c=r.replace("{0}",String(i));let p={adapter_number:i,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(i=>i.map(r=>r.adapter_number===e?Ye(Z({},r),{port_name:t}):r)),this.cd.markForCheck()}onAdapterTypeChange(e,t){this.adapters.update(i=>i.map(r=>r.adapter_number===e?Ye(Z({},r),{adapter_type:t}):r)),this.cd.markForCheck()}onMacAddressChange(e,t){let i=this.formatMacAddress(t);this.adapters.update(r=>r.map(a=>a.adapter_number===e?Ye(Z({},a),{mac_address:i}):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 g=this.getMacErrorMessage(h.mac_address);return`Adapter ${h.adapter_number}: ${g}`});this.toasterService.error(`Invalid MAC addresses:
|
||
`+u.join(`
|
||
`));return}let e=this.data.portNameFormat||"Ethernet{0}",t=this.data.portSegmentSize||0,i=this.data.defaultAdapterType||"e1000",r=[];for(let p of this.adapters()){let u;if(t>0){let b=Math.floor(p.adapter_number/t),x=p.adapter_number%t;u=e.replace("{0}",String(b*t+x))}else u=e.replace("{0}",String(p.adapter_number));let h=p.port_name!==u,g=p.adapter_type!==i,y=p.mac_address&&p.mac_address.length>0;(h||g||y)&&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)(at(Ct))};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,i){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(),K(14,Wse,15,11,"div",7,jse),l(),s(16,"div",8)(17,"button",9),_("click",function(){return i.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),_("click",function(){return i.cancelConfigureCustomAdapters()}),d(25,"Cancel"),l(),s(26,"button",13),_("click",function(){return i.configureCustomAdapters()}),d(27,"Apply"),l()()),t&2&&(m(14),Y(i.adapters()))},dependencies:[G,pe,ze,we,Me,ni,oe,de,Se,Te,gt,Pt,ft,ht,Mt,ve,Le,Ve,St],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 rL=(n,o)=>o[1],jm=(n,o)=>o.filename,Gse=(n,o)=>o.value;function qse(n,o){if(n&1){let e=z();s(0,"button",18),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function Qse(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e[1]),m(),B(e[0])}}function Xse(n,o){if(n&1){let e=z();s(0,"mat-chip",47),_("removed",function(){let i=k(e).$implicit,r=v(3);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",48),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function Kse(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Yse(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e[1]),m(),B(e[0])}}function Zse(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function Jse(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function ele(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function tle(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.templateName.set(i.target.value))}),l()(),s(6,"mat-form-field",31)(7,"mat-label"),d(8,"Default name format"),l(),s(9,"input",33),_("input",function(i){k(e);let r=v(2);return T(r.defaultName.set(i.target.value))}),l()()(),s(10,"div",34)(11,"mat-form-field",35)(12,"mat-label"),d(13,"Category"),l(),s(14,"mat-select",36),_("selectionChange",function(i){k(e);let r=v(2);return T(r.category.set(i.value))}),K(15,Qse,2,2,"mat-option",37,Ni),l()(),s(17,"mat-form-field",38)(18,"mat-label"),d(19,"Symbol"),l(),s(20,"input",39),_("input",function(i){k(e);let r=v(2);return T(r.symbol.set(i.target.value))}),l()(),s(21,"button",40),_("click",function(){k(e);let i=v(2);return T(i.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),K(28,Xse,4,1,"mat-chip",null,Oe),l(),s(30,"input",41),_("matChipInputTokenEnd",function(i){k(e);let r=v(2);return T(r.addTag(i))}),l()(),s(31,"div",42)(32,"mat-form-field",31)(33,"mat-label"),d(34,"Platform"),l(),s(35,"mat-select",36),_("selectionChange",function(i){k(e);let r=v(2);return T(r.platform.set(i.value))}),K(36,Kse,2,2,"mat-option",37,Oe),l()(),s(38,"mat-form-field",31)(39,"mat-label"),d(40,"RAM"),l(),s(41,"input",43),_("input",function(i){k(e);let r=v(2);return T(r.ram.set(+i.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),_("input",function(i){k(e);let r=v(2);return T(r.cpus.set(+i.target.value))}),l()(),s(48,"mat-form-field",31)(49,"mat-label"),d(50,"Boot priority"),l(),s(51,"mat-select",36),_("selectionChange",function(i){k(e);let r=v(2);return T(r.bootPriority.set(i.value))}),K(52,Yse,2,2,"mat-option",37,rL),l()()(),s(54,"mat-form-field",31)(55,"mat-label"),d(56,"On close"),l(),s(57,"mat-select",36),_("selectionChange",function(i){k(e);let r=v(2);return T(r.onClose.set(i.value))}),K(58,Zse,2,2,"mat-option",37,rL),l()(),s(60,"div",30)(61,"mat-form-field",31)(62,"mat-label"),d(63,"Console type"),l(),s(64,"mat-select",36),_("selectionChange",function(i){k(e);let r=v(2);return T(r.consoleType.set(i.value))}),K(65,Jse,2,2,"mat-option",37,Oe),l()(),s(67,"mat-form-field",31)(68,"mat-label"),d(69,"Auxiliary console type"),l(),s(70,"mat-select",36),_("selectionChange",function(i){k(e);let r=v(2);return T(r.auxConsoleType.set(i.value))}),K(71,ele,2,2,"mat-option",37,Oe),l()()(),s(73,"mat-checkbox",46),_("change",function(i){k(e);let r=v(2);return T(r.consoleAutoStart.set(i.checked))}),d(74,"Auto start console"),l()()}if(n&2){let e=ke(27),t=v(2);m(5),C("value",t.templateName()),m(4),C("value",t.defaultName()),m(5),C("value",t.category()),m(),Y(t.categories),m(5),C("value",t.symbol()),m(8),Y(t.tags()),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(5),C("value",t.platform()),m(),Y(t.selectPlatform),m(5),C("value",t.ram()),m(6),C("value",t.cpus()),m(4),C("value",t.bootPriority()),m(),Y(t.bootPriorities),m(5),C("value",t.onClose()),m(),Y(t.onCloseOptions),m(6),C("value",t.consoleType()),m(),Y(t.consoleTypes),m(5),C("value",t.auxConsoleType()),m(),Y(t.auxConsoleTypes),m(2),C("checked",t.consoleAutoStart())}}function nle(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e.filename),m(),B(e.filename)}}function ile(n,o){if(n&1&&(s(0,"mat-optgroup",53),K(1,nle,2,2,"mat-option",37,jm),l()),n&2){let e=v(3);m(),Y(e.filteredImages)}}function ole(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function rle(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e.filename),m(),B(e.filename)}}function ale(n,o){if(n&1&&(s(0,"mat-optgroup",53),K(1,rle,2,2,"mat-option",37,jm),l()),n&2){let e=v(3);m(),Y(e.filteredImages)}}function sle(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function lle(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e.filename),m(),B(e.filename)}}function cle(n,o){if(n&1&&(s(0,"mat-optgroup",53),K(1,lle,2,2,"mat-option",37,jm),l()),n&2){let e=v(3);m(),Y(e.filteredImages)}}function dle(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function mle(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e.filename),m(),B(e.filename)}}function ple(n,o){if(n&1&&(s(0,"mat-optgroup",53),K(1,mle,2,2,"mat-option",37,jm),l()),n&2){let e=v(3);m(),Y(e.filteredImages)}}function ule(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function hle(n,o){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),_("input",function(i){k(e);let r=v(2);return r.onHdaImageInput(i),T(r.hdaDiskImage.set(i.target.value))})("focus",function(){k(e);let i=v(2);return T(i.refreshQemuImages())}),l(),s(8,"mat-autocomplete",52,1),_("optionSelected",function(i){k(e);let r=v(2);return T(r.hdaDiskImage.set(i.option.value))}),I(10,ile,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),_("selectionChange",function(i){k(e);let r=v(2);return T(r.hdaDiskInterface.set(i.value))}),K(15,ole,2,2,"mat-option",37,Oe),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),_("input",function(i){k(e);let r=v(2);return r.onHdbImageInput(i),T(r.hdbDiskImage.set(i.target.value))})("focus",function(){k(e);let i=v(2);return T(i.refreshQemuImages())}),l(),s(24,"mat-autocomplete",52,2),_("optionSelected",function(i){k(e);let r=v(2);return T(r.hdbDiskImage.set(i.option.value))}),I(26,ale,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),_("selectionChange",function(i){k(e);let r=v(2);return T(r.hdbDiskInterface.set(i.value))}),K(31,sle,2,2,"mat-option",37,Oe),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),_("input",function(i){k(e);let r=v(2);return r.onHdcImageInput(i),T(r.hdcDiskImage.set(i.target.value))})("focus",function(){k(e);let i=v(2);return T(i.refreshQemuImages())}),l(),s(40,"mat-autocomplete",52,3),_("optionSelected",function(i){k(e);let r=v(2);return T(r.hdcDiskImage.set(i.option.value))}),I(42,cle,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),_("selectionChange",function(i){k(e);let r=v(2);return T(r.hdcDiskInterface.set(i.value))}),K(47,dle,2,2,"mat-option",37,Oe),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),_("input",function(i){k(e);let r=v(2);return r.onHddImageInput(i),T(r.hddDiskImage.set(i.target.value))})("focus",function(){k(e);let i=v(2);return T(i.refreshQemuImages())}),l(),s(56,"mat-autocomplete",52,4),_("optionSelected",function(i){k(e);let r=v(2);return T(r.hddDiskImage.set(i.option.value))}),I(58,ple,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),_("selectionChange",function(i){k(e);let r=v(2);return T(r.hddDiskInterface.set(i.value))}),K(63,ule,2,2,"mat-option",37,Oe),l()()()()}if(n&2){let e=ke(9),t=ke(25),i=ke(41),r=ke(57),a=v(2);m(7),C("value",a.hdaDiskImage())("matAutocomplete",e),m(3),A(a.filteredImages.length?10:-1),m(4),C("value",a.hdaDiskInterface()),m(),Y(a.diskInterfaces),m(8),C("value",a.hdbDiskImage())("matAutocomplete",t),m(3),A(a.filteredImages.length?26:-1),m(4),C("value",a.hdbDiskInterface()),m(),Y(a.diskInterfaces),m(8),C("value",a.hdcDiskImage())("matAutocomplete",i),m(3),A(a.filteredImages.length?42:-1),m(4),C("value",a.hdcDiskInterface()),m(),Y(a.diskInterfaces),m(8),C("value",a.hddDiskImage())("matAutocomplete",r),m(3),A(a.filteredImages.length?58:-1),m(4),C("value",a.hddDiskInterface()),m(),Y(a.diskInterfaces)}}function fle(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e.filename),m(),B(e.filename)}}function gle(n,o){if(n&1&&(s(0,"mat-optgroup",53),K(1,fle,2,2,"mat-option",37,jm),l()),n&2){let e=v(3);m(),Y(e.filteredGlobalImages)}}function _le(n,o){if(n&1){let e=z();s(0,"div",25)(1,"input",54,5),_("change",function(i){k(e);let r=v(2);return T(r.uploadCdromImageFile(i))}),l(),s(3,"button",55),_("click",function(){k(e);let i=ke(2);return T(i.click())}),d(4," Upload "),l(),s(5,"mat-form-field",38)(6,"mat-label"),d(7,"Image"),l(),s(8,"input",56),_("input",function(i){k(e);let r=v(2);return r.onCdromInput(i),T(r.cdromImage.set(i.target.value))})("focus",function(){k(e);let i=v(2);return T(i.refreshGlobalImages())}),l(),s(9,"mat-autocomplete",null,6),I(11,gle,3,0,"mat-optgroup",53),l()()()}if(n&2){let e=ke(10),t=v(2);m(8),C("value",t.cdromImage())("matAutocomplete",e),m(3),A(t.filteredGlobalImages.length?11:-1)}}function vle(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e.value),m(),mi("",e.name," (",e.value,")")}}function Cle(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.adapters.set(+i.target.value))}),l()(),s(5,"mat-form-field",31)(6,"mat-label"),d(7,"First port name"),l(),s(8,"input",58),_("input",function(i){k(e);let r=v(2);return T(r.firstPortName.set(i.target.value))}),l()(),s(9,"mat-form-field",31)(10,"mat-label"),d(11,"Name format"),l(),s(12,"input",59),_("input",function(i){k(e);let r=v(2);return T(r.portNameFormat.set(i.target.value))}),l()(),s(13,"mat-form-field",31)(14,"mat-label"),d(15,"Segment size"),l(),s(16,"input",60),_("input",function(i){k(e);let r=v(2);return T(r.portSegmentSize.set(+i.target.value))}),l()(),s(17,"mat-form-field",31)(18,"mat-label"),d(19,"Base MAC"),l(),s(20,"input",61),_("input",function(i){k(e);let r=v(2);return T(r.macAddress.set(i.target.value))}),l()(),s(21,"mat-form-field",31)(22,"mat-label"),d(23,"Type"),l(),s(24,"mat-select",36),_("selectionChange",function(i){k(e);let r=v(2);return T(r.networkType.set(i.value))}),K(25,vle,2,3,"mat-option",37,Gse),l()(),s(27,"button",62),_("click",function(){k(e);let i=v(2);return T(i.openCustomAdaptersDialog())}),d(28," Configure custom adapters "),l(),s(29,"mat-checkbox",46),_("change",function(i){k(e);let r=v(2);return T(r.replicateNetworkConnectionState.set(i.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(),Y(e.networkTypes),m(4),C("checked",e.replicateNetworkConnectionState())}}function xle(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e.filename),m(),B(e.filename)}}function ble(n,o){if(n&1&&(s(0,"mat-optgroup",53),K(1,xle,2,2,"mat-option",37,jm),l()),n&2){let e=v(3);m(),Y(e.filteredAdvancedImages)}}function yle(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e.filename),m(),B(e.filename)}}function Sle(n,o){if(n&1&&(s(0,"mat-optgroup",53),K(1,yle,2,2,"mat-option",37,jm),l()),n&2){let e=v(3);m(),Y(e.filteredAdvancedImages)}}function wle(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e.filename),m(),B(e.filename)}}function Mle(n,o){if(n&1&&(s(0,"mat-optgroup",53),K(1,wle,2,2,"mat-option",37,jm),l()),n&2){let e=v(3);m(),Y(e.filteredAdvancedImages)}}function kle(n,o){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),_("input",function(i){k(e);let r=v(3);return T(r.cpuThrottling.set(+i.target.value))}),l()()}if(n&2){let e=v(3);m(3),C("value",e.cpuThrottling())}}function Tle(n,o){if(n&1&&(s(0,"mat-option",37),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function Ele(n,o){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),_("change",function(i){k(e);let r=v(2);return T(r.uploadInitrdFile(i))}),l(),s(7,"button",55),_("click",function(){k(e);let i=ke(6);return T(i.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),_("input",function(i){k(e);let r=v(2);return r.onAdvancedInput(i),T(r.initrd.set(i.target.value))})("focus",function(){k(e);let i=v(2);return T(i.refreshQemuImages())}),l(),s(13,"mat-autocomplete",null,8),I(15,ble,3,0,"mat-optgroup",53),l()()(),s(16,"div",25)(17,"input",65,9),_("change",function(i){k(e);let r=v(2);return T(r.uploadKernelImageFile(i))}),l(),s(19,"button",55),_("click",function(){k(e);let i=ke(18);return T(i.click())}),d(20," Upload "),l(),s(21,"mat-form-field",38)(22,"mat-label"),d(23,"Kernel image"),l(),s(24,"input",67),_("input",function(i){k(e);let r=v(2);return r.onAdvancedInput(i),T(r.kernelImage.set(i.target.value))})("focus",function(){k(e);let i=v(2);return T(i.refreshQemuImages())}),l(),s(25,"mat-autocomplete",null,10),I(27,Sle,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),_("input",function(i){k(e);let r=v(2);return T(r.kernelCommandLine.set(i.target.value))}),l()()(),s(32,"div",63)(33,"h4",64),d(34,"Bios"),l(),s(35,"div",25)(36,"input",65,11),_("change",function(i){k(e);let r=v(2);return T(r.uploadBiosFile(i))}),l(),s(38,"button",55),_("click",function(){k(e);let i=ke(37);return T(i.click())}),d(39," Upload "),l(),s(40,"mat-form-field",38)(41,"mat-label"),d(42,"Bios image"),l(),s(43,"input",69),_("input",function(i){k(e);let r=v(2);return r.onAdvancedInput(i),T(r.biosImage.set(i.target.value))})("focus",function(){k(e);let i=v(2);return T(i.refreshQemuImages())}),l(),s(44,"mat-autocomplete",null,12),I(46,Mle,3,0,"mat-optgroup",53),l()()()(),s(47,"div",63)(48,"h4",64),d(49,"Optimization"),l(),s(50,"mat-checkbox",46),_("change",function(i){k(e);let r=v(2);return T(r.activateCpuThrottling.set(i.checked))}),d(51,"Activate CPU throttling"),l(),I(52,kle,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),_("selectionChange",function(i){k(e);let r=v(2);return T(r.processPriority.set(i.value))}),K(57,Tle,2,2,"mat-option",37,Oe),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),_("input",function(i){k(e);let r=v(2);return T(r.qemuPath.set(i.target.value))}),l()(),s(66,"mat-form-field",31)(67,"mat-label"),d(68,"Options"),l(),s(69,"input",71),_("input",function(i){k(e);let r=v(2);return T(r.options.set(i.target.value))}),l()(),s(70,"mat-checkbox",46),_("change",function(i){k(e);let r=v(2);return T(r.linkedClone.set(i.checked))}),d(71,"Use as a linked base VM"),l(),s(72,"mat-checkbox",46),_("change",function(i){k(e);let r=v(2);return T(r.tpm.set(i.checked))}),d(73,"Enable the Trusted Platform Module (TPM)"),l(),s(74,"mat-checkbox",46),_("change",function(i){k(e);let r=v(2);return T(r.uefi.set(i.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),_("input",function(i){k(e);let r=v(2);return T(r.maxcpus.set(+i.target.value))}),l()(),s(81,"mat-checkbox",46),_("change",function(i){k(e);let r=v(2);return T(r.createConfigDisk.set(i.checked))}),d(82,"Auto-create config disk"),l()()()()}if(n&2){let e=ke(14),t=ke(26),i=ke(45),r=v(2);m(12),C("value",r.initrd())("matAutocomplete",e),m(3),A(r.filteredAdvancedImages.length?15:-1),m(9),C("value",r.kernelImage())("matAutocomplete",t),m(3),A(r.filteredAdvancedImages.length?27:-1),m(4),C("value",r.kernelCommandLine()),m(12),C("value",r.biosImage())("matAutocomplete",i),m(3),A(r.filteredAdvancedImages.length?46:-1),m(4),C("checked",r.activateCpuThrottling()),m(2),A(r.activateCpuThrottling()?52:-1),m(4),C("value",r.processPriority()),m(),Y(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 Dle(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.usage.set(i.target.value))}),l()()()}if(n&2){let e=v(2);m(4),C("value",e.usage())}}function Ple(n,o){if(n&1){let e=z();s(0,"main",17)(1,"section",19)(2,"div",20),_("click",function(){k(e);let i=v();return T(i.toggleSection("general"))}),s(3,"h3",21),d(4,"General settings"),l(),s(5,"mat-icon",22),d(6),l()(),I(7,tle,75,14,"form",23),l(),s(8,"section",19)(9,"div",20),_("click",function(){k(e);let i=v();return T(i.toggleSection("hdd"))}),s(10,"h3",21),d(11,"HDD"),l(),s(12,"mat-icon",22),d(13),l()(),I(14,hle,65,16,"div",24),l(),s(15,"section",19)(16,"div",20),_("click",function(){k(e);let i=v();return T(i.toggleSection("cddvd"))}),s(17,"h3",21),d(18,"CD/DVD"),l(),s(19,"mat-icon",22),d(20),l()(),I(21,_le,12,3,"div",25),l(),s(22,"section",19)(23,"div",20),_("click",function(){k(e);let i=v();return T(i.toggleSection("network"))}),s(24,"h3",21),d(25,"Network"),l(),s(26,"mat-icon",22),d(27),l()(),I(28,Cle,31,7,"form",23),l(),s(29,"section",19)(30,"div",20),_("click",function(){k(e);let i=v();return T(i.toggleSection("advanced"))}),s(31,"h3",21),d(32,"Advanced"),l(),s(33,"mat-icon",22),d(34),l()(),I(35,Ele,83,20,"div",23),l(),s(36,"section",19)(37,"div",20),_("click",function(){k(e);let i=v();return T(i.toggleSection("usage"))}),s(38,"h3",21),d(39,"Usage"),l(),s(40,"mat-icon",22),d(41),l()(),I(42,Dle,5,1,"div",26),l(),s(43,"div",27)(44,"button",28),_("click",function(){k(e);let i=v();return T(i.goBack())}),d(45,"Cancel"),l(),s(46,"button",29),_("click",function(){k(e);let i=v();return T(i.onSave())}),d(47,"Save"),l()()()}if(n&2){let e=v();m(6),B(e.generalSettingsExpanded?"expand_less":"expand_more"),m(),A(e.generalSettingsExpanded?7:-1),m(6),B(e.hddExpanded?"expand_less":"expand_more"),m(),A(e.hddExpanded?14:-1),m(6),B(e.cdDvdExpanded?"expand_less":"expand_more"),m(),A(e.cdDvdExpanded?21:-1),m(6),B(e.networkExpanded?"expand_less":"expand_more"),m(),A(e.networkExpanded?28:-1),m(6),B(e.advancedExpanded?"expand_less":"expand_more"),m(),A(e.advancedExpanded?35:-1),m(6),B(e.usageExpanded?"expand_less":"expand_more"),m(),A(e.usageExpanded?42:-1)}}var Hb=(()=>{class n{route=f(lt);controllerService=f(nt);qemuService=f(na);toasterService=f(ie);configurationService=f(zm);router=f(_t);cd=f(X);dialog=f(it);dialogConfig=f(go);validationService=f(SP);imageManagerService=f(Wc);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(i=>{this.controller=i,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()}})},i=>{let r=i.error?.message||i.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 i=e.name;this.imageManagerService.uploadedImage(this.controller,!1,i,e).subscribe({next:()=>{t.set(i),this.refreshGlobalImages(),this.toasterService.success(`Uploaded ${i}`),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((i,r,a)=>a.findIndex(c=>c.filename===i.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,i=this.networkType()||"e1000",r=this.adapters(),a=this.qemuTemplate.custom_adapters||[],c=[];for(let u=0;u<r;u++){let h=a.find(g=>g.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 g;if(t>0){let y=Math.floor(u/t),b=u%t;g=e.replace("{0}",String(y*t+b))}else g=e.replace("{0}",String(u));c.push({adapter_number:u,adapter_type:i,port_name:g,mac_address:""})}}this.dialog.open(Gc,{panelClass:"custom-adapters-dialog-panel",data:{adapters:c,networkTypes:this.networkTypes,portNameFormat:e,portSegmentSize:t,defaultAdapterType:i,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(),i=this.globalImages.filter(r=>r.filename.toLowerCase().includes(t));this.filteredGlobalImages=i}onAdvancedInput(e){let t=e.target.value.toLowerCase();this.filteredAdvancedImages=this.qemuImages.filter(i=>i.filename.toLowerCase().includes(t))}filterImages(e){let t=e.target.value.toLowerCase();return this.qemuImages.filter(i=>i.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 i=this.validationService.validateFirstPortName(this.firstPortName());if(!i.isValid){this.toasterService.error(i.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(Jr,e).afterClosed().subscribe(i=>{i&&this.symbol.set(i)})}addTag(e){let t=(e.value||"").trim(),i=this.tags();t&&this.tags.set([...i,t]),e.chipInput&&e.chipInput.clear()}removeTag(e){let t=this.tags(),i=t.indexOf(e);if(i>=0){let r=[...t];r.splice(i,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,i){t&1&&(s(0,"div",13)(1,"header",14),I(2,qse,3,0,"button",15),s(3,"h1",16),d(4,"QEMU VM template configuration"),l()(),I(5,Ple,48,12,"main",17),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.qemuTemplate?5:-1))},dependencies:[ne,Je,rt,ot,Gn,dt,oe,de,G,pe,ze,we,Me,Xe,Ti,Se,Te,gt,Pt,ft,BC,oi,ei,Ci,xi,hi,Lt,qt,lr,Dr,So],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 Ile=(n,o)=>o.template_id;function Ale(n,o){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 Ole(n,o){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 Nle(n,o){n&1&&R(0,"app-empty-templates-list")}function Fle(n,o){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),_("click",function(i){return i.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),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.copyTemplate(i))}),s(16,"mat-icon"),d(17,"content_copy"),l(),s(18,"span"),d(19,"Copy"),l()(),s(20,"button",16),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.deleteTemplate(i))}),s(21,"mat-icon"),d(22,"delete"),l(),s(23,"span"),d(24,"Delete"),l()()()()}if(n&2){let e=o.$implicit,t=ke(9);C("routerLink",e.template_id),m(4),B(e.name),m(),C("matMenuTriggerFor",t),m(5),C("routerLink",e.template_id)}}function Rle(n,o){if(n&1&&(s(0,"nav",8),K(1,Fle,25,4,"div",10,Ile),l()),n&2){let e=v();m(),Y(e.qemuTemplates)}}var Ub=(()=>{class n{route=f(lt);controllerService=f(nt);qemuService=f(na);toasterService=f(ie);router=f(_t);cd=f(X);controller;qemuTemplates=[];deleteComponent=Rt(Vi);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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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,i){t&1&&Xt(i.deleteComponent,Vi,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,i){t&1&&(s(0,"div",2)(1,"header",3),I(2,Ale,3,1,"button",4),s(3,"h1",5),d(4,"QEMU VM templates"),l(),I(5,Ole,3,1,"button",6),l(),s(6,"main",7),I(7,Nle,1,0,"app-empty-templates-list"),I(8,Rle,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),_("deleteEvent",function(){return i.onDeleteEvent()}),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.controller?5:-1),m(2),A(i.qemuTemplates.length?-1:7),m(),A(i.qemuTemplates.length?8:-1),m(),C("controller",i.controller))},dependencies:[ne,dt,vn,G,ze,oe,de,eo,qe,Kn,tt,Fn,ht,Mt,Vi,ta],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 $m=(()=>{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=te({token:n,factory:n.\u0275fac})}return n})();function Lle(n,o){if(n&1){let e=z();s(0,"button",14),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}var Wb=(()=>{class n{route=f(lt);controllerService=f(nt);vpcsService=f($m);router=f(_t);toasterService=f(ie);templateMocksService=f(Ma);formBuilder=f(Bn);computeService=f(Eo);cd=f(X);controller;templateName="";templateNameForm;isLocalComputerChosen=!0;constructor(){this.templateNameForm=this.formBuilder.group({templateName:new $e(null,[je.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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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=Li(),t.name=this.templateName,t.compute_id="local",this.vpcsService.addTemplate(this.controller,t).subscribe({next:()=>{this.goBack()},error:i=>{let r=i.error?.message||i.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,i){t&1&&(s(0,"div",0)(1,"header",1),I(2,Lle,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),_("click",function(){return i.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),_("click",function(){return i.goBack()}),d(17,"Cancel"),l(),s(18,"button",13),_("click",function(){return i.addTemplate()}),d(19," Add template "),l()()()()),t&2&&(m(2),A(i.controller?2:-1),m(6),C("checked",!0),m(2),C("formGroup",i.templateNameForm))},dependencies:[ne,Je,rt,Nt,Dt,ot,Et,Ft,Vt,dt,oe,de,G,pe,ze,kt,oo,yo,fo,we,Me,Xe,Se,Te],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 Hm=(()=>{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=te({token:n,factory:n.\u0275fac})}return n})();function Vle(n,o){if(n&1){let e=z();s(0,"button",6),_("click",function(){k(e);let i=v();return T(i.goBack())}),s(1,"mat-icon"),d(2,"arrow_back"),l()()}}function Ble(n,o){if(n&1){let e=z();s(0,"mat-chip",28),_("removed",function(){let i=k(e).$implicit,r=v(2);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",29),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function zle(n,o){if(n&1&&(s(0,"mat-option",20),d(1),l()),n&2){let e=o.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function jle(n,o){if(n&1&&(s(0,"mat-option",20),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function $le(n,o){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),_("input",function(i){k(e);let r=v();return T(r.templateName.set(i.target.value))}),l()(),s(9,"mat-form-field",10)(10,"mat-label"),d(11,"Default name format"),l(),s(12,"input",12),_("input",function(i){k(e);let r=v();return T(r.defaultName.set(i.target.value))}),l()(),s(13,"mat-form-field",10)(14,"mat-label"),d(15,"Base script file"),l(),s(16,"input",13),_("input",function(i){k(e);let r=v();return T(r.scriptFile.set(i.target.value))}),l()(),s(17,"div",14)(18,"mat-form-field",15)(19,"mat-label"),d(20,"Symbol"),l(),s(21,"input",16),_("input",function(i){k(e);let r=v();return T(r.symbol.set(i.target.value))}),l()(),s(22,"button",17),_("click",function(){k(e);let i=v();return T(i.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),K(29,Ble,4,1,"mat-chip",null,Oe),l(),s(31,"input",18),_("matChipInputTokenEnd",function(i){k(e);let r=v();return T(r.addTag(i))}),l()(),s(32,"mat-form-field",10)(33,"mat-label"),d(34,"Category"),l(),s(35,"mat-select",19),_("selectionChange",function(i){k(e);let r=v();return T(r.category.set(i.value))}),K(36,zle,2,2,"mat-option",20,Ni),l()(),s(38,"mat-form-field",10)(39,"mat-label"),d(40,"Console type"),l(),s(41,"mat-select",19),_("selectionChange",function(i){k(e);let r=v();return T(r.consoleType.set(i.value))}),K(42,jle,2,2,"mat-option",20,Oe),l()(),s(44,"mat-checkbox",21),_("change",function(i){k(e);let r=v();return T(r.consoleAutoStart.set(i.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),_("input",function(i){k(e);let r=v();return T(r.usage.set(i.target.value))}),l()()()(),s(54,"div",25)(55,"button",26),_("click",function(){k(e);let i=v();return T(i.goBack())}),d(56,"Cancel"),l(),s(57,"button",27),_("click",function(){k(e);let i=v();return T(i.onSave())}),d(58,"Save"),l()()()}if(n&2){let e=ke(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),Y(t.tags()),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.category()),m(),Y(t.categories),m(5),C("value",t.consoleType()),m(),Y(t.consoleTypes),m(2),C("checked",t.consoleAutoStart()),m(9),C("value",t.usage())}}var Gb=(()=>{class n{route=f(lt);controllerService=f(nt);vpcsService=f($m);toasterService=f(ie);vpcsConfigurationService=f(Hm);router=f(_t);cd=f(X);dialog=f(it);dialogConfig=f(go);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(i=>{this.controller=i,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()}})},i=>{let r=i.error?.message||i.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(Jr,e).afterClosed().subscribe(i=>{i&&this.symbol.set(i)})}addTag(e){let t=(e.value||"").trim(),i=this.tags();t&&this.tags.set([...i,t]),e.chipInput&&e.chipInput.clear()}removeTag(e){let t=this.tags(),i=t.indexOf(e);if(i>=0){let r=[...t];r.splice(i,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,i){t&1&&(s(0,"div",1)(1,"header",2),I(2,Vle,3,0,"button",3),s(3,"h1",4),d(4,"VPCS node template configuration"),l()(),I(5,$le,59,10,"main",5),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.vpcsTemplate?5:-1))},dependencies:[ne,Je,rt,ot,Gn,dt,oe,de,G,pe,ze,kt,we,Me,Xe,Se,Te,gt,Pt,ft,Lt,qt,oi,ei,Ci,xi,hi],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 Hle=(n,o)=>o.template_id;function Ule(n,o){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 Wle(n,o){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 Gle(n,o){n&1&&R(0,"app-empty-templates-list")}function qle(n,o){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),_("click",function(i){return i.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),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.deleteTemplate(i))}),s(16,"mat-icon"),d(17,"delete"),l(),s(18,"span"),d(19,"Delete"),l()()()()}if(n&2){let e=o.$implicit,t=ke(9);C("routerLink",e.template_id),m(4),B(e.name),m(),C("matMenuTriggerFor",t),m(5),C("routerLink",e.template_id)}}function Qle(n,o){if(n&1&&(s(0,"nav",8),K(1,qle,20,4,"div",10,Hle),l()),n&2){let e=v();m(),Y(e.vpcsTemplates)}}var qb=(()=>{class n{route=f(lt);controllerService=f(nt);vpcsService=f($m);toasterService=f(ie);cd=f(X);controller;vpcsTemplates=[];deleteComponent=Rt(Vi);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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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,i){t&1&&Xt(i.deleteComponent,Vi,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,i){t&1&&(s(0,"div",2)(1,"header",3),I(2,Ule,3,1,"button",4),s(3,"h1",5),d(4,"VPCS node templates"),l(),I(5,Wle,3,1,"button",6),l(),s(6,"main",7),I(7,Gle,1,0,"app-empty-templates-list"),I(8,Qle,3,0,"nav",8),l()(),s(9,"app-delete-template",9,0),_("deleteEvent",function(){return i.onDeleteEvent()}),l()),t&2&&(m(2),A(i.controller?2:-1),m(3),A(i.controller?5:-1),m(2),A(i.vpcsTemplates.length?-1:7),m(),A(i.vpcsTemplates.length?8:-1),m(),C("controller",i.controller))},dependencies:[ne,dt,vn,G,ze,oe,de,eo,qe,Kn,tt,Fn,ht,Mt,Vi,ta],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 Xle(n,o){}var aL="_mat-bottom-sheet-enter",sL="_mat-bottom-sheet-exit",Kle=(()=>{class n extends W4{_breakpointSubscription;_animationsDisabled=er();_animationState="void";_animationStateChanged=new _e;_destroyed=!1;constructor(){super();let e=f(AC);this._breakpointSubscription=e.observe([vd.Medium,vd.Large,vd.XLarge]).subscribe(()=>{let t=this._elementRef.nativeElement.classList;t.toggle("mat-bottom-sheet-container-medium",e.isMatched(vd.Medium)),t.toggle("mat-bottom-sheet-container-large",e.isMatched(vd.Large)),t.toggle("mat-bottom-sheet-container-xlarge",e.isMatched(vd.XLarge))})}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._animationsDisabled&&this._simulateAnimation(aL))}exit(){this._destroyed||(this._elementRef.nativeElement.setAttribute("mat-exit",""),this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._animationsDisabled&&this._simulateAnimation(sL))}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 i=t===aL;(i||t===sL)&&this._animationStateChanged.emit({toState:i?"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,i){t&1&&_("animationstart",function(a){return i._handleAnimationEvent(!0,a.animationName)})("animationend",function(a){return i._handleAnimationEvent(!1,a.animationName)})("animationcancel",function(a){return i._handleAnimationEvent(!1,a.animationName)}),t&2&&(Qt("role",i._config.role)("aria-modal",i._config.ariaModal)("aria-label",i._config.ariaLabel),Ae("mat-bottom-sheet-container-animations-enabled",!i._animationsDisabled)("mat-bottom-sheet-container-enter",i._animationState==="visible")("mat-bottom-sheet-container-exit",i._animationState==="hidden"))},features:[di],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,i){t&1&&Ce(0,Xle,0,0,"ng-template",0)},dependencies:[Zu],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})(),DP=new cn("MatBottomSheetData"),EP=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},Um=class{_ref;get instance(){return this._ref.componentInstance}get componentRef(){return this._ref.componentRef}containerInstance;disableClose;_afterOpened=new We;_result;_closeFallbackTimeout;constructor(o,e,t){this._ref=o,this.containerInstance=t,this.disableClose=e.disableClose,t._animationStateChanged.pipe(ci(i=>i.phase==="done"&&i.toState==="visible"),Fo(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(ci(i=>i.phase==="done"&&i.toState==="hidden"),Fo(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._ref.close(this._result)}),o.overlayRef.detachments().subscribe(()=>{this._ref.close(this._result)}),Wn(this.backdropClick(),this.keydownEvents().pipe(ci(i=>i.keyCode===27))).subscribe(i=>{!this.disableClose&&(i.type!=="keydown"||!xa(i))&&(i.preventDefault(),this.dismiss())})}dismiss(o){this.containerInstance&&(this.containerInstance._animationStateChanged.pipe(ci(e=>e.phase==="start"),Fo(1)).subscribe(()=>{this._closeFallbackTimeout=setTimeout(()=>this._ref.close(this._result),500),this._ref.overlayRef.detachBackdrop()}),this._result=o,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}},Yle=new cn("mat-bottom-sheet-default-options"),ec=(()=>{class n{_injector=f(rr);_parentBottomSheet=f(n,{optional:!0,skipSelf:!0});_animationsDisabled=er();_defaultOptions=f(Yle,{optional:!0});_bottomSheetRefAtThisLevel=null;_dialog=f(q4);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 i=Z(Z({},this._defaultOptions||new EP),t),r;return this._dialog.open(e,Ye(Z({},i),{disableClose:!0,closeOnOverlayDetachments:!1,maxWidth:"100%",container:Kle,scrollStrategy:i.scrollStrategy||y4(this._injector),positionStrategy:S4(this._injector).centerHorizontally().bottom("0"),disableAnimations:this._animationsDisabled,templateContext:()=>({bottomSheetRef:r}),providers:(a,c,p)=>(r=new Um(a,i,p),[{provide:Um,useValue:r},{provide:DP,useValue:i.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=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),qc=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({providers:[ec],imports:[Q4,Ju,_i]})}return n})();var Jle=(n,o)=>o==null?null:o.name;function ece(n,o){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e==null?null:e.name)}}function tce(n,o){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function nce(n,o){if(n&1){let e=z();s(0,"form",1),_("ngSubmit",function(){k(e);let i=v();return T(i.export_project_form.valid&&i.exportPortableProject())}),s(1,"div",2)(2,"h1",3),d(3,"Export Project"),l(),s(4,"button",4),_("click",function(){k(e);let i=v();return T(i.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),_("selectionChange",function(i){k(e);let r=v();return T(r.selectCompression(i))}),K(14,ece,2,2,"mat-option",10,Jle),l()()(),s(16,"div",6)(17,"span",7),d(18,"Compression level:"),l(),s(19,"mat-form-field",8)(20,"mat-select",11),K(21,tce,2,2,"mat-option",10,Oe),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),_("click",function(){k(e);let i=v();return T(i.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),Y(e.compression_methods),m(7),Y(e.compression_filter_value),m(18),C("disabled",e.isExport())}}var cf=(()=>{class n{data;export_project_form;chosenImage="";compression_methods=[];compression_level=[];compression_filter_value=[];controller;project;index=4;fileName;isExport=Q(!1);dialogRef=f(Ie);projectService=f(Ei);_fb=f(Bn);destroyRef=f(Ms);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:["",je.required],compression_level:[""],include_base_image:[!1,je.required],include_snapshots:[!1,je.required],reset_mac_address:[!1,je.required]})}selectCompression(e){let t=this.compression_level.find(i=>e.value.value===i.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,i=Ye(Z({},e),{compression:t??"zstd"});window.location.assign(this.projectService.getexportPortableProjectPath(this.controller,this.project.project_id,i)),this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)(at(Ct))};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,i){t&1&&I(0,nce,41,2,"form",0),t&2&&A(i.export_project_form?0:-1)},dependencies:[ne,Et,rt,Dt,ot,I4,Ft,Vt,ve,G,pe,ze,oe,de,we,Me,Se,gt,Pt,ft,Lt,qt,yr,qr],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 Wd=Gs(lL());var Xb="http://www.w3.org/1999/xhtml",PP={svg:"http://www.w3.org/2000/svg",xhtml:Xb,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Od(n){var o=n+="",e=o.indexOf(":");return e>=0&&(o=n.slice(0,e))!=="xmlns"&&(n=n.slice(e+1)),PP.hasOwnProperty(o)?{space:PP[o],local:n}:n}function ice(n){return function(){var o=this.ownerDocument,e=this.namespaceURI;return e===Xb&&o.documentElement.namespaceURI===Xb?o.createElement(n):o.createElementNS(e,n)}}function oce(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Kb(n){var o=Od(n);return(o.local?oce:ice)(o)}function rce(){}function xu(n){return n==null?rce:function(){return this.querySelector(n)}}function cL(n){typeof n!="function"&&(n=xu(n));for(var o=this._groups,e=o.length,t=new Array(e),i=0;i<e;++i)for(var r=o[i],a=r.length,c=t[i]=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 cr(t,this._parents)}function IP(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function ace(){return[]}function U0(n){return n==null?ace:function(){return this.querySelectorAll(n)}}function sce(n){return function(){return IP(n.apply(this,arguments))}}function dL(n){typeof n=="function"?n=sce(n):n=U0(n);for(var o=this._groups,e=o.length,t=[],i=[],r=0;r<e;++r)for(var a=o[r],c=a.length,p,u=0;u<c;++u)(p=a[u])&&(t.push(n.call(p,p.__data__,u,a)),i.push(p));return new cr(t,i)}function W0(n){return function(){return this.matches(n)}}function Yb(n){return function(o){return o.matches(n)}}var lce=Array.prototype.find;function cce(n){return function(){return lce.call(this.children,n)}}function dce(){return this.firstElementChild}function mL(n){return this.select(n==null?dce:cce(typeof n=="function"?n:Yb(n)))}var mce=Array.prototype.filter;function pce(){return Array.from(this.children)}function uce(n){return function(){return mce.call(this.children,n)}}function pL(n){return this.selectAll(n==null?pce:uce(typeof n=="function"?n:Yb(n)))}function uL(n){typeof n!="function"&&(n=W0(n));for(var o=this._groups,e=o.length,t=new Array(e),i=0;i<e;++i)for(var r=o[i],a=r.length,c=t[i]=[],p,u=0;u<a;++u)(p=r[u])&&n.call(p,p.__data__,u,r)&&c.push(p);return new cr(t,this._parents)}function Zb(n){return new Array(n.length)}function hL(){return new cr(this._enter||this._groups.map(Zb),this._parents)}function G0(n,o){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=o}G0.prototype={constructor:G0,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,o){return this._parent.insertBefore(n,o)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};function fL(n){return function(){return n}}function hce(n,o,e,t,i,r){for(var a=0,c,p=o.length,u=r.length;a<u;++a)(c=o[a])?(c.__data__=r[a],t[a]=c):e[a]=new G0(n,r[a]);for(;a<p;++a)(c=o[a])&&(i[a]=c)}function fce(n,o,e,t,i,r,a){var c,p,u=new Map,h=o.length,g=r.length,y=new Array(h),b;for(c=0;c<h;++c)(p=o[c])&&(y[c]=b=a.call(p,p.__data__,c,o)+"",u.has(b)?i[c]=p:u.set(b,p));for(c=0;c<g;++c)b=a.call(n,r[c],c,r)+"",(p=u.get(b))?(t[c]=p,p.__data__=r[c],u.delete(b)):e[c]=new G0(n,r[c]);for(c=0;c<h;++c)(p=o[c])&&u.get(y[c])===p&&(i[c]=p)}function gce(n){return n.__data__}function gL(n,o){if(!arguments.length)return Array.from(this,gce);var e=o?fce:hce,t=this._parents,i=this._groups;typeof n!="function"&&(n=fL(n));for(var r=i.length,a=new Array(r),c=new Array(r),p=new Array(r),u=0;u<r;++u){var h=t[u],g=i[u],y=g.length,b=_ce(n.call(h,h&&h.__data__,u,t)),x=b.length,M=c[u]=new Array(x),w=a[u]=new Array(x),S=p[u]=new Array(y);e(h,g,M,w,S,b,o);for(var E=0,O=0,D,N;E<x;++E)if(D=M[E]){for(E>=O&&(O=E+1);!(N=w[O])&&++O<x;);D._next=N||null}}return a=new cr(a,t),a._enter=c,a._exit=p,a}function _ce(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function _L(){return new cr(this._exit||this._groups.map(Zb),this._parents)}function vL(n,o,e){var t=this.enter(),i=this,r=this.exit();return typeof n=="function"?(t=n(t),t&&(t=t.selection())):t=t.append(n+""),o!=null&&(i=o(i),i&&(i=i.selection())),e==null?r.remove():e(r),t&&i?t.merge(i).order():i}function CL(n){for(var o=n.selection?n.selection():n,e=this._groups,t=o._groups,i=e.length,r=t.length,a=Math.min(i,r),c=new Array(i),p=0;p<a;++p)for(var u=e[p],h=t[p],g=u.length,y=c[p]=new Array(g),b,x=0;x<g;++x)(b=u[x]||h[x])&&(y[x]=b);for(;p<i;++p)c[p]=e[p];return new cr(c,this._parents)}function xL(){for(var n=this._groups,o=-1,e=n.length;++o<e;)for(var t=n[o],i=t.length-1,r=t[i],a;--i>=0;)(a=t[i])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function bL(n){n||(n=vce);function o(g,y){return g&&y?n(g.__data__,y.__data__):!g-!y}for(var e=this._groups,t=e.length,i=new Array(t),r=0;r<t;++r){for(var a=e[r],c=a.length,p=i[r]=new Array(c),u,h=0;h<c;++h)(u=a[h])&&(p[h]=u);p.sort(o)}return new cr(i,this._parents).order()}function vce(n,o){return n<o?-1:n>o?1:n>=o?0:NaN}function yL(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function SL(){return Array.from(this)}function wL(){for(var n=this._groups,o=0,e=n.length;o<e;++o)for(var t=n[o],i=0,r=t.length;i<r;++i){var a=t[i];if(a)return a}return null}function ML(){let n=0;for(let o of this)++n;return n}function kL(){return!this.node()}function TL(n){for(var o=this._groups,e=0,t=o.length;e<t;++e)for(var i=o[e],r=0,a=i.length,c;r<a;++r)(c=i[r])&&n.call(c,c.__data__,r,i);return this}function Cce(n){return function(){this.removeAttribute(n)}}function xce(n){return function(){this.removeAttributeNS(n.space,n.local)}}function bce(n,o){return function(){this.setAttribute(n,o)}}function yce(n,o){return function(){this.setAttributeNS(n.space,n.local,o)}}function Sce(n,o){return function(){var e=o.apply(this,arguments);e==null?this.removeAttribute(n):this.setAttribute(n,e)}}function wce(n,o){return function(){var e=o.apply(this,arguments);e==null?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}}function EL(n,o){var e=Od(n);if(arguments.length<2){var t=this.node();return e.local?t.getAttributeNS(e.space,e.local):t.getAttribute(e)}return this.each((o==null?e.local?xce:Cce:typeof o=="function"?e.local?wce:Sce:e.local?yce:bce)(e,o))}function Jb(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function Mce(n){return function(){this.style.removeProperty(n)}}function kce(n,o,e){return function(){this.style.setProperty(n,o,e)}}function Tce(n,o,e){return function(){var t=o.apply(this,arguments);t==null?this.style.removeProperty(n):this.style.setProperty(n,t,e)}}function DL(n,o,e){return arguments.length>1?this.each((o==null?Mce:typeof o=="function"?Tce:kce)(n,o,e??"")):Wm(this.node(),n)}function Wm(n,o){return n.style.getPropertyValue(o)||Jb(n).getComputedStyle(n,null).getPropertyValue(o)}function Ece(n){return function(){delete this[n]}}function Dce(n,o){return function(){this[n]=o}}function Pce(n,o){return function(){var e=o.apply(this,arguments);e==null?delete this[n]:this[n]=e}}function PL(n,o){return arguments.length>1?this.each((o==null?Ece:typeof o=="function"?Pce:Dce)(n,o)):this.node()[n]}function IL(n){return n.trim().split(/^|\s+/)}function AP(n){return n.classList||new AL(n)}function AL(n){this._node=n,this._names=IL(n.getAttribute("class")||"")}AL.prototype={add:function(n){var o=this._names.indexOf(n);o<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var o=this._names.indexOf(n);o>=0&&(this._names.splice(o,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function OL(n,o){for(var e=AP(n),t=-1,i=o.length;++t<i;)e.add(o[t])}function NL(n,o){for(var e=AP(n),t=-1,i=o.length;++t<i;)e.remove(o[t])}function Ice(n){return function(){OL(this,n)}}function Ace(n){return function(){NL(this,n)}}function Oce(n,o){return function(){(o.apply(this,arguments)?OL:NL)(this,n)}}function FL(n,o){var e=IL(n+"");if(arguments.length<2){for(var t=AP(this.node()),i=-1,r=e.length;++i<r;)if(!t.contains(e[i]))return!1;return!0}return this.each((typeof o=="function"?Oce:o?Ice:Ace)(e,o))}function Nce(){this.textContent=""}function Fce(n){return function(){this.textContent=n}}function Rce(n){return function(){var o=n.apply(this,arguments);this.textContent=o??""}}function RL(n){return arguments.length?this.each(n==null?Nce:(typeof n=="function"?Rce:Fce)(n)):this.node().textContent}function Lce(){this.innerHTML=""}function Vce(n){return function(){this.innerHTML=n}}function Bce(n){return function(){var o=n.apply(this,arguments);this.innerHTML=o??""}}function LL(n){return arguments.length?this.each(n==null?Lce:(typeof n=="function"?Bce:Vce)(n)):this.node().innerHTML}function zce(){this.nextSibling&&this.parentNode.appendChild(this)}function VL(){return this.each(zce)}function jce(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function BL(){return this.each(jce)}function zL(n){var o=typeof n=="function"?n:Kb(n);return this.select(function(){return this.appendChild(o.apply(this,arguments))})}function $ce(){return null}function jL(n,o){var e=typeof n=="function"?n:Kb(n),t=o==null?$ce:typeof o=="function"?o:xu(o);return this.select(function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)})}function Hce(){var n=this.parentNode;n&&n.removeChild(this)}function $L(){return this.each(Hce)}function Uce(){var n=this.cloneNode(!1),o=this.parentNode;return o?o.insertBefore(n,this.nextSibling):n}function Wce(){var n=this.cloneNode(!0),o=this.parentNode;return o?o.insertBefore(n,this.nextSibling):n}function HL(n){return this.select(n?Wce:Uce)}function UL(n){return arguments.length?this.property("__data__",n):this.node().__data__}function Gce(n){return function(o){n.call(this,o,this.__data__)}}function qce(n){return n.trim().split(/^|\s+/).map(function(o){var e="",t=o.indexOf(".");return t>=0&&(e=o.slice(t+1),o=o.slice(0,t)),{type:o,name:e}})}function Qce(n){return function(){var o=this.__on;if(o){for(var e=0,t=-1,i=o.length,r;e<i;++e)r=o[e],(!n.type||r.type===n.type)&&r.name===n.name?this.removeEventListener(r.type,r.listener,r.options):o[++t]=r;++t?o.length=t:delete this.__on}}}function Xce(n,o,e){return function(){var t=this.__on,i,r=Gce(o);if(t){for(var a=0,c=t.length;a<c;++a)if((i=t[a]).type===n.type&&i.name===n.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=e),i.value=o;return}}this.addEventListener(n.type,r,e),i={type:n.type,name:n.name,value:o,listener:r,options:e},t?t.push(i):this.__on=[i]}}function WL(n,o,e){var t=qce(n+""),i,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(i=0,h=c[p];i<r;++i)if((a=t[i]).type===h.type&&a.name===h.name)return h.value}return}for(c=o?Xce:Qce,i=0;i<r;++i)this.each(c(t[i],o,e));return this}function GL(n,o,e){var t=Jb(n),i=t.CustomEvent;typeof i=="function"?i=new i(o,e):(i=t.document.createEvent("Event"),e?(i.initEvent(o,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(o,!1,!1)),n.dispatchEvent(i)}function Kce(n,o){return function(){return GL(this,n,o)}}function Yce(n,o){return function(){return GL(this,n,o.apply(this,arguments))}}function qL(n,o){return this.each((typeof o=="function"?Yce:Kce)(n,o))}function*QL(){for(var n=this._groups,o=0,e=n.length;o<e;++o)for(var t=n[o],i=0,r=t.length,a;i<r;++i)(a=t[i])&&(yield a)}var OP=[null];function cr(n,o){this._groups=n,this._parents=o}function XL(){return new cr([[document.documentElement]],OP)}function Zce(){return this}cr.prototype=XL.prototype={constructor:cr,select:cL,selectAll:dL,selectChild:mL,selectChildren:pL,filter:uL,data:gL,enter:hL,exit:_L,join:vL,merge:CL,selection:Zce,order:xL,sort:bL,call:yL,nodes:SL,node:wL,size:ML,empty:kL,each:TL,attr:EL,style:DL,property:PL,classed:FL,text:RL,html:LL,raise:VL,lower:BL,append:zL,insert:jL,remove:$L,clone:HL,datum:UL,on:WL,dispatch:qL,[Symbol.iterator]:QL};var Nd=XL;function Ut(n){return typeof n=="string"?new cr([[document.querySelector(n)]],[document.documentElement]):new cr([[n]],OP)}function KL(n){let o;for(;o=n.sourceEvent;)n=o;return n}function Pr(n,o){if(n=KL(n),o===void 0&&(o=n.currentTarget),o){var e=o.ownerSVGElement||o;if(e.createSVGPoint){var t=e.createSVGPoint();return t.x=n.clientX,t.y=n.clientY,t=t.matrixTransform(o.getScreenCTM().inverse()),[t.x,t.y]}if(o.getBoundingClientRect){var i=o.getBoundingClientRect();return[n.clientX-i.left-o.clientLeft,n.clientY-i.top-o.clientTop]}}return[n.pageX,n.pageY]}var _o=(()=>{class n{symbolScalingSubject=new We;isScrollDisabled=new We;isMapLocked=new We;isTopologySummaryVisible=!0;isLogConsoleVisible=!1;isLayerNumberVisible=!1;isItemLockStatusVisible=!1;logConsoleSubject=new We;mapRenderedEmitter=new _e;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=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Ml=(()=>{class n{isSelectionToolActivated=new We;isMovingToolActivated=new We;isTextEditingToolActivated=new We;isTextAddingToolActivated=new We;isDrawLinkToolActivated=new We;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=te({token:n,factory:n.\u0275fac})}return n})();function Fd(){return{additions:{nodes:[],links:[],drawings:[]},updates:new Map,removals:{nodes:[],links:[],drawings:[]}}}function ty(n,...o){for(let e of o){n.additions.nodes.push(...e.additions.nodes),n.additions.links.push(...e.additions.links),n.additions.drawings.push(...e.additions.drawings),n.removals.nodes.push(...e.removals.nodes),n.removals.links.push(...e.removals.links),n.removals.drawings.push(...e.removals.drawings);for(let[t,i]of e.updates){let r=n.updates.get(t);if(r)for(let a of i)r.includes(a)||r.push(a);else n.updates.set(t,[...i])}}return n}function YL(n){return n.additions.nodes.length===0&&n.additions.links.length===0&&n.additions.drawings.length===0&&n.removals.nodes.length===0&&n.removals.links.length===0&&n.removals.drawings.length===0&&n.updates.size===0}function ZL(n){let o=`${n.x}|${n.y}`,e=`${n.z}`,t=`${n.symbol}|${n.symbol_url}|${n.width}|${n.height}|${n.status}|${n.locked}|${n.name}`,i=JSON.stringify(n.label),r=JSON.stringify(n.ports),a=`${n.node_type}|${n.first_port_name}|${n.port_name_format}|${n.port_segment_size}`;return{all:`${n.node_id}|${o}|${e}|${t}|${i}|${r}|${a}`,groups:{xY:o,z:e,visual:t,label:i,ports:r,type:a}}}function JL(n){let o=JSON.stringify(n.nodes),e=`${n.capturing}|${n.suspend}|${n.show_filters_icon}|${n.wireshark}|${n.link_type}|${JSON.stringify(n.filters)}|${JSON.stringify(n.link_style)}`;return{all:`${n.link_id}|${o}|${e}`,groups:{nodes:o,visual:e}}}function e7(n){let o=`${n.x}|${n.y}`,e=`${n.z}`,t=`${n.rotation}|${n.locked}|${n.svg}`;return{all:`${n.drawing_id}|${o}|${e}|${t}`,groups:{xY:o,z:e,visual:t}}}function ny(n,o){if(!n)return Object.keys(o);let e=[];for(let t of Object.keys(n))n[t]!==o[t]&&e.push(t);return e}function t7(n,o,e,t){if(o.additions.nodes.length>0||o.removals.nodes.length>0||o.additions.links.length>0||o.removals.links.length>0||o.additions.drawings.length>0||o.removals.drawings.length>0)return!0;if(o.updates.size===0)return!1;let i=new Map(e.getNodes().map(c=>[c.id,c])),r=new Map(e.getDrawings().map(c=>[c.id,c])),a=!1;for(let[c,p]of o.updates){let u=p.length===1&&p[0]==="xY",h=p.length===1&&p[0]==="label";if(u){let g=i.get(c);if(g){let b=g.width?0:-30;n.select(`g.node[node_id="${iy(c)}"]`).select("g.node_body").attr("transform",`translate(${g.x+b}, ${g.y+b})`);continue}let y=r.get(c);if(y){n.select(`g.drawing[drawing_id="${iy(c)}"]`).select("g.drawing_body").attr("transform",`translate(${y.x}, ${y.y}) rotate(${y.rotation})`);continue}}if(h){let g=i.get(c);if(g&&g.label){let y=n.select(`g.node[node_id="${iy(c)}"]`).select("text.label");if(!y.empty()){let b=g.label;y.attr("style",b.style).text(b.text).attr("x",b.x).attr("y",b.y);let x=y.node()?.getBBox();x&&n.select(`g.node[node_id="${iy(c)}"]`).select("rect.label_selection").attr("x",x.x).attr("y",x.y).attr("width",x.width).attr("height",x.height)}continue}}a=!0}return a}function iy(n){return n.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}var Rd=class{width;height;constructor(o,e){this.width=o,this.height=e}};var oy=(()=>{class n{getOptimalSize(e,t){let i=document.documentElement.clientWidth,r=document.documentElement.clientHeight;return e>i&&(i=e),t>r&&(r=t),new Rd(i,r)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var df=class extends em{getItemKey(o){return o.id}},mf=(()=>{class n extends df{static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})(),kl=(()=>{class n extends df{static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})(),pf=(()=>{class n extends df{static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})(),uf=(()=>{class n extends df{static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var qa=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 tc=class{id;rotation;style;text;x;y;originalX;originalY;nodeId};var Qc=(()=>{class n{calculate(e,t){let i=document.createElement("text");i.innerText=e,i.setAttribute("fill","#00000"),i.setAttribute("fill-opacity","0"),i.setAttribute("style",t),document.documentElement.appendChild(i);let r=i.getBoundingClientRect();return document.documentElement.removeChild(i),{width:r.width,height:r.height}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();function ir(n){return n>=48&&n<=57}function Cs(n){return ir(n)||n>=65&&n<=70||n>=97&&n<=102}function ly(n){return n>=65&&n<=90}function Jce(n){return n>=97&&n<=122}function ede(n){return ly(n)||Jce(n)}function tde(n){return n>=128}function sy(n){return ede(n)||tde(n)||n===95}function q0(n){return sy(n)||ir(n)||n===45}function nde(n){return n>=0&&n<=8||n===11||n>=14&&n<=31||n===127}function Q0(n){return n===10||n===13||n===12}function Xc(n){return Q0(n)||n===32||n===9}function Qa(n,o){return!(n!==92||Q0(o)||o===0)}function hf(n,o,e){return n===45?sy(o)||o===45||Qa(o,e):sy(n)?!0:n===92?Qa(n,o):!1}function cy(n,o,e){return n===43||n===45?ir(o)?2:o===46&&ir(e)?3:0:n===46?ir(o)?2:0:ir(n)?1:0}function dy(n){return n===65279||n===65534?1:0}var NP=new Array(128),ide=128,X0=130,FP=131,my=132,RP=133;for(let n=0;n<NP.length;n++)NP[n]=Xc(n)&&X0||ir(n)&&FP||sy(n)&&my||nde(n)&&RP||n||ide;function py(n){return n<128?NP[n]:my}function ff(n,o){return o<n.length?n.charCodeAt(o):0}function uy(n,o,e){return e===13&&ff(n,o+1)===10?2:1}function Ld(n,o,e){let t=n.charCodeAt(o);return ly(t)&&(t=t|32),t===e}function Vd(n,o,e,t){if(e-o!==t.length||o<0||e>n.length)return!1;for(let i=o;i<e;i++){let r=t.charCodeAt(i-o),a=n.charCodeAt(i);if(ly(a)&&(a=a|32),a!==r)return!1}return!0}function i7(n,o){for(;o>=0&&Xc(n.charCodeAt(o));o--);return o+1}function K0(n,o){for(;o<n.length&&Xc(n.charCodeAt(o));o++);return o}function LP(n,o){for(;o<n.length&&ir(n.charCodeAt(o));o++);return o}function Kc(n,o){if(o+=2,Cs(ff(n,o-1))){for(let t=Math.min(n.length,o+5);o<t&&Cs(ff(n,o));o++);let e=ff(n,o);Xc(e)&&(o+=uy(n,o,e))}return o}function Y0(n,o){for(;o<n.length;o++){let e=n.charCodeAt(o);if(!q0(e)){if(Qa(e,ff(n,o+1))){o=Kc(n,o)-1;continue}break}}return o}function bu(n,o){let e=n.charCodeAt(o);if((e===43||e===45)&&(e=n.charCodeAt(o+=1)),ir(e)&&(o=LP(n,o+1),e=n.charCodeAt(o)),e===46&&ir(n.charCodeAt(o+1))&&(o+=2,o=LP(n,o)),Ld(n,o,101)){let t=0;e=n.charCodeAt(o+1),(e===45||e===43)&&(t=1,e=n.charCodeAt(o+2)),ir(e)&&(o=LP(n,o+1+t+1))}return o}function hy(n,o){for(;o<n.length;o++){let e=n.charCodeAt(o);if(e===41){o++;break}Qa(e,ff(n,o+1))&&(o=Kc(n,o))}return o}function Z0(n){if(n.length===1&&!Cs(n.charCodeAt(0)))return n[0];let o=parseInt(n,16);return(o===0||o>=55296&&o<=57343||o>1114111)&&(o=65533),String.fromCodePoint(o)}var gf=["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 _f(n=null,o){return n===null||n.length<o?new Uint32Array(Math.max(o+1024,16384)):n}var o7=10,ode=12,r7=13;function a7(n){let o=n.source,e=o.length,t=o.length>0?dy(o.charCodeAt(0)):0,i=_f(n.lines,e),r=_f(n.columns,e),a=n.startLine,c=n.startColumn;for(let p=t;p<e;p++){let u=o.charCodeAt(p);i[p]=a,r[p]=c++,(u===o7||u===r7||u===ode)&&(u===r7&&p+1<e&&o.charCodeAt(p+1)===o7&&(p++,i[p]=a,r[p]=c),a++,c=1)}i[e]=a,r[e]=c,n.lines=i,n.columns=r,n.computed=!0}var fy=class{constructor(){this.lines=null,this.columns=null,this.computed=!1}setSource(o,e=0,t=1,i=1){this.source=o,this.startOffset=e,this.startLine=t,this.startColumn=i,this.computed=!1}getLocation(o,e){return this.computed||a7(this),{source:e,offset:this.startOffset+o,line:this.lines[o],column:this.columns[o]}}getLocationRange(o,e,t){return this.computed||a7(this),{source:t,start:{offset:this.startOffset+o,line:this.lines[o],column:this.columns[o]},end:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}}};var Tl=16777215,Gm=24,rde=new Map([[2,22],[21,22],[19,20],[23,24]]),J0=class{constructor(o,e){this.setSource(o,e)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(o="",e=()=>{}){o=String(o||"");let t=o.length,i=_f(this.offsetAndType,o.length+1),r=_f(this.balance,o.length+1),a=0,c=0,p=0,u=-1;for(this.offsetAndType=null,this.balance=null,e(o,(h,g,y)=>{switch(h){default:r[a]=t;break;case c:{let b=p&Tl;for(p=r[b],c=p>>Gm,r[a]=b,r[b++]=a;b<a;b++)r[b]===t&&(r[b]=a);break}case 21:case 2:case 19:case 23:r[a]=p,c=rde.get(h),p=c<<Gm|a;break}i[a++]=h<<Gm|y,u===-1&&(u=g)}),i[a]=0<<Gm|t,r[a]=t,r[t]=t;p!==0;){let h=p&Tl;p=r[h],r[h]=t}this.source=o,this.firstCharOffset=u===-1?0:u,this.tokenCount=a,this.offsetAndType=i,this.balance=r,this.reset(),this.next()}lookupType(o){return o+=this.tokenIndex,o<this.tokenCount?this.offsetAndType[o]>>Gm:0}lookupOffset(o){return o+=this.tokenIndex,o<this.tokenCount?this.offsetAndType[o-1]&Tl:this.source.length}lookupValue(o,e){return o+=this.tokenIndex,o<this.tokenCount?Vd(this.source,this.offsetAndType[o-1]&Tl,this.offsetAndType[o]&Tl,e):!1}getTokenStart(o){return o===this.tokenIndex?this.tokenStart:o>0?o<this.tokenCount?this.offsetAndType[o-1]&Tl:this.offsetAndType[this.tokenCount]&Tl:this.firstCharOffset}substrToCursor(o){return this.source.substring(o,this.tokenStart)}isBalanceEdge(o){return this.balance[this.tokenIndex]<o}isDelim(o,e){return e?this.lookupType(e)===9&&this.source.charCodeAt(this.lookupOffset(e))===o:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===o}skip(o){let e=this.tokenIndex+o;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.offsetAndType[e-1]&Tl,e=this.offsetAndType[e],this.tokenType=e>>Gm,this.tokenEnd=e&Tl):(this.tokenIndex=this.tokenCount,this.next())}next(){let o=this.tokenIndex+1;o<this.tokenCount?(this.tokenIndex=o,this.tokenStart=this.tokenEnd,o=this.offsetAndType[o],this.tokenType=o>>Gm,this.tokenEnd=o&Tl):(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(o,e){let t=o,i,r;e:for(;t<this.tokenCount;t++){if(i=this.balance[t],i<o)break e;switch(r=t>0?this.offsetAndType[t-1]&Tl:this.firstCharOffset,e(this.source.charCodeAt(r))){case 1:break e;case 2:t++;break e;default:this.balance[i]===t&&(t=i)}}this.skip(t-this.tokenIndex)}forEachToken(o){for(let e=0,t=this.firstCharOffset;e<this.tokenCount;e++){let i=t,r=this.offsetAndType[e],a=r&Tl,c=r>>Gm;t=a,o(c,i,a,e)}}dump(){let o=new Array(this.tokenCount);return this.forEachToken((e,t,i,r)=>{o[r]={idx:r,type:gf[e],chunk:this.source.substring(t,i),balance:this.balance[r]}}),o}};function Qm(n,o){function e(g){return g<c?n.charCodeAt(g):0}function t(){if(u=bu(n,u),hf(e(u),e(u+1),e(u+2))){h=12,u=Y0(n,u);return}if(e(u)===37){h=11,u++;return}h=10}function i(){let g=u;if(u=Y0(n,u),Vd(n,g,u,"url")&&e(u)===40){if(u=K0(n,u+1),e(u)===34||e(u)===39){h=2,u=g+4;return}a();return}if(e(u)===40){h=2,u++;return}h=1}function r(g){for(g||(g=e(u++)),h=5;u<n.length;u++){let y=n.charCodeAt(u);switch(py(y)){case g:u++;return;case X0:if(Q0(y)){u+=uy(n,u,y),h=6;return}break;case 92:if(u===n.length-1)break;let b=e(u+1);Q0(b)?u+=uy(n,u+1,b):Qa(y,b)&&(u=Kc(n,u)-1);break}}}function a(){for(h=7,u=K0(n,u);u<n.length;u++){let g=n.charCodeAt(u);switch(py(g)){case 41:u++;return;case X0:if(u=K0(n,u),e(u)===41||u>=n.length){u<n.length&&u++;return}u=hy(n,u),h=8;return;case 34:case 39:case 40:case RP:u=hy(n,u),h=8;return;case 92:if(Qa(g,e(u+1))){u=Kc(n,u)-1;break}u=hy(n,u),h=8;return}}}n=String(n||"");let c=n.length,p=dy(e(0)),u=p,h;for(;u<c;){let g=n.charCodeAt(u);switch(py(g)){case X0:h=13,u=K0(n,u+1);break;case 34:r();break;case 35:q0(e(u+1))||Qa(e(u+1),e(u+2))?(h=4,u=Y0(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:cy(g,e(u+1),e(u+2))?t():(h=9,u++);break;case 44:h=18,u++;break;case 45:cy(g,e(u+1),e(u+2))?t():e(u+1)===45&&e(u+2)===62?(h=15,u=u+3):hf(g,e(u+1),e(u+2))?i():(h=9,u++);break;case 46:cy(g,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:hf(e(u+1),e(u+2),e(u+3))?(h=3,u=Y0(n,u+1)):(h=9,u++);break;case 91:h=19,u++;break;case 92:Qa(g,e(u+1))?i():(h=9,u++);break;case 93:h=20,u++;break;case 123:h=23,u++;break;case 125:h=24,u++;break;case FP:t();break;case my:i();break;default:h=9,u++}o(h,p,p=u)}}var vf=null,Xa=class n{static createItem(o){return{prev:null,next:null,data:o}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(o){return n.createItem(o)}allocateCursor(o,e){let t;return vf!==null?(t=vf,vf=vf.cursor,t.prev=o,t.next=e,t.cursor=this.cursor):t={prev:o,next:e,cursor:this.cursor},this.cursor=t,t}releaseCursor(){let{cursor:o}=this;this.cursor=o.cursor,o.prev=null,o.next=null,o.cursor=vf,vf=o}updateCursors(o,e,t,i){let{cursor:r}=this;for(;r!==null;)r.prev===o&&(r.prev=e),r.next===t&&(r.next=i),r=r.cursor}*[Symbol.iterator](){for(let o=this.head;o!==null;o=o.next)yield o.data}get size(){let o=0;for(let e=this.head;e!==null;e=e.next)o++;return o}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(o){let e=null;this.head=null;for(let t of o){let i=n.createItem(t);e!==null?e.next=i:this.head=i,i.prev=e,e=i}return this.tail=e,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(o,e=this){let t=this.allocateCursor(null,this.head);for(;t.next!==null;){let i=t.next;t.next=i.next,o.call(e,i.data,i,this)}this.releaseCursor()}forEachRight(o,e=this){let t=this.allocateCursor(this.tail,null);for(;t.prev!==null;){let i=t.prev;t.prev=i.prev,o.call(e,i.data,i,this)}this.releaseCursor()}reduce(o,e,t=this){let i=this.allocateCursor(null,this.head),r=e,a;for(;i.next!==null;)a=i.next,i.next=a.next,r=o.call(t,r,a.data,a,this);return this.releaseCursor(),r}reduceRight(o,e,t=this){let i=this.allocateCursor(this.tail,null),r=e,a;for(;i.prev!==null;)a=i.prev,i.prev=a.prev,r=o.call(t,r,a.data,a,this);return this.releaseCursor(),r}some(o,e=this){for(let t=this.head;t!==null;t=t.next)if(o.call(e,t.data,t,this))return!0;return!1}map(o,e=this){let t=new n;for(let i=this.head;i!==null;i=i.next)t.appendData(o.call(e,i.data,i,this));return t}filter(o,e=this){let t=new n;for(let i=this.head;i!==null;i=i.next)o.call(e,i.data,i,this)&&t.appendData(i.data);return t}nextUntil(o,e,t=this){if(o===null)return;let i=this.allocateCursor(null,o);for(;i.next!==null;){let r=i.next;if(i.next=r.next,e.call(t,r.data,r,this))break}this.releaseCursor()}prevUntil(o,e,t=this){if(o===null)return;let i=this.allocateCursor(o,null);for(;i.prev!==null;){let r=i.prev;if(i.prev=r.prev,e.call(t,r.data,r,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){let o=new n;for(let e of this)o.appendData(e);return o}prepend(o){return this.updateCursors(null,o,this.head,o),this.head!==null?(this.head.prev=o,o.next=this.head):this.tail=o,this.head=o,this}prependData(o){return this.prepend(n.createItem(o))}append(o){return this.insert(o)}appendData(o){return this.insert(n.createItem(o))}insert(o,e=null){if(e!==null)if(this.updateCursors(e.prev,o,e,o),e.prev===null){if(this.head!==e)throw new Error("before doesn't belong to list");this.head=o,e.prev=o,o.next=e,this.updateCursors(null,o)}else e.prev.next=o,o.prev=e.prev,e.prev=o,o.next=e;else this.updateCursors(this.tail,o,null,o),this.tail!==null?(this.tail.next=o,o.prev=this.tail):this.head=o,this.tail=o;return this}insertData(o,e){return this.insert(n.createItem(o),e)}remove(o){if(this.updateCursors(o,o.prev,o,o.next),o.prev!==null)o.prev.next=o.next;else{if(this.head!==o)throw new Error("item doesn't belong to list");this.head=o.next}if(o.next!==null)o.next.prev=o.prev;else{if(this.tail!==o)throw new Error("item doesn't belong to list");this.tail=o.prev}return o.prev=null,o.next=null,o}push(o){this.insert(n.createItem(o))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(o){this.prepend(n.createItem(o))}shift(){return this.head!==null?this.remove(this.head):null}prependList(o){return this.insertList(o,this.head)}appendList(o){return this.insertList(o)}insertList(o,e){return o.head===null?this:(e!=null?(this.updateCursors(e.prev,o.tail,e,o.head),e.prev!==null?(e.prev.next=o.head,o.head.prev=e.prev):this.head=o.head,e.prev=o.tail,o.tail.next=e):(this.updateCursors(this.tail,o.tail,null,o.head),this.tail!==null?(this.tail.next=o.head,o.head.prev=this.tail):this.head=o.head,this.tail=o.tail),o.head=null,o.tail=null,this)}replace(o,e){"head"in e?this.insertList(e,o):this.insert(e,o),this.remove(o)}};function yu(n,o){let e=Object.create(SyntaxError.prototype),t=new Error;return Object.assign(e,{name:n,message:o,get stack(){return(t.stack||"").replace(/^(.+\n){1,3}/,`${n}: ${o}
|
||
`)}})}var BP=100,s7=60,l7=" ";function c7({source:n,line:o,column:e},t){function i(h,g){return r.slice(h,g).map((y,b)=>String(h+b+1).padStart(p)+" |"+y).join(`
|
||
`)}let r=n.split(/\r\n?|\n|\f/),a=Math.max(1,o-t)-1,c=Math.min(o+t,r.length+1),p=Math.max(4,String(c).length)+1,u=0;e+=(l7.length-1)*(r[o-1].substr(0,e-1).match(/\t/g)||[]).length,e>BP&&(u=e-s7+3,e=s7-2);for(let h=a;h<=c;h++)h>=0&&h<r.length&&(r[h]=r[h].replace(/\t/g,l7),r[h]=(u>0&&r[h].length>u?"\u2026":"")+r[h].substr(u,BP-2)+(r[h].length>u+BP-1?"\u2026":""));return[i(a,o),new Array(e+p+2).join("-")+"^",i(o,c)].filter(Boolean).join(`
|
||
`)}function zP(n,o,e,t,i){return Object.assign(yu("SyntaxError",n),{source:o,offset:e,line:t,column:i,sourceFragment(a){return c7({source:o,line:t,column:i},isNaN(a)?0:a)},get formattedMessage(){return`Parse error: ${n}
|
||
`+c7({source:o,line:t,column:i},2)}})}function d7(n){let o=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 i=n.getNode.call(this,t);if(i===void 0)break;e&&(n.onWhiteSpace&&n.onWhiteSpace.call(this,i,o,t),e=!1),o.push(i)}return e&&n.onWhiteSpace&&n.onWhiteSpace.call(this,null,o,t),o}var m7=()=>{},ade=33,sde=35,jP=59,p7=123,u7=0;function lde(n){return function(){return this[n]()}}function $P(n){let o=Object.create(null);for(let e in n){let t=n[e],i=t.parse||t;i&&(o[e]=i)}return o}function cde(n){let o={context:Object.create(null),scope:Object.assign(Object.create(null),n.scope),atrule:$P(n.atrule),pseudo:$P(n.pseudo),node:$P(n.node)};for(let e in n.parseContext)switch(typeof n.parseContext[e]){case"function":o.context[e]=n.parseContext[e];break;case"string":o.context[e]=lde(n.parseContext[e]);break}return Z(Z({config:o},o),o.node)}function h7(n){let o="",e="<unknown>",t=!1,i=m7,r=!1,a=new fy,c=Object.assign(new J0,cde(n||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:d7,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(u){return u===p7?1:0},consumeUntilLeftCurlyBracketOrSemicolon(u){return u===p7||u===jP?1:0},consumeUntilExclamationMarkOrSemicolon(u){return u===ade||u===jP?1:0},consumeUntilSemicolonIncluded(u){return u===jP?2:0},createList(){return new Xa},createSingleNodeList(u){return new Xa().appendData(u)},getFirstListNode(u){return u&&u.first},getLastListNode(u){return u&&u.last},parseWithFallback(u,h){let g=this.tokenIndex;try{return u.call(this)}catch(y){if(r)throw y;let b=h.call(this,g);return r=!0,i(y,b),r=!1,b}},lookupNonWSType(u){let h;do if(h=this.lookupType(u++),h!==13)return h;while(h!==u7);return u7},charCodeAt(u){return u>=0&&u<o.length?o.charCodeAt(u):0},substring(u,h){return o.substring(u,h)},substrToCursor(u){return this.source.substring(u,this.tokenStart)},cmpChar(u,h){return Ld(o,u,h)},cmpStr(u,h,g){return Vd(o,u,h,g)},consume(u){let h=this.tokenStart;return this.eat(u),this.substrToCursor(h)},consumeFunctionName(){let u=o.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),u},consumeNumber(u){let h=o.substring(this.tokenStart,bu(o,this.tokenStart));return this.eat(u),h},eat(u){if(this.tokenType!==u){let h=gf[u].slice(0,-6).replace(/-/g," ").replace(/^./,b=>b.toUpperCase()),g=`${/[[\](){}]/.test(h)?`"${h}"`:h} is expected`,y=this.tokenStart;switch(u){case 1:this.tokenType===2||this.tokenType===7?(y=this.tokenEnd-1,g="Identifier is expected but function found"):g="Identifier is expected";break;case 4:this.isDelim(sde)&&(this.next(),y++,g="Name is expected");break;case 11:this.tokenType===10&&(y=this.tokenEnd,g="Percent sign is expected");break}this.error(g,y)}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),g=this.getLastListNode(u);return a.getLocationRange(h!==null?h.loc.start.offset-a.startOffset:this.tokenStart,g!==null?g.loc.end.offset-a.startOffset:this.tokenStart,e)}return null},error(u,h){let g=typeof h<"u"&&h<o.length?a.getLocation(h):this.eof?a.getLocation(i7(o,o.length-1)):a.getLocation(this.tokenStart);throw new zP(u||"Unexpected input",o,g.offset,g.line,g.column)}});return Object.assign(function(u,h){o=u,h=h||{},c.setSource(o,Qm),a.setSource(o,h.offset,h.line,h.column),e=h.filename||"<unknown>",t=!!h.positions,i=typeof h.onParseError=="function"?h.onParseError:m7,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:g="default",onComment:y}=h;if(!(g in c.context))throw new Error("Unknown context `"+g+"`");typeof y=="function"&&c.forEachToken((x,M,w)=>{if(x===25){let S=c.getLocation(M,w),E=Vd(o,w-2,w,"*/")?o.slice(M+2,w-2):o.slice(M+2,w);y(E,S)}});let b=c.context[g].call(c,h);return c.eof||c.error(),b},{SyntaxError:zP,config:c.config})}var F7=Gs(O7(),1),N7=new Set(["Atrule","Selector","Declaration"]);function R7(n){let o=new F7.SourceMapGenerator,e={line:1,column:0},t={line:0,column:0},i={line:1,column:0},r={generated:i},a=1,c=0,p=!1,u=n.node;n.node=function(y){if(y.loc&&y.loc.start&&N7.has(y.type)){let b=y.loc.start.line,x=y.loc.start.column-1;(t.line!==b||t.column!==x)&&(t.line=b,t.column=x,e.line=a,e.column=c,p&&(p=!1,(e.line!==i.line||e.column!==i.column)&&o.addMapping(r)),p=!0,o.addMapping({source:y.loc.source,original:t,generated:e}))}u.call(this,y),p&&N7.has(y.type)&&(i.line=a,i.column=c)};let h=n.emit;n.emit=function(y,b,x){for(let M=0;M<y.length;M++)y.charCodeAt(M)===10?(a++,c=0):c++;h(y,b,x)};let g=n.result;return n.result=function(){return p&&o.addMapping(r),{css:g(),map:o}},n}var Cy={};Ln(Cy,{safe:()=>KP,spec:()=>Ide});var Ede=43,Dde=45,XP=(n,o)=>{if(n===9&&(n=o),typeof n=="string"){let e=n.charCodeAt(0);return e>127?32768:e<<8}return n},L7=[[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],["/","*"]],Pde=L7.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 V7(n){let o=new Set(n.map(([e,t])=>XP(e)<<16|XP(t)));return function(e,t,i){let r=XP(t,i),a=i.charCodeAt(0);return(a===Dde&&t!==1&&t!==2&&t!==15||a===Ede?o.has(e<<16|a<<8):o.has(e<<16|r))&&this.emit(" ",13,!0),r}}var Ide=V7(L7),KP=V7(Pde);var Ade=92;function Ode(n,o){if(typeof o=="function"){let e=null;n.children.forEach(t=>{e!==null&&o.call(this,e),this.node(t),e=t});return}n.children.forEach(this.node,this)}function Nde(n){Qm(n,(o,e,t)=>{this.token(o,n.slice(e,t))})}function B7(n){let o=new Map;for(let e in n.node){let t=n.node[e];typeof(t.generate||t)=="function"&&o.set(e,t.generate||t)}return function(e,t){let i="",r=0,a={node(p){if(o.has(p.type))o.get(p.type).call(c,p);else throw new Error("Unknown node type: "+p.type)},tokenBefore:KP,token(p,u){r=this.tokenBefore(r,p,u),this.emit(u,p,!1),p===9&&u.charCodeAt(0)===Ade&&this.emit(`
|
||
`,13,!0)},emit(p){i+=p},result(){return i}};t&&(typeof t.decorator=="function"&&(a=t.decorator(a)),t.sourceMap&&(a=R7(a)),t.mode in Cy&&(a.tokenBefore=Cy[t.mode]));let c={node:p=>a.node(p),children:Ode,token:(p,u)=>a.token(p,u),tokenize:Nde};return a.node(e),a.result()}}function z7(n){return{fromPlainObject(o){return n(o,{enter(e){e.children&&!(e.children instanceof Xa)&&(e.children=new Xa().fromArray(e.children))}}),o},toPlainObject(o){return n(o,{leave(e){e.children&&e.children instanceof Xa&&(e.children=e.children.toArray())}}),o}}}var{hasOwnProperty:YP}=Object.prototype,iv=function(){};function j7(n){return typeof n=="function"?n:iv}function $7(n,o){return function(e,t,i){e.type===o&&n.call(this,e,t,i)}}function Fde(n,o){let e=o.structure,t=[];for(let i in e){if(YP.call(e,i)===!1)continue;let r=e[i],a={name:i,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:o.walkContext,fields:t}:null}function Rde(n){let o={};for(let e in n.node)if(YP.call(n.node,e)){let t=n.node[e];if(!t.structure)throw new Error("Missed `structure` field in `"+e+"` node type definition");o[e]=Fde(e,t)}return o}function H7(n,o){let e=n.fields.slice(),t=n.context,i=typeof t=="string";return o&&e.reverse(),function(r,a,c,p){let u;i&&(u=a[t],a[t]=r);for(let h of e){let g=r[h.name];if(!h.nullable||g){if(h.type==="list"){if(o?g.reduceRight(p,!1):g.reduce(p,!1))return!0}else if(c(g))return!0}}i&&(a[t]=u)}}function U7({StyleSheet:n,Atrule:o,Rule:e,Block:t,DeclarationList:i}){return{Atrule:{StyleSheet:n,Atrule:o,Rule:e,Block:t},Rule:{StyleSheet:n,Atrule:o,Rule:e,Block:t},Declaration:{StyleSheet:n,Atrule:o,Rule:e,Block:t,DeclarationList:i}}}function W7(n){let o=Rde(n),e={},t={},i=Symbol("break-walk"),r=Symbol("skip-node");for(let u in o)YP.call(o,u)&&o[u]!==null&&(e[u]=H7(o[u],!1),t[u]=H7(o[u],!0));let a=U7(e),c=U7(t),p=function(u,h){function g(S,E,O){let D=y.call(w,S,E,O);return D===i?!0:D===r?!1:!!(x.hasOwnProperty(S.type)&&x[S.type](S,w,g,M)||b.call(w,S,E,O)===i)}let y=iv,b=iv,x=e,M=(S,E,O,D)=>S||g(E,O,D),w={break:i,skip:r,root:u,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof h=="function")y=h;else if(h&&(y=j7(h.enter),b=j7(h.leave),h.reverse&&(x=t),h.visit)){if(a.hasOwnProperty(h.visit))x=h.reverse?c[h.visit]:a[h.visit];else if(!o.hasOwnProperty(h.visit))throw new Error("Bad value `"+h.visit+"` for `visit` option (should be: "+Object.keys(o).sort().join(", ")+")");y=$7(y,h.visit),b=$7(b,h.visit)}if(y===iv&&b===iv)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");g(u)};return p.break=i,p.skip=r,p.find=function(u,h){let g=null;return p(u,function(y,b,x){if(h.call(this,y,b,x))return g=y,i}),g},p.findLast=function(u,h){let g=null;return p(u,{reverse:!0,enter(y,b,x){if(h.call(this,y,b,x))return g=y,i}}),g},p.findAll=function(u,h){let g=[];return p(u,function(y,b,x){h.call(this,y,b,x)&&g.push(y)}),g},p}function Lde(n){return n}function Vde(n){let{min:o,max:e,comma:t}=n;return o===0&&e===0?t?"#?":"*":o===0&&e===1?"?":o===1&&e===0?t?"#":"+":o===1&&e===1?"":(t?"#":"")+(o===e?"{"+o+"}":"{"+o+","+(e!==0?e:"")+"}")}function Bde(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 zde(n,o,e,t){let i=n.combinator===" "||t?n.combinator:" "+n.combinator+" ",r=n.terms.map(a=>ZP(a,o,e,t)).join(i);return n.explicit||e?(t||r[0]===","?"[":"[ ")+r+(t?"]":" ]"):r}function ZP(n,o,e,t){let i;switch(n.type){case"Group":i=zde(n,o,e,t)+(n.disallowEmpty?"!":"");break;case"Multiplier":return ZP(n.term,o,e,t)+o(Vde(n),n);case"Type":i="<"+n.name+(n.opts?o(Bde(n.opts),n.opts):"")+">";break;case"Property":i="<'"+n.name+"'>";break;case"Keyword":i=n.name;break;case"AtKeyword":i="@"+n.name;break;case"Function":i=n.name+"(";break;case"String":case"Token":i=n.value;break;case"Comma":i=",";break;default:throw new Error("Unknown node type `"+n.type+"`")}return o(i,n)}function xf(n,o){let e=Lde,t=!1,i=!1;return typeof o=="function"?e=o:o&&(t=!!o.forceBraces,i=!!o.compact,typeof o.decorate=="function"&&(e=o.decorate)),ZP(n,e,t,i)}var G7={offset:0,line:1,column:1};function jde(n,o){let e=n.tokens,t=n.longestMatch,i=t<e.length&&e[t].node||null,r=i!==o?i:null,a=0,c=0,p=0,u="",h,g;for(let y=0;y<e.length;y++){let b=e[y].value;y===t&&(c=b.length,a=u.length),r!==null&&e[y].node===r&&(y<=t?p++:p=0),u+=b}return t===e.length||p>1?(h=xy(r||o,"end")||ov(G7,u),g=ov(h)):(h=xy(r,"start")||ov(xy(o,"start")||G7,u.slice(0,a)),g=xy(r,"end")||ov(h,u.substr(a,c))),{css:u,mismatchOffset:a,mismatchLength:c,start:h,end:g}}function xy(n,o){let e=n&&n.loc&&n.loc[o];return e?"line"in e?ov(e):e:null}function ov({offset:n,line:o,column:e},t){let i={offset:n,line:o,column:e};if(t){let r=t.split(/\n|\r\n?|\f/);i.offset+=t.length,i.line+=r.length-1,i.column=r.length===1?i.column+t.length:r.pop().length+1}return i}var bf=function(n,o){let e=yu("SyntaxReferenceError",n+(o?" `"+o+"`":""));return e.reference=o,e},q7=function(n,o,e,t){let i=yu("SyntaxMatchError",n),{css:r,mismatchOffset:a,mismatchLength:c,start:p,end:u}=jde(t,e);return i.rawMessage=n,i.syntax=o?xf(o):"<generic>",i.css=r,i.mismatchOffset=a,i.mismatchLength=c,i.message=n+`
|
||
syntax: `+i.syntax+`
|
||
value: `+(r||"<empty string>")+`
|
||
--------`+new Array(i.mismatchOffset+1).join("-")+"^",Object.assign(i,p),i.loc={source:e&&e.loc&&e.loc.source||"<unknown>",start:p,end:u},i};var by=new Map,yf=new Map,yy=45,Sy=$de,JP=Hde;function wy(n,o){return o=o||0,n.length-o>=2&&n.charCodeAt(o)===yy&&n.charCodeAt(o+1)===yy}function Q7(n,o){if(o=o||0,n.length-o>=3&&n.charCodeAt(o)===yy&&n.charCodeAt(o+1)!==yy){let e=n.indexOf("-",o+2);if(e!==-1)return n.substring(o,e+1)}return""}function $de(n){if(by.has(n))return by.get(n);let o=n.toLowerCase(),e=by.get(o);if(e===void 0){let t=wy(o,0),i=t?"":Q7(o,0);e=Object.freeze({basename:o.substr(i.length),name:o,prefix:i,vendor:i,custom:t})}return by.set(n,e),e}function Hde(n){if(yf.has(n))return yf.get(n);let o=n,e=n[0];e==="/"?e=n[1]==="/"?"//":"/":e!=="_"&&e!=="*"&&e!=="$"&&e!=="#"&&e!=="+"&&e!=="&"&&(e="");let t=wy(o,e.length);if(!t&&(o=o.toLowerCase(),yf.has(o))){let c=yf.get(o);return yf.set(n,c),c}let i=t?"":Q7(o,e.length),r=o.substr(0,e.length+i.length),a=Object.freeze({basename:o.substr(r.length),name:o.substr(e.length),hack:e,vendor:i,prefix:r,custom:t});return yf.set(n,a),a}var My=["initial","inherit","unset","revert","revert-layer"];var av=43,Yc=45,eI=110,Sf=!0,Wde=!1;function nI(n,o){return n!==null&&n.type===9&&n.value.charCodeAt(0)===o}function rv(n,o,e){for(;n!==null&&(n.type===13||n.type===25);)n=e(++o);return o}function Xm(n,o,e,t){if(!n)return 0;let i=n.value.charCodeAt(o);if(i===av||i===Yc){if(e)return 0;o++}for(;o<n.value.length;o++)if(!ir(n.value.charCodeAt(o)))return 0;return t+1}function tI(n,o,e){let t=!1,i=rv(n,o,e);if(n=e(i),n===null)return o;if(n.type!==10)if(nI(n,av)||nI(n,Yc)){if(t=!0,i=rv(e(++i),i,e),n=e(i),n===null||n.type!==10)return 0}else return o;if(!t){let r=n.value.charCodeAt(0);if(r!==av&&r!==Yc)return 0}return Xm(n,t?0:1,t,i)}function iI(n,o){let e=0;if(!n)return 0;if(n.type===10)return Xm(n,0,Wde,e);if(n.type===1&&n.value.charCodeAt(0)===Yc){if(!Ld(n.value,1,eI))return 0;switch(n.value.length){case 2:return tI(o(++e),e,o);case 3:return n.value.charCodeAt(2)!==Yc?0:(e=rv(o(++e),e,o),n=o(e),Xm(n,0,Sf,e));default:return n.value.charCodeAt(2)!==Yc?0:Xm(n,3,Sf,e)}}else if(n.type===1||nI(n,av)&&o(e+1).type===1){if(n.type!==1&&(n=o(++e)),n===null||!Ld(n.value,0,eI))return 0;switch(n.value.length){case 1:return tI(o(++e),e,o);case 2:return n.value.charCodeAt(1)!==Yc?0:(e=rv(o(++e),e,o),n=o(e),Xm(n,0,Sf,e));default:return n.value.charCodeAt(1)!==Yc?0:Xm(n,2,Sf,e)}}else if(n.type===12){let t=n.value.charCodeAt(0),i=t===av||t===Yc?1:0,r=i;for(;r<n.value.length&&ir(n.value.charCodeAt(r));r++);return r===i||!Ld(n.value,r,eI)?0:r+1===n.value.length?tI(o(++e),e,o):n.value.charCodeAt(r+1)!==Yc?0:r+2===n.value.length?(e=rv(o(++e),e,o),n=o(e),Xm(n,0,Sf,e)):Xm(n,r+2,Sf,e)}return 0}var Gde=43,X7=45,K7=63,qde=117;function oI(n,o){return n!==null&&n.type===9&&n.value.charCodeAt(0)===o}function Qde(n,o){return n.value.charCodeAt(0)===o}function sv(n,o,e){let t=0;for(let i=o;i<n.value.length;i++){let r=n.value.charCodeAt(i);if(r===X7&&e&&t!==0)return sv(n,o+t+1,!1),6;if(!Cs(r)||++t>6)return 0}return t}function ky(n,o,e){if(!n)return 0;for(;oI(e(o),K7);){if(++n>6)return 0;o++}return o}function rI(n,o){let e=0;if(n===null||n.type!==1||!Ld(n.value,0,qde)||(n=o(++e),n===null))return 0;if(oI(n,Gde))return n=o(++e),n===null?0:n.type===1?ky(sv(n,0,!0),++e,o):oI(n,K7)?ky(1,++e,o):0;if(n.type===10){let t=sv(n,1,!0);return t===0?0:(n=o(++e),n===null?e:n.type===12||n.type===10?!Qde(n,X7)||!sv(n,1,!1)?0:e+1:ky(t,e,o))}return n.type===12?ky(sv(n,1,!0),++e,o):0}var Xde=["calc(","-moz-calc(","-webkit-calc("],aI=new Map([[2,22],[21,22],[19,20],[23,24]]);function nc(n,o){return o<n.length?n.charCodeAt(o):0}function Y7(n,o){return Vd(n,0,n.length,o)}function Z7(n,o){for(let e=0;e<o.length;e++)if(Y7(n,o[e]))return!0;return!1}function J7(n,o){return o!==n.length-2?!1:nc(n,o)===92&&ir(nc(n,o+1))}function Ty(n,o,e){if(n&&n.type==="Range"){let t=Number(e!==void 0&&e!==o.length?o.substr(0,e):o);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 Kde(n,o){let e=0,t=[],i=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){i++;break e}break;case 2:case 21:case 19:case 23:t.push(e),e=aI.get(n.type);break}i++}while(n=o(i));return i}function Dl(n){return function(o,e,t){return o===null?0:o.type===2&&Z7(o.value,Xde)?Kde(o,e):n(o,e,t)}}function Io(n){return function(o){return o===null||o.type!==n?0:1}}function Yde(n){if(n===null||n.type!==1)return 0;let o=n.value.toLowerCase();return Z7(o,My)||Y7(o,"default")?0:1}function Zde(n){return n===null||n.type!==1||nc(n.value,0)!==45||nc(n.value,1)!==45?0:1}function Jde(n){if(n===null||n.type!==4)return 0;let o=n.value.length;if(o!==4&&o!==5&&o!==7&&o!==9)return 0;for(let e=1;e<o;e++)if(!Cs(nc(n.value,e)))return 0;return 1}function eme(n){return n===null||n.type!==4||!hf(nc(n.value,1),nc(n.value,2),nc(n.value,3))?0:1}function tme(n,o){if(!n)return 0;let e=0,t=[],i=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=aI.get(n.type);break}i++}while(n=o(i));return i}function nme(n,o){if(!n)return 0;let e=0,t=[],i=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=aI.get(n.type);break}i++}while(n=o(i));return i}function jd(n){return n&&(n=new Set(n)),function(o,e,t){if(o===null||o.type!==12)return 0;let i=bu(o.value,0);if(n!==null){let r=o.value.indexOf("\\",i),a=r===-1||!J7(o.value,r)?o.value.substr(i):o.value.substring(i,r);if(n.has(a.toLowerCase())===!1)return 0}return Ty(t,o.value,i)?0:1}}function ime(n,o,e){return n===null||n.type!==11||Ty(e,n.value,n.value.length-1)?0:1}function eV(n){return typeof n!="function"&&(n=function(){return 0}),function(o,e,t){return o!==null&&o.type===10&&Number(o.value)===0?1:n(o,e,t)}}function ome(n,o,e){if(n===null)return 0;let t=bu(n.value,0);return!(t===n.value.length)&&!J7(n.value,t)||Ty(e,n.value,t)?0:1}function rme(n,o,e){if(n===null||n.type!==10)return 0;let t=nc(n.value,0)===43||nc(n.value,0)===45?1:0;for(;t<n.value.length;t++)if(!ir(nc(n.value,t)))return 0;return Ty(e,n.value,t)?0:1}var ame={"ident-token":Io(1),"function-token":Io(2),"at-keyword-token":Io(3),"hash-token":Io(4),"string-token":Io(5),"bad-string-token":Io(6),"url-token":Io(7),"bad-url-token":Io(8),"delim-token":Io(9),"number-token":Io(10),"percentage-token":Io(11),"dimension-token":Io(12),"whitespace-token":Io(13),"CDO-token":Io(14),"CDC-token":Io(15),"colon-token":Io(16),"semicolon-token":Io(17),"comma-token":Io(18),"[-token":Io(19),"]-token":Io(20),"(-token":Io(21),")-token":Io(22),"{-token":Io(23),"}-token":Io(24)},sme={string:Io(5),ident:Io(1),percentage:Dl(ime),zero:eV(),number:Dl(ome),integer:Dl(rme),"custom-ident":Yde,"custom-property-name":Zde,"hex-color":Jde,"id-selector":eme,"an-plus-b":iI,urange:rI,"declaration-value":tme,"any-value":nme};function lme(n){let{angle:o,decibel:e,frequency:t,flex:i,length:r,resolution:a,semitones:c,time:p}=n||{};return{dimension:Dl(jd(null)),angle:Dl(jd(o)),decibel:Dl(jd(e)),frequency:Dl(jd(t)),flex:Dl(jd(i)),length:Dl(eV(jd(r))),resolution:Dl(jd(a)),semitones:Dl(jd(c)),time:Dl(jd(p))}}function tV(n){return Z(Z(Z({},ame),sme),lme(n))}var Ey={};Ln(Ey,{angle:()=>dme,decibel:()=>fme,flex:()=>hme,frequency:()=>pme,length:()=>cme,resolution:()=>ume,semitones:()=>gme,time:()=>mme});var cme=["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"],dme=["deg","grad","rad","turn"],mme=["s","ms"],pme=["hz","khz"],ume=["dpi","dpcm","dppx","x"],hme=["fr"],fme=["db"],gme=["st"];function sI(n,o,e){return Object.assign(yu("SyntaxError",n),{input:o,offset:e,rawMessage:n,message:n+`
|
||
`+o+`
|
||
--`+new Array((e||o.length)+1).join("-")+"^"})}var _me=9,vme=10,Cme=12,xme=13,bme=32,Dy=class{constructor(o){this.str=o,this.pos=0}charCodeAt(o){return o<this.str.length?this.str.charCodeAt(o):0}charCode(){return this.charCodeAt(this.pos)}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(o){return this.charCodeAt(this.findWsEnd(o))}findWsEnd(o){for(;o<this.str.length;o++){let e=this.str.charCodeAt(o);if(e!==xme&&e!==vme&&e!==Cme&&e!==bme&&e!==_me)break}return o}substringToPos(o){return this.str.substring(this.pos,this.pos=o)}eat(o){this.charCode()!==o&&this.error("Expect `"+String.fromCharCode(o)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(o){throw new sI(o,this.str,this.pos)}};var yme=9,Sme=10,wme=12,Mme=13,kme=32,cV=33,dI=35,nV=38,Py=39,dV=40,Tme=41,mV=42,mI=43,pI=44,iV=45,uI=60,pV=62,cI=63,Eme=64,Ny=91,hI=93,Iy=123,oV=124,rV=125,aV=8734,lv=new Uint8Array(128).map((n,o)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(o))?1:0),sV={" ":1,"&&":2,"||":3,"|":4};function Ay(n){return n.substringToPos(n.findWsEnd(n.pos))}function wf(n){let o=n.pos;for(;o<n.str.length;o++){let e=n.str.charCodeAt(o);if(e>=128||lv[e]===0)break}return n.pos===o&&n.error("Expect a keyword"),n.substringToPos(o)}function Oy(n){let o=n.pos;for(;o<n.str.length;o++){let e=n.str.charCodeAt(o);if(e<48||e>57)break}return n.pos===o&&n.error("Expect a number"),n.substringToPos(o)}function Dme(n){let o=n.str.indexOf("'",n.pos+1);return o===-1&&(n.pos=n.str.length,n.error("Expect an apostrophe")),n.substringToPos(o+1)}function lV(n){let o=null,e=null;return n.eat(Iy),o=Oy(n),n.charCode()===pI?(n.pos++,n.charCode()!==rV&&(e=Oy(n))):e=o,n.eat(rV),{min:Number(o),max:e?Number(e):0}}function Pme(n){let o=null,e=!1;switch(n.charCode()){case mV:n.pos++,o={min:0,max:0};break;case mI:n.pos++,o={min:1,max:0};break;case cI:n.pos++,o={min:0,max:1};break;case dI:n.pos++,e=!0,n.charCode()===Iy?o=lV(n):n.charCode()===cI?(n.pos++,o={min:0,max:0}):o={min:1,max:0};break;case Iy:o=lV(n);break;default:return null}return{type:"Multiplier",comma:e,min:o.min,max:o.max,term:null}}function Mf(n,o){let e=Pme(n);return e!==null?(e.term=o,n.charCode()===dI&&n.charCodeAt(n.pos-1)===mI?Mf(n,e):e):o}function lI(n){let o=n.peek();return o===""?null:{type:"Token",value:o}}function Ime(n){let o;return n.eat(uI),n.eat(Py),o=wf(n),n.eat(Py),n.eat(pV),Mf(n,{type:"Property",name:o})}function Ame(n){let o=null,e=null,t=1;return n.eat(Ny),n.charCode()===iV&&(n.peek(),t=-1),t==-1&&n.charCode()===aV?n.peek():(o=t*Number(Oy(n)),lv[n.charCode()]!==0&&(o+=wf(n))),Ay(n),n.eat(pI),Ay(n),n.charCode()===aV?n.peek():(t=1,n.charCode()===iV&&(n.peek(),t=-1),e=t*Number(Oy(n)),lv[n.charCode()]!==0&&(e+=wf(n))),n.eat(hI),{type:"Range",min:o,max:e}}function Ome(n){let o,e=null;return n.eat(uI),o=wf(n),n.charCode()===dV&&n.nextCharCode()===Tme&&(n.pos+=2,o+="()"),n.charCodeAt(n.findWsEnd(n.pos))===Ny&&(Ay(n),e=Ame(n)),n.eat(pV),Mf(n,{type:"Type",name:o,opts:e})}function Nme(n){let o=wf(n);return n.charCode()===dV?(n.pos++,{type:"Function",name:o}):Mf(n,{type:"Keyword",name:o})}function Fme(n,o){function e(i,r){return{type:"Group",terms:i,combinator:r,disallowEmpty:!1,explicit:!1}}let t;for(o=Object.keys(o).sort((i,r)=>sV[i]-sV[r]);o.length>0;){t=o.shift();let i=0,r=0;for(;i<n.length;i++){let a=n[i];a.type==="Combinator"&&(a.value===t?(r===-1&&(r=i-1),n.splice(i,1),i--):(r!==-1&&i-r>1&&(n.splice(r,i-r,e(n.slice(r,i),t)),i=r+1),r=-1))}r!==-1&&o.length&&n.splice(r,i-r,e(n.slice(r,i),t))}return t}function uV(n){let o=[],e={},t,i=null,r=n.pos;for(;t=Lme(n);)t.type!=="Spaces"&&(t.type==="Combinator"?((i===null||i.type==="Combinator")&&(n.pos=r,n.error("Unexpected combinator")),e[t.value]=!0):i!==null&&i.type!=="Combinator"&&(e[" "]=!0,o.push({type:"Combinator",value:" "})),o.push(t),i=t,r=n.pos);return i!==null&&i.type==="Combinator"&&(n.pos-=r,n.error("Unexpected combinator")),{type:"Group",terms:o,combinator:Fme(o,e)||" ",disallowEmpty:!1,explicit:!1}}function Rme(n){let o;return n.eat(Ny),o=uV(n),n.eat(hI),o.explicit=!0,n.charCode()===cV&&(n.pos++,o.disallowEmpty=!0),o}function Lme(n){let o=n.charCode();if(o<128&&lv[o]===1)return Nme(n);switch(o){case hI:break;case Ny:return Mf(n,Rme(n));case uI:return n.nextCharCode()===Py?Ime(n):Ome(n);case oV:return{type:"Combinator",value:n.substringToPos(n.pos+(n.nextCharCode()===oV?2:1))};case nV:return n.pos++,n.eat(nV),{type:"Combinator",value:"&&"};case pI:return n.pos++,{type:"Comma"};case Py:return Mf(n,{type:"String",value:Dme(n)});case kme:case yme:case Sme:case Mme:case wme:return{type:"Spaces",value:Ay(n)};case Eme:return o=n.nextCharCode(),o<128&&lv[o]===1?(n.pos++,{type:"AtKeyword",name:wf(n)}):lI(n);case mV:case mI:case cI:case dI:case cV:break;case Iy:if(o=n.nextCharCode(),o<48||o>57)return lI(n);break;default:return lI(n)}}function cv(n){let o=new Dy(n),e=uV(o);return o.pos!==n.length&&o.error("Unexpected input"),e.terms.length===1&&e.terms[0].type==="Group"?e.terms[0]:e}var dv=function(){};function hV(n){return typeof n=="function"?n:dv}function fI(n,o,e){function t(a){switch(i.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 i=dv,r=dv;if(typeof o=="function"?i=o:o&&(i=hV(o.enter),r=hV(o.leave)),i===dv&&r===dv)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");t(n,e)}var Bme={decorator(n){let o=[],e=null;return Ye(Z({},n),{node(t){let i=e;e=t,n.node.call(this,t),e=i},emit(t,i,r){o.push({type:i,value:t,node:r?null:e})},result(){return o}})}};function zme(n){let o=[];return Qm(n,(e,t,i)=>o.push({type:e,value:n.slice(t,i),node:null})),o}function fV(n,o){return typeof n=="string"?zme(n):o.generate(n,Bme)}var qi={type:"Match"},mo={type:"Mismatch"},Fy={type:"DisallowEmpty"},jme=40,$me=41;function Pa(n,o,e){return o===qi&&e===mo||n===qi&&o===qi&&e===qi?n:(n.type==="If"&&n.else===mo&&o===qi&&(o=n.then,n=n.match),{type:"If",match:n,then:o,else:e})}function _V(n){return n.length>2&&n.charCodeAt(n.length-2)===jme&&n.charCodeAt(n.length-1)===$me}function gV(n){return n.type==="Keyword"||n.type==="AtKeyword"||n.type==="Function"||n.type==="Type"&&_V(n.name)}function gI(n,o,e){switch(n){case" ":{let t=qi;for(let i=o.length-1;i>=0;i--){let r=o[i];t=Pa(r,t,mo)}return t}case"|":{let t=mo,i=null;for(let r=o.length-1;r>=0;r--){let a=o[r];if(gV(a)&&(i===null&&r>0&&gV(o[r-1])&&(i=Object.create(null),t=Pa({type:"Enum",map:i},qi,t)),i!==null)){let c=(_V(a.name)?a.name.slice(0,-1):a.name).toLowerCase();if(!(c in i)){i[c]=a;continue}}i=null,t=Pa(a,qi,t)}return t}case"&&":{if(o.length>5)return{type:"MatchOnce",terms:o,all:!0};let t=mo;for(let i=o.length-1;i>=0;i--){let r=o[i],a;o.length>1?a=gI(n,o.filter(function(c){return c!==r}),!1):a=qi,t=Pa(r,a,t)}return t}case"||":{if(o.length>5)return{type:"MatchOnce",terms:o,all:!1};let t=e?qi:mo;for(let i=o.length-1;i>=0;i--){let r=o[i],a;o.length>1?a=gI(n,o.filter(function(c){return c!==r}),!0):a=qi,t=Pa(r,a,t)}return t}}}function Hme(n){let o=qi,e=_I(n.term);if(n.max===0)e=Pa(e,Fy,mo),o=Pa(e,null,mo),o.then=Pa(qi,qi,o),n.comma&&(o.then.else=Pa({type:"Comma",syntax:n},o,mo));else for(let t=n.min||1;t<=n.max;t++)n.comma&&o!==qi&&(o=Pa({type:"Comma",syntax:n},o,mo)),o=Pa(e,Pa(qi,qi,o),mo);if(n.min===0)o=Pa(qi,qi,o);else for(let t=0;t<n.min-1;t++)n.comma&&o!==qi&&(o=Pa({type:"Comma",syntax:n},o,mo)),o=Pa(e,o,mo);return o}function _I(n){if(typeof n=="function")return{type:"Generic",fn:n};switch(n.type){case"Group":{let o=gI(n.combinator,n.terms.map(_I),!1);return n.disallowEmpty&&(o=Pa(o,Fy,mo)),o}case"Multiplier":return Hme(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 Ry(n,o){return typeof n=="string"&&(n=cv(n)),{type:"MatchGraph",match:_I(n),syntax:o||null,source:n}}var{hasOwnProperty:vV}=Object.prototype,Ume=0,Wme=1,CI=2,SV=3,CV="Match",Gme="Mismatch",qme="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",xV=15e3,Qme=0;function Xme(n){let o=null,e=null,t=n;for(;t!==null;)e=t.prev,t.prev=o,o=t,t=e;return o}function vI(n,o){if(n.length!==o.length)return!1;for(let e=0;e<n.length;e++){let t=o.charCodeAt(e),i=n.charCodeAt(e);if(i>=65&&i<=90&&(i=i|32),i!==t)return!1}return!0}function Kme(n){return n.type!==9?!1:n.value!=="?"}function bV(n){return n===null?!0:n.type===18||n.type===2||n.type===21||n.type===19||n.type===23||Kme(n)}function yV(n){return n===null?!0:n.type===22||n.type===20||n.type===24||n.type===9&&n.value==="/"}function Yme(n,o,e){function t(){do E++,S=E<n.length?n[E]:null;while(S!==null&&(S.type===13||S.type===25))}function i(N){let P=E+N;return P<n.length?n[P]:null}function r(N,P){return{nextState:N,matchStack:D,syntaxStack:g,thenStack:y,tokenIndex:E,prev:P}}function a(N){y={nextState:N,matchStack:D,syntaxStack:g,prev:y}}function c(N){b=r(N,b)}function p(){D={type:Wme,syntax:o.syntax,token:S,prev:D},t(),x=null,E>O&&(O=E)}function u(){g={syntax:o.syntax,opts:o.syntax.opts||g!==null&&g.opts||null,prev:g},D={type:CI,syntax:o.syntax,token:D.token,prev:D}}function h(){D.type===CI?D=D.prev:D={type:SV,syntax:g.syntax,token:D.token,prev:D},g=g.prev}let g=null,y=null,b=null,x=null,M=0,w=null,S=null,E=-1,O=0,D={type:Ume,syntax:null,token:null,prev:null};for(t();w===null&&++M<xV;)switch(o.type){case"Match":if(y===null){if(S!==null&&(E!==n.length-1||S.value!=="\\0"&&S.value!=="\\9")){o=mo;break}w=CV;break}if(o=y.nextState,o===Fy)if(y.matchStack===D){o=mo;break}else o=qi;for(;y.syntaxStack!==g;)h();y=y.prev;break;case"Mismatch":if(x!==null&&x!==!1)(b===null||E>b.tokenIndex)&&(b=x,x=!1);else if(b===null){w=Gme;break}o=b.nextState,y=b.thenStack,g=b.syntaxStack,D=b.matchStack,E=b.tokenIndex,S=E<n.length?n[E]:null,b=b.prev;break;case"MatchGraph":o=o.match;break;case"If":o.else!==mo&&c(o.else),o.then!==qi&&a(o.then),o=o.match;break;case"MatchOnce":o={type:"MatchOnceBuffer",syntax:o,index:0,mask:0};break;case"MatchOnceBuffer":{let L=o.syntax.terms;if(o.index===L.length){if(o.mask===0||o.syntax.all){o=mo;break}o=qi;break}if(o.mask===(1<<L.length)-1){o=qi;break}for(;o.index<L.length;o.index++){let se=1<<o.index;if((o.mask&se)===0){c(o),a({type:"AddMatchOnce",syntax:o.syntax,mask:o.mask|se}),o=L[o.index++];break}}break}case"AddMatchOnce":o={type:"MatchOnceBuffer",syntax:o.syntax,index:0,mask:o.mask};break;case"Enum":if(S!==null){let L=S.value.toLowerCase();if(L.indexOf("\\")!==-1&&(L=L.replace(/\\[09].*$/,"")),vV.call(o.map,L)){o=o.map[L];break}}o=mo;break;case"Generic":{let L=g!==null?g.opts:null,se=E+Math.floor(o.fn(S,i,L));if(!isNaN(se)&&se>E){for(;E<se;)p();o=qi}else o=mo;break}case"Type":case"Property":{let L=o.type==="Type"?"types":"properties",se=vV.call(e,L)?e[L][o.name]:null;if(!se||!se.match)throw new Error("Bad syntax reference: "+(o.type==="Type"?"<"+o.name+">":"<'"+o.name+"'>"));if(x!==!1&&S!==null&&o.type==="Type"&&(o.name==="custom-ident"&&S.type===1||o.name==="length"&&S.value==="0")){x===null&&(x=r(o,b)),o=mo;break}u(),o=se.match;break}case"Keyword":{let L=o.name;if(S!==null){let se=S.value;if(se.indexOf("\\")!==-1&&(se=se.replace(/\\[09].*$/,"")),vI(se,L)){p(),o=qi;break}}o=mo;break}case"AtKeyword":case"Function":if(S!==null&&vI(S.value,o.name)){p(),o=qi;break}o=mo;break;case"Token":if(S!==null&&S.value===o.value){p(),o=qi;break}o=mo;break;case"Comma":S!==null&&S.type===18?bV(D.token)?o=mo:(p(),o=yV(S)?mo:qi):o=bV(D.token)||yV(S)?qi:mo;break;case"String":let N="",P=E;for(;P<n.length&&N.length<o.value.length;P++)N+=n[P].value;if(vI(N,o.value)){for(;E<P;)p();o=qi}else o=mo;break;default:throw new Error("Unknown node type: "+o.type)}switch(Qme+=M,w){case null:console.warn("[csstree-match] BREAK after "+xV+" iterations"),w=qme,D=null;break;case CV:for(;g!==null;)h();break;default:D=null}return{tokens:n,reason:w,iterations:M,match:D,longestMatch:O}}function xI(n,o,e){let t=Yme(n,o,e||{});if(t.match===null)return t;let i=t.match,r=t.match={syntax:o.syntax||null,match:[]},a=[r];for(i=Xme(i).prev;i!==null;){switch(i.type){case CI:r.match.push(r={syntax:i.syntax,match:[]}),a.push(r);break;case SV:a.pop(),r=a[a.length-1];break;default:r.match.push({syntax:i.syntax||null,token:i.token.value,node:i.token.node})}i=i.prev}return t}var yI={};Ln(yI,{getTrace:()=>wV,isKeyword:()=>epe,isProperty:()=>Jme,isType:()=>Zme});function wV(n){function o(i){return i===null?!1:i.type==="Type"||i.type==="Property"||i.type==="Keyword"}function e(i){if(Array.isArray(i.match)){for(let r=0;r<i.match.length;r++)if(e(i.match[r]))return o(i.syntax)&&t.unshift(i.syntax),!0}else if(i.node===n)return t=o(i.syntax)?[i.syntax]:[],!0;return!1}let t=null;return this.matched!==null&&e(this.matched),t}function Zme(n,o){return bI(this,n,e=>e.type==="Type"&&e.name===o)}function Jme(n,o){return bI(this,n,e=>e.type==="Property"&&e.name===o)}function epe(n){return bI(this,n,o=>o.type==="Keyword")}function bI(n,o,e){let t=wV.call(n,o);return t===null?!1:t.some(e)}function MV(n){return"node"in n?n.node:MV(n.match[0])}function kV(n){return"node"in n?n.node:kV(n.match[n.match.length-1])}function SI(n,o,e,t,i){function r(c){if(c.syntax!==null&&c.syntax.type===t&&c.syntax.name===i){let p=MV(c),u=kV(c);n.syntax.walk(o,function(h,g,y){if(h===p){let b=new Xa;do{if(b.appendData(g.data),g.data===u)break;g=g.next}while(g!==null);a.push({parent:y,nodes:b})}})}Array.isArray(c.match)&&c.match.forEach(r)}let a=[];return e.matched!==null&&r(e.matched),a}var{hasOwnProperty:mv}=Object.prototype;function wI(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n&&n>=0}function TV(n){return!!n&&wI(n.offset)&&wI(n.line)&&wI(n.column)}function tpe(n,o){return function(t,i){if(!t||t.constructor!==Object)return i(t,"Type of node should be an Object");for(let r in t){let a=!0;if(mv.call(t,r)!==!1){if(r==="type")t.type!==n&&i(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(!TV(t.loc.start))r+=".start";else if(!TV(t.loc.end))r+=".end";else continue;a=!1}else if(o.hasOwnProperty(r)){a=!1;for(let c=0;!a&&c<o[r].length;c++){let p=o[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 Xa)}}}else i(t,"Unknown field `"+r+"` for "+n+" node type");a||i(t,"Bad value for `"+n+"."+r+"`")}}for(let r in o)mv.call(o,r)&&mv.call(t,r)===!1&&i(t,"Field `"+n+"."+r+"` is missed")}}function npe(n,o){let e=o.structure,t={type:String,loc:!0},i={type:'"'+n+'"'};for(let r in e){if(mv.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")}i[r]=a.join(" | ")}return{docs:i,check:tpe(n,t)}}function EV(n){let o={};if(n.node){for(let e in n.node)if(mv.call(n.node,e)){let t=n.node[e];if(t.structure)o[e]=npe(e,t);else throw new Error("Missed `structure` field in `"+e+"` node type definition")}}return o}var ipe=Ry(My.join(" | "));function MI(n,o,e){let t={};for(let i in n)n[i].syntax&&(t[i]=e?n[i].syntax:xf(n[i].syntax,{compact:o}));return t}function ope(n,o,e){let t={};for(let[i,r]of Object.entries(n))t[i]={prelude:r.prelude&&(e?r.prelude.syntax:xf(r.prelude.syntax,{compact:o})),descriptors:r.descriptors&&MI(r.descriptors,o,e)};return t}function rpe(n){for(let o=0;o<n.length;o++)if(n[o].value.toLowerCase()==="var(")return!0;return!1}function ic(n,o,e){return Z({matched:n,iterations:e,error:o},yI)}function kf(n,o,e,t){let i=fV(e,n.syntax),r;return rpe(i)?ic(null,new Error("Matching for a tree with var() is not supported")):(t&&(r=xI(i,n.cssWideKeywordsSyntax,n)),(!t||!r.match)&&(r=xI(i,o.match,n),!r.match)?ic(null,new q7(r.reason,o.syntax,e,r),r.iterations):ic(r.match,null,r.iterations))}var Tf=class{constructor(o,e,t){if(this.cssWideKeywordsSyntax=ipe,this.syntax=e,this.generic=!1,this.units=Z({},Ey),this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=t||EV(o),o){if(o.units)for(let i of Object.keys(Ey))Array.isArray(o.units[i])&&(this.units[i]=o.units[i]);if(o.types)for(let i in o.types)this.addType_(i,o.types[i]);if(o.generic){this.generic=!0;for(let[i,r]of Object.entries(tV(this.units)))this.addType_(i,r)}if(o.atrules)for(let i in o.atrules)this.addAtrule_(i,o.atrules[i]);if(o.properties)for(let i in o.properties)this.addProperty_(i,o.properties[i])}}checkStructure(o){function e(r,a){i.push({node:r,message:a})}let t=this.structure,i=[];return this.syntax.walk(o,function(r){t.hasOwnProperty(r.type)?t[r.type].check(r,e):e(r,"Unknown node type `"+r.type+"`")}),i.length?i:!1}createDescriptor(o,e,t,i=null){let r={type:e,name:t},a={type:e,name:t,parent:i,serializable:typeof o=="string"||o&&typeof o.type=="string",syntax:null,match:null};return typeof o=="function"?a.match=Ry(o,r):(typeof o=="string"?Object.defineProperty(a,"syntax",{get(){return Object.defineProperty(a,"syntax",{value:cv(o)}),a.syntax}}):a.syntax=o,Object.defineProperty(a,"match",{get(){return Object.defineProperty(a,"match",{value:Ry(a.syntax,r)}),a.match}})),a}addAtrule_(o,e){e&&(this.atrules[o]={type:"Atrule",name:o,prelude:e.prelude?this.createDescriptor(e.prelude,"AtrulePrelude",o):null,descriptors:e.descriptors?Object.keys(e.descriptors).reduce((t,i)=>(t[i]=this.createDescriptor(e.descriptors[i],"AtruleDescriptor",i,o),t),Object.create(null)):null})}addProperty_(o,e){e&&(this.properties[o]=this.createDescriptor(e,"Property",o))}addType_(o,e){e&&(this.types[o]=this.createDescriptor(e,"Type",o))}checkAtruleName(o){if(!this.getAtrule(o))return new bf("Unknown at-rule","@"+o)}checkAtrulePrelude(o,e){let t=this.checkAtruleName(o);if(t)return t;let i=this.getAtrule(o);if(!i.prelude&&e)return new SyntaxError("At-rule `@"+o+"` should not contain a prelude");if(i.prelude&&!e&&!kf(this,i.prelude,"",!1).matched)return new SyntaxError("At-rule `@"+o+"` should contain a prelude")}checkAtruleDescriptorName(o,e){let t=this.checkAtruleName(o);if(t)return t;let i=this.getAtrule(o),r=Sy(e);if(!i.descriptors)return new SyntaxError("At-rule `@"+o+"` has no known descriptors");if(!i.descriptors[r.name]&&!i.descriptors[r.basename])return new bf("Unknown at-rule descriptor",e)}checkPropertyName(o){if(!this.getProperty(o))return new bf("Unknown property",o)}matchAtrulePrelude(o,e){let t=this.checkAtrulePrelude(o,e);if(t)return ic(null,t);let i=this.getAtrule(o);return i.prelude?kf(this,i.prelude,e||"",!1):ic(null,null)}matchAtruleDescriptor(o,e,t){let i=this.checkAtruleDescriptorName(o,e);if(i)return ic(null,i);let r=this.getAtrule(o),a=Sy(e);return kf(this,r.descriptors[a.name]||r.descriptors[a.basename],t,!1)}matchDeclaration(o){return o.type!=="Declaration"?ic(null,new Error("Not a Declaration node")):this.matchProperty(o.property,o.value)}matchProperty(o,e){if(JP(o).custom)return ic(null,new Error("Lexer matching doesn't applicable for custom properties"));let t=this.checkPropertyName(o);return t?ic(null,t):kf(this,this.getProperty(o),e,!0)}matchType(o,e){let t=this.getType(o);return t?kf(this,t,e,!1):ic(null,new bf("Unknown type",o))}match(o,e){return typeof o!="string"&&(!o||!o.type)?ic(null,new bf("Bad syntax")):((typeof o=="string"||!o.match)&&(o=this.createDescriptor(o,"Type","anonymous")),kf(this,o,e,!1))}findValueFragments(o,e,t,i){return SI(this,e,this.matchProperty(o,e),t,i)}findDeclarationValueFragments(o,e,t){return SI(this,o.value,this.matchDeclaration(o),e,t)}findAllFragments(o,e,t){let i=[];return this.syntax.walk(o,{visit:"Declaration",enter:r=>{i.push.apply(i,this.findDeclarationValueFragments(r,e,t))}}),i}getAtrule(o,e=!0){let t=Sy(o);return(t.vendor&&e?this.atrules[t.name]||this.atrules[t.basename]:this.atrules[t.name])||null}getAtrulePrelude(o,e=!0){let t=this.getAtrule(o,e);return t&&t.prelude||null}getAtruleDescriptor(o,e){return this.atrules.hasOwnProperty(o)&&this.atrules.declarators&&this.atrules[o].declarators[e]||null}getProperty(o,e=!0){let t=JP(o);return(t.vendor&&e?this.properties[t.name]||this.properties[t.basename]:this.properties[t.name])||null}getType(o){return hasOwnProperty.call(this.types,o)?this.types[o]:null}validate(){function o(i,r,a,c){if(a.has(r))return a.get(r);a.set(r,!1),c.syntax!==null&&fI(c.syntax,function(p){if(p.type!=="Type"&&p.type!=="Property")return;let u=p.type==="Type"?i.types:i.properties,h=p.type==="Type"?e:t;(!hasOwnProperty.call(u,p.name)||o(i,p.name,h,u[p.name]))&&a.set(r,!0)},this)}let e=new Map,t=new Map;for(let i in this.types)o(this,i,e,this.types[i]);for(let i in this.properties)o(this,i,t,this.properties[i]);return e=[...e.keys()].filter(i=>e.get(i)),t=[...t.keys()].filter(i=>t.get(i)),e.length||t.length?{types:e,properties:t}:null}dump(o,e){return{generic:this.generic,units:this.units,types:MI(this.types,!e,o),properties:MI(this.properties,!e,o),atrules:ope(this.atrules,!e,o)}}toString(){return JSON.stringify(this.dump())}};function kI(n,o){return typeof o=="string"&&/^\s*\|/.test(o)?typeof n=="string"?n+o:o.replace(/^\s*\|\s*/,""):o||null}function DV(n,o){let e=Object.create(null);for(let[t,i]of Object.entries(n))if(i){e[t]={};for(let r of Object.keys(i))o.includes(r)&&(e[t][r]=i[r])}return e}function pv(n,o){let e=Z({},n);for(let[t,i]of Object.entries(o))switch(t){case"generic":e[t]=!!i;break;case"units":e[t]=Z({},n[t]);for(let[r,a]of Object.entries(i))e[t][r]=Array.isArray(a)?a:[];break;case"atrules":e[t]=Z({},n[t]);for(let[r,a]of Object.entries(i)){let c=e[t][r]||{},p=e[t][r]={prelude:c.prelude||null,descriptors:Z({},c.descriptors)};if(a){p.prelude=a.prelude?kI(p.prelude,a.prelude):p.prelude||null;for(let[u,h]of Object.entries(a.descriptors||{}))p.descriptors[u]=h?kI(p.descriptors[u],h):null;Object.keys(p.descriptors).length||(p.descriptors=null)}}break;case"types":case"properties":e[t]=Z({},n[t]);for(let[r,a]of Object.entries(i))e[t][r]=kI(e[t][r],a);break;case"scope":e[t]=Z({},n[t]);for(let[r,a]of Object.entries(i))e[t][r]=Z(Z({},e[t][r]),a);break;case"parseContext":e[t]=Z(Z({},n[t]),i);break;case"atrule":case"pseudo":e[t]=Z(Z({},n[t]),DV(i,["parse"]));break;case"node":e[t]=Z(Z({},n[t]),DV(i,["name","structure","parse","generate","walkContext"]));break}return e}function PV(n){let o=h7(n),e=W7(n),t=B7(n),{fromPlainObject:i,toPlainObject:r}=z7(e),a={lexer:null,createLexer:c=>new Tf(c,a,a.lexer.structure),tokenize:Qm,parse:o,generate:t,walk:e,find:e.find,findLast:e.findLast,findAll:e.findAll,fromPlainObject:i,toPlainObject:r,fork(c){let p=pv({},n);return PV(typeof c=="function"?c(p,Object.assign):pv(p,c))}};return a.lexer=new Tf({generic:!0,units:n.units,types:n.types,atrules:n.atrules,properties:n.properties,node:n.node},a),a}var TI=n=>PV(pv({},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 hv={};Ln(hv,{AnPlusB:()=>PI,Atrule:()=>AI,AtrulePrelude:()=>NI,AttributeSelector:()=>LI,Block:()=>BI,Brackets:()=>jI,CDC:()=>HI,CDO:()=>WI,ClassSelector:()=>qI,Combinator:()=>XI,Comment:()=>YI,Declaration:()=>JI,DeclarationList:()=>n3,Dimension:()=>o3,Function:()=>a3,Hash:()=>l3,IdSelector:()=>p3,Identifier:()=>d3,MediaFeature:()=>h3,MediaQuery:()=>g3,MediaQueryList:()=>v3,NestingSelector:()=>x3,Nth:()=>y3,Number:()=>w3,Operator:()=>k3,Parentheses:()=>E3,Percentage:()=>P3,PseudoClassSelector:()=>A3,PseudoElementSelector:()=>N3,Ratio:()=>R3,Raw:()=>V3,Rule:()=>z3,Selector:()=>$3,SelectorList:()=>U3,String:()=>q3,StyleSheet:()=>X3,TypeSelector:()=>Z3,UnicodeRange:()=>tA,Url:()=>oA,Value:()=>aA,WhiteSpace:()=>lA});var PI={};Ln(PI,{generate:()=>cpe,name:()=>spe,parse:()=>DI,structure:()=>lpe});var Zc=43,js=45,Ly=110,wu=!0,ape=!1;function Vy(n,o){let e=this.tokenStart+n,t=this.charCodeAt(e);for((t===Zc||t===js)&&(o&&this.error("Number sign is not allowed"),e++);e<this.tokenEnd;e++)ir(this.charCodeAt(e))||this.error("Integer is expected",e)}function Ef(n){return Vy.call(this,0,n)}function Km(n,o){if(!this.cmpChar(this.tokenStart+n,o)){let e="";switch(o){case Ly:e="N is expected";break;case js:e="HyphenMinus is expected";break}this.error(e,this.tokenStart+n)}}function EI(){let n=0,o=0,e=this.tokenType;for(;e===13||e===25;)e=this.lookupType(++n);if(e!==10)if(this.isDelim(Zc,n)||this.isDelim(js,n)){o=this.isDelim(Zc,n)?Zc:js;do e=this.lookupType(++n);while(e===13||e===25);e!==10&&(this.skip(n),Ef.call(this,wu))}else return null;return n>0&&this.skip(n),o===0&&(e=this.charCodeAt(this.tokenStart),e!==Zc&&e!==js&&this.error("Number sign is expected")),Ef.call(this,o!==0),o===js?"-"+this.consume(10):this.consume(10)}var spe="AnPlusB",lpe={a:[String,null],b:[String,null]};function DI(){let n=this.tokenStart,o=null,e=null;if(this.tokenType===10)Ef.call(this,ape),e=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,js))switch(o="-1",Km.call(this,1,Ly),this.tokenEnd-this.tokenStart){case 2:this.next(),e=EI.call(this);break;case 3:Km.call(this,2,js),this.next(),this.skipSC(),Ef.call(this,wu),e="-"+this.consume(10);break;default:Km.call(this,2,js),Vy.call(this,3,wu),this.next(),e=this.substrToCursor(n+2)}else if(this.tokenType===1||this.isDelim(Zc)&&this.lookupType(1)===1){let t=0;switch(o="1",this.isDelim(Zc)&&(t=1,this.next()),Km.call(this,0,Ly),this.tokenEnd-this.tokenStart){case 1:this.next(),e=EI.call(this);break;case 2:Km.call(this,1,js),this.next(),this.skipSC(),Ef.call(this,wu),e="-"+this.consume(10);break;default:Km.call(this,1,js),Vy.call(this,2,wu),this.next(),e=this.substrToCursor(n+t+1)}}else if(this.tokenType===12){let t=this.charCodeAt(this.tokenStart),i=t===Zc||t===js,r=this.tokenStart+i;for(;r<this.tokenEnd&&ir(this.charCodeAt(r));r++);r===this.tokenStart+i&&this.error("Integer is expected",this.tokenStart+i),Km.call(this,r-this.tokenStart,Ly),o=this.substring(n,r),r+1===this.tokenEnd?(this.next(),e=EI.call(this)):(Km.call(this,r-this.tokenStart+1,js),r+2===this.tokenEnd?(this.next(),this.skipSC(),Ef.call(this,wu),e="-"+this.consume(10)):(Vy.call(this,r-this.tokenStart+2,wu),this.next(),e=this.substrToCursor(r+1)))}else this.error();return o!==null&&o.charCodeAt(0)===Zc&&(o=o.substr(1)),e!==null&&e.charCodeAt(0)===Zc&&(e=e.substr(1)),{type:"AnPlusB",loc:this.getLocation(n,this.tokenStart),a:o,b:e}}function cpe(n){if(n.a){let o=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(o+e)}else this.tokenize(o)}else this.tokenize(n.b)}var AI={};Ln(AI,{generate:()=>hpe,name:()=>mpe,parse:()=>II,structure:()=>upe,walkContext:()=>ppe});function AV(n){return this.Raw(n,this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function dpe(){for(let n=1,o;o=this.lookupType(n);n++){if(o===24)return!0;if(o===23||o===3)return!1}return!1}var mpe="Atrule",ppe="atrule",upe={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function II(n=!1){let o=this.tokenStart,e,t,i=null,r=null;switch(this.eat(3),e=this.substrToCursor(o+1),t=e.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==23&&this.tokenType!==17&&(this.parseAtrulePrelude?i=this.parseWithFallback(this.AtrulePrelude.bind(this,e,n),AV):i=AV.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(dpe.call(this));break}return{type:"Atrule",loc:this.getLocation(o,this.tokenStart),name:e,prelude:i,block:r}}function hpe(n){this.token(3,"@"+n.name),n.prelude!==null&&this.node(n.prelude),n.block?this.node(n.block):this.token(17,";")}var NI={};Ln(NI,{generate:()=>vpe,name:()=>fpe,parse:()=>OI,structure:()=>_pe,walkContext:()=>gpe});var fpe="AtrulePrelude",gpe="atrulePrelude",_pe={children:[[]]};function OI(n){let o=null;return n!==null&&(n=n.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,n)&&typeof this.atrule[n].prelude=="function"?o=this.atrule[n].prelude.call(this):o=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(o),children:o}}function vpe(n){this.children(n)}var LI={};Ln(LI,{generate:()=>kpe,name:()=>wpe,parse:()=>RI,structure:()=>Mpe});var Cpe=36,OV=42,By=61,xpe=94,FI=124,bpe=126;function ype(){this.eof&&this.error("Unexpected end of input");let n=this.tokenStart,o=!1;return this.isDelim(OV)?(o=!0,this.next()):this.isDelim(FI)||this.eat(1),this.isDelim(FI)?this.charCodeAt(this.tokenStart+1)!==By?(this.next(),this.eat(1)):o&&this.error("Identifier is expected",this.tokenEnd):o&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(n,this.tokenStart),name:this.substrToCursor(n)}}function Spe(){let n=this.tokenStart,o=this.charCodeAt(n);return o!==By&&o!==bpe&&o!==xpe&&o!==Cpe&&o!==OV&&o!==FI&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),o!==By&&(this.isDelim(By)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(n)}var wpe="AttributeSelector",Mpe={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function RI(){let n=this.tokenStart,o,e=null,t=null,i=null;return this.eat(19),this.skipSC(),o=ype.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(e=Spe.call(this),this.skipSC(),t=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(i=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(n,this.tokenStart),name:o,matcher:e,value:t,flags:i}}function kpe(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:()=>Ape,name:()=>Dpe,parse:()=>VI,structure:()=>Ipe,walkContext:()=>Ppe});var Tpe=38;function RV(n){return this.Raw(n,null,!0)}function NV(){return this.parseWithFallback(this.Rule,RV)}function FV(n){return this.Raw(n,this.consumeUntilSemicolonIncluded,!0)}function Epe(){if(this.tokenType===17)return FV.call(this,this.tokenIndex);let n=this.parseWithFallback(this.Declaration,FV);return this.tokenType===17&&this.next(),n}var Dpe="Block",Ppe="block",Ipe={children:[["Atrule","Rule","Declaration"]]};function VI(n){let o=n?Epe:NV,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),RV));break;default:n&&this.isDelim(Tpe)?t.push(NV.call(this)):t.push(o.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(e,this.tokenStart),children:t}}function Ape(n){this.token(23,"{"),this.children(n,o=>{o.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var jI={};Ln(jI,{generate:()=>Fpe,name:()=>Ope,parse:()=>zI,structure:()=>Npe});var Ope="Brackets",Npe={children:[[]]};function zI(n,o){let e=this.tokenStart,t=null;return this.eat(19),t=n.call(this,o),this.eof||this.eat(20),{type:"Brackets",loc:this.getLocation(e,this.tokenStart),children:t}}function Fpe(n){this.token(9,"["),this.children(n),this.token(9,"]")}var HI={};Ln(HI,{generate:()=>Vpe,name:()=>Rpe,parse:()=>$I,structure:()=>Lpe});var Rpe="CDC",Lpe=[];function $I(){let n=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(n,this.tokenStart)}}function Vpe(){this.token(15,"-->")}var WI={};Ln(WI,{generate:()=>jpe,name:()=>Bpe,parse:()=>UI,structure:()=>zpe});var Bpe="CDO",zpe=[];function UI(){let n=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(n,this.tokenStart)}}function jpe(){this.token(14,"<!--")}var qI={};Ln(qI,{generate:()=>Wpe,name:()=>Hpe,parse:()=>GI,structure:()=>Upe});var $pe=46,Hpe="ClassSelector",Upe={name:String};function GI(){return this.eatDelim($pe),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function Wpe(n){this.token(9,"."),this.token(1,n.name)}var XI={};Ln(XI,{generate:()=>Ype,name:()=>Xpe,parse:()=>QI,structure:()=>Kpe});var Gpe=43,LV=47,qpe=62,Qpe=126,Xpe="Combinator",Kpe={name:String};function QI(){let n=this.tokenStart,o;switch(this.tokenType){case 13:o=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case qpe:case Gpe:case Qpe:this.next();break;case LV:this.next(),this.eatIdent("deep"),this.eatDelim(LV);break;default:this.error("Combinator is expected")}o=this.substrToCursor(n);break}return{type:"Combinator",loc:this.getLocation(n,this.tokenStart),name:o}}function Ype(n){this.tokenize(n.name)}var YI={};Ln(YI,{generate:()=>nue,name:()=>eue,parse:()=>KI,structure:()=>tue});var Zpe=42,Jpe=47,eue="Comment",tue={value:String};function KI(){let n=this.tokenStart,o=this.tokenEnd;return this.eat(25),o-n+2>=2&&this.charCodeAt(o-2)===Zpe&&this.charCodeAt(o-1)===Jpe&&(o-=2),{type:"Comment",loc:this.getLocation(n,this.tokenStart),value:this.substring(n+2,o)}}function nue(n){this.token(25,"/*"+n.value+"*/")}var JI={};Ln(JI,{generate:()=>hue,name:()=>mue,parse:()=>ZI,structure:()=>uue,walkContext:()=>pue});var BV=33,iue=35,oue=36,rue=38,aue=42,sue=43,VV=47;function lue(n){return this.Raw(n,this.consumeUntilExclamationMarkOrSemicolon,!0)}function cue(n){return this.Raw(n,this.consumeUntilExclamationMarkOrSemicolon,!1)}function due(){let n=this.tokenIndex,o=this.Value();return o.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(BV)===!1&&this.isBalanceEdge(n)===!1&&this.error(),o}var mue="Declaration",pue="declaration",uue={important:[Boolean,String],property:String,value:["Value","Raw"]};function ZI(){let n=this.tokenStart,o=this.tokenIndex,e=fue.call(this),t=wy(e),i=t?this.parseCustomProperty:this.parseValue,r=t?cue:lue,a=!1,c;this.skipSC(),this.eat(16);let p=this.tokenIndex;if(t||this.skipSC(),i?c=this.parseWithFallback(due,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(BV)&&(a=gue.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==17&&this.isBalanceEdge(o)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(n,this.tokenStart),important:a,property:e,value:c}}function hue(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 fue(){let n=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case aue:case oue:case sue:case iue:case rue:this.next();break;case VV:this.next(),this.isDelim(VV)&&this.next();break}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(n)}function gue(){this.eat(9),this.skipSC();let n=this.consume(1);return n==="important"?!0:n}var n3={};Ln(n3,{generate:()=>xue,name:()=>vue,parse:()=>t3,structure:()=>Cue});var _ue=38;function e3(n){return this.Raw(n,this.consumeUntilSemicolonIncluded,!0)}var vue="DeclarationList",Cue={children:[["Declaration","Atrule","Rule"]]};function t3(){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),e3));break;default:this.isDelim(_ue)?n.push(this.parseWithFallback(this.Rule,e3)):n.push(this.parseWithFallback(this.Declaration,e3))}return{type:"DeclarationList",loc:this.getLocationFromList(n),children:n}}function xue(n){this.children(n,o=>{o.type==="Declaration"&&this.token(17,";")})}var o3={};Ln(o3,{generate:()=>Sue,name:()=>bue,parse:()=>i3,structure:()=>yue});var bue="Dimension",yue={value:String,unit:String};function i3(){let n=this.tokenStart,o=this.consumeNumber(12);return{type:"Dimension",loc:this.getLocation(n,this.tokenStart),value:o,unit:this.substring(n+o.length,this.tokenStart)}}function Sue(n){this.token(12,n.value+n.unit)}var a3={};Ln(a3,{generate:()=>Tue,name:()=>wue,parse:()=>r3,structure:()=>kue,walkContext:()=>Mue});var wue="Function",Mue="function",kue={name:String,children:[[]]};function r3(n,o){let e=this.tokenStart,t=this.consumeFunctionName(),i=t.toLowerCase(),r;return r=o.hasOwnProperty(i)?o[i].call(this,o):n.call(this,o),this.eof||this.eat(22),{type:"Function",loc:this.getLocation(e,this.tokenStart),name:t,children:r}}function Tue(n){this.token(2,n.name+"("),this.children(n),this.token(22,")")}var l3={};Ln(l3,{generate:()=>Iue,name:()=>Due,parse:()=>s3,structure:()=>Pue,xxx:()=>Eue});var Eue="XXX",Due="Hash",Pue={value:String};function s3(){let n=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(n,this.tokenStart),value:this.substrToCursor(n+1)}}function Iue(n){this.token(4,"#"+n.value)}var d3={};Ln(d3,{generate:()=>Nue,name:()=>Aue,parse:()=>c3,structure:()=>Oue});var Aue="Identifier",Oue={name:String};function c3(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function Nue(n){this.token(1,n.name)}var p3={};Ln(p3,{generate:()=>Lue,name:()=>Fue,parse:()=>m3,structure:()=>Rue});var Fue="IdSelector",Rue={name:String};function m3(){let n=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(n,this.tokenStart),name:this.substrToCursor(n+1)}}function Lue(n){this.token(9,"#"+n.name)}var h3={};Ln(h3,{generate:()=>zue,name:()=>Vue,parse:()=>u3,structure:()=>Bue});var Vue="MediaFeature",Bue={name:String,value:["Identifier","Number","Dimension","Ratio",null]};function u3(){let n=this.tokenStart,o,e=null;if(this.eat(21),this.skipSC(),o=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:o,value:e}}function zue(n){this.token(21,"("),this.token(1,n.name),n.value!==null&&(this.token(16,":"),this.node(n.value)),this.token(22,")")}var g3={};Ln(g3,{generate:()=>Hue,name:()=>jue,parse:()=>f3,structure:()=>$ue});var jue="MediaQuery",$ue={children:[["Identifier","MediaFeature","WhiteSpace"]]};function f3(){let n=this.createList(),o=null;this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 25:case 13:this.next();continue;case 1:o=this.Identifier();break;case 21:o=this.MediaFeature();break;default:break e}n.push(o)}return o===null&&this.error("Identifier or parenthesis is expected"),{type:"MediaQuery",loc:this.getLocationFromList(n),children:n}}function Hue(n){this.children(n)}var v3={};Ln(v3,{generate:()=>Gue,name:()=>Uue,parse:()=>_3,structure:()=>Wue});var Uue="MediaQueryList",Wue={children:[["MediaQuery"]]};function _3(){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 Gue(n){this.children(n,()=>this.token(18,","))}var x3={};Ln(x3,{generate:()=>Kue,name:()=>Que,parse:()=>C3,structure:()=>Xue});var que=38,Que="NestingSelector",Xue={};function C3(){let n=this.tokenStart;return this.eatDelim(que),{type:"NestingSelector",loc:this.getLocation(n,this.tokenStart)}}function Kue(){this.token(9,"&")}var y3={};Ln(y3,{generate:()=>Jue,name:()=>Yue,parse:()=>b3,structure:()=>Zue});var Yue="Nth",Zue={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function b3(){this.skipSC();let n=this.tokenStart,o=n,e=null,t;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?t=this.Identifier():t=this.AnPlusB(),o=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),e=this.SelectorList(),o=this.tokenStart),{type:"Nth",loc:this.getLocation(n,o),nth:t,selector:e}}function Jue(n){this.node(n.nth),n.selector!==null&&(this.token(1,"of"),this.node(n.selector))}var w3={};Ln(w3,{generate:()=>nhe,name:()=>ehe,parse:()=>S3,structure:()=>the});var ehe="Number",the={value:String};function S3(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function nhe(n){this.token(10,n.value)}var k3={};Ln(k3,{generate:()=>rhe,name:()=>ihe,parse:()=>M3,structure:()=>ohe});var ihe="Operator",ohe={value:String};function M3(){let n=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(n,this.tokenStart),value:this.substrToCursor(n)}}function rhe(n){this.tokenize(n.value)}var E3={};Ln(E3,{generate:()=>lhe,name:()=>ahe,parse:()=>T3,structure:()=>she});var ahe="Parentheses",she={children:[[]]};function T3(n,o){let e=this.tokenStart,t=null;return this.eat(21),t=n.call(this,o),this.eof||this.eat(22),{type:"Parentheses",loc:this.getLocation(e,this.tokenStart),children:t}}function lhe(n){this.token(21,"("),this.children(n),this.token(22,")")}var P3={};Ln(P3,{generate:()=>mhe,name:()=>che,parse:()=>D3,structure:()=>dhe});var che="Percentage",dhe={value:String};function D3(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function mhe(n){this.token(11,n.value+"%")}var A3={};Ln(A3,{generate:()=>fhe,name:()=>phe,parse:()=>I3,structure:()=>hhe,walkContext:()=>uhe});var phe="PseudoClassSelector",uhe="function",hhe={name:String,children:[["Raw"],null]};function I3(){let n=this.tokenStart,o=null,e,t;return this.eat(16),this.tokenType===2?(e=this.consumeFunctionName(),t=e.toLowerCase(),hasOwnProperty.call(this.pseudo,t)?(this.skipSC(),o=this.pseudo[t].call(this),this.skipSC()):(o=this.createList(),o.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:o}}function fhe(n){this.token(16,":"),n.children===null?this.token(1,n.name):(this.token(2,n.name+"("),this.children(n),this.token(22,")"))}var N3={};Ln(N3,{generate:()=>Che,name:()=>ghe,parse:()=>O3,structure:()=>vhe,walkContext:()=>_he});var ghe="PseudoElementSelector",_he="function",vhe={name:String,children:[["Raw"],null]};function O3(){let n=this.tokenStart,o=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(),o=this.pseudo[t].call(this),this.skipSC()):(o=this.createList(),o.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:o}}function Che(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 R3={};Ln(R3,{generate:()=>whe,name:()=>yhe,parse:()=>F3,structure:()=>She});var xhe=47,bhe=46;function zV(){this.skipSC();let n=this.consume(10);for(let o=0;o<n.length;o++){let e=n.charCodeAt(o);!ir(e)&&e!==bhe&&this.error("Unsigned number is expected",this.tokenStart-n.length+o)}return Number(n)===0&&this.error("Zero number is not allowed",this.tokenStart-n.length),n}var yhe="Ratio",She={left:String,right:String};function F3(){let n=this.tokenStart,o=zV.call(this),e;return this.skipSC(),this.eatDelim(xhe),e=zV.call(this),{type:"Ratio",loc:this.getLocation(n,this.tokenStart),left:o,right:e}}function whe(n){this.token(10,n.left),this.token(9,"/"),this.token(10,n.right)}var V3={};Ln(V3,{generate:()=>Ehe,name:()=>khe,parse:()=>L3,structure:()=>The});function Mhe(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var khe="Raw",The={value:String};function L3(n,o,e){let t=this.getTokenStart(n),i;return this.skipUntilBalanced(n,o||this.consumeUntilBalanceEnd),e&&this.tokenStart>t?i=Mhe.call(this):i=this.tokenStart,{type:"Raw",loc:this.getLocation(t,i),value:this.substring(t,i)}}function Ehe(n){this.tokenize(n.value)}var z3={};Ln(z3,{generate:()=>Ohe,name:()=>Phe,parse:()=>B3,structure:()=>Ahe,walkContext:()=>Ihe});function jV(n){return this.Raw(n,this.consumeUntilLeftCurlyBracket,!0)}function Dhe(){let n=this.SelectorList();return n.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),n}var Phe="Rule",Ihe="rule",Ahe={prelude:["SelectorList","Raw"],block:["Block"]};function B3(){let n=this.tokenIndex,o=this.tokenStart,e,t;return this.parseRulePrelude?e=this.parseWithFallback(Dhe,jV):e=jV.call(this,n),t=this.Block(!0),{type:"Rule",loc:this.getLocation(o,this.tokenStart),prelude:e,block:t}}function Ohe(n){this.node(n.prelude),this.node(n.block)}var $3={};Ln($3,{generate:()=>Rhe,name:()=>Nhe,parse:()=>j3,structure:()=>Fhe});var Nhe="Selector",Fhe={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]};function j3(){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 Rhe(n){this.children(n)}var U3={};Ln(U3,{generate:()=>zhe,name:()=>Lhe,parse:()=>H3,structure:()=>Bhe,walkContext:()=>Vhe});var Lhe="SelectorList",Vhe="selector",Bhe={children:[["Selector","Raw"]]};function H3(){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 zhe(n){this.children(n,()=>this.token(18,","))}var q3={};Ln(q3,{generate:()=>Hhe,name:()=>jhe,parse:()=>G3,structure:()=>$he});var W3=92,$V=34,HV=39;function zy(n){let o=n.length,e=n.charCodeAt(0),t=e===$V||e===HV?1:0,i=t===1&&o>1&&n.charCodeAt(o-1)===e?o-2:o-1,r="";for(let a=t;a<=i;a++){let c=n.charCodeAt(a);if(c===W3){if(a===i){a!==o-1&&(r=n.substr(a+1));break}if(c=n.charCodeAt(++a),Qa(W3,c)){let p=a-1,u=Kc(n,p);a=u-1,r+=Z0(n.substring(p+1,u))}else c===13&&n.charCodeAt(a+1)===10&&a++}else r+=n[a]}return r}function UV(n,o){let e=o?"'":'"',t=o?HV:$V,i="",r=!1;for(let a=0;a<n.length;a++){let c=n.charCodeAt(a);if(c===0){i+="\uFFFD";continue}if(c<=31||c===127){i+="\\"+c.toString(16),r=!0;continue}c===t||c===W3?(i+="\\"+n.charAt(a),r=!1):(r&&(Cs(c)||Xc(c))&&(i+=" "),i+=n.charAt(a),r=!1)}return e+i+e}var jhe="String",$he={value:String};function G3(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:zy(this.consume(5))}}function Hhe(n){this.token(5,UV(n.value))}var X3={};Ln(X3,{generate:()=>Qhe,name:()=>Whe,parse:()=>Q3,structure:()=>qhe,walkContext:()=>Ghe});var Uhe=33;function GV(n){return this.Raw(n,null,!1)}var Whe="StyleSheet",Ghe="stylesheet",qhe={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function Q3(){let n=this.tokenStart,o=this.createList(),e;for(;!this.eof;){switch(this.tokenType){case 13:this.next();continue;case 25:if(this.charCodeAt(this.tokenStart+2)!==Uhe){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,GV);break;default:e=this.parseWithFallback(this.Rule,GV)}o.push(e)}return{type:"StyleSheet",loc:this.getLocation(n,this.tokenStart),children:o}}function Qhe(n){this.children(n)}var Z3={};Ln(Z3,{generate:()=>Zhe,name:()=>Khe,parse:()=>Y3,structure:()=>Yhe});var Xhe=42,qV=124;function K3(){this.tokenType!==1&&this.isDelim(Xhe)===!1&&this.error("Identifier or asterisk is expected"),this.next()}var Khe="TypeSelector",Yhe={name:String};function Y3(){let n=this.tokenStart;return this.isDelim(qV)?(this.next(),K3.call(this)):(K3.call(this),this.isDelim(qV)&&(this.next(),K3.call(this))),{type:"TypeSelector",loc:this.getLocation(n,this.tokenStart),name:this.substrToCursor(n)}}function Zhe(n){this.tokenize(n.name)}var tA={};Ln(tA,{generate:()=>ife,name:()=>tfe,parse:()=>eA,structure:()=>nfe});var QV=43,XV=45,J3=63;function uv(n,o){let e=0;for(let t=this.tokenStart+n;t<this.tokenEnd;t++){let i=this.charCodeAt(t);if(i===XV&&o&&e!==0)return uv.call(this,n+e+1,!1),-1;Cs(i)||this.error(o&&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 jy(n){let o=0;for(;this.isDelim(J3);)++o>n&&this.error("Too many question marks"),this.next()}function Jhe(n){this.charCodeAt(this.tokenStart)!==n&&this.error((n===QV?"Plus sign":"Hyphen minus")+" is expected")}function efe(){let n=0;switch(this.tokenType){case 10:if(n=uv.call(this,1,!0),this.isDelim(J3)){jy.call(this,6-n);break}if(this.tokenType===12||this.tokenType===10){Jhe.call(this,XV),uv.call(this,1,!1);break}break;case 12:n=uv.call(this,1,!0),n>0&&jy.call(this,6-n);break;default:if(this.eatDelim(QV),this.tokenType===1){n=uv.call(this,0,!0),n>0&&jy.call(this,6-n);break}if(this.isDelim(J3)){this.next(),jy.call(this,5);break}this.error("Hex digit or question mark is expected")}}var tfe="UnicodeRange",nfe={value:String};function eA(){let n=this.tokenStart;return this.eatIdent("u"),efe.call(this),{type:"UnicodeRange",loc:this.getLocation(n,this.tokenStart),value:this.substrToCursor(n)}}function ife(n){this.tokenize(n.value)}var oA={};Ln(oA,{generate:()=>dfe,name:()=>lfe,parse:()=>iA,structure:()=>cfe});var ofe=32,nA=92,rfe=34,afe=39,sfe=40,KV=41;function YV(n){let o=n.length,e=4,t=n.charCodeAt(o-1)===KV?o-2:o-1,i="";for(;e<t&&Xc(n.charCodeAt(e));)e++;for(;e<t&&Xc(n.charCodeAt(t));)t--;for(let r=e;r<=t;r++){let a=n.charCodeAt(r);if(a===nA){if(r===t){r!==o-1&&(i=n.substr(r+1));break}if(a=n.charCodeAt(++r),Qa(nA,a)){let c=r-1,p=Kc(n,c);r=p-1,i+=Z0(n.substring(c+1,p))}else a===13&&n.charCodeAt(r+1)===10&&r++}else i+=n[r]}return i}function ZV(n){let o="",e=!1;for(let t=0;t<n.length;t++){let i=n.charCodeAt(t);if(i===0){o+="\uFFFD";continue}if(i<=31||i===127){o+="\\"+i.toString(16),e=!0;continue}i===ofe||i===nA||i===rfe||i===afe||i===sfe||i===KV?(o+="\\"+n.charAt(t),e=!1):(e&&Cs(i)&&(o+=" "),o+=n.charAt(t),e=!1)}return"url("+o+")"}var lfe="Url",cfe={value:String};function iA(){let n=this.tokenStart,o;switch(this.tokenType){case 7:o=YV(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(),o=zy(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:o}}function dfe(n){this.token(7,ZV(n.value))}var aA={};Ln(aA,{generate:()=>ufe,name:()=>mfe,parse:()=>rA,structure:()=>pfe});var mfe="Value",pfe={children:[[]]};function rA(){let n=this.tokenStart,o=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(n,this.tokenStart),children:o}}function ufe(n){this.children(n)}var lA={};Ln(lA,{generate:()=>_fe,name:()=>ffe,parse:()=>sA,structure:()=>gfe});var hfe=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),ffe="WhiteSpace",gfe={value:String};function sA(){return this.eat(13),hfe}function _fe(n){this.token(13,n.value)}var eB=Ye(Z({generic:!0},IV),{node:hv});var cA={};Ln(cA,{AtrulePrelude:()=>nB,Selector:()=>oB,Value:()=>lB});var vfe=35,Cfe=42,tB=43,xfe=45,bfe=47,yfe=117;function fv(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,yfe)&&this.cmpChar(this.tokenStart+1,tB)?this.UnicodeRange():this.Identifier();case 9:{let o=this.charCodeAt(this.tokenStart);if(o===bfe||o===Cfe||o===tB||o===xfe)return this.Operator();o===vfe&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var nB={getNode:fv};var Sfe=35,wfe=38,Mfe=42,kfe=43,Tfe=47,iB=46,Efe=62,Dfe=124,Pfe=126;function Ife(n,o){o.last!==null&&o.last.type!=="Combinator"&&n!==null&&n.type!=="Combinator"&&o.push({type:"Combinator",loc:null,name:" "})}function Afe(){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)===iB&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:{switch(this.charCodeAt(this.tokenStart)){case kfe:case Efe:case Pfe:case Tfe:return this.Combinator();case iB:return this.ClassSelector();case Mfe:case Dfe:return this.TypeSelector();case Sfe:return this.IdSelector();case wfe:return this.NestingSelector()}break}}}var oB={onWhiteSpace:Ife,getNode:Afe};function rB(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function aB(){let n=this.createList();if(this.skipSC(),n.push(this.Identifier()),this.skipSC(),this.tokenType===18){n.push(this.Operator());let o=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=o-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 sB(n){return n!==null&&n.type==="Operator"&&(n.value[n.value.length-1]==="-"||n.value[n.value.length-1]==="+")}var lB={getNode:fv,onWhiteSpace(n,o){sB(n)&&(n.value=" "+n.value),sB(o.last)&&(o.last.value+=" ")},expression:rB,var:aB};var cB={parse:{prelude:null,block(){return this.Block(!0)}}};var dB={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 mB={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(n=!1){return this.Block(n)}}};var pB={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};var uB={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};function Ofe(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function Nfe(){return this.skipSC(),this.tokenType===1&&this.lookupNonWSType(1)===16?this.createSingleNodeList(this.Declaration()):hB.call(this)}function hB(){let n=this.createList(),o;this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 25:case 13:this.next();continue;case 2:o=this.Function(Ofe,this.scope.AtrulePrelude);break;case 1:o=this.Identifier();break;case 21:o=this.Parentheses(Nfe,this.scope.AtrulePrelude);break;default:break e}n.push(o)}return n}var fB={parse:{prelude(){let n=hB.call(this);return this.getFirstListNode(n)===null&&this.error("Condition is expected"),n},block(n=!1){return this.Block(n)}}};var gB={"font-face":cB,import:dB,media:mB,nest:pB,page:uB,supports:fB};var Mu={parse(){return this.createSingleNodeList(this.SelectorList())}},dA={parse(){return this.createSingleNodeList(this.Selector())}},_B={parse(){return this.createSingleNodeList(this.Identifier())}},$y={parse(){return this.createSingleNodeList(this.Nth())}},vB={dir:_B,has:Mu,lang:_B,matches:Mu,is:Mu,"-moz-any":Mu,"-webkit-any":Mu,where:Mu,not:Mu,"nth-child":$y,"nth-last-child":$y,"nth-last-of-type":$y,"nth-of-type":$y,slotted:dA,host:dA,"host-context":dA};var mA={};Ln(mA,{AnPlusB:()=>DI,Atrule:()=>II,AtrulePrelude:()=>OI,AttributeSelector:()=>RI,Block:()=>VI,Brackets:()=>zI,CDC:()=>$I,CDO:()=>UI,ClassSelector:()=>GI,Combinator:()=>QI,Comment:()=>KI,Declaration:()=>ZI,DeclarationList:()=>t3,Dimension:()=>i3,Function:()=>r3,Hash:()=>s3,IdSelector:()=>m3,Identifier:()=>c3,MediaFeature:()=>u3,MediaQuery:()=>f3,MediaQueryList:()=>_3,NestingSelector:()=>C3,Nth:()=>b3,Number:()=>S3,Operator:()=>M3,Parentheses:()=>T3,Percentage:()=>D3,PseudoClassSelector:()=>I3,PseudoElementSelector:()=>O3,Ratio:()=>F3,Raw:()=>L3,Rule:()=>B3,Selector:()=>j3,SelectorList:()=>H3,String:()=>G3,StyleSheet:()=>Q3,TypeSelector:()=>Y3,UnicodeRange:()=>eA,Url:()=>iA,Value:()=>rA,WhiteSpace:()=>sA});var CB={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:cA,atrule:gB,pseudo:vB,node:mA};var xB={node:hv};var bB=TI(Z(Z(Z({},eB),CB),xB));var{tokenize:dct,parse:Df,generate:Hy,lexer:mct,createLexer:pct,walk:uct,find:hct,findLast:fct,findAll:gct,toPlainObject:_ct,fromPlainObject:vct,fork:Cct}=bB;var Pl=(()=>{class n{fix(e){let t=Df(e,{context:"declarationList"});return t.children.forEach(i=>{i.property==="font-size"&&i.value&&i.value.children&&i.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`)}})}),Hy(t)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var ra=(()=>{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=Df(e,{context:"declarationList"}),i=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"&&(i=p),p.type==="String"&&(i=p,a=!1)}),c.property==="font-size"&&c.value&&c.value.children&&c.value.children.forEach(p=>{p.type==="Dimension"&&(r=p)})}),r&&i){let c=null,p=r.value;a?c=i.name:c=i.value;let u=this.fix({font_family:c.split('"').join(""),font_size:parseInt(p,10)});a?i.name=u.font_family:i.value=u.font_family,r.value=u.font_size}return Hy(t)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var If=(()=>{class n{fontBBoxCalculator;cssFixer;fontFixer;constructor(e,t,i){this.fontBBoxCalculator=e,this.cssFixer=t,this.fontFixer=i}convert(e,t){let i=new tc;i.rotation=e.rotation,i.style=e.style,i.text=e.text,i.x=e.x,i.y=e.y,i.originalX=e.x,i.originalY=e.y,t!==void 0&&(i.id=t.node_id,i.nodeId=t.node_id);let r=this.cssFixer.fix(i.style),a=this.fontFixer.fixStyles(r),c=this.fontBBoxCalculator.calculate(i.text,a);return i.x!==null&&(i.x+=3),i.y!==null&&(i.y+=c.height),i}static \u0275fac=function(t){return new(t||n)(ge(Qc),ge(Pl),ge(ra))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Uy=class{adapterNumber;linkType;name;portNumber;shortName};var Af=(()=>{class n{convert(e){let t=new Uy;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=te({token:n,factory:n.\u0275fac})}return n})();var Of=(()=>{class n{labelToMapLabel;portToMapPort;fontBBoxCalculator;cssFixer;fontFixer;constructor(e,t,i,r,a){this.labelToMapLabel=e,this.portToMapPort=t,this.fontBBoxCalculator=i,this.cssFixer=r,this.fontFixer=a}convert(e){let t=new qa;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(i=>this.portToMapPort.convert(i)):[],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 i=this.cssFixer.fix(t.label.style),r=this.fontFixer.fixStyles(i),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(If),ge(Af),ge(Qc),ge(Pl),ge(ra))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var ku=class{id;captureFileName;captureFilePath;capturing;filters;linkType;nodes;projectId;suspend;show_filters_icon;link_style;wireshark;markers;distance;length;source;target;isSelected=!1;isMultiplied=!1;parallelLinksCount=1;x;y};var Il=(()=>{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,i){if(!(!e||!t||!i))try{localStorage.setItem(n.linkTypeKey(e,t),i)}catch{}}static getNumberValue(e){try{let t=localStorage.getItem(e);if(t===null||t==="")return;let i=parseInt(t,10);return Number.isNaN(i)?void 0:i}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,i){!e||!t||n.setNumberValue(n.bezierCurvinessKey(e,t),i)}static getFlowchartRoundness(e,t){if(!(!e||!t))return n.getNumberValue(n.flowchartRoundnessKey(e,t))}static setFlowchartRoundness(e,t,i){!e||!t||n.setNumberValue(n.flowchartRoundnessKey(e,t),i)}static getStyleSnapshot(e,t){let i=n.get(e,t),r=n.getBezierCurviness(e,t),a=n.getFlowchartRoundness(e,t);if(!(!i&&r===void 0&&a===void 0))return{link_type:i,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 $d=class{id;nodeId;linkId;adapterNumber;portNumber;label;bezierRenderOffsetX;bezierRenderOffsetY};var Wy=(()=>{class n{labelToMapLabel;constructor(e){this.labelToMapLabel=e}convert(e,t){let i=new $d;return i.nodeId=e.node_id,i.adapterNumber=e.adapter_number,i.portNumber=e.port_number,i.label=this.labelToMapLabel.convert(e.label),t!==void 0&&(i.linkId=t.link_id,i.id=`${i.nodeId}-${i.linkId}`),i}static \u0275fac=function(t){return new(t||n)(ge(If))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Nf=(()=>{class n{linkNodeToMapLinkNode;constructor(e){this.linkNodeToMapLinkNode=e}convert(e){let t=new ku;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=Il.getStyleSnapshot(e.project_id,e.link_id);r&&(t.link_style=Z(Z({},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.markers=e.markers,t}static \u0275fac=function(t){return new(t||n)(ge(Wy))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Ia=class{id;projectId;rotation;svg;locked;x;y;z;element};var Ym=(()=>{class n{constructor(){}convert(e){let t=new Ia;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=te({token:n,factory:n.\u0275fac})}return n})();var Gy=class{id;builtin;filename;raw};var qy=(()=>{class n{convert(e){let t=new Gy;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=te({token:n,factory:n.\u0275fac})}return n})();var Qy=class{index;nodes;drawings;links;constructor(o,e=[],t=[],i=[]){this.index=o,this.nodes=e,this.drawings=t,this.links=i}};var Zm=(()=>{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 i=Math.min(t.source.z,t.target.z).toString();this.getLayerForKey(i).links.push(t)})}clear(){this.layers={}}addNode(e){this.getLayerForKey(e.z.toString()).nodes.push(e)}removeNode(e){for(let t of Object.keys(this.layers))this.layers[t].nodes=this.layers[t].nodes.filter(i=>i.id!==e.id)}moveNode(e,t){this.removeNode(e),this.addNode(e)}addLink(e){if(!e.source||!e.target)return;let t=Math.min(e.source.z,e.target.z).toString();this.getLayerForKey(t).links.push(e)}removeLink(e){for(let t of Object.keys(this.layers))this.layers[t].links=this.layers[t].links.filter(i=>i.id!==e.id)}moveLink(e,t,i){this.removeLink(e),this.addLink(e)}addDrawing(e){this.getLayerForKey(e.z.toString()).drawings.push(e)}removeDrawing(e){for(let t of Object.keys(this.layers))this.layers[t].drawings=this.layers[t].drawings.filter(i=>i.id!==e.id)}moveDrawing(e,t){this.removeDrawing(e),this.addDrawing(e)}getLayerForKey(e){return e in this.layers||(this.layers[e]=new Qy,this.layers[e].index=Number(e)),this.layers[e]}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Jm=(()=>{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,i){if(!e)return{dx:0,dy:0};let r=i.x-t.x,a=i.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(i=>{if(!i.source||!i.target){i.distance=0,i.parallelLinksCount=1;return}let r=i.source.id,a=i.target.id,c=r<a?`${r},${a}`:`${a},${r}`;c in t||(t[c]=[]),t[c].push(i)}),Object.keys(t).forEach(i=>{let r=t[i],a=this.calculateSpacingForGroup(r),c=this.getVisibleRange(r.length),p=this.getOverflowStackDistance(r.length,a),u=(c.count-1)/2;r.forEach((h,g)=>{if(g<c.start||g>c.end)h.distance=p;else{let y=g-c.start;h.distance=(y-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),i=e-t,a=Math.floor(i/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,i=this.getMaxSpacingFromNodeSize(e);return i>0&&(t=Math.min(t,i)),Math.max(n.MIN_LINK_SPACING,t)}getMaxSpacingFromNodeSize(e){let t=this.getVisibleLinksCountForSpacing(e.length);if(t<=1)return n.DEFAULT_LINK_SPACING;let i=e[0],r=this.getNodeCrossSection(i.source),a=this.getNodeCrossSection(i.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(i=>typeof i=="number"&&i>0);return t.length===0?0:Math.min(...t)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var ep=(()=>{class n{mapNodesDataSource;mapLinksDataSource;mapDrawingsDataSource;mapSymbolsDataSource;nodeToMapNode;linkToMapLink;drawingToMapDrawing;symbolToMapSymbol;layersManager;multiLinkCalculator;nodeSig=new Map;linkSig=new Map;drawingSig=new Map;nodeToLinks=new Map;constructor(e,t,i,r,a,c,p,u,h,g){this.mapNodesDataSource=e,this.mapLinksDataSource=t,this.mapDrawingsDataSource=i,this.mapSymbolsDataSource=r,this.nodeToMapNode=a,this.linkToMapLink=c,this.drawingToMapDrawing=p,this.symbolToMapSymbol=u,this.layersManager=h,this.multiLinkCalculator=g}getNodes(){return this.mapNodesDataSource.getItems()}getLinks(){return this.mapLinksDataSource.getItems()}getDrawings(){return this.mapDrawingsDataSource.getItems()}getSymbols(){return this.mapSymbolsDataSource.getItems()}setNodes(e){if(!e)return Fd();let t=Fd(),i=[];for(let u of this.getNodes())u.id!=null&&i.push([u.id,u]);let r=new Map(i),a=new Set(e.map(u=>u.node_id)),c=[],p=[];for(let u of e){let h=ZL(u),g=r.get(u.node_id);if(g){let y=this.nodeSig.get(u.node_id),b=ny(y?.groups,h.groups);if(b.length>0){let x=this.nodeToMapNode.convert(u);Object.assign(g,x),this.nodeSig.set(u.node_id,h),t.updates.set(u.node_id,b);let M=y?.groups.z,w=h.groups.z;if(M!==void 0&&M!==w&&this.layersManager.moveNode(g,Number(M)),b.includes("xY")||b.includes("visual")){let S=this.nodeToLinks.get(u.node_id);if(S)for(let E of S)t.updates.set(E,["linkPath"])}}}else{let y=this.nodeToMapNode.convert(u);c.push(y),this.nodeSig.set(u.node_id,h),t.additions.nodes.push(u.node_id),this.layersManager.addNode(y)}}for(let[u]of this.nodeSig)if(!a.has(u)){let h=r.get(u);h&&(p.push(h),this.layersManager.removeNode(h)),this.nodeSig.delete(u),this.nodeToLinks.delete(u),t.removals.nodes.push(u)}return this.mapNodesDataSource.applyBatch(c,p),this.assignDataToLinksIncremental(t,r),t}setLinks(e){if(!e)return Fd();let t=Fd(),i=[];for(let h of this.getLinks())h.id!=null&&i.push([h.id,h]);let r=new Map(i),a=new Set(e.map(h=>h.link_id)),c=[],p=[],u=new Map;for(let[h,g]of r){let y=g.nodes[0]?.nodeId,b=g.nodes[1]?.nodeId;y&&b&&u.set(h,[y,b])}for(let h of e){let g=JL(h),y=r.get(h.link_id);if(y){let b=this.linkSig.get(h.link_id),x=ny(b?.groups,g.groups);if(x.length>0){let M=this.linkToMapLink.convert(h);if(Object.assign(y,M),this.linkSig.set(h.link_id,g),t.updates.set(h.link_id,x),x.includes("nodes")){let w=u.get(h.link_id);w&&this.unregisterLinkNodes(h.link_id,w[0],w[1]);let S=y.nodes[0]?.nodeId,E=y.nodes[1]?.nodeId;S&&E&&this.registerLinkNodes(h.link_id,S,E)}}}else{let b=this.linkToMapLink.convert(h);c.push(b),this.linkSig.set(h.link_id,g),t.additions.links.push(h.link_id);let x=b.nodes[0]?.nodeId,M=b.nodes[1]?.nodeId;x&&M&&this.registerLinkNodes(h.link_id,x,M)}}for(let[h]of this.linkSig)if(!a.has(h)){let g=r.get(h);g&&(p.push(g),this.layersManager.removeLink(g)),this.linkSig.delete(h);let y=u.get(h);y&&this.unregisterLinkNodes(h,y[0],y[1]),t.removals.links.push(h)}this.mapLinksDataSource.applyBatch(c,p);for(let h of c)this.layersManager.addLink(h);return this.assignDataToLinksIncremental(t,new Map),t}setDrawings(e){if(!e)return Fd();let t=Fd(),i=[];for(let u of this.getDrawings())u.id!=null&&i.push([u.id,u]);let r=new Map(i),a=new Set(e.map(u=>u.drawing_id)),c=[],p=[];for(let u of e){let h=e7(u),g=r.get(u.drawing_id);if(g){let y=this.drawingSig.get(u.drawing_id),b=ny(y?.groups,h.groups);if(b.length>0){let x=this.drawingToMapDrawing.convert(u);if(Object.assign(g,x),this.drawingSig.set(u.drawing_id,h),t.updates.set(u.drawing_id,b),b.includes("z")){let M=y?.groups.z;M!==void 0&&this.layersManager.moveDrawing(g,Number(M))}}}else{let y=this.drawingToMapDrawing.convert(u);c.push(y),this.drawingSig.set(u.drawing_id,h),t.additions.drawings.push(u.drawing_id),this.layersManager.addDrawing(y)}}for(let[u]of this.drawingSig)if(!a.has(u)){let h=r.get(u);h&&(p.push(h),this.layersManager.removeDrawing(h)),this.drawingSig.delete(u),t.removals.drawings.push(u)}return this.mapDrawingsDataSource.applyBatch(c,p),t}setSymbols(e){if(e){let t=e.map(i=>this.symbolToMapSymbol.convert(i));this.mapSymbolsDataSource.set(t)}}registerLinkNodes(e,t,i){for(let r of[t,i]){let a=this.nodeToLinks.get(r);a||(a=new Set,this.nodeToLinks.set(r,a)),a.add(e)}}unregisterLinkNodes(e,t,i){for(let r of[t,i]){let a=this.nodeToLinks.get(r);a&&(a.delete(e),a.size===0&&this.nodeToLinks.delete(r))}}assignDataToLinksIncremental(e,t){if(e.additions.nodes.length>0||e.removals.nodes.length>0||e.additions.links.length>0||e.removals.links.length>0){this.assignDataToLinksFull(),this.onDataUpdateFull();return}let r=new Map(this.getNodes().map(c=>[c.id,c])),a=this.collectAffectedLinks(e);for(let c of a){let p=this.mapLinksDataSource.get(c);if(!p)continue;let u=p.nodes;if(!u||u.length<2)continue;let h=u[0]?.nodeId,g=u[1]?.nodeId,y=h?r.get(h):void 0,b=g?r.get(g):void 0;y&&Object.assign(p,{source:y}),b&&Object.assign(p,{target:b}),y&&b&&Object.assign(p,{x:y.x+(b.x-y.x)*.5,y:y.y+(b.y-y.y)*.5})}this.multiLinkCalculator.assignDataToLinks(this.getLinks())}collectAffectedLinks(e){let t=new Set;for(let[i]of e.updates){let r=this.nodeToLinks.get(i);if(r)for(let a of r)t.add(a)}for(let[i]of e.updates)t.add(i);return t}assignDataToLinksFull(){let e={};this.getNodes().forEach(t=>{e[t.id]=t}),this.getLinks().forEach(t=>{if(!t.nodes||t.nodes.length<2)return;let i=t.nodes[0]?.nodeId,r=t.nodes[1]?.nodeId;i&&i in e&&(t.source=e[i]),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())}onDataUpdateFull(){this.layersManager.clear(),this.layersManager.setNodes(this.getNodes()),this.layersManager.setLinks(this.getLinks()),this.layersManager.setDrawings(this.getDrawings())}static \u0275fac=function(t){return new(t||n)(ge(mf),ge(kl),ge(pf),ge(uf),ge(Of),ge(Nf),ge(Ym),ge(qy),ge(Zm),ge(Jm))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Al=(()=>{class n{isReadOnly=!1;static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var tp=class{x;y;constructor(o,e){this.x=o,this.y=e}};var hA=class{x;y;k;constructor(o,e,t){this.x=o,this.y=e,this.k=t}},Ao=(()=>{class n{transformation;size;centerZeroZeroPoint=!0;centerX=null;centerY=null;constructor(){this.size=new Rd(0,0),this.transformation=new hA(0,0,1)}getZeroZeroTransformationPoint(){return this.centerZeroZeroPoint?new tp(this.centerX!==null?this.centerX:this.size.width/2,this.centerY!==null?this.centerY:this.size.height/2):new tp(0,0)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Ol=(()=>{class n{changesDetected=new _e;selectionChangesDetected=new _e;hasBeenDrawn=!1;detectChanges(){this.changesDetected.emit(!0)}detectSelectionChanges(){this.selectionChangesDetected.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var $fe={value:()=>{}};function MB(){for(var n=0,o=arguments.length,e={},t;n<o;++n){if(!(t=arguments[n]+"")||t in e||/[\s.]/.test(t))throw new Error("illegal type: "+t);e[t]=[]}return new Ky(e)}function Ky(n){this._=n}function Hfe(n,o){return n.trim().split(/^|\s+/).map(function(e){var t="",i=e.indexOf(".");if(i>=0&&(t=e.slice(i+1),e=e.slice(0,i)),e&&!o.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})}Ky.prototype=MB.prototype={constructor:Ky,on:function(n,o){var e=this._,t=Hfe(n+"",e),i,r=-1,a=t.length;if(arguments.length<2){for(;++r<a;)if((i=(n=t[r]).type)&&(i=Ufe(e[i],n.name)))return i;return}if(o!=null&&typeof o!="function")throw new Error("invalid callback: "+o);for(;++r<a;)if(i=(n=t[r]).type)e[i]=wB(e[i],n.name,o);else if(o==null)for(i in e)e[i]=wB(e[i],n.name,null);return this},copy:function(){var n={},o=this._;for(var e in o)n[e]=o[e].slice();return new Ky(n)},call:function(n,o){if((i=arguments.length-2)>0)for(var e=new Array(i),t=0,i,r;t<i;++t)e[t]=arguments[t+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(r=this._[n],t=0,i=r.length;t<i;++t)r[t].value.apply(o,e)},apply:function(n,o,e){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var t=this._[n],i=0,r=t.length;i<r;++i)t[i].value.apply(o,e)}};function Ufe(n,o){for(var e=0,t=n.length,i;e<t;++e)if((i=n[e]).name===o)return i.value}function wB(n,o,e){for(var t=0,i=n.length;t<i;++t)if(n[t].name===o){n[t]=$fe,n=n.slice(0,t).concat(n.slice(t+1));break}return e!=null&&n.push({name:o,value:e}),n}var Tu=MB;var kB={passive:!1},Eu={capture:!0,passive:!1};function Yy(n){n.stopImmediatePropagation()}function np(n){n.preventDefault(),n.stopImmediatePropagation()}function _v(n){var o=n.document.documentElement,e=Ut(n).on("dragstart.drag",np,Eu);"onselectstart"in o?e.on("selectstart.drag",np,Eu):(o.__noselect=o.style.MozUserSelect,o.style.MozUserSelect="none")}function vv(n,o){var e=n.document.documentElement,t=Ut(n).on("dragstart.drag",null);o&&(t.on("click.drag",np,Eu),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 Cv=n=>()=>n;function xv(n,{sourceEvent:o,subject:e,target:t,identifier:i,active:r,x:a,y:c,dx:p,dy:u,dispatch:h}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:o,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},identifier:{value:i,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}})}xv.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function Wfe(n){return!n.ctrlKey&&!n.button}function Gfe(){return this.parentNode}function qfe(n,o){return o??{x:n.x,y:n.y}}function Qfe(){return navigator.maxTouchPoints||"ontouchstart"in this}function xs(){var n=Wfe,o=Gfe,e=qfe,t=Qfe,i={},r=Tu("start","drag","end"),a=0,c,p,u,h,g=0;function y(D){D.on("mousedown.drag",b).filter(t).on("touchstart.drag",w).on("touchmove.drag",S,kB).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(D,N){if(!(h||!n.call(this,D,N))){var P=O(this,o.call(this,D,N),D,N,"mouse");P&&(Ut(D.view).on("mousemove.drag",x,Eu).on("mouseup.drag",M,Eu),_v(D.view),Yy(D),u=!1,c=D.clientX,p=D.clientY,P("start",D))}}function x(D){if(np(D),!u){var N=D.clientX-c,P=D.clientY-p;u=N*N+P*P>g}i.mouse("drag",D)}function M(D){Ut(D.view).on("mousemove.drag mouseup.drag",null),vv(D.view,u),np(D),i.mouse("end",D)}function w(D,N){if(n.call(this,D,N)){var P=D.changedTouches,L=o.call(this,D,N),se=P.length,re,W;for(re=0;re<se;++re)(W=O(this,L,D,N,P[re].identifier,P[re]))&&(Yy(D),W("start",D,P[re]))}}function S(D){var N=D.changedTouches,P=N.length,L,se;for(L=0;L<P;++L)(se=i[N[L].identifier])&&(np(D),se("drag",D,N[L]))}function E(D){var N=D.changedTouches,P=N.length,L,se;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),L=0;L<P;++L)(se=i[N[L].identifier])&&(Yy(D),se("end",D,N[L]))}function O(D,N,P,L,se,re){var W=r.copy(),$=Pr(re||P,N),ue,be,me;if((me=e.call(D,new xv("beforestart",{sourceEvent:P,target:y,identifier:se,active:a,x:$[0],y:$[1],dx:0,dy:0,dispatch:W}),L))!=null)return ue=me.x-$[0]||0,be=me.y-$[1]||0,function Pe(he,j,J){var le=$,ce;switch(he){case"start":i[se]=Pe,ce=a++;break;case"end":delete i[se],--a;case"drag":$=Pr(J||j,N),ce=a;break}W.call(he,D,new xv(he,{sourceEvent:j,subject:me,target:y,identifier:se,active:ce,x:$[0]+ue,y:$[1]+be,dx:$[0]-le[0],dy:$[1]-le[1],dispatch:W}),L)}}return y.filter=function(D){return arguments.length?(n=typeof D=="function"?D:Cv(!!D),y):n},y.container=function(D){return arguments.length?(o=typeof D=="function"?D:Cv(D),y):o},y.subject=function(D){return arguments.length?(e=typeof D=="function"?D:Cv(D),y):e},y.touchable=function(D){return arguments.length?(t=typeof D=="function"?D:Cv(!!D),y):t},y.on=function(){var D=r.on.apply(r,arguments);return D===r?y:D},y.clickDistance=function(D){return arguments.length?(g=(D=+D)*D,y):Math.sqrt(g)},y}function Zy(n,o,e){n.prototype=o.prototype=e,e.constructor=n}function fA(n,o){var e=Object.create(n.prototype);for(var t in o)e[t]=o[t];return e}function Sv(){}var bv=.7,tS=1/bv,Rf="\\s*([+-]?\\d+)\\s*",yv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xfe=/^#([0-9a-f]{3,8})$/,Kfe=new RegExp(`^rgb\\(${Rf},${Rf},${Rf}\\)$`),Yfe=new RegExp(`^rgb\\(${Jc},${Jc},${Jc}\\)$`),Zfe=new RegExp(`^rgba\\(${Rf},${Rf},${Rf},${yv}\\)$`),Jfe=new RegExp(`^rgba\\(${Jc},${Jc},${Jc},${yv}\\)$`),ege=new RegExp(`^hsl\\(${yv},${Jc},${Jc}\\)$`),tge=new RegExp(`^hsla\\(${yv},${Jc},${Jc},${yv}\\)$`),TB={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};Zy(Sv,ip,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:EB,formatHex:EB,formatHex8:nge,formatHsl:ige,formatRgb:DB,toString:DB});function EB(){return this.rgb().formatHex()}function nge(){return this.rgb().formatHex8()}function ige(){return FB(this).formatHsl()}function DB(){return this.rgb().formatRgb()}function ip(n){var o,e;return n=(n+"").trim().toLowerCase(),(o=Xfe.exec(n))?(e=o[1].length,o=parseInt(o[1],16),e===6?PB(o):e===3?new bs(o>>8&15|o>>4&240,o>>4&15|o&240,(o&15)<<4|o&15,1):e===8?Jy(o>>24&255,o>>16&255,o>>8&255,(o&255)/255):e===4?Jy(o>>12&15|o>>8&240,o>>8&15|o>>4&240,o>>4&15|o&240,((o&15)<<4|o&15)/255):null):(o=Kfe.exec(n))?new bs(o[1],o[2],o[3],1):(o=Yfe.exec(n))?new bs(o[1]*255/100,o[2]*255/100,o[3]*255/100,1):(o=Zfe.exec(n))?Jy(o[1],o[2],o[3],o[4]):(o=Jfe.exec(n))?Jy(o[1]*255/100,o[2]*255/100,o[3]*255/100,o[4]):(o=ege.exec(n))?OB(o[1],o[2]/100,o[3]/100,1):(o=tge.exec(n))?OB(o[1],o[2]/100,o[3]/100,o[4]):TB.hasOwnProperty(n)?PB(TB[n]):n==="transparent"?new bs(NaN,NaN,NaN,0):null}function PB(n){return new bs(n>>16&255,n>>8&255,n&255,1)}function Jy(n,o,e,t){return t<=0&&(n=o=e=NaN),new bs(n,o,e,t)}function oge(n){return n instanceof Sv||(n=ip(n)),n?(n=n.rgb(),new bs(n.r,n.g,n.b,n.opacity)):new bs}function Lf(n,o,e,t){return arguments.length===1?oge(n):new bs(n,o,e,t??1)}function bs(n,o,e,t){this.r=+n,this.g=+o,this.b=+e,this.opacity=+t}Zy(bs,Lf,fA(Sv,{brighter(n){return n=n==null?tS:Math.pow(tS,n),new bs(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?bv:Math.pow(bv,n),new bs(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new bs(Pu(this.r),Pu(this.g),Pu(this.b),nS(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:rge,formatRgb:AB,toString:AB}));function IB(){return`#${Du(this.r)}${Du(this.g)}${Du(this.b)}`}function rge(){return`#${Du(this.r)}${Du(this.g)}${Du(this.b)}${Du((isNaN(this.opacity)?1:this.opacity)*255)}`}function AB(){let n=nS(this.opacity);return`${n===1?"rgb(":"rgba("}${Pu(this.r)}, ${Pu(this.g)}, ${Pu(this.b)}${n===1?")":`, ${n})`}`}function nS(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Pu(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Du(n){return n=Pu(n),(n<16?"0":"")+n.toString(16)}function OB(n,o,e,t){return t<=0?n=o=e=NaN:e<=0||e>=1?n=o=NaN:o<=0&&(n=NaN),new oc(n,o,e,t)}function FB(n){if(n instanceof oc)return new oc(n.h,n.s,n.l,n.opacity);if(n instanceof Sv||(n=ip(n)),!n)return new oc;if(n instanceof oc)return n;n=n.rgb();var o=n.r/255,e=n.g/255,t=n.b/255,i=Math.min(o,e,t),r=Math.max(o,e,t),a=NaN,c=r-i,p=(r+i)/2;return c?(o===r?a=(e-t)/c+(e<t)*6:e===r?a=(t-o)/c+2:a=(o-e)/c+4,c/=p<.5?r+i:2-r-i,a*=60):c=p>0&&p<1?0:a,new oc(a,c,p,n.opacity)}function RB(n,o,e,t){return arguments.length===1?FB(n):new oc(n,o,e,t??1)}function oc(n,o,e,t){this.h=+n,this.s=+o,this.l=+e,this.opacity=+t}Zy(oc,RB,fA(Sv,{brighter(n){return n=n==null?tS:Math.pow(tS,n),new oc(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?bv:Math.pow(bv,n),new oc(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,o=isNaN(n)||isNaN(this.s)?0:this.s,e=this.l,t=e+(e<.5?e:1-e)*o,i=2*e-t;return new bs(gA(n>=240?n-240:n+120,i,t),gA(n,i,t),gA(n<120?n+240:n-120,i,t),this.opacity)},clamp(){return new oc(NB(this.h),eS(this.s),eS(this.l),nS(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=nS(this.opacity);return`${n===1?"hsl(":"hsla("}${NB(this.h)}, ${eS(this.s)*100}%, ${eS(this.l)*100}%${n===1?")":`, ${n})`}`}}));function NB(n){return n=(n||0)%360,n<0?n+360:n}function eS(n){return Math.max(0,Math.min(1,n||0))}function gA(n,o,e){return(n<60?o+(e-o)*n/60:n<180?e:n<240?o+(e-o)*(240-n)/60:o)*255}function _A(n,o,e,t,i){var r=n*n,a=r*n;return((1-3*n+3*r-a)*o+(4-6*r+3*a)*e+(1+3*n+3*r-3*a)*t+a*i)/6}function LB(n){var o=n.length-1;return function(e){var t=e<=0?e=0:e>=1?(e=1,o-1):Math.floor(e*o),i=n[t],r=n[t+1],a=t>0?n[t-1]:2*i-r,c=t<o-1?n[t+2]:2*r-i;return _A((e-t/o)*o,a,i,r,c)}}function VB(n){var o=n.length;return function(e){var t=Math.floor(((e%=1)<0?++e:e)*o),i=n[(t+o-1)%o],r=n[t%o],a=n[(t+1)%o],c=n[(t+2)%o];return _A((e-t/o)*o,i,r,a,c)}}var vA=n=>()=>n;function age(n,o){return function(e){return n+e*o}}function sge(n,o,e){return n=Math.pow(n,e),o=Math.pow(o,e)-n,e=1/e,function(t){return Math.pow(n+t*o,e)}}function BB(n){return(n=+n)==1?iS:function(o,e){return e-o?sge(o,e,n):vA(isNaN(o)?e:o)}}function iS(n,o){var e=o-n;return e?age(n,e):vA(isNaN(n)?o:n)}var oS=(function n(o){var e=BB(o);function t(i,r){var a=e((i=Lf(i)).r,(r=Lf(r)).r),c=e(i.g,r.g),p=e(i.b,r.b),u=iS(i.opacity,r.opacity);return function(h){return i.r=a(h),i.g=c(h),i.b=p(h),i.opacity=u(h),i+""}}return t.gamma=n,t})(1);function zB(n){return function(o){var e=o.length,t=new Array(e),i=new Array(e),r=new Array(e),a,c;for(a=0;a<e;++a)c=Lf(o[a]),t[a]=c.r||0,i[a]=c.g||0,r[a]=c.b||0;return t=n(t),i=n(i),r=n(r),c.opacity=1,function(p){return c.r=t(p),c.g=i(p),c.b=r(p),c+""}}}var lge=zB(LB),cge=zB(VB);function Nl(n,o){return n=+n,o=+o,function(e){return n*(1-e)+o*e}}var xA=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,CA=new RegExp(xA.source,"g");function dge(n){return function(){return n}}function mge(n){return function(o){return n(o)+""}}function bA(n,o){var e=xA.lastIndex=CA.lastIndex=0,t,i,r,a=-1,c=[],p=[];for(n=n+"",o=o+"";(t=xA.exec(n))&&(i=CA.exec(o));)(r=i.index)>e&&(r=o.slice(e,r),c[a]?c[a]+=r:c[++a]=r),(t=t[0])===(i=i[0])?c[a]?c[a]+=i:c[++a]=i:(c[++a]=null,p.push({i:a,x:Nl(t,i)})),e=CA.lastIndex;return e<o.length&&(r=o.slice(e),c[a]?c[a]+=r:c[++a]=r),c.length<2?p[0]?mge(p[0].x):dge(o):(o=p.length,function(u){for(var h=0,g;h<o;++h)c[(g=p[h]).i]=g.x(u);return c.join("")})}var jB=180/Math.PI,rS={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function yA(n,o,e,t,i,r){var a,c,p;return(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a),(p=n*e+o*t)&&(e-=n*p,t-=o*p),(c=Math.sqrt(e*e+t*t))&&(e/=c,t/=c,p/=c),n*t<o*e&&(n=-n,o=-o,p=-p,a=-a),{translateX:i,translateY:r,rotate:Math.atan2(o,n)*jB,skewX:Math.atan(p)*jB,scaleX:a,scaleY:c}}var aS;function $B(n){let o=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return o.isIdentity?rS:yA(o.a,o.b,o.c,o.d,o.e,o.f)}function HB(n){return n==null?rS:(aS||(aS=document.createElementNS("http://www.w3.org/2000/svg","g")),aS.setAttribute("transform",n),(n=aS.transform.baseVal.consolidate())?(n=n.matrix,yA(n.a,n.b,n.c,n.d,n.e,n.f)):rS)}function UB(n,o,e,t){function i(u){return u.length?u.pop()+" ":""}function r(u,h,g,y,b,x){if(u!==g||h!==y){var M=b.push("translate(",null,o,null,e);x.push({i:M-4,x:Nl(u,g)},{i:M-2,x:Nl(h,y)})}else(g||y)&&b.push("translate("+g+o+y+e)}function a(u,h,g,y){u!==h?(u-h>180?h+=360:h-u>180&&(u+=360),y.push({i:g.push(i(g)+"rotate(",null,t)-2,x:Nl(u,h)})):h&&g.push(i(g)+"rotate("+h+t)}function c(u,h,g,y){u!==h?y.push({i:g.push(i(g)+"skewX(",null,t)-2,x:Nl(u,h)}):h&&g.push(i(g)+"skewX("+h+t)}function p(u,h,g,y,b,x){if(u!==g||h!==y){var M=b.push(i(b)+"scale(",null,",",null,")");x.push({i:M-4,x:Nl(u,g)},{i:M-2,x:Nl(h,y)})}else(g!==1||y!==1)&&b.push(i(b)+"scale("+g+","+y+")")}return function(u,h){var g=[],y=[];return u=n(u),h=n(h),r(u.translateX,u.translateY,h.translateX,h.translateY,g,y),a(u.rotate,h.rotate,g,y),c(u.skewX,h.skewX,g,y),p(u.scaleX,u.scaleY,h.scaleX,h.scaleY,g,y),u=h=null,function(b){for(var x=-1,M=y.length,w;++x<M;)g[(w=y[x]).i]=w.x(b);return g.join("")}}}var SA=UB($B,"px, ","px)","deg)"),wA=UB(HB,", ",")",")");var pge=1e-12;function WB(n){return((n=Math.exp(n))+1/n)/2}function uge(n){return((n=Math.exp(n))-1/n)/2}function hge(n){return((n=Math.exp(2*n))-1)/(n+1)}var MA=(function n(o,e,t){function i(r,a){var c=r[0],p=r[1],u=r[2],h=a[0],g=a[1],y=a[2],b=h-c,x=g-p,M=b*b+x*x,w,S;if(M<pge)S=Math.log(y/u)/o,w=function(L){return[c+L*b,p+L*x,u*Math.exp(o*L*S)]};else{var E=Math.sqrt(M),O=(y*y-u*u+t*M)/(2*u*e*E),D=(y*y-u*u-t*M)/(2*y*e*E),N=Math.log(Math.sqrt(O*O+1)-O),P=Math.log(Math.sqrt(D*D+1)-D);S=(P-N)/o,w=function(L){var se=L*S,re=WB(N),W=u/(e*E)*(re*hge(o*se+N)-uge(N));return[c+W*b,p+W*x,u*re/WB(o*se+N)]}}return w.duration=S*1e3*o/Math.SQRT2,w}return i.rho=function(r){var a=Math.max(.001,+r),c=a*a,p=c*c;return n(a,c,p)},i})(Math.SQRT2,2,4);var Vf=0,Mv=0,wv=0,qB=1e3,sS,kv,lS=0,Iu=0,cS=0,Tv=typeof performance=="object"&&performance.now?performance:Date,QB=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function Dv(){return Iu||(QB(fge),Iu=Tv.now()+cS)}function fge(){Iu=0}function Ev(){this._call=this._time=this._next=null}Ev.prototype=dS.prototype={constructor:Ev,restart:function(n,o,e){if(typeof n!="function")throw new TypeError("callback is not a function");e=(e==null?Dv():+e)+(o==null?0:+o),!this._next&&kv!==this&&(kv?kv._next=this:sS=this,kv=this),this._call=n,this._time=e,kA()},stop:function(){this._call&&(this._call=null,this._time=1/0,kA())}};function dS(n,o,e){var t=new Ev;return t.restart(n,o,e),t}function XB(){Dv(),++Vf;for(var n=sS,o;n;)(o=Iu-n._time)>=0&&n._call.call(void 0,o),n=n._next;--Vf}function GB(){Iu=(lS=Tv.now())+cS,Vf=Mv=0;try{XB()}finally{Vf=0,_ge(),Iu=0}}function gge(){var n=Tv.now(),o=n-lS;o>qB&&(cS-=o,lS=n)}function _ge(){for(var n,o=sS,e,t=1/0;o;)o._call?(t>o._time&&(t=o._time),n=o,o=o._next):(e=o._next,o._next=null,o=n?n._next=e:sS=e);kv=n,kA(t)}function kA(n){if(!Vf){Mv&&(Mv=clearTimeout(Mv));var o=n-Iu;o>24?(n<1/0&&(Mv=setTimeout(GB,n-Tv.now()-cS)),wv&&(wv=clearInterval(wv))):(wv||(lS=Tv.now(),wv=setInterval(gge,qB)),Vf=1,QB(GB))}}function mS(n,o,e){var t=new Ev;return o=o==null?0:+o,t.restart(i=>{t.stop(),n(i+o)},o,e),t}var vge=Tu("start","end","cancel","interrupt"),Cge=[],ZB=0,KB=1,uS=2,pS=3,YB=4,hS=5,Pv=6;function op(n,o,e,t,i,r){var a=n.__transition;if(!a)n.__transition={};else if(e in a)return;xge(n,e,{name:o,index:t,group:i,on:vge,tween:Cge,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:ZB})}function Iv(n,o){var e=Ur(n,o);if(e.state>ZB)throw new Error("too late; already scheduled");return e}function _a(n,o){var e=Ur(n,o);if(e.state>pS)throw new Error("too late; already running");return e}function Ur(n,o){var e=n.__transition;if(!e||!(e=e[o]))throw new Error("transition not found");return e}function xge(n,o,e){var t=n.__transition,i;t[o]=e,e.timer=dS(r,0,e.time);function r(u){e.state=KB,e.timer.restart(a,e.delay,e.time),e.delay<=u&&a(u-e.delay)}function a(u){var h,g,y,b;if(e.state!==KB)return p();for(h in t)if(b=t[h],b.name===e.name){if(b.state===pS)return mS(a);b.state===YB?(b.state=Pv,b.timer.stop(),b.on.call("interrupt",n,n.__data__,b.index,b.group),delete t[h]):+h<o&&(b.state=Pv,b.timer.stop(),b.on.call("cancel",n,n.__data__,b.index,b.group),delete t[h])}if(mS(function(){e.state===pS&&(e.state=YB,e.timer.restart(c,e.delay,e.time),c(u))}),e.state=uS,e.on.call("start",n,n.__data__,e.index,e.group),e.state===uS){for(e.state=pS,i=new Array(y=e.tween.length),h=0,g=-1;h<y;++h)(b=e.tween[h].value.call(n,n.__data__,e.index,e.group))&&(i[++g]=b);i.length=g+1}}function c(u){for(var h=u<e.duration?e.ease.call(null,u/e.duration):(e.timer.restart(p),e.state=hS,1),g=-1,y=i.length;++g<y;)i[g].call(n,h);e.state===hS&&(e.on.call("end",n,n.__data__,e.index,e.group),p())}function p(){e.state=Pv,e.timer.stop(),delete t[o];for(var u in t)return;delete n.__transition}}function rp(n,o){var e=n.__transition,t,i,r=!0,a;if(e){o=o==null?null:o+"";for(a in e){if((t=e[a]).name!==o){r=!1;continue}i=t.state>uS&&t.state<hS,t.state=Pv,t.timer.stop(),t.on.call(i?"interrupt":"cancel",n,n.__data__,t.index,t.group),delete e[a]}r&&delete n.__transition}}function JB(n){return this.each(function(){rp(this,n)})}function bge(n,o){var e,t;return function(){var i=_a(this,n),r=i.tween;if(r!==e){t=e=r;for(var a=0,c=t.length;a<c;++a)if(t[a].name===o){t=t.slice(),t.splice(a,1);break}}i.tween=t}}function yge(n,o,e){var t,i;if(typeof e!="function")throw new Error;return function(){var r=_a(this,n),a=r.tween;if(a!==t){i=(t=a).slice();for(var c={name:o,value:e},p=0,u=i.length;p<u;++p)if(i[p].name===o){i[p]=c;break}p===u&&i.push(c)}r.tween=i}}function ez(n,o){var e=this._id;if(n+="",arguments.length<2){for(var t=Ur(this.node(),e).tween,i=0,r=t.length,a;i<r;++i)if((a=t[i]).name===n)return a.value;return null}return this.each((o==null?bge:yge)(e,n,o))}function Bf(n,o,e){var t=n._id;return n.each(function(){var i=_a(this,t);(i.value||(i.value={}))[o]=e.apply(this,arguments)}),function(i){return Ur(i,t).value[o]}}function fS(n,o){var e;return(typeof o=="number"?Nl:o instanceof ip?oS:(e=ip(o))?(o=e,oS):bA)(n,o)}function Sge(n){return function(){this.removeAttribute(n)}}function wge(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Mge(n,o,e){var t,i=e+"",r;return function(){var a=this.getAttribute(n);return a===i?null:a===t?r:r=o(t=a,e)}}function kge(n,o,e){var t,i=e+"",r;return function(){var a=this.getAttributeNS(n.space,n.local);return a===i?null:a===t?r:r=o(t=a,e)}}function Tge(n,o,e){var t,i,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===i?r:(i=p,r=o(t=a,c)))}}function Ege(n,o,e){var t,i,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===i?r:(i=p,r=o(t=a,c)))}}function tz(n,o){var e=Od(n),t=e==="transform"?wA:fS;return this.attrTween(n,typeof o=="function"?(e.local?Ege:Tge)(e,t,Bf(this,"attr."+n,o)):o==null?(e.local?wge:Sge)(e):(e.local?kge:Mge)(e,t,o))}function Dge(n,o){return function(e){this.setAttribute(n,o.call(this,e))}}function Pge(n,o){return function(e){this.setAttributeNS(n.space,n.local,o.call(this,e))}}function Ige(n,o){var e,t;function i(){var r=o.apply(this,arguments);return r!==t&&(e=(t=r)&&Pge(n,r)),e}return i._value=o,i}function Age(n,o){var e,t;function i(){var r=o.apply(this,arguments);return r!==t&&(e=(t=r)&&Dge(n,r)),e}return i._value=o,i}function nz(n,o){var e="attr."+n;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(o==null)return this.tween(e,null);if(typeof o!="function")throw new Error;var t=Od(n);return this.tween(e,(t.local?Ige:Age)(t,o))}function Oge(n,o){return function(){Iv(this,n).delay=+o.apply(this,arguments)}}function Nge(n,o){return o=+o,function(){Iv(this,n).delay=o}}function iz(n){var o=this._id;return arguments.length?this.each((typeof n=="function"?Oge:Nge)(o,n)):Ur(this.node(),o).delay}function Fge(n,o){return function(){_a(this,n).duration=+o.apply(this,arguments)}}function Rge(n,o){return o=+o,function(){_a(this,n).duration=o}}function oz(n){var o=this._id;return arguments.length?this.each((typeof n=="function"?Fge:Rge)(o,n)):Ur(this.node(),o).duration}function Lge(n,o){if(typeof o!="function")throw new Error;return function(){_a(this,n).ease=o}}function rz(n){var o=this._id;return arguments.length?this.each(Lge(o,n)):Ur(this.node(),o).ease}function Vge(n,o){return function(){var e=o.apply(this,arguments);if(typeof e!="function")throw new Error;_a(this,n).ease=e}}function az(n){if(typeof n!="function")throw new Error;return this.each(Vge(this._id,n))}function sz(n){typeof n!="function"&&(n=W0(n));for(var o=this._groups,e=o.length,t=new Array(e),i=0;i<e;++i)for(var r=o[i],a=r.length,c=t[i]=[],p,u=0;u<a;++u)(p=r[u])&&n.call(p,p.__data__,u,r)&&c.push(p);return new Ka(t,this._parents,this._name,this._id)}function lz(n){if(n._id!==this._id)throw new Error;for(var o=this._groups,e=n._groups,t=o.length,i=e.length,r=Math.min(t,i),a=new Array(t),c=0;c<r;++c)for(var p=o[c],u=e[c],h=p.length,g=a[c]=new Array(h),y,b=0;b<h;++b)(y=p[b]||u[b])&&(g[b]=y);for(;c<t;++c)a[c]=o[c];return new Ka(a,this._parents,this._name,this._id)}function Bge(n){return(n+"").trim().split(/^|\s+/).every(function(o){var e=o.indexOf(".");return e>=0&&(o=o.slice(0,e)),!o||o==="start"})}function zge(n,o,e){var t,i,r=Bge(o)?Iv:_a;return function(){var a=r(this,n),c=a.on;c!==t&&(i=(t=c).copy()).on(o,e),a.on=i}}function cz(n,o){var e=this._id;return arguments.length<2?Ur(this.node(),e).on.on(n):this.each(zge(e,n,o))}function jge(n){return function(){var o=this.parentNode;for(var e in this.__transition)if(+e!==n)return;o&&o.removeChild(this)}}function dz(){return this.on("end.remove",jge(this._id))}function mz(n){var o=this._name,e=this._id;typeof n!="function"&&(n=xu(n));for(var t=this._groups,i=t.length,r=new Array(i),a=0;a<i;++a)for(var c=t[a],p=c.length,u=r[a]=new Array(p),h,g,y=0;y<p;++y)(h=c[y])&&(g=n.call(h,h.__data__,y,c))&&("__data__"in h&&(g.__data__=h.__data__),u[y]=g,op(u[y],o,e,y,u,Ur(h,e)));return new Ka(r,this._parents,o,e)}function pz(n){var o=this._name,e=this._id;typeof n!="function"&&(n=U0(n));for(var t=this._groups,i=t.length,r=[],a=[],c=0;c<i;++c)for(var p=t[c],u=p.length,h,g=0;g<u;++g)if(h=p[g]){for(var y=n.call(h,h.__data__,g,p),b,x=Ur(h,e),M=0,w=y.length;M<w;++M)(b=y[M])&&op(b,o,e,M,y,x);r.push(y),a.push(h)}return new Ka(r,a,o,e)}var $ge=Nd.prototype.constructor;function uz(){return new $ge(this._groups,this._parents)}function Hge(n,o){var e,t,i;return function(){var r=Wm(this,n),a=(this.style.removeProperty(n),Wm(this,n));return r===a?null:r===e&&a===t?i:i=o(e=r,t=a)}}function hz(n){return function(){this.style.removeProperty(n)}}function Uge(n,o,e){var t,i=e+"",r;return function(){var a=Wm(this,n);return a===i?null:a===t?r:r=o(t=a,e)}}function Wge(n,o,e){var t,i,r;return function(){var a=Wm(this,n),c=e(this),p=c+"";return c==null&&(p=c=(this.style.removeProperty(n),Wm(this,n))),a===p?null:a===t&&p===i?r:(i=p,r=o(t=a,c))}}function Gge(n,o){var e,t,i,r="style."+o,a="end."+r,c;return function(){var p=_a(this,n),u=p.on,h=p.value[r]==null?c||(c=hz(o)):void 0;(u!==e||i!==h)&&(t=(e=u).copy()).on(a,i=h),p.on=t}}function fz(n,o,e){var t=(n+="")=="transform"?SA:fS;return o==null?this.styleTween(n,Hge(n,t)).on("end.style."+n,hz(n)):typeof o=="function"?this.styleTween(n,Wge(n,t,Bf(this,"style."+n,o))).each(Gge(this._id,n)):this.styleTween(n,Uge(n,t,o),e).on("end.style."+n,null)}function qge(n,o,e){return function(t){this.style.setProperty(n,o.call(this,t),e)}}function Qge(n,o,e){var t,i;function r(){var a=o.apply(this,arguments);return a!==i&&(t=(i=a)&&qge(n,a,e)),t}return r._value=o,r}function gz(n,o,e){var t="style."+(n+="");if(arguments.length<2)return(t=this.tween(t))&&t._value;if(o==null)return this.tween(t,null);if(typeof o!="function")throw new Error;return this.tween(t,Qge(n,o,e??""))}function Xge(n){return function(){this.textContent=n}}function Kge(n){return function(){var o=n(this);this.textContent=o??""}}function _z(n){return this.tween("text",typeof n=="function"?Kge(Bf(this,"text",n)):Xge(n==null?"":n+""))}function Yge(n){return function(o){this.textContent=n.call(this,o)}}function Zge(n){var o,e;function t(){var i=n.apply(this,arguments);return i!==e&&(o=(e=i)&&Yge(i)),o}return t._value=n,t}function vz(n){var o="text";if(arguments.length<1)return(o=this.tween(o))&&o._value;if(n==null)return this.tween(o,null);if(typeof n!="function")throw new Error;return this.tween(o,Zge(n))}function Cz(){for(var n=this._name,o=this._id,e=gS(),t=this._groups,i=t.length,r=0;r<i;++r)for(var a=t[r],c=a.length,p,u=0;u<c;++u)if(p=a[u]){var h=Ur(p,o);op(p,n,e,u,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Ka(t,this._parents,n,e)}function xz(){var n,o,e=this,t=e._id,i=e.size();return new Promise(function(r,a){var c={value:a},p={value:function(){--i===0&&r()}};e.each(function(){var u=_a(this,t),h=u.on;h!==n&&(o=(n=h).copy(),o._.cancel.push(c),o._.interrupt.push(c),o._.end.push(p)),u.on=o}),i===0&&r()})}var Jge=0;function Ka(n,o,e,t){this._groups=n,this._parents=o,this._name=e,this._id=t}function bz(n){return Nd().transition(n)}function gS(){return++Jge}var Hd=Nd.prototype;Ka.prototype=bz.prototype={constructor:Ka,select:mz,selectAll:pz,selectChild:Hd.selectChild,selectChildren:Hd.selectChildren,filter:sz,merge:lz,selection:uz,transition:Cz,call:Hd.call,nodes:Hd.nodes,node:Hd.node,size:Hd.size,empty:Hd.empty,each:Hd.each,on:cz,attr:tz,attrTween:nz,style:fz,styleTween:gz,text:_z,textTween:vz,remove:dz,tween:ez,delay:iz,duration:oz,ease:rz,easeVarying:az,end:xz,[Symbol.iterator]:Hd[Symbol.iterator]};function _S(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var e_e={time:null,delay:0,duration:250,ease:_S};function t_e(n,o){for(var e;!(e=n.__transition)||!(e=e[o]);)if(!(n=n.parentNode))throw new Error(`transition ${o} not found`);return e}function yz(n){var o,e;n instanceof Ka?(o=n._id,n=n._name):(o=gS(),(e=e_e).time=Dv(),n=n==null?null:n+"");for(var t=this._groups,i=t.length,r=0;r<i;++r)for(var a=t[r],c=a.length,p,u=0;u<c;++u)(p=a[u])&&op(p,n,o,u,a,e||t_e(p,o));return new Ka(t,this._parents,n,o)}Nd.prototype.interrupt=JB;Nd.prototype.transition=yz;var Av=n=>()=>n;function TA(n,{sourceEvent:o,target:e,transform:t,dispatch:i}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:o,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:t,enumerable:!0,configurable:!0},_:{value:i}})}function rc(n,o,e){this.k=n,this.x=o,this.y=e}rc.prototype={constructor:rc,scale:function(n){return n===1?this:new rc(this.k*n,this.x,this.y)},translate:function(n,o){return n===0&o===0?this:new rc(this.k,this.x+this.k*n,this.y+this.k*o)},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 Ov=new rc(1,0,0);EA.prototype=rc.prototype;function EA(n){for(;!n.__zoom;)if(!(n=n.parentNode))return Ov;return n.__zoom}function vS(n){n.stopImmediatePropagation()}function zf(n){n.preventDefault(),n.stopImmediatePropagation()}function n_e(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function i_e(){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 Sz(){return this.__zoom||Ov}function o_e(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function r_e(){return navigator.maxTouchPoints||"ontouchstart"in this}function a_e(n,o,e){var t=n.invertX(o[0][0])-e[0][0],i=n.invertX(o[1][0])-e[1][0],r=n.invertY(o[0][1])-e[0][1],a=n.invertY(o[1][1])-e[1][1];return n.translate(i>t?(t+i)/2:Math.min(0,t)||Math.max(0,i),a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a))}function DA(){var n=n_e,o=i_e,e=a_e,t=o_e,i=r_e,r=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,p=MA,u=Tu("start","zoom","end"),h,g,y,b=500,x=150,M=0,w=10;function S(me){me.property("__zoom",Sz).on("wheel.zoom",se,{passive:!1}).on("mousedown.zoom",re).on("dblclick.zoom",W).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",ue).on("touchend.zoom touchcancel.zoom",be).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(me,Pe,he,j){var J=me.selection?me.selection():me;J.property("__zoom",Sz),me!==J?N(me,Pe,he,j):J.interrupt().each(function(){P(this,arguments).event(j).start().zoom(null,typeof Pe=="function"?Pe.apply(this,arguments):Pe).end()})},S.scaleBy=function(me,Pe,he,j){S.scaleTo(me,function(){var J=this.__zoom.k,le=typeof Pe=="function"?Pe.apply(this,arguments):Pe;return J*le},he,j)},S.scaleTo=function(me,Pe,he,j){S.transform(me,function(){var J=o.apply(this,arguments),le=this.__zoom,ce=he==null?D(J):typeof he=="function"?he.apply(this,arguments):he,De=le.invert(ce),He=typeof Pe=="function"?Pe.apply(this,arguments):Pe;return e(O(E(le,He),ce,De),J,a)},he,j)},S.translateBy=function(me,Pe,he,j){S.transform(me,function(){return e(this.__zoom.translate(typeof Pe=="function"?Pe.apply(this,arguments):Pe,typeof he=="function"?he.apply(this,arguments):he),o.apply(this,arguments),a)},null,j)},S.translateTo=function(me,Pe,he,j,J){S.transform(me,function(){var le=o.apply(this,arguments),ce=this.__zoom,De=j==null?D(le):typeof j=="function"?j.apply(this,arguments):j;return e(Ov.translate(De[0],De[1]).scale(ce.k).translate(typeof Pe=="function"?-Pe.apply(this,arguments):-Pe,typeof he=="function"?-he.apply(this,arguments):-he),le,a)},j,J)};function E(me,Pe){return Pe=Math.max(r[0],Math.min(r[1],Pe)),Pe===me.k?me:new rc(Pe,me.x,me.y)}function O(me,Pe,he){var j=Pe[0]-he[0]*me.k,J=Pe[1]-he[1]*me.k;return j===me.x&&J===me.y?me:new rc(me.k,j,J)}function D(me){return[(+me[0][0]+ +me[1][0])/2,(+me[0][1]+ +me[1][1])/2]}function N(me,Pe,he,j){me.on("start.zoom",function(){P(this,arguments).event(j).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(j).end()}).tween("zoom",function(){var J=this,le=arguments,ce=P(J,le).event(j),De=o.apply(J,le),He=he==null?D(De):typeof he=="function"?he.apply(J,le):he,et=Math.max(De[1][0]-De[0][0],De[1][1]-De[0][1]),Ze=J.__zoom,ye=typeof Pe=="function"?Pe.apply(J,le):Pe,q=p(Ze.invert(He).concat(et/Ze.k),ye.invert(He).concat(et/ye.k));return function(Ne){if(Ne===1)Ne=ye;else{var Qe=q(Ne),ct=et/Qe[2];Ne=new rc(ct,He[0]-Qe[0]*ct,He[1]-Qe[1]*ct)}ce.zoom(null,Ne)}})}function P(me,Pe,he){return!he&&me.__zooming||new L(me,Pe)}function L(me,Pe){this.that=me,this.args=Pe,this.active=0,this.sourceEvent=null,this.extent=o.apply(me,Pe),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,Pe){return this.mouse&&me!=="mouse"&&(this.mouse[1]=Pe.invert(this.mouse[0])),this.touch0&&me!=="touch"&&(this.touch0[1]=Pe.invert(this.touch0[0])),this.touch1&&me!=="touch"&&(this.touch1[1]=Pe.invert(this.touch1[0])),this.that.__zoom=Pe,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(me){var Pe=Ut(this.that).datum();u.call(me,this.that,new TA(me,{sourceEvent:this.sourceEvent,target:S,type:me,transform:this.that.__zoom,dispatch:u}),Pe)}};function se(me,...Pe){if(!n.apply(this,arguments))return;var he=P(this,Pe).event(me),j=this.__zoom,J=Math.max(r[0],Math.min(r[1],j.k*Math.pow(2,t.apply(this,arguments)))),le=Pr(me);if(he.wheel)(he.mouse[0][0]!==le[0]||he.mouse[0][1]!==le[1])&&(he.mouse[1]=j.invert(he.mouse[0]=le)),clearTimeout(he.wheel);else{if(j.k===J)return;he.mouse=[le,j.invert(le)],rp(this),he.start()}zf(me),he.wheel=setTimeout(ce,x),he.zoom("mouse",e(O(E(j,J),he.mouse[0],he.mouse[1]),he.extent,a));function ce(){he.wheel=null,he.end()}}function re(me,...Pe){if(y||!n.apply(this,arguments))return;var he=me.currentTarget,j=P(this,Pe,!0).event(me),J=Ut(me.view).on("mousemove.zoom",He,!0).on("mouseup.zoom",et,!0),le=Pr(me,he),ce=me.clientX,De=me.clientY;_v(me.view),vS(me),j.mouse=[le,this.__zoom.invert(le)],rp(this),j.start();function He(Ze){if(zf(Ze),!j.moved){var ye=Ze.clientX-ce,q=Ze.clientY-De;j.moved=ye*ye+q*q>M}j.event(Ze).zoom("mouse",e(O(j.that.__zoom,j.mouse[0]=Pr(Ze,he),j.mouse[1]),j.extent,a))}function et(Ze){J.on("mousemove.zoom mouseup.zoom",null),vv(Ze.view,j.moved),zf(Ze),j.event(Ze).end()}}function W(me,...Pe){if(n.apply(this,arguments)){var he=this.__zoom,j=Pr(me.changedTouches?me.changedTouches[0]:me,this),J=he.invert(j),le=he.k*(me.shiftKey?.5:2),ce=e(O(E(he,le),j,J),o.apply(this,Pe),a);zf(me),c>0?Ut(this).transition().duration(c).call(N,ce,j,me):Ut(this).call(S.transform,ce,j,me)}}function $(me,...Pe){if(n.apply(this,arguments)){var he=me.touches,j=he.length,J=P(this,Pe,me.changedTouches.length===j).event(me),le,ce,De,He;for(vS(me),ce=0;ce<j;++ce)De=he[ce],He=Pr(De,this),He=[He,this.__zoom.invert(He),De.identifier],J.touch0?!J.touch1&&J.touch0[2]!==He[2]&&(J.touch1=He,J.taps=0):(J.touch0=He,le=!0,J.taps=1+!!h);h&&(h=clearTimeout(h)),le&&(J.taps<2&&(g=He[0],h=setTimeout(function(){h=null},b)),rp(this),J.start())}}function ue(me,...Pe){if(this.__zooming){var he=P(this,Pe).event(me),j=me.changedTouches,J=j.length,le,ce,De,He;for(zf(me),le=0;le<J;++le)ce=j[le],De=Pr(ce,this),he.touch0&&he.touch0[2]===ce.identifier?he.touch0[0]=De:he.touch1&&he.touch1[2]===ce.identifier&&(he.touch1[0]=De);if(ce=he.that.__zoom,he.touch1){var et=he.touch0[0],Ze=he.touch0[1],ye=he.touch1[0],q=he.touch1[1],Ne=(Ne=ye[0]-et[0])*Ne+(Ne=ye[1]-et[1])*Ne,Qe=(Qe=q[0]-Ze[0])*Qe+(Qe=q[1]-Ze[1])*Qe;ce=E(ce,Math.sqrt(Ne/Qe)),De=[(et[0]+ye[0])/2,(et[1]+ye[1])/2],He=[(Ze[0]+q[0])/2,(Ze[1]+q[1])/2]}else if(he.touch0)De=he.touch0[0],He=he.touch0[1];else return;he.zoom("touch",e(O(ce,De,He),he.extent,a))}}function be(me,...Pe){if(this.__zooming){var he=P(this,Pe).event(me),j=me.changedTouches,J=j.length,le,ce;for(vS(me),y&&clearTimeout(y),y=setTimeout(function(){y=null},b),le=0;le<J;++le)ce=j[le],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=Pr(ce,this),Math.hypot(g[0]-ce[0],g[1]-ce[1])<w)){var De=Ut(this).on("dblclick.zoom");De&&De.apply(this,arguments)}}}return S.wheelDelta=function(me){return arguments.length?(t=typeof me=="function"?me:Av(+me),S):t},S.filter=function(me){return arguments.length?(n=typeof me=="function"?me:Av(!!me),S):n},S.touchable=function(me){return arguments.length?(i=typeof me=="function"?me:Av(!!me),S):i},S.extent=function(me){return arguments.length?(o=typeof me=="function"?me:Av([[+me[0][0],+me[0][1]],[+me[1][0],+me[1][1]]]),S):o},S.scaleExtent=function(me){return arguments.length?(r[0]=+me[0],r[1]=+me[1],S):[r[0],r[1]]},S.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],S):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},S.constrain=function(me){return arguments.length?(e=me,S):e},S.duration=function(me){return arguments.length?(c=+me,S):c},S.interpolate=function(me){return arguments.length?(p=me,S):p},S.on=function(){var me=u.on.apply(u,arguments);return me===u?S:me},S.clickDistance=function(me){return arguments.length?(M=(me=+me)*me,S):Math.sqrt(M)},S.tapDistance=function(me){return arguments.length?(w=+me,S):w},S}var jf=(()=>{class n{context;zoom;enabled=!1;needsDeactivate=!1;needsActivate=!1;constructor(e){this.context=e,this.zoom=DA().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,i=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",i),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(Ao))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var CS=class{x;y;width;height;constructor(o,e,t,i){this.x=o,this.y=e,this.width=t,this.height=i}};var $f=(()=>{class n{selected=new We;static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var ap=(()=>{class n{context;selectionEventSource;contextMenuOpened=new _e;path;enabled=!1;constructor(e,t){this.context=e,this.selectionEventSource=t}setEnabled(e){this.enabled=e}activate(e){let t=this,i=e.node();e.on("contextmenu.selection",r=>r.preventDefault()).on("mousedown.selection",function(r){if(r.button===2){t.contextMenuOpened.emit(r);return}let a=Ut(window),c=t.transformation(Pr(r,i));t.startSelection(c),a.on("mousemove.selection",function(p){let u=t.transformation(Pr(p,i));t.moveSelection(c,u)}).on("mouseup.selection",function(p){let u=t.transformation(Pr(p,i));t.endSelection(c,u),a.on("mousemove.selection",null).on("mouseup.selection",null)})})}deactivate(e){e.on("mousedown.selection",null).on("contextmenu.selection",null)}draw(e,t){let i=e.select("g.canvas");if(!i.select("g.selection-line-tool").node()){let c=i.append("g");c.attr("class","selection-line-tool"),this.path=c.append("path"),this.path.attr("class","selection").attr("visibility","hidden")}let r=i.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 i=this.context.transformation.k;if(!i||i===0||isNaN(i))return;let r=e[0]/i,a=e[1]/i;if(isNaN(r)||isNaN(a))return;let c=t[0]/i-r,p=t[1]/i-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 i=this.context.transformation.k;if(!i||i===0||isNaN(i))return;let r=e[0]/i,a=e[1]/i,c=t[0]/i,p=t[1]/i,u=Math.min(r,c),h=Math.min(a,p),g=Math.abs(r-c),y=Math.abs(a-p);this.selectionEventSource.selected.next(new CS(u,h,g,y))}rect(e,t,i,r){return"M"+[e,t]+" l"+[i,0]+" l"+[0,r]+" l"+[-i,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(Ao),ge($f))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var{abs:kut,max:Tut,min:Eut}=Math;function wz(n){return[+n[0],+n[1]]}function d_e(n){return[wz(n[0]),wz(n[1])]}var Dut={name:"x",handles:["w","e"].map(PA),input:function(n,o){return n==null?null:[[+n[0],o[0][1]],[+n[1],o[1][1]]]},output:function(n){return n&&[n[0][0],n[1][0]]}},Put={name:"y",handles:["n","s"].map(PA),input:function(n,o){return n==null?null:[[o[0][0],+n[0]],[o[1][0],+n[1]]]},output:function(n){return n&&[n[0][1],n[1][1]]}},Iut={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(PA),input:function(n){return n==null?null:d_e(n)},output:function(n){return n}};function PA(n){return{type:n}}var IA=Math.PI,AA=2*IA,Au=1e-6,m_e=AA-Au;function Mz(n){this._+=n[0];for(let o=1,e=n.length;o<e;++o)this._+=arguments[o]+n[o]}function p_e(n){let o=Math.floor(n);if(!(o>=0))throw new Error(`invalid digits: ${n}`);if(o>15)return Mz;let e=10**o;return function(t){this._+=t[0];for(let i=1,r=t.length;i<r;++i)this._+=Math.round(arguments[i]*e)/e+t[i]}}var Ou=class{constructor(o){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=o==null?Mz:p_e(o)}moveTo(o,e){this._append`M${this._x0=this._x1=+o},${this._y0=this._y1=+e}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(o,e){this._append`L${this._x1=+o},${this._y1=+e}`}quadraticCurveTo(o,e,t,i){this._append`Q${+o},${+e},${this._x1=+t},${this._y1=+i}`}bezierCurveTo(o,e,t,i,r,a){this._append`C${+o},${+e},${+t},${+i},${this._x1=+r},${this._y1=+a}`}arcTo(o,e,t,i,r){if(o=+o,e=+e,t=+t,i=+i,r=+r,r<0)throw new Error(`negative radius: ${r}`);let a=this._x1,c=this._y1,p=t-o,u=i-e,h=a-o,g=c-e,y=h*h+g*g;if(this._x1===null)this._append`M${this._x1=o},${this._y1=e}`;else if(y>Au)if(!(Math.abs(g*p-u*h)>Au)||!r)this._append`L${this._x1=o},${this._y1=e}`;else{let b=t-a,x=i-c,M=p*p+u*u,w=b*b+x*x,S=Math.sqrt(M),E=Math.sqrt(y),O=r*Math.tan((IA-Math.acos((M+y-w)/(2*S*E)))/2),D=O/E,N=O/S;Math.abs(D-1)>Au&&this._append`L${o+D*h},${e+D*g}`,this._append`A${r},${r},0,0,${+(g*b>h*x)},${this._x1=o+N*p},${this._y1=e+N*u}`}}arc(o,e,t,i,r,a){if(o=+o,e=+e,t=+t,a=!!a,t<0)throw new Error(`negative radius: ${t}`);let c=t*Math.cos(i),p=t*Math.sin(i),u=o+c,h=e+p,g=1^a,y=a?i-r:r-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>Au||Math.abs(this._y1-h)>Au)&&this._append`L${u},${h}`,t&&(y<0&&(y=y%AA+AA),y>m_e?this._append`A${t},${t},0,1,${g},${o-c},${e-p}A${t},${t},0,1,${g},${this._x1=u},${this._y1=h}`:y>Au&&this._append`A${t},${t},0,${+(y>=IA)},${g},${this._x1=o+t*Math.cos(r)},${this._y1=e+t*Math.sin(r)}`)}rect(o,e,t,i){this._append`M${this._x0=this._x1=+o},${this._y0=this._y1=+e}h${t=+t}v${+i}h${-t}Z`}toString(){return this._}};function sp(){return new Ou}sp.prototype=Ou.prototype;function Nu(n){return function(){return n}}var OA=1e-12,kz=Math.PI,Uut=kz/2,Wut=2*kz;function Tz(n){let o=3;return n.digits=function(e){if(!arguments.length)return o;if(e==null)o=null;else{let t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);o=t}return n},()=>new Ou(o)}var Xut=Array.prototype.slice;function Ez(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function Dz(n){this._context=n}Dz.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,o){switch(n=+n,o=+o,this._point){case 0:this._point=1,this._line?this._context.lineTo(n,o):this._context.moveTo(n,o);break;case 1:this._point=2;default:this._context.lineTo(n,o);break}}};function Pz(n){return new Dz(n)}function Iz(n){return n[0]}function Az(n){return n[1]}function Fu(n,o){var e=Nu(!0),t=null,i=Pz,r=null,a=Tz(c);n=typeof n=="function"?n:n===void 0?Iz:Nu(n),o=typeof o=="function"?o:o===void 0?Az:Nu(o);function c(p){var u,h=(p=Ez(p)).length,g,y=!1,b;for(t==null&&(r=i(b=a())),u=0;u<=h;++u)!(u<h&&e(g=p[u],u,p))===y&&((y=!y)?r.lineStart():r.lineEnd()),y&&r.point(+n(g,u,p),+o(g,u,p));if(b)return r=null,b+""||null}return c.x=function(p){return arguments.length?(n=typeof p=="function"?p:Nu(+p),c):n},c.y=function(p){return arguments.length?(o=typeof p=="function"?p:Nu(+p),c):o},c.defined=function(p){return arguments.length?(e=typeof p=="function"?p:Nu(!!p),c):e},c.curve=function(p){return arguments.length?(i=p,t!=null&&(r=i(t)),c):i},c.context=function(p){return arguments.length?(p==null?t=r=null:r=i(t=p),c):t},c}function Oz(n,o,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+o)/6,(n._y0+4*n._y1+e)/6)}function Nz(n){this._context=n}Nz.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:Oz(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,o){switch(n=+n,o=+o,this._point){case 0:this._point=1,this._line?this._context.lineTo(n,o):this._context.moveTo(n,o);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:Oz(this,n,o);break}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=o}};function Nv(n){return new Nz(n)}function Fz(n,o,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-o),n._y2+n._k*(n._y1-e),n._x2,n._y2)}function xS(n,o){this._context=n,this._k=(1-o)/6}xS.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:Fz(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,o){switch(n=+n,o=+o,this._point){case 0:this._point=1,this._line?this._context.lineTo(n,o):this._context.moveTo(n,o);break;case 1:this._point=2,this._x1=n,this._y1=o;break;case 2:this._point=3;default:Fz(this,n,o);break}this._x0=this._x1,this._x1=this._x2,this._x2=n,this._y0=this._y1,this._y1=this._y2,this._y2=o}};var aht=(function n(o){function e(t){return new xS(t,o)}return e.tension=function(t){return n(+t)},e})(0);function u_e(n,o,e){var t=n._x1,i=n._y1,r=n._x2,a=n._y2;if(n._l01_a>OA){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,i=(i*c-n._y0*n._l12_2a+n._y2*n._l01_2a)/p}if(n._l23_a>OA){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-o*n._l12_2a)/h,a=(a*u+n._y1*n._l23_2a-e*n._l12_2a)/h}n._context.bezierCurveTo(t,i,r,a,n._x2,n._y2)}function Rz(n,o){this._context=n,this._alpha=o}Rz.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,o){if(n=+n,o=+o,this._point){var e=this._x2-n,t=this._y2-o;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,o):this._context.moveTo(n,o);break;case 1:this._point=2;break;case 2:this._point=3;default:u_e(this,n,o);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=o}};var Ru=(function n(o){function e(t){return o?new Rz(t,o):new xS(t,0)}return e.alpha=function(t){return n(+t)},e})(.5);function Lz(n){return n<0?-1:1}function Vz(n,o,e){var t=n._x1-n._x0,i=o-n._x1,r=(n._y1-n._y0)/(t||i<0&&-0),a=(e-n._y1)/(i||t<0&&-0),c=(r*i+a*t)/(t+i);return(Lz(r)+Lz(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(c))||0}function Bz(n,o){var e=n._x1-n._x0;return e?(3*(n._y1-n._y0)/e-o)/2:o}function NA(n,o,e){var t=n._x0,i=n._y0,r=n._x1,a=n._y1,c=(r-t)/3;n._context.bezierCurveTo(t+c,i+c*o,r-c,a-c*e,r,a)}function bS(n){this._context=n}bS.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:NA(this,this._t0,Bz(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(n,o){var e=NaN;if(n=+n,o=+o,!(n===this._x1&&o===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(n,o):this._context.moveTo(n,o);break;case 1:this._point=2;break;case 2:this._point=3,NA(this,Bz(this,e=Vz(this,n,o)),e);break;default:NA(this,this._t0,e=Vz(this,n,o));break}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=o,this._t0=e}}};function h_e(n){this._context=new zz(n)}(h_e.prototype=Object.create(bS.prototype)).point=function(n,o){bS.prototype.point.call(this,o,n)};function zz(n){this._context=n}zz.prototype={moveTo:function(n,o){this._context.moveTo(o,n)},closePath:function(){this._context.closePath()},lineTo:function(n,o){this._context.lineTo(o,n)},bezierCurveTo:function(n,o,e,t,i,r){this._context.bezierCurveTo(o,n,t,e,r,i)}};function Fv(n){return new bS(n)}var va=class{height;width;stroke;stroke_width;stroke_dasharray;points;curve_type;arrow_start;arrow_end};var Rv=class{x;y;dx;dy},FA=class extends Rv{datum;constructor(o){super(),this.datum=o}},RA=class extends Rv{datum;constructor(o){super(),this.datum=o}},LA=class extends Rv{datum;constructor(o){super(),this.datum=o}},ed=class{start=new _e;drag=new _e;end=new _e;call(o){o.call(this.behaviour())}behaviour(){let o;return xs().on("start",e=>{o=new FA(e.subject),o.dx=e.dx,o.dy=e.dy,o.x=e.x,o.y=e.y,this.start.emit(o)}).on("drag",e=>{let t=new RA(e.subject);t.dx=e.dx,t.dy=e.dy,this.drag.emit(t)}).on("end",e=>{let t=new LA(e.subject);t.dx=e.x-o.x,t.dy=e.y-o.y,this.end.emit(t)})}};var VA=class{datum;dx;dy;constructor(o,e,t){this.datum=o,this.dx=e,this.dy=t}},Lu=class extends VA{},yS=class{datum;x;y;width;height;rotation;constructor(o,e,t,i,r,a){this.datum=o,this.x=e,this.y=t,this.width=i,this.height=r,this.rotation=a}},SS=class{x;y;constructor(o,e){this.x=o,this.y=e}},wS=class{datum;x;y;constructor(o,e,t){this.datum=o,this.x=e,this.y=t}},MS=class{savedText;x;y;constructor(o,e,t){this.savedText=o,this.x=e,this.y=t}},kS=class{textDrawingId;editedText;textElement;constructor(o,e,t){this.textDrawingId=o,this.editedText=e,this.textElement=t}},TS=class{event;drawing;constructor(o,e){this.event=o,this.drawing=e}},ac=class{event;link;constructor(o,e){this.event=o,this.link=e}},ES=class{event;interfaceLabel;constructor(o,e){this.event=o,this.interfaceLabel=e}},DS=class{event;label;constructor(o,e){this.event=o,this.label=e}};var BA=class{event;node;constructor(o,e){this.event=o,this.node=e}};var Lv=class extends BA{};var Xo=(()=>{class n{selection={};selected=new _e;unselected=new _e;setSelected(e){let t=this.convertToKeyDict(e),i=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,i.length>0&&this.selected.emit(i),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(i=>{t[this.getKey(i)]=i}),t}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var lp=(()=>{class n{cssFixer;fontFixer;selectionManager;mapSettings;onContextMenu=new _e;draggable=new ed;static NODE_LABEL_MARGIN=3;constructor(e,t,i,r){this.cssFixer=e,this.fontFixer=t,this.selectionManager=i,this.mapSettings=r}redrawLabel(e,t){this.drawLabel(this.selectLabel(e,t))}draw(e){let t=this,i=e.selectAll("g.label_container").data(c=>[c.label]),r=i.enter().append("g").attr("class","label_container").attr("label_id",c=>c.id),a=i.merge(r).on("mousedown.context-menu",function(c){c.button===2&&c.stopPropagation()}).on("contextmenu",function(c,p){c.preventDefault(),t.onContextMenu.emit(new DS(c,p))});this.drawLabel(a),i.exit().remove(),this.mapSettings.isReadOnly||this.draggable.call(i)}removeInlineFillColor(e){return e.replace(/fill:\s*[^;]+;?/gi,"")}drawLabel(e){let t=e.selectAll("g.label_body").data(a=>[a]),i=t.enter().append("g").attr("class","label_body");i.append("text").attr("class","label"),i.append("rect").attr("class","label_selection");let r=t.merge(i);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=Ut(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(Pl),ge(ra),ge(Xo),ge(Al))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Fl=(()=>{class n{dragged=new _e;labelDragged=new _e;clicked=new _e;static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var v_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",C_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",x_e="var(--gns3-lock-badge-locked-color)",b_e="var(--gns3-lock-badge-unlocked-color)",zA="var(--gns3-lock-badge-outline-color)",Uf=(()=>{class n{selectionManager;labelWidget;nodesEventSource;mapSettingsService;onContextMenu=new _e;onContextConsoleMenu=new _e;onNodeClicked=new _e;constructor(e,t,i,r){this.selectionManager=e,this.labelWidget=t,this.nodesEventSource=i,this.mapSettingsService=r}draw(e){let t=this,i=e.selectAll("g.node_body").data(c=>[c]),r=i.enter().append("g").attr("class","node_body");r.append("image");let a=i.merge(r).classed("selected",c=>this.selectionManager.isSelected(c)).classed("locked",c=>c.locked).on("click",(c,p)=>{this.nodesEventSource.clicked.emit(new wS(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",g=>{let y=g.width>0?g.width:60,b=g.height>0?g.height:60;if(g.nodeType==="cloud"||g.nodeType==="nat"||g.symbol&&(g.symbol.toLowerCase().includes("nat")||g.symbol.toLowerCase().includes("cloud"))){let M=y/2+(y/2-12)/Math.SQRT2,w=b/2-(b/2-12)/Math.SQRT2;return`translate(${M}, ${w})`}return`translate(${y*.8}, ${b*.2})`});c.filter(g=>g.locked).append("path").attr("d",v_e).attr("transform","translate(-7.68, -7.68) scale(0.64)").attr("fill",x_e).attr("stroke",zA).attr("stroke-width",1.2).attr("stroke-linejoin","round").attr("paint-order","stroke fill");let h=c.filter(g=>!g.locked).append("g").attr("transform","translate(-7.68, -7.68) scale(0.64)");h.append("path").attr("d",C_e).attr("fill",b_e).attr("stroke",zA).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",zA)}a.select("image").on("mousedown.context-menu",function(c){c.button===2&&c.stopPropagation()}).on("contextmenu",function(c,p){c.preventDefault(),t.onContextMenu.emit(new Lv(c,p))}).on("dblclick",function(c,p){c.preventDefault(),t.onContextConsoleMenu.emit(new Lv(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){Ut(this).attr("class","over")}).on("mouseout",function(c){Ut(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(Xo),ge(lp),ge(Fl),ge(_o))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var cp=(()=>{class n{nodeWidget;mapSettings;static NODE_LABEL_MARGIN=3;draggable=new ed;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),i=t.enter().append("g").attr("class","node").attr("node_id",a=>a.id),r=t.merge(i);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(Uf),ge(Al))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var PS=class{points};var Wf=(()=>{class n{drawingLine=new PS;selection;drawing=!1;data={};start(e,t,i){let r=this;this.drawing=!0,this.data=i,this.drawingLine.points=[new tp(e,t)];let a=function(p,u){let h=r.selection.select("g.canvas").node(),g=Pr(p,h);r.drawing&&(r.drawingLine.points=[r.drawingLine.points[0],new tp(g[0],g[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 i=this.selection.select("g.canvas");i.select("g.drawing-line-tool").node()||i.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=Fu(),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=te({token:n,factory:n.\u0275fac})}return n})();var en=(()=>{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,i,r){let a=n.normalizeLinkType(i?.link_type);if(a==="bezier"){let c=typeof r?.bezierVariation=="number"&&!Number.isNaN(r.bezierVariation)?r.bezierVariation:0,p=n.getEffectiveBezierMajorAnchor(i?.bezier_curviness,c);return n.getJsPlumbBezierPath(e,t,p,r?.sourceOrientation,r?.targetOrientation)}if(a==="flowchart"){let c=n.normalizeFlowchartRoundness(i?.flowchart_roundness);return n.getFlowchartPath(e,t,c,r?.flowchartDistance)}if(a==="statemachine"){let c=n.normalizeStateMachineCurviness(i?.bezier_curviness);return n.getStateMachinePath(e,t,c)}return n.getStraightPath(e,t)}static getFreeformBezierPath(e,t,i,r,a){let c=sp();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,i=Math.round(t/n.BEZIER_CURVINESS_STEP)*n.BEZIER_CURVINESS_STEP;return Math.max(n.BEZIER_CURVINESS_MIN,Math.min(n.BEZIER_CURVINESS_MAX,i))}static getEffectiveBezierMajorAnchor(e,t=0){let i=n.normalizeBezierCurviness(e),r=typeof t=="number"&&!Number.isNaN(t)?t:0;return-i+r}static normalizeFlowchartRoundness(e){let t=typeof e=="number"&&!Number.isNaN(e)?e:n.FLOWCHART_ROUNDNESS_DEFAULT,i=Math.round(t/n.FLOWCHART_ROUNDNESS_STEP)*n.FLOWCHART_ROUNDNESS_STEP;return Math.max(n.FLOWCHART_ROUNDNESS_MIN,Math.min(n.FLOWCHART_ROUNDNESS_MAX,i))}static normalizeStateMachineCurviness(e){let t=typeof e=="number"&&!Number.isNaN(e)?e:n.STATE_MACHINE_CURVINESS_DEFAULT,i=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,i))}static getContinuousOrientation(e,t){let i=t[0]-e[0],r=t[1]-e[1];return Math.abs(i)>=Math.abs(r)?[i>=0?1:-1,0]:[0,r>=0?1:-1]}static getBezierControlPoints(e,t,i,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,i),h=n.findBezierControlPoint(t,t,e,p,c,i);return{sourceControlPoint:u,targetControlPoint:h,sourceOrientation:c,targetOrientation:p}}static getBezierSideSign(e,t,i,r,a){let{sourceControlPoint:c}=n.getBezierControlPoints(e,t,i,r,a),p=t[0]-e[0],u=t[1]-e[1],h=c[0]-e[0],g=c[1]-e[1],y=p*g-u*h;return Math.abs(y)<1e-4||y>0?1:-1}static getStraightPath(e,t){let i=sp();return i.moveTo(e[0],e[1]),i.lineTo(t[0],t[1]),i.toString()}static getFlowchartPath(e,t,i,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),g=6,y=Math.hypot(a,c)||1,b=typeof r=="number"&&!Number.isNaN(r)?r:0,x=-c/y*b,M=a/y*b;if(p<=g||u<=g)return n.getStraightPath(e,t);let w=[[e[0],e[1]]];if(h){let S=(x<0?-1:1)*Math.abs(M),E=e[0]+a/2+(S-x);w.push([E,e[1]]),w.push([E,t[1]])}else{let S=(M<0?-1:1)*Math.abs(x),E=e[1]+c/2+(S-M);w.push([e[0],E]),w.push([t[0],E])}return w.push([t[0],t[1]]),n.getRoundedPolylinePath(w,Math.abs(i))}static getRoundedPolylinePath(e,t){let i=sp(),r=e.filter((p,u,h)=>{if(u===0)return!0;let g=h[u-1];return p[0]!==g[0]||p[1]!==g[1]});if(r.length===0)return"";if(i.moveTo(r[0][0],r[0][1]),r.length===1)return i.toString();if(t<=0){for(let p=1;p<r.length;p++){let u=r[p];i.lineTo(u[0],u[1])}return i.toString()}let a=1e-4;for(let p=1;p<r.length-1;p++){let u=r[p-1],h=r[p],g=r[p+1],y=h[0]-u[0],b=h[1]-u[1],x=g[0]-h[0],M=g[1]-h[1],w=Math.sqrt(y*y+b*b),S=Math.sqrt(x*x+M*M);if(w<a||S<a){i.lineTo(h[0],h[1]);continue}let E=y/w,O=b/w,D=x/S,N=M/S,P=E*N-O*D;if(Math.abs(P)<a){i.lineTo(h[0],h[1]);continue}let L=Math.min(t,w/2,S/2);if(L<a){i.lineTo(h[0],h[1]);continue}let se=[h[0]-E*L,h[1]-O*L],re=[h[0]+D*L,h[1]+N*L];i.lineTo(se[0],se[1]),i.quadraticCurveTo(h[0],h[1],re[0],re[1])}let c=r[r.length-1];return i.lineTo(c[0],c[1]),i.toString()}static getStateMachinePath(e,t,i){let r=sp(),a=(e[0]+t[0])/2,c=(e[1]+t[1])/2,p=n.getContinuousOrientation(e,t),u=-p[1],h=p[0],g=i+n.STATE_MACHINE_ZERO_CURVE_OFFSET,y=[a+u*g,c+h*g];return r.moveTo(e[0],e[1]),r.bezierCurveTo(y[0],y[1],y[0],y[1],t[0],t[1]),r.toString()}static getJsPlumbBezierPath(e,t,i,r,a){let{sourceControlPoint:c,targetControlPoint:p}=n.getBezierControlPoints(e,t,i,r,a),u=sp();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=i=>i>0?1:i<0?-1:0;return[t(e[0]),t(e[1])]}static findBezierControlPoint(e,t,i,r,a,c){let u=r[0]!==a[0]||r[1]===a[1],h=[0,0];return u?(a[0]===0?h[0]=i[0]<t[0]?e[0]+10:e[0]-10:h[0]=e[0]+c*a[0],a[1]===0?h[1]=i[1]<t[1]?e[1]+10:e[1]-10:h[1]=e[1]+c*r[1]):(r[0]===0?h[0]=t[0]<i[0]?e[0]+10:e[0]-10:h[0]=e[0]-c*r[0],r[1]===0?h[1]=t[1]<i[1]?e[1]+10:e[1]-10:h[1]=e[1]+c*a[1]),h}}return n})();var td=(()=>{class n{cssFixer;fontFixer;selectionManager;mapSettings;themeService=f(pi);onContextMenu=new _e;draggable=new ed;static SURROUNDING_TEXT_BORDER=5;enabled=!0;constructor(e,t,i,r){this.cssFixer=e,this.fontFixer=t,this.selectionManager=i,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,i=e.selectAll("g.link_node_position").data(h=>{let g=h.link_style?.type===0;return[[h.source,h.nodes[0],g],[h.target,h.nodes[1],g]]}),r=i.enter().append("g").classed("link_node_position",!0),a=i.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,g){h.preventDefault(),t.onContextMenu.emit(new ES(h,g))});u.select("text.interface_label").text(h=>h.label.text).attr("style",h=>{let g=this.cssFixer.fix(h.label.style);return g=this.fontFixer.fixStyles(g),g=this.applyThemeLabelColor(g),g}).attr("x",h=>this.getRenderedLabelX(h)).attr("y",h=>this.getRenderedLabelY(h)).attr("transform",h=>{let g=this.getRenderedLabelX(h),y=this.getRenderedLabelY(h);return`rotate(${h.label.rotation}, ${g}, ${y})`}),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 g=Ut(this),b=u.select(`text[interface_label_id="${h.id}"]`).node().getBBox(),x=2;g.attr("width",b.width+x*2),g.attr("height",b.height+x*2),g.attr("x",b.x-x),g.attr("y",b.y-x),g.attr("transform",`rotate(${h.label.rotation}, ${b.x-x}, ${b.y-x})`)}),c.exit().remove(),this.mapSettings.isReadOnly||this.draggable.call(u)}static \u0275fac=function(t){return new(t||n)(ge(Pl),ge(ra),ge(Xo),ge(Al))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Vv=class{x;y;status;port;constructor(o,e,t,i){this.x=o,this.y=e,this.status=t,this.port=i}};var IS=(()=>{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(i){i.isMultiplied=(i.parallelLinksCount||1)>1;let r=Ut(this),a=r.select("path"),c=t.mapSettingsService.showInterfaceLabels,p=i.link_style?.type===0,u=c&&t.mapSettingsService.integrateLinkLabelsToLinks,h=c&&t.shouldRenderTooltipOnly(i),g=[],y=a.node();if(y){let b=y.getTotalLength();if(i.source&&i.target&&(h||b>n.MIN_LINK_LENGTH_FOR_LABELS)){let x=h?Math.min(n.LABEL_DISTANCE,b/4):n.LABEL_DISTANCE,M=y.getPointAtLength(x),w=y.getPointAtLength(b-x),S=i.nodes?.find(O=>O.nodeId===i.source.id)?.label?.text||"",E=i.nodes?.find(O=>O.nodeId===i.target.id)?.label?.text||"";g=[new Vv(M.x,M.y,i.suspend?"suspended":i.source.status,S),new Vv(w.x,w.y,i.suspend?"suspended":i.target.status,E)]}}if(t.renderEndpointHoverTooltips(r,g,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 b=r.selectAll("g.status_label").data(g),x=b.enter().append("g").attr("class","status_label"),M=b.merge(x).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 S=M.selectAll("text").data(E=>[E]);S.enter().append("text").merge(S).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"),S.exit().remove(),b.exit().remove()}else{r.selectAll("g.status_label").remove();let b=r.selectAll("circle.status_started").data(g.filter(D=>D.status==="started")),x=b.enter().append("circle");b.merge(x).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),b.exit().remove();let M=r.selectAll("rect.status_stopped").data(g.filter(D=>D.status==="stopped")),w=M.enter().append("rect"),S=10;M.merge(w).attr("class","status_stopped").attr("x",D=>D.x-S/2).attr("y",D=>D.y-S/2).attr("width",S).attr("height",S).attr("fill","red").classed("link-hidden",()=>p),M.exit().remove();let E=r.selectAll("circle.status_suspended").data(g.filter(D=>D.status==="suspended")),O=E.enter().append("circle");E.merge(O).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||"",i=n.LABEL_FONT_SIZE*.62,r=t.length*i+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,i){let r=e.selectAll("g.status_hover_tooltip").data(i?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,i){let r=t.node(),a=r&&r.parentNode?Ut(r.parentNode):null;if(!i){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(_o))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Gf=class{endpointOrder=new Map;getEndpointOrderKey(o,e){return`${o||""}:${e}`}getEndpointOrder(o,e){return this.endpointOrder.get(this.getEndpointOrderKey(o.id,e))||0}hasDistanceBasedParallelSpacing(o){return o.parallelLinksCount>1&&typeof o.distance=="number"&&!Number.isNaN(o.distance)}getRenderEndpointOrder(o,e){return this.hasDistanceBasedParallelSpacing(o)?0:this.getEndpointOrder(o,e)}getEndpointPoint(o,e,t,i=0){let r=-e[1],a=e[0],p=t*14+i;return[o[0]+r*p,o[1]+a*p]}getFaceEndpointOrder(o,e){let t=e-(o-1)/2;return o===2?e===0?-1:1:t}buildEndpointOrder(o){this.endpointOrder.clear();let e=new Map;o.forEach(t=>{if(!t.source||!t.target||!t.nodes||t.nodes.length<2||en.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=en.getContinuousOrientation(r,a),h=`${c}:${u[0]},${u[1]}`,g=-u[1],y=u[0],b=a[0]-r[0],x=a[1]-r[1],M=b*g+x*y,w=e.get(h)||[];w.push({link:t,endpointIndex:0,projection:M}),e.set(h,w)}if(p){let u=en.getContinuousOrientation(a,r),h=`${p}:${u[0]},${u[1]}`,g=-u[1],y=u[0],b=r[0]-a[0],x=r[1]-a[1],M=b*g+x*y,w=e.get(h)||[];w.push({link:t,endpointIndex:1,projection:M}),e.set(h,w)}}),e.forEach(t=>{t.sort((i,r)=>i.projection-r.projection),t.forEach((i,r)=>{let a=this.getFaceEndpointOrder(t.length,r);this.endpointOrder.set(this.getEndpointOrderKey(i.link.id,i.endpointIndex),a)})})}clearLabelRenderOffsets(o){o.nodes&&o.nodes.forEach(e=>{e.bezierRenderOffsetX=0,e.bezierRenderOffsetY=0})}applyLabelRenderOffsets(o,e,t,i,r){if(!o.nodes||o.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,g=i>=0?1:-1,y=Math.min(16,Math.max(7,7+Math.abs(r)*.03)),b=6,x=this.getRenderEndpointOrder(o,0),M=this.getRenderEndpointOrder(o,1),w=y*g+x*b,S=-y*g+M*b;o.nodes[0].bezierRenderOffsetX=u*w,o.nodes[0].bezierRenderOffsetY=h*w,o.nodes[1].bezierRenderOffsetX=u*S,o.nodes[1].bezierRenderOffsetY=h*S}getVariation(o){let e=this.getEndpointOrder(o,0),t=this.getEndpointOrder(o,1),i=(e-t)*6;return Math.round(Math.max(-24,Math.min(24,i)))}};var jA=class{link;source;target;style;bezierVariation;sourceOrientation;targetOrientation;controlOffset;constructor(o,e,t,i,r=0,a,c,p){this.link=o,this.source=e,this.target=t,this.style=i,this.bezierVariation=r,this.sourceOrientation=a,this.targetOrientation=c,this.controlOffset=p}},qf=(()=>{class n{onContextMenu=new _e;bezierLayout=new Gf;defaultEthernetLinkStyle={color:"#000000",width:2,type:1,link_type:en.DEFAULT_LINK_TYPE,bezier_curviness:en.BEZIER_CURVINESS_DEFAULT,flowchart_roundness:en.FLOWCHART_ROUNDNESS_DEFAULT};constructor(){}linktoEthernetLink(e){let t=en.normalizeLinkType(e.link_style?.link_type),i=[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=en.getContinuousOrientation(i,r),c=en.getContinuousOrientation(r,i),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,g={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"?en.normalizeStateMachineCurviness(e.link_style?.bezier_curviness):en.normalizeBezierCurviness(e.link_style?.bezier_curviness),flowchart_roundness:en.normalizeFlowchartRoundness(e.link_style?.flowchart_roundness),control_offset:e.link_style?.control_offset},y=i,b=r;if(t==="bezier"){y=this.bezierLayout.getEndpointPoint(i,a,this.bezierLayout.getRenderEndpointOrder(e,0)),b=this.bezierLayout.getEndpointPoint(r,c,this.bezierLayout.getRenderEndpointOrder(e,1));let x=en.getEffectiveBezierMajorAnchor(g.bezier_curviness,p),M=en.getBezierSideSign(y,b,x,a,c);this.bezierLayout.applyLabelRenderOffsets(e,y,b,M,x)}else this.bezierLayout.clearLabelRenderOffsets(e);return new jA(e,y,b,g,p,a,c,g.control_offset)}draw(e){let t=e.data();this.bezierLayout.buildEndpointOrder(Array.isArray(t)?t:[]);let i=e.selectAll("path.ethernet_link").data(c=>{if(c.linkType==="ethernet"){let p=this.linktoEthernetLink(c);return p?[p]:[]}return[]}),r=i.enter().append("path").attr("class","ethernet_link");i.merge(r).on("contextmenu",(c,p)=>{let u=p;u&&this.onContextMenu.emit(new ac(c,u))}).attr("transform",c=>en.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=>en.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?en.getFreeformBezierPath(c.source,c.target,c.sourceOrientation,c.targetOrientation,c.controlOffset):en.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=te({token:n,factory:n.\u0275fac})}return n})();var $A=class{link;source;target;style;bezierVariation;useLegacySerialPattern;sourceOrientation;targetOrientation;controlOffset;constructor(o,e,t,i,r=0,a=!1,c,p,u){this.link=o,this.source=e,this.target=t,this.style=i,this.bezierVariation=r,this.useLegacySerialPattern=a,this.sourceOrientation=c,this.targetOrientation=p,this.controlOffset=u}},Qf=(()=>{class n{onContextMenu=new _e;bezierLayout=new Gf;defaultSerialLinkStyle={color:"#800000",width:2,type:1,link_type:en.DEFAULT_LINK_TYPE,bezier_curviness:en.BEZIER_CURVINESS_DEFAULT,flowchart_roundness:en.FLOWCHART_ROUNDNESS_DEFAULT};constructor(){}getLegacySerialPath(e,t){let i=t[0]-e[0],r=t[1]-e[1],c=Math.atan2(r,i)-Math.PI/4,p=Math.cos(c),u=Math.sin(c),h=15,g=e[0]+i/2,y=e[1]+r/2,b=[g+h*p,y+h*u],x=[g-h*p,y-h*u];return`M${e[0]},${e[1]}L${b[0]},${b[1]}L${x[0]},${x[1]}L${t[0]},${t[1]}`}linkToSerialLink(e){let t=en.normalizeLinkType(e.link_style?.link_type),i=[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=en.getContinuousOrientation(i,r),c=en.getContinuousOrientation(r,i),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,g={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"?en.normalizeStateMachineCurviness(e.link_style?.bezier_curviness):en.normalizeBezierCurviness(e.link_style?.bezier_curviness),flowchart_roundness:en.normalizeFlowchartRoundness(e.link_style?.flowchart_roundness),control_offset:e.link_style?.control_offset},y=i,b=r;if(t==="bezier"){y=this.bezierLayout.getEndpointPoint(i,a,this.bezierLayout.getRenderEndpointOrder(e,0)),b=this.bezierLayout.getEndpointPoint(r,c,this.bezierLayout.getRenderEndpointOrder(e,1));let x=en.getEffectiveBezierMajorAnchor(g.bezier_curviness,p),M=en.getBezierSideSign(y,b,x,a,c);this.bezierLayout.applyLabelRenderOffsets(e,y,b,M,x)}else this.bezierLayout.clearLabelRenderOffsets(e);return new $A(e,y,b,g,p,t===en.DEFAULT_LINK_TYPE,a,c,g.control_offset)}draw(e){let t=e.data();this.bezierLayout.buildEndpointOrder(Array.isArray(t)?t:[]);let i=e.selectAll("path.serial_link").data(c=>{if(c.linkType==="serial"){let p=this.linkToSerialLink(c);return p?[p]:[]}return[]}),r=i.enter().append("path").attr("class","serial_link");i.merge(r).on("contextmenu",(c,p)=>{let u=p;u&&this.onContextMenu.emit(new ac(c,u))}).attr("transform",c=>en.getLinkTransform(c.style)).attr("fill","none").attr("stroke",c=>c.style.color).attr("stroke-width",c=>c.style.width).attr("stroke-dasharray",c=>en.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?en.getFreeformBezierPath(c.source,c.target,c.sourceOrientation,c.targetOrientation,c.controlOffset):en.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=te({token:n,factory:n.\u0275fac})}return n})();var Aa=(()=>{class n{created=new _e;edited=new _e;interfaceDragged=new _e;static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Xf=(()=>{class n{multiLinkCalculatorHelper;interfaceLabelWidget;interfaceStatusWidget;selectionManager;ethernetLinkWidget;serialLinkWidget;linksEventSource;mapLinksDataSource;onContextMenu=new _e;subscription;constructor(e,t,i,r,a,c,p,u){this.multiLinkCalculatorHelper=e,this.interfaceLabelWidget=t,this.interfaceStatusWidget=i,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;Ut("svg#map").selectAll("g.link_body").filter(i=>i&&i.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]),i=t.enter().append("g").attr("class","link_body"),r=t.merge(i).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 ac(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 ac(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 ac(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 ac(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(en.normalizeLinkType(c.link_style?.link_type)!=="freeform")return;let h=Ut(this).select("path");if(h.empty())return;let g=c.source.x+c.source.width/2,y=c.source.y+c.source.height/2,b=c.target.x+c.target.width/2,x=c.target.y+c.target.height/2,M=(g+b)/2,w=(y+x)/2,S={startX:0,startY:0,startOffset:[0,0]};h.attr("cursor","grab").on("mouseenter",function(){Ut(this).attr("cursor","grab")}).on("mouseleave",function(){Ut(this).attr("cursor","default")}).call(xs().on("start",function(E){Ut(this).attr("cursor","grabbing"),S.startX=E.x,S.startY=E.y,c.link_style?.control_offset?S.startOffset=[c.link_style.control_offset[0],c.link_style.control_offset[1]]:S.startOffset=[M,w]}).on("drag",function(E,O){let D=[E.x,E.y],N=S.startX,P=S.startY,L=S.startOffset,se=D[0]-N,re=D[1]-P,W=L[0]+se,$=L[1]+re,ue=[g,y],be=[b,x],me=en.getContinuousOrientation(ue,be),Pe=en.getContinuousOrientation(be,ue),he=en.getFreeformBezierPath(ue,be,me,Pe,[W,$]);Ut(this).attr("d",he);let j=Ut(this.parentNode),J=j.select("g.capture-icon");J.empty()||J.attr("transform",`translate (${W-5}, ${$-5}) scale(0.5)`);let le=j.select("g.filter-capture-icon");le.empty()||le.attr("transform",`translate (${W-5}, ${$-5}) scale(0.5)`);let ce=j.select("g.filter-icon");ce.empty()||ce.attr("transform",`translate (${W-5}, ${$-5}) scale(0.5)`);let De=j.select("g.pause-icon");De.empty()||De.attr("transform",`translate (${W-5}, ${$-5}) scale(0.5)`),O.link_style||(O.link_style={}),O.link_style.control_offset=[W,$]}).on("end",function(E){Ut(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(Jm),ge(td),ge(IS),ge(Xo),ge(qf),ge(Qf),ge(Aa),ge(kl))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var dp=(()=>{class n{multiLinkCalculatorHelper;linkWidget;constructor(e,t){this.multiLinkCalculatorHelper=e,this.linkWidget=t}redrawLink(e,t){let i=this.selectLink(e,t),r=null;i.each(u=>{this.mergeDefinedFields(u,t),t.link_style&&(u.link_style=Z(Z({},u.link_style||{}),t.link_style)),r=u}),i.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()?i: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),i=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(i).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 i=t.source?.id,r=t.target?.id;if(!i||!r)return this.selectLink(e,t);let a=`g.link[map-source="${i}"], g.link[map-target="${i}"], g.link[map-source="${r}"], g.link[map-target="${r}"]`;return e.selectAll(a)}mergeDefinedFields(e,t){!e||!t||Object.keys(t).forEach(i=>{let r=t[i];r!==void 0&&i!=="link_style"&&(e[i]=r)})}static \u0275fac=function(t){return new(t||n)(ge(Jm),ge(Xf))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var AS=class{datum;x;y;width;height;rotation};var OS=class{convert(o){let e=new va,t=o.attributes.getNamedItem("stroke");t&&(e.stroke=t.value);let i=o.attributes.getNamedItem("stroke-width");i&&(e.stroke_width=parseInt(i.value,10));let r=o.attributes.getNamedItem("stroke-dasharray");r&&(e.stroke_dasharray=r.value);let a=o.attributes.getNamedItem("data-curve-type");a?e.curve_type=a.value:e.curve_type="catmullrom";let c=o.attributes.getNamedItem("data-arrow-start");c&&(e.arrow_start=c.value==="true");let p=o.attributes.getNamedItem("data-arrow-end");p&&(e.arrow_end=p.value==="true");let u=o.attributes.getNamedItem("d");return u&&(e.points=this.parsePathData(u.value)),e}parsePathData(o){let e=[],t=o.match(/[MLQCZ][^MLQCZ]*/gi);if(!t)return e;for(let i of t){let r=i[0].toUpperCase(),a=i.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 wi=class{height;width;cx;cy;fill;fill_opacity;rx;ry;stroke;stroke_width;stroke_dasharray};var NS=class{convert(o){let e=new wi,t=o.attributes.getNamedItem("fill");t&&(e.fill=t.value);let i=o.attributes.getNamedItem("fill-opacity");t&&(e.fill_opacity=parseFloat(i.value));let r=o.attributes.getNamedItem("stroke");r&&(e.stroke=r.value);let a=o.attributes.getNamedItem("stroke-width");r&&(e.stroke_width=parseInt(a.value,10));let c=o.attributes.getNamedItem("stroke-dasharray");c&&(e.stroke_dasharray=c.value);let p=o.attributes.getNamedItem("cx");p&&(e.cx=parseInt(p.value,10));let u=o.attributes.getNamedItem("cy");u&&(e.cy=parseInt(u.value,10));let h=o.attributes.getNamedItem("rx");h&&(e.rx=parseInt(h.value,10));let g=o.attributes.getNamedItem("ry");return g&&(e.ry=parseInt(g.value,10)),e}};var nd=class{height;width;data};var FS=class{convert(o){let e=new nd,t=o.attributes.getNamedItem("xlink:href");t&&(e.data=t.value);let i=o.attributes.getNamedItem("width");i&&(e.width=parseInt(i.value,10));let r=o.attributes.getNamedItem("height");return r&&(e.height=parseInt(r.value,10)),e}};var Oa=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 RS=class{convert(o){let e=new Oa,t=o.attributes.getNamedItem("stroke");t&&(e.stroke=t.value);let i=o.attributes.getNamedItem("stroke-width");i&&(e.stroke_width=parseInt(i.value,10));let r=o.attributes.getNamedItem("stroke-dasharray");r&&(e.stroke_dasharray=r.value);let a=o.attributes.getNamedItem("x1");a&&(e.x1=parseInt(a.value,10));let c=o.attributes.getNamedItem("x2");c&&(e.x2=parseInt(c.value,10));let p=o.attributes.getNamedItem("y1");p&&(e.y1=parseInt(p.value,10));let u=o.attributes.getNamedItem("y2");u&&(e.y2=parseInt(u.value,10));let h=o.attributes.getNamedItem("marker-start"),g=o.attributes.getNamedItem("marker-end");h&&h.value.includes("line-start")?e.arrow_start=!0:e.arrow_start=!1,g&&g.value.includes("line-end")?e.arrow_end=!0:e.arrow_end=!1;let y=o.attributes.getNamedItem("data-drawing-type");y&&(y.value==="straight"||y.value==="freeform")?e.drawing_type=y.value:e.drawing_type="straight";let b=o.attributes.getNamedItem("data-control-offset");if(b&&b.value){let x=b.value.split(",");x.length===2?e.control_offset=[parseInt(x[0],10),parseInt(x[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 Or=class{height;width;fill;fill_opacity;stroke;stroke_width;stroke_dasharray;rx;ry};var LS=class{convert(o){let e=new Or,t=o.attributes.getNamedItem("fill");t&&(e.fill=t.value);let i=o.attributes.getNamedItem("fill-opacity");t&&(e.fill_opacity=parseFloat(i.value));let r=o.attributes.getNamedItem("stroke");r&&(e.stroke=r.value);let a=o.attributes.getNamedItem("stroke-width");r&&(e.stroke_width=parseInt(a.value,10));let c=o.attributes.getNamedItem("stroke-dasharray");c&&(e.stroke_dasharray=c.value);let p=o.attributes.getNamedItem("width");p&&(e.width=parseInt(p.value,10));let u=o.attributes.getNamedItem("height");u&&(e.height=parseInt(u.value,10));let h=o.attributes.getNamedItem("rx");h&&(e.rx=parseInt(h.value,0));let g=o.attributes.getNamedItem("ry");return g&&(e.ry=parseInt(g.value,0)),e}};var ys=class{height;width;text;fill;fill_opacity;font_family;font_size;font_weight;text_decoration};var VS=class{convert(o){let e=new ys;e.text=o.textContent;let t=o.attributes.getNamedItem("fill");t&&(e.fill=t.value);let i=o.attributes.getNamedItem("fill-opacity");i&&(e.fill_opacity=parseFloat(i.value));let r=o.attributes.getNamedItem("font-family");r&&(e.font_family=r.value);let a=o.attributes.getNamedItem("font-size");a&&(e.font_size=+a.value);let c=o.attributes.getNamedItem("font-weight");c&&(e.font_weight=c.value);let p=o.attributes.getNamedItem("text-decoration");return p&&(e.text_decoration=p.value),e}};var mp=(()=>{class n{parser;elementParsers;constructor(){this.parser=new DOMParser,this.elementParsers={text:new VS,image:new FS,rect:new LS,line:new RS,ellipse:new NS,path:new OS}}supportedTags(){return Object.keys(this.elementParsers)}convert(e){let i=this.parser.parseFromString(e,"text/xml").getElementsByTagName("svg");if(i.length!==1)throw new Error(`Cannot locate svg element root in '${e}'`);let r=i[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=te({token:n,factory:n.\u0275fac})}return n})();var BS=(()=>{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 ys?[u.element]:[]),i=t.enter().append("text").attr("class","text_element noselect"),r=t.merge(i);r.attr("style",u=>{let h=this.fontFixer.fix(u),g=[];return h.font_family&&g.push(`font-family: "${u.font_family}"`),h.font_size&&g.push(`font-size: ${u.font_size}pt`),h.font_weight&&g.push(`font-weight: ${u.font_weight}`),g.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(),g=Number(u.height),y=g>0?h.height/g:0;return`translate(0, ${isFinite(g)&&y>.5?g/2-(h.y+h.height/2):0})`}),t.exit().remove()}static \u0275fac=function(t){return new(t||n)(ge(ra))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var zS=(()=>{class n{draw(e){let t=e.selectAll("image.image_element").data(a=>a.element&&a.element instanceof nd?[a.element]:[]),i=t.enter().append("image").attr("class","image_element noselect");t.merge(i).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=te({token:n,factory:n.\u0275fac})}return n})();var id=(()=>{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=te({token:n,factory:n.\u0275fac})}return n})();var jS=(()=>{class n{qtDasharrayFixer;constructor(e){this.qtDasharrayFixer=e}draw(e){let t=e.selectAll("rect.rect_element").data(a=>a.element&&a.element instanceof Or?[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 i=t.enter().append("rect").attr("class","rect_element noselect");t.merge(i).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(id))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var $S=(()=>{class n{qtDasharrayFixer;constructor(e){this.qtDasharrayFixer=e}getCurveInterpolator(e){switch(e){case"basis":return Nv;case"catmullrom":return Ru;case"monotone":return Fv;case"none":return null;default:return Ru}}draw(e){this.drawLineElements(e),this.drawCurveElements(e)}drawLineElements(e){let t=this,i=e.select("defs");i.empty()&&(i=e.append("defs"));let r=e.selectAll("line.line_element").data(g=>g.element&&g.element instanceof Oa&&g.element.drawing_type!=="freeform"?[g]:[]);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(g){let y=g.element,b=y.stroke;y.arrow_end&&t.createOrUpdateArrowMarkerForLine(i,g.id,"end",y.stroke,y.stroke_width),y.arrow_start&&t.createOrUpdateArrowMarkerForLine(i,g.id,"start",y.stroke,y.stroke_width),Ut(this).attr("stroke",y.stroke).attr("stroke-width",y.stroke_width).attr("stroke-dasharray",t.qtDasharrayFixer.fix(y.stroke_dasharray)).attr("x1",y.x1).attr("x2",y.x2).attr("y1",y.y1).attr("y2",y.y2).attr("cursor","pointer").attr("marker-end",y.arrow_end?`url(#line-end-${g.id})`:null).attr("marker-start",y.arrow_start?`url(#line-start-${g.id})`:null).on("mouseenter",function(){let M=getComputedStyle(document.documentElement).getPropertyValue("--mat-sys-error").trim();Ut(this).attr("stroke",M),y.arrow_end&&i.select(`#line-end-${g.id} path`).attr("fill",M),y.arrow_start&&i.select(`#line-start-${g.id} path`).attr("fill",M)}).on("mouseleave",function(){Ut(this).attr("stroke",b),y.arrow_end&&i.select(`#line-end-${g.id} path`).attr("fill",b),y.arrow_start&&i.select(`#line-start-${g.id} path`).attr("fill",b)});let x=Ut(this.parentNode).select("text.line_text_label");y.text&&y.text.trim()!==""?x.text(y.text).attr("x",y.text_x).attr("y",y.text_y).attr("fill",y.text_fill).attr("font-family",y.text_font_family).attr("font-size",`${y.text_font_size}px`).attr("font-weight",y.text_font_weight).attr("visibility","visible").attr("class","line_text_label noselect"):x.attr("visibility","hidden")});let p=e.selectAll("path.line_element_freeform").data(g=>g.element&&g.element instanceof Oa&&g.element.drawing_type==="freeform"?[g]:[]);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(g){let y=g.element;y.arrow_end&&t.createOrUpdateArrowMarkerForLine(i,g.id,"end",y.stroke,y.stroke_width),y.arrow_start&&t.createOrUpdateArrowMarkerForLine(i,g.id,"start",y.stroke,y.stroke_width);let b=[y.x1,y.y1],x=[y.x2,y.y2],M=y.control_offset||[(y.x1+y.x2)/2,(y.y1+y.y2)/2],w=en.getFreeformBezierPath(b,x,void 0,void 0,M);Ut(this).attr("d",w).attr("stroke",y.stroke).attr("stroke-width",y.stroke_width).attr("stroke-dasharray",t.qtDasharrayFixer.fix(y.stroke_dasharray)).attr("fill","none").attr("cursor","grab").attr("marker-end",y.arrow_end?`url(#line-end-${g.id})`:null).attr("marker-start",y.arrow_start?`url(#line-start-${g.id})`:null);let S=Ut(this.parentNode).select("text.line_text_label");y.text&&y.text.trim()!==""?S.text(y.text).attr("x",y.text_x).attr("y",y.text_y).attr("fill",y.text_fill).attr("font-family",y.text_font_family).attr("font-size",`${y.text_font_size}px`).attr("font-weight",y.text_font_weight).attr("visibility","visible").attr("class","line_text_label noselect"):S.attr("visibility","hidden")}),r.exit().remove(),p.exit().remove()}drawCurveElements(e){let t=this,i=e.select("defs");i.empty()&&(i=e.append("defs"));let r=e.selectAll("path.curve_element").data(u=>u.element&&u.element instanceof va?[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 g=h.points.map(M=>[M.x,M.y]),y=t.getCurveInterpolator(h.curve_type||"catmullrom"),b="";if(y===null){b=`M ${g[0][0]} ${g[0][1]}`;for(let M=1;M<g.length;M++)b+=` L ${g[M][0]} ${g[M][1]}`}else b=Fu().curve(y)(g)||"";h.arrow_end&&t.createOrUpdateArrowMarker(i,u.id,"end",h.stroke,h.stroke_width),h.arrow_start&&t.createOrUpdateArrowMarker(i,u.id,"start",h.stroke,h.stroke_width);let x=h.stroke;Ut(this).attr("d",b).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();Ut(this).attr("stroke",M),h.arrow_end&&i.select(`#arrow-end-${u.id} path`).attr("fill",M),h.arrow_start&&i.select(`#arrow-start-${u.id} path`).attr("fill",M)}).on("mouseleave",function(){Ut(this).attr("stroke",x),h.arrow_end&&i.select(`#arrow-end-${u.id} path`).attr("fill",x),h.arrow_start&&i.select(`#arrow-start-${u.id} path`).attr("fill",x)})}});let p=new Set(e.selectAll("path.curve_element").data().map(u=>u.id));i.selectAll('marker[id^="arrow-"]').each(function(){let u=Ut(this).attr("id");if(!u)return;let h=u.replace(/^arrow-(start|end)-/,"");p.has(h)||Ut(this).remove()})}createOrUpdateArrowMarkerForLine(e,t,i,r,a){let c=`line-${i}-${t}`,p=e.select(`marker#${c}`);p.empty()?(p=e.append("marker").attr("id",c).attr("markerWidth","4").attr("markerHeight","4").attr("refX",i==="end"?"0":"4").attr("refY","2").attr("orient","auto").attr("markerUnits","strokeWidth"),p.append("path").attr("d",i==="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,i,r,a){let c=`arrow-${i}-${t}`,p=e.select(`marker#${c}`);p.empty()?(p=e.append("marker").attr("id",c).attr("markerWidth","4").attr("markerHeight","4").attr("refX",i==="end"?"0":"4").attr("refY","2").attr("orient","auto").attr("markerUnits","strokeWidth"),p.append("path").attr("d",i==="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(id))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var HS=(()=>{class n{qtDasharrayFixer;constructor(e){this.qtDasharrayFixer=e}draw(e){let t=e.selectAll("ellipse.ellipse_element").data(a=>a.element&&a.element instanceof wi?[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 i=t.enter().append("ellipse").attr("class","ellipse_element noselect");t.merge(i).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(id))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Q_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",X_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",UA="var(--gns3-lock-badge-locked-color)",Hz="var(--gns3-lock-badge-unlocked-color)",WA="var(--gns3-lock-badge-outline-color)",US=(()=>{class n{textDrawingWidget;imageDrawingWidget;rectDrawingWidget;lineDrawingWidget;ellipseDrawingWidget;selectionManager;mapSettingsService;drawingWidgets=[];constructor(e,t,i,r,a,c,p){this.textDrawingWidget=e,this.imageDrawingWidget=t,this.rectDrawingWidget=i,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]),i=t.enter().append("g").attr("class","drawing_body"),r=t.merge(i).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 Or||a.element instanceof wi).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 Or||a.element instanceof wi).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 Or||h.element instanceof wi||h.element instanceof nd).append("g").attr("class","drawing_lock_status_badge").attr("pointer-events","none").attr("transform",h=>{if(h.element instanceof wi){let y=h.element.cx+(h.element.rx-12)/Math.SQRT2,b=h.element.cy-(h.element.ry-12)/Math.SQRT2;return`translate(${y}, ${b})`}return`translate(${(h.element.width>0?h.element.width:60)-12}, 12)`});a.filter(h=>h.locked).append("path").attr("d",Q_e).attr("transform","translate(-7.68, -7.68) scale(0.64)").attr("fill",UA).attr("stroke",WA).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",X_e).attr("fill",Hz).attr("stroke",WA).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",WA)}r.select(".rotation-handle-stem").remove(),r.select(".rotation-handle-knob").remove(),r.select(".rotation-center-point").remove(),r.filter(a=>(a.element instanceof Or||a.element instanceof wi)&&this.selectionManager.isSelected(a)).each(function(a){let c=Ut(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",Hz),c.append("line").attr("class","rotation-handle-stem").attr("pointer-events","none").attr("stroke",UA).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",UA).attr("cursor","grab")}),r.select("line.top").attr("stroke","transparent").attr("stroke-width","8px").attr("x1",a=>a.element instanceof wi?a.element.cx-a.element.width/10:"0").attr("x2",a=>a.element instanceof wi?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 wi?a.element.cx-a.element.width/10:"0").attr("x2",a=>a.element instanceof wi?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 wi?a.element.cy-a.element.height/10:"0").attr("y2",a=>a.element instanceof wi?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 wi?a.element.cy-a.element.height/10:"0").attr("y2",a=>a.element instanceof wi?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(BS),ge(zS),ge(jS),ge($S),ge(HS),ge(Xo),ge(_o))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var od=(()=>{class n{drawingWidget;svgToDrawingConverter;context;mapSettings;draggable=new ed;draggingEnabled=!1;resizingFinished=new _e;onContextMenu=new _e;constructor(e,t,i,r){this.drawingWidget=e,this.svgToDrawingConverter=t,this.context=i,this.mapSettings=r,this.svgToDrawingConverter=new mp}redrawDrawing(e,t){this.drawingWidget.draw(this.selectDrawing(e,t))}draw(e){let t=e.selectAll("g.drawing").data(re=>(re.drawings.forEach(W=>{try{W.element=this.svgToDrawingConverter.convert(W.svg)}catch{}}),re.drawings),re=>re.id),i=t.enter().append("g").attr("class","drawing").attr("drawing_id",re=>re.id).on("contextmenu",(re,W)=>{re.preventDefault(),this.onContextMenu.emit(new TS(re,W))}),r=t.merge(i);this.drawingWidget.draw(r),t.exit().remove(),this.mapSettings.isReadOnly||this.draggable.call(r);let a,c,p,u,h=!1,g=xs().on("start",(re,W)=>{document.body.style.cursor="ns-resize",p=W.y}).on("drag",(re,W)=>{let $=re;h?(c=a-($.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y)),a=$.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y),W.element.height+c<0?(h=!1,a=p,W.element.height=Math.abs(W.element.height+$.dy)):(W.y=$.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y),W.element.height+=c,W.element instanceof wi&&(W.element.cy=W.element.cy+c/2<0?1:W.element.cy+=c/2,W.element.ry=W.element.ry+c/2<0?1:W.element.ry+=c/2))):W.element.height+$.dy<0?(h=!0,a=p,W.element.height=Math.abs(W.element.height+$.dy)):(W.element.height+=$.dy,W.element instanceof wi&&(W.element.cy=W.element.cy+$.dy/2<0?1:W.element.cy+=$.dy/2,W.element.ry=W.element.ry+$.dy/2<0?1:W.element.ry+=$.dy/2)),this.redrawDrawing(e,W)}).on("end",(re,W)=>{document.body.style.cursor="initial",this.resizingFinished.emit(this.createResizingEvent(W))}),y=xs().on("start",(re,W)=>{a=re.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y),u=a+W.element.height,document.body.style.cursor="ns-resize"}).on("drag",(re,W)=>{let $=re;h?W.element.height+$.dy<0?(h=!1,a=u,W.element.height=Math.abs(W.element.height+$.dy)):(W.element.height+=$.dy,W.element instanceof wi&&(W.element.cy=W.element.cy+$.dy/2<0?1:W.element.cy+=$.dy/2,W.element.ry=W.element.ry+$.dy/2<0?1:W.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),W.element.height+c<0?(a=u,h=!0,W.element.height=Math.abs(W.element.height+$.dy)):(W.y=$.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y),W.element.height+=c,W.element instanceof wi&&(W.element.cy=W.element.cy+c/2<0?1:W.element.cy+=c/2,W.element.ry=W.element.ry+c/2<0?1:W.element.ry+=c/2))),this.redrawDrawing(e,W)}).on("end",(re,W)=>{document.body.style.cursor="initial",this.resizingFinished.emit(this.createResizingEvent(W))}),b,x,M,w,S=!1,E=xs().on("start",(re,W)=>{b=re.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x),w=b+W.element.width,document.body.style.cursor="ew-resize"}).on("drag",(re,W)=>{let $=re;S?W.element.width+$.dx<0?(b=w,S=!1,W.element.width=Math.abs(W.element.width+$.dx)):(W.element instanceof wi&&(W.element.cx=W.element.cx+$.dx/2<0?1:W.element.cx+=$.dx/2,W.element.rx=W.element.rx+$.dx/2<0?1:W.element.rx+=$.dx/2),W.element.width=W.element.width+$.dx<0?1:W.element.width+=$.dx):(x=b-($.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x)),b=$.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x),W.element.width+x<0?(b=w,S=!0,W.element.width=Math.abs(W.element.width+$.dx)):(W.x=$.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x),W.element.width+=x,W.element instanceof wi&&(W.element.cx=W.element.cx+x/2<0?1:W.element.cx+=x/2,W.element.rx=W.element.rx+x/2<0?1:W.element.rx+=x/2))),this.redrawDrawing(e,W)}).on("end",(re,W)=>{document.body.style.cursor="initial",this.resizingFinished.emit(this.createResizingEvent(W))}),O=xs().on("start",(re,W)=>{document.body.style.cursor="ew-resize",M=W.x}).on("drag",(re,W)=>{let $=re;S?(x=b-($.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x)),b=$.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x),W.element.width+x<0?(b=M,S=!1,W.element.width=Math.abs(W.element.width+$.dx)):(W.x=$.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x),W.element.width+=x,W.element instanceof wi&&(W.element.cx=W.element.cx+x/2<0?1:W.element.cx+=x/2,W.element.rx=W.element.rx+x/2<0?1:W.element.rx+=x/2))):W.element.width+$.dx<0?(b=M,S=!0,W.element.width=Math.abs(W.element.width+$.dx)):(W.element instanceof wi&&(W.element.cx=W.element.cx+$.dx/2<0?1:W.element.cx+=$.dx/2,W.element.rx=W.element.rx+$.dx/2<0?1:W.element.rx+=$.dx/2),W.element.width=W.element.width+$.dx<0?1:W.element.width+=$.dx),this.redrawDrawing(e,W)}).on("end",(re,W)=>{document.body.style.cursor="initial",this.resizingFinished.emit(this.createResizingEvent(W))}),D=xs().on("start",()=>{document.body.style.cursor="move"}).on("drag",(re,W)=>{let $=re;W.element.width+=$.dx,W.element.height+=$.dy,W.element.x2+=$.dx,W.element.y2+=$.dy,this.redrawDrawing(e,W)}).on("end",(re,W)=>{document.body.style.cursor="initial",this.resizingFinished.emit(this.createResizingEvent(W))}),N=xs().on("start",()=>{document.body.style.cursor="move"}).on("drag",(re,W)=>{let $=re;W.element.width+=$.dx,W.element.height+=$.dy,W.element.x1+=$.dx,W.element.y1+=$.dy,this.redrawDrawing(e,W)}).on("end",(re,W)=>{document.body.style.cursor="initial",this.resizingFinished.emit(this.createResizingEvent(W))});r.select("line.bottom").call(g),r.select("line.top").call(y),r.select("line.right").call(E),r.select("line.left").call(O),r.select("circle.right").call(D),r.select("circle.left").call(N),r.each(re=>{if(re.element instanceof Oa&&re.element.drawing_type==="freeform"){let W=re.element,$=e.select(`g.drawing[drawing_id="${re.id}"] path.line_element_freeform`);if(!$.empty()){let ue={startX:0,startY:0,startOffset:[0,0]};$.call(xs().on("start",be=>{if(document.body.style.cursor="grabbing",ue.startX=be.x,ue.startY=be.y,W.control_offset)ue.startOffset=[W.control_offset[0],W.control_offset[1]];else{let me=(W.x1+W.x2)/2,Pe=(W.y1+W.y2)/2;ue.startOffset=[me,Pe]}}).on("drag",be=>{let me=[be.x,be.y],Pe=ue.startX,he=ue.startY,j=ue.startOffset,J=me[0]-Pe,le=me[1]-he,ce=j[0]+J,De=j[1]+le;W.control_offset=[ce,De];let He=[W.x1,W.y1],et=[W.x2,W.y2],Ze=en.getFreeformBezierPath(He,et,void 0,void 0,[ce,De]);$.attr("d",Ze),this.redrawDrawing(e,re)}).on("end",be=>{document.body.style.cursor="initial",this.resizingFinished.emit(this.createResizingEvent(re))}))}}});let P=0,L=0,se=xs().on("start",(re,W)=>{document.body.style.cursor="grabbing";let $=re.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x),ue=re.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y);P=Math.atan2(ue-W.y,$-W.x)*(180/Math.PI),L=W.rotation||0}).on("drag",(re,W)=>{let $=re.sourceEvent.pageX-(this.context.getZeroZeroTransformationPoint().x+this.context.transformation.x),ue=re.sourceEvent.pageY-(this.context.getZeroZeroTransformationPoint().y+this.context.transformation.y),me=Math.atan2(ue-W.y,$-W.x)*(180/Math.PI)-P;me>180&&(me-=360),me<-180&&(me+=360);let Pe=L+me;for(;Pe>360;)Pe-=360;for(;Pe<-359;)Pe+=360;W.rotation=Math.round(Pe),this.redrawDrawing(e,W)}).on("end",(re,W)=>{document.body.style.cursor="initial";let $=this.createResizingEvent(W);$.rotation=W.rotation,this.resizingFinished.emit($)});r.select("circle.rotation-handle-knob").call(se)}createResizingEvent(e){let t=new AS;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(US),ge(mp),ge(Ao),ge(Al))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var WS=(()=>{class n{linksWidget;nodesWidget;drawingsWidget;constructor(e,t,i){this.linksWidget=e,this.nodesWidget=t,this.drawingsWidget=i}draw(e,t){let i=e.selectAll("g.layer").data(t,h=>h.index.toString()),r=i.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=i.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");i.exit().remove(),this.linksWidget.draw(c),this.nodesWidget.draw(p),this.drawingsWidget.draw(u)}static \u0275fac=function(t){return new(t||n)(ge(dp),ge(cp),ge(od))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var GS=(()=>{class n{nodesWidget;drawingLineTool;selectionTool;movingTool;layersWidget;layersManager;selectionManager;constructor(e,t,i,r,a,c,p){this.nodesWidget=e,this.drawingLineTool=t,this.selectionTool=i,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 i=e.selectAll("g.canvas").data([t]),r=i.enter().append("g").attr("class","canvas");i.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(i,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"),i=e.select("defs");t.selectAll("g.node_body").classed("selected",p=>this.selectionManager.isSelected(p)),t.selectAll("g.link_body").classed("selected",p=>this.selectionManager.isSelected(p));let r=new Set(this.selectionManager.getSelected().filter(p=>p instanceof qa).map(p=>p.id));t.selectAll("rect.label_selection").attr("visibility",p=>this.selectionManager.isSelected(p)||r.has(p.nodeId)?"visible":"hidden");let a=t.selectAll("g.drawing_body");a.classed("drawing_selected",p=>this.selectionManager.isSelected(p));let c=getComputedStyle(document.documentElement).getPropertyValue("--mat-sys-error").trim();a.each(function(p,u,h){let g=h[u],y=p.element&&this.selectionManager.isSelected(p);if(Ut(g).selectAll("path.curve_element").classed("selected",()=>this.selectionManager.isSelected(p)),p.element instanceof va){let x=p.element,M=x.stroke||getComputedStyle(document.documentElement).getPropertyValue("--gns3-canvas-link-color").trim(),w=this.selectionManager.isSelected(p);if(x.arrow_end){let S=i.select(`#arrow-end-${p.id} path`);S.empty()||S.attr("fill",w?c:M)}if(x.arrow_start){let S=i.select(`#arrow-start-${p.id} path`);S.empty()||S.attr("fill",w?c:M)}}}.bind(this))}disconnect(e){e.empty&&!e.empty()&&e.selectAll("*").remove()}static \u0275fac=function(t){return new(t||n)(ge(cp),ge(Wf),ge(ap),ge(jf),ge(WS),ge(Zm),ge(Xo))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Pi=(()=>{class n{httpController;constructor(e){this.httpController=e}createLink(e,t,i,r,a,c,p,u,h){return this.httpController.post(e,`/projects/${t.project_id}/links`,{nodes:[{node_id:t.node_id,port_number:i.port_number,adapter_number:i.adapter_number,label:{rotation:0,style:"font-size: 10; font-style: Verdana",text:i.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,i){return this.httpController.get(e,`/projects/${t}/links/${i}`)}deleteLink(e,t){return this.httpController.delete(e,`/projects/${t.project_id}/links/${t.link_id}`)}updateLink(e,t){let i={};return t.nodes!==void 0&&(i.nodes=t.nodes),t.filters!==void 0&&(i.filters=t.filters),t.suspend!==void 0&&(i.suspend=t.suspend),t.show_filters_icon!==void 0&&(i.show_filters_icon=t.show_filters_icon),this.httpController.put(e,`/projects/${t.project_id}/links/${t.link_id}`,i)}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,i){let r=i.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,i){return this.httpController.post(e,`/projects/${t.project_id}/links/${t.link_id}/capture/start`,i)}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=te({token:n,factory:n.\u0275fac})}return n})();var pp=(()=>{class n{context;currentScale;scaleChangeEmitter=new _e;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(Ao))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Ko=(()=>{class n{dragged=new _e;resized=new _e;selected=new _e;pointToAddSelected=new _e;saved=new _e;drawingCompleted=new _e;textAdded=new _e;textEdited=new _e;textSaved=new _e;static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var e0e=["temporaryTextElement"],Uz=(()=>{class n{temporaryTextElement=Rt("temporaryTextElement");svg=ae(void 0);controller=ae(void 0);leftPosition=Q("0px");topPosition=Q("0px");innerText=Q("");editingDrawingId;editedElement;editedLink;editedNode;mapListener;textListener;textAddingSubscription;addingFinished=new _e;drawingsEventSource=f(Ko);toolsService=f(Ml);context=f(Ao);renderer=f(Si);mapScaleService=f(pp);linkService=f(Pi);linksDataSource=f(qo);nodesDataSource=f(ui);selectionManager=f(Xo);fontFixer=f(ra);ngOnInit(){this.textAddingSubscription=this.toolsService.isTextAddingToolActivated.subscribe(e=>{e?this.activateTextAdding():this.deactivateTextAdding()}),this.activateTextEditingForDrawings(),this.activateTextEditingForNodeLabels()}activateTextAdding(){let e=t=>{let i=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-(i+a))/p,h=(t.pageY-(r+c))/p,g=u*p+i+a,y=h*p+r+c;this.leftPosition.set(g.toString()+"px"),this.topPosition.set(y.toString()+"px");let b=this.temporaryTextElement();this.renderer.setStyle(b.nativeElement,"display","initial"),this.renderer.setStyle(b.nativeElement,"transform",`scale(${this.mapScaleService.getScale()})`),b.nativeElement.focus(),document.documentElement.style.cursor="default";let x=()=>{let M=this.temporaryTextElement();this.drawingsEventSource.textAdded.emit(new MS(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=x,b.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=Ut(this.svg());t.selectAll("g.interface_label_container").select("text.interface_label").on("dblclick",function(i,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,Ut(i.currentTarget).attr("visibility","hidden"),Ut(i.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 y of r.label.style.split(";"))u.push({property:y.split(": ")[0],value:y.split(": ")[1]});let h={font_family:u.find(y=>y.property==="font-family")?u.find(y=>y.property==="font-family").value:"TypeWriter",font_size:u.find(y=>y.property==="font-size")?Number(u.find(y=>y.property==="font-size").value):10,font_weight:u.find(y=>y.property==="font-weight")?u.find(y=>y.property==="font-weight").value:"normal"};h=e.fontFixer.fix(h),e.renderer.setStyle(a.nativeElement,"color",u.find(y=>y.property==="fill")?u.find(y=>y.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 g=()=>{let y=e.temporaryTextElement().nativeElement.innerText,b=e.linksDataSource.get(e.editedLink.linkId);b.nodes.find(x=>x.node_id===e.editedNode.node_id).label.text=y,e.linkService.updateLink(e.controller(),b).subscribe(x=>{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=g,a.nativeElement.addEventListener("focusout",e.textListener),a.nativeElement.focus()})}activateTextEditingForDrawings(){let e=this,t=Ut(this.svg());t.selectAll("text.text_element").on("dblclick",function(i,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=i.currentTarget;Ut(c).attr("visibility","hidden"),Ut(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"),g=0;if(h){var y=h.match(/translate\(0,\s*([^)]+)\)/);y&&(g=parseFloat(y[1])||0)}var b=(Number(p[1].split(/,/)[1])+g)*e.context.transformation.k+e.context.getZeroZeroTransformationPoint().y+e.context.transformation.y;e.leftPosition.set(u.toString()+"px"),e.topPosition.set(b.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 x=()=>{let M=e.temporaryTextElement().nativeElement.innerText;e.drawingsEventSource.textEdited.emit(new kS(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=x,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,i){t&1&&Xt(i.temporaryTextElement,e0e,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,i){t&1&&(Co(0,"div",1,0),d(2),ko()),t&2&&(Yt("top",i.topPosition())("left",i.leftPosition()),m(2),ee(" ",i.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 Wz=(()=>{class n{svg=ae(void 0);mapListener;drawingSelected;drawingsEventSource=f(Ko);context=f(Ao);ngOnInit(){this.drawingSelected=this.drawingsEventSource.selected.subscribe(e=>{e===""?this.deactivate():this.activate()})}activate(){let e=t=>{let i=(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(i,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,i){},encapsulation:2,changeDetection:0})}return n})();var zi=(()=>{class n extends em{getItemKey(e){return e.drawing_id}static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var ji=(()=>{class n{httpController;svgToDrawingConverter;constructor(e,t){this.httpController=e,this.svgToDrawingConverter=t}add(e,t,i,r,a){return this.httpController.post(e,`/projects/${t}/drawings`,{svg:a,x:Math.round(i),y:Math.round(r),z:1})}duplicate(e,t,i){return this.httpController.post(e,`/projects/${t}/drawings`,{svg:i.svg,rotation:i.rotation,x:i.x+10,y:i.y+10,z:i.z})}updatePosition(e,t,i,r,a){let c=Math.round(r),p=Math.round(a);return t.snap_to_grid&&(i.element=this.svgToDrawingConverter.convert(i.svg),c=Math.round((c+i.element.width/2)/t.drawing_grid_size)*t.drawing_grid_size,p=Math.round((p+i.element.height/2)/t.drawing_grid_size)*t.drawing_grid_size,c=Math.round(c-i.element.width/2),p=Math.round(p-i.element.height/2)),this.httpController.put(e,`/projects/${i.project_id}/drawings/${i.drawing_id}`,{x:c,y:p})}updateSizeAndPosition(e,t,i,r,a){return this.httpController.put(e,`/projects/${t.project_id}/drawings/${t.drawing_id}`,{svg:a,x:Math.round(i),y:Math.round(r)})}updateText(e,t,i){return this.httpController.put(e,`/projects/${t.project_id}/drawings/${t.drawing_id}`,{svg:i,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(mp))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Gz=(()=>{class n{svg=ae(void 0);controller=ae(void 0);project=ae(void 0);isDrawing=!1;points=[];drawingSelected;svgSelection;canvasGroup;previewPath;drawingsEventSource=f(Ko);context=f(Ao);drawingsDataSource=f(zi);drawingService=f(ji);toolsService=f(Ml);ngOnInit(){this.svgSelection=Ut(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",i,{passive:!1}),document.addEventListener("mouseup",r,{passive:!1})},i=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",i),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(),i=this.context.transformation,r=this.context.getZeroZeroTransformationPoint(),a=(e.pageX-(r.x+i.x))/i.k,c=(e.pageY-(r.y+i.y))/i.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(b=>b.x),t=this.points.map(b=>b.y),i=Math.min(...e),r=Math.max(...e),a=Math.min(...t),c=Math.max(...t),p=r-i,u=c-a,h=new va;h.points=this.points.map(b=>({x:b.x-i,y:b.y-a}));let g=getComputedStyle(document.documentElement).getPropertyValue("--gns3-canvas-link-color").trim()||"var(--gns3-canvas-link-color)";h.stroke=g,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 y=this.convertCurveToSvg(h);this.drawingService.add(this.controller(),this.project().project_id,i,a,y).subscribe(b=>{this.drawingsDataSource.add(b)})}convertCurveToSvg(e){let t="";if(e.points.length>0){t=`M ${e.points[0].x} ${e.points[0].y}`;for(let i=1;i<e.points.length;i++)t+=` L ${e.points[i].x} ${e.points[i].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,i){},encapsulation:2,changeDetection:0})}return n})();var n0e=["*"],qz=(()=>{class n{resizingFinished;drawingsWidget=f(od);drawingsEventSource=f(Ko);ngOnInit(){this.resizingFinished=this.drawingsWidget.resizingFinished.subscribe(e=>{this.drawingsEventSource.resized.emit(new yS(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:n0e,decls:1,vars:0,template:function(t,i){t&1&&(ai(),an(0))},encapsulation:2,changeDetection:0})}return n})();var qS=(()=>{class n{inRectangle(e,t,i){return e.x<=t&&t<e.x+e.width&&e.y<=i&&i<e.y+e.height}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Qz=(()=>{class n{onSelection;selectionEventSource=f($f);graphDataManager=f(ep);inRectangleHelper=f(qS);selectionManager=f(Xo);cd=f(X);ngOnInit(){this.onSelection=this.selectionEventSource.selected.subscribe(e=>{let t=this.graphDataManager.getNodes().filter(g=>this.inRectangleHelper.inRectangle(e,g.x,g.y)),i=this.graphDataManager.getLinks().filter(g=>this.inRectangleHelper.inRectangle(e,g.x,g.y)),r=this.graphDataManager.getDrawings().filter(g=>this.inRectangleHelper.inRectangle(e,g.x,g.y)),a=this.graphDataManager.getNodes().filter(g=>{if(g.label===void 0)return!1;let y=g.x+g.label.x,b=g.y+g.label.y;return this.inRectangleHelper.inRectangle(e,y,b)}).map(g=>g.label),c=this.graphDataManager.getLinks().filter(g=>{if(g.source===void 0||g.nodes.length!=2||g.nodes[0].label===void 0)return!1;let y=g.source.x+g.nodes[0].label.x,b=g.source.y+g.nodes[0].label.y;return this.inRectangleHelper.inRectangle(e,y,b)}).map(g=>g.nodes[0]),p=this.graphDataManager.getLinks().filter(g=>{if(g.target===void 0||g.nodes.length!=2||g.nodes[1].label===void 0)return!1;let y=g.target.x+g.nodes[1].label.x,b=g.target.y+g.nodes[1].label.y;return this.inRectangleHelper.inRectangle(e,y,b)}).map(g=>g.nodes[1]),u=[...c,...p],h=[...t,...i,...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,i){},encapsulation:2,changeDetection:0})}return n})();var Xz=(()=>{class n{onSelected;onUnselected;selectionManager=f(Xo);mapChangeDetectorRef=f(Ol);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,i){},encapsulation:2,changeDetection:0})}return n})();var Kz=(()=>{class n{start;drag;end;mapSettingsSubscription;isMapLocked=!1;svg;nodesWidget=f(cp);drawingsWidget=f(od);linksWidget=f(dp);labelWidget=f(lp);interfaceWidget=f(td);selectionManager=f(Xo);nodesEventSource=f(Fl);drawingsEventSource=f(Ko);graphDataManager=f(ep);linksEventSource=f(Aa);mapSettingsService=f(_o);ngOnInit(){let e=Ut(this.svg);this.mapSettingsSubscription=this.mapSettingsService.isMapLocked.subscribe(t=>{this.isMapLocked=t}),this.start=Wn(this.nodesWidget.draggable.start,this.drawingsWidget.draggable.start,this.labelWidget.draggable.start,this.interfaceWidget.draggable.start).subscribe(t=>{let i=this.selectionManager.getSelected();t.datum instanceof qa&&i.filter(r=>r instanceof qa&&r.id===t.datum.id).length===0&&this.selectionManager.setSelected([t.datum]),t.datum instanceof Ia&&i.filter(r=>r instanceof Ia&&r.id===t.datum.id).length===0&&this.selectionManager.setSelected([t.datum]),t.datum instanceof tc&&i.filter(r=>r instanceof tc&&r.id===t.datum.id).length===0&&this.selectionManager.setSelected([t.datum]),t.datum instanceof $d&&i.filter(r=>r instanceof $d&&r.id===t.datum.id).length===0&&this.selectionManager.setSelected([t.datum])}),this.drag=Wn(this.nodesWidget.draggable.drag,this.drawingsWidget.draggable.drag,this.labelWidget.draggable.drag,this.interfaceWidget.draggable.drag).subscribe(t=>{if(!this.isMapLocked){let i=this.selectionManager.getSelected(),r=i.filter(x=>x instanceof qa),a=r.filter(x=>x.locked),c=r.filter(x=>!x.locked);c.forEach(x=>{x.x+=t.dx,x.y+=t.dy,this.nodesWidget.updateNodePosition(e,x),this.graphDataManager.getLinks().filter(w=>w.target!==void 0&&w.target.id===x.id||w.source!==void 0&&w.source.id===x.id).forEach(w=>{this.linksWidget.redrawLink(e,w)})}),i.filter(x=>x instanceof Ia).filter(x=>!x.locked).forEach(x=>{x.x+=t.dx,x.y+=t.dy,this.drawingsWidget.redrawDrawing(e,x)}),i.filter(x=>x instanceof tc).filter(x=>a.filter(M=>M.id===x.nodeId).length===0).forEach(x=>{if(c.filter(S=>S.id===x.nodeId).length>0)return;let w=this.graphDataManager.getNodes().filter(S=>S.id===x.nodeId)[0];x.x+=t.dx,x.y+=t.dy,w.label.x=x.x,w.label.y=x.y,this.labelWidget.redrawLabel(e,x)}),i.filter(x=>x instanceof $d).filter(x=>a.filter(M=>M.id===x.nodeId).length===0).forEach(x=>{if(c.filter(S=>S.id===x.nodeId).length>0)return;let w=this.graphDataManager.getLinks().filter(S=>S.nodes[0].id===x.id||S.nodes[1].id===x.id)[0];w.nodes[0].id===x.id&&(w.nodes[0].label.x+=t.dx,w.nodes[0].label.y+=t.dy),w.nodes[1].id===x.id&&(w.nodes[1].label.x+=t.dx,w.nodes[1].label.y+=t.dy),this.linksWidget.redrawLink(e,w)})}}),this.end=Wn(this.nodesWidget.draggable.end,this.drawingsWidget.draggable.end,this.labelWidget.draggable.end,this.interfaceWidget.draggable.end).subscribe(t=>{if(!this.isMapLocked){let i=this.selectionManager.getSelected(),r=i.filter(x=>x instanceof qa),a=r.filter(x=>x.locked),c=r.filter(x=>!x.locked);c.forEach(x=>{this.nodesEventSource.dragged.emit(new Lu(x,t.dx,t.dy))}),i.filter(x=>x instanceof Ia).filter(x=>!x.locked).forEach(x=>{this.drawingsEventSource.dragged.emit(new Lu(x,t.dx,t.dy))}),i.filter(x=>x instanceof tc).filter(x=>a.filter(M=>M.id===x.nodeId).length===0).forEach(x=>{c.filter(w=>w.id===x.nodeId).length>0||this.nodesEventSource.labelDragged.emit(new Lu(x,t.dx,t.dy))}),i.filter(x=>x instanceof $d).filter(x=>a.filter(M=>M.id===x.nodeId).length===0).forEach(x=>{c.filter(w=>w.id===x.nodeId).length>0||this.linksEventSource.interfaceDragged.emit(new Lu(x,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,i){},encapsulation:2,changeDetection:0})}return n})();var Yz=(()=>{class n{linkEditedSubscription;svg=ae(void 0);controller=ae(void 0);linksWidget=f(dp);linksEventSource=f(Aa);linksDataSource=f(qo);linkService=f(Pi);ngOnInit(){let e=Ut(this.svg());this.linkEditedSubscription=this.linksEventSource.edited.subscribe(t=>{this.linksWidget.redrawLink(e,t);let i=this.controller();if(i&&t.link_style?.control_offset!==void 0){let r=this.linksDataSource.get(t.id);r&&(r.link_style=Z({},t.link_style),this.linkService.updateLinkStyle(i,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,i){},encapsulation:2,changeDetection:0})}return n})();var up=(()=>{class n{movingModeState=new _e;static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Jz=(()=>{class n{element;movingEventSource;context;mouseupListener=null;mousemoveListener=null;movingModeState;activated=!1;isDragging=!1;constructor(e,t,i){this.element=e,this.movingEventSource=t,this.context=i}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=>{Ut(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)(at(Jt),at(up),at(Ao))};static \u0275dir=vt({type:n,selectors:[["","appMovingCanvas",""]],hostBindings:function(t,i){t&1&&_("mousedown",function(a){return i.onMouseDown(a)})}})}return n})();var e9=(()=>{class n{element;renderer;movingEventSource;context;mapsScaleService;wheelListener;movingModeState;constructor(e,t,i,r,a){this.element=e,this.renderer=t,this.movingEventSource=i,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(),e.preventDefault();let t=e.deltaY;t=e.deltaMode===0?t/100:t/3,Ut(this.element.nativeElement).selectAll("g.canvas").data([this.context]).attr("transform",()=>{let a=this.context.transformation.k;if(!a||isNaN(a))return;let c=Math.max(.01,a*Math.exp(-t/10)),p=Pr(e,this.element.nativeElement),u=this.context.getZeroZeroTransformationPoint(),h=u.x+this.context.transformation.x,g=u.y+this.context.transformation.y,y=(p[0]-h)/a,b=(p[1]-g)/a;this.context.transformation.k=c,this.context.transformation.x+=y*(a-c),this.context.transformation.y+=b*(a-c);let x=u.x+this.context.transformation.x,M=u.y+this.context.transformation.y;return this.mapsScaleService.setScale(c),`translate(${x}, ${M}) scale(${c})`})},this.element.nativeElement.addEventListener("wheel",this.wheelListener,{passive:!1})}removeListener(){this.element.nativeElement.removeEventListener("wheel",this.wheelListener)}static \u0275fac=function(t){return new(t||n)(at(Jt),at(Si),at(up),at(Ao),at(pp))};static \u0275dir=vt({type:n,selectors:[["","appZoomingCanvas",""]]})}return n})();var i0e=["svg"],o0e=["textEditor"];function r0e(n,o){if(n&1&&(ti(),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 QS=(()=>{class n{nodes=ae([]);links=ae([]);drawings=ae([]);symbols=ae([]);project=ae(void 0);controller=ae(void 0);width=ae(1500);height=ae(600);svgRef=Rt("svg");textEditor=Rt("textEditor");parentNativeElement;svg;onChangesDetected;subscriptions=[];drawLinkTool;rafId=null;pendingGated=!0;settings={show_interface_labels:!0};gridVisibility=Q(0);nodeGridX=0;nodeGridY=0;drawingGridX=0;drawingGridY=0;graphDataManager=f(ep);layersManager=f(Zm);context=f(Ao);mapChangeDetectorRef=f(Ol);canvasSizeDetector=f(oy);mapSettings=f(Al);element=f(Jt);interfaceLabelWidget=f(td);selectionToolWidget=f(ap);movingToolWidget=f(jf);graphLayout=f(GS);toolsService=f(Ml);mapSettingsService=f(_o);constructor(){this.parentNativeElement=this.element.nativeElement,ur(()=>{this.project()&&this.mapChangeDetectorRef.hasBeenDrawn&&(this.updateGrid(),this.mapChangeDetectorRef.detectChanges())}),ur(()=>{this.nodes(),this.links(),this.drawings(),this.mapChangeDetectorRef.hasBeenDrawn&&this.scheduleRedraw(!0)})}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.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.project()&&this.updateGrid(),this.onChangesDetected=this.mapChangeDetectorRef.changesDetected.subscribe(()=>{this.mapChangeDetectorRef.hasBeenDrawn&&this.scheduleRedraw()}),this.subscriptions.push(this.mapChangeDetectorRef.selectionChangesDetected.subscribe(()=>{this.mapChangeDetectorRef.hasBeenDrawn&&this.graphLayout.updateSelectionHighlights(this.svg)})),this.subscriptions.push(this.toolsService.isMovingToolActivated.subscribe(r=>{this.movingToolWidget.setEnabled(r),this.movingToolWidget.draw(this.svg,this.context)})),this.subscriptions.push(this.toolsService.isSelectionToolActivated.subscribe(r=>{this.selectionToolWidget.setEnabled(r),this.selectionToolWidget.draw(this.svg,this.context)})),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,i=null;this.subscriptions.push(this.graphLayout.getNodesWidget().draggable.start.subscribe(()=>{let r=this.context.getZeroZeroTransformationPoint();t=r.x,i=r.y})),this.subscriptions.push(this.graphLayout.getNodesWidget().draggable.drag.subscribe(()=>{let r=this.getSize();this.context.centerX=t,this.context.centerY=i,(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=i??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,i=null}))}ngOnDestroy(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.graphLayout.disconnect(this.svg),this.onChangesDetected.unsubscribe(),this.subscriptions.forEach(e=>{e.unsubscribe()})}applyMapSettingsChanges(){this.scheduleRedraw()}scheduleRedraw(e=!1){if(this.rafId!==null){e||(this.pendingGated=!1);return}this.pendingGated=e,this.rafId=requestAnimationFrame(()=>{this.rafId=null;let t=this.pendingGated;this.pendingGated=!0,this.redraw(t)})}createGraph(e){let t=Ut(e);this.svg=t.select("svg"),this.context.transformation.x=0,this.context.transformation.y=0,this.context.transformation.k=1,this.context.centerX=null,this.context.centerY=null,this.layersManager.clear(),this.context.size=new Rd(0,0),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,i=this.graphDataManager.getNodes(),r=this.graphDataManager.getDrawings();if(i.length===0&&r.length===0)return this.context.centerX=null,this.context.centerY=null,new Rd(e,t);let a=this.context.transformation.k,c=30,p=0,u=0,h=0,g=0;for(let E of i){let O=(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+O),h=Math.min(h,P),g=Math.max(g,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),g=Math.max(g,E.y*a);let y=e/2,b=t/2,x=Math.max(y,-p+c),M=Math.max(y,u+c),w=Math.max(b,-h+c),S=Math.max(b,g+c);return this.context.centerX=x,this.context.centerY=w,this.canvasSizeDetector.getOptimalSize(x+M,w+S)}changeLayout(){this.scheduleRedraw()}onSymbolsChange(e){this.graphDataManager.setSymbols(this.symbols())}redraw(e=!1){this.updateGrid();let t=Fd();if(ty(t,this.graphDataManager.setNodes(this.nodes())),ty(t,this.graphDataManager.setLinks(this.links())),ty(t,this.graphDataManager.setDrawings(this.drawings())),e&&YL(t))return;let i=this.context.centerX,r=this.context.centerY;if(this.context.size=this.getSize(),this.context.centerX=i??this.context.centerX,this.context.centerY=r??this.context.centerY,e&&!t7(this.svg,t,this.graphDataManager,this.context)){this.textEditor().activateTextEditingForDrawings(),this.textEditor().activateTextEditingForNodeLabels(),this.mapSettingsService.mapRenderedEmitter.emit(!0);return}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,i){t&1&&Xt(i.svgRef,i0e,5)(i.textEditor,o0e,5),t&2&&Kt(2)},hostBindings:function(t,i){t&1&&_("resize",function(a){return i.onResize(a)},Zo)},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:[Pn],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,i){if(t&1&&(ti(),s(0,"svg",2,0),I(2,r0e,7,14),l(),Vr(),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=ke(1);m(2),A(i.gridVisibility()>0&&i.project()?2:-1),m(),C("svg",r),m(),C("svg",r)("controller",i.controller())("project",i.project()),m(4),C("controller",i.controller())("svg",r),m(2),C("svg",r),m(),C("svg",r)("controller",i.controller())}},dependencies:[Uz,Wz,Gz,qz,Qz,Xz,Kz,Yz,Jz,e9],styles:["svg[_ngcontent-%COMP%]{display:block}"],changeDetection:0})}return n})();var XS=class{drawing_id;project_id;rotation;svg;locked;x;y;z;element};var KS=(()=>{class n{constructor(){}convert(e){let t=new XS;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=te({token:n,factory:n.\u0275fac})}return n})();var YS=class{rotation;style;text;x;y};var rd=(()=>{class n{fontBBoxCalculator;cssFixer;fontFixer;constructor(e,t,i){this.fontBBoxCalculator=e,this.cssFixer=t,this.fontFixer=i}convert(e){let t=this.cssFixer.fix(e.style),i=this.fontFixer.fixStyles(t),r=this.fontBBoxCalculator.calculate(e.text,i),a=new YS;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(Qc),ge(Pl),ge(ra))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var ZS=class{node_id;adapter_number;port_number;label};var Kf=(()=>{class n{mapLabelToLabel;constructor(e){this.mapLabelToLabel=e}convert(e){let t=new ZS;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(rd))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var JS=class{capture_file_name;capture_file_path;capturing;filters;link_id;link_type;nodes;project_id;suspend;link_style;show_filters_icon;wireshark;markers;distance;length;source;target;x;y};var ew=(()=>{class n{mapLinkNodeToMapLinkNode;constructor(e){this.mapLinkNodeToMapLinkNode=e}convert(e){let t=new JS;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(i=>this.mapLinkNodeToMapLinkNode.convert(i)),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(Kf))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var tw=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 nw=class{adapter_number;adapter_type;link_type;name;port_number;short_name;available};var Yf=(()=>{class n{convert(e){let t=new nw;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=te({token:n,factory:n.\u0275fac})}return n})();var hp=(()=>{class n{mapLabelToLabel;mapPortToPort;constructor(e,t){this.mapLabelToLabel=e,this.mapPortToPort=t}convert(e){let t=new tw;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(i=>this.mapPortToPort.convert(i)):[],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(rd),ge(Yf))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var ad=(()=>{class n{_entries=Q([]);entries=this._entries.asReadonly();getSnapshot(){return this._entries()}rebuildAll(e){let t=[];for(let i of e)this.collect(i,t);this.setEntries(t)}rebuildFromAggregate(e){let t=[];for(let[i,r]of Object.entries(e)){let a=i.indexOf("/"),c=a>=0?i.slice(a+1):i;t.push({name:c,linkId:r.link_id,bpf:r.bpf,tag:r.tag??null,color:r.color})}this.setEntries(t)}reconcileLink(e){let t=this._entries().filter(i=>i.linkId!==e.link_id);this.collect(e,t),this.setEntries(t)}removeLink(e){let t=this._entries().filter(i=>i.linkId!==e);this.setEntries(t)}collect(e,t){if(e.markers)for(let[i,r]of Object.entries(e.markers))t.push({name:i,linkId:e.link_id,bpf:r.bpf,tag:r.tag,color:r.color})}setEntries(e){l0e(this._entries(),e)||this._entries.set(e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();function l0e(n,o){if(n.length!==o.length)return!1;let e=i=>`${i.linkId}\0${i.name}\0${i.bpf}\0${i.tag??""}\0${i.color??""}`,t=new Set(n.map(e));for(let i of o)if(!t.has(e(i)))return!1;return!0}var d0e="M -4 -6 L 8 0 L -4 6 Z",m0e=55,p0e=3,u0e=8,n9=6,i9="\0",h0e=(n,o)=>`${n}${i9}${o??"none"}`,iw=n=>n.split(i9)[0],f0e=0,Zf=(()=>{class n{_flashing=Q(new Map);timers=new Map;DEFAULT_FLASH_MS=800;effectRef;prev=new Map;geoCache=new Map;pending=new Map;flushRaf=null;flushScheduled=!1;constructor(){let e=f(Ms);this.effectRef=ur(()=>this.applyDiff(this._flashing())),e.onDestroy(()=>{this.flushRaf!==null&&(cancelAnimationFrame(this.flushRaf),this.flushRaf=null),this.flushScheduled=!1,this.pending.clear(),this.effectRef.destroy();for(let t of[...this.prev.keys()])this.clearLink(iw(t));this.prev.clear();for(let t of this.timers.values())clearTimeout(t);this.timers.clear(),this.geoCache.clear()})}flash(e,t,i,r=null,a=null){let c=h0e(e,r),p=i&&i>0?i:this.DEFAULT_FLASH_MS;this.pending.set(c,{state:{color:t,dir:r,captureNodeId:a,_seq:f0e++},ms:p}),this.scheduleFlush()}scheduleFlush(){this.flushScheduled||(this.flushScheduled=!0,this.flushRaf=requestAnimationFrame(()=>{this.flushScheduled=!1,this.flushRaf=null,this.flush()}))}flush(){if(this.pending.size===0)return;let e=this.pending;this.pending=new Map;for(let[t,{ms:i}]of e)clearTimeout(this.timers.get(t)),this.timers.set(t,setTimeout(()=>this.expire(t),i));this._flashing.update(t=>{let i=null;for(let[r,{state:a}]of e){let c=t.get(r);(!c||c.color!==a.color||c.dir!==a.dir||c.captureNodeId!==a.captureNodeId)&&(i===null&&(i=new Map(t)),i.set(r,a))}return i??t})}expire(e){this.timers.delete(e),this._flashing.update(t=>{if(!t.has(e))return t;let i=new Map(t);return i.delete(e),i})}applyDiff(e){for(let t of[...this.prev.keys()])if(!e.has(t)){let i=iw(t);this.prev.delete(t);let r=this.bestEntryForLink(e,i);r?(this.setLink(i,r.state),this.prev.set(r.key,r.state)):this.clearLink(i)}for(let[t,i]of e){let r=this.prev.get(t);(!r||r.color!==i.color||r.dir!==i.dir||r.captureNodeId!==i.captureNodeId)&&(this.setLink(iw(t),i),this.prev.set(t,i))}}bestEntryForLink(e,t){let i=null;for(let[r,a]of e)iw(r)===t&&(!i||a._seq>i.state._seq)&&(i={key:r,state:a});return i}setLink(e,t){let i=this.selectLinkGroup(e);if(i.empty())return;let r=i.select("path.ethernet_link, path.serial_link");if(r.empty())return;r.classed("marker-pulse",!0),r.style("stroke",t.color??null);let a=t.dir==="tx"?"tx":t.dir==="rx"?"rx":null;this.renderDirArrow(e,i,r,t,a)}clearLink(e){let t=this.selectLinkGroup(e);t.empty()||(t.select("path.ethernet_link, path.serial_link").classed("marker-pulse",!1).style("stroke",null),t.selectAll("g.marker-arrow-tx, g.marker-arrow-rx").remove())}selectLinkGroup(e){return Ut("svg#map").select(`g.link[link_id="${e}"]`)}static arrowPointsAlongPath(e,t,i){return e==="tx"&&t||e==="rx"&&i}renderDirArrow(e,t,i,r,a){let c=a?`marker-arrow-${a}`:"marker-arrow";if(t.select(`g.${c}`).remove(),!a)return;let p=t.attr("map-source"),u=t.attr("map-target"),h=!!r.captureNodeId&&r.captureNodeId===p,g=!!r.captureNodeId&&r.captureNodeId===u;if(!h&&!g)return;let y=i.node();if(!y)return;let b=y.getAttribute("d")??"",x=this.geoCache.get(e);if(!x||x.d!==b){let D;try{D=y.getTotalLength()}catch{return}if(!D||!Number.isFinite(D))return;x={d:b,len:D,pts:new Map},this.geoCache.set(e,x)}let M=x.len,w=n.arrowPointsAlongPath(r.dir,h,g)?0:Math.PI,S=Math.max(p0e,Math.min(u0e,Math.round(M/m0e))),E=t.append("g").attr("class",c),O=M/(S+1);for(let D=0;D<S;D++){let N=O*(D+1);a==="rx"&&(N+=O*.5);let P=this.getCachedPt(x,y,Math.max(0,N-n9)),L=this.getCachedPt(x,y,Math.min(M,N+n9)),se=this.getCachedPt(x,y,N);if(!P||!L||!se)continue;let re=Math.atan2(L.y-P.y,L.x-P.x)+w;E.append("path").attr("d",d0e).attr("transform",`translate(${se.x},${se.y}) rotate(${re*180/Math.PI})`).style("fill",r.color??null)}}getCachedPt(e,t,i){let r=Math.round(i*100),a=e.pts.get(r);if(a!==void 0)return a;let c=this.pointAt(t,i);return e.pts.set(r,c),c}pointAt(e,t){try{let i=e.getPointAtLength(t);return i&&Number.isFinite(i.x)&&Number.isFinite(i.y)?{x:i.x,y:i.y}:null}catch{return null}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Jf=(()=>{class n{nodesDataSource;linksDataSource;drawingsDataSource;markerRegistryService;markerFlashService;nodeNotificationEmitter=new _e;linkNotificationEmitter=new _e;drawingNotificationEmitter=new _e;infoNotificationEmitter=new _e;warningNotificationEmitter=new _e;errorNotificationEmitter=new _e;constructor(e,t,i,r,a){this.nodesDataSource=e,this.linksDataSource=t,this.drawingsDataSource=i,this.markerRegistryService=r,this.markerFlashService=a}handleMessage(e){if(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"){let t=e.event;this.linksDataSource.add(t),this.markerRegistryService.reconcileLink(t),this.linkNotificationEmitter.emit(e)}if(e.action==="link.updated"){let t=e.event;this.linksDataSource.update(t),this.markerRegistryService.reconcileLink(t),this.linkNotificationEmitter.emit(e)}if(e.action==="link.deleted"){let t=e.event;this.linksDataSource.remove(t),this.markerRegistryService.removeLink(t.link_id),this.linkNotificationEmitter.emit(e)}if(e.action==="marker.match"){let t=e.event,r=this.linksDataSource.get(t.link_id)?.markers?.[t.filter];this.markerFlashService.flash(t.link_id,r?.color??null,r?.highlight_duration??null,t.dir??null,t.node_id)}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(ui),ge(qo),ge(zi),ge(ad),ge(Zf))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var mr=(()=>{class n{router;toasterService;mapSettingsService;nodeConsoleTrigger=new _e;closeNodeConsoleTrigger=new We;consoleResized=new We;openConsoles=0;defaultConsoleWidth=720;defaultConsoleHeight=408;defaultNumberOfColumns=80;defaultNumberOfRows=24;lastNumberOfColumns;lastNumberOfRows;constructor(e,t,i){this.router=e,this.toasterService=t,this.mapSettingsService=i}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 i="ws";return e.protocol==="https:"&&(i="wss"),`${i}://${e.host}:${e.port}/${ki.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: ",i=0;e.forEach(r=>{r.console_type!=="none"&&(r.status==="started"?(this.mapSettingsService.logConsoleSubject.next(!0),setTimeout(()=>{this.openConsoleForNode(r)},500)):(i++,t+=r.name+" "))}),i>0&&this.toasterService.error(t)}openConsolesForAllNodesInNewTabs(e){let t="Please start the following nodes if you want to open consoles in tabs for them: ",i=0;e.forEach(r=>{if(r.console_type==="telnet"||r.console_type==="ssh"||r.console_type==="docker_exec")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 i++,t+=r.name+" "}),i>0&&this.toasterService.error(t)}static \u0275fac=function(t){return new(t||n)(ge(_t),ge(ie),ge(_o))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Rl=(()=>{class n{minimizedWindowsSignal=Q([]);minimizedWindows=this.minimizedWindowsSignal.asReadonly();minimizeWindow(e,t,i){let r=this.minimizedWindowsSignal();r.find(a=>a.id===e)||this.minimizedWindowsSignal.set([...r,{id:e,type:t,linkId:i}])}restoreWindow(e){let t=this.minimizedWindowsSignal();this.minimizedWindowsSignal.set(t.filter(i=>i.id!==e))}isMinimized(e){return!!this.minimizedWindowsSignal().find(t=>t.id===e)}toggleMinimize(e,t,i){this.isMinimized(e)?this.restoreWindow(e):this.minimizeWindow(e,t,i)}getMinimizedByType(e){return this.minimizedWindowsSignal().filter(t=>t.type===e)}clearAll(){this.minimizedWindowsSignal.set([])}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var $s=(()=>{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=te({token:n,factory:n.\u0275fac})}return n})();var C0e=n=>({"is-invalid":n});function x0e(n,o){n&1&&R(0,"mat-spinner",4)}function b0e(n,o){n&1&&(s(0,"mat-error"),d(1,"Project name contains invalid characters"),l())}function y0e(n,o){n&1&&(s(0,"mat-error"),d(1,"Project with this name already exists"),l())}function S0e(n,o){n&1&&(s(0,"span"),d(1,"Checking..."),l())}function w0e(n,o){n&1&&(s(0,"span"),d(1,"Add project"),l())}var eg=(()=>{class n{dialogRef=f(Ie);router=f(_t);projectService=f(Ei);toasterService=f(ie);projectNameValidator=f($s);controller;projectName=U("");uuid=Q("");isCheckingName=Q(!1);nameExistsError=Q(!1);onAddProject=new _e;isNameValid=$t(()=>{let e=this.projectName();return!e||e.trim().length===0?!1:!this.projectNameValidator.get({value:e})});hasInvalidCharacters=$t(()=>{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(),i=e.find(r=>r.name===t);this.isCheckingName.set(!1),i?(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(Li()),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([$s])],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,i){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),_("input",function(a){return i.projectName.set(a.target.value)})("keydown",function(a){return i.onKeyDown(a)}),l(),I(7,x0e,1,0,"mat-spinner",4),I(8,b0e,2,0,"mat-error"),I(9,y0e,2,0,"mat-error"),l(),s(10,"div",5)(11,"button",6),_("click",function(){return i.onNoClick()}),d(12,"Cancel"),l(),s(13,"button",7),_("click",function(){return i.onAddClick()}),I(14,S0e,2,0,"span")(15,w0e,2,0,"span"),l()()()),t&2&&(m(6),C("value",i.projectName())("ngClass",un(9,C0e,i.hasInvalidCharacters()||i.nameExistsError()))("disabled",i.isCheckingName()),m(),A(i.isCheckingName()?7:-1),m(),A(i.hasInvalidCharacters()?8:-1),m(),A(i.nameExistsError()?9:-1),m(2),C("disabled",i.isCheckingName()),m(2),C("disabled",!i.isNameValid()||i.isCheckingName()),m(),A(i.isCheckingName()?14:15))},dependencies:[ne,Ji,Je,rt,ot,Gn,ve,Le,Ve,G,pe,we,Me,Xe,ni,Ti,Se,Te,dn,qn],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 M0e=n=>({lightTheme:n}),Ya=(()=>{class n{data;bottomSheetRef=f(Um);themeService=f(pi);message=Q("");isLightThemeEnabled=Q(!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)(at(DP))};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,i){t&1&&(s(0,"div",0)(1,"div",1),d(2),l(),s(3,"div",2)(4,"button",3),_("click",function(){return i.onNoClick()}),d(5,"No"),l(),s(6,"button",4),_("click",function(){return i.onYesClick()}),d(7,"Yes"),l()()()),t&2&&(C("ngClass",un(2,M0e,i.isLightThemeEnabled())),m(2),B(i.message()))},dependencies:[ne,Ji,qc,G,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 Hs(n){n||(n=f(Ms));let o=new Rr(e=>{if(n.destroyed){e.next();return}return n.onDestroy(e.next.bind(e))});return e=>e.pipe(Ge(o))}function ow(n,o){let e=o?.injector??f(rr),t=new Xd(1),i=ur(()=>{let r;try{r=n()}catch(a){Dk(()=>t.error(a));return}Dk(()=>t.next(r))},{injector:e,manualCleanup:!0});return e.get(Ms).onDestroy(()=>{i.destroy(),t.complete()}),t.asObservable()}function o9(n,o){let t=!o?.manualCleanup?o?.injector?.get(Ms)??f(Ms):null,i=k0e(o?.equal),r;o?.requireSync?r=Q({kind:0},{equal:i}):r=Q({kind:1,value:o?.initialValue},{equal:i});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(o?.requireSync&&r().kind===0)throw new Mi(601,!1);return a=t?.onDestroy(c.unsubscribe.bind(c)),$t(()=>{let p=r();switch(p.kind){case 1:return p.value;case 2:throw p.error;case 0:throw new Mi(601,!1)}},{equal:o?.equal})}function k0e(n=Object.is){return(o,e)=>o.kind===1&&e.kind===1&&n(o.value,e.value)}function XA(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var zu=XA();function m9(n){zu=n}var Vu={exec:()=>null};function $i(n,o=""){let e=typeof n=="string"?n:n.source,t={replace:(i,r)=>{let a=typeof r=="string"?r:r.source;return a=a.replace(Za.caret,"$1"),e=e.replace(i,a),t},getRegex:()=>new RegExp(e,o)};return t}var T0e=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Za={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)}}>`)},E0e=/^(?:[ \t]*(?:\n|$))+/,D0e=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,P0e=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Hv=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,I0e=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,KA=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,p9=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,u9=$i(p9).replace(/bull/g,KA).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(),A0e=$i(p9).replace(/bull/g,KA).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(),YA=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,O0e=/^[^\n]+/,ZA=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,N0e=$i(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ZA).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),F0e=$i(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,KA).getRegex(),lw="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",JA=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,R0e=$i("^ {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",JA).replace("tag",lw).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),h9=$i(YA).replace("hr",Hv).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",lw).getRegex(),L0e=$i(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",h9).getRegex(),eO={blockquote:L0e,code:D0e,def:N0e,fences:P0e,heading:I0e,hr:Hv,html:R0e,lheading:u9,list:F0e,newline:E0e,paragraph:h9,table:Vu,text:O0e},r9=$i("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Hv).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",lw).getRegex(),V0e=Ye(Z({},eO),{lheading:A0e,table:r9,paragraph:$i(YA).replace("hr",Hv).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",r9).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",lw).getRegex()}),B0e=Ye(Z({},eO),{html:$i(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",JA).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:Vu,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$i(YA).replace("hr",Hv).replace("heading",` *#{1,6} *[^
|
||
]`).replace("lheading",u9).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),z0e=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,j0e=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,f9=/^( {2,}|\\)\n(?!\s*$)/,$0e=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,tg=/[\p{P}\p{S}]/u,cw=/[\s\p{P}\p{S}]/u,tO=/[^\s\p{P}\p{S}]/u,H0e=$i(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,cw).getRegex(),g9=/(?!~)[\p{P}\p{S}]/u,U0e=/(?!~)[\s\p{P}\p{S}]/u,W0e=/(?:[^\s\p{P}\p{S}]|~)/u,G0e=$i(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",T0e?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),_9=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,q0e=$i(_9,"u").replace(/punct/g,tg).getRegex(),Q0e=$i(_9,"u").replace(/punct/g,g9).getRegex(),v9="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",X0e=$i(v9,"gu").replace(/notPunctSpace/g,tO).replace(/punctSpace/g,cw).replace(/punct/g,tg).getRegex(),K0e=$i(v9,"gu").replace(/notPunctSpace/g,W0e).replace(/punctSpace/g,U0e).replace(/punct/g,g9).getRegex(),Y0e=$i("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,tO).replace(/punctSpace/g,cw).replace(/punct/g,tg).getRegex(),Z0e=$i(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,tg).getRegex(),J0e="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",eve=$i(J0e,"gu").replace(/notPunctSpace/g,tO).replace(/punctSpace/g,cw).replace(/punct/g,tg).getRegex(),tve=$i(/\\(punct)/,"gu").replace(/punct/g,tg).getRegex(),nve=$i(/^<(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(),ive=$i(JA).replace("(?:-->|$)","-->").getRegex(),ove=$i("^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",ive).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),aw=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,rve=$i(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",aw).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),C9=$i(/^!?\[(label)\]\[(ref)\]/).replace("label",aw).replace("ref",ZA).getRegex(),x9=$i(/^!?\[(ref)\](?:\[\])?/).replace("ref",ZA).getRegex(),ave=$i("reflink|nolink(?!\\()","g").replace("reflink",C9).replace("nolink",x9).getRegex(),a9=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,nO={_backpedal:Vu,anyPunctuation:tve,autolink:nve,blockSkip:G0e,br:f9,code:j0e,del:Vu,delLDelim:Vu,delRDelim:Vu,emStrongLDelim:q0e,emStrongRDelimAst:X0e,emStrongRDelimUnd:Y0e,escape:z0e,link:rve,nolink:x9,punctuation:H0e,reflink:C9,reflinkSearch:ave,tag:ove,text:$0e,url:Vu},sve=Ye(Z({},nO),{link:$i(/^!?\[(label)\]\((.*?)\)/).replace("label",aw).getRegex(),reflink:$i(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",aw).getRegex()}),GA=Ye(Z({},nO),{emStrongRDelimAst:K0e,emStrongLDelim:Q0e,delLDelim:Z0e,delRDelim:eve,url:$i(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",a9).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:$i(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",a9).getRegex()}),lve=Ye(Z({},GA),{br:$i(f9).replace("{2,}","*").getRegex(),text:$i(GA.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),rw={normal:eO,gfm:V0e,pedantic:B0e},zv={normal:nO,gfm:GA,breaks:lve,pedantic:sve},cve={"&":"&","<":"<",">":">",'"':""","'":"'"},s9=n=>cve[n];function sd(n,o){if(o){if(Za.escapeTest.test(n))return n.replace(Za.escapeReplace,s9)}else if(Za.escapeTestNoEncode.test(n))return n.replace(Za.escapeReplaceNoEncode,s9);return n}function l9(n){try{n=encodeURI(n).replace(Za.percentDecode,"%")}catch{return null}return n}function c9(n,o){let e=n.replace(Za.findPipe,(r,a,c)=>{let p=!1,u=a;for(;--u>=0&&c[u]==="\\";)p=!p;return p?"|":" |"}),t=e.split(Za.splitPipe),i=0;if(t[0].trim()||t.shift(),t.length>0&&!t.at(-1)?.trim()&&t.pop(),o)if(t.length>o)t.splice(o);else for(;t.length<o;)t.push("");for(;i<t.length;i++)t[i]=t[i].trim().replace(Za.slashPipe,"|");return t}function jv(n,o,e){let t=n.length;if(t===0)return"";let i=0;for(;i<t;){let r=n.charAt(t-i-1);if(r===o&&!e)i++;else if(r!==o&&e)i++;else break}return n.slice(0,t-i)}function dve(n,o){if(n.indexOf(o[1])===-1)return-1;let e=0;for(let t=0;t<n.length;t++)if(n[t]==="\\")t++;else if(n[t]===o[0])e++;else if(n[t]===o[1]&&(e--,e<0))return t;return e>0?-2:-1}function mve(n,o=0){let e=o,t="";for(let i of n)if(i===" "){let r=4-e%4;t+=" ".repeat(r),e+=r}else t+=i,e++;return t}function d9(n,o,e,t,i){let r=o.href,a=o.title||null,c=n[1].replace(i.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 pve(n,o,e){let t=n.match(e.other.indentCodeCompensation);if(t===null)return o;let i=t[1];return o.split(`
|
||
`).map(r=>{let a=r.match(e.other.beginningSpace);if(a===null)return r;let[c]=a;return c.length>=i.length?r.slice(i.length):r}).join(`
|
||
`)}var sw=class{options;rules;lexer;constructor(n){this.options=n||zu}space(n){let o=this.rules.block.newline.exec(n);if(o&&o[0].length>0)return{type:"space",raw:o[0]}}code(n){let o=this.rules.block.code.exec(n);if(o){let e=o[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:o[0],codeBlockStyle:"indented",text:this.options.pedantic?e:jv(e,`
|
||
`)}}}fences(n){let o=this.rules.block.fences.exec(n);if(o){let e=o[0],t=pve(e,o[3]||"",this.rules);return{type:"code",raw:e,lang:o[2]?o[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):o[2],text:t}}}heading(n){let o=this.rules.block.heading.exec(n);if(o){let e=o[2].trim();if(this.rules.other.endingHash.test(e)){let t=jv(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:o[0],depth:o[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(n){let o=this.rules.block.hr.exec(n);if(o)return{type:"hr",raw:jv(o[0],`
|
||
`)}}blockquote(n){let o=this.rules.block.blockquote.exec(n);if(o){let e=jv(o[0],`
|
||
`).split(`
|
||
`),t="",i="",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,i=i?`${i}
|
||
${h}`:h;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,r,!0),this.lexer.state.top=g,e.length===0)break;let y=r.at(-1);if(y?.type==="code")break;if(y?.type==="blockquote"){let b=y,x=b.raw+`
|
||
`+e.join(`
|
||
`),M=this.blockquote(x);r[r.length-1]=M,t=t.substring(0,t.length-b.raw.length)+M.raw,i=i.substring(0,i.length-b.text.length)+M.text;break}else if(y?.type==="list"){let b=y,x=b.raw+`
|
||
`+e.join(`
|
||
`),M=this.list(x);r[r.length-1]=M,t=t.substring(0,t.length-y.raw.length)+M.raw,i=i.substring(0,i.length-b.raw.length)+M.raw,e=x.substring(r.at(-1).raw.length).split(`
|
||
`);continue}}return{type:"blockquote",raw:t,tokens:r,text:i}}}list(n){let o=this.rules.block.list.exec(n);if(o){let e=o[1].trim(),t=e.length>1,i={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(!(o=r.exec(n))||this.rules.block.hr.test(n))break;u=o[0],n=n.substring(u.length);let g=mve(o[2].split(`
|
||
`,1)[0],o[1].length),y=n.split(`
|
||
`,1)[0],b=!g.trim(),x=0;if(this.options.pedantic?(x=2,h=g.trimStart()):b?x=o[1].length+1:(x=g.search(this.rules.other.nonSpaceChar),x=x>4?1:x,h=g.slice(x),x+=o[1].length),b&&this.rules.other.blankLine.test(y)&&(u+=y+`
|
||
`,n=n.substring(y.length+1),p=!0),!p){let M=this.rules.other.nextBulletRegex(x),w=this.rules.other.hrRegex(x),S=this.rules.other.fencesBeginRegex(x),E=this.rules.other.headingBeginRegex(x),O=this.rules.other.htmlBeginRegex(x),D=this.rules.other.blockquoteBeginRegex(x);for(;n;){let N=n.split(`
|
||
`,1)[0],P;if(y=N,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),P=y):P=y.replace(this.rules.other.tabCharGlobal," "),S.test(y)||E.test(y)||O.test(y)||D.test(y)||M.test(y)||w.test(y))break;if(P.search(this.rules.other.nonSpaceChar)>=x||!y.trim())h+=`
|
||
`+P.slice(x);else{if(b||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(g)||E.test(g)||w.test(g))break;h+=`
|
||
`+y}b=!y.trim(),u+=N+`
|
||
`,n=n.substring(N.length+1),g=P.slice(x)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0)),i.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),i.raw+=u}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let p of i.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,i.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(!i.loose){let u=p.tokens.filter(g=>g.type==="space"),h=u.length>0&&u.some(g=>this.rules.other.anyLine.test(g.raw));i.loose=h}}if(i.loose)for(let p of i.items){p.loose=!0;for(let u of p.tokens)u.type==="text"&&(u.type="paragraph")}return i}}html(n){let o=this.rules.block.html.exec(n);if(o)return{type:"html",block:!0,raw:o[0],pre:o[1]==="pre"||o[1]==="script"||o[1]==="style",text:o[0]}}def(n){let o=this.rules.block.def.exec(n);if(o){let e=o[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),t=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:e,raw:o[0],href:t,title:i}}}table(n){let o=this.rules.block.table.exec(n);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let e=c9(o[1]),t=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=o[3]?.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
||
`):[],r={type:"table",raw:o[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 i)r.rows.push(c9(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 o=this.rules.block.lheading.exec(n);if(o){let e=o[1].trim();return{type:"heading",raw:o[0],depth:o[2].charAt(0)==="="?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(n){let o=this.rules.block.paragraph.exec(n);if(o){let e=o[1].charAt(o[1].length-1)===`
|
||
`?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:e,tokens:this.lexer.inline(e)}}}text(n){let o=this.rules.block.text.exec(n);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(n){let o=this.rules.inline.escape.exec(n);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(n){let o=this.rules.inline.tag.exec(n);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(n){let o=this.rules.inline.link.exec(n);if(o){let e=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let r=jv(e.slice(0,-1),"\\");if((e.length-r.length)%2===0)return}else{let r=dve(o[2],"()");if(r===-2)return;if(r>-1){let a=(o[0].indexOf("!")===0?5:4)+o[1].length+r;o[2]=o[2].substring(0,r),o[0]=o[0].substring(0,a).trim(),o[3]=""}}let t=o[2],i="";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(t);r&&(t=r[1],i=r[3])}else i=o[3]?o[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)),d9(o,{href:t&&t.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},o[0],this.lexer,this.rules)}}reflink(n,o){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," "),i=o[t.toLowerCase()];if(!i){let r=e[0].charAt(0);return{type:"text",raw:r,text:r}}return d9(e,i,e[0],this.lexer,this.rules)}}emStrong(n,o,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 i=[...t[0]].length-1,r,a,c=i,p=0,u=t[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,o=o.slice(-1*n.length+i);(t=u.exec(o))!=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])&&i%3&&!((i+a)%3)){p+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+p);let h=[...t[0]][0].length,g=n.slice(0,i+t.index+h+a);if(Math.min(i,a)%2){let b=g.slice(1,-1);return{type:"em",raw:g,text:b,tokens:this.lexer.inlineTokens(b)}}let y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(n){let o=this.rules.inline.code.exec(n);if(o){let e=o[2].replace(this.rules.other.newLineCharGlobal," "),t=this.rules.other.nonSpaceChar.test(e),i=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return t&&i&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:o[0],text:e}}}br(n){let o=this.rules.inline.br.exec(n);if(o)return{type:"br",raw:o[0]}}del(n,o,e=""){let t=this.rules.inline.delLDelim.exec(n);if(t&&(!t[1]||!e||this.rules.inline.punctuation.exec(e))){let i=[...t[0]].length-1,r,a,c=i,p=this.rules.inline.delRDelim;for(p.lastIndex=0,o=o.slice(-1*n.length+i);(t=p.exec(o))!=null;){if(r=t[1]||t[2]||t[3]||t[4]||t[5]||t[6],!r||(a=[...r].length,a!==i))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,i+t.index+u+a),g=h.slice(i,-i);return{type:"del",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(n){let o=this.rules.inline.autolink.exec(n);if(o){let e,t;return o[2]==="@"?(e=o[1],t="mailto:"+e):(e=o[1],t=e),{type:"link",raw:o[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}url(n){let o;if(o=this.rules.inline.url.exec(n)){let e,t;if(o[2]==="@")e=o[0],t="mailto:"+e;else{let i;do i=o[0],o[0]=this.rules.inline._backpedal.exec(o[0])?.[0]??"";while(i!==o[0]);e=o[0],o[1]==="www."?t="http://"+o[0]:t=o[0]}return{type:"link",raw:o[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(n){let o=this.rules.inline.text.exec(n);if(o){let e=this.lexer.state.inRawBlock;return{type:"text",raw:o[0],text:o[0],escaped:e}}}},sc=class qA{tokens;options;state;inlineQueue;tokenizer;constructor(o){this.tokens=[],this.tokens.links=Object.create(null),this.options=o||zu,this.options.tokenizer=this.options.tokenizer||new sw,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:Za,block:rw.normal,inline:zv.normal};this.options.pedantic?(e.block=rw.pedantic,e.inline=zv.pedantic):this.options.gfm&&(e.block=rw.gfm,this.options.breaks?e.inline=zv.breaks:e.inline=zv.gfm),this.tokenizer.rules=e}static get rules(){return{block:rw,inline:zv}}static lex(o,e){return new qA(e).lex(o)}static lexInline(o,e){return new qA(e).inlineTokens(o)}lex(o){o=o.replace(Za.carriageReturn,`
|
||
`),this.blockTokens(o,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(o,e=[],t=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(Za.tabCharGlobal," ").replace(Za.spaceLine,""));o;){let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},o,e))?(o=o.substring(i.raw.length),e.push(i),!0):!1))continue;if(i=this.tokenizer.space(o)){o=o.substring(i.raw.length);let a=e.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
|
||
`:e.push(i);continue}if(i=this.tokenizer.code(o)){o=o.substring(i.raw.length);let a=e.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
||
`)?"":`
|
||
`)+i.raw,a.text+=`
|
||
`+i.text,this.inlineQueue.at(-1).src=a.text):e.push(i);continue}if(i=this.tokenizer.fences(o)){o=o.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.heading(o)){o=o.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.hr(o)){o=o.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.blockquote(o)){o=o.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.list(o)){o=o.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.html(o)){o=o.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.def(o)){o=o.substring(i.raw.length);let a=e.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
||
`)?"":`
|
||
`)+i.raw,a.text+=`
|
||
`+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},e.push(i));continue}if(i=this.tokenizer.table(o)){o=o.substring(i.raw.length),e.push(i);continue}if(i=this.tokenizer.lheading(o)){o=o.substring(i.raw.length),e.push(i);continue}let r=o;if(this.options.extensions?.startBlock){let a=1/0,c=o.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=o.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(r))){let a=e.at(-1);t&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
||
`)?"":`
|
||
`)+i.raw,a.text+=`
|
||
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):e.push(i),t=r.length!==o.length,o=o.substring(i.raw.length);continue}if(i=this.tokenizer.text(o)){o=o.substring(i.raw.length);let a=e.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
||
`)?"":`
|
||
`)+i.raw,a.text+=`
|
||
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):e.push(i);continue}if(o){let a="Infinite loop on byte: "+o.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,e}inline(o,e=[]){return this.inlineQueue.push({src:o,tokens:e}),e}inlineTokens(o,e=[]){this.tokenizer.lexer=this;let t=o,i=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(t))!=null;)p.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(t=t.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+t.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(t))!=null;)t=t.slice(0,i.index)+"++"+t.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let r;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(t))!=null;)r=i[2]?i[2].length:0,t=t.slice(0,i.index+r)+"["+"a".repeat(i[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(;o;){a||(c=""),a=!1;let p;if(this.options.extensions?.inline?.some(h=>(p=h.call({lexer:this},o,e))?(o=o.substring(p.raw.length),e.push(p),!0):!1))continue;if(p=this.tokenizer.escape(o)){o=o.substring(p.raw.length),e.push(p);continue}if(p=this.tokenizer.tag(o)){o=o.substring(p.raw.length),e.push(p);continue}if(p=this.tokenizer.link(o)){o=o.substring(p.raw.length),e.push(p);continue}if(p=this.tokenizer.reflink(o,this.tokens.links)){o=o.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(o,t,c)){o=o.substring(p.raw.length),e.push(p);continue}if(p=this.tokenizer.codespan(o)){o=o.substring(p.raw.length),e.push(p);continue}if(p=this.tokenizer.br(o)){o=o.substring(p.raw.length),e.push(p);continue}if(p=this.tokenizer.del(o,t,c)){o=o.substring(p.raw.length),e.push(p);continue}if(p=this.tokenizer.autolink(o)){o=o.substring(p.raw.length),e.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(o))){o=o.substring(p.raw.length),e.push(p);continue}let u=o;if(this.options.extensions?.startInline){let h=1/0,g=o.slice(1),y;this.options.extensions.startInline.forEach(b=>{y=b.call({lexer:this},g),typeof y=="number"&&y>=0&&(h=Math.min(h,y))}),h<1/0&&h>=0&&(u=o.substring(0,h+1))}if(p=this.tokenizer.inlineText(u)){o=o.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(o){let h="Infinite loop on byte: "+o.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return e}},fp=class{options;parser;constructor(n){this.options=n||zu}space(n){return""}code({text:n,lang:o,escaped:e}){let t=(o||"").match(Za.notSpaceStart)?.[0],i=n.replace(Za.endingNewline,"")+`
|
||
`;return t?'<pre><code class="language-'+sd(t)+'">'+(e?i:sd(i,!0))+`</code></pre>
|
||
`:"<pre><code>"+(e?i:sd(i,!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:o}){return`<h${o}>${this.parser.parseInline(n)}</h${o}>
|
||
`}hr(n){return`<hr>
|
||
`}list(n){let o=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 i=o?"ol":"ul",r=o&&e!==1?' start="'+e+'"':"";return"<"+i+r+`>
|
||
`+t+"</"+i+`>
|
||
`}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 o="",e="";for(let i=0;i<n.header.length;i++)e+=this.tablecell(n.header[i]);o+=this.tablerow({text:e});let t="";for(let i=0;i<n.rows.length;i++){let r=n.rows[i];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>
|
||
`+o+`</thead>
|
||
`+t+`</table>
|
||
`}tablerow({text:n}){return`<tr>
|
||
${n}</tr>
|
||
`}tablecell(n){let o=this.parser.parseInline(n.tokens),e=n.header?"th":"td";return(n.align?`<${e} align="${n.align}">`:`<${e}>`)+o+`</${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>${sd(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:o,tokens:e}){let t=this.parser.parseInline(e),i=l9(n);if(i===null)return t;n=i;let r='<a href="'+n+'"';return o&&(r+=' title="'+sd(o)+'"'),r+=">"+t+"</a>",r}image({href:n,title:o,text:e,tokens:t}){t&&(e=this.parser.parseInline(t,this.parser.textRenderer));let i=l9(n);if(i===null)return sd(e);n=i;let r=`<img src="${n}" alt="${sd(e)}"`;return o&&(r+=` title="${sd(o)}"`),r+=">",r}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:sd(n.text)}},iO=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}},lc=class QA{options;renderer;textRenderer;constructor(o){this.options=o||zu,this.options.renderer=this.options.renderer||new fp,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new iO}static parse(o,e){return new QA(e).parse(o)}static parseInline(o,e){return new QA(e).parseInline(o)}parse(o){this.renderer.parser=this;let e="";for(let t=0;t<o.length;t++){let i=o[t];if(this.options.extensions?.renderers?.[i.type]){let a=i,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=i;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(o,e=this.renderer){this.renderer.parser=this;let t="";for(let i=0;i<o.length;i++){let r=o[i];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}},$v=class{options;block;constructor(n){this.options=n||zu}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?sc.lex:sc.lexInline}provideParser(){return this.block?lc.parse:lc.parseInline}},uve=class{defaults=XA();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=lc;Renderer=fp;TextRenderer=iO;Lexer=sc;Tokenizer=sw;Hooks=$v;constructor(...n){this.use(...n)}walkTokens(n,o){let e=[];for(let t of n)switch(e=e.concat(o.call(this,t)),t.type){case"table":{let i=t;for(let r of i.header)e=e.concat(this.walkTokens(r.tokens,o));for(let r of i.rows)for(let a of r)e=e.concat(this.walkTokens(a.tokens,o));break}case"list":{let i=t;e=e.concat(this.walkTokens(i.items,o));break}default:{let i=t;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(r=>{let a=i[r].flat(1/0);e=e.concat(this.walkTokens(a,o))}):i.tokens&&(e=e.concat(this.walkTokens(i.tokens,o)))}}return e}use(...n){let o=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(e=>{let t=Z({},e);if(t.async=this.defaults.async||t.async||!1,e.extensions&&(e.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let r=o.renderers[i.name];r?o.renderers[i.name]=function(...a){let c=i.renderer.apply(this,a);return c===!1&&(c=r.apply(this,a)),c}:o.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=o[i.level];r?r.unshift(i.tokenizer):o[i.level]=[i.tokenizer],i.start&&(i.level==="block"?o.startBlock?o.startBlock.push(i.start):o.startBlock=[i.start]:i.level==="inline"&&(o.startInline?o.startInline.push(i.start):o.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(o.childTokens[i.name]=i.childTokens)}),t.extensions=o),e.renderer){let i=this.defaults.renderer||new fp(this.defaults);for(let r in e.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let a=r,c=e.renderer[a],p=i[a];i[a]=(...u)=>{let h=c.apply(i,u);return h===!1&&(h=p.apply(i,u)),h||""}}t.renderer=i}if(e.tokenizer){let i=this.defaults.tokenizer||new sw(this.defaults);for(let r in e.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let a=r,c=e.tokenizer[a],p=i[a];i[a]=(...u)=>{let h=c.apply(i,u);return h===!1&&(h=p.apply(i,u)),h}}t.tokenizer=i}if(e.hooks){let i=this.defaults.hooks||new $v;for(let r in e.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let a=r,c=e.hooks[a],p=i[a];$v.passThroughHooks.has(r)?i[a]=u=>{if(this.defaults.async&&$v.passThroughHooksRespectAsync.has(r))return(async()=>{let g=await c.call(i,u);return p.call(i,g)})();let h=c.call(i,u);return p.call(i,h)}:i[a]=(...u)=>{if(this.defaults.async)return(async()=>{let g=await c.apply(i,u);return g===!1&&(g=await p.apply(i,u)),g})();let h=c.apply(i,u);return h===!1&&(h=p.apply(i,u)),h}}t.hooks=i}if(e.walkTokens){let i=this.defaults.walkTokens,r=e.walkTokens;t.walkTokens=function(a){let c=[];return c.push(r.call(this,a)),i&&(c=c.concat(i.call(this,a))),c}}this.defaults=Z(Z({},this.defaults),t)}),this}setOptions(n){return this.defaults=Z(Z({},this.defaults),n),this}lexer(n,o){return sc.lex(n,o??this.defaults)}parser(n,o){return lc.parse(n,o??this.defaults)}parseMarkdown(n){return(o,e)=>{let t=Z({},e),i=Z(Z({},this.defaults),t),r=this.onError(!!i.silent,!!i.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 o>"u"||o===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=n),i.async)return(async()=>{let a=i.hooks?await i.hooks.preprocess(o):o,c=await(i.hooks?await i.hooks.provideLexer():n?sc.lex:sc.lexInline)(a,i),p=i.hooks?await i.hooks.processAllTokens(c):c;i.walkTokens&&await Promise.all(this.walkTokens(p,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser():n?lc.parse:lc.parseInline)(p,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(r);try{i.hooks&&(o=i.hooks.preprocess(o));let a=(i.hooks?i.hooks.provideLexer():n?sc.lex:sc.lexInline)(o,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let c=(i.hooks?i.hooks.provideParser():n?lc.parse:lc.parseInline)(a,i);return i.hooks&&(c=i.hooks.postprocess(c)),c}catch(a){return r(a)}}}onError(n,o){return e=>{if(e.message+=`
|
||
Please report this to https://github.com/markedjs/marked.`,n){let t="<p>An error occurred:</p><pre>"+sd(e.message+"",!0)+"</pre>";return o?Promise.resolve(t):t}if(o)return Promise.reject(e);throw e}}},Bu=new uve;function Ii(n,o){return Bu.parse(n,o)}Ii.options=Ii.setOptions=function(n){return Bu.setOptions(n),Ii.defaults=Bu.defaults,m9(Ii.defaults),Ii};Ii.getDefaults=XA;Ii.defaults=zu;Ii.use=function(...n){return Bu.use(...n),Ii.defaults=Bu.defaults,m9(Ii.defaults),Ii};Ii.walkTokens=function(n,o){return Bu.walkTokens(n,o)};Ii.parseInline=Bu.parseInline;Ii.Parser=lc;Ii.parser=lc.parse;Ii.Renderer=fp;Ii.TextRenderer=iO;Ii.Lexer=sc;Ii.lexer=sc.lex;Ii.Tokenizer=sw;Ii.Hooks=$v;Ii.parse=Ii;var LCt=Ii.options,VCt=Ii.setOptions,BCt=Ii.use,zCt=Ii.walkTokens,jCt=Ii.parseInline;var $Ct=lc.parse,HCt=sc.lex;var hve=["*"],fve="Copy",gve="Copied",_ve=(()=>{class n{constructor(){this._buttonClick$=new We,this.copied=o9(this._buttonClick$.pipe(Vn(()=>Wn(Nn(!0),Ca(3e3).pipe(zO(!1)))),yp(),Sp(1))),this.copiedText=$t(()=>this.copied()?gve:fve)}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,i){t&1&&(Co(0,"button",0),cC("click",function(){return i.onCopyToClipboardClick()}),d(1),ko()),t&2&&(Ae("copied",i.copied()),m(),B(i.copiedText()))},encapsulation:2,changeDetection:0})}}return n})(),vve=new cn("CLIPBOARD_OPTIONS");var Cve=new cn("MARKED_EXTENSIONS"),xve=new cn("MARKED_OPTIONS"),bve=new cn("MERMAID_OPTIONS"),yve=new cn("SANITIZE");function Sve(n){return typeof n=="function"}var wve="[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",Mve="[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information",kve="[ngx-markdown] When using the `mermaid` attribute you *have to* include Mermaid files to `angular.json` or use imports. See README for more information",Tve="[ngx-markdown] When using the `clipboard` attribute you *have to* include Clipboard files to `angular.json` or use imports. See README for more information",Eve="[ngx-markdown] When using the `clipboard` attribute you *have to* provide the `viewContainerRef` parameter to `MarkdownService.render()` function",Dve="[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 b9=(()=>{class n{get options(){return this._options}set options(e){this._options=Z(Z({},this.DEFAULT_MARKED_OPTIONS),e)}get renderer(){return this.options.renderer}set renderer(e){this.options.renderer=e}constructor(){this.clipboardOptions=f(vve,{optional:!0}),this.extensions=f(Cve,{optional:!0}),this.http=f(Ks,{optional:!0}),this.mermaidOptions=f(bve,{optional:!0}),this.platform=f(Gu),this.sanitize=f(yve,{optional:!0}),this.sanitizer=f(xr),this.DEFAULT_MARKED_OPTIONS={renderer:new fp},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=Ek.HTML,this._options=null,this._reload$=new We,this.reload$=this._reload$.asObservable(),this.options=f(xve,{optional:!0})}parse(e,t=this.DEFAULT_PARSE_OPTIONS){let{decodeHtml:i,inline:r,emoji:a,mermaid:c,disableSanitizer:p}=t,u=Z(Z({},this.options),t.markedOptions),h=u.renderer||this.renderer||new fp;this.extensions&&(this.renderer=this.extendsRendererForExtensions(h)),c&&(this.renderer=this.extendsRendererForMermaid(h));let g=this.trimIndentation(e),y=i?this.decodeHtml(g):g,b=a?this.parseEmoji(y):y,x=this.parseMarked(b,u,r);return p?x:this.sanitizeHtml(x)}render(e,t=this.DEFAULT_RENDER_OPTIONS,i){let{clipboard:r,clipboardOptions:a,katex:c,katexOptions:p,mermaid:u,mermaidOptions:h}=t;c&&this.renderKatex(e,Z(Z({},this.DEFAULT_KATEX_OPTIONS),p)),u&&this.renderMermaid(e,Z(Z(Z({},this.DEFAULT_MERMAID_OPTIONS),this.mermaidOptions),h)),r&&this.renderClipboard(e,i,Z(Z(Z({},this.DEFAULT_CLIPBOARD_OPTIONS),this.clipboardOptions),a)),this.highlight(e)}reload(){this._reload$.next()}getSource(e){if(!this.http)throw new Error(Dve);return this.http.get(e,{responseType:"text"}).pipe(Bt(t=>this.handleExtension(e,t)))}highlight(e){if(!Ts(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,i=>i.classList.add("language-none")),Prism.highlightAllUnder(e)}decodeHtml(e){if(!Ts(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&&Ii.use(...this.extensions),t.\u0275NgxMarkdownRendererExtendedForExtensions=!0),e}extendsRendererForMermaid(e){let t=e;if(t.\u0275NgxMarkdownRendererExtendedForMermaid===!0)return e;let i=e.code;return e.code=r=>r.lang==="mermaid"?`<div class="mermaid">${r.text}</div>`:i(r),t.\u0275NgxMarkdownRendererExtendedForMermaid=!0,e}handleExtension(e,t){let i=e.lastIndexOf("://"),r=i>-1?e.substring(i+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,i=!1){if(t.renderer){let r=Z({},t.renderer);delete r.\u0275NgxMarkdownRendererExtendedForExtensions,delete r.\u0275NgxMarkdownRendererExtendedForMermaid,delete t.renderer,Ii.use({renderer:r})}return i?Ii.parseInline(e,t):Ii.parse(e,t)}parseEmoji(e){if(!Ts(this.platform))return e;if(typeof joypixels>"u"||typeof joypixels.shortnameToUnicode>"u")throw new Error(wve);return joypixels.shortnameToUnicode(e)}renderKatex(e,t){if(Ts(this.platform)){if(typeof katex>"u"||typeof renderMathInElement>"u")throw new Error(Mve);renderMathInElement(e,t)}}renderClipboard(e,t,i){if(!Ts(this.platform))return;if(typeof ClipboardJS>"u")throw new Error(Tve);if(!t)throw new Error(Eve);let{buttonComponent:r,buttonTemplate:a}=i,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 g=document.createElement("div");g.classList.add("markdown-clipboard-toolbar"),g.style.position="absolute",g.style.top=".5em",g.style.right=".5em",g.style.zIndex="1",h.insertAdjacentElement("beforeend",g),h.onmouseenter=()=>g.classList.add("hover"),h.onmouseleave=()=>g.classList.remove("hover");let y;if(r){let x=t.createComponent(r);y=x.hostView,x.changeDetectorRef.markForCheck()}else if(a)y=t.createEmbeddedView(a);else{let x=t.createComponent(_ve);y=x.hostView,x.changeDetectorRef.markForCheck()}let b;y.rootNodes.forEach(x=>{g.appendChild(x),b=new ClipboardJS(x,{text:()=>u.innerText})}),y.onDestroy(()=>b.destroy())}}renderMermaid(e,t=this.DEFAULT_MERMAID_OPTIONS){if(!Ts(this.platform))return;if(typeof mermaid>"u"||typeof mermaid.initialize>"u")throw new Error(kve);let i=e.querySelectorAll(".mermaid");i.length!==0&&(mermaid.initialize(t),mermaid.run({nodes:i}))}trimIndentation(e){if(!e)return"";let t;return e.split(`
|
||
`).map(i=>{let r=t;return i.length>0&&(r=isNaN(r)?i.search(/\S|$/):Math.min(i.search(/\S|$/),r)),isNaN(t)&&(t=r),r?i.substring(r):i}).join(`
|
||
`)}async sanitizeHtml(e){return Sve(this.sanitize)?this.sanitize(await e):this.sanitize!==Ek.NONE?this.sanitizer.sanitize(this.sanitize??this.DEFAULT_SECURITY_CONTEXT,e)??"":e}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=te({token:n,factory:n.\u0275fac})}}return n})(),oO=(function(n){return n.CommandLine="command-line",n.LineHighlight="line-highlight",n.LineNumbers="line-numbers",n})(oO||{}),dw=(()=>{class n{constructor(){this.element=f(Jt),this.markdownService=f(b9),this.viewContainerRef=f(ro),this.error=new _e,this.load=new _e,this.ready=new _e,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 We}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(Ge(this.destroyed$)).subscribe(()=>this.loadContent())}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}async render(e,t=!1){let i={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,i);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,oO.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,oO.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(e,t){let i=e.querySelectorAll("pre");for(let r=0;r<i.length;r++){let a=t instanceof Array?t:[t];i.item(r).classList.add(...a)}}setPluginOptions(e,t){let i=e.querySelectorAll("pre");for(let r=0;r<i.length;r++)Object.keys(t).forEach(a=>{let c=t[a];if(c){let p=this.toLispCase(a);i.item(r).setAttribute(p,c.toString())}})}toLispCase(e){let t=e.match(/([A-Z])/g);if(!t)return e;let i=e.toString();for(let r=0,a=t.length;r<a;r++)i=i.replace(new RegExp(t[r]),"-"+t[r].toLowerCase());return i.slice(0,1)==="-"&&(i=i.slice(1)),i}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:[Pn],ngContentSelectors:hve,decls:1,vars:0,template:function(t,i){t&1&&(ai(),an(0))},encapsulation:2})}}return n})();function Pve(n){return[b9,n?.loader??[],n?.clipboardOptions??[],n?.markedOptions??[],n?.mermaidOptions??[],n?.markedExtensions??[],n?.sanitize??[]]}var ng=(()=>{class n{static forRoot(e){return{ngModule:n,providers:[Pve(e)]}}static forChild(){return{ngModule:n}}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275mod=Gt({type:n})}static{this.\u0275inj=Wt({})}}return n})();function Ive(n,o){if(n&1&&(s(0,"div",2),R(1,"markdown",4),l()),n&2){let e=v(2);m(),C("data",e.markdown())}}function Ave(n,o){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 Ove(n,o){if(n&1&&(s(0,"div",0),I(1,Ive,2,1,"div",2)(2,Ave,5,0,"div",3),l()),n&2){let e=v();m(),A(e.markdown()?1:2)}}function Nve(n,o){n&1&&(s(0,"mat-icon",13),d(1,"sync"),l(),s(2,"span"),d(3,"Saving..."),l())}function Fve(n,o){n&1&&(s(0,"mat-icon",13),d(1,"check_circle"),l(),s(2,"span"),d(3,"Saved"),l())}function Rve(n,o){n&1&&(s(0,"mat-icon",13),d(1,"error"),l(),s(2,"span"),d(3,"Save failed"),l())}function Lve(n,o){if(n&1&&(s(0,"div",12),I(1,Nve,4,0),I(2,Fve,4,0),I(3,Rve,4,0),l()),n&2){let e=v(2);Ae("save-status--saving",e.saveStatus()==="saving")("save-status--saved",e.saveStatus()==="saved")("save-status--error",e.saveStatus()==="error"),m(),A(e.saveStatus()==="saving"?1:-1),m(),A(e.saveStatus()==="saved"?2:-1),m(),A(e.saveStatus()==="error"?3:-1)}}function Vve(n,o){if(n&1){let e=z();s(0,"div",1)(1,"div",7)(2,"mat-label",8),d(3,"Edit README (Markdown)"),l(),I(4,Lve,4,9,"div",9),l(),s(5,"textarea",10),_("input",function(i){k(e);let r=v();return T(r.onMarkdownInput(i))}),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),A(e.saveStatus()!=="idle"?4:-1),m(),C("value",e.markdown())}}var mw=(()=>{class n{controller=ae(void 0);project=ae(void 0);projectService=f(Ei);cd=f(X);markdown=Q("");isEditing=Q(!1);saveStatus=Q("idle");originalMarkdown="";destroy$=new We;markdownChangeSubscription=null;isEditingChange=$g();markdownChange$=new We;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(BO(2e3),yp(),yi(e=>this.autoSave(e)),Ge(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,i){t&1&&(I(0,Ove,3,1,"div",0),I(1,Vve,8,2,"div",1)),t&2&&(A(i.isEditing()?-1:0),m(),A(i.isEditing()?1:-1))},dependencies:[ne,Je,G,oe,de,we,Xe,Se,ng,dw],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 Bve=["editor"];function zve(n,o){if(n&1){let e=z();s(0,"mat-tab",15)(1,"app-readme-editor",30,0),_("isEditingChange",function(i){k(e);let r=v();return T(r.onReadmeEditingChange(i))}),l()()}if(n&2){let e=v();m(),C("controller",e.controller)("project",e.project)}}function jve(n,o){n&1&&(s(0,"th",31),d(1,"Name"),l())}function $ve(n,o){if(n&1&&(s(0,"td",32),d(1),l()),n&2){let e=o.$implicit;m(),B(e.name)}}function Hve(n,o){n&1&&(s(0,"th",31),d(1,"Value"),l())}function Uve(n,o){if(n&1&&(s(0,"td",32),d(1),l()),n&2){let e=o.$implicit;m(),B(e.value)}}function Wve(n,o){n&1&&(s(0,"th",31),d(1,"Actions"),l())}function Gve(n,o){if(n&1){let e=z();s(0,"td",32)(1,"button",33),_("click",function(){let i=k(e).$implicit,r=v();return T(r.deleteVariable(i))}),s(2,"mat-icon",34),d(3,"delete"),l()()()}}function qve(n,o){n&1&&R(0,"tr",35)}function Qve(n,o){n&1&&R(0,"tr",36)}function Xve(n,o){n&1&&R(0,"mat-spinner",39)}function Kve(n,o){n&1&&d(0," Apply ")}function Yve(n,o){if(n&1){let e=z();s(0,"button",37),_("click",function(){k(e);let i=v();return T(i.onNoClick())}),d(1,"Cancel"),l(),s(2,"button",38),_("click",function(){k(e);let i=v();return T(i.onYesClick())}),I(3,Xve,1,0,"mat-spinner",39),I(4,Kve,1,0),l()}if(n&2){let e=v();m(2),C("disabled",e.isApplying()),m(),A(e.isApplying()?3:-1),m(),A(e.isApplying()?-1:4)}}function Zve(n,o){if(n&1){let e=z();s(0,"button",41),_("click",function(){let i;k(e);let r=v(2);return T((i=r.editor())==null?null:i.cancelEdit())}),d(1,"Cancel"),l()}}function Jve(n,o){n&1&&R(0,"mat-spinner",39)}function eCe(n,o){n&1&&d(0," Apply ")}function tCe(n,o){if(n&1){let e=z();s(0,"button",37),_("click",function(){k(e);let i=v(2);return T(i.onNoClick())}),d(1,"Cancel"),l(),s(2,"button",41),_("click",function(){let i;k(e);let r=v(2);return T((i=r.editor())==null?null:i.enterEditMode())}),d(3,"Edit"),l(),s(4,"button",38),_("click",function(){k(e);let i=v(2);return T(i.onYesClick())}),I(5,Jve,1,0,"mat-spinner",39),I(6,eCe,1,0),l()}if(n&2){let e=v(2);m(4),C("disabled",e.isApplying()),m(),A(e.isApplying()?5:-1),m(),A(e.isApplying()?-1:6)}}function nCe(n,o){if(n&1&&I(0,Zve,2,0,"button",40)(1,tCe,7,3),n&2){let e=v();A(e.isReadmeEditing()?0:1)}}var ig=(()=>{class n{editor=Rt("editor");dialogRef=f(Ie);dialog=f(it);projectService=f(Ei);toasterService=f(ie);controller;project;displayedColumns=["name","value","actions"];variables=Q([]);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=Q(!1);selectedTab=Q(0);isApplying=Q(!1);originalVariables=[];isFormValid=$t(()=>this.projectName().trim().length>0&&+this.width()>=0&&+this.height()>=0&&+this.nodeGridSize()>=0&&+this.drawingGridSize()>=0);isVariableFormValid=$t(()=>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(Pm,{data:{templateName:e.name},panelClass:"base-dialog-panel"}).afterClosed().subscribe(i=>{i&&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)),i=[...this.originalVariables].sort((r,a)=>r.name.localeCompare(a.name));for(let r=0;r<t.length;r++)if(t[r].name!==i[r].name||t[r].value!==i[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(Ga,{data:e,panelClass:["base-confirmation-dialog-panel","confirmation-warning-panel"]}).afterClosed().subscribe(i=>{i&&(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 i=t.error?.message||t.message||"Failed to update project readme";this.toasterService.error(i),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,i){t&1&&Xt(i.editor,Bve,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,i){t&1&&(s(0,"h1",1),d(1,"Edit project"),l(),s(2,"div",2)(3,"mat-tab-group",3),_("selectedTabChange",function(a){return i.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),_("input",function(a){return i.projectName.set(a.target.value)}),l()(),s(11,"mat-form-field",9)(12,"mat-label"),d(13,"Scene width"),l(),s(14,"input",10),_("input",function(a){return i.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),_("input",function(a){return i.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),_("input",function(a){return i.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),_("input",function(a){return i.drawingGridSize.set(+a.target.value)}),l()()()(),s(31,"mat-checkbox",14),_("change",function(a){return i.auto_open.set(a.checked)}),d(32," Open this project in the background when GNS3 controller starts "),l(),s(33,"mat-checkbox",14),_("change",function(a){return i.auto_start.set(a.checked)}),d(34," Start all nodes when this project is opened "),l(),s(35,"mat-checkbox",14),_("change",function(a){return i.auto_close.set(a.checked)}),d(36," Leave this project running in the background after closing "),l(),s(37,"mat-checkbox",14),_("change",function(a){return i.show_interface_labels.set(a.checked)}),d(38," Show interface labels at start "),l()(),I(39,zve,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),_("input",function(a){return i.variableName.set(a.target.value)}),l()(),s(46,"mat-form-field",17)(47,"mat-label"),d(48,"Value"),l(),s(49,"input",19),_("input",function(a){return i.variableValue.set(a.target.value)}),l()()(),s(50,"button",20),_("click",function(){return i.addVariable()}),d(51," Add variable "),l(),s(52,"table",21),Fe(53,22),Ce(54,jve,2,0,"th",23)(55,$ve,2,1,"td",24),Re(),Fe(56,25),Ce(57,Hve,2,0,"th",23)(58,Uve,2,1,"td",24),Re(),Fe(59,26),Ce(60,Wve,2,0,"th",23)(61,Gve,4,0,"td",24),Re(),Ce(62,qve,1,0,"tr",27)(63,Qve,1,0,"tr",28),l()()()(),s(64,"div",29),I(65,Yve,5,3),I(66,nCe,2,1),l()),t&2&&(m(10),C("value",i.projectName()),m(4),C("value",i.width()),m(6),C("value",i.height()),m(6),C("value",i.nodeGridSize()),m(4),C("value",i.drawingGridSize()),m(),C("checked",i.auto_open()),m(2),C("checked",i.auto_start()),m(2),C("checked",i.auto_close()),m(2),C("checked",i.show_interface_labels()),m(2),A(i.controller&&i.project?39:-1),m(6),C("value",i.variableName()),m(4),C("value",i.variableValue()),m(3),C("dataSource",i.variables()),m(10),C("matHeaderRowDef",i.displayedColumns),m(),C("matRowDefColumns",i.displayedColumns),m(2),A(i.selectedTab()!==1?65:-1),m(),A(i.selectedTab()===1?66:-1))},dependencies:[ne,Je,rt,ot,Gn,ve,Le,Ve,G,pe,ze,we,Me,Xe,Ti,Se,Te,Lt,qt,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,oe,de,ht,Mt,ho,Wo,Go,dn,qn,mw],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 iCe(n,o){if(n&1){let e=z();s(0,"div",1)(1,"button",2),_("click",function(){k(e);let i=v();return T(i.onNoClick())}),d(2,"No"),l(),s(3,"button",3),_("click",function(){k(e);let i=v();return T(i.onYesClick())}),d(4," Yes "),l()()}}function oCe(n,o){if(n&1){let e=z();s(0,"div",1)(1,"button",4),_("click",function(){k(e);let i=v();return T(i.onNoClick())}),d(2,"OK"),l()()}}var pw=(()=>{class n{data;dialogRef=f(Ie);existingProject;confirmationMessage=Q("");isOpen=Q(!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)(at(Ct))};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,i){t&1&&(s(0,"div",0)(1,"span"),d(2),l()(),I(3,iCe,5,0,"div",1),I(4,oCe,3,0,"div",1)),t&2&&(m(2),B(i.confirmationMessage()),m(),A(i.isOpen()?-1:3),m(),A(i.isOpen()?4:-1))},dependencies:[ve,Ve,St,G,pe],encapsulation:2,changeDetection:0})}return n})();var rCe=n=>({empty:n}),aCe=n=>({"is-invalid":n});function sCe(n,o){n&1&&(s(0,"mat-error"),d(1,"Project name is required"),l())}function lCe(n,o){n&1&&(s(0,"mat-error"),d(1,"Project name is incorrect"),l())}function cCe(n,o){if(n&1){let e=z();s(0,"button",8)(1,"mat-icon",12),_("click",function(){k(e);let i=v(2);return T(i.onDeleteClick())}),d(2,"clear"),l()()}}function dCe(n,o){if(n&1){let e=z();s(0,"div")(1,"form",2)(2,"input",3,0),_("change",function(i){k(e);let r=v();return T(r.uploadProjectFile(i))}),l(),s(4,"button",4),_("click",function(){k(e);let i=ke(3);return T(i.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),_("input",function(i){k(e);let r=v();return T(r.projectName.set(i.target.value))}),l(),I(11,sCe,2,0,"mat-error"),I(12,lCe,2,0,"mat-error"),l(),I(13,cCe,3,0,"button",8),l(),s(14,"div",9)(15,"button",10),_("click",function(){k(e);let i=v();return T(i.onNoClick())}),d(16,"Cancel"),l(),s(17,"button",11),_("click",function(){k(e);let i=v();return T(i.onImportClick())}),d(18," Import "),l()()()()}if(n&2){let e=v();m(2),C("uploader",e.uploader),m(7),C("ngClass",un(8,rCe,!e.isDeleteVisible())),m(),C("value",e.projectName())("ngClass",un(10,aCe,e.hasInvalidCharacters()||e.isNameEmpty()&&e.submitted())),m(),A(e.isNameEmpty()&&e.submitted()?11:-1),m(),A(e.hasInvalidCharacters()?12:-1),m(),A(e.isDeleteVisible()?13:-1),m(4),C("disabled",!e.isImportEnabled())}}function mCe(n,o){if(n&1){let e=z();s(0,"div")(1,"div",13)(2,"span"),d(3),l()(),s(4,"div",9)(5,"button",11),_("click",function(){k(e);let i=v();return T(i.onNoClick())}),d(6," Finish "),l()()()}if(n&2){let e=v();m(3),B(e.resultMessage()),m(2),C("disabled",!e.isFinishEnabled())}}var og=(()=>{class n{dialog=f(it);dialogRef=f(Ie);projectService=f(Ei);projectNameValidator=f($s);toasterService=f(ie);uploadServiceService=f(Sl);snackBar=f(br);data=f(Ct);uploader;controller;uploadProgress=Q(0);isImportEnabled=Q(!1);isFinishEnabled=Q(!1);isDeleteVisible=Q(!1);resultMessage=Q("The project is being imported... Please wait");projectName=U("");submitted=Q(!1);isFirstStepCompleted=Q(!1);uuid=Q("");onImportProject=new _e;isNameEmpty=$t(()=>{let e=this.projectName();return!e||e.trim().length===0});isNameValid=$t(()=>{let e=this.projectName();return this.isNameEmpty()?!1:!this.projectNameValidator.get({value:e})});hasInvalidCharacters=$t(()=>{let e=this.projectName();return this.isNameEmpty()?!1:this.projectNameValidator.get({value:e})?.invalidName===!0});ngOnInit(){this.uploader=new Wa({url:""}),this.uploader.onAfterAddingFile=e=>{e.withCredentials=!1},this.uploader.onErrorItem=(e,t,i,r)=>{let a=JSON.parse(t);this.resultMessage.set("An error has occurred: "+a.message),this.isFinishEnabled.set(!0)},this.uploader.onCompleteItem=(e,t,i,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(),i=e.find(r=>r.name===t);i?this.openConfirmationDialog(i):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(i=>i.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(wl,{panelClass:"uplaoding-file-snackabar",data:{upload_file_type:"Project"}})}openConfirmationDialog(e){this.dialog.open(pw,{width:"300px",height:"150px",panelClass:["base-confirmation-dialog-panel","confirmation-warning-panel"],data:{existingProject:e},autoFocus:!1,disableClose:!0}).afterClosed().subscribe(i=>{i&&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(Li());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,i){t&1&&(s(0,"h1",1),d(1,"Import project"),l(),I(2,dCe,19,12,"div"),I(3,mCe,7,2,"div")),t&2&&(m(2),A(i.isFirstStepCompleted()?-1:2),m(),A(i.isFirstStepCompleted()?3:-1))},dependencies:[ne,Ji,Je,rt,ot,Gn,ve,Le,Ve,G,pe,we,Me,ni,Se,Te,oe,de,ht,Mt,ns,hl,Vc],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 pCe=n=>({lightTheme:n}),rg=(()=>{class n{bottomSheetRef=f(Um);themeService=f(pi);cd=f(X);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,i){t&1&&(s(0,"div",0)(1,"div",1),d(2),l(),s(3,"div")(4,"button",2),_("click",function(){return i.onNoClick()}),d(5,"No"),l(),s(6,"button",3),_("click",function(){return i.onYesClick()}),d(7,"Yes"),l()()()),t&2&&(C("ngClass",un(2,pCe,i.isLightThemeEnabled)),m(2),ee("Do you want to navigate to ",i.projectMessage,"?"))},dependencies:[ne,Ji,qc,G,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 uCe=n=>({"is-invalid":n});function hCe(n,o){n&1&&R(0,"mat-spinner",4)}function fCe(n,o){n&1&&(s(0,"mat-error"),d(1,"Project name is incorrect"),l())}function gCe(n,o){n&1&&(s(0,"mat-error"),d(1,"Project with this name already exists"),l())}function _Ce(n,o){n&1&&(s(0,"span"),d(1,"Checking..."),l())}function vCe(n,o){n&1&&(s(0,"span"),d(1,"Save project"),l())}var uw=(()=>{class n{dialogRef=f(Ie);projectService=f(Ei);toasterService=f(ie);projectNameValidator=f($s);controller;project;projectName=U("");isCheckingName=Q(!1);nameExistsError=Q(!1);onAddProject=new _e;isNameValid=$t(()=>{let e=this.projectName();return!e||e.trim().length===0?!1:!this.projectNameValidator.get({value:e})});hasInvalidCharacters=$t(()=>{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(),i=e.find(r=>r.name===t);this.isCheckingName.set(!1),i?(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,i){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),_("input",function(a){return i.projectName.set(a.target.value)})("keydown",function(a){return i.onKeyDown(a)}),l(),I(7,hCe,1,0,"mat-spinner",4),I(8,fCe,2,0,"mat-error"),I(9,gCe,2,0,"mat-error"),l(),s(10,"div",5)(11,"button",6),_("click",function(){return i.onNoClick()}),d(12,"Cancel"),l(),s(13,"button",7),_("click",function(){return i.onAddClick()}),I(14,_Ce,2,0,"span")(15,vCe,2,0,"span"),l()()()),t&2&&(m(6),C("value",i.projectName())("ngClass",un(9,uCe,i.hasInvalidCharacters()||i.nameExistsError()))("disabled",i.isCheckingName()),m(),A(i.isCheckingName()?7:-1),m(),A(i.hasInvalidCharacters()?8:-1),m(),A(i.nameExistsError()?9:-1),m(2),C("disabled",i.isCheckingName()),m(2),C("disabled",!i.isNameValid()||i.isCheckingName()),m(),A(i.isCheckingName()?14:15))},dependencies:[ne,Ji,Je,rt,ot,Gn,ve,Le,Ve,G,pe,we,Me,Xe,ni,Ti,Se,Te,dn,qn],styles:[".file-name-form-field[_ngcontent-%COMP%]{width:100%}.project-snackbar[_ngcontent-%COMP%]{background:var(--mat-app-primary-color)}"],changeDetection:0})}return n})();var hw=(()=>{class n{getInfoAboutNode(e,t){let i=[];return e.node_type==="cloud"?i.push(`Cloud ${e.name} is always on.`):e.node_type==="nat"?i.push(`NAT ${e.name} is always on.`):e.node_type==="ethernet-hub"?i.push(`Ethernet hub ${e.name} is always on.`):e.node_type==="ethernet_switch"?i.push(`Ethernet switch ${e.name} is always on.`):e.node_type==="frame_relay_switch"?i.push(`Frame relay switch ${e.name} is always on.`):e.node_type==="atm_switch"?i.push(`ATM switch ${e.name} is always on.`):e.node_type==="docker"?i.push(`Docker ${e.name} is ${e.status}.`):e.node_type==="dynamips"?i.push(`Dynamips ${e.name} is always on.`):e.node_type==="virtualbox"?i.push(`VirtualBox VM ${e.name} is ${e.status}.`):e.node_type==="vmware"?i.push(`VMware VM ${e.name} is ${e.status}.`):e.node_type==="qemu"?i.push(`QEMU VM ${e.name} is ${e.status}.`):e.node_type==="iou"?i.push(`IOU ${e.name} is always on.`):e.node_type==="vpcs"&&i.push(`Node ${e.name} is ${e.status}.`),i.push(`Node ID: ${e.node_id}`),i.push(`Running on controller ${t.name} with port ${t.port}.`),i.push(`Controller ID: ${t.id}`),e.console_type!=="none"&&e.console_type!=="null"&&i.push(`Console is on port ${e.console} and type is ${e.console_type}.`),e.ports.forEach(r=>{i.push(`Port ${r.name} is ${r.link_type}.`)}),i}getInfoAboutPorts(e){let t="Ports: ";return e.forEach(i=>{t+=`link_type: ${i.link_type},
|
||
|
||
name: ${i.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=te({token:n,factory:n.\u0275fac})}return n})();function CCe(n,o){if(n&1&&(s(0,"div"),d(1),l()),n&2){let e=o.$implicit;m(),B(e)}}var fw=(()=>{class n{dialogRef=f(Ie);infoService=f(hw);cd=f(X);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,i){t&1&&(s(0,"h1",0),d(1),s(2,"button",1),_("click",function(){return i.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),K(9,CCe,2,1,"div",null,Oe),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(" ",i.node.name," "),m(8),Y(i.infoList),m(4),ee(" ",i.usage," "),m(3),ee(" ",i.commandLine," "))},dependencies:[ve,Le,G,ze,oe,de,dn,ho,Wo,Go],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 gw=(()=>{class n{dialog=f(it);node=ae(void 0);controller=ae(void 0);showNode(){let t=this.dialog.open(fw,{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,i){t&1&&(s(0,"button",0),_("click",function(){return i.showNode()}),s(1,"mat-icon"),d(2,"info"),l(),s(3,"span"),d(4,"Show node information"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();function xCe(n,o){n&1&&(s(0,"th",21),d(1,"Source Port : VPI : VCI"),l())}function bCe(n,o){if(n&1&&(s(0,"td",22),d(1),l()),n&2){let e=o.$implicit;m(),B(e.portIn)}}function yCe(n,o){n&1&&(s(0,"th",21),d(1,"Destination Port : VPI : VCI"),l())}function SCe(n,o){if(n&1&&(s(0,"td",22),d(1),l()),n&2){let e=o.$implicit;m(),B(e.portOut)}}function wCe(n,o){n&1&&(s(0,"th",21),d(1,"Actions"),l())}function MCe(n,o){if(n&1){let e=z();s(0,"td",22)(1,"button",23),_("click",function(){let i=k(e).$implicit,r=v();return T(r.delete(i))}),s(2,"mat-icon",24),d(3,"delete"),l()()()}}function kCe(n,o){n&1&&R(0,"tr",25)}function TCe(n,o){n&1&&R(0,"tr",26)}var _w=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(ie);validationService=f(yP);controller;node;name;nameSignal=U("");useVpiOnly=U(!1);sourcePort=U("");sourceVci=U("");destinationPort=U("");destinationVci=U("");sourceVpi=U("");destinationVpi=U("");nodeMappings=Q(new Map);nodeMappingsDataSource=Q([]);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,i=new Map;Object.keys(t).forEach(r=>{i.set(r,t[r])}),this.nodeMappings.set(i),this.nodeMappingsDataSource.set(Array.from(i.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 i=this.validationService.validateUniqueMapping(t.portIn,this.nodeMappingsDataSource());if(!i.isValid){this.toasterService.error(i.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[i,r]of e)t[i]=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,[i,r])=>Object.assign(t,{[i]:r}),{}),this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:t=>{let i=t?.error?.message||t?.message||"Failed to update node";this.toasterService.error(i)}})}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,i){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),_("input",function(a){return i.nameSignal.set(a.target.value)}),l()(),s(10,"mat-checkbox",6),_("change",function(a){return i.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),_("input",function(a){return i.sourcePort.set(a.target.value)}),l()(),s(17,"mat-form-field",4)(18,"mat-label"),d(19,"Destination Port"),l(),s(20,"input",5),_("input",function(a){return i.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),_("input",function(a){return i.sourceVci.set(a.target.value)}),l()(),s(26,"mat-form-field",4)(27,"mat-label"),d(28,"Destination VCI"),l(),s(29,"input",5),_("input",function(a){return i.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),_("input",function(a){return i.sourceVpi.set(a.target.value)}),l()(),s(35,"mat-form-field",4)(36,"mat-label"),d(37,"Destination VPI"),l(),s(38,"input",5),_("input",function(a){return i.destinationVpi.set(a.target.value)}),l()()(),s(39,"div",8)(40,"button",9),_("click",function(){return i.add()}),d(41,"Add"),l()(),s(42,"table",10),Fe(43,11),Ce(44,xCe,2,0,"th",12)(45,bCe,2,1,"td",13),Re(),Fe(46,14),Ce(47,yCe,2,0,"th",12)(48,SCe,2,1,"td",13),Re(),Fe(49,15),Ce(50,wCe,2,0,"th",12)(51,MCe,4,0,"td",13),Re(),Ce(52,kCe,1,0,"tr",16)(53,TCe,1,0,"tr",17),l()()()()(),s(54,"div",18)(55,"button",19),_("click",function(){return i.onCancelClick()}),d(56,"Cancel"),l(),s(57,"button",20),_("click",function(){return i.onSaveClick()}),d(58,"Apply"),l()()),t&2&&(m(),ee("Configurator for ATM switch ",i.name),m(8),C("value",i.nameSignal()),m(),C("checked",i.useVpiOnly()),m(6),C("value",i.sourcePort()),m(4),C("value",i.destinationPort()),m(5),C("value",i.sourceVci()),m(4),C("value",i.destinationVci()),m(5),C("value",i.sourceVpi()),m(4),C("value",i.destinationVpi()),m(4),C("dataSource",i.nodeMappingsDataSource()),m(10),C("matHeaderRowDef",i.displayedColumns),m(),C("matRowDefColumns",i.displayedColumns))},dependencies:[ne,Je,ve,Le,Ve,kt,On,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,we,Me,Xe,Se,Te,G,pe,ze,Lt,qt,oe,de,ht,Mt],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 ECe(n,o){n&1&&(s(0,"th",15),d(1,"Name"),l())}function DCe(n,o){if(n&1&&(s(0,"td",16),d(1),l()),n&2){let e=o.$implicit;m(),B(e.name)}}function PCe(n,o){n&1&&(s(0,"th",15),d(1,"Local port"),l())}function ICe(n,o){if(n&1&&(s(0,"td",16),d(1),l()),n&2){let e=o.$implicit;m(),B(e.lport)}}function ACe(n,o){n&1&&(s(0,"th",15),d(1,"Remote host"),l())}function OCe(n,o){if(n&1&&(s(0,"td",16),d(1),l()),n&2){let e=o.$implicit;m(),B(e.rhost)}}function NCe(n,o){n&1&&(s(0,"th",15),d(1,"Remote port"),l())}function FCe(n,o){if(n&1&&(s(0,"td",16),d(1),l()),n&2){let e=o.$implicit;m(),B(e.rport)}}function RCe(n,o){n&1&&(s(0,"th",15),d(1,"Actions"),l())}function LCe(n,o){if(n&1){let e=z();s(0,"td",16)(1,"button",17),_("click",function(){let i=k(e).$implicit,r=v();return T(r.delete(i))}),s(2,"mat-icon",18),d(3,"delete"),l()()()}}function VCe(n,o){n&1&&R(0,"tr",19)}function BCe(n,o){n&1&&R(0,"tr",20)}var vw=(()=>{class n{dataSourceUdp=[];displayedColumns=["name","lport","rhost","rport","action"];newPortName=U("");newPortLport=U(0);newPortRhost=U("");newPortRport=U(0);portTypes=Q([]);etherTypes=Q([]);builtInTemplatesConfigurationService=f(ka);toasterService=f(ie);validationService=f(Wi);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,i){t&1&&(s(0,"div",0)(1,"mat-form-field")(2,"mat-label"),d(3,"Name"),l(),s(4,"input",1),_("input",function(a){return i.newPortName.set(a.target.value)}),l()(),s(5,"mat-form-field")(6,"mat-label"),d(7,"Remote host"),l(),s(8,"input",1),_("input",function(a){return i.newPortRhost.set(a.target.value)}),l()(),s(9,"mat-form-field")(10,"mat-label"),d(11,"Local port"),l(),s(12,"input",2),_("input",function(a){return i.newPortLport.set(+a.target.value)}),l()(),s(13,"mat-form-field")(14,"mat-label"),d(15,"Remote port"),l(),s(16,"input",2),_("input",function(a){return i.newPortRport.set(+a.target.value)}),l()()(),s(17,"div",3)(18,"button",4),_("click",function(){return i.onAddUdpInterface()}),d(19,"Add"),l()(),s(20,"table",5),Fe(21,6),Ce(22,ECe,2,0,"th",7)(23,DCe,2,1,"td",8),Re(),Fe(24,9),Ce(25,PCe,2,0,"th",7)(26,ICe,2,1,"td",8),Re(),Fe(27,10),Ce(28,ACe,2,0,"th",7)(29,OCe,2,1,"td",8),Re(),Fe(30,11),Ce(31,NCe,2,0,"th",7)(32,FCe,2,1,"td",8),Re(),Fe(33,12),Ce(34,RCe,2,0,"th",7)(35,LCe,4,0,"td",8),Re(),Ce(36,VCe,1,0,"tr",13)(37,BCe,1,0,"tr",14),l()),t&2&&(m(4),C("value",i.newPortName()),m(4),C("value",i.newPortRhost()),m(4),C("value",i.newPortLport()),m(4),C("value",i.newPortRport()),m(4),C("dataSource",i.dataSourceUdp),m(16),C("matHeaderRowDef",i.displayedColumns),m(),C("matRowDefColumns",i.displayedColumns))},dependencies:[ne,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,we,Me,Xe,Se,Te,G,pe,ze,oe,de,ht,Mt],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})();function zCe(n){return(n??"").split("%")[0]}function jCe(n){let o=parseInt(n,10);return Number.isNaN(o)?0:(o>>>0).toString(2).split("").filter(e=>e==="1").length}function $Ce(n){let o=n.split(".");return o.length!==4?0:o.reduce((e,t)=>e+jCe(t),0)}function HCe(n){if(!n.includes("::"))return n.split(":");let[o="",e=""]=n.split("::"),t=o?o.split(":"):[],i=e?e.split(":"):[],r=8-t.length-i.length,a=r>0?Array(r).fill("0"):[];return[...t,...a,...i]}function UCe(n){return HCe(n).reduce((o,e)=>{let t=parseInt(e||"0",16);return Number.isNaN(t)?o:o+t.toString(2).split("").filter(i=>i==="1").length},0)}function WCe(n,o){return n?o==="ipv6"||n.includes(":")?UCe(n):$Ce(n):0}function Uv(n){return`${zCe(n.address)}/${WCe(n.netmask,n.family)}`}function Cw(n){return!n||n.length===0?"":n.map(Uv).join(", ")}function GCe(n){if(!n||n<=0)return"\u2014";if(n>=1e3){let o=n/1e3;return`${o.toFixed(o%1===0?0:1)} Gbit/s`}return`${n} Mbit/s`}function xw(n){if(!n)return"";let o=[];return n.speed&&n.speed>0&&o.push(GCe(n.speed)),n.mtu&&o.push(`MTU ${n.mtu}`),o.join(" \xB7 ")}function bw(n){return n&&n.length>0?`Flags: ${n.join(", ")}`:""}var qCe=["udpTunnels"],QCe=()=>[],XCe=(n,o)=>o.name,S9=(n,o)=>o.address;function KCe(n,o){if(n&1&&(s(0,"span",41),d(1),l()),n&2){let e=o.$implicit,t=v(3);m(),B(t.formatIpAddress(e))}}function YCe(n,o){if(n&1&&(s(0,"mat-option",14)(1,"div",37)(2,"div",38),R(3,"span",39),s(4,"span",40),d(5),l()(),K(6,KCe,2,1,"span",41,S9),l()()),n&2){let e=o.$implicit;C("value",e.name),m(3),Ae("cloud-iface-status--up",e.status==="up")("cloud-iface-status--down",e.status!=="up"),m(2),B(e.name),m(),Y(e.ip_addresses||Tt(6,QCe))}}function ZCe(n,o){n&1&&(s(0,"th",42),d(1,"Interface"),l())}function JCe(n,o){n&1&&(s(0,"span",46),d(1),l()),n&2&&(m(),B(o))}function e1e(n,o){if(n&1&&(s(0,"div",44)(1,"span",45),R(2,"span",39),d(3),l(),I(4,JCe,2,1,"span",46),l()),n&2){let e,t=o,i=v().$implicit,r=v(2);m(),C("matTooltip",r.formatFlags(t.flags)||null),m(),Ae("cloud-iface-status--up",t.status==="up")("cloud-iface-status--down",t.status!=="up"),m(),ee(" ",i.name," "),m(),A((e=r.formatInterfaceMeta(t))?4:-1,e)}}function t1e(n,o){if(n&1&&d(0),n&2){let e=v().$implicit;ee(" ",e.name," ")}}function n1e(n,o){if(n&1&&(s(0,"td",43),I(1,e1e,5,7,"div",44)(2,t1e,1,1),l()),n&2){let e,t=o.$implicit,i=v(2);m(),A((e=i.getHostInterface(t.interface||t.name))?1:2,e)}}function i1e(n,o){n&1&&(s(0,"th",42),d(1,"IP addresses"),l())}function o1e(n,o){if(n&1&&(s(0,"div",47),d(1),l()),n&2){let e=o.$implicit,t=v(3);m(),B(t.formatIpAddress(e))}}function r1e(n,o){n&1&&d(0," \u2014 ")}function a1e(n,o){if(n&1&&(s(0,"td",43),K(1,o1e,2,1,"div",47,S9,!1,r1e,1,0),l()),n&2){let e=o.$implicit,t=v(2);m(),Y(t.getHostInterfaceIps(e.interface||e.name))}}function s1e(n,o){n&1&&(s(0,"th",42),d(1,"Actions"),l())}function l1e(n,o){if(n&1){let e=z();s(0,"td",43)(1,"button",48),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.onDeleteEthernetInterface(i))}),s(2,"mat-icon",49),d(3,"delete"),l()()()}}function c1e(n,o){n&1&&R(0,"tr",50)}function d1e(n,o){n&1&&R(0,"tr",51)}function m1e(n,o){n&1&&(s(0,"th",42),d(1,"Interface"),l())}function p1e(n,o){if(n&1&&(s(0,"td",43),d(1),l()),n&2){let e=o.$implicit;m(),B(e.name)}}function u1e(n,o){n&1&&(s(0,"th",42),d(1,"Actions"),l())}function h1e(n,o){if(n&1){let e=z();s(0,"td",43)(1,"button",48),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.onDeleteTapInterface(i))}),s(2,"mat-icon",49),d(3,"delete"),l()()()}}function f1e(n,o){n&1&&R(0,"tr",50)}function g1e(n,o){n&1&&R(0,"tr",51)}function _1e(n,o){if(n&1){let e=z();s(0,"mat-chip",52),_("removed",function(){let i=k(e).$implicit,r=v(2);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",53),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function v1e(n,o){if(n&1&&(s(0,"mat-option",14),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function C1e(n,o){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),_("selectionChange",function(i){k(e);let r=v();return T(r.ethernetInterface.set(i.value))}),s(8,"mat-select-trigger"),d(9),l(),K(10,YCe,8,7,"mat-option",14,XCe),l()(),s(12,"button",15),_("click",function(){k(e);let i=v();return T(i.onAddEthernetInterface())}),d(13,"Add"),l()(),s(14,"table",16),Fe(15,17),Ce(16,ZCe,2,0,"th",18)(17,n1e,3,1,"td",19),Re(),Fe(18,20),Ce(19,i1e,2,0,"th",18)(20,a1e,4,1,"td",19),Re(),Fe(21,21),Ce(22,s1e,2,0,"th",18)(23,l1e,4,0,"td",19),Re(),Ce(24,c1e,1,0,"tr",22)(25,d1e,1,0,"tr",23),l()()(),s(26,"mat-tab",24)(27,"div",11)(28,"div",12)(29,"mat-form-field")(30,"input",25),_("input",function(i){k(e);let r=v();return T(r.tapInterface.set(i.target.value))}),l()(),s(31,"button",15),_("click",function(){k(e);let i=v();return T(i.onAddTapInterface())}),d(32,"Add"),l()(),s(33,"table",16),Fe(34,17),Ce(35,m1e,2,0,"th",18)(36,p1e,2,1,"td",19),Re(),Fe(37,21),Ce(38,u1e,2,0,"th",18)(39,h1e,4,0,"td",19),Re(),Ce(40,f1e,1,0,"tr",22)(41,g1e,1,0,"tr",23),l()()(),s(42,"mat-tab",26),R(43,"app-udp-tunnels",27,0),l(),s(45,"mat-tab",28)(46,"div",29)(47,"mat-form-field",30)(48,"mat-label"),d(49,"Name"),l(),s(50,"input",31),_("input",function(i){k(e);let r=v();return T(r.nodeName.set(i.target.value))}),l()(),s(51,"mat-form-field",32)(52,"mat-label"),d(53,"Tags"),l(),s(54,"mat-chip-grid",null,1),K(56,_1e,4,1,"mat-chip",null,Oe),l(),s(58,"input",33),_("matChipInputTokenEnd",function(i){k(e);let r=v();return T(r.addTag(i))}),l()(),s(59,"mat-form-field",30)(60,"mat-label"),d(61,"Console type"),l(),s(62,"mat-select",34),_("valueChange",function(i){k(e);let r=v();return T(r.consoleType.set(i))}),K(63,v1e,2,2,"mat-option",14,Oe),l()(),s(65,"mat-form-field",30)(66,"mat-label"),d(67,"Console host"),l(),s(68,"input",31),_("input",function(i){k(e);let r=v();return T(r.remoteConsoleHost.set(i.target.value))}),l()(),s(69,"mat-form-field",30)(70,"mat-label"),d(71,"Console port"),l(),s(72,"input",31),_("input",function(i){k(e);let r=v();return T(r.remoteConsolePort.set(i.target.value))}),l()(),s(73,"mat-form-field",30)(74,"mat-label"),d(75,"Console HTTP path"),l(),s(76,"input",31),_("input",function(i){k(e);let r=v();return T(r.remoteConsoleHttpPath.set(i.target.value))}),l()()()(),s(77,"mat-tab",35)(78,"div",29)(79,"mat-form-field",30)(80,"mat-label"),d(81,"Usage"),l(),s(82,"textarea",36),_("input",function(i){k(e);let r=v();return T(r.usage.set(i.target.value))}),l()()()()()}if(n&2){let e=ke(55),t=v();m(7),C("value",t.ethernetInterface()),m(2),B(t.ethernetInterface()),m(),Y(t.availableEthernetInterfaces()),m(4),C("dataSource",t.portsMappingEthernet()),m(10),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),Y(t.node==null?null:t.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.consoleType()),m(),Y(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 yw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(ie);builtInTemplatesConfigurationService=f(ka);cd=f(X);validationService=f(R0);controller;node;name;separatorKeysCodes=[13,188];consoleTypes=[];onCloseOptions=[];bootPriorities=[];diskInterfaces=[];portsMappingEthernet=Q([]);portsMappingTap=Q([]);portsMappingUdp=Q([]);ethernetDisplayColumns=["name","ipAddresses","actions"];tapDisplayColumns=["name","actions"];displayedColumns=["adapter_number","port_name","adapter_type","actions"];networkTypes=[];tapInterface=U("");ethernetInterface=U("");availableEthernetInterfaces=Q([]);nodeName=U("");consoleType=U("none");remoteConsoleHost=U("");remoteConsolePort=U("");remoteConsoleHttpPath=U("");usage=U("");udpTunnels=Rt("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.set(this.node.properties.interfaces.filter(t=>t.type==="ethernet")),this.portsMappingEthernet.set(this.node.properties.ports_mapping.filter(t=>t.type==="ethernet")),this.portsMappingTap.set(this.node.properties.ports_mapping.filter(t=>t.type==="tap")),this.portsMappingUdp.set(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()}formatIpAddresses=Cw;formatIpAddress=Uv;formatInterfaceMeta=xw;formatFlags=bw;getHostInterface(e){return this.node?.properties?.interfaces?.find(t=>t.name===e)}getHostInterfaceIps(e){return this.getHostInterface(e)?.ip_addresses??[]}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),i=this.validationService.validateUniqueInterface(this.ethernetInterface(),t);if(!i.isValid){this.toasterService.error(i.errorMessage||`Interface ${this.ethernetInterface()} already configured.`);return}this.portsMappingEthernet.update(r=>[...r,{interface:this.ethernetInterface(),name:this.ethernetInterface(),port_number:0,type:"ethernet"}]),this.ethernetInterface.set("")}}onDeleteEthernetInterface(e){this.portsMappingEthernet.update(t=>t.filter(i=>i!==e))}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),i=this.validationService.validateUniqueInterface(this.tapInterface(),t);if(!i.isValid){this.toasterService.error(i.errorMessage||`Interface ${this.tapInterface()} already configured.`);return}this.portsMappingTap.update(r=>[...r,{interface:this.tapInterface(),name:this.tapInterface(),port_number:0,type:"tap"}]),this.tapInterface.set("")}}onDeleteTapInterface(e){this.portsMappingTap.update(t=>t.filter(i=>i!==e))}onSaveClick(){let e=this.validationService.validateName(this.nodeName());if(!e.isValid){this.toasterService.error(e.errorMessage||"Name is required");return}if(this.remoteConsolePort()){let i=this.validationService.validateRemoteConsolePort(this.remoteConsolePort());if(!i.isValid){this.toasterService.error(i.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 i=this.validationService.validateRemoteConsoleHost(this.remoteConsoleHost());if(!i.isValid){this.toasterService.error(i.errorMessage||"Invalid remote console host");return}}if(this.remoteConsoleHttpPath()){let i=this.validationService.validateRemoteConsoleHttpPath(this.remoteConsoleHttpPath());if(!i.isValid){this.toasterService.error(i.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.set(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:i=>{let r=i?.error?.message||i?.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,i){t&1&&Xt(i.udpTunnels,qCe,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"],["panelClass","cloud-ethernet-select-panel",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","ipAddresses"],["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"],[1,"cloud-iface-option"],[1,"cloud-iface-option__head"],[1,"cloud-iface-status"],[1,"cloud-iface-option__name"],[1,"cloud-iface-option__ip"],["mat-header-cell",""],["mat-cell",""],[1,"cloud-iface-cell"],[3,"matTooltip"],[1,"cloud-iface-meta"],[1,"cloud-ip-line"],["mat-icon-button","","matTooltip","Delete interface",3,"click"],["aria-label","Delete interface"],["mat-header-row",""],["mat-row",""],[3,"removed"],["matChipRemove",""]],template:function(t,i){t&1&&(s(0,"h1",2),d(1),l(),s(2,"div",3)(3,"div",4)(4,"div",5)(5,"mat-card",6),I(6,C1e,83,18,"mat-tab-group"),l(),R(7,"div"),l()(),s(8,"div",7)(9,"button",8),_("click",function(){return i.onCancelClick()}),d(10,"Cancel"),l(),s(11,"button",9),_("click",function(){return i.onSaveClick()}),d(12,"Apply"),l()()()),t&2&&(m(),ee("Configurator for cloud node ",i.name),m(5),A(i.name?6:-1))},dependencies:[ne,Je,ve,Le,Ve,kt,On,ho,Wo,Go,we,Me,Xe,Se,Te,gt,Pt,e5,ft,G,pe,ze,oi,ei,Ci,xi,hi,oe,de,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,ht,Mt,vw],encapsulation:2,changeDetection:0})}return n})();function x1e(n,o){if(n&1){let e=z();s(0,"div",1)(1,"textarea",5),_("input",function(i){k(e);let r=v();return T(r.configuration.set(i.target.value))}),l()()}if(n&2){let e=v();m(),C("value",e.configuration())}}var Sw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(ie);cdr=f(X);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,i){t&1&&(s(0,"h1",0),d(1),l(),I(2,x1e,2,1,"div",1),s(3,"div",2)(4,"button",3),_("click",function(){return i.onCancelClick()}),d(5,"Cancel"),l(),s(6,"button",4),_("click",function(){return i.onSaveClick()}),d(7,"Apply"),l()()),t&2&&(m(),ee("Edit network configuration for node ",i.node.name),m(),A(i.node?2:-1))},dependencies:[ne,ve,Le,Ve,Se,Te,G,pe],styles:[".textArea[_ngcontent-%COMP%]{width:100%;height:350px}"],changeDetection:0})}return n})();function b1e(n,o){if(n&1){let e=z();s(0,"mat-chip",32),_("removed",function(){let i=k(e).$implicit,r=v(2);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",33),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function y1e(n,o){if(n&1&&(s(0,"mat-option",19),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function S1e(n,o){if(n&1&&(s(0,"mat-option",19),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function w1e(n,o){if(n&1&&(s(0,"mat-option",19),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function M1e(n,o){if(n&1){let e=z();s(0,"mat-form-field",11)(1,"mat-label"),d(2,"Container target path"),l(),s(3,"input",34),_("input",function(i){let r=k(e).$index,a=v(2);return T(a.updateExtraConfigTarget(r,i.target.value))}),l(),s(4,"button",35),_("click",function(){let i=k(e).$index,r=v(2);return T(r.removeExtraConfig(i))}),s(5,"mat-icon"),d(6,"delete"),l()()(),s(7,"mat-form-field",11)(8,"mat-label"),d(9,"File content"),l(),s(10,"textarea",36),_("input",function(i){let r=k(e).$index,a=v(2);return T(a.updateExtraConfigContent(r,i.target.value))}),l()()}if(n&2){let e=o.$implicit;m(3),C("value",e.target),m(7),C("value",e.content||"")}}function k1e(n,o){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),_("input",function(i){k(e);let r=v();return T(r.nodeName.set(i.target.value))}),l()(),s(7,"mat-form-field",13)(8,"mat-label"),d(9,"Tags"),l(),s(10,"mat-chip-grid",null,0),K(12,b1e,4,1,"mat-chip",null,Oe),l(),s(14,"input",14),_("matChipInputTokenEnd",function(i){k(e);let r=v();return T(r.addTag(i))}),l()(),s(15,"mat-form-field",11)(16,"mat-label"),d(17,"Image"),l(),s(18,"input",12),_("input",function(i){k(e);let r=v();return T(r.dockerImage.set(i.target.value))}),l()(),s(19,"div",15)(20,"mat-form-field",11)(21,"mat-label"),d(22,"Adapters"),l(),s(23,"input",12),_("input",function(i){k(e);let r=v();return T(r.adapter.set(i.target.value))}),l()(),s(24,"mat-form-field",11)(25,"mat-label"),d(26,"Base MAC"),l(),s(27,"input",12),_("input",function(i){k(e);let r=v();return T(r.macAddress.set(i.target.value))}),l()(),s(28,"mat-form-field",11)(29,"mat-label"),d(30,"Maximum memory"),l(),s(31,"input",16),_("input",function(i){k(e);let r=v();return T(r.memory.set(i.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),_("input",function(i){k(e);let r=v();return T(r.cpus.set(i.target.value))}),l()(),s(38,"mat-form-field",11)(39,"mat-label"),d(40,"Console type"),l(),s(41,"mat-select",18),_("valueChange",function(i){k(e);let r=v();return T(r.consoleType.set(i))}),K(42,y1e,2,2,"mat-option",19,Oe),l()(),s(44,"mat-form-field",11)(45,"mat-label"),d(46,"Auxiliary console type"),l(),s(47,"mat-select",18),_("valueChange",function(i){k(e);let r=v();return T(r.auxType.set(i))}),K(48,S1e,2,2,"mat-option",19,Oe),l()(),s(50,"mat-form-field",11)(51,"mat-label"),d(52,"VNC console resolution"),l(),s(53,"mat-select",18),_("valueChange",function(i){k(e);let r=v();return T(r.consoleResolution.set(i))}),K(54,w1e,2,2,"mat-option",19,Oe),l()(),s(56,"mat-form-field",11)(57,"mat-label"),d(58,"HTTP port in the container"),l(),s(59,"input",12),_("input",function(i){k(e);let r=v();return T(r.consoleHttpPort.set(i.target.value))}),l()(),s(60,"mat-form-field",20)(61,"mat-label"),d(62,"HTTP path"),l(),s(63,"input",12),_("input",function(i){k(e);let r=v();return T(r.consoleHttpPath.set(i.target.value))}),l()(),s(64,"mat-checkbox",21),_("change",function(i){k(e);let r=v();return T(r.consoleAutoStart.set(i.checked))}),d(65," Auto start console "),l()(),s(66,"div",15)(67,"button",22),_("click",function(){k(e);let i=v();return T(i.configureCustomAdapters())}),d(68," Configure custom adapters "),l(),s(69,"button",22),_("click",function(){k(e);let i=v();return T(i.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),_("input",function(i){k(e);let r=v();return T(r.startCommand.set(i.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),_("input",function(i){k(e);let r=v();return T(r.environment.set(i.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),_("input",function(i){k(e);let r=v();return T(r.extraHosts.set(i.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),_("input",function(i){k(e);let r=v();return T(r.extraVolumes.set(i.target.value))}),l()()()(),s(97,"mat-tab",28)(98,"div",10)(99,"h6"),d(100,"Configuration files"),l(),K(101,M1e,11,2,null,null,Ni),s(103,"button",29),_("click",function(){k(e);let i=v();return T(i.addExtraConfig())}),s(104,"mat-icon"),d(105,"add"),l(),d(106," Add configuration file "),l()()(),s(107,"mat-tab",30)(108,"div",10)(109,"mat-form-field",11)(110,"mat-label"),d(111,"Usage"),l(),s(112,"textarea",31),_("input",function(i){k(e);let r=v();return T(r.usage.set(i.target.value))}),l()()()()()}if(n&2){let e=ke(11),t=v();m(6),C("value",t.nodeName()),m(6),Y(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(),Y(t.consoleTypes),m(5),C("value",t.auxType()),m(),Y(t.auxConsoleTypes),m(5),C("value",t.consoleResolution()),m(),Y(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(5),Y(t.extraConfigs()),m(11),C("value",t.usage())}}var ww=(()=>{class n{dialogReference=f(Ie);nodeService=f(ut);toasterService=f(ie);dockerConfigurationService=f($c);dialog=f(it);cd=f(X);validationService=f(L0);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("");extraConfigs=Q([]);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.extraConfigs.set((e.properties.extra_configs||[]).map(i=>({target:i.target||"",content:i.content??""}))),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 i=parseInt(this.adapter(),10)||1;e=Array.from({length:i},(r,a)=>({adapter_number:a,mac_address:""}))}this.dialogRef=this.dialog.open(sf,this.conf);let t=this.dialogRef.componentInstance;t.controller=this.controller,t.adapters.set(e),t.saveHandler=i=>{this.node.custom_adapters=i.map(r=>Ye(Z({},r),{mac_address:r.mac_address||null})),this.adapter.set(i.length.toString())}}editNetworkConfiguration(){this.dialogRef=this.dialog.open(Sw,this.conf);let e=this.dialogRef.componentInstance;e.controller=this.controller,e.node=this.node}addExtraConfig(){this.extraConfigs.update(e=>[...e,{target:"",content:""}])}removeExtraConfig(e){this.extraConfigs.update(t=>t.filter((i,r)=>r!==e))}updateExtraConfigTarget(e,t){this.extraConfigs.update(i=>i.map((r,a)=>a===e?Ye(Z({},r),{target:t}):r))}updateExtraConfigContent(e,t){this.extraConfigs.update(i=>i.map((r,a)=>a===e?Ye(Z({},r),{content:t}):r))}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 i=this.validationService.validateMacAddress(this.macAddress());if(!i.isValid){this.toasterService.error(i.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}let u=this.validationService.validateExtraConfigs(this.extraConfigs());if(!u.isValid){this.toasterService.error(u.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(g=>g.trim()):[];let h=this.extraConfigs().filter(g=>(g.target||"").trim()).map(g=>({target:g.target.trim(),content:g.content??""}));this.node.properties.extra_configs=h,this.extraConfigs.set(h),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:g=>{let y=g?.error?.message||g?.message||"Failed to update node";this.toasterService.error(y),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","","rows","1","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","12","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","","rows","1","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","12","placeholder","Environment variables (one per line, KEY=VALUE format). Supports: %vm-name%, %vm-id%, %project-id%, %project-path%",3,"input","value"],["matInput","","rows","1","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","12","placeholder","Hostname to IP mappings, one per line (e.g., gns3.com:192.168.100.10)",3,"input","value"],["matInput","","rows","1","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","12","placeholder",`Container directories to persist, one per line (e.g., /data
|
||
/config)`,3,"input","value"],["label","Extra files"],["mat-stroked-button","","type","button",1,"form-field",3,"click"],["label","Usage"],["matInput","",3,"input","value"],[3,"removed"],["matChipRemove",""],["matInput","","type","text","placeholder","/first_boot.cfg",3,"input","value"],["matSuffix","","mat-icon-button","","type","button","aria-label","Remove configuration file",3,"click"],["matInput","","rows","1","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","12","placeholder","File contents injected (read-only) into the container at the target path",3,"input","value"]],template:function(t,i){t&1&&(s(0,"h1",1),d(1),l(),s(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-card",5),I(6,k1e,113,19,"mat-tab-group"),l()()()(),s(7,"div",6)(8,"button",7),_("click",function(){return i.onCancelClick()}),d(9,"Cancel"),l(),s(10,"button",8),_("click",function(){return i.onSaveClick()}),d(11,"Apply"),l()()),t&2&&(m(),ee("Configurator for node ",i.name),m(5),A(i.name?6:-1))},dependencies:[ne,Je,ve,Le,Ve,kt,On,ho,Wo,Go,we,Me,Xe,Ti,Se,Te,Bc,gt,Pt,ft,G,pe,ze,oi,ei,Ci,xi,hi,oe,de,Lt,qt],encapsulation:2,changeDetection:0})}return n})();function T1e(n,o){if(n&1){let e=z();s(0,"mat-chip",18),_("removed",function(){let i=k(e).$implicit,r=v(2);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",19),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function E1e(n,o){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function D1e(n,o){if(n&1&&R(0,"app-ports",17,1),n&2){let e=v(2);C("ethernetPorts",e.node.properties.ports_mapping)}}function P1e(n,o){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),_("input",function(i){k(e);let r=v();return T(r.nodeName.set(i.target.value))}),l()(),s(7,"mat-form-field",13)(8,"mat-label"),d(9,"Tags"),l(),s(10,"mat-chip-grid",null,0),K(12,T1e,4,1,"mat-chip",null,Oe),l(),s(14,"input",14),_("matChipInputTokenEnd",function(i){k(e);let r=v();return T(r.addTag(i))}),l()(),s(15,"mat-form-field",11)(16,"mat-label"),d(17,"Console type"),l(),s(18,"mat-select",15),_("valueChange",function(i){k(e);let r=v();return T(r.consoleType.set(i))}),K(19,E1e,2,2,"mat-option",16,Oe),l()()(),I(21,D1e,2,1,"app-ports",17),l()()}if(n&2){let e=ke(11),t=v();m(6),C("value",t.nodeName()),m(6),Y(t.node==null?null:t.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.consoleType()),m(),Y(t.consoleTypes),m(2),A(t.node.properties?21:-1)}}var Mw=(()=>{class n{portsComponent=Rt(Ad);dialogRef=f(Ie);nodeService=f(ut);toasterService=f(ie);ethernetSwitchesConfigurationService=f(ka);cd=f(X);validationService=f(Wi);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 i=t?.error?.message||t?.message||"Failed to update node";this.toasterService.error(i),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,i){t&1&&Xt(i.portsComponent,Ad,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,i){t&1&&(s(0,"h1",2),d(1),l(),s(2,"div",3)(3,"div",4),I(4,P1e,22,5,"div",5),l()(),s(5,"div",6)(6,"button",7),_("click",function(){return i.onCancelClick()}),d(7,"Cancel"),l(),s(8,"button",8),_("click",function(){return i.onSaveClick()}),d(9,"Apply"),l()()),t&2&&(m(),ee("Configurator for Ethernet switch ",i.name),m(3),A(i.node?4:-1))},dependencies:[ne,Je,ve,Le,Ve,kt,On,we,Me,Xe,Se,Te,gt,Pt,ft,G,pe,oi,ei,Ci,xi,hi,oe,de,Ad],encapsulation:2,changeDetection:0})}return n})();function I1e(n,o){if(n&1){let e=z();s(0,"mat-chip",14),_("removed",function(){let i=k(e).$implicit,r=v();return T(r.removeTag(i))}),d(1),s(2,"mat-icon",15),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}var kw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(ie);vpcsConfigurationService=f(Hm);cd=f(X);validationService=f(Wi);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 i=parseInt(t,10);if(isNaN(i)||i<0||i!==parseFloat(t)){this.toasterService.error("Number of ports must be a non-negative integer");return}this.numberOfPorts=i}else this.numberOfPorts=0;this.node.name=this.nodeName(),this.node.properties.ports_mapping=[];for(let i=0;i<this.numberOfPorts;i++)this.node.properties.ports_mapping.push({name:`Ethernet${i}`,port_number:i});this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:i=>{let r=i?.error?.message||i?.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,i){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),_("input",function(a){return i.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),K(16,I1e,4,1,"mat-chip",null,Oe),l(),s(18,"input",10),_("matChipInputTokenEnd",function(a){return i.addTag(a)}),l()(),s(19,"mat-form-field",7)(20,"mat-label"),d(21,"Number of ports"),l(),s(22,"input",8),_("input",function(a){return i.nodeNumberOfPorts.set(a.target.value)}),l()()()()()()(),s(23,"div",11)(24,"button",12),_("click",function(){return i.onCancelClick()}),d(25,"Cancel"),l(),s(26,"button",13),_("click",function(){return i.onSaveClick()}),d(27,"Apply"),l()()),t&2){let r=ke(15);m(),ee("Configurator for Ethernet hub ",i.name),m(9),C("value",i.nodeName()),m(6),Y(i.node==null?null:i.node.tags),m(2),C("matChipInputFor",r)("matChipInputSeparatorKeyCodes",i.separatorKeysCodes),m(4),C("value",i.nodeNumberOfPorts())}},dependencies:[ne,Je,ve,Le,Ve,kt,On,we,Me,Xe,Se,Te,G,pe,oi,ei,Ci,xi,hi,oe,de],encapsulation:2,changeDetection:0})}return n})();var A1e=()=>["c1700","c2600","c2691","c3600","c3725","c3745"],O1e=()=>[0,1,2,3,4,5,6],N1e=()=>[0,1,2];function F1e(n,o){if(n&1&&(s(0,"mat-label"),d(1),l()),n&2){let e=v(2);m(),ee(" (chassis: ",e.node.properties.chassis,")")}}function R1e(n,o){if(n&1){let e=z();s(0,"mat-chip",35),_("removed",function(){let i=k(e).$implicit,r=v(2);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",36),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function L1e(n,o){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function V1e(n,o){if(n&1){let e=z();s(0,"mat-form-field",11)(1,"mat-label"),d(2,"Midplane"),l(),s(3,"mat-select",16),_("valueChange",function(i){k(e);let r=v(2);return T(r.midplane.set(i))}),K(4,L1e,2,2,"mat-option",17,Oe),l()()}if(n&2){let e=v(2);m(3),C("value",e.midplane()),m(),Y(e.MidplaneTypes)}}function B1e(n,o){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function z1e(n,o){if(n&1){let e=z();s(0,"mat-form-field",11)(1,"mat-label"),d(2,"NPE"),l(),s(3,"mat-select",16),_("valueChange",function(i){k(e);let r=v(2);return T(r.npe.set(i))}),K(4,B1e,2,2,"mat-option",17,Oe),l()()}if(n&2){let e=v(2);m(3),C("value",e.npe()),m(),Y(e.NPETypes)}}function j1e(n,o){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function $1e(n,o){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function H1e(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.iomem.set(i.target.value))}),l(),s(4,"span",25),d(5,"%"),l()()}if(n&2){let e=v(2);m(3),C("value",e.iomem())}}function U1e(n,o){n&1&&(s(0,"mat-option",17),d(1),l()),n&2&&(m(),ee(" ",""," "))}function W1e(n,o){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function G1e(n,o){if(n&1){let e=z();s(0,"mat-form-field",11)(1,"mat-label"),d(2),l(),s(3,"mat-select",16),_("valueChange",function(i){k(e);let r=v().$implicit,a=v(2);return T(a.setSlotValue(r,i))}),I(4,U1e,2,1,"mat-option",17),K(5,W1e,2,2,"mat-option",17,Oe),l()()}if(n&2){let e=v().$implicit,t=v(2);m(2),ee("Slot ",e),m(),C("value",t.getSlotValue(e)),m(),A(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(),Y(t.adapterMatrix[t.node.properties.platform][t.node.properties.chassis||""][e])}}function q1e(n,o){if(n&1&&I(0,G1e,7,3,"mat-form-field",11),n&2){let e=o.$implicit,t=v(2);A(t.adapterMatrix[t.node.properties.platform][t.node.properties.chassis||""][e]?0:-1)}}function Q1e(n,o){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function X1e(n,o){if(n&1){let e=z();s(0,"mat-form-field",11)(1,"mat-label"),d(2),l(),s(3,"mat-select",16),_("valueChange",function(i){k(e);let r=v().$implicit,a=v(3);return T(a.setWicValue(r,i))}),s(4,"mat-option",17),d(5),l(),K(6,Q1e,2,2,"mat-option",17,Oe),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(),Y(t.wicMatrix[t.node.properties.platform][e])}}function K1e(n,o){if(n&1&&I(0,X1e,8,3,"mat-form-field",11),n&2){let e=o.$implicit,t=v(3);A(t.wicMatrix[t.node.properties.platform][e]?0:-1)}}function Y1e(n,o){n&1&&(s(0,"div",29)(1,"h6",30),d(2,"WICs"),l(),s(3,"div",31),K(4,K1e,1,1,null,null,Oe),l()()),n&2&&(m(4),Y(Tt(0,N1e)))}function Z1e(n,o){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(),I(5,F1e,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),_("input",function(i){k(e);let r=v();return T(r.nodeName.set(i.target.value))}),l()(),s(13,"mat-form-field",13)(14,"mat-label"),d(15,"Tags"),l(),s(16,"mat-chip-grid",null,0),K(18,R1e,4,1,"mat-chip",null,Oe),l(),s(20,"input",14),_("matChipInputTokenEnd",function(i){k(e);let r=v();return T(r.addTag(i))}),l()(),s(21,"mat-form-field",11)(22,"mat-label"),d(23,"IOS image path"),l(),s(24,"input",12),_("input",function(i){k(e);let r=v();return T(r.imagePath.set(i.target.value))}),l()(),s(25,"div",15),I(26,V1e,6,1,"mat-form-field",11),I(27,z1e,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),_("valueChange",function(i){k(e);let r=v();return T(r.consoleType.set(i))}),K(32,j1e,2,2,"mat-option",17,Oe),l()(),s(34,"mat-form-field",11)(35,"mat-label"),d(36,"Auxiliary console type"),l(),s(37,"mat-select",16),_("valueChange",function(i){k(e);let r=v();return T(r.auxType.set(i))}),K(38,$1e,2,2,"mat-option",17,Oe),l()(),s(40,"mat-checkbox",18),_("change",function(i){k(e);let r=v();return T(r.consoleAutoStart.set(i.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),_("input",function(i){k(e);let r=v();return T(r.ram.set(i.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),_("input",function(i){k(e);let r=v();return T(r.nvram.set(i.target.value))}),l(),s(60,"span",25),d(61,"MiB"),l()(),I(62,H1e,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),_("input",function(i){k(e);let r=v();return T(r.disk0.set(i.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),_("input",function(i){k(e);let r=v();return T(r.disk1.set(i.target.value))}),l(),s(79,"span",25),d(80,"MiB"),l()(),s(81,"mat-checkbox",26),_("change",function(i){k(e);let r=v();return T(r.autoDeleteDisks.set(i.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),K(90,q1e,1,1,null,null,Oe),l()(),I(92,Y1e,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),_("input",function(i){k(e);let r=v();return T(r.systemId.set(i.target.value))}),l()(),s(105,"mat-form-field",11)(106,"mat-label"),d(107,"Base MAC"),l(),s(108,"input",12),_("input",function(i){k(e);let r=v();return T(r.baseMac.set(i.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),_("input",function(i){k(e);let r=v();return T(r.idlepc.set(i.target.value))}),l()(),s(118,"mat-form-field",11)(119,"mat-label"),d(120,"Idlemax"),l(),s(121,"input",12),_("input",function(i){k(e);let r=v();return T(r.idlemax.set(i.target.value))}),l()(),s(122,"mat-form-field",11)(123,"mat-label"),d(124,"Idlesleep"),l(),s(125,"input",12),_("input",function(i){k(e);let r=v();return T(r.idlesleep.set(i.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),_("input",function(i){k(e);let r=v();return T(r.execArea.set(i.target.value))}),l(),s(132,"span",25),d(133,"MiB"),l()(),s(134,"mat-checkbox",26),_("change",function(i){k(e);let r=v();return T(r.mmap.set(i.checked))}),d(135," Enable mmap support "),l(),s(136,"mat-checkbox",26),_("change",function(i){k(e);let r=v();return T(r.sparsemem.set(i.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),_("input",function(i){k(e);let r=v();return T(r.usage.set(i.target.value))}),l()()()()()}if(n&2){let e=ke(17),t=v();m(4),ee("Platform: ",t.node.properties.platform),m(),A(t.node.properties.chassis?5:-1),m(7),C("value",t.nodeName()),m(6),Y(t.node==null?null:t.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.imagePath()),m(2),A(t.node.properties.midplane?26:-1),m(),A(t.node.properties.npe?27:-1),m(4),C("value",t.consoleType()),m(),Y(t.consoleTypes),m(5),C("value",t.auxType()),m(),Y(t.consoleTypes),m(2),C("checked",t.consoleAutoStart()),m(13),C("value",t.ram()),m(6),C("value",t.nvram()),m(3),A(Tt(27,A1e).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),Y(Tt(28,O1e)),m(2),A(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 Tw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(ie);configurationService=f(Lm);cd=f(X);validationService=f(V0);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()],i=this.node.properties.platform,r=this.node.properties.chassis||"";for(let a=0;a<=6;a++)this.adapterMatrix?.[i]?.[r]?.[a]?this.node.properties[`slot${a}`]=e[a]||"":delete this.node.properties[`slot${a}`];for(let a=0;a<=2;a++)this.wicMatrix?.[i]?.[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 i=this.node.properties.platform,r=this.validationService.validateRamForPlatform(this.ram(),i);if(!r.isValid){this.toasterService.error(r.errorMessage);return}let a=this.validationService.validateNvramForPlatform(this.nvram(),i);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 g=this.validationService.validateIomem(this.iomem());if(!g.isValid){this.toasterService.error(g.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:g=>{let y=g?.error?.message||g?.message||"Failed to update node";this.toasterService.error(y),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,i){t&1&&(s(0,"h1",1),d(1),l(),s(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-card",5),I(6,Z1e,144,29,"mat-tab-group"),l()()()(),s(7,"div",6)(8,"button",7),_("click",function(){return i.onCancelClick()}),d(9,"Cancel"),l(),s(10,"button",8),_("click",function(){return i.onSaveClick()}),d(11,"Apply"),l()()),t&2&&(m(),ee("Configurator for IOS router ",i.name),m(5),A(i.name?6:-1))},dependencies:[ne,Je,ve,Le,Ve,kt,On,ho,Wo,Go,we,Me,Xe,Ti,Se,Te,gt,Pt,ft,G,pe,oi,ei,Ci,xi,hi,oe,de,Lt,qt],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 J1e(n,o){if(n&1){let e=z();s(0,"mat-chip",22),_("removed",function(){let i=k(e).$implicit,r=v(2);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",23),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function exe(n,o){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function txe(n,o){if(n&1){let e=z();s(0,"mat-form-field",11)(1,"mat-label"),d(2,"RAM size"),l(),s(3,"input",12),_("input",function(i){k(e);let r=v(2);return T(r.ram.set(i.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 nxe(n,o){if(n&1){let e=z();s(0,"mat-form-field",11)(1,"mat-label"),d(2,"NVRAM size"),l(),s(3,"input",12),_("input",function(i){k(e);let r=v(2);return T(r.nvram.set(i.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 ixe(n,o){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),_("input",function(i){k(e);let r=v();return T(r.nodeName.set(i.target.value))}),l()(),s(7,"mat-form-field",13)(8,"mat-label"),d(9,"Tags"),l(),s(10,"mat-chip-grid",null,0),K(12,J1e,4,1,"mat-chip",null,Oe),l(),s(14,"input",14),_("matChipInputTokenEnd",function(i){k(e);let r=v();return T(r.addTag(i))}),l()(),s(15,"mat-form-field",11)(16,"mat-label"),d(17,"Console type"),l(),s(18,"mat-select",15),_("valueChange",function(i){k(e);let r=v();return T(r.consoleType.set(i))}),K(19,exe,2,2,"mat-option",16,Oe),l()(),s(21,"mat-checkbox",17),_("change",function(i){k(e);let r=v();return T(r.consoleAutoStart.set(i.checked))}),d(22," Auto start console "),l(),s(23,"mat-checkbox",17),_("change",function(i){k(e);let r=v();return T(r.l1Keepalives.set(i.checked))}),d(24," Enable Layer 1 keepalive messages "),l(),s(25,"mat-checkbox",17),_("change",function(i){k(e);let r=v();return T(r.useDefaultIouValues.set(i.checked))}),d(26," Use default IOU values for memories "),l(),I(27,txe,6,1,"mat-form-field",11),I(28,nxe,6,1,"mat-form-field",11),l()(),s(29,"mat-tab",18)(30,"div",19)(31,"mat-form-field",11)(32,"mat-label"),d(33,"Ethernet adapters"),l(),s(34,"input",12),_("input",function(i){k(e);let r=v();return T(r.ethernetAdapters.set(i.target.value))}),l()(),s(35,"mat-form-field",11)(36,"mat-label"),d(37,"Serial adapters"),l(),s(38,"input",12),_("input",function(i){k(e);let r=v();return T(r.serialAdapters.set(i.target.value))}),l()()()(),s(39,"mat-tab",20)(40,"div",10)(41,"mat-form-field",11)(42,"mat-label"),d(43,"Usage"),l(),s(44,"textarea",21),_("input",function(i){k(e);let r=v();return T(r.usage.set(i.target.value))}),l()()()()()}if(n&2){let e=ke(11),t=v();m(6),C("value",t.nodeName()),m(6),Y(t.node==null?null:t.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(4),C("value",t.consoleType()),m(),Y(t.consoleTypes),m(2),C("checked",t.consoleAutoStart()),m(2),C("checked",t.l1Keepalives()),m(2),C("checked",t.useDefaultIouValues()),m(2),A(t.useDefaultIouValues()?-1:27),m(),A(t.useDefaultIouValues()?-1:28),m(6),C("value",t.ethernetAdapters()),m(4),C("value",t.serialAdapters()),m(6),C("value",t.usage())}}var Ew=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(ie);configurationService=f(lf);cd=f(X);validationService=f(B0);controller;node;name;separatorKeysCodes=[13,188];consoleTypes=[];nodeName=U("");consoleType=U("");consoleAutoStart=U(!1);l1Keepalives=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.l1Keepalives.set(e.properties.l1_keepalives??!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 i=this.validationService.validateSerialAdapters(this.serialAdapters());if(!i.isValid){this.toasterService.error(i.errorMessage);return}this.node.name=this.nodeName(),this.node.console_type=this.consoleType(),this.node.console_auto_start=this.consoleAutoStart(),this.node.properties.l1_keepalives=this.l1Keepalives(),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"],l1Keepalives:[1,"l1Keepalives"],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",l1Keepalives:"l1KeepalivesChange",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,i){t&1&&(s(0,"h1",1),d(1),l(),s(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-card",5),I(6,ixe,45,12,"mat-tab-group"),l()()()(),s(7,"div",6)(8,"button",7),_("click",function(){return i.onCancelClick()}),d(9,"Cancel"),l(),s(10,"button",8),_("click",function(){return i.onSaveClick()}),d(11,"Apply"),l()()),t&2&&(m(),ee("Configurator for IOU device ",i.name),m(5),A(i.name?6:-1))},dependencies:[ne,Je,ve,Le,Ve,kt,On,ho,Wo,Go,we,Me,Xe,Ti,Se,Te,gt,Pt,ft,G,pe,oi,ei,Ci,xi,hi,oe,de,Lt,qt],encapsulation:2,changeDetection:0})}return n})();var oxe=(n,o)=>o.address;function rxe(n,o){if(n&1){let e=z();s(0,"mat-chip",15),_("removed",function(){let i=k(e).$implicit,r=v(2);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",16),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function axe(n,o){n&1&&(s(0,"th",24),d(1,"Interface"),l())}function sxe(n,o){n&1&&(s(0,"span",29),d(1),l()),n&2&&(m(),B(o))}function lxe(n,o){if(n&1&&(s(0,"div",26)(1,"span",27),R(2,"span",28),d(3),l(),I(4,sxe,2,1,"span",29),l()),n&2){let e,t=o,i=v().$implicit,r=v(3);m(),C("matTooltip",r.formatFlags(t.flags)||null),m(),Ae("cloud-iface-status--up",t.status==="up")("cloud-iface-status--down",t.status!=="up"),m(),ee(" ",i.name," "),m(),A((e=r.formatInterfaceMeta(t))?4:-1,e)}}function cxe(n,o){if(n&1&&d(0),n&2){let e=v().$implicit;ee(" ",e.name," ")}}function dxe(n,o){if(n&1&&(s(0,"td",25),I(1,lxe,5,7,"div",26)(2,cxe,1,1),l()),n&2){let e,t=o.$implicit,i=v(3);m(),A((e=i.getHostInterface(t.interface||t.name))?1:2,e)}}function mxe(n,o){n&1&&(s(0,"th",24),d(1,"IP addresses"),l())}function pxe(n,o){if(n&1&&(s(0,"div",30),d(1),l()),n&2){let e=o.$implicit,t=v(4);m(),B(t.formatIpAddress(e))}}function uxe(n,o){n&1&&d(0," \u2014 ")}function hxe(n,o){if(n&1&&(s(0,"td",25),K(1,pxe,2,1,"div",30,oxe,!1,uxe,1,0),l()),n&2){let e=o.$implicit,t=v(3);m(),Y(t.getHostInterfaceIps(e.interface||e.name))}}function fxe(n,o){n&1&&R(0,"tr",31)}function gxe(n,o){n&1&&R(0,"tr",32)}function _xe(n,o){if(n&1&&(s(0,"div",14)(1,"table",17),Fe(2,18),Ce(3,axe,2,0,"th",19)(4,dxe,3,1,"td",20),Re(),Fe(5,21),Ce(6,mxe,2,0,"th",19)(7,hxe,4,1,"td",20),Re(),Ce(8,fxe,1,0,"tr",22)(9,gxe,1,0,"tr",23),l()()),n&2){let e=v(2);m(),C("dataSource",e.portsMappingEthernet()),m(7),C("matHeaderRowDef",e.ethernetDisplayColumns),m(),C("matRowDefColumns",e.ethernetDisplayColumns)}}function vxe(n,o){if(n&1){let e=z();s(0,"div",6)(1,"mat-form-field",10)(2,"mat-label"),d(3,"Name"),l(),s(4,"input",11),_("input",function(i){k(e);let r=v();return T(r.nodeName.set(i.target.value))}),l()(),s(5,"mat-form-field",12)(6,"mat-label"),d(7,"Tags"),l(),s(8,"mat-chip-grid",null,0),K(10,rxe,4,1,"mat-chip",null,Oe),l(),s(12,"input",13),_("matChipInputTokenEnd",function(i){k(e);let r=v();return T(r.addTag(i))}),l()(),I(13,_xe,10,3,"div",14),l()}if(n&2){let e=ke(9),t=v();m(4),C("value",t.nodeName()),m(6),Y(t.node==null?null:t.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(),A(t.portsMappingEthernet().length?13:-1)}}var Dw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(ie);cd=f(X);validationService=f(Wi);controller;node;name;separatorKeysCodes=[13,188];portsMappingEthernet=Q([]);ethernetDisplayColumns=["name","ipAddresses"];nodeName=U("");formatIpAddresses=Cw;formatIpAddress=Uv;formatInterfaceMeta=xw;formatFlags=bw;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.portsMappingEthernet.set(this.node.properties.ports_mapping.filter(t=>t.type==="ethernet")),this.cd.markForCheck()},error:e=>{let t=e.error?.message||e.message||"Failed to load node";this.toasterService.error(t),this.cd.markForCheck()}})}getHostInterface(e){return this.node?.properties?.interfaces?.find(t=>t.name===e)}getHostInterfaceIps(e){return this.getHostInterface(e)?.ip_addresses??[]}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.properties.ports_mapping=this.portsMappingEthernet(),this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:t=>{let i=t?.error?.message||t?.message||"Failed to update node";this.toasterService.error(i),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-nat"]],inputs:{nodeName:[1,"nodeName"]},outputs:{nodeName:"nodeNameChange"},decls:12,vars:2,consts:[["chipList",""],["mat-dialog-title",""],[1,"modal-form-container"],[1,"content"],[1,"default-content"],[1,"matCard"],[1,"form-container"],["mat-dialog-actions",""],["mat-button","","color","accent",3,"click"],["mat-button","","tabindex","2","mat-raised-button","","color","primary",3,"click"],[1,"form-field"],["matInput","","type","text",3,"input","value"],[1,"form-field","tags-field"],["matInput","","placeholder","Add tags",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[1,"interfaces-list"],[3,"removed"],["matChipRemove",""],["mat-table","",1,"interfaces-table",3,"dataSource"],["matColumnDef","name"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","ipAddresses"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],[1,"cloud-iface-cell"],[3,"matTooltip"],[1,"cloud-iface-status"],[1,"cloud-iface-meta"],[1,"cloud-ip-line"],["mat-header-row",""],["mat-row",""]],template:function(t,i){t&1&&(s(0,"h1",1),d(1),l(),s(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-card",5),I(6,vxe,14,4,"div",6),l()()()(),s(7,"div",7)(8,"button",8),_("click",function(){return i.onCancelClick()}),d(9,"Cancel"),l(),s(10,"button",9),_("click",function(){return i.onSaveClick()}),d(11,"Apply"),l()()),t&2&&(m(),ee("Configurator for NAT node ",i.name),m(5),A(i.name?6:-1))},dependencies:[ne,Je,ve,Le,Ve,kt,On,we,Me,Xe,Se,Te,G,pe,oi,ei,Ci,xi,hi,oe,de,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,ht,Mt],encapsulation:2,changeDetection:0})}return n})();function Cxe(n,o){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e.toUpperCase())}}function xxe(n,o){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function bxe(n,o){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function yxe(n,o){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Sxe(n,o){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function wxe(n,o){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),_("valueChange",function(i){k(e);let r=v();return T(r.clusterSize.set(i))}),s(4,"mat-option",18),d(5,"Default (64)"),l(),K(6,yxe,2,2,"mat-option",10,Oe),l()(),s(8,"mat-form-field",8)(9,"mat-label"),d(10,"Refcount bits"),l(),s(11,"mat-select",9),_("valueChange",function(i){k(e);let r=v();return T(r.refcountBits.set(i))}),s(12,"mat-option",18),d(13,"Default (12)"),l(),K(14,Sxe,2,2,"mat-option",10,Oe),l()()}if(n&2){let e=v();m(3),C("value",e.clusterSize()),m(3),Y(e.clusterSizeOptions),m(5),C("value",e.refcountBits()),m(3),Y(e.refcountBitsOptions)}}function Mxe(n,o){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function kxe(n,o){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Txe(n,o){if(n&1){let e=z();s(0,"mat-form-field",8)(1,"mat-label"),d(2,"Subformat"),l(),s(3,"mat-select",9),_("valueChange",function(i){k(e);let r=v();return T(r.subformat.set(i))}),s(4,"mat-option",18),d(5,"Default"),l(),K(6,Mxe,2,2,"mat-option",10,Oe),l()(),s(8,"mat-form-field",8)(9,"mat-label"),d(10,"Adapter type"),l(),s(11,"mat-select",9),_("valueChange",function(i){k(e);let r=v();return T(r.adapterType.set(i))}),s(12,"mat-option",18),d(13,"Default"),l(),K(14,kxe,2,2,"mat-option",10,Oe),l()(),s(16,"mat-form-field",8)(17,"mat-label"),d(18,"Zeroed grain"),l(),s(19,"mat-select",9),_("valueChange",function(i){k(e);let r=v();return T(r.zeroedGrain.set(i))}),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),Y(e.vmdkSubformatOptions),m(5),C("value",e.adapterType()),m(3),Y(e.adapterTypeOptions),m(5),C("value",e.zeroedGrain())}}function Exe(n,o){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Dxe(n,o){if(n&1){let e=z();s(0,"mat-form-field",8)(1,"mat-label"),d(2,"Subformat"),l(),s(3,"mat-select",9),_("valueChange",function(i){k(e);let r=v();return T(r.subformat.set(i))}),s(4,"mat-option",18),d(5,"Default"),l(),K(6,Exe,2,2,"mat-option",10,Oe),l()(),s(8,"mat-form-field",8)(9,"mat-label"),d(10,"Static"),l(),s(11,"mat-select",9),_("valueChange",function(i){k(e);let r=v();return T(r.static.set(i))}),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),Y(e.vhdSubformatOptions),m(5),C("value",e.static())}}function Pxe(n,o){if(n&1){let e=z();s(0,"mat-form-field",8)(1,"mat-label"),d(2,"Static"),l(),s(3,"mat-select",9),_("valueChange",function(i){k(e);let r=v();return T(r.static.set(i))}),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 Pw=(()=>{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(ie);qemuService=f(na);validationService=f(Wi);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 i="."+this.format();if(!this.diskName().toLowerCase().endsWith(i)){this.toasterService.error(`Filename must end with ${i} 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,i){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),_("valueChange",function(a){return i.mountPoint.set(a)}),K(14,Cxe,2,2,"mat-option",10,Oe),l()(),s(16,"mat-form-field",8)(17,"mat-label"),d(18,"Filename *"),l(),s(19,"input",11),_("input",function(a){return i.diskName.set(a.target.value)}),l()()(),s(20,"mat-form-field",8)(21,"mat-label"),d(22,"Format *"),l(),s(23,"mat-select",9),_("valueChange",function(a){return i.format.set(a)}),K(24,xxe,2,2,"mat-option",10,Oe),l()(),s(26,"mat-form-field",8)(27,"mat-label"),d(28,"Size (MB) *"),l(),s(29,"input",12),_("input",function(a){return i.size.set(a.target.value)}),l()(),s(30,"mat-form-field",8)(31,"mat-label"),d(32,"Preallocation"),l(),s(33,"mat-select",9),_("valueChange",function(a){return i.preallocation.set(a)}),K(34,bxe,2,2,"mat-option",10,Oe),l()(),s(36,"mat-form-field",8)(37,"mat-label"),d(38,"Lazy refcounts"),l(),s(39,"mat-select",9),_("valueChange",function(a){return i.lazyRefcounts.set(a)}),s(40,"mat-option",13),d(41,"on"),l(),s(42,"mat-option",14),d(43,"off"),l()()(),I(44,wxe,16,2),I(45,Txe,26,3),I(46,Dxe,18,2),I(47,Pxe,10,1,"mat-form-field",8),l()()()()(),s(48,"div",15)(49,"button",16),_("click",function(){return i.onCancelClick()}),d(50,"Cancel"),l(),s(51,"button",17),_("click",function(){return i.onSaveClick()}),d(52,"Apply"),l()()),t&2&&(m(13),C("value",i.mountPoint()),m(),Y(i.mountPointOptions),m(5),C("value",i.diskName()),m(4),C("value",i.format()),m(),Y(i.formatOptions),m(5),C("value",i.size()),m(4),C("value",i.preallocation()),m(),Y(i.preallocationsOptions),m(5),C("value",i.lazyRefcounts()),m(5),A(i.format()==="qcow2"?44:-1),m(),A(i.format()==="vmdk"?45:-1),m(),A(i.format()==="vhd"||i.format()==="vpc"?46:-1),m(),A(i.format()==="vdi"?47:-1))},dependencies:[ne,Je,ve,Le,Ve,G,pe,we,Me,Xe,Se,Te,gt,Pt,ft,Vo,kt,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 w9=(n,o)=>o[1],Iw=(n,o)=>o.filename,Ixe=(n,o)=>o.value;function Axe(n,o){if(n&1){let e=z();s(0,"mat-chip",71),_("removed",function(){let i=k(e).$implicit,r=v(2);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",72),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function Oxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function Nxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function Fxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function Rxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Lxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Vxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Bxe(n,o){if(n&1&&(s(0,"mat-optgroup",52),K(1,Vxe,2,2,"mat-option",36,Oe),l()),n&2){let e=v(2);m(),Y(e.projectDiskFiles)}}function zxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e.filename),m(),B(e.filename)}}function jxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function $xe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Hxe(n,o){if(n&1&&(s(0,"mat-optgroup",52),K(1,$xe,2,2,"mat-option",36,Oe),l()),n&2){let e=v(2);m(),Y(e.projectDiskFiles)}}function Uxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e.filename),m(),B(e.filename)}}function Wxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function Gxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function qxe(n,o){if(n&1&&(s(0,"mat-optgroup",52),K(1,Gxe,2,2,"mat-option",36,Oe),l()),n&2){let e=v(2);m(),Y(e.projectDiskFiles)}}function Qxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e.filename),m(),B(e.filename)}}function Xxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function Kxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function Yxe(n,o){if(n&1&&(s(0,"mat-optgroup",52),K(1,Kxe,2,2,"mat-option",36,Oe),l()),n&2){let e=v(2);m(),Y(e.projectDiskFiles)}}function Zxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e.filename),m(),B(e.filename)}}function Jxe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function ebe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function tbe(n,o){if(n&1&&(s(0,"mat-optgroup",52),K(1,ebe,2,2,"mat-option",36,Oe),l()),n&2){let e=v(2);m(),Y(e.filteredIsoFiles)}}function nbe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function ibe(n,o){if(n&1&&(s(0,"mat-optgroup",53),K(1,nbe,2,2,"mat-option",36,Oe),l()),n&2){let e=v(2);m(),Y(e.filteredGlobalIsoImages)}}function obe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e.value),m(),mi(" ",e.name," (",e.value,") ")}}function rbe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function abe(n,o){if(n&1&&(s(0,"mat-optgroup",52),K(1,rbe,2,2,"mat-option",36,Oe),l()),n&2){let e=v(2);m(),Y(e.filteredNodeFiles)}}function sbe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function lbe(n,o){if(n&1&&(s(0,"mat-optgroup",53),K(1,sbe,2,2,"mat-option",36,Oe),l()),n&2){let e=v(2);m(),Y(e.filteredGlobalFiles)}}function cbe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function dbe(n,o){if(n&1&&(s(0,"mat-optgroup",52),K(1,cbe,2,2,"mat-option",36,Oe),l()),n&2){let e=v(2);m(),Y(e.filteredNodeFiles)}}function mbe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function pbe(n,o){if(n&1&&(s(0,"mat-optgroup",53),K(1,mbe,2,2,"mat-option",36,Oe),l()),n&2){let e=v(2);m(),Y(e.filteredGlobalFiles)}}function ube(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function hbe(n,o){if(n&1&&(s(0,"mat-optgroup",52),K(1,ube,2,2,"mat-option",36,Oe),l()),n&2){let e=v(2);m(),Y(e.filteredNodeFiles)}}function fbe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function gbe(n,o){if(n&1&&(s(0,"mat-optgroup",53),K(1,fbe,2,2,"mat-option",36,Oe),l()),n&2){let e=v(2);m(),Y(e.filteredGlobalFiles)}}function _be(n,o){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),_("input",function(i){k(e);let r=v(2);return T(r.cpuThrottling.set(i.target.value))}),l()()}if(n&2){let e=v(2);m(3),C("value",e.cpuThrottling())}}function vbe(n,o){if(n&1&&(s(0,"mat-option",36),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function Cbe(n,o){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),_("input",function(i){k(e);let r=v();return T(r.nodeName.set(i.target.value))}),l()(),s(7,"mat-form-field",32)(8,"mat-label"),d(9,"Tags"),l(),s(10,"mat-chip-grid",null,0),K(12,Axe,4,1,"mat-chip",null,Oe),l(),s(14,"input",33),_("matChipInputTokenEnd",function(i){k(e);let r=v();return T(r.addTag(i))}),l()(),s(15,"div",34)(16,"mat-form-field",30)(17,"mat-label"),d(18,"Platform"),l(),s(19,"mat-select",35),_("valueChange",function(i){k(e);let r=v();return T(r.platform.set(i))}),K(20,Oxe,2,2,"mat-option",36,Oe),l()(),s(22,"mat-form-field",30)(23,"mat-label"),d(24,"RAM"),l(),s(25,"input",31),_("input",function(i){k(e);let r=v();return T(r.ram.set(i.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),_("input",function(i){k(e);let r=v();return T(r.cpus.set(i.target.value))}),l()(),s(32,"mat-form-field",30)(33,"mat-label"),d(34,"Boot priority"),l(),s(35,"mat-select",35),_("valueChange",function(i){k(e);let r=v();return T(r.bootPriority.set(i))}),K(36,Nxe,2,2,"mat-option",36,w9),l()()(),s(38,"mat-form-field",30)(39,"mat-label"),d(40,"On close"),l(),s(41,"mat-select",35),_("valueChange",function(i){k(e);let r=v();return T(r.onClose.set(i))}),K(42,Fxe,2,2,"mat-option",36,w9),l()(),s(44,"div",39)(45,"mat-form-field",30)(46,"mat-label"),d(47,"Console type"),l(),s(48,"mat-select",35),_("valueChange",function(i){k(e);let r=v();return T(r.consoleType.set(i))}),K(49,Rxe,2,2,"mat-option",36,Oe),l()(),s(51,"mat-form-field",30)(52,"mat-label"),d(53,"Auxiliary console type"),l(),s(54,"mat-select",35),_("valueChange",function(i){k(e);let r=v();return T(r.auxType.set(i))}),K(55,Lxe,2,2,"mat-option",36,Oe),l()()(),s(57,"mat-checkbox",40),_("change",function(i){k(e);let r=v();return T(r.consoleAutoStart.set(i.checked))}),d(58," Auto start console "),l()(),s(59,"mat-tab",41)(60,"div",42)(61,"button",43),_("click",function(){k(e);let i=v();return T(i.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),_("input",function(i){k(e);let r=v();return T(r.hdaDiskImage.set(i.target.value))})("input",function(i){k(e);let r=v();return T(r.onHdaImageInput(i))})("focus",function(){k(e);let i=v();return i.filteredImages=i.qemuImages,T(i.refreshQemuImages())}),l(),s(75,"mat-autocomplete",51,1),_("optionSelected",function(i){k(e);let r=v();return T(r.hdaDiskImage.set(i.option.value))}),I(77,Bxe,3,0,"mat-optgroup",52),s(78,"mat-optgroup",53),K(79,zxe,2,2,"mat-option",36,Iw),l()()(),s(81,"mat-form-field",30)(82,"mat-label"),d(83,"Disk interface"),l(),s(84,"mat-select",35),_("valueChange",function(i){k(e);let r=v();return T(r.hdaDiskInterface.set(i))}),K(85,jxe,2,2,"mat-option",36,Oe),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),_("input",function(i){k(e);let r=v();return T(r.hdbDiskImage.set(i.target.value))})("input",function(i){k(e);let r=v();return T(r.onHdbImageInput(i))})("focus",function(){k(e);let i=v();return i.filteredImages=i.qemuImages,T(i.refreshQemuImages())}),l(),s(98,"mat-autocomplete",51,2),_("optionSelected",function(i){k(e);let r=v();return T(r.hdbDiskImage.set(i.option.value))}),I(100,Hxe,3,0,"mat-optgroup",52),s(101,"mat-optgroup",53),K(102,Uxe,2,2,"mat-option",36,Iw),l()()(),s(104,"mat-form-field",30)(105,"mat-label"),d(106,"Disk interface"),l(),s(107,"mat-select",35),_("valueChange",function(i){k(e);let r=v();return T(r.hdbDiskInterface.set(i))}),K(108,Wxe,2,2,"mat-option",36,Oe),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),_("input",function(i){k(e);let r=v();return T(r.hdcDiskImage.set(i.target.value))})("input",function(i){k(e);let r=v();return T(r.onHdcImageInput(i))})("focus",function(){k(e);let i=v();return i.filteredImages=i.qemuImages,T(i.refreshQemuImages())}),l(),s(121,"mat-autocomplete",51,3),_("optionSelected",function(i){k(e);let r=v();return T(r.hdcDiskImage.set(i.option.value))}),I(123,qxe,3,0,"mat-optgroup",52),s(124,"mat-optgroup",53),K(125,Qxe,2,2,"mat-option",36,Iw),l()()(),s(127,"mat-form-field",30)(128,"mat-label"),d(129,"Disk interface"),l(),s(130,"mat-select",35),_("valueChange",function(i){k(e);let r=v();return T(r.hdcDiskInterface.set(i))}),K(131,Xxe,2,2,"mat-option",36,Oe),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),_("input",function(i){k(e);let r=v();return T(r.hddDiskImage.set(i.target.value))})("input",function(i){k(e);let r=v();return T(r.onHddImageInput(i))})("focus",function(){k(e);let i=v();return i.filteredImages=i.qemuImages,T(i.refreshQemuImages())}),l(),s(144,"mat-autocomplete",51,4),_("optionSelected",function(i){k(e);let r=v();return T(r.hddDiskImage.set(i.option.value))}),I(146,Yxe,3,0,"mat-optgroup",52),s(147,"mat-optgroup",53),K(148,Zxe,2,2,"mat-option",36,Iw),l()()(),s(150,"mat-form-field",30)(151,"mat-label"),d(152,"Disk interface"),l(),s(153,"mat-select",35),_("valueChange",function(i){k(e);let r=v();return T(r.hddDiskInterface.set(i))}),K(154,Jxe,2,2,"mat-option",36,Oe),l()()()()()(),s(156,"mat-tab",54)(157,"div",55)(158,"div",56)(159,"button",57),_("click",function(){k(e);let i=ke(164);return T(i.click())}),d(160," Upload to device "),l(),s(161,"button",58),_("click",function(){k(e);let i=ke(166);return T(i.click())}),d(162," Upload globally "),l(),s(163,"input",59,5),_("change",function(i){k(e);let r=v();return T(r.uploadCdromImageFile(i,"device"))}),l(),s(165,"input",59,6),_("change",function(i){k(e);let r=v();return T(r.uploadCdromImageFile(i,"global"))}),l()(),s(167,"mat-form-field",30)(168,"mat-label"),d(169,"Image"),l(),s(170,"input",50,7),_("input",function(i){k(e);let r=v();return r.cdromImage.set(i.target.value),T(r.onCdromInput(i))})("focus",function(){k(e);let i=ke(171),r=v();return r.filteredIsoFiles=r.projectIsoFiles,r.filteredGlobalIsoImages=r.globalIsoImages,i.openPanel(),r.refreshNodeFiles(),T(r.refreshGlobalImages())}),l(),s(172,"mat-autocomplete",51,8),_("optionSelected",function(i){k(e);let r=v();return T(r.cdromImage.set(i.option.value))}),I(174,tbe,3,0,"mat-optgroup",52),I(175,ibe,3,0,"mat-optgroup",53),l()()()(),s(176,"mat-tab",60)(177,"div")(178,"mat-form-field",30)(179,"mat-label"),d(180,"Number of adapters"),l(),s(181,"input",61),_("input",function(i){k(e);let r=v();return T(r.adapters.set(i.target.value))}),l()(),s(182,"mat-form-field",30)(183,"mat-label"),d(184,"Base MAC"),l(),s(185,"input",31),_("input",function(i){k(e);let r=v();return T(r.macAddress.set(i.target.value))}),l()(),s(186,"mat-form-field",30)(187,"mat-label"),d(188,"Type"),l(),s(189,"mat-select",35),_("valueChange",function(i){k(e);let r=v();return T(r.adapterType.set(i))}),K(190,obe,2,3,"mat-option",36,Ixe),l()(),s(192,"div",62)(193,"button",57),_("click",function(){k(e);let i=v();return T(i.openCustomAdaptersDialog())}),d(194," Configurator Custom Adapters "),l()(),s(195,"mat-checkbox",40),_("change",function(i){k(e);let r=v();return T(r.replicateNetworkState.set(i.checked))}),d(196," Replicate network connection state "),l()()(),s(197,"mat-tab",63)(198,"div",64)(199,"div",45)(200,"div",46)(201,"h3",47),d(202,"Linux boot specific settings"),l()(),s(203,"div",49)(204,"div",65)(205,"div",66)(206,"button",57),_("click",function(){k(e);let i=ke(220);return T(i.click())}),d(207,"Upload to device"),l(),s(208,"button",58),_("click",function(){k(e);let i=ke(222);return T(i.click())}),d(209,"Upload globally"),l(),s(210,"mat-form-field",67)(211,"mat-label"),d(212,"Initial RAM disk (initrd)"),l(),s(213,"input",50,9),_("input",function(i){k(e);let r=v();return r.initrd.set(i.target.value),T(r.onAdvancedFileInput(i))})("focus",function(){k(e);let i=ke(214),r=v();return r.filteredNodeFiles=r.allNodeFiles,r.filteredGlobalFiles=r.allGlobalFiles,i.openPanel(),r.refreshNodeFiles(),T(r.refreshQemuImages())}),l(),s(215,"mat-autocomplete",51,10),_("optionSelected",function(i){k(e);let r=v();return T(r.initrd.set(i.option.value))}),I(217,abe,3,0,"mat-optgroup",52),I(218,lbe,3,0,"mat-optgroup",53),l()()(),s(219,"input",68,11),_("change",function(i){k(e);let r=v();return T(r.uploadInitrdFile(i,"device"))}),l(),s(221,"input",68,12),_("change",function(i){k(e);let r=v();return T(r.uploadInitrdFile(i,"global"))}),l()(),s(223,"div",65)(224,"div",66)(225,"button",57),_("click",function(){k(e);let i=ke(239);return T(i.click())}),d(226,"Upload to device"),l(),s(227,"button",58),_("click",function(){k(e);let i=ke(241);return T(i.click())}),d(228,"Upload globally"),l(),s(229,"mat-form-field",67)(230,"mat-label"),d(231,"Kernel image"),l(),s(232,"input",50,13),_("input",function(i){k(e);let r=v();return r.kernelImage.set(i.target.value),T(r.onAdvancedFileInput(i))})("focus",function(){k(e);let i=ke(233),r=v();return r.filteredNodeFiles=r.allNodeFiles,r.filteredGlobalFiles=r.allGlobalFiles,i.openPanel(),r.refreshNodeFiles(),T(r.refreshQemuImages())}),l(),s(234,"mat-autocomplete",51,14),_("optionSelected",function(i){k(e);let r=v();return T(r.kernelImage.set(i.option.value))}),I(236,dbe,3,0,"mat-optgroup",52),I(237,pbe,3,0,"mat-optgroup",53),l()()(),s(238,"input",68,15),_("change",function(i){k(e);let r=v();return T(r.uploadKernelImageFile(i,"device"))}),l(),s(240,"input",68,16),_("change",function(i){k(e);let r=v();return T(r.uploadKernelImageFile(i,"global"))}),l()(),s(242,"mat-form-field",30)(243,"mat-label"),d(244,"Kernel command line"),l(),s(245,"input",31),_("input",function(i){k(e);let r=v();return T(r.kernelCommandLine.set(i.target.value))}),l()()()(),s(246,"div",45)(247,"div",46)(248,"h3",47),d(249,"Bios"),l()(),s(250,"div",49)(251,"div",65)(252,"div",66)(253,"button",57),_("click",function(){k(e);let i=ke(267);return T(i.click())}),d(254,"Upload to device"),l(),s(255,"button",58),_("click",function(){k(e);let i=ke(269);return T(i.click())}),d(256,"Upload globally"),l(),s(257,"mat-form-field",67)(258,"mat-label"),d(259,"Bios image"),l(),s(260,"input",50,17),_("input",function(i){k(e);let r=v();return r.biosImage.set(i.target.value),T(r.onAdvancedFileInput(i))})("focus",function(){k(e);let i=ke(261),r=v();return r.filteredNodeFiles=r.allNodeFiles,r.filteredGlobalFiles=r.allGlobalFiles,i.openPanel(),r.refreshNodeFiles(),T(r.refreshQemuImages())}),l(),s(262,"mat-autocomplete",51,18),_("optionSelected",function(i){k(e);let r=v();return T(r.biosImage.set(i.option.value))}),I(264,hbe,3,0,"mat-optgroup",52),I(265,gbe,3,0,"mat-optgroup",53),l()()(),s(266,"input",68,19),_("change",function(i){k(e);let r=v();return T(r.uploadBiosFile(i,"device"))}),l(),s(268,"input",68,20),_("change",function(i){k(e);let r=v();return T(r.uploadBiosFile(i,"global"))}),l()()()(),s(270,"div",45)(271,"div",46)(272,"h3",47),d(273,"Optimization"),l()(),s(274,"div",49)(275,"mat-checkbox",40),_("change",function(i){k(e);let r=v();return T(r.linkedClone.set(i.checked))}),d(276,"Linked clone"),l(),s(277,"mat-checkbox",40),_("change",function(i){k(e);let r=v();return T(r.createConfigDisk.set(i.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),_("input",function(i){k(e);let r=v();return T(r.maxcpus.set(i.target.value))}),l()(),s(283,"mat-checkbox",40),_("change",function(i){k(e);let r=v();return T(r.activateCpuThrottling.set(i.checked))}),d(284," Activate CPU throttling "),l(),I(285,_be,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),_("valueChange",function(i){k(e);let r=v();return T(r.processPriority.set(i))}),K(290,vbe,2,2,"mat-option",36,Oe),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),_("input",function(i){k(e);let r=v();return T(r.qemuPath.set(i.target.value))}),l()(),s(301,"mat-form-field",30)(302,"mat-label"),d(303,"Options"),l(),s(304,"input",31),_("input",function(i){k(e);let r=v();return T(r.options.set(i.target.value))}),l()(),s(305,"mat-checkbox",40),_("change",function(i){k(e);let r=v();return T(r.tpm.set(i.checked))}),d(306," Enable the Trusted Platform Module (TPM) "),l(),s(307,"mat-checkbox",40),_("change",function(i){k(e);let r=v();return T(r.uefi.set(i.checked))}),d(308," Enable the UEFI boot mode "),l()()()()(),s(309,"mat-tab",69)(310,"mat-form-field",30)(311,"mat-label"),d(312,"Usage"),l(),s(313,"textarea",70),_("input",function(i){k(e);let r=v();return T(r.usage.set(i.target.value))}),l()()()()()}if(n&2){let e=ke(11),t=ke(76),i=ke(99),r=ke(122),a=ke(145),c=ke(173),p=ke(216),u=ke(235),h=ke(263),g=v();m(6),C("value",g.nodeName()),m(6),Y(g.node==null?null:g.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",g.separatorKeysCodes),m(5),C("value",g.platform()),m(),Y(g.selectPlatform),m(5),C("value",g.ram()),m(6),C("value",g.cpus()),m(4),C("value",g.bootPriority()),m(),Y(g.bootPriorities),m(5),C("value",g.onClose()),m(),Y(g.onCloseOptions),m(6),C("value",g.consoleType()),m(),Y(g.consoleTypes),m(5),C("value",g.auxType()),m(),Y(g.auxConsoleTypes),m(2),C("checked",g.consoleAutoStart()),m(17),C("value",g.hdaDiskImage())("matAutocomplete",t),m(3),A(g.projectDiskFiles.length?77:-1),m(2),Y(g.filteredImages),m(5),C("value",g.hdaDiskInterface()),m(),Y(g.diskInterfaces),m(12),C("value",g.hdbDiskImage())("matAutocomplete",i),m(3),A(g.projectDiskFiles.length?100:-1),m(2),Y(g.filteredImages),m(5),C("value",g.hdbDiskInterface()),m(),Y(g.diskInterfaces),m(12),C("value",g.hdcDiskImage())("matAutocomplete",r),m(3),A(g.projectDiskFiles.length?123:-1),m(2),Y(g.filteredImages),m(5),C("value",g.hdcDiskInterface()),m(),Y(g.diskInterfaces),m(12),C("value",g.hddDiskImage())("matAutocomplete",a),m(3),A(g.projectDiskFiles.length?146:-1),m(2),Y(g.filteredImages),m(5),C("value",g.hddDiskInterface()),m(),Y(g.diskInterfaces),m(16),C("value",g.cdromImage())("matAutocomplete",c),m(4),A(g.filteredIsoFiles.length?174:-1),m(),A(g.filteredGlobalIsoImages.length?175:-1),m(6),C("value",g.adapters()),m(4),C("value",g.macAddress()),m(4),C("value",g.adapterType()),m(),Y(g.networkTypes),m(5),C("checked",g.replicateNetworkState()),m(18),C("value",g.initrd())("matAutocomplete",p),m(4),A(g.filteredNodeFiles.length?217:-1),m(),A(g.filteredGlobalFiles.length?218:-1),m(14),C("value",g.kernelImage())("matAutocomplete",u),m(4),A(g.filteredNodeFiles.length?236:-1),m(),A(g.filteredGlobalFiles.length?237:-1),m(8),C("value",g.kernelCommandLine()),m(15),C("value",g.biosImage())("matAutocomplete",h),m(4),A(g.filteredNodeFiles.length?264:-1),m(),A(g.filteredGlobalFiles.length?265:-1),m(10),C("checked",g.linkedClone()),m(2),C("checked",g.createConfigDisk()),m(5),C("value",g.maxcpus()),m(),C("checked",g.activateCpuThrottling()),m(2),A(g.activateCpuThrottling()?285:-1),m(4),C("value",g.processPriority()),m(),Y(g.priorities),m(10),C("value",g.qemuPath()),m(4),C("value",g.options()),m(),C("checked",g.tpm()),m(2),C("checked",g.uefi()),m(6),C("value",g.usage())}}var Aw=(()=>{class n{dialog=f(it);dialogRef=f(Ie);nodeService=f(ut);toasterService=f(ie);qemuService=f(na);qemuConfigurationService=f(zm);cd=f(X);imageManagerService=f(Wc);validationService=f(Wi);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(i=>i.path),this.projectDiskFiles=t.filter(i=>i.file_type?.toLowerCase().includes("qemu")||i.file_type?.toLowerCase().includes("qcow")||i.file_type?.toLowerCase().includes("vmdk")||i.file_type?.toLowerCase().includes("vmware")||i.file_type?.toLowerCase().includes("virtual")||i.file_type?.toLowerCase().includes("disk image")).map(i=>i.path),this.projectIsoFiles=t.filter(i=>i.file_type?.toLowerCase().includes("iso 9660")||i.file_type?.toLowerCase().includes("cd-rom")).map(i=>i.path),this.cd.markForCheck()},error:()=>{}}),this.imageManagerService.getImages(this.controller).subscribe({next:t=>{this.globalIsoImages=t.filter(i=>i.filename?.endsWith(".iso")).map(i=>i.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(Pw,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 i=t.mountPoint.toLowerCase(),r={hda:this.hdaDiskImage,hdb:this.hdbDiskImage,hdc:this.hdcDiskImage,hdd:this.hddDiskImage};r[i]&&(r[i].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 i=e.target.files[0];if(!i)return;let r=i.name;(t==="device"?this.nodeService.uploadNodeFile(this.controller,this.node.project_id,this.node.node_id,r,i):this.imageManagerService.uploadedImage(this.controller,!1,r,i)).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,i,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[i]=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(i=>i.filename.toLowerCase().includes(t))}onAdvancedFileInput(e){let t=e.target.value.toLowerCase();this.filteredNodeFiles=this.allNodeFiles.filter(i=>i.toLowerCase().includes(t)),this.filteredGlobalFiles=this.allGlobalFiles.filter(i=>i.toLowerCase().includes(t))}onCdromInput(e){let t=e.target.value.toLowerCase();this.filteredIsoFiles=this.projectIsoFiles.filter(i=>i.toLowerCase().includes(t)),this.filteredGlobalIsoImages=this.globalIsoImages.filter(i=>i.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,i=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(g=>g.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 g;if(t>0){let y=Math.floor(u/t),b=u%t;g=e.replace("{0}",String(y*t+b))}else g=e.replace("{0}",String(u));c.push({adapter_number:u,adapter_type:i,port_name:g,mac_address:""})}}this.dialog.open(Gc,{panelClass:"custom-adapters-dialog-panel",data:{adapters:c,networkTypes:this.networkTypes,portNameFormat:e,portSegmentSize:t,defaultAdapterType:i,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:i=>{let r=i.error?.message||i.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"],[3,"optionSelected"],["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,i){t&1&&(s(0,"h1",21),d(1),l(),s(2,"div",22)(3,"div",23)(4,"div",24)(5,"mat-card",25),I(6,Cbe,314,59,"div"),l()()()(),s(7,"div",26)(8,"button",27),_("click",function(){return i.onCancelClick()}),d(9,"Cancel"),l(),s(10,"button",28),_("click",function(){return i.onSaveClick()}),d(11,"Apply"),l()()),t&2&&(m(),ee("Configurator for Qemu VM ",i.name),m(5),A(i.name?6:-1))},dependencies:[ne,Je,ve,Le,Ve,kt,On,ho,Wo,Go,we,Me,Xe,Ti,Se,Te,gt,Pt,ft,BC,G,pe,oi,ei,Ci,xi,hi,oe,de,Lt,qt,lr,Dr,So],encapsulation:2,changeDetection:0})}return n})();function xbe(n,o){n&1&&(s(0,"th",21),d(1,"Source Port : DLCI"),l())}function bbe(n,o){if(n&1&&(s(0,"td",22),d(1),l()),n&2){let e=o.$implicit;m(),B(e.portIn)}}function ybe(n,o){n&1&&(s(0,"th",21),d(1,"Destination Port : DLCI"),l())}function Sbe(n,o){if(n&1&&(s(0,"td",22),d(1),l()),n&2){let e=o.$implicit;m(),B(e.portOut)}}function wbe(n,o){n&1&&(s(0,"th",21),d(1,"Actions"),l())}function Mbe(n,o){if(n&1){let e=z();s(0,"td",22)(1,"button",23),_("click",function(){let i=k(e).$implicit,r=v();return T(r.delete(i))}),s(2,"mat-icon",24),d(3,"delete"),l()()()}}function kbe(n,o){n&1&&R(0,"tr",25)}function Tbe(n,o){n&1&&R(0,"tr",26)}var Ow=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(ie);cd=f(X);validationService=f(Wi);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(i=>{this.nodeMappings.set(i,t[i])}),this.nodeMappingsDataSource=Array.from(this.nodeMappings.entries()).map(([i,r])=>({portIn:i,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(),i=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(i,"Destination Port");if(!u.isValid){this.toasterService.error(u.errorMessage);return}if(!this.validationService.validatePort(i).isValid){this.toasterService.error("Destination Port must be a non-negative integer");return}let g=this.validationService.required(r,"Destination DLCI");if(!g.isValid){this.toasterService.error(g.errorMessage);return}let y={portIn:`${e}:${t}`,portOut:`${i}:${r}`};this.nodeMappingsDataSource.filter(b=>b.portIn===y.portIn).length>0?this.toasterService.error("Mapping already defined."):(this.nodeMappingsDataSource=this.nodeMappingsDataSource.concat([y]),this.clearUserInput())}clearUserInput(){this.sourcePort.set(""),this.sourceDlci.set(""),this.destinationPort.set(""),this.destinationDlci.set("")}strMapToObj(e){let t=Object.create(null);for(let[i,r]of e)t[i]=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,[i,r])=>Object.assign(t,{[i]:r}),{}),this.nodeService.updateNode(this.controller,this.node).subscribe({next:()=>{this.toasterService.success(`Node ${this.node.name} updated.`),this.onCancelClick()},error:t=>{let i=t?.error?.message||t?.message||"Failed to update node";this.toasterService.error(i)}})}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,i){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),_("input",function(a){return i.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),_("input",function(a){return i.sourcePort.set(a.target.value)}),l()(),s(16,"mat-form-field",5)(17,"mat-label"),d(18,"Destination Port"),l(),s(19,"input",6),_("input",function(a){return i.destinationPort.set(a.target.value)}),l()(),s(20,"mat-form-field",5)(21,"mat-label"),d(22,"Source DLCI"),l(),s(23,"input",6),_("input",function(a){return i.sourceDlci.set(a.target.value)}),l()(),s(24,"mat-form-field",5)(25,"mat-label"),d(26,"Destination DLCI"),l(),s(27,"input",6),_("input",function(a){return i.destinationDlci.set(a.target.value)}),l()()(),s(28,"div",8)(29,"button",9),_("click",function(){return i.add()}),d(30,"Add"),l()(),s(31,"table",10),Fe(32,11),Ce(33,xbe,2,0,"th",12)(34,bbe,2,1,"td",13),Re(),Fe(35,14),Ce(36,ybe,2,0,"th",12)(37,Sbe,2,1,"td",13),Re(),Fe(38,15),Ce(39,wbe,2,0,"th",12)(40,Mbe,4,0,"td",13),Re(),Ce(41,kbe,1,0,"tr",16)(42,Tbe,1,0,"tr",17),l()()()()(),s(43,"div",18)(44,"button",19),_("click",function(){return i.onCancelClick()}),d(45,"Cancel"),l(),s(46,"button",20),_("click",function(){return i.onSaveClick()}),d(47,"Apply"),l()()),t&2&&(m(),ee("Configurator for Frame-Relay switch ",i.name),m(9),C("value",i.nodeName()),m(5),C("value",i.sourcePort()),m(4),C("value",i.destinationPort()),m(4),C("value",i.sourceDlci()),m(4),C("value",i.destinationDlci()),m(4),C("dataSource",i.nodeMappingsDataSource),m(10),C("matHeaderRowDef",i.displayedColumns),m(),C("matRowDefColumns",i.displayedColumns))},dependencies:[ne,Je,ve,Le,Ve,kt,On,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,we,Me,Xe,Se,Te,G,pe,ze,oe,de,ht,Mt],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 M9=(()=>{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=te({token:n,factory:n.\u0275fac})}return n})();var Ebe=(n,o)=>o[1];function Dbe(n,o){if(n&1){let e=z();s(0,"mat-chip",27),_("removed",function(){let i=k(e).$implicit,r=v(2);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",28),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function Pbe(n,o){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function Ibe(n,o){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=o.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function Abe(n,o){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),K(12,Dbe,4,1,"mat-chip",null,Oe),l(),s(14,"input",14),_("matChipInputTokenEnd",function(i){k(e);let r=v();return T(r.addTag(i))}),l()(),s(15,"mat-form-field",11)(16,"mat-label"),d(17,"Console type"),l(),s(18,"mat-select",15),K(19,Pbe,2,2,"mat-option",16,Oe),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),K(33,Ibe,2,2,"mat-option",16,Ebe),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),_("click",function(){k(e);let i=v();return T(i.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=ke(11),t=v();m(2),C("formGroup",t.generalSettingsForm),m(10),Y(t.node==null?null:t.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(5),Y(t.consoleTypes),m(14),Y(t.onCloseOptions),m(5),C("formGroup",t.generalSettingsForm),m(8),C("formGroup",t.generalSettingsForm)}}var k9=(()=>{class n{dialogRef=f(Ie);dialog=f(it);nodeService=f(ut);toasterService=f(ie);formBuilder=f(Bn);virtualBoxConfigurationService=f(M9);cd=f(X);controller;node;name;generalSettingsForm;consoleTypes=[];onCloseOptions=[];separatorKeysCodes=[13,188];networkTypes=[];constructor(){this.generalSettingsForm=this.formBuilder.group({name:new $e("",je.required),console_type:new $e(""),console_auto_start:new $e(!1),ram:new $e("",je.required),on_close:new $e(""),headless:new $e(!1),use_any_adapter:new $e(!1),usage:new $e("")})}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,i=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(g=>g.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 g;if(t>0){let y=Math.floor(u/t),b=u%t;g=e.replace("{0}",String(y*t+b))}else g=e.replace("{0}",String(u));c.push({adapter_number:u,adapter_type:i,port_name:g,mac_address:""})}}this.dialog.open(Gc,{panelClass:"custom-adapters-dialog-panel",data:{adapters:c,networkTypes:this.networkTypes,portNameFormat:e,portSegmentSize:t,defaultAdapterType:i,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 i=t?.error?.message||t?.message||"Failed to update node";this.toasterService.error(i),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,i){t&1&&(s(0,"h1",1),d(1),l(),s(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-card",5),I(6,Abe,51,5,"mat-tab-group"),l()()()(),s(7,"div",6)(8,"button",7),_("click",function(){return i.onCancelClick()}),d(9,"Cancel"),l(),s(10,"button",8),_("click",function(){return i.onSaveClick()}),d(11,"Apply"),l()()),t&2&&(m(),ee("Configurator for VirtualBox VM ",i.name),m(5),A(i.name?6:-1))},dependencies:[ne,Je,rt,Nt,Uo,Dt,ot,Et,Ft,Vt,ve,Le,Ve,kt,On,ho,Wo,Go,we,Me,Xe,Ti,Se,Te,gt,Pt,ft,G,pe,oi,ei,Ci,xi,hi,oe,de,Lt,qt],encapsulation:2,changeDetection:0})}return n})();var T9=(()=>{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=te({token:n,factory:n.\u0275fac})}return n})();var Obe=(n,o)=>o[1];function Nbe(n,o){if(n&1){let e=z();s(0,"mat-chip",26),_("removed",function(){let i=k(e).$implicit,r=v(2);return T(r.removeTag(i))}),d(1),s(2,"mat-icon",27),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function Fbe(n,o){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function Rbe(n,o){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=o.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function Lbe(n,o){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),K(12,Nbe,4,1,"mat-chip",null,Oe),l(),s(14,"input",14),_("matChipInputTokenEnd",function(i){k(e);let r=v();return T(r.addTag(i))}),l()(),s(15,"mat-form-field",11)(16,"mat-label"),d(17,"Console type"),l(),s(18,"mat-select",15),K(19,Fbe,2,2,"mat-option",16,Oe),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),K(27,Rbe,2,2,"mat-option",16,Obe),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),_("click",function(){k(e);let i=v();return T(i.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=ke(11),t=v();m(2),C("formGroup",t.generalSettingsForm),m(10),Y(t.node==null?null:t.node.tags),m(2),C("matChipInputFor",e)("matChipInputSeparatorKeyCodes",t.separatorKeysCodes),m(5),Y(t.consoleTypes),m(8),Y(t.onCloseOptions),m(7),C("formGroup",t.generalSettingsForm),m(8),C("formGroup",t.generalSettingsForm)}}var E9=(()=>{class n{dialogRef=f(Ie);dialog=f(it);nodeService=f(ut);toasterService=f(ie);formBuilder=f(Bn);vmwareConfigurationService=f(T9);cd=f(X);controller;node;name;generalSettingsForm;separatorKeysCodes=[13,188];consoleTypes=[];onCloseOptions=[];networkTypes=[];constructor(){this.generalSettingsForm=this.formBuilder.group({name:new $e("",je.required),console_type:new $e(""),console_auto_start:new $e(!1),on_close:new $e(""),headless:new $e(!1),linked_clone:new $e(!1),use_any_adapter:new $e(!1),usage:new $e("")})}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,i=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(g=>g.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 g;if(t>0){let y=Math.floor(u/t),b=u%t;g=e.replace("{0}",String(y*t+b))}else g=e.replace("{0}",String(u));c.push({adapter_number:u,adapter_type:i,port_name:g,mac_address:""})}}this.dialog.open(Gc,{panelClass:"custom-adapters-dialog-panel",data:{adapters:c,networkTypes:this.networkTypes,portNameFormat:e,portSegmentSize:t,defaultAdapterType:i,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 i=t?.error?.message||t?.message||"Failed to update node";this.toasterService.error(i)}})}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,i){t&1&&(s(0,"h1",1),d(1),l(),s(2,"div",2)(3,"div",3)(4,"div",4)(5,"mat-card",5),I(6,Lbe,47,5,"mat-tab-group"),l()()()(),s(7,"div",6)(8,"button",7),_("click",function(){return i.onCancelClick()}),d(9,"Cancel"),l(),s(10,"button",8),_("click",function(){return i.onSaveClick()}),d(11,"Apply"),l()()),t&2&&(m(),ee("Configurator for VMware VM ",i.name),m(5),A(i.name?6:-1))},dependencies:[ne,Je,rt,Nt,Dt,ot,Et,Ft,Vt,ve,Le,Ve,kt,On,ho,Wo,Go,we,Me,Xe,Se,Te,gt,Pt,ft,G,pe,oi,ei,Ci,xi,hi,oe,de,Lt,qt],encapsulation:2,changeDetection:0})}return n})();function Vbe(n,o){if(n&1){let e=z();s(0,"mat-chip",17),_("removed",function(){let i=k(e).$implicit,r=v();return T(r.removeTag(i))}),d(1),s(2,"mat-icon",18),d(3,"cancel"),l()()}if(n&2){let e=o.$implicit;m(),ee(" ",e," ")}}function Bbe(n,o){if(n&1&&(s(0,"mat-option",12),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}var Nw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(ie);vpcsConfigurationService=f(Hm);cd=f(X);validationService=f(Wi);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 i=t?.error?.message||t?.message||"Failed to update node";this.toasterService.error(i),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,i){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),_("input",function(a){return i.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),K(16,Vbe,4,1,"mat-chip",null,Oe),l(),s(18,"input",10),_("matChipInputTokenEnd",function(a){return i.addTag(a)}),l()(),s(19,"mat-form-field",7)(20,"mat-label"),d(21,"Console type"),l(),s(22,"mat-select",11),_("valueChange",function(a){return i.consoleType.set(a)}),K(23,Bbe,2,2,"mat-option",12,Oe),l()(),s(25,"mat-checkbox",13),_("change",function(a){return i.consoleAutoStart.set(a.checked)}),d(26," Auto start console "),l()()()()()(),s(27,"div",14)(28,"button",15),_("click",function(){return i.onCancelClick()}),d(29,"Cancel"),l(),s(30,"button",16),_("click",function(){return i.onSaveClick()}),d(31,"Apply"),l()()),t&2){let r=ke(15);m(),ee("Configurator for VPCS node ",i.name),m(9),C("value",i.nodeName()),m(6),Y(i.node==null?null:i.node.tags),m(2),C("matChipInputFor",r)("matChipInputSeparatorKeyCodes",i.separatorKeysCodes),m(4),C("value",i.consoleType()),m(),Y(i.consoleTypes),m(2),C("checked",i.consoleAutoStart())}},dependencies:[ne,Je,ve,Le,Ve,kt,On,we,Me,Xe,Se,Te,gt,Pt,ft,G,pe,oi,ei,Ci,xi,hi,oe,de,Lt,qt],encapsulation:2,changeDetection:0})}return n})();var Fw=(()=>{class n{dialog=f(it);controller=ae(void 0);node=ae(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(Nw,this.conf):e.node_type==="ethernet_hub"?this.dialogRef=this.dialog.open(kw,this.conf):e.node_type==="ethernet_switch"?this.dialogRef=this.dialog.open(Mw,this.conf):e.node_type==="cloud"?this.dialogRef=this.dialog.open(yw,this.conf):e.node_type==="dynamips"?this.dialogRef=this.dialog.open(Tw,this.conf):e.node_type==="iou"?this.dialogRef=this.dialog.open(Ew,this.conf):e.node_type==="qemu"?this.dialogRef=this.dialog.open(Aw,Ye(Z({},this.conf),{panelClass:["base-dialog-panel","configurator-dialog-panel"]})):e.node_type==="virtualbox"?this.dialogRef=this.dialog.open(k9,this.conf):e.node_type==="vmware"?this.dialogRef=this.dialog.open(E9,this.conf):e.node_type==="docker"?this.dialogRef=this.dialog.open(ww,Ye(Z({},this.conf),{panelClass:["base-dialog-panel","configurator-dialog-panel","docker-configurator-dialog-panel"]})):e.node_type==="nat"?this.dialogRef=this.dialog.open(Dw,this.conf):e.node_type==="frame_relay_switch"?this.dialogRef=this.dialog.open(Ow,this.conf):e.node_type==="atm_switch"&&(this.dialogRef=this.dialog.open(_w,Ye(Z({},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,i){t&1&&(s(0,"button",0),_("click",function(){return i.configureNode()}),s(1,"mat-icon"),d(2,"settings_applications"),l(),s(3,"span"),d(4,"Configure"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();function zbe(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.startNodes())}),s(1,"mat-icon"),d(2,"play_arrow"),l(),s(3,"span"),d(4,"Start"),l()()}}var Rw=(()=>{class n{nodeService=f(ut);toasterService=f(ie);cdr=f(X);progressService=f(io);controller=ae(void 0);nodes=ae(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 i=t.error?.message||t.message||"Failed to start node";this.toasterService.error(i),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:[Pn],decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,i){t&1&&I(0,zbe,5,0,"button",0),t&2&&A(i.isNodeWithStoppedStatus?0:-1)},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();function jbe(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.suspendNodes())}),s(1,"mat-icon"),d(2,"pause"),l(),s(3,"span"),d(4,"Suspend"),l()()}}var Lw=(()=>{class n{nodeService=f(ut);toasterService=f(ie);cdr=f(X);controller=ae(void 0);nodes=ae(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 i=t.error?.message||t.message||"Failed to suspend node";this.toasterService.error(i),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:[Pn],decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,i){t&1&&I(0,jbe,5,0,"button",0),t&2&&A(i.isNodeWithStartedStatus?0:-1)},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();function $be(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.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(ie);cdr=f(X);progressService=f(io);controller=ae(void 0);nodes=ae(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 i=t.error?.message||t.message||"Failed to stop node";this.toasterService.error(i),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:[Pn],decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,i){t&1&&I(0,$be,5,0,"button",0),t&2&&A(i.isNodeWithStartedStatus?0:-1)},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();function Hbe(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.reloadNodes())}),s(1,"mat-icon"),d(2,"refresh"),l(),s(3,"span"),d(4,"Reload"),l()()}}var Bw=(()=>{class n{nodeService=f(ut);toasterService=f(ie);cdr=f(X);controller=ae(void 0);nodes=ae(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 i=t.error?.message||t.message||"Failed to reload node";this.toasterService.error(i),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,i){t&1&&I(0,Hbe,5,0,"button",0),t&2&&A(i.filteredNodes.length>0?0:-1)},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var gp=(()=>{class n{toasterService;constructor(e){this.toasterService=e}buildVncWebSocketUrl(e,t){return`${e.protocol==="https:"?"wss":"ws"}://${e.host}:${e.port}/${ki.current_version}/projects/${t.project_id}/nodes/${t.node_id}/console/vnc?token=${e.authToken}`}buildVncConsolePageUrl(e,t){let i=this.buildVncWebSocketUrl(e,t);return`assets/vnc-console/index.html?${new URLSearchParams({ws_url:i,node_name:t.name,node_id:t.node_id,project_id:t.project_id,autoconnect:"1"}).toString()}`}openVncConsole(e,t,i=!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 y=h.console_resolution.split("x");y.length===2&&(c=parseInt(y[0],10)+a,p=parseInt(y[1],10)+a)}}let u;if(i)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(ie))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var zw=(()=>{class n{nodeConsoleService=f(mr);vncConsoleService=f(gp);toasterService=f(ie);router=f(_t);mapSettingsService=f(_o);cdr=f(X);controller=ae(void 0);project=ae(void 0);nodes=ae(void 0);openWebConsoleInline=new _e;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(),i=this.project();if(!(!t||!i)){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:i}):e.console_type==="telnet"||e.console_type==="ssh"||e.console_type==="docker_exec"?(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,i){t&1&&(s(0,"button",0),_("click",function(){return i.openConsole()}),s(1,"mat-icon"),d(2,"web_asset"),l(),s(3,"span"),d(4,"Web console (Inline)"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var jw=(()=>{class n{nodeConsoleService=f(mr);vncConsoleService=f(gp);toasterService=f(ie);router=f(_t);controller=ae(void 0);nodes=ae(void 0);openConsole(){let e="",t=0;this.nodes().forEach(i=>{if(i.console_type!=="none")if(i.status==="started")if(i.console_type==="vnc")this.vncConsoleService.openVncConsole(this.controller(),i,!0);else if(i.console_type&&i.console_type.startsWith("http")){(i.console_host==="0.0.0.0"||i.console_host==="0:0:0:0:0:0:0:0"||i.console_host==="::")&&(i.console_host=this.controller().host);let r=`${i.console_type}://${i.console_host}:${i.console}`;window.open(r,"_blank")}else if(i.console_type==="telnet"||i.console_type==="ssh"||i.console_type==="docker_exec"){let r=this.router.url.split("/"),a=`/static/web-ui/${r[1]}/${r[2]}/${r[3]}/${r[4]}/nodes/${i.node_id}`;window.open(a,"_blank")}else this.toasterService.error(`Console type '${i.console_type}' not supported in new tab for node ${i.name}.`);else t++,e+=i.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,i){t&1&&(s(0,"button",0),_("click",function(){return i.openConsole()}),s(1,"mat-icon"),d(2,"http"),l(),s(3,"span"),d(4,"Web console in new tab"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var sg={UKNOWN:"Unknown"},dO={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:sg.UKNOWN},$w={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`)},ag={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`)},_p={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:sg.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"},D9=[_p.PS4,_p.CHROME_BOOK,_p.MAC,_p.DELL,_p.ASUS,_p.UNKNOWN],Ube={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:sg.UKNOWN},Wbe={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:sg.UKNOWN.toLowerCase()},P9={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/},Gbe={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/},qbe=Ye(Z(Z(Z({},$w),ag),P9),{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/]}}]}}),aO={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)/},sO={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/},Qbe=Object.keys(aO).reduce((n,o)=>(n[o]=aO[o],n),{}),I9=Object.keys(sO).reduce((n,o)=>(n[dO[o]]=sO[o],n),{}),ld=Object.freeze({__proto__:null,GENERAL:sg,BROWSERS:dO,MOBILES_RE:$w,TABLETS_RE:ag,DEVICES:_p,DESKTOP_DEVICES:D9,OS:Ube,OS_VERSIONS:Wbe,OS_RE:P9,BROWSERS_RE:Gbe,DEVICES_RE:qbe,OS_VERSIONS_RE_MAP:aO,BROWSER_VERSIONS_RE_MAP:sO,OS_VERSIONS_RE:Qbe,BROWSER_VERSIONS_RE:I9}),lO=class{constructor(){}test(o,e){return typeof e=="string"&&(e=new RegExp(e)),e instanceof RegExp?e.test(o):e&&Array.isArray(e.and)?e.and.every(t=>this.test(o,t)):e&&Array.isArray(e.or)?e.or.some(t=>this.test(o,t)):e&&e.not?!this.test(o,e.not):!1}exec(o,e){return typeof e=="string"&&(e=new RegExp(e)),e instanceof RegExp?e.exec(o):e&&Array.isArray(e)?e.reduce((t,i)=>t||this.exec(o,i),null):null}},Wv=(function(n){return n.Mobile="mobile",n.Tablet="tablet",n.Desktop="desktop",n.Unknown="unknown",n})(Wv||{}),cO=(function(n){return n.Portrait="portrait",n.Landscape="landscape",n})(cO||{}),rO="iPad",Hw=(()=>{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 lO,this.deviceType="",this.orientation="",Ts(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(i=>{this[i.prop]=Object.keys(ld[i.const]).reduce((r,a)=>ld[i.const][a]==="device"&&Ts(this.platformId)&&(this.reTree.test(this.userAgent,ag[rO])||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)?(r[ld[i.const][a]]=rO,Object):(r[ld[i.const][a]]=this.reTree.test(e,ld[`${i.const}_RE`][a]),r),{})}),t.forEach(i=>{this[i.prop]=Object.keys(ld[i.const]).map(r=>ld[i.const][r]).reduce((r,a)=>i.prop==="device"&&r===ld[i.const].ANDROID?this[i.prop][a]?a:r:r===ld[i.const].UNKNOWN&&this[i.prop][a]?a:r,ld[i.const].UNKNOWN)}),this.browser_version="0",this.browser!==dO.UNKNOWN){let i=I9[this.browser],r=this.reTree.exec(e,i);r&&(this.browser_version=r[1])}typeof window<"u"&&window.matchMedia?this.orientation=window.matchMedia("(orientation: landscape)").matches?cO.Landscape:cO.Portrait:this.orientation=sg.UKNOWN,this.deviceType=this.isTablet()?Wv.Tablet:this.isMobile(this.userAgent)?Wv.Mobile:this.isDesktop(this.userAgent)?Wv.Desktop:Wv.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($w).find(i=>this.reTree.test(e,$w[i]))}isTablet(e=this.userAgent){return Ts(this.platformId)&&(this.reTree.test(this.userAgent,ag[rO])||typeof navigator<"u"&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)?!0:!!Object.keys(ag).find(i=>!!this.reTree.test(e,ag[i]))}isDesktop(e=this.userAgent){return this.device===_p.UNKNOWN&&(this.isMobile(e)||this.isTablet(e))?!1:D9.indexOf(this.device)>-1}}return n.\u0275fac=function(e){return new(e||n)(ge(Gu))},n.\u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();var vp=(()=>{class n{toasterService;deviceService;loginService;constructor(e,t,i){this.toasterService=e,this.deviceService=t,this.loginService=i}createHiddenIframe(e,t){let i=document.createElement("iframe");return i.src=t,i.id="hiddenIframe",i.style.display="none",e.appendChild(i),i}openUriUsingFirefox(e){var t=document.querySelector("#hiddenIframe");t||(t=this.createHiddenIframe(document.body,"about:blank"));try{t.contentWindow.location.href=e}catch(i){i.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(ie),ge(Hw),ge(vl))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var O9=Gs(mO());function Ybe(n,o){if(n&1){let e=z();s(0,"button",0),_("click",function(){k(e);let i=v();return T(i.openConsole(i.auxiliary=!0))}),s(1,"mat-icon"),d(2,"web_asset"),l(),s(3,"span"),d(4,"Auxiliary console"),l()()}}var lg=(()=>{class n{toasterService=f(ie);nodeService=f(ut);deviceService=f(Hw);protocolHandlerService=f(vp);cd=f(X);controller=ae(void 0);node=ae(void 0);updatedNode=Q(void 0);openConsole(e=!1){let t=this.node();t&&this.nodeService.getNode(this.controller(),t).subscribe({next:i=>{this.updatedNode.set(i),this.cd.markForCheck(),this.startConsole(e)},error:i=>{let r=i.error?.message||i.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=Ye(Z({},t),{console_host:this.controller().host}),this.updatedNode.set(t));try{var i,r=t.console_host;if(O9.IPv6.isValid(r)&&(r=`[${r}]`),t.console_type==="telnet"||t.console_type==="ssh"||t.console_type==="docker_exec"){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;i=`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")i=`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"))i=`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 i=`${t.console_type}://${r}:${t.console}`,window.open(i);this.toasterService.error("Supported console types are: telnet, ssh, vnc, spice and spice+agent.");return}this.protocolHandlerService.open(i)}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,i){if(t&1&&(s(0,"button",0),_("click",function(){return i.openConsole()}),s(1,"mat-icon"),d(2,"web_asset"),l(),s(3,"span"),d(4,"Console"),l()(),I(5,Ybe,5,0,"button",1)),t&2){let r;m(5),A(((r=i.node())==null?null:r.node_type)==="docker"||((r=i.node())==null?null:r.node_type)==="dynamips"||((r=i.node())==null?null:r.node_type)==="qemu"?5:-1)}},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var Ww=(()=>{class n{nodeService=f(ut);toasterService=f(ie);cdr=f(X);controller=ae(void 0);node=ae(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,i){t&1&&(s(0,"button",0),_("click",function(){return i.isolate()}),s(1,"mat-icon"),d(2,"gps_off"),l(),s(3,"span"),d(4,"Isolate"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var Gw=(()=>{class n{nodeService=f(ut);toasterService=f(ie);cdr=f(X);controller=ae(void 0);node=ae(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,i){t&1&&(s(0,"button",0),_("click",function(){return i.unisolate()}),s(1,"mat-icon"),d(2,"gps_not_fixed"),l(),s(3,"span"),d(4,"Un-isolate"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var qw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(ie);formBuilder=f(Bn);cd=f(X);controller;node;inputForm;name;constructor(){this.name="",this.inputForm=this.formBuilder.group({name:new $e("",je.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 i=t.error?.message||t.message||"Failed to update node.";this.toasterService.error(i),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,i){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),_("click",function(){return i.onCancelClick()}),d(10,"Cancel"),l(),s(11,"button",7),_("click",function(){return i.onSaveClick()}),d(12,"Apply"),l()()()),t&2&&(m(2),ee("Change hostname for node ",i.name),m(),C("formGroup",i.inputForm))},dependencies:[ve,G,pe,Se,Te,Me,Xe,we,kt,Et,rt,Nt,Dt,ot,Ft,Vt],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 Qw=(()=>{class n{dialog=f(it);controller=ae(void 0);node=ae(void 0);changeHostname(){let t=this.dialog.open(qw,{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,i){t&1&&(s(0,"button",0),_("click",function(){return i.changeHostname()}),s(1,"mat-icon"),d(2,"edit"),l(),s(3,"span"),d(4,"Change hostname"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var Xw=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(ie);cd=f(X);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,i){t&1&&(s(0,"h1",0),d(1),l(),s(2,"div",1)(3,"app-symbols",2),_("symbolChanged",function(a){return i.symbolChanged(a)}),l()(),s(4,"div",3)(5,"button",4),_("click",function(){return i.onCloseClick()}),d(6,"Cancel"),l(),s(7,"button",5),_("click",function(){return i.onSelectClick()}),d(8,"Apply"),l()()),t&2&&(m(),ee("Change symbol for node: ",i.node.name),m(2),C("controller",i.controller)("symbol",i.symbol))},dependencies:[ve,Le,Ve,G,pe,Fm],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 Kw=(()=>{class n{dialog=f(it);dialogConfig=f(go);controller=ae(void 0);node=ae(void 0);changeSymbol(){let e=this.dialogConfig.openConfig("changeSymbol",{autoFocus:!1,disableClose:!1}),i=this.dialog.open(Xw,e).componentInstance;i.controller=this.controller(),i.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,i){t&1&&(s(0,"button",0),_("click",function(){return i.changeSymbol()}),s(1,"mat-icon"),d(2,"find_replace"),l(),s(3,"span"),d(4,"Change symbol"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var Yw=(()=>{class n{nodeService=f(ut);nodesDataSource=f(ui);drawingService=f(ji);drawingsDataSource=f(zi);toasterService=f(ie);cdr=f(X);controller=ae(void 0);project=ae(void 0);drawings=ae([]);nodes=ae([]);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 i=t.error?.message||t.message||"Failed to duplicate node";this.toasterService.error(i)}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 i=t.error?.message||t.message||"Failed to duplicate drawing";this.toasterService.error(i),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,i){t&1&&(s(0,"button",0),_("click",function(){return i.duplicate()}),s(1,"mat-icon"),d(2,"filter_none"),l(),s(3,"span"),d(4,"Duplicate"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var Ss=(()=>{class n{constructor(){}getCurveInterpolator(e){switch(e){case"basis":return Nv;case"catmullrom":return Ru;case"monotone":return Fv;default:return Ru}}convert(e){let t="";if(e.element instanceof Or)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 wi)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 Oa){let i=e.element,r=i.arrow_start?' marker-start="url(#line-start)"':"",a=i.arrow_end?' marker-end="url(#line-end)"':"",c=i.control_offset?` data-control-offset="${i.control_offset.join(",")}"`:"";t=`<line stroke="${i.stroke}" stroke-width="${i.stroke_width}" x1="${i.x1}" x2="${i.x2}" y1="${i.y1}" y2="${i.y2}" stroke-dasharray="${i.stroke_dasharray??"none"}"${r}${a} data-drawing-type="${i.drawing_type??"straight"}" data-arrow-start="${i.arrow_start??!1}" data-arrow-end="${i.arrow_end??!1}"${c} />`}else if(e.element instanceof va){let i=e.element,r=i.points.map(p=>[p.x,p.y]);t=`<path d="${Fu().curve(this.getCurveInterpolator(i.curve_type||"catmullrom"))(r)||""}" stroke="${i.stroke}" stroke-width="${i.stroke_width}" stroke-dasharray="${i.stroke_dasharray??"none"}" fill="none" data-curve-type="${i.curve_type??"catmullrom"}" data-arrow-start="${i.arrow_start}" data-arrow-end="${i.arrow_end}" />`}else if(e.element instanceof ys)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=te({token:n,factory:n.\u0275fac})}return n})();var Cp=(()=>{class n{get(e){return+e.value>=0?null:{negativeValue:!0}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var cg=(()=>{class n{get(e){return+e.value>-360&&+e.value<=360?null:{negativeValue:!0}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Gv=(n,o)=>o.value;function Zbe(n,o){if(n&1){let e=z();s(0,"mat-form-field",3)(1,"mat-label"),d(2,"Fill color"),l(),s(3,"input",4),_("input",function(i){k(e);let r=v();return T(r.onFillChange(i.target.value))}),l()()}if(n&2){let e=v();m(3),C("value",e.element.fill)}}function Jbe(n,o){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=o.$implicit;C("value",e.value),m(),ee(" ",e.name," ")}}function eye(n,o){if(n&1){let e=z();s(0,"mat-form-field",3)(1,"mat-label"),d(2,"Width"),l(),s(3,"input",12),_("input",function(i){k(e);let r=v();return T(r.onWidthChange(+i.target.value))}),l()()}if(n&2){let e=v();m(3),C("value",e.element.width)}}function tye(n,o){if(n&1){let e=z();s(0,"mat-form-field",3)(1,"mat-label"),d(2,"Height"),l(),s(3,"input",12),_("input",function(i){k(e);let r=v();return T(r.onHeightChange(+i.target.value))}),l()()}if(n&2){let e=v();m(3),C("value",e.element.height)}}function nye(n,o){if(n&1){let e=z();s(0,"mat-form-field",8)(1,"mat-label"),d(2,"Corner radius"),l(),s(3,"input",13),_("input",function(i){k(e);let r=v();return T(r.onRxChange(+i.target.value))}),l()()}if(n&2){let e=v();m(3),C("value",e.element.rx)}}function iye(n,o){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=o.$implicit;C("value",e.value),m(),ee(" ",e.name," ")}}function oye(n,o){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=o.$implicit;C("value",e.value),m(),ee(" ",e.name," ")}}function rye(n,o){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),_("selectionChange",function(i){k(e);let r=v();return T(r.onCurveTypeChange(i.value))}),K(4,iye,2,2,"mat-option",7,Gv),l()(),s(6,"mat-form-field",3)(7,"mat-label"),d(8,"Arrow direction"),l(),s(9,"mat-select",6),_("selectionChange",function(i){k(e);let r=v();return T(r.onArrowDirectionChange(i.value))}),K(10,oye,2,2,"mat-option",7,Gv),l()()}if(n&2){let e=v();m(3),C("value",e.element.curve_type),m(),Y(e.curveTypes),m(5),C("value",e.element.arrow_direction),m(),Y(e.arrowDirections)}}function aye(n,o){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=o.$implicit;C("value",e.value),m(),ee(" ",e.name," ")}}function sye(n,o){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=o.$implicit;C("value",e.value),m(),ee(" ",e.name," ")}}function lye(n,o){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),_("selectionChange",function(i){k(e);let r=v();return T(r.onLineArrowDirectionChange(i.value))}),K(4,aye,2,2,"mat-option",7,Gv),l()(),s(6,"mat-form-field",3)(7,"mat-label"),d(8,"Drawing type"),l(),s(9,"mat-select",6),_("selectionChange",function(i){k(e);let r=v();return T(r.onLineDrawingTypeChange(i.value))}),K(10,sye,2,2,"mat-option",7,Gv),l()()}if(n&2){let e=v();m(3),C("value",e.element.line_arrow_direction),m(),Y(e.arrowDirections),m(5),C("value",e.element.line_drawing_type),m(),Y(e.lineDrawingTypes)}}function cye(n,o){n&1&&(s(0,"mat-form-field",8)(1,"mat-label"),d(2,"Rotation"),l(),R(3,"input",14),l())}var Zw=(()=>{class n{dialogRef=f(Ie);drawingToMapDrawingConverter=f(Ym);mapDrawingToSvgConverter=f(Ss);drawingService=f(ji);drawingsDataSource=f(zi);formBuilder=f(Bn);toasterService=f(ie);nonNegativeValidator=f(Cp);rotationValidator=f(cg);qtDasharrayFixer=f(id);cd=f(X);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 $e("",[je.required,this.nonNegativeValidator.get]),rotation:new $e("",[je.required,this.rotationValidator.get])})}ngOnInit(){let e;this.element=new pO,this.drawing.element instanceof Or||this.drawing.element instanceof wi?(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 Oa?(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 va&&(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 Or&&(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 Or||this.drawing.element instanceof wi?(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 Oa?(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 va&&(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 Or?(this.drawing.element.rx=this.element.rx,this.drawing.element.ry=this.element.rx):this.drawing.element instanceof wi&&(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 i=t.error?.message||t.message||"Failed to update drawing";this.toasterService.error(i),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,i){t&1&&(s(0,"h1",0),d(1,"Style editor"),l(),s(2,"div",1)(3,"form",2),I(4,Zbe,4,1,"mat-form-field",3),s(5,"mat-form-field",3)(6,"mat-label"),d(7,"Border color"),l(),s(8,"input",4),_("input",function(a){return i.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),_("selectionChange",function(a){return i.onStrokeDasharrayChange(a.value)}),K(17,Jbe,2,2,"mat-option",7,Gv),l()(),I(19,eye,4,1,"mat-form-field",3),I(20,tye,4,1,"mat-form-field",3),I(21,nye,4,1,"mat-form-field",8),I(22,rye,12,2),I(23,lye,12,2),I(24,cye,4,0,"mat-form-field",8),l()(),s(25,"div",9)(26,"button",10),_("click",function(){return i.onNoClick()}),d(27,"Cancel"),l(),s(28,"button",11),_("click",function(){return i.onYesClick()}),d(29,"Apply"),l()()),t&2&&(m(3),C("formGroup",i.formGroup),m(),A(i.element.fill!==void 0?4:-1),m(4),C("value",i.element.stroke),m(8),C("value",i.element.stroke_dasharray),m(),Y(i.borderTypes),m(2),A(i.element.width!==void 0?19:-1),m(),A(i.element.height!==void 0?20:-1),m(),A(i.element.rx!==void 0?21:-1),m(),A(i.element.curve_type!==void 0?22:-1),m(),A(i.element.line_arrow_direction!==void 0?23:-1),m(),A(i.element.line_drawing_type===void 0||i.element.line_drawing_type==="straight"?24:-1))},dependencies:[ne,Et,rt,Nt,Uo,Dt,ot,gc,nh,Ft,Vt,ve,Le,Ve,we,Me,Xe,Se,Te,gt,Pt,ft,Vo,G,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})(),pO=class{fill;width;height;stroke;stroke_width;stroke_dasharray;rx;ry;curve_type;arrow_direction;line_arrow_direction;line_drawing_type};function dye(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.editStyle())}),s(1,"mat-icon"),d(2,"style"),l(),s(3,"span"),d(4,"Edit style"),l()()}}var Jw=(()=>{class n{dialog=f(it);controller=ae(void 0);project=ae(void 0);drawing=ae(void 0);isImageDrawing=!1;constructor(){}ngOnChanges(){let e=this.drawing();this.isImageDrawing=e?.element instanceof nd}editStyle(){let t=this.dialog.open(Zw,{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:[Pn],decls:1,vars:1,consts:[["mat-menu-item",""],["mat-menu-item","",3,"click"]],template:function(t,i){t&1&&I(0,dye,5,0,"button",0),t&2&&A(!i.isImageDrawing&&i.drawing()?0:-1)},dependencies:[ve,qe,tt,oe,de],encapsulation:2,changeDetection:0})}return n})();var mye=["textArea"],e2=(()=>{class n{textArea=Rt("textArea");dialogRef=f(Ie);drawingToMapDrawingConverter=f(Ym);mapDrawingToSvgConverter=f(Ss);drawingService=f(ji);drawingsDataSource=f(zi);renderer=f(Si);nodeService=f(ut);nodesDataSource=f(ui);linkService=f(Pi);linksDataSource=f(qo);formBuilder=f(Bn);toasterService=f(ie);rotationValidator=f(cg);fontFixer=f(ra);cdr=f(X);controller;project;drawing;node;label;link;linkNode;element;rotation;isTextEditable;formGroup;constructor(){}ngOnInit(){this.formGroup=this.formBuilder.group({rotation:new $e("",[je.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(i=>i.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 ys;for(var i of this.label.style.split(";"))e.push({property:i.split(": ")[0],value:i.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 i=t.error?.message||t.message||"Failed to update drawing";this.toasterService.error(i),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,i){t&1&&Xt(i.textArea,mye,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,i){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),_("input",function(c){return i.changeTextColor(c.target.value)}),l()(),s(8,"mat-form-field")(9,"mat-label"),d(10,"Font family"),l(),s(11,"mat-select",5),uc("valueChange",function(c){return k(r),pc(i.element.font_family,c)||(i.element.font_family=c),T(c)}),_("selectionChange",function(c){return i.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),_("input",function(c){return i.changeFontSize(c.target.value)}),l()(),s(32,"mat-form-field")(33,"mat-label"),d(34,"Font weight"),l(),s(35,"mat-select",5),uc("valueChange",function(c){return k(r),pc(i.element.font_weight,c)||(i.element.font_weight=c),T(c)}),_("selectionChange",function(c){return i.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),uc("valueChange",function(c){return k(r),pc(i.element.text_decoration,c)||(i.element.text_decoration=c),T(c)}),_("selectionChange",function(c){return i.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),_("input",function(c){return i.onTextChange(c.target.value)}),l()()()(),s(82,"div",36)(83,"button",37),_("click",function(){return i.onNoClick()}),d(84,"Cancel"),l(),s(85,"button",38),_("click",function(){return i.onYesClick()}),d(86,"Apply"),l()()}t&2&&(m(7),C("value",i.element.fill),m(4),mc("value",i.element.font_family),m(20),C("value",i.element.font_size),m(4),mc("value",i.element.font_weight),m(30),mc("value",i.element.text_decoration),m(9),C("formGroup",i.formGroup),m(6),C("value",i.element.text)("readonly",!i.isTextEditable))},dependencies:[ne,Et,rt,Nt,Dt,ot,Ft,Vt,ve,Le,Ve,St,we,Me,Xe,Se,Te,G,pe,gt,Pt,ft,Vo],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 t2=(()=>{class n{dialog=f(it);controller=ae(void 0);project=ae(void 0);drawing=ae(void 0);node=ae(void 0);label=ae(void 0);link=ae(void 0);linkNode=ae(void 0);editText(){let t=this.dialog.open(e2,{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,i){t&1&&(s(0,"button",0),_("click",function(){return i.editText()}),s(1,"mat-icon"),d(2,"text_format"),l(),s(3,"span"),d(4,"Edit text"),l()())},dependencies:[ve,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();function pye(n,o){if(n&1){let e=z();s(0,"div",2)(1,"textarea",6,0),_("input",function(i){k(e);let r=v();return T(r.onConfigChange(i.target.value))}),l()()}if(n&2){let e=v();m(),C("value",e.config())}}function uye(n,o){if(n&1){let e=z();s(0,"mat-tab-group")(1,"mat-tab",7)(2,"textarea",8,0),_("input",function(i){k(e);let r=v();return T(r.onConfigChange(i.target.value))}),l()(),s(4,"mat-tab",9)(5,"textarea",8,0),_("input",function(i){k(e);let r=v();return T(r.onPrivateConfigChange(i.target.value))}),l()()()}if(n&2){let e=v();m(2),C("value",e.config()),m(3),C("value",e.privateConfig())}}var n2=(()=>{class n{dialogRef=f(Ie);nodeService=f(ut);toasterService=f(ie);cdr=f(X);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 i=t.error?.message||t.message||"Failed to save private configuration";this.toasterService.error(i),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,i){t&1&&(s(0,"h1",1),d(1),l(),I(2,pye,3,1,"div",2),I(3,uye,7,2,"mat-tab-group"),s(4,"div",3)(5,"button",4),_("click",function(){return i.onCancelClick()}),d(6,"Cancel"),l(),s(7,"button",5),_("click",function(){return i.onSaveClick()}),d(8,"Apply"),l()()),t&2&&(m(),ee("Configuration for node ",i.node.name),m(),A(i.node.node_type==="vpcs"?2:-1),m(),A(i.node.node_type==="iou"||i.node.node_type==="dynamips"?3:-1))},dependencies:[ve,Le,Ve,G,pe,dn],styles:[".textArea[_ngcontent-%COMP%]{width:100%;height:350px}.textAreaTab[_ngcontent-%COMP%]{width:100%;height:300px}"],changeDetection:0})}return n})();function hye(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.editConfig())}),s(1,"mat-icon"),d(2,"settings"),l(),s(3,"span"),d(4,"Edit config"),l()()}}var i2=(()=>{class n{dialog=f(it);controller=ae(void 0);project=ae(void 0);node=ae(void 0);editConfig(){let t=this.dialog.open(n2,{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,i){if(t&1&&I(0,hye,5,0,"button",0),t&2){let r;A(((r=i.node())==null?null:r.node_type)==="vpcs"||((r=i.node())==null?null:r.node_type)==="iou"||((r=i.node())==null?null:r.node_type)==="dynamips"?0:-1)}},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var dg=(()=>{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,i){t&1&&(s(0,"h1",0),d(1,"Choose configuration file"),l(),s(2,"div",1)(3,"div",2)(4,"button",3),_("click",function(){return i.close("startup-config")}),d(5,"Startup configuration"),l(),s(6,"button",3),_("click",function(){return i.close("private-config")}),d(7,"Private configuration"),l()()(),s(8,"div",4)(9,"button",5),_("click",function(){return i.onClose()}),d(10,"Cancel"),l()())},dependencies:[ve,Le,Ve,St,G,pe],styles:[".config-options[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;padding:8px 0}"],changeDetection:0})}return n})();function fye(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.exportConfig())}),s(1,"mat-icon"),d(2,"call_made"),l(),s(3,"span"),d(4,"Export config"),l()()}}var o2=(()=>{class n{nodeService=f(ut);dialog=f(it);toasterService=f(ie);cdr=f(X);controller=ae(void 0);node=ae(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 i=t.error?.message||t.message||"Failed to export configuration";this.toasterService.error(i),this.cdr.markForCheck()}});else{let t=this.dialog.open(dg,{panelClass:["base-dialog-panel","export-config-action-dialog-panel"],autoFocus:!1,disableClose:!1}),i=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,i){if(t&1&&I(0,fye,5,0,"button",0),t&2){let r;A(((r=i.node())==null?null:r.node_type)==="vpcs"||((r=i.node())==null?null:r.node_type)==="dynamips"||((r=i.node())==null?null:r.node_type)==="iou"?0:-1)}},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var gye=["fileInput"],r2=(()=>{class n{nodeService=f(ut);toasterService=f(ie);dialog=f(it);cdr=f(X);controller=ae(void 0);node=ae(void 0);fileInput=Rt("fileInput");configType;triggerClick(){if(this.fileInput().nativeElement.value="",this.node().node_type!=="vpcs"){let e=this.dialog.open(dg,{panelClass:["base-dialog-panel","import-config-action-dialog-panel"],autoFocus:!1,disableClose:!1}),t=e.componentInstance;e.afterClosed().subscribe({next:i=>{this.configType=i,this.cdr.markForCheck(),this.fileInput().nativeElement.click()},error:i=>{let r=i.error?.message||i.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],i=new FileReader;i.onload=r=>{let a=i.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")},i.readAsText(t)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-import-config-action"]],viewQuery:function(t,i){t&1&&Xt(i.fileInput,gye,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,i){t&1&&(s(0,"input",1,0),_("change",function(a){return i.importConfig(a)}),l(),s(2,"button",2),_("click",function(){return i.triggerClick()}),s(3,"mat-icon"),d(4,"call_received"),l(),s(5,"span"),d(6,"Import config"),l()())},dependencies:[G,oe,de,qe,tt],styles:[".non-visible[_ngcontent-%COMP%]{display:none}"],changeDetection:0})}return n})();var _ye=(n,o)=>o.key;function vye(n,o){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 Cye(n,o){if(n&1&&(s(0,"mat-option",9),d(1),l()),n&2){let e=o.$implicit;C("value",e.key),m(),ee(" ",e.name," ")}}function xye(n,o){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),_("selectionChange",function(i){k(e);let r=v();return T(r.idlePC.set(i.value))}),K(4,Cye,2,2,"mat-option",9,_ye),l()()}if(n&2){let e=v();m(3),C("value",e.idlePC())("matTooltip",e.getTooltip()),m(),Y(e.idlepcs)}}function bye(n,o){if(n&1){let e=z();s(0,"button",2),_("click",function(){k(e);let i=v();return T(i.onCompute())}),d(1,"Compute"),l()}}function yye(n,o){if(n&1){let e=z();s(0,"button",2),_("click",function(){k(e);let i=v();return T(i.onApply())}),d(1,"Apply"),l()}}var a2=(()=>{class n{nodeService=f(ut);dialogRef=f(Ie);toasterService=f(ie);cd=f(X);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 i of e){let r=i.match(/^(0x[0-9a-f]{8})\s+\[(\d+)\]$/);if(r){let a=r[1],c=parseInt(r[2],10);50<=c&&c<=60&&(i+="*"),t.push({key:a,name:i})}}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,i){t&1&&(I(0,vye,5,0,"div"),I(1,xye,6,2),s(2,"div",0),I(3,bye,2,0,"button",1),I(4,yye,2,0,"button",1),s(5,"button",2),_("click",function(){return i.onClose()}),d(6,"Close"),l()()),t&2&&(A(i.isComputing?0:-1),m(),A(i.isComputing?-1:1),m(2),A(i.isComputing?-1:3),m(),A(i.isComputing?-1:4))},dependencies:[ve,Le,Ve,St,G,pe,dn,qn,Se,Me,oo,gt,Pt,ft,Je],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 Sye(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.idlePC())}),s(1,"mat-icon"),d(2,"query_builder"),l(),s(3,"span"),d(4,"Idle-PC"),l()()}}var s2=(()=>{class n{nodeService=f(ut);dialog=f(it);controller=ae(void 0);node=ae(void 0);idlePC(){let t=this.dialog.open(a2,{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,i){if(t&1&&I(0,Sye,5,0,"button",0),t&2){let r;A(((r=i.node())==null?null:r.node_type)==="dynamips"?0:-1)}},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();function wye(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.autoIdlePC())}),s(1,"mat-icon"),d(2,"query_builder"),l(),s(3,"span"),d(4,"Auto Idle-PC"),l()()}}var l2=(()=>{class n{nodeService=f(ut);toasterService=f(ie);progressService=f(io);cdr=f(X);controller=ae(void 0);node=ae(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,i){if(t&1&&I(0,wye,5,0,"button",0),t&2){let r;A(((r=i.node())==null?null:r.node_type)==="dynamips"?0:-1)}},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var c2=(()=>{class n{nodesDataSource=f(ui);drawingsDataSource=f(zi);nodeService=f(ut);drawingService=f(ji);toasterService=f(ie);cdr=f(X);controller=ae(void 0);nodes=ae(void 0);drawings=ae(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 i=t.error?.message||t.message||"Failed to move layer up";this.toasterService.error(i),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 i=t.error?.message||t.message||"Failed to move layer up";this.toasterService.error(i),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,i){t&1&&(s(0,"button",0),_("click",function(){return i.moveLayerUp()}),s(1,"mat-icon"),d(2,"keyboard_arrow_up"),l(),s(3,"span"),d(4,"Move layer up"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var d2=(()=>{class n{nodesDataSource=f(ui);drawingsDataSource=f(zi);nodeService=f(ut);drawingService=f(ji);toasterService=f(ie);cdr=f(X);controller=ae(void 0);nodes=ae(void 0);drawings=ae(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 i=t.error?.message||t.message||"Failed to move layer down";this.toasterService.error(i),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 i=t.error?.message||t.message||"Failed to move layer down";this.toasterService.error(i),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,i){t&1&&(s(0,"button",0),_("click",function(){return i.moveLayerDown()}),s(1,"mat-icon"),d(2,"keyboard_arrow_down"),l(),s(3,"span"),d(4,"Move layer down"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var m2=(()=>{class n{nodesDataSource=f(ui);drawingsDataSource=f(zi);nodeService=f(ut);drawingService=f(ji);toasterService=f(ie);cdr=f(X);controller=ae(void 0);nodes=ae([]);drawings=ae([]);bringToFront(){let e=Math.max(...this.nodes().map(r=>r.z)),t=Math.max(...this.drawings().map(r=>r.z)),i=Math.max(e,t);i<100&&i++,this.nodes().forEach(r=>{r.z=i,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=i,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,i){t&1&&(s(0,"button",0),_("click",function(){return i.bringToFront()}),s(1,"mat-icon"),d(2,"vertical_align_top"),l(),s(3,"span"),d(4,"Bring to front"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var mg=(()=>{class n{protocolHandlerService;constructor(e){this.protocolHandlerService=e}startCapture(e,t,i,r){let a=`gns3+pcap://${e.host}:${e.port}?protocol=${e.protocol.slice(0,-1)}&project_id=${t.project_id}&link_id=${i.link_id}&project=${t.name}&name=${r}`;this.protocolHandlerService.open(a)}static \u0275fac=function(t){return new(t||n)(ge(vp))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Mye=(n,o)=>o[1];function kye(n,o){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),B(e.loadingMessage())}}function Tye(n,o){if(n&1&&(s(0,"div",7)(1,"p"),d(2),l()()),n&2){let e=v(2);m(2),B(e.errorMessage())}}function Eye(n,o){if(n&1&&(s(0,"mat-option",12),d(1),l()),n&2){let e=o.$implicit;C("value",e[1]),m(),ee(" ",e[0]," ")}}function Dye(n,o){if(n&1){let e=z();I(0,Tye,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),K(9,Eye,2,2,"mat-option",12,Mye),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),_("change",function(i){k(e);let r=v();return T(r.startProgram.set(i.checked))}),d(16," Start the capture visualization program "),l(),s(17,"mat-checkbox",14),_("change",function(i){k(e);let r=v();return T(r.webWireshark.set(i.checked))}),d(18," Web Wireshark "),l()()(),s(19,"div",4)(20,"button",15),_("click",function(){k(e);let i=v();return T(i.onNoClick())}),d(21,"Cancel"),l(),s(22,"button",16),_("click",function(){k(e);let i=v();return T(i.onYesClick())}),d(23,"Ok"),l()()}if(n&2){let e=v();A(e.errorMessage()?0:-1),m(4),C("formGroup",e.inputForm),m(5),Y(e.linkTypes),m(6),C("checked",e.startProgram()),m(2),C("checked",e.webWireshark())}}var p2=(()=>{class n{controller;project;link;linkTypes=[];inputForm;startProgram=U(!1);webWireshark=U(!1);isLoading=Q(!1);loadingMessage=Q("");errorMessage=Q("");dialogRef=f(Ie);linkService=f(Pi);formBuilder=f(Bn);toasterService=f(ie);nodesDataSource=f(ui);linksDataSource=f(qo);packetCaptureService=f(mg);constructor(){this.inputForm=this.formBuilder.group({linkType:new $e("",je.required),fileName:new $e("",je.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),i=this.link.nodes[0].label.text,r=this.link.nodes[1].label.text,a=`${e.name}_${i}_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(i=>{this.nodesDataSource.get(i.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:i=>{this.linksDataSource.update(i),this.startProgram()&&this.packetCaptureService.startCapture(this.controller,this.project,this.link,t.capture_file_name),this.isLoading.set(!1),this.dialogRef.close()},error:i=>{if(this.isLoading.set(!1),i.status===409){let r=i.error?.message||i.error?.detail||i.message;this.errorMessage.set(r||"A packet capture is already running on this link. Please stop the existing capture first.")}else i.status===404?this.errorMessage.set("The link or controller could not be found. Please refresh the page and try again."):i.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: ${i.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:i=>{this.linksDataSource.update(i),this.dialogRef.close()},error:i=>{let r=i.error?.message||i.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,i){t&1&&I(0,kye,11,1)(1,Dye,24,4),t&2&&A(i.isLoading()?0:1)},dependencies:[ne,Et,rt,Nt,Dt,ot,Ft,Vt,ve,Le,Ve,St,G,pe,we,Me,Xe,Se,Te,gt,Pt,ft,Lt,qt,dn,qn],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 Pye(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.startCapture())}),s(1,"mat-icon"),d(2,"loupe"),l(),s(3,"span"),d(4,"Start capture"),l()()}}var u2=(()=>{class n{dialog=f(it);dialogConfig=f(go);controller=ae(void 0);project=ae(void 0);link=ae(void 0);startCapture(){let e=this.dialogConfig.openConfig("startCapture",{autoFocus:!1,disableClose:!1}),i=this.dialog.open(p2,e).componentInstance;i.controller=this.controller(),i.project=this.project(),i.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,i){if(t&1&&I(0,Pye,5,0,"button",0),t&2){let r;A(((r=i.link())==null?null:r.capturing)===!1?0:-1)}},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();function Iye(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.stopCapture())}),s(1,"mat-icon"),d(2,"pause_circle_filled"),l(),s(3,"span"),d(4,"Stop capture"),l()()}}var h2=(()=>{class n{linkService=f(Pi);toasterService=f(ie);cdr=f(X);controller=ae(void 0);link=ae(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,i){if(t&1&&I(0,Iye,5,0,"button",0),t&2){let r;A((r=i.link())!=null&&r.capturing?0:-1)}},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();function Aye(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.startCapture())}),s(1,"mat-icon"),d(2,"search"),l(),s(3,"span"),d(4,"Start Wireshark"),l()()}}var f2=(()=>{class n{packetCaptureService=f(mg);controller=ae(void 0);project=ae(void 0);link=ae(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,i){if(t&1&&I(0,Aye,5,0,"button",0),t&2){let r;A((r=i.link())!=null&&r.capturing?0:-1)}},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var pg=(()=>{class n{toasterService;constructor(e){this.toasterService=e}parseWebSocketUrl(e){try{let t=new URL(e),i=t.protocol==="wss:",r=t.hostname,a=t.port||(i?"443":"80"),c=t.pathname,p=t.searchParams.get("token")||void 0;return{server:r,port:a,ssl:i,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:i,ssl:r}=this.parseWebSocketUrl(e),a=new URLSearchParams;a.set("server",t),a.set("port",i),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 i=this.buildXpraWebSocketUrl(e,t);return this.buildXpraConsolePageUrl(i)}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,i=!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(i)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(ie))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();function Oye(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.startWebWireshark())}),s(1,"mat-icon"),d(2,"analytics"),l(),s(3,"span"),d(4,"Start Web Wireshark"),l()()}}var N9=(()=>{class n{xpraConsoleService=f(pg);toasterService=f(ie);controller=ae(void 0);project=ae(void 0);link=ae(void 0);startWebWireshark(){let e=this.controller(),t=this.project(),i=this.link();if(!e||!t||!i){this.toasterService.error("Missing controller, project or link");return}let r=this.xpraConsoleService.buildXpraWebSocketUrlForWebWireshark(e,i),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,i){if(t&1&&I(0,Oye,5,0,"button",0),t&2){let r;A((r=i.link())!=null&&r.capturing&&((r=i.link())!=null&&r.wireshark)?0:-1)}},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();function Nye(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.onOpenWebWiresharkInline())}),s(1,"mat-icon"),d(2,"open_in_full"),l(),s(3,"span"),d(4,"Open Web Wireshark (Inline)"),l()()}}var F9=(()=>{class n{controller=ae(void 0);project=ae(void 0);link=ae(void 0);openWebWiresharkInline=new _e;onOpenWebWiresharkInline(){let e=this.controller(),t=this.project(),i=this.link();!e||!t||!i||this.openWebWiresharkInline.emit({link:i,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,i){if(t&1&&I(0,Nye,5,0,"button",0),t&2){let r;A((r=i.link())!=null&&r.capturing&&((r=i.link())!=null&&r.wireshark)?0:-1)}},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();function Fye(n,o){if(n&1&&(s(0,"div",2)(1,"h6"),d(2),l(),s(3,"span",5),d(4),l()()),n&2){let e=o.$implicit;m(2),ee(" ",e.name," "),m(2),ee(" ",e.description," ")}}var g2=(()=>{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,i){t&1&&(s(0,"h1",0),d(1),l(),s(2,"div",1),K(3,Fye,5,2,"div",2,Ni),l(),s(5,"div",3)(6,"button",4),_("click",function(){return i.onCloseClick()}),d(7,"Close"),l()()),t&2&&(m(),B(i.title),m(2),Y(i.messages))},dependencies:[ve,Le,Ve,G,pe,oe],styles:[".message[_ngcontent-%COMP%]{margin-bottom:8px}.description[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface);opacity:.7}"],changeDetection:0})}return n})();function Rye(n,o){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),_("input",function(i){k(e);let r=v();return T(r.onFrequencyDropChange(+i.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),_("input",function(i){k(e);let r=v();return T(r.onPacketLossChange(+i.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),_("input",function(i){k(e);let r=v();return T(r.onCorruptChange(+i.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),_("input",function(i){k(e);let r=v();return T(r.onDelayLatencyChange(+i.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),_("input",function(i){k(e);let r=v();return T(r.onDelayJitterChange(+i.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),_("input",function(i){k(e);let r=v();return T(r.onBpfChange(i.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 _2=(()=>{class n{dialogRef=f(Ie);linkService=f(Pi);dialog=f(it);dialogConfig=f(go);cdr=f(X);toasterService=f(ie);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}),i=this.dialog.open(g2,e).componentInstance;i.title="Help for filters";let r=[];this.availableFilters.forEach(a=>{r.push({name:a.name,description:a.description})}),i.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,i){t&1&&(s(0,"h1",0),d(1,"Packet filters"),l(),I(2,Rye,38,6,"div",1),s(3,"div",2)(4,"button",3),_("click",function(){return i.onNoClick()}),d(5,"Cancel"),l(),s(6,"button",3),_("click",function(){return i.onResetClick()}),d(7,"Reset"),l(),s(8,"button",4),_("click",function(){return i.onYesClick()}),d(9,"Apply"),l(),s(10,"button",3),_("click",function(){return i.onHelpClick()}),d(11,"Help"),l()()),t&2&&(m(2),A(i.filters?2:-1))},dependencies:[ne,ve,Le,Ve,St,we,Me,Xe,Ti,Se,Te,G,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 v2=(()=>{class n{dialog=f(it);dialogConfig=f(go);controller=ae(void 0);project=ae(void 0);link=ae(void 0);openPacketFilters(){let e=this.dialogConfig.openConfig("packetFilters",{autoFocus:!1,disableClose:!1}),i=this.dialog.open(_2,e).componentInstance;i.controller=this.controller(),i.project=this.project(),i.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,i){t&1&&(s(0,"button",0),_("click",function(){return i.openPacketFilters()}),s(1,"mat-icon"),d(2,"filter_list"),l(),s(3,"span"),d(4,"Packet filters"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();function Lye(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.resumeLink())}),s(1,"mat-icon"),d(2,"play_arrow"),l(),s(3,"span"),d(4,"Resume"),l()()}}var C2=(()=>{class n{linkService=f(Pi);toasterService=f(ie);cdr=f(X);controller=ae(void 0);link=ae(void 0);resumeLink(){let e=this.link();e.suspend=!1,this.linkService.updateLink(this.controller(),e).subscribe({next:()=>{},error:t=>{let i=t.error?.message||t.message||"Failed to resume link";this.toasterService.error(i),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,i){if(t&1&&I(0,Lye,5,0,"button",0),t&2){let r;A((r=i.link())!=null&&r.suspend?0:-1)}},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();function Vye(n,o){if(n&1){let e=z();s(0,"button",1),_("click",function(){k(e);let i=v();return T(i.suspendLink())}),s(1,"mat-icon"),d(2,"pause"),l(),s(3,"span"),d(4,"Suspend"),l()()}}var x2=(()=>{class n{linkService=f(Pi);toasterService=f(ie);cdr=f(X);controller=ae(void 0);link=ae(void 0);suspendLink(){let e=this.link();e.suspend=!0,this.linkService.updateLink(this.controller(),e).subscribe({next:()=>{},error:t=>{let i=t.error?.message||t.message||"Failed to suspend link";this.toasterService.error(i),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,i){if(t&1&&I(0,Vye,5,0,"button",0),t&2){let r;A(((r=i.link())==null?null:r.suspend)===!1?0:-1)}},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var b2=(()=>{class n{linkService=f(Pi);toasterService=f(ie);linksDataSource=f(qo);mapLinksDataSource=f(kl);controller=ae(void 0);link=ae(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 i=!this.showFiltersIcon;this.linkService.updateLink(this.controller(),Ye(Z({},e),{show_filters_icon:i})).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,i){t&1&&(s(0,"button",0),_("click",function(){return i.toggleShowFiltersIcon()}),s(1,"mat-icon"),d(2),l(),s(3,"span"),d(4),l()()),t&2&&(m(2),B(i.showFiltersIcon===!1?"visibility_off":"visibility"),m(2),B(i.showFiltersIcon===!1?"Show filter icons":"Hide filter icons"))},dependencies:[oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var y2=(()=>{class n{linkService=f(Pi);toasterService=f(ie);cdr=f(X);controller=ae(void 0);link=ae(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,i){t&1&&(s(0,"button",0),_("click",function(){return i.resetLink()}),s(1,"mat-icon"),d(2,"settings_backup_restore"),l(),s(3,"span"),d(4,"Reset link"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();function Bye(n,o){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function zye(n,o){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function jye(n,o){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 $ye(n,o){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 S2=(()=>{class n{dialogRef=f(Ie);formBuilder=f(Bn);toasterService=f(ie);linkService=f(Pi);linksDataSource=f(qo);linksEventSource=f(Aa);linkToMapLink=f(Nf);nonNegativeValidator=f(Cp);cdr=f(X);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=en.BEZIER_CURVINESS_MIN;bezierCurvinessMax=en.BEZIER_CURVINESS_MAX;bezierCurvinessStep=en.BEZIER_CURVINESS_STEP;bezierCurvinessDefault=en.BEZIER_CURVINESS_DEFAULT;stateMachineCurvinessMin=en.STATE_MACHINE_CURVINESS_MIN;stateMachineCurvinessMax=en.STATE_MACHINE_CURVINESS_MAX;stateMachineCurvinessStep=en.STATE_MACHINE_CURVINESS_STEP;stateMachineCurvinessDefault=en.STATE_MACHINE_CURVINESS_DEFAULT;flowchartRoundnessMin=en.FLOWCHART_ROUNDNESS_MIN;flowchartRoundnessMax=en.FLOWCHART_ROUNDNESS_MAX;flowchartRoundnessStep=en.FLOWCHART_ROUNDNESS_STEP;flowchartRoundnessDefault=en.FLOWCHART_ROUNDNESS_DEFAULT;curvinessLinkTypeContext=en.DEFAULT_LINK_TYPE;constructor(){this.formGroup=this.formBuilder.group({color:new $e("",[je.required]),width:new $e("",[je.required,this.nonNegativeValidator.get]),type:new $e("",[je.required]),linkType:new $e("",[je.required]),bezierCurviness:new $e(this.bezierCurvinessDefault,[je.required]),flowchartRoundness:new $e(this.flowchartRoundnessDefault,[je.required,je.min(this.flowchartRoundnessMin),je.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 i=this.borderTypes[1];this.link.link_style?.type!==void 0&&this.link.link_style.type>=0&&this.link.link_style.type<this.borderTypes.length&&(i=this.borderTypes[this.link.link_style.type]),this.formGroup.controls.type.setValue(i);let r=Il.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=Il.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=Il.getFlowchartRoundness(this.link.project_id,this.link.link_id),g=this.link.link_style?.flowchart_roundness!==void 0?this.link.link_style.flowchart_roundness:h;this.formGroup.controls.flowchartRoundness.setValue(en.normalizeFlowchartRoundness(g)),this.formGroup.controls.linkType.valueChanges.subscribe({next:y=>{let b=this.normalizeLinkType(y),x=this.curvinessLinkTypeContext;this.applyCurvinessValidators(b);let M=this.formGroup.controls.bezierCurviness.value,w=this.normalizeCurvinessByLinkType(x,M),S=this.getCurvinessDefaultByLinkType(x),E=w===S,O=this.getCurvinessDefaultByLinkType(b),D=E?O:this.normalizeCurvinessByLinkType(b,M);this.formGroup.controls.bezierCurviness.setValue(D,{emitEvent:!1}),this.curvinessLinkTypeContext=b},error:y=>{let b=y.error?.message||y.message||"Failed to update link type";this.toasterService.error(b),this.cdr.markForCheck()}})}normalizeLinkType(e){return en.normalizeLinkType(e)}getLinkTypeLabel(e){let t=this.normalizeLinkType(e),i=this.linkTypeValues.indexOf(t);return this.linkTypes[i===-1?0:i]}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"?en.normalizeStateMachineCurviness(t):en.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([je.required,je.min(this.getCurvinessMinByLinkType(e)),je.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||Il.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=en.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 i=this.link.link_style.link_type,r=this.link.link_style.bezier_curviness,a=this.link.link_style.flowchart_roundness,c=i!==e;this.linkService.updateLinkStyle(this.controller,this.link).subscribe({next:p=>{p.link_style||(p.link_style={});let u=p.link_style.link_type,g=typeof u=="string"&&u.trim().length>0&&this.normalizeLinkType(u)!==this.normalizeLinkType(i);!p.link_style.link_type&&i&&(p.link_style.link_type=i),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),Il.set(p.project_id,p.link_id,p.link_style.link_type),Il.setBezierCurviness(p.project_id,p.link_id,this.normalizeCurvinessByLinkType(p.link_style.link_type,p.link_style.bezier_curviness)),Il.setFlowchartRoundness(p.project_id,p.link_id,en.normalizeFlowchartRoundness(p.link_style.flowchart_roundness)),this.linksDataSource.update(p),this.linksEventSource.edited.next(this.linkToMapLink.convert(p)),c&&i&&g?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,i){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),K(16,Bye,2,2,"mat-option",7,Oe),l()(),s(18,"mat-form-field",3)(19,"mat-label"),d(20,"Link type"),l(),s(21,"mat-select",8),K(22,zye,2,2,"mat-option",7,Oe),l()(),I(24,jye,4,3,"mat-form-field",9),I(25,$ye,4,3,"mat-form-field",10),l()(),s(26,"div",11)(27,"button",12),_("click",function(){return i.onNoClick()}),d(28,"Cancel"),l(),s(29,"button",13),_("click",function(){return i.onYesClick()}),d(30,"Apply"),l()()),t&2&&(m(3),C("formGroup",i.formGroup),m(13),Y(i.borderTypes),m(6),Y(i.linkTypes),m(2),A(i.isCurvinessSelected()?24:-1),m(),A(i.isFlowchartSelected()?25:-1))},dependencies:[ne,Je,rt,Nt,Uo,Dt,ot,gc,nh,Et,Ft,Vt,ve,Le,Ve,we,Me,Xe,Se,Te,gt,Pt,ft,Vo,G,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 w2=(()=>{class n{dialog=f(it);dialogConfig=f(go);controller=ae(void 0);project=ae(void 0);link=ae(void 0);editStyle(){let e=this.dialogConfig.openConfig("linkStyleEditor",{autoFocus:!1,disableClose:!1}),i=this.dialog.open(S2,e).componentInstance;i.controller=this.controller(),i.project=this.project(),i.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,i){t&1&&(s(0,"button",0),_("click",function(){return i.editStyle()}),s(1,"mat-icon"),d(2,"style"),l(),s(3,"span"),d(4,"Edit style"),l()())},dependencies:[ve,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var M2=(()=>{class n{nodesDataSource=f(ui);drawingsDataSource=f(zi);nodeService=f(ut);drawingService=f(ji);projectService=f(Ei);cdr=f(X);dialog=f(it);toasterService=f(ie);controller=ae(void 0);nodes=ae(void 0);drawings=ae(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(),i=e.length+t.length;if(i>1){let a=!e.every(p=>p.locked)||!t.every(p=>p.locked)?"lock":"unlock";this.dialog.open(Hye,{panelClass:"simple-dialog-panel",data:{title:`Confirm ${a==="lock"?"Lock":"Unlock"} All`,message:`Are you sure you want to ${a} ${i} item${i>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 i=t.error?.message||t.message||"Failed to update node lock status";this.toasterService.error(i),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 i=t.error?.message||t.message||"Failed to update drawing lock status";this.toasterService.error(i),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:[Pn],decls:5,vars:1,consts:[["mat-menu-item","",3,"click"]],template:function(t,i){t&1&&(s(0,"button",0),_("click",function(){return i.lock()}),s(1,"mat-icon"),d(2,"lock"),l(),s(3,"span"),d(4),l()()),t&2&&(m(4),B(i.command))},dependencies:[G,oe,de,qe,tt,ve],encapsulation:2,changeDetection:0})}return n})(),Hye=(()=>{class n{dialogRef;data;constructor(e,t){this.dialogRef=e,this.data=t}static \u0275fac=function(t){return new(t||n)(at(Ie),at(Ct))};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,i){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),_("click",function(){return i.dialogRef.close(!1)}),d(7,"Cancel"),l(),s(8,"button",4),_("click",function(){return i.dialogRef.close(!0)}),d(9),l()()),t&2&&(m(),B(i.data.title),m(3),B(i.data.message),m(5),ee(" ",i.data.action==="lock"?"Lock":"Unlock"," "))},dependencies:[ve,Le,Ve,St,G,pe],encapsulation:2,changeDetection:0})}return n})();var k2=(()=>{class n{toasterService=f(ie);nodeService=f(ut);drawingService=f(ji);linkService=f(Pi);bottomSheet=f(ec);cdr=f(X);controller=ae(void 0);nodes=ae([]);drawings=ae([]);links=ae([]);confirmDelete(){let t=this.bottomSheet.open(Ya,{data:{message:"Do you want to delete all selected objects?"},panelClass:"confirmation-bottom-sheet"}).afterDismissed().subscribe(i=>{i&&(this.delete(),this.cdr.markForCheck())})}delete(){this.nodes().forEach(e=>{if(!e.locked)this.nodeService.delete(this.controller(),e).subscribe({next:t=>{},error:t=>{let i=t.error?.message||t.message||"Failed to delete node";this.toasterService.error(i),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.drawingService.delete(this.controller(),e).subscribe({next:t=>{},error:t=>{let i=t.error?.message||t.message||"Failed to delete drawing";this.toasterService.error(i),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.linkService.deleteLink(this.controller(),e).subscribe({next:()=>{Il.remove(e.project_id,e.link_id)},error:t=>{let i=t.error?.message||t.message||"Failed to delete link";this.toasterService.error(i),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,i){t&1&&(s(0,"button",0),_("click",function(){return i.confirmDelete()}),s(1,"mat-icon"),d(2,"delete"),l(),s(3,"span"),d(4,"Delete"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var T2=(()=>{class n{nodesDataSource=f(ui);nodeService=f(ut);toasterService=f(ie);cdr=f(X);controller=ae(void 0);nodes=ae(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:i=>{let r=i.error?.message||i.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,i){t&1&&(s(0,"button",0),_("click",function(){return i.alignHorizontally()}),s(1,"mat-icon"),d(2,"more_horiz"),l(),s(3,"span"),d(4,"Align horizontally"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var E2=(()=>{class n{nodesDataSource=f(ui);nodeService=f(ut);toasterService=f(ie);cdr=f(X);controller=ae(void 0);nodes=ae(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:i=>{let r=i.error?.message||i.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,i){t&1&&(s(0,"button",0),_("click",function(){return i.alignVertically()}),s(1,"mat-icon"),d(2,"more_vert"),l(),s(3,"span"),d(4,"Align vertically"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var R9=(()=>{class n{openFileManagerInline=new _e;node=ae(void 0);controller=ae(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,i){t&1&&(s(0,"button",0),_("click",function(){return i.showInFileManager()}),s(1,"mat-icon"),d(2,"folder_open"),l(),s(3,"span"),d(4,"Show in file manager"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();function Uye(n,o){if(n&1&&R(0,"app-show-node-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function Wye(n,o){if(n&1){let e=z();s(0,"app-show-in-file-manager-action",15),_("openFileManagerInline",function(i){k(e);let r=v();return T(r.onOpenFileManagerInline(i))}),l()}if(n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function Gye(n,o){if(n&1&&R(0,"app-config-node-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function qye(n,o){if(n&1&&R(0,"app-start-node-action",5),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)}}function Qye(n,o){if(n&1&&R(0,"app-suspend-node-action",5),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)}}function Xye(n,o){if(n&1&&R(0,"app-stop-node-action",5),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)}}function Kye(n,o){if(n&1&&R(0,"app-reload-node-action",5),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)}}function Yye(n,o){if(n&1){let e=z();s(0,"app-http-console-action",16),_("openWebConsoleInline",function(i){k(e);let r=v();return T(r.onOpenWebConsoleInline(i))}),l()}if(n&2){let e=v();C("controller",e.controller)("project",e.project)("nodes",e.nodes)}}function Zye(n,o){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 Jye(n,o){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 eSe(n,o){if(n&1&&R(0,"app-isolate-node-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function tSe(n,o){if(n&1&&R(0,"app-unisolate-node-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function nSe(n,o){if(n&1&&R(0,"app-change-hostname-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function iSe(n,o){if(n&1&&R(0,"app-change-symbol-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function oSe(n,o){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 rSe(n,o){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 aSe(n,o){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 sSe(n,o){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 lSe(n,o){if(n&1&&R(0,"app-export-config-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function cSe(n,o){if(n&1&&R(0,"app-import-config-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function dSe(n,o){if(n&1&&R(0,"app-idle-pc-action",4),n&2){let e=v();C("controller",e.controller)("node",e.nodes[0])}}function mSe(n,o){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 pSe(n,o){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 uSe(n,o){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 hSe(n,o){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 fSe(n,o){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 gSe(n,o){if(n&1&&R(0,"app-stop-capture-action",13),n&2){let e=v();C("controller",e.controller)("link",e.links[0])}}function _Se(n,o){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 vSe(n,o){if(n&1){let e=z();R(0,"app-start-web-wireshark-action",12),s(1,"app-start-web-wireshark-inline-action",17),_("openWebWiresharkInline",function(i){k(e);let r=v();return T(r.onOpenWebWiresharkInline(i))}),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 CSe(n,o){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 xSe(n,o){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 bSe(n,o){if(n&1&&R(0,"app-resume-link-action",13),n&2){let e=v();C("controller",e.controller)("link",e.links[0])}}function ySe(n,o){if(n&1&&R(0,"app-suspend-link-action",13),n&2){let e=v();C("controller",e.controller)("link",e.links[0])}}function SSe(n,o){if(n&1&&R(0,"app-reset-link-action",13),n&2){let e=v();C("controller",e.controller)("link",e.links[0])}}function wSe(n,o){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 MSe(n,o){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 kSe(n,o){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 TSe(n,o){if(n&1&&R(0,"app-align-horizontally-action",5),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)}}function ESe(n,o){if(n&1&&R(0,"app-align-vertically-action",5),n&2){let e=v();C("controller",e.controller)("nodes",e.nodes)}}var ug=(()=>{class n{sanitizer=f(xr);changeDetector=f(X);projectService=f(Ei);project;controller;openWebWiresharkInline=new _e;openWebConsoleInline=new _e;openFileManagerInline=new _e;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,i){this.resetCapabilities(),this.hasTextCapabilities=e.element instanceof ys,this.drawings=[e],this.setPosition(t,i),this.contextMenu.openMenu()}openMenuForNode(e,t,i){this.resetCapabilities(),this.nodes=[e],this.setPosition(t,i),this.contextMenu.openMenu()}openMenuForLabel(e,t,i,r){this.resetCapabilities(),this.labels=[e],this.nodes=[t],this.setPosition(i,r),this.contextMenu.openMenu()}openMenuForInterfaceLabel(e,t,i,r){this.resetCapabilities(),this.linkNodes=[e],this.links=[t],this.setPosition(i,r),this.contextMenu.openMenu()}openMenuForListOfElements(e,t,i,r,a,c){this.resetCapabilities(),this.drawings=e,this.nodes=t,this.labels=i,this.links=r,this.setPosition(a,c),this.contextMenu.openMenu()}isCloudLikeNode(e){return e==="cloud"||e==="ethernet_switch"||e==="ethernet_hub"||e==="nat"}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,i){if(t&1&&In(Fn,5),t&2){let r;mt(r=pt())&&(i.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,i){if(t&1&&(s(0,"div",1),R(1,"span",2),s(2,"mat-menu",3,0),I(4,Uye,1,2,"app-show-node-action",4),I(5,Wye,1,2,"app-show-in-file-manager-action",4),I(6,Gye,1,2,"app-config-node-action",4),I(7,qye,1,2,"app-start-node-action",5),I(8,Qye,1,2,"app-suspend-node-action",5),I(9,Xye,1,2,"app-stop-node-action",5),I(10,Kye,1,2,"app-reload-node-action",5),I(11,Yye,1,3,"app-http-console-action",6),I(12,Zye,1,2,"app-http-console-new-tab-action",5),I(13,Jye,1,2,"app-console-device-action-browser",4),I(14,eSe,1,2,"app-isolate-node-action",4),I(15,tSe,1,2,"app-unisolate-node-action",4),I(16,nSe,1,2,"app-change-hostname-action",4),I(17,iSe,1,2,"app-change-symbol-action",4),I(18,oSe,1,4,"app-duplicate-action",7),I(19,rSe,1,3,"app-edit-style-action",8),I(20,aSe,1,7,"app-edit-text-action",9),I(21,sSe,1,3,"app-edit-config-action",10),I(22,lSe,1,2,"app-export-config-action",4),I(23,cSe,1,2,"app-import-config-action",4),I(24,dSe,1,2,"app-idle-pc-action",4),I(25,mSe,1,2,"app-auto-idle-pc-action",4),I(26,pSe,1,3,"app-move-layer-up-action",11),I(27,uSe,1,3,"app-move-layer-down-action",11),I(28,hSe,1,3,"app-bring-to-front-action",11),I(29,fSe,1,3,"app-start-capture-action",12),I(30,gSe,1,2,"app-stop-capture-action",13),I(31,_Se,1,3,"app-start-capture-on-started-link-action",12),I(32,vSe,2,6),I(33,CSe,1,3,"app-packet-filters-action",12),I(34,xSe,1,2,"app-toggle-show-filters-icon-action",13),I(35,bSe,1,2,"app-resume-link-action",13),I(36,ySe,1,2,"app-suspend-link-action",13),I(37,SSe,1,2,"app-reset-link-action",13),I(38,wSe,1,3,"app-edit-link-style-action",12),I(39,MSe,1,3,"app-lock-action",11),I(40,kSe,1,4,"app-delete-action",14),I(41,TSe,1,2,"app-align-horizontally-action",5),I(42,ESe,1,2,"app-align-vertically-action",5),l()()),t&2){let r=ke(3);Yt("left",i.leftPosition)("top",i.topPosition),m(),C("matMenuTriggerFor",r),m(3),A(i.nodes.length===1?4:-1),m(),A(i.nodes.length===1&&!i.isCloudLikeNode(i.nodes[0].node_type)?5:-1),m(),A(i.nodes.length===1?6:-1),m(),A(i.nodes.length?7:-1),m(),A(i.nodes.length?8:-1),m(),A(i.nodes.length?9:-1),m(),A(i.nodes.length?10:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.nodes.length>0&&!i.isCloudLikeNode(i.nodes[0].node_type)?11:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.nodes.length>0&&!i.isCloudLikeNode(i.nodes[0].node_type)?12:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.nodes.length===1&&!i.isCloudLikeNode(i.nodes[0].node_type)?13:-1),m(),A(i.nodes.length===1?14:-1),m(),A(i.nodes.length===1?15:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.nodes.length===1?16:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.nodes.length===1?17:-1),m(),A(i.drawings.length>0||i.nodes.length>0?18:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.drawings.length===1&&!i.hasTextCapabilities?19:-1),m(),A(!i.projectService.isReadOnly(i.project)&&(i.drawings.length===1&&i.hasTextCapabilities&&i.labels.length===0&&i.linkNodes.length===0||i.labels.length===1&&i.linkNodes.length===0&&i.drawings.length===0||i.linkNodes.length===1&&i.labels.length===0&&i.drawings.length===0)?20:-1),m(),A(i.nodes.length===1&&i.nodes[0].node_type==="vpcs"?21:-1),m(),A(i.nodes.length===1&&(i.nodes[0].node_type==="vpcs"||i.nodes[0].node_type==="iou"||i.nodes[0].node_type==="dynamips")?22:-1),m(),A(i.nodes.length===1&&(i.nodes[0].node_type==="vpcs"||i.nodes[0].node_type==="iou"||i.nodes[0].node_type==="dynamips")?23:-1),m(),A(i.nodes.length===1&&i.nodes[0].node_type==="dynamips"?24:-1),m(),A(i.nodes.length===1&&i.nodes[0].node_type==="dynamips"?25:-1),m(),A(!i.projectService.isReadOnly(i.project)&&(i.drawings.length||i.nodes.length)?26:-1),m(),A(!i.projectService.isReadOnly(i.project)&&(i.drawings.length||i.nodes.length)?27:-1),m(),A(!i.projectService.isReadOnly(i.project)&&(i.drawings.length||i.nodes.length)?28:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.drawings.length===0&&i.nodes.length===0&&i.links.length===1?29:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.drawings.length===0&&i.nodes.length===0&&i.links.length===1&&i.linkNodes.length===0?30:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.drawings.length===0&&i.nodes.length===0&&i.links.length===1&&i.linkNodes.length===0?31:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.drawings.length===0&&i.nodes.length===0&&i.links.length===1&&i.linkNodes.length===0?32:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.drawings.length===0&&i.nodes.length===0&&i.links.length===1&&i.linkNodes.length===0?33:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.drawings.length===0&&i.nodes.length===0&&i.links.length===1&&i.linkNodes.length===0?34:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.drawings.length===0&&i.nodes.length===0&&i.links.length===1&&i.linkNodes.length===0?35:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.drawings.length===0&&i.nodes.length===0&&i.links.length===1&&i.linkNodes.length===0?36:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.drawings.length===0&&i.nodes.length===0&&i.links.length===1&&i.linkNodes.length===0?37:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.drawings.length===0&&i.nodes.length===0&&i.links.length===1&&i.linkNodes.length===0?38:-1),m(),A(!i.projectService.isReadOnly(i.project)&&(i.drawings.length>0||i.nodes.length>0)?39:-1),m(),A(!i.projectService.isReadOnly(i.project)&&(i.drawings.length>0||i.nodes.length>0||i.links.length>0)&&i.linkNodes.length===0?40:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.nodes.length>1?41:-1),m(),A(!i.projectService.isReadOnly(i.project)&&i.nodes.length>1?42:-1)}},dependencies:[ne,qe,Kn,Fn,gw,Fw,Rw,Lw,Vw,Bw,zw,jw,lg,Ww,Gw,Qw,Kw,Yw,Jw,t2,i2,o2,r2,s2,l2,c2,d2,m2,u2,h2,f2,N9,F9,v2,C2,x2,b2,y2,w2,M2,k2,T2,E2,R9],styles:[".context-menu[_ngcontent-%COMP%]{position:fixed;min-height:0}"],changeDetection:0})}return n})();var D2=(()=>{class n{fontBBCalculator;themeService=f(pi);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 i=this.fontBBCalculator.calculate(e.label.text,e.label.style);return e.label.x=e.width/2-i.width/2,e.label.y=-i.height-this.MARGIN_BETWEEN_NODE_AND_LABEL,e}static \u0275fac=function(t){return new(t||n)(ge(Qc))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();function DSe(n,o){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function PSe(n,o){if(n&1){let e=z();s(0,"mat-form-field",14)(1,"mat-select",16,0),_("selectionChange",function(i){k(e);let r=v(2);return T(r._changePageSize(i.value))}),K(3,DSe,2,2,"mat-option",17,Oe),l(),s(5,"div",18),_("click",function(){k(e);let i=ke(2);return T(i.open())}),l()()}if(n&2){let e=v(2);C("appearance",e._formFieldAppearance)("color",e.color),m(),C("value",e.pageSize)("disabled",e.disabled),KO("aria-labelledby",e._pageSizeLabelId),C("panelClass",e.selectConfig.panelClass||"")("disableOptionCentering",e.selectConfig.disableOptionCentering),m(2),Y(e._displayedPageSizeOptions)}}function ISe(n,o){if(n&1&&(s(0,"div",15),d(1),l()),n&2){let e=v(2);m(),B(e.pageSize)}}function ASe(n,o){if(n&1&&(s(0,"div",3)(1,"div",13),d(2),l(),I(3,PSe,6,7,"mat-form-field",14),I(4,ISe,2,1,"div",15),l()),n&2){let e=v();m(),Qt("id",e._pageSizeLabelId),m(),ee(" ",e._intl.itemsPerPageLabel," "),m(),A(e._displayedPageSizeOptions.length>1?3:-1),m(),A(e._displayedPageSizeOptions.length<=1?4:-1)}}function OSe(n,o){if(n&1){let e=z();s(0,"button",19),_("click",function(){k(e);let i=v();return T(i._buttonClicked(0,i._previousButtonsDisabled()))}),ti(),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 NSe(n,o){if(n&1){let e=z();s(0,"button",21),_("click",function(){k(e);let i=v();return T(i._buttonClicked(i.getNumberOfPages()-1,i._nextButtonsDisabled()))}),ti(),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 FSe=(()=>{class n{changes=new We;itemsPerPageLabel="Items per page:";nextPageLabel="Next page";previousPageLabel="Previous page";firstPageLabel="First page";lastPageLabel="Last page";getRangeLabel=(e,t,i)=>{if(i==0||t==0)return`0 of ${i}`;i=Math.max(i,0);let r=e*t,a=r<i?Math.min(r+t,i):r+t;return`${r+1} \u2013 ${a} of ${i}`};static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),RSe=50;var LSe=new cn("MAT_PAGINATOR_DEFAULT_OPTIONS"),Cr=(()=>{class n{_intl=f(FSe);_changeDetectorRef=f(X);_formFieldAppearance;_pageSizeLabelId=f(To).getId("mat-paginator-page-size-label-");_intlChanges;_isInitialized=!1;_initializedStream=new Xd(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=>Lo(t,0)),this._updateDisplayedPageSizeOptions()}_pageSizeOptions=[];hidePageSize=!1;showFirstLastButtons=!1;selectConfig={};disabled=!1;page=new _e;_displayedPageSizeOptions;initialized=this._initializedStream;constructor(){let e=this._intl,t=f(LSe,{optional:!0});if(this._intlChanges=e.changes.subscribe(()=>this._changeDetectorRef.markForCheck()),t){let{pageSize:i,pageSizeOptions:r,hidePageSize:a,showFirstLastButtons:c}=t;i!=null&&(this._pageSize=i),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,i=this.pageIndex;this.pageIndex=Math.floor(t/e)||0,this.pageSize=e,this._emitPageEvent(i)}_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]:RSe),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",Lo],length:[2,"length","length",Lo],pageSize:[2,"pageSize","pageSize",Lo],pageSizeOptions:"pageSizeOptions",hidePageSize:[2,"hidePageSize","hidePageSize",yt],showFirstLastButtons:[2,"showFirstLastButtons","showFirstLastButtons",yt],selectConfig:"selectConfig",disabled:[2,"disabled","disabled",yt]},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,i){t&1&&(s(0,"div",1)(1,"div",2),I(2,ASe,5,4,"div",3),s(3,"div",4)(4,"div",5),d(5),l(),I(6,OSe,3,5,"button",6),s(7,"button",7),_("click",function(){return i._buttonClicked(i.pageIndex-1,i._previousButtonsDisabled())}),ti(),s(8,"svg",8),R(9,"path",9),l()(),Vr(),s(10,"button",10),_("click",function(){return i._buttonClicked(i.pageIndex+1,i._nextButtonsDisabled())}),ti(),s(11,"svg",8),R(12,"path",11),l()(),I(13,NSe,3,5,"button",12),l()()()),t&2&&(m(2),A(i.hidePageSize?-1:2),m(3),ee(" ",i._intl.getRangeLabel(i.pageIndex,i.pageSize,i.length)," "),m(),A(i.showFirstLastButtons?6:-1),m(),C("matTooltip",i._intl.previousPageLabel)("matTooltipDisabled",i._previousButtonsDisabled())("disabled",i._previousButtonsDisabled())("tabindex",i._previousButtonsDisabled()?-1:null),Qt("aria-label",i._intl.previousPageLabel),m(3),C("matTooltip",i._intl.nextPageLabel)("matTooltipDisabled",i._nextButtonsDisabled())("disabled",i._nextButtonsDisabled())("tabindex",i._nextButtonsDisabled()?-1:null),Qt("aria-label",i._intl.nextPageLabel),m(3),A(i.showFirstLastButtons?13:-1))},dependencies:[Me,Pt,ft,ze,Mt],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: transparent;
|
||
transform: translate(-50%, -50%);
|
||
cursor: pointer;
|
||
}
|
||
`],encapsulation:2,changeDetection:0})}return n})(),hg=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[G,gt,ht,Cr]})}return n})();var VSe=["mat-sort-header",""],BSe=["*",[["","matSortHeaderIcon",""]]],zSe=["*","[matSortHeaderIcon]"];function jSe(n,o){n&1&&(ti(),Co(0,"svg",3),ks(1,"path",4),ko())}function $Se(n,o){n&1&&(Co(0,"div",2),an(1,1,null,jSe,2,0),ko())}var V9=new cn("MAT_SORT_DEFAULT_OPTIONS"),po=(()=>{class n{_defaultOptions;_initializedStream=new Xd(1);sortables=new Map;_stateChanges=new We;active;start="asc";get direction(){return this._direction}set direction(e){this._direction=e}_direction="";disableClear;disabled=!1;sortChange=new _e;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,i=HSe(e.start||this.start,t),r=i.indexOf(this.direction)+1;return r>=i.length&&(r=0),i[r]}ngOnInit(){this._initializedStream.next()}ngOnChanges(){this._stateChanges.next()}ngOnDestroy(){this._stateChanges.complete(),this._initializedStream.complete()}static \u0275fac=function(t){return new(t||n)(at(V9,8))};static \u0275dir=vt({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",yt],disabled:[2,"matSortDisabled","disabled",yt]},outputs:{sortChange:"matSortChange"},exportAs:["matSort"],features:[Pn]})}return n})();function HSe(n,o){let e=["asc","desc"];return n=="desc"&&e.reverse(),o||e.push(""),e}var Nr=(()=>{class n{_sort=f(po,{optional:!0});_columnDef=f(km,{optional:!0});_changeDetectorRef=f(X);_focusMonitor=f(Fa);_elementRef=f(Jt);_ariaDescriber=f(N4,{optional:!0});_renderChanges;_animationsDisabled=er();_recentlyCleared=Q(null);_sortButton;id;arrowPosition="after";start;disabled=!1;get sortActionDescription(){return this._sortActionDescription}set sortActionDescription(e){this._updateSortActionDescription(e)}_sortActionDescription="Sort";disableClear;constructor(){f(sr).load(la);let e=f(V9,{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=Wn(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,i){t&1&&_("click",function(){return i._toggleOnInteraction()})("keydown",function(a){return i._handleKeydown(a)})("mouseleave",function(){return i._recentlyCleared.set(null)}),t&2&&(Qt("aria-sort",i._getAriaSortAttribute()),Ae("mat-sort-header-disabled",i._isDisabled()))},inputs:{id:[0,"mat-sort-header","id"],arrowPosition:"arrowPosition",start:"start",disabled:[2,"disabled","disabled",yt],sortActionDescription:"sortActionDescription",disableClear:[2,"disableClear","disableClear",yt]},exportAs:["matSortHeader"],attrs:VSe,ngContentSelectors:zSe,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,i){t&1&&(ai(BSe),Co(0,"div",0)(1,"div",1),an(2),ko(),I(3,$Se,3,0,"div",2),ko()),t&2&&(Ae("mat-sort-header-sorted",i._isSorted())("mat-sort-header-position-before",i.arrowPosition==="before")("mat-sort-header-descending",i._sort.direction==="desc")("mat-sort-header-ascending",i._sort.direction==="asc")("mat-sort-header-recently-cleared-ascending",i._recentlyCleared()==="asc")("mat-sort-header-recently-cleared-descending",i._recentlyCleared()==="desc")("mat-sort-header-animations-disabled",i._animationsDisabled),Qt("tabindex",i._isDisabled()?null:0)("role",i._isDisabled()?null:"button"),m(3),A(i._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: 0.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})(),pr=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[_i]})}return n})();var H9=Gs(j9());var qv=(()=>{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,i){t&1&&(s(0,"mat-dialog-content",0)(1,"p",1),d(2),l()(),s(3,"div",2)(4,"button",3),_("click",function(){return i.onNoClick()}),d(5,"No"),l(),s(6,"button",4),_("click",function(){return i.onYesClick()}),d(7," Yes "),l()()),t&2&&(m(2),B(i.confirmationMessage))},dependencies:[ve,Ve,St,G,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 fg=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;extra_configs;image;memory;cpus;name;start_command;symbol;template_id;template_type;usage;tags};var P2=(()=>{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}/${ki.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=te({token:n,factory:n.\u0275fac})}return n})();function USe(n,o){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 I2=(()=>{class n{data;dialogRef=f(Ie);appliance;constructor(e){this.data=e}onNoClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)(at(Ct))};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,i){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(),I(10,USe,4,2),l(),s(11,"div",3)(12,"button",4),_("click",function(){return i.onNoClick()}),d(13,"Close"),l()()),t&2&&(m(2),B(i.appliance.name),m(3),ee("Vendor: ",i.appliance.vendor_name),m(2),ee("Status: ",i.appliance.status),m(2),ee("Maintainer: ",i.appliance.maintainer),m(),A(i.appliance.qemu?10:-1))},dependencies:[ve,Le,Ve,St,G,pe,dn],encapsulation:2,changeDetection:0})}return n})();var $9=(n,o)=>e=>Ca(500).pipe(Vn(()=>o.list(n)),Bt(t=>t.find(i=>i.name===e.value)?{templateExist:!0}:null));var WSe=n=>({"is-invalid":n});function GSe(n,o){n&1&&(s(0,"mat-error"),d(1,"Template name is required"),l())}function qSe(n,o){n&1&&(s(0,"mat-error"),d(1,"Template name is incorrect"),l())}function QSe(n,o){n&1&&(s(0,"mat-error"),d(1,"Template with this name exists"),l())}var ju=(()=>{class n{templateNameValidator;data;dialogRef=f(Ie);router=f(_t);dialog=f(it);toasterService=f(ie);formBuilder=f(Bn);templateService=f(bl);cdr=f(X);controller;templateNameForm;constructor(e,t){this.templateNameValidator=e,this.data=t}ngOnInit(){let e=this.data.name;this.templateNameForm=this.formBuilder.group({templateName:new $e(e,[je.required,this.templateNameValidator.get],[$9(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)(at($s),at(Ct))};static \u0275cmp=F({type:n,selectors:[["app-template-name-dialog"]],features:[fn([$s])],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,i){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),_("keydown",function(a){return i.onKeyDown(a)}),l(),I(5,GSe,2,0,"mat-error"),I(6,qSe,2,0,"mat-error"),I(7,QSe,2,0,"mat-error"),l(),s(8,"div",4)(9,"button",5),_("click",function(){return i.onNoClick()}),d(10,"Cancel"),l(),s(11,"button",6),_("click",function(){return i.onAddClick()}),d(12," Add template "),l()()()),t&2&&(m(2),C("formGroup",i.templateNameForm),m(2),C("ngClass",un(5,WSe,i.form.templateName==null?null:i.form.templateName.errors)),m(),A(i.form.templateName!=null&&i.form.templateName.touched&&(i.form.templateName!=null&&i.form.templateName.errors)&&(i.form.templateName!=null&&i.form.templateName.errors.required)?5:-1),m(),A(i.form.templateName!=null&&i.form.templateName.errors&&(i.form.templateName!=null&&i.form.templateName.errors.invalidName)?6:-1),m(),A(i.form.templateName!=null&&i.form.templateName.errors&&(i.form.templateName!=null&&i.form.templateName.errors.templateExist)?7:-1))},dependencies:[ne,Ji,Et,rt,Nt,Dt,ot,Ft,Vt,ve,Le,Ve,we,Me,ni,Se,Te,G,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 XSe=["stepper"],KSe=()=>[5,10,20,50,100],YSe=(n,o)=>o.name,U9=(n,o)=>o.filename;function ZSe(n,o){n&1&&d(0,"Select creation method")}function JSe(n,o){if(n&1&&d(0),n&2){let e=v();B(e.actionTitle)}}function ewe(n,o){if(n&1){let e=z();s(0,"button",60),_("click",function(){k(e);let i=v(2);return T(i.clearFilter())}),s(1,"mat-icon"),d(2,"close"),l()()}}function twe(n,o){if(n&1){let e=z();s(0,"button",60),_("click",function(){k(e);let i=v(2);return T(i.clearCategoryFilter())}),s(1,"mat-icon"),d(2,"close"),l()()}}function nwe(n,o){if(n&1&&(s(0,"mat-option",44),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function iwe(n,o){if(n&1){let e=z();s(0,"button",60),_("click",function(){k(e);let i=v(2);return T(i.clearEmulatorFilter())}),s(1,"mat-icon"),d(2,"close"),l()()}}function owe(n,o){if(n&1&&(s(0,"mat-option",44),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function rwe(n,o){if(n&1){let e=z();s(0,"button",60),_("click",function(){k(e);let i=v(2);return T(i.clearVendorFilter())}),s(1,"mat-icon"),d(2,"close"),l()()}}function awe(n,o){if(n&1&&(s(0,"mat-option",44),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e)}}function swe(n,o){n&1&&(s(0,"mat-header-cell",61),d(1,"Name"),l())}function lwe(n,o){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=o.$implicit;m(),B(e.name)}}function cwe(n,o){n&1&&(s(0,"mat-header-cell",61),d(1,"Emulator"),l())}function dwe(n,o){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=o.$implicit;m(),B(e.emulator)}}function mwe(n,o){n&1&&(s(0,"mat-header-cell",61),d(1,"Vendor"),l())}function pwe(n,o){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=o.$implicit;m(),B(e.vendor_name)}}function uwe(n,o){n&1&&(s(0,"mat-header-cell"),d(1,"Actions"),l())}function hwe(n,o){if(n&1){let e=z();s(0,"mat-cell",62)(1,"button",63),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.install(i))}),s(2,"mat-icon"),d(3,"archive"),l()(),s(4,"button",64),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.showInfo(i))}),s(5,"mat-icon"),d(6,"info"),l()()()}}function fwe(n,o){n&1&&R(0,"mat-header-row")}function gwe(n,o){n&1&&R(0,"mat-row")}function _we(n,o){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),_("input",function(i){k(e);let r=v();return T(r.onSearchTextChange(i.target.value))}),l(),I(6,ewe,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),I(12,twe,3,0,"button",39),s(13,"mat-autocomplete",43,1),_("optionSelected",function(i){k(e);let r=v();return T(r.onCategoryChange(i.option.value))}),K(15,nwe,2,2,"mat-option",44,Oe),l()(),s(17,"mat-form-field",45)(18,"mat-label"),d(19,"Emulator"),l(),R(20,"input",42),I(21,iwe,3,0,"button",39),s(22,"mat-autocomplete",43,2),_("optionSelected",function(i){k(e);let r=v();return T(r.onEmulatorChange(i.option.value))}),K(24,owe,2,2,"mat-option",44,Oe),l()(),s(26,"mat-form-field",46)(27,"mat-label"),d(28,"Vendor"),l(),R(29,"input",42),I(30,rwe,3,0,"button",39),s(31,"mat-autocomplete",43,3),_("optionSelected",function(i){k(e);let r=v();return T(r.onVendorChange(i.option.value))}),K(33,awe,2,2,"mat-option",44,Oe),l()()()(),s(35,"div",47)(36,"mat-table",48),_("matSortChange",function(i){k(e);let r=v();return T(r.sortData(i))}),Fe(37,49),Ce(38,swe,2,0,"mat-header-cell",50)(39,lwe,2,1,"mat-cell",51),Re(),Fe(40,52),Ce(41,cwe,2,0,"mat-header-cell",50)(42,dwe,2,1,"mat-cell",51),Re(),Fe(43,53),Ce(44,mwe,2,0,"mat-header-cell",50)(45,pwe,2,1,"mat-cell",51),Re(),Fe(46,54),Ce(47,uwe,2,0,"mat-header-cell",55)(48,hwe,7,0,"mat-cell",56),Re(),Ce(49,fwe,1,0,"mat-header-row",57)(50,gwe,1,0,"mat-row",58),l(),R(51,"mat-paginator",59),l()}if(n&2){let e=ke(14),t=ke(23),i=ke(32),r=v();m(5),C("value",r.searchText()),m(),A(r.searchText()?6:-1),m(5),C("formControl",r.categoryControl)("matAutocomplete",e),m(),A(r.categoryControl.value?12:-1),m(3),Y(r.filteredCategories),m(5),C("formControl",r.emulatorControl)("matAutocomplete",t),m(),A(r.emulatorControl.value?21:-1),m(3),Y(r.filteredEmulators),m(5),C("formControl",r.vendorControl)("matAutocomplete",i),m(),A(r.vendorControl.value?30:-1),m(3),Y(r.filteredVendors),m(3),C("dataSource",r.dataSource),m(13),C("matHeaderRowDef",r.displayedColumns),m(),C("matRowDefColumns",r.displayedColumns),m(),C("pageSizeOptions",Tt(15,KSe))}}function vwe(n,o){if(n&1){let e=z();s(0,"div",32)(1,"input",65,4),_("change",function(i){k(e);let r=v();return T(r.addAppliance(i))}),l(),s(3,"button",66),_("click",function(){k(e);let i=ke(2);return T(i.click())}),d(4," Click to import appliance "),l()()}if(n&2){let e=v();m(),C("uploader",e.uploader)}}function Cwe(n,o){n&1&&(R(0,"mat-spinner",68),s(1,"span"),d(2,"Updating..."),l())}function xwe(n,o){n&1&&(s(0,"span"),d(1,"Update from online registry"),l())}function bwe(n,o){if(n&1){let e=z();s(0,"button",67),_("click",function(){k(e);let i=v();return T(i.updateAppliances())}),I(1,Cwe,3,0)(2,xwe,2,0,"span"),l()}if(n&2){let e=v();C("disabled",e.isUpdatingAppliances),m(),A(e.isUpdatingAppliances?1:2)}}function ywe(n,o){if(n&1&&d(0),n&2){let e=v(2);B(e.secondActionTitle)}}function Swe(n,o){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function wwe(n,o){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function Mwe(n,o){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),_("click",function(){k(e);let i=v(5);return T(i.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 kwe(n,o){if(n&1){let e=z();s(0,"div",80)(1,"span",81),d(2),l(),s(3,"div",82),I(4,Swe,5,0,"div",83)(5,wwe,5,0,"div",84),s(6,"div",85)(7,"input",86,5),_("change",function(i){k(e);let r=v().$implicit,a=v(3);return T(a.importImage(i,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),_("click",function(){k(e);let i=ke(8);return T(i.click())}),s(17,"mat-icon"),d(18,"upload_file"),l(),s(19,"span"),d(20,"Import from file"),l()(),s(21,"button",88),_("click",function(){k(e);let i=v().$implicit,r=v(3);return T(r.downloadImageFromVersion(i.images.bios_image))}),s(22,"mat-icon"),d(23,"download"),l(),s(24,"span"),d(25,"Download from vendor"),l()()()()(),I(26,Mwe,12,3,"div",89),l()}if(n&2){let e=ke(15),t=v().$implicit,i=v(3);Ae("new-template__image-item--installed",i.checkImageFromVersion(t.images.bios_image))("new-template__image-item--missing",!i.checkImageFromVersion(t.images.bios_image)),m(2),B(t.images.bios_image),m(2),A(i.checkImageFromVersion(t.images.bios_image)?4:5),m(3),C("uploader",i.uploaderImage),m(2),C("matMenuTriggerFor",e),m(17),A(i.isUploading&&i.uploadingImageName===t.images.bios_image?26:-1)}}function Twe(n,o){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function Ewe(n,o){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function Dwe(n,o){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),_("click",function(){k(e);let i=v(5);return T(i.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 Pwe(n,o){if(n&1){let e=z();s(0,"div",80)(1,"span",81),d(2),l(),s(3,"div",82),I(4,Twe,5,0,"div",83)(5,Ewe,5,0,"div",84),s(6,"div",85)(7,"input",86,7),_("change",function(i){k(e);let r=v().$implicit,a=v(3);return T(a.importImage(i,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),_("click",function(){k(e);let i=ke(8);return T(i.click())}),s(17,"mat-icon"),d(18,"upload_file"),l(),s(19,"span"),d(20,"Import from file"),l()(),s(21,"button",88),_("click",function(){k(e);let i=v().$implicit,r=v(3);return T(r.downloadImageFromVersion(i.images.hda_disk_image))}),s(22,"mat-icon"),d(23,"download"),l(),s(24,"span"),d(25,"Download from vendor"),l()()()()(),I(26,Dwe,12,3,"div",89),l()}if(n&2){let e=ke(15),t=v().$implicit,i=v(3);Ae("new-template__image-item--installed",i.checkImageFromVersion(t.images.hda_disk_image))("new-template__image-item--missing",!i.checkImageFromVersion(t.images.hda_disk_image)),m(2),B(t.images.hda_disk_image),m(2),A(i.checkImageFromVersion(t.images.hda_disk_image)?4:5),m(3),C("uploader",i.uploaderImage),m(2),C("matMenuTriggerFor",e),m(17),A(i.isUploading&&i.uploadingImageName===t.images.hda_disk_image?26:-1)}}function Iwe(n,o){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function Awe(n,o){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function Owe(n,o){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),_("click",function(){k(e);let i=v(5);return T(i.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 Nwe(n,o){if(n&1){let e=z();s(0,"div",80)(1,"span",81),d(2),l(),s(3,"div",82),I(4,Iwe,5,0,"div",83)(5,Awe,5,0,"div",84),s(6,"div",85)(7,"input",86,9),_("change",function(i){k(e);let r=v().$implicit,a=v(3);return T(a.importImage(i,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),_("click",function(){k(e);let i=ke(8);return T(i.click())}),s(17,"mat-icon"),d(18,"upload_file"),l(),s(19,"span"),d(20,"Import from file"),l()(),s(21,"button",88),_("click",function(){k(e);let i=v().$implicit,r=v(3);return T(r.downloadImageFromVersion(i.images.hdb_disk_image))}),s(22,"mat-icon"),d(23,"download"),l(),s(24,"span"),d(25,"Download from vendor"),l()()()()(),I(26,Owe,12,3,"div",89),l()}if(n&2){let e=ke(15),t=v().$implicit,i=v(3);Ae("new-template__image-item--installed",i.checkImageFromVersion(t.images.hdb_disk_image))("new-template__image-item--missing",!i.checkImageFromVersion(t.images.hdb_disk_image)),m(2),B(t.images.hdb_disk_image),m(2),A(i.checkImageFromVersion(t.images.hdb_disk_image)?4:5),m(3),C("uploader",i.uploaderImage),m(2),C("matMenuTriggerFor",e),m(17),A(i.isUploading&&i.uploadingImageName===t.images.hdb_disk_image?26:-1)}}function Fwe(n,o){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function Rwe(n,o){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function Lwe(n,o){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),_("click",function(){k(e);let i=v(5);return T(i.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 Vwe(n,o){if(n&1){let e=z();s(0,"div",80)(1,"span",81),d(2),l(),s(3,"div",82),I(4,Fwe,5,0,"div",83)(5,Rwe,5,0,"div",84),s(6,"div",85)(7,"input",86,11),_("change",function(i){k(e);let r=v().$implicit,a=v(3);return T(a.importImage(i,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),_("click",function(){k(e);let i=ke(8);return T(i.click())}),s(17,"mat-icon"),d(18,"upload_file"),l(),s(19,"span"),d(20,"Import from file"),l()(),s(21,"button",88),_("click",function(){k(e);let i=v().$implicit,r=v(3);return T(r.downloadImageFromVersion(i.images.hdc_disk_image))}),s(22,"mat-icon"),d(23,"download"),l(),s(24,"span"),d(25,"Download from vendor"),l()()()()(),I(26,Lwe,12,3,"div",89),l()}if(n&2){let e=ke(15),t=v().$implicit,i=v(3);Ae("new-template__image-item--installed",i.checkImageFromVersion(t.images.hdc_disk_image))("new-template__image-item--missing",!i.checkImageFromVersion(t.images.hdc_disk_image)),m(2),B(t.images.hdc_disk_image),m(2),A(i.checkImageFromVersion(t.images.hdc_disk_image)?4:5),m(3),C("uploader",i.uploaderImage),m(2),C("matMenuTriggerFor",e),m(17),A(i.isUploading&&i.uploadingImageName===t.images.hdc_disk_image?26:-1)}}function Bwe(n,o){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function zwe(n,o){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function jwe(n,o){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),_("click",function(){k(e);let i=v(5);return T(i.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 $we(n,o){if(n&1){let e=z();s(0,"div",80)(1,"span",81),d(2),l(),s(3,"div",82),I(4,Bwe,5,0,"div",83)(5,zwe,5,0,"div",84),s(6,"div",85)(7,"input",86,13),_("change",function(i){k(e);let r=v().$implicit,a=v(3);return T(a.importImage(i,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),_("click",function(){k(e);let i=ke(8);return T(i.click())}),s(17,"mat-icon"),d(18,"upload_file"),l(),s(19,"span"),d(20,"Import from file"),l()(),s(21,"button",88),_("click",function(){k(e);let i=v().$implicit,r=v(3);return T(r.downloadImageFromVersion(i.images.hdd_disk_image))}),s(22,"mat-icon"),d(23,"download"),l(),s(24,"span"),d(25,"Download from vendor"),l()()()()(),I(26,jwe,12,3,"div",89),l()}if(n&2){let e=ke(15),t=v().$implicit,i=v(3);Ae("new-template__image-item--installed",i.checkImageFromVersion(t.images.hdd_disk_image))("new-template__image-item--missing",!i.checkImageFromVersion(t.images.hdd_disk_image)),m(2),B(t.images.hdd_disk_image),m(2),A(i.checkImageFromVersion(t.images.hdd_disk_image)?4:5),m(3),C("uploader",i.uploaderImage),m(2),C("matMenuTriggerFor",e),m(17),A(i.isUploading&&i.uploadingImageName===t.images.hdd_disk_image?26:-1)}}function Hwe(n,o){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function Uwe(n,o){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function Wwe(n,o){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),_("click",function(){k(e);let i=v(5);return T(i.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 Gwe(n,o){if(n&1){let e=z();s(0,"div",80)(1,"span",81),d(2),l(),s(3,"div",82),I(4,Hwe,5,0,"div",83)(5,Uwe,5,0,"div",84),s(6,"div",85)(7,"input",86,15),_("change",function(i){k(e);let r=v().$implicit,a=v(3);return T(a.importImage(i,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),_("click",function(){k(e);let i=ke(8);return T(i.click())}),s(17,"mat-icon"),d(18,"upload_file"),l(),s(19,"span"),d(20,"Import from file"),l()(),s(21,"button",88),_("click",function(){k(e);let i=v().$implicit,r=v(3);return T(r.downloadImageFromVersion(i.images.cdrom_image))}),s(22,"mat-icon"),d(23,"download"),l(),s(24,"span"),d(25,"Download from vendor"),l()()()()(),I(26,Wwe,12,3,"div",89),l()}if(n&2){let e=ke(15),t=v().$implicit,i=v(3);Ae("new-template__image-item--installed",i.checkImageFromVersion(t.images.cdrom_image))("new-template__image-item--missing",!i.checkImageFromVersion(t.images.cdrom_image)),m(2),B(t.images.cdrom_image),m(2),A(i.checkImageFromVersion(t.images.cdrom_image)?4:5),m(3),C("uploader",i.uploaderImage),m(2),C("matMenuTriggerFor",e),m(17),A(i.isUploading&&i.uploadingImageName===t.images.cdrom_image?26:-1)}}function qwe(n,o){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),_("click",function(i){let r=k(e).$implicit,a=v(3);return i.stopPropagation(),T(a.createQemuTemplateFromVersion(r))}),d(10," Create "),l()()()()(),s(11,"div",78),I(12,kwe,27,9,"div",79),I(13,Pwe,27,9,"div",79),I(14,Nwe,27,9,"div",79),I(15,Vwe,27,9,"div",79),I(16,$we,27,9,"div",79),I(17,Gwe,27,9,"div",79),l()()}if(n&2){let e=o.$implicit,t=v(3);m(5),mi("",t.applianceToInstall.name," version ",e.name),m(2),Ae("new-template__version-count--complete",t.isVersionComplete(e))("new-template__version-count--partial",!t.isVersionComplete(e)&&t.getVersionReadyCount(e)>0),m(),mi(" ",t.getVersionReadyCount(e),"/",t.getVersionImageCount(e)," ready "),m(),C("disabled",!t.isVersionComplete(e)),m(3),A(e.images.bios_image?12:-1),m(),A(e.images.hda_disk_image?13:-1),m(),A(e.images.hdb_disk_image?14:-1),m(),A(e.images.hdc_disk_image?15:-1),m(),A(e.images.hdd_disk_image?16:-1),m(),A(e.images.cdrom_image?17:-1)}}function Qwe(n,o){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),_("click",function(){k(e);let i=v(2);return T(i.refreshImages())}),s(5,"mat-icon"),d(6,"refresh"),l()()(),s(7,"mat-accordion",72),K(8,qwe,18,15,"mat-expansion-panel",null,YSe),l()()}if(n&2){let e=v(2);m(8),Y(e.applianceToInstall.versions)}}function Xwe(n,o){if(n&1){let e=z();s(0,"div",69)(1,"button",95),_("click",function(){k(e);let i=v(2);return T(i.createDockerTemplate())}),d(2," Create docker template "),l()()}}function Kwe(n,o){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function Ywe(n,o){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function Zwe(n,o){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),_("click",function(){k(e);let i=v(4);return T(i.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 Jwe(n,o){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),I(5,Kwe,5,0,"div",83)(6,Ywe,5,0,"div",84),s(7,"div",85)(8,"input",86,7),_("change",function(i){let r=k(e).$implicit,a=v(3);return T(a.importImage(i,r.filename))}),l(),s(10,"button",98),_("click",function(){let i=k(e).$implicit,r=v(3);return T(r.createIosTemplate(i))}),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),_("click",function(){k(e);let i=ke(9);return T(i.click())}),s(18,"mat-icon"),d(19,"upload_file"),l(),s(20,"span"),d(21,"Import from file"),l()()()(),I(22,Zwe,12,3,"div",89),l()()()}if(n&2){let e=o.$implicit,t=ke(16),i=v(3);m(),Ae("new-template__image-item--installed",i.checkImageFromVersion(e.filename))("new-template__image-item--missing",!i.checkImageFromVersion(e.filename)),m(2),B(e.filename),m(2),A(i.checkImageFromVersion(e.filename)?5:6),m(3),C("uploader",i.uploaderImage),m(4),C("matMenuTriggerFor",t),m(10),A(i.isUploading&&i.uploadingImageName===e.filename?22:-1)}}function e2e(n,o){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),_("click",function(){k(e);let i=v(2);return T(i.refreshImages())}),s(5,"mat-icon"),d(6,"refresh"),l()()(),s(7,"mat-list",96),K(8,Jwe,23,9,"mat-list-item",97,U9),l()()}if(n&2){let e=v(2);m(8),Y(e.applianceToInstall.images)}}function t2e(n,o){n&1&&(s(0,"div",83)(1,"mat-icon"),d(2,"check_circle"),l(),s(3,"span"),d(4,"Ready"),l()())}function n2e(n,o){n&1&&(s(0,"div",84)(1,"mat-icon"),d(2,"cancel"),l(),s(3,"span"),d(4,"Missing"),l()())}function i2e(n,o){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),_("click",function(){k(e);let i=v(4);return T(i.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 o2e(n,o){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),I(5,t2e,5,0,"div",83)(6,n2e,5,0,"div",84),s(7,"div",85)(8,"input",86,18),_("change",function(i){let r=k(e).$implicit,a=v(3);return T(a.importImage(i,r.filename))}),l(),s(10,"button",98),_("click",function(){let i=k(e).$implicit,r=v(3);return T(r.createIouTemplate(i))}),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),_("click",function(){k(e);let i=ke(9);return T(i.click())}),s(18,"mat-icon"),d(19,"upload_file"),l(),s(20,"span"),d(21,"Import from file"),l()()()(),I(22,i2e,12,3,"div",89),l()()()}if(n&2){let e=o.$implicit,t=ke(16),i=v(3);m(),Ae("new-template__image-item--installed",i.checkImageFromVersion(e.filename))("new-template__image-item--missing",!i.checkImageFromVersion(e.filename)),m(2),B(e.filename),m(2),A(i.checkImageFromVersion(e.filename)?5:6),m(3),C("uploader",i.uploaderImage),m(4),C("matMenuTriggerFor",t),m(10),A(i.isUploading&&i.uploadingImageName===e.filename?22:-1)}}function r2e(n,o){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),_("click",function(){k(e);let i=v(2);return T(i.refreshImages())}),s(5,"mat-icon"),d(6,"refresh"),l()()(),s(7,"mat-list",96),K(8,o2e,23,9,"mat-list-item",97,U9),l()()}if(n&2){let e=v(2);m(8),Y(e.applianceToInstall.images)}}function a2e(n,o){if(n&1){let e=z();s(0,"mat-step",22),Ce(1,ywe,1,1,"ng-template",23),s(2,"mat-dialog-content",24),I(3,Qwe,10,0,"div",69),I(4,Xwe,3,0,"div",69),I(5,e2e,10,0,"div",69),I(6,r2e,10,0,"div",69),l(),s(7,"mat-dialog-actions",29)(8,"button",33),d(9,"Back"),l(),s(10,"button",31),_("click",function(){k(e);let i=v();return T(i.onCloseClick())}),d(11,"Cancel"),l()()()}if(n&2){let e=v();m(3),A(e.applianceToInstall.qemu&&(!e.isLinuxPlatform||e.applianceToInstall.dynamips)?3:-1),m(),A(e.applianceToInstall.docker?4:-1),m(),A(e.applianceToInstall.dynamips?5:-1),m(),A(e.applianceToInstall.iou?6:-1)}}var gg=(()=>{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 fc("all categories");emulatorControl=new fc("all emulators");vendorControl=new fc("all vendors");filteredCategories=[];filteredEmulators=[];filteredVendors=[];dataSource;qemuImages=[];iosImages=[];iouImages=[];templates=[];uploadProgress=0;uploadingImageName="";isUploading=!1;isUpdatingAppliances=!1;checksumCancelled=!1;paginator=Rt(Cr);stepper=Rt("stepper");dialogRef=f(Ie);applianceService=f(P2);changeDetector=f(X);toasterService=f(ie);qemuService=f(na);dockerService=f(fs);iosService=f(_s);iouService=f(vs);templateService=f(bl);dialog=f(it);computeService=f(Eo);changeDetectorRef=f(X);progressService=f(io);snackBar=f(br);uploadServiceService=f(Sl);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 _r(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 _r(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 _r(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 Wa({url:""}),this.uploader.onAfterAddingFile=e=>{e.withCredentials=!1},this.uploader.onErrorItem=(e,t,i,r)=>{this.toasterService.error("An error has occured")},this.uploader.onSuccessItem=(e,t,i,r)=>{this.toasterService.success("Appliance imported succesfully"),this.getAppliance(e.url)},this.uploaderImage=new Wa({url:""}),this.uploaderImage.onAfterAddingFile=e=>{e.withCredentials=!1},this.uploaderImage.onErrorItem=(e,t,i,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,i,r)=>{this.toasterService.success("Image successfully imported");let a=this.uploadingImageName;this.progressService.deactivate(),this.isUploading=!1,this.uploadingImageName="",this.uploaderImage.clearQueue(),this.changeDetectorRef.markForCheck(),this.refreshImagesUntilReady(a)},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()}})}refreshImagesUntilReady(e,t=0){(this.applianceToInstall?.qemu?this.qemuService:this.applianceToInstall?.dynamips?this.iosService:this.iouService).getImages(this.controller).subscribe(a=>{this.applianceToInstall?.qemu?this.qemuImages=a:this.applianceToInstall?.dynamips?this.iosImages=a:this.iouImages=a,this.changeDetectorRef.markForCheck(),!(this.checkImageFromVersion(e)||t>=15)&&Ca(1e3).subscribe(()=>this.refreshImagesUntilReady(e,t+1))})}getAppliance(e){let t=e.split(`/${ki.current_version}`),i=t[t.length-1];this.applianceService.getAppliance(this.controller,i).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],i=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,i);this.uploader.queue.forEach(g=>g.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,i=new Set;this.allAppliances.forEach(r=>{r.emulator&&e.add(r.emulator),r.vendor_name&&t.add(r.vendor_name),r.category&&i.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,i=new Set,r=new Set;e.forEach(a=>{a.emulator&&t.add(a.emulator),a.vendor_name&&i.add(a.vendor_name),a.category&&r.add(a.category)}),this.emulators=["all emulators",...Array.from(t).sort()],this.vendors=["all vendors",...Array.from(i).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 i=e.toLowerCase();return t.filter(r=>r.toLowerCase().includes(i))}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 _r(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((i,r)=>{let a=e.direction==="asc";return e.active==="name"?uO(i.name,r.name,a):e.active==="emulator"?uO(i.emulator,r.emulator,a):e.active==="vendor"?uO(i.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(I2,{width:"250px",data:{appliance:e}});t.componentInstance.appliance=e}importImage(e,t){this.uploadingImageName=t,this.checksumCancelled=!1,this.uploadServiceService.setMessage("Computing checksum"),this.uploadServiceService.setComputing(!0),this.openSnackBar(),this.uploadServiceService.processBarCount(0),this.computeChecksumMd5(e.target.files[0],!1,i=>{this.uploadServiceService.processBarCount(i)}).then(i=>{if(this.checksumCancelled)return;let r=this.applianceToInstall.images.filter(a=>a.filename===t)[0];if(r.md5sum!==i){this.uploadServiceService.processBarCount(null),this.uploadServiceService.setMessage(""),this.uploadServiceService.setComputing(!1),this.progressService.deactivate();let a=this.dialog.open(qv,{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 ${i} and should be ${r.md5sum}. Do you want to accept it at your own risks?`,a.afterClosed().subscribe(c=>{c?(this.openSnackBar(),this.uploadServiceService.setMessage("Uploading"),this.uploadServiceService.setComputing(!1),this.importImageFile(e,t)):(this.isUploading=!1,this.uploadingImageName="",this.uploaderImage.clearQueue(),this.changeDetectorRef.markForCheck())})}else this.uploadServiceService.setMessage("Uploading"),this.uploadServiceService.setComputing(!1),this.uploadServiceService.processBarCount(0),this.importImageFile(e,t)})}importImageFile(e,t){let i=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.checksumCancelled=!0,this.uploaderImage.clearQueue(),this.uploadServiceService.processBarCount(null),this.uploadServiceService.setMessage(""),this.uploadServiceService.setComputing(!1),this.toasterService.warning("File upload cancelled"),this.uploadServiceService.cancelFileUploading(!1)}checkImageFromVersion(e){let t=this.applianceToInstall.images.filter(i=>i.filename===e)[0];if(this.applianceToInstall.qemu){if(this.qemuImages.filter(i=>i.checksum===t.md5sum).length>0)return!0}else if(this.applianceToInstall.dynamips){if(this.iosImages.filter(i=>i.checksum===t.md5sum).length>0)return!0}else if(this.applianceToInstall.iou&&this.iouImages.filter(i=>i.checksum===t.md5sum).length>0)return!0;return!1}getVersionImageCount(e){let t=e.images,i=0;return t.bios_image&&i++,t.hda_disk_image&&i++,t.hdb_disk_image&&i++,t.hdc_disk_image&&i++,t.hdd_disk_image&&i++,t.cdrom_image&&i++,i}getVersionReadyCount(e){let t=e.images,i=0;return t.bios_image&&this.checkImageFromVersion(t.bios_image)&&i++,t.hda_disk_image&&this.checkImageFromVersion(t.hda_disk_image)&&i++,t.hdb_disk_image&&this.checkImageFromVersion(t.hdb_disk_image)&&i++,t.hdc_disk_image&&this.checkImageFromVersion(t.hdc_disk_image)&&i++,t.hdd_disk_image&&this.checkImageFromVersion(t.hdd_disk_image)&&i++,t.cdrom_image&&this.checkImageFromVersion(t.cdrom_image)&&i++,i}isVersionComplete(e){return this.getVersionReadyCount(e)===this.getVersionImageCount(e)}openConfirmationDialog(e,t){let i=this.dialog.open(qv,{autoFocus:!1,disableClose:!0,panelClass:["base-confirmation-dialog-panel","information-dialog-panel"]});i.componentInstance.confirmationMessage=e,i.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.",i=`The file is compressed with ${e.compression}, it must be uncompressed first.`;e.direct_download_url?e.compression?this.openConfirmationDialog(i,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,i=this.applianceToInstall.images.filter(p=>p.filename===t)[0],r=this.iouImages.filter(p=>p.checksum===i.md5sum);r.length>0&&(t=r[0].filename);let a=new Vm;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=Li(),a.path=t,a.template_type="iou";let c=this.dialog.open(ju,{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,i=this.applianceToInstall.images.filter(p=>p.filename===t)[0],r=this.iosImages.filter(p=>p.checksum===i.md5sum);r.length>0&&(t=r[0].filename);let a=new Rm;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=Li(),a.image=t,a.template_type="dynamips";let c=this.dialog.open(ju,{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 fg,t=this.applianceToInstall.docker;e.adapters=t.adapters,e.image=t.image,e.console_type=t.console_type,e.start_command=t.start_command,e.environment=t.environment,e.extra_hosts=t.extra_hosts,e.extra_volumes=t.extra_volumes||[],e.extra_configs=(t.extra_configs||[]).filter(r=>(r.target||"").trim()).map(r=>({target:r.target.trim(),content:r.content??""})),e.custom_adapters=this.applianceToInstall.custom_adapters||[],e.mac_address=t.mac_address,e.cpus=t.cpus,e.memory=t.mem_limit,e.console_http_path=t.console_http_path,e.console_http_port=t.console_http_port,e.console_resolution=t.console_resolution,e.template_type="docker",e.category=this.getCategory(),e.default_name_format=this.applianceToInstall.default_name_format,e.symbol=this.applianceToInstall.symbol,e.tags=this.applianceToInstall.tags||[],e.usage=this.applianceToInstall.usage,e.compute_id="local",e.template_id=Li();let i=this.dialog.open(ju,{width:"400px",autoFocus:!1,disableClose:!0,panelClass:["base-dialog-panel","simple-dialog-panel","template-name-dialog-panel"],data:{name:this.applianceToInstall.name}});i.componentInstance.controller=this.controller,i.afterClosed().subscribe(r=>{if(r)e.name=r,this.dockerService.addTemplate(this.controller,e).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})}findControllerImageName(e){if(e){let t=this.applianceToInstall.images.filter(r=>r.filename===e)[0],i=this.qemuImages.filter(r=>r.checksum===t.md5sum);i.length>0&&(e=i[0].filename)}return e}createQemuTemplateFromVersion(e){let t=new Bm;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=Li(),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 i=this.dialog.open(ju,{width:"400px",autoFocus:!1,disableClose:!0,panelClass:["base-dialog-panel","simple-dialog-panel","template-name-dialog-panel"],data:{name:this.applianceToInstall.name}});i.componentInstance.controller=this.controller,i.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,i){return new Promise((r,a)=>{let p=new H9.ArrayBuffer,u=new FileReader,h=0;u.onerror=function(){a("MD5 computation failed - error reading the file")};function g(y){let b=Math.min(e.size,y+2097152);u.readAsArrayBuffer(e.slice(y,b))}u.onload=function(y){if(p.append(y.target.result),h+=2097152,i){let b=Math.min(100,Math.floor(Math.min(h,e.size)/e.size*100));i(b)}h<e.size?g(h):r(p.end(t))},g(0)})}openSnackBar(){this.snackBar.openFromComponent(wl,{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,i){t&1&&Xt(i.paginator,Cr,5)(i.stepper,XSe,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,i){t&1&&(s(0,"h1",20),d(1,"Add new template"),l(),s(2,"mat-horizontal-stepper",21,0)(4,"mat-step",22),Ce(5,ZSe,1,0,"ng-template",23),s(6,"mat-dialog-content",24)(7,"mat-radio-group",25),_("change",function(a){return i.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),_("click",function(){return i.onCloseClick()}),d(18,"Cancel"),l()()(),s(19,"mat-step",22),Ce(20,JSe,1,1,"ng-template",23),s(21,"mat-dialog-content",24),I(22,_we,52,16),I(23,vwe,5,1,"div",32),l(),s(24,"mat-dialog-actions",29)(25,"button",33),d(26,"Back"),l(),I(27,bwe,3,2,"button",34),s(28,"button",31),_("click",function(){return i.onCloseClick()}),d(29,"Cancel"),l()()(),I(30,a2e,12,4,"mat-step",22),l()),t&2&&(m(2),C("linear",!1),m(5),C("value",i.action),m(15),A(i.action==="install"?22:-1),m(),A(i.action==="import"?23:-1),m(4),A(i.action==="install"?27:-1),m(3),A(i.applianceToInstall?30:-1))},dependencies:[ne,ve,Le,Ve,St,oo,yo,fo,G,pe,ze,yl,Zl,z0,Jl,eL,tL,kt,we,Me,Xe,Ti,gt,ft,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,hg,Cr,pr,po,Nr,Se,Te,gs,Hc,dn,qn,Lt,gl,Om,Pd,Id,Am,oe,de,qe,Kn,tt,Fn,lr,Dr,So,hl,Vc,Je,Nt,Dt,Et,Ys],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:[xD("detailExpand",[Ix("collapsed",mu({height:"0px",minHeight:"0",visibility:"hidden"})),Ix("expanded",mu({height:"*",visibility:"visible"})),yD("expanded <=> collapsed",bD("225ms cubic-bezier(0.4, 0.0, 0.2, 1)"))])]},changeDetection:0})}return n})();function uO(n,o,e){return n=n.toLowerCase(),o=o.toLowerCase(),(n<o?-1:1)*(e?1:-1)}var A2=(()=>{class n{getDrawingElement(){let e=new ys;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=te({token:n,factory:n.\u0275fac})}return n})();var O2=(()=>{class n{getDrawingElement(){let e=new wi;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=te({token:n,factory:n.\u0275fac})}return n})();var N2=(()=>{class n{getDrawingElement(){let e=new Or;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=te({token:n,factory:n.\u0275fac})}return n})();var F2=(()=>{class n{getDrawingElement(){let e=new Oa;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=te({token:n,factory:n.\u0275fac})}return n})();var R2=(()=>{class n{getDrawingElement(){let e=new va;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=te({token:n,factory:n.\u0275fac})}return n})();var _g=(()=>{class n{textElementFactory;ellipseElementFactory;rectangleElementFactory;lineElementFactory;curveElementFactory;factory;availableFactories;constructor(e,t,i,r,a){this.textElementFactory=e,this.ellipseElementFactory=t,this.rectangleElementFactory=i,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 Ia;return t.element=this.factory.getDrawingElement(),t}static \u0275fac=function(t){return new(t||n)(ge(A2),ge(O2),ge(N2),ge(F2),ge(R2))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var W9=(()=>{class n{controller=ae(void 0);project;selectedDrawing;drawingSaved=new _e;pointToAddSelected;drawingService=f(ji);drawingsDataSource=f(zi);drawingsEventSource=f(Ko);drawingsFactory=f(_g);mapDrawingToSvgConverter=f(Ss);toasterService=f(ie);cdr=f(X);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),i=this.mapDrawingToSvgConverter.convert(t);this.drawingService.add(this.controller(),this.project.project_id,e.x,e.y,i).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:[Pn],decls:0,vars:0,template:function(t,i){},encapsulation:2,changeDetection:0})}return n})();var q9=Gs(G9());function p2e(n,o){n&1&&(s(0,"mat-error"),d(1,"Name for screenshot is required"),l())}var L2=(()=>{class n{dialogRef=f(Ie);toasterService=f(ie);formBuilder=f(Bn);cd=f(X);nameForm;isPngAvailable;filetype="svg";constructor(){this.nameForm=this.formBuilder.group({screenshotName:new $e(`screenshot-${Date.now()}`,[je.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,i){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),_("click",function(){return i.setFiletype("svg")}),d(5,"SVG"),l(),s(6,"mat-radio-button",4),_("click",function(){return i.setFiletype("png")}),d(7,"PNG"),l()(),s(8,"form",5)(9,"mat-form-field",6)(10,"input",7),_("keydown",function(a){return i.onKeyDown(a)}),l(),I(11,p2e,2,0,"mat-error"),l()()(),s(12,"div",8)(13,"button",9),_("click",function(){return i.onNoClick()}),d(14,"Cancel"),l(),s(15,"button",10),_("click",function(){return i.onAddClick()}),d(16,"Take a screenshot"),l()()),t&2&&(m(6),C("disabled",!i.isPngAvailable),m(2),C("formGroup",i.nameForm),m(3),A(i.form.screenshotName!=null&&i.form.screenshotName.touched&&(i.form.screenshotName!=null&&i.form.screenshotName.errors)&&(i.form.screenshotName!=null&&i.form.screenshotName.errors.required)?11:-1))},dependencies:[ne,ve,Le,Ve,St,G,pe,Se,Te,Me,ni,kt,oo,yo,fo,Et,rt,Nt,Dt,ot,Ft,Vt],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)(at(Ct))};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,i){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),_("click",function(){return i.onNoClick()}),d(7,"No"),l(),s(8,"button",3),_("click",function(){return i.confirmAction()}),d(9,"Yes"),l()()),t&2&&(m(),ee("Confirm ",i.confirmActionData.actionType," All"),m(3),ee("Are you sure you want to ",i.confirmActionData.actionType," all devices?"))},dependencies:[ve,Le,St,G,pe],encapsulation:2,changeDetection:0})}return n})();var vg=(()=>{class n{currentProjectId$=new tn(null);currentSessionId$=new tn(null);sessions$=new tn([]);messagesMap=new Map;messages$=new tn(new Map);isStreaming$=new tn(!1);currentToolCalls$=new tn(new Map);error$=new tn(null);panelState$=new tn({isOpen:!1,width:800,height:900,isMaximized:!1,isMinimized:!1,position:{top:80,right:20}});sessionUIStateMap=new Map;sessionUIStates$=new tn(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,i=t.findIndex(r=>r.thread_id===e.thread_id);if(i!==-1){let r=[...t];r[i]=e,this.sessions$.next(r)}}deleteSession(e){let t=this.sessions$.value;this.sessions$.next(t.filter(i=>i.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 Rr(t=>{let i=e||this.currentSessionId$.value;if(!i){t.next([]);return}let r=this.messagesMap.get(i)||[];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 i=this.messagesMap.get(e)||[];this.messagesMap.set(e,[...i,t]),this.messages$.next(new Map(this.messagesMap))}updateLastMessage(e,t){let i=this.messagesMap.get(e);if(i&&i.length>0){let r=i[i.length-1],a=[...i];a[a.length-1]=Ye(Z({},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,i=Z(Z({},t),e);this.panelState$.next(i),this.savePanelState(i)}getPanelState(){return this.panelState$.asObservable()}getPanelStateValue(){return this.panelState$.value}openPanel(){let e=this.panelState$.value;this.panelState$.next(Ye(Z({},e),{isOpen:!0})),this.savePanelState(this.panelState$.value)}closePanel(){let e=this.panelState$.value;this.panelState$.next(Ye(Z({},e),{isOpen:!1})),this.savePanelState(this.panelState$.value)}maximizePanel(){let e=this.panelState$.value;this.panelState$.next(Ye(Z({},e),{isMaximized:!0,isMinimized:!1})),this.savePanelState(this.panelState$.value)}minimizePanel(){let e=this.panelState$.value;this.panelState$.next(Ye(Z({},e),{isMaximized:!1,isMinimized:!0})),this.savePanelState(this.panelState$.value)}restorePanel(){let e=this.panelState$.value;this.panelState$.next(Ye(Z({},e),{isMaximized:!1,isMinimized:!1})),this.savePanelState(this.panelState$.value)}updatePanelPosition(e){let t=this.panelState$.value,i=Z(Z({},t.position),e);this.panelState$.next(Ye(Z({},t),{position:i})),this.savePanelState(this.panelState$.value)}updatePanelSize(e,t){let i=this.panelState$.value;this.panelState$.next(Ye(Z({},i),{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 i=new Map(this.sessionUIStateMap),r=i.get(e)||{isEditing:!1,isExpanded:!0},a=Z(Z({},r),t);i.set(e,a),this.sessionUIStateMap=i,this.sessionUIStates$.next(new Map(i))}getSessionUIState(e){return new Rr(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=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var fO=n=>({selected:n}),u2e=(n,o)=>({unmarkedLight:n,marked:o}),h2e=n=>({unmarkedLight:n});function f2e(n,o){if(n&1){let e=z();s(0,"button",19),_("click",function(){k(e);let i=v();return T(i.addDrawing("line"))}),ti(),s(1,"svg",20),R(2,"line",21),l()()}if(n&2){let e=v();m(2),C("ngClass",un(1,fO,e.drawTools.isLineChosen))}}function g2e(n,o){if(n&1){let e=z();s(0,"button",19),_("click",function(){k(e);let i=v();return T(i.addDrawing("line"))}),ti(),s(1,"svg",20),R(2,"line",21),l()()}if(n&2){let e=v();m(2),C("ngClass",un(1,fO,e.drawTools.isLineChosen))}}var Cg=(()=>{class n{toolsService=f(Ml);mapSettingsService=f(_o);drawingService=f(ji);symbolService=f(Cl);dialog=f(it);themeService=f(pi);projectServices=f(Ei);nodeService=f(ut);nodesDataSource=f(ui);drawingsDataSource=f(zi);drawingsEventSource=f(Ko);aiChatStore=f(vg);cdr=f(X);toaster=f(ie);project=ae(void 0);controller=ae(void 0);aiChatOpened=new _e;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(L2,{panelClass:["base-dialog-panel","simple-dialog-panel"],autoFocus:!1,disableClose:!0}).afterClosed().subscribe(t=>{t&&this.saveImage(t)})}async saveImage(e){let i=document.getElementById("map").cloneNode(!0),r=document.querySelector(".project-map");if(r){let a=this.resolveBackground(r);a&&(i.style.background=a);let c=this.getCanvasColors(r);this.applyCanvasColors(i,c.label,c.link)}if(await this.processEmbeddedImages(i),e.filetype==="svg"&&this.resolveAllCssVariables(i,r),e.filetype==="png")try{q9.saveSvgAsPng(i,`${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(i),p=new Blob([c],{type:"image/svg+xml"}),u=URL.createObjectURL(p),h=document.createElement("a"),g=!1;try{h.href=u,h.download=`${e.name}.svg`,document.body.appendChild(h),g=!0,h.click()}catch(y){throw console.error("Failed to save SVG:",y),this.toaster.error("Failed to save screenshot as SVG"),y}finally{g&&document.body.removeChild(h),URL.revokeObjectURL(u)}}}resolveBackground(e){let t=window.getComputedStyle(e),i=t.background;if(i&&i!=="none")return i;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),i=t.getPropertyValue("--gns3-canvas-label-color").trim(),r=t.getPropertyValue("--gns3-canvas-link-color").trim();return{label:i,link:r}}applyCanvasColors(e,t,i){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",i)})}resolveAllCssVariables(e,t){if(!t)return;let i=window.getComputedStyle(t);e.querySelectorAll("*[style]").forEach(c=>{let p=c,u=p.getAttribute("style");if(!u)return;let h=u.replace(/var\(([^)]+)\)/g,(g,y)=>i.getPropertyValue(y).trim()||g);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 g=h.match(/var\(([^)]+)\)/)?.[1];if(g){let y=i.getPropertyValue(g).trim();y&&p.setAttribute(u,y)}}})})}async processEmbeddedImages(e){let t=Array.from(e.getElementsByTagName("image"));for(let i=0;i<t.length;i++){let r=t[i],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,g=e.ownerDocument.importNode(h,!0);if(g.nodeName!=="svg"){let x=e.ownerDocument.createElementNS("http://www.w3.org/2000/svg","svg");for(x.setAttribute("xmlns","http://www.w3.org/2000/svg");g.firstChild;)x.appendChild(g.firstChild);g=x}let y=r.getAttribute("width"),b=r.getAttribute("height");g.setAttribute("width",y||"60"),g.setAttribute("height",b||"60"),g.setAttribute("x",r.getAttribute("x")||"0"),g.setAttribute("y",r.getAttribute("y")||"0"),r.parentNode.replaceChild(g,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:i=>{i?(this.isLocked=!0,this.lock="lock"):(this.isLocked=!1,this.lock="lock_open"),this.cdr.markForCheck()},error:i=>{let r=i.error?.message||i.message||"Failed to get project status";this.toaster.error(r),this.cdr.markForCheck()}}),this.projectServices.nodes(e,t.project_id).subscribe({next:i=>{this.nodes=i,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:i=>{let r=i.error?.message||i.message||"Failed to load nodes";this.toaster.error(r),this.cdr.markForCheck()}}),this.projectServices.drawings(this.controller(),this.project().project_id).subscribe({next:i=>{this.drawing=i,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:i=>{let r=i.error?.message||i.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-3PDLDM3Z.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(i=>{i&&(console.log("Fault injection completed:",i),i.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,i){if(t&1){let r=z();s(0,"button",1),_("click",function(){return i.addDrawing("text")}),s(1,"mat-icon",2),d(2,"create"),l()(),s(3,"input",3,0),_("change",function(c){return i.uploadImageFile(c)}),l(),s(5,"button",4),_("click",function(){k(r);let c=ke(4);return T(c.click())}),s(6,"mat-icon"),d(7,"image"),l()(),s(8,"button",5),_("click",function(){return i.addDrawing("rectangle")}),s(9,"mat-icon",2),d(10,"crop_3_2"),l()(),s(11,"button",6),_("click",function(){return i.addDrawing("ellipse")}),s(12,"mat-icon",2),d(13,"panorama_fish_eye"),l()(),I(14,f2e,3,3,"button",7),I(15,g2e,3,3,"button",7),s(16,"button",8),_("click",function(){return i.addDrawing("curve")}),ti(),s(17,"svg",9)(18,"g",10),R(19,"path",11),l()()(),Vr(),s(20,"button",12),_("click",function(){return i.changeLockValue()}),s(21,"mat-icon",2),d(22),l()(),s(23,"button",13),_("click",function(){return i.takeScreenshot()}),s(24,"mat-icon",2),d(25,"photo_camera"),l()(),s(26,"button",14),_("click",function(){return i.openAIChat()}),s(27,"span",15),d(28,"AI"),l()(),s(29,"button",16),_("click",function(){return i.openFaultInjection()}),s(30,"mat-icon"),d(31,"bug_report"),l()(),s(32,"app-drawing-added",17),_("drawingSaved",function(){return i.onDrawingSaved()}),l(),R(33,"div",18)}t&2&&(m(),C("ngClass",i.getCssClassForIcon("text")),m(8),C("ngClass",i.getCssClassForIcon("rectangle")),m(3),C("ngClass",i.getCssClassForIcon("ellipse")),m(2),A(i.isLightThemeEnabled?-1:14),m(),A(i.isLightThemeEnabled?15:-1),m(4),C("ngClass",un(16,fO,i.drawTools.isCurveChosen)),m(2),C("ngClass",aa(18,u2e,!i.isLocked&&i.isLightThemeEnabled,i.isLocked)),m(),B(i.lock),m(2),C("ngClass",un(21,h2e,!i.isLocked&&i.isLightThemeEnabled)),m(2),Ae("ai-active",i.isAIChatOpen&&!i.isAIMinimized)("ai-minimized",i.isAIChatOpen&&i.isAIMinimized),m(6),C("controller",i.controller())("project",i.project())("selectedDrawing",i.selectedDrawing))},dependencies:[ne,Ji,ve,G,ze,oe,de,ht,Mt,yr,qe,W9],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 _2e=["text"],B2=(()=>{class n{text=Rt("text");dialogRef=f(Ie);projectService=f(Ei);sanitizer=f(xr);cdr=f(X);controller;project;readmeHtml="";ngAfterViewInit(){let e="";this.projectService.getReadmeFile(this.controller,this.project.project_id).subscribe({next:t=>{if(t){e=t;let i=Ii(e);this.readmeHtml=this.sanitizer.bypassSecurityTrustHtml(i),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,i){t&1&&Xt(i.text,_2e,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,i){t&1&&(s(0,"h1",0),d(1,"Project README"),l(),R(2,"div",1),s(3,"div",2)(4,"button",3),_("click",function(){return i.onNoClick()}),d(5,"Close"),l()()),t&2&&(m(2),C("innerHTML",i.readmeHtml,wp))},dependencies:[ne,ve,Le,Ve,G,pe],styles:[".textWrapper[_ngcontent-%COMP%]{height:500px;overflow-y:scroll}"],changeDetection:0})}return n})();var $u=typeof window>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;function v2e(n){let o=n.cloneNode(!0),e=o.querySelectorAll("[id]"),t=n.nodeName.toLowerCase();return o.removeAttribute("id"),e.forEach(i=>{i.removeAttribute("id")}),t==="canvas"?K9(n,o):(t==="input"||t==="select"||t==="textarea")&&X9(n,o),Q9("canvas",n,o,K9),Q9("input, textarea, select",n,o,X9),o}function Q9(n,o,e,t){let i=o.querySelectorAll(n);if(i.length){let r=e.querySelectorAll(n);for(let a=0;a<i.length;a++)t(i[a],r[a])}}var C2e=0;function X9(n,o){o.type!=="file"&&(o.value=n.value),o.type==="radio"&&o.name&&(o.name=`mat-clone-${o.name}-${C2e++}`)}function K9(n,o){let e=o.getContext("2d");if(e)try{e.drawImage(n,0,0)}catch{}}function tj(n){return n.type.startsWith("touch")}function Y9(n,o,e,t){let i={top:n.top,bottom:n.bottom,left:n.left,right:n.right};return o.top&&(i.top+=t),o.bottom&&(i.bottom+=t),o.left&&(i.left+=e),o.right&&(i.right+=e),i.height=i.bottom-i.top,i.width=i.right-i.left,i}function x2e(n,o){let e=0,t=0,i=n.nativeElement.style,a=["transform","-ms-transform","-moz-transform","-o-transform"].map(c=>i[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")),o==="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 Z9=Object.freeze({topLeft:"nw-resize",topRight:"ne-resize",bottomLeft:"sw-resize",bottomRight:"se-resize",leftOrRight:"col-resize",topOrBottom:"row-resize"});function J9(n,o){return n.left&&n.top?o.topLeft:n.right&&n.top?o.topRight:n.left&&n.bottom?o.bottomLeft:n.right&&n.bottom?o.bottomRight:n.left||n.right?o.leftOrRight:n.top||n.bottom?o.topOrBottom:""}function z2({edges:n,initialRectangle:o,newRectangle:e}){let t={};return Object.keys(n).forEach(i=>{t[i]=(e[i]||0)-(o[i]||0)}),t}var ej="resize-active",b2e="resize-ghost-element",y2e=50,Us=(()=>{class n{constructor(){this.enableGhostResize=!1,this.resizeSnapGrid={},this.resizeCursors=Z9,this.ghostElementPositioning="fixed",this.allowNegativeResizes=!1,this.mouseMoveThrottleMS=y2e,this.resizeStart=new _e,this.resizing=new _e,this.resizeEnd=new _e,this.mouseup=new We,this.mousedown=new We,this.mousemove=new We,this.destroy$=new We,this.platformId=f(Gu),this.renderer=f(Si),this.elm=f(Jt),this.zone=f(Ai),this.rendererFactory=f(md),this.document=f(Qi),this.pointerEventListeners=gO.getInstance(this.rendererFactory.createRenderer(this.document,null),this.zone)}ngOnInit(){let e=Wn(this.pointerEventListeners.pointerDown,this.mousedown),t=Wn(this.pointerEventListeners.pointerMove,this.mousemove).pipe(yi(({event:u})=>{r&&u.cancelable&&!tj(u)&&u.preventDefault()}),$l()),i=Wn(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=()=>Z(Z({},Z9),this.resizeCursors);e.pipe(dc(u=>{function h(b){return{clientX:b.clientX-u.clientX,clientY:b.clientY-u.clientY}}let g=()=>{let b={x:1,y:1};return r&&(this.resizeSnapGrid.left&&r.edges.left?b.x=+this.resizeSnapGrid.left:this.resizeSnapGrid.right&&r.edges.right&&(b.x=+this.resizeSnapGrid.right),this.resizeSnapGrid.top&&r.edges.top?b.y=+this.resizeSnapGrid.top:this.resizeSnapGrid.bottom&&r.edges.bottom&&(b.y=+this.resizeSnapGrid.bottom)),b};function y(b,x){return{x:Math.ceil(b.clientX/x.x),y:Math.ceil(b.clientY/x.y)}}return Wn(t.pipe(Fo(1)).pipe(Bt(b=>[,b])),t.pipe(sC())).pipe(Bt(([b,x])=>[b&&h(b),h(x)])).pipe(ci(([b,x])=>{if(!b)return!0;let M=g(),w=y(b,M),S=y(x,M);return w.x!==S.x||w.y!==S.y})).pipe(Bt(([,b])=>{let x=g();return{clientX:Math.round(b.clientX/x.x)*x.x,clientY:Math.round(b.clientY/x.y)*x.y}})).pipe(Ge(Wn(i,e)))})).pipe(ci(()=>!!r)).pipe(Bt(({clientX:u,clientY:h})=>Y9(r.startingRect,r.edges,u,h))).pipe(ci(u=>this.allowNegativeResizes||!!(u.height&&u.width&&u.height>0&&u.width>0))).pipe(ci(u=>this.validateResize?this.validateResize({rectangle:u,edges:z2({edges:r.edges,initialRectangle:r.startingRect,newRectangle:u})}):!0),Ge(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:z2({edges:r.edges,initialRectangle:r.startingRect,newRectangle:u}),rectangle:u})}),r.currentRect=u}),e.pipe(Bt(({edges:u})=>u||{}),ci(u=>Object.keys(u).length>0),Ge(this.destroy$)).subscribe(u=>{r&&a();let h=x2e(this.elm,this.ghostElementPositioning);r={edges:u,startingRect:h,currentRect:h};let g=c(),y=J9(r.edges,g);this.renderer.setStyle(document.body,"cursor",y),this.setElementClass(this.elm,ej,!0),this.enableGhostResize&&(r.clonedNode=v2e(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",J9(r.edges,g)),this.renderer.addClass(r.clonedNode,b2e),r.clonedNode.scrollTop=r.startingRect.scrollTop,r.clonedNode.scrollLeft=r.startingRect.scrollLeft),this.resizeStart.observers.length>0&&this.zone.run(()=>{this.resizeStart.emit({edges:z2({edges:u,initialRectangle:h,newRectangle:h}),rectangle:Y9(h,{},0,0)})})}),i.pipe(Ge(this.destroy$)).subscribe(()=>{r&&(this.renderer.removeClass(this.elm.nativeElement,ej),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:z2({edges:r.edges,initialRectangle:r.startingRect,newRectangle:r.currentRect}),rectangle:r.currentRect})}),a(),r=null)})}ngOnDestroy(){Ts(this.platformId)&&this.renderer.setStyle(document.body,"cursor",""),this.mousedown.complete(),this.mouseup.complete(),this.mousemove.complete(),this.destroy$.next()}setElementClass(e,t,i){i?this.renderer.addClass(e.nativeElement,t):this.renderer.removeClass(e.nativeElement,t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275dir=vt({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})(),gO=class n{static getInstance(o,e){return n.instance||(n.instance=new n(o,e)),n.instance}constructor(o,e){this.pointerDown=new Rr(t=>{let i,r;return e.runOutsideAngular(()=>{i=o.listen("document","mousedown",a=>{t.next({clientX:a.clientX,clientY:a.clientY,event:a})}),$u&&(r=o.listen("document","touchstart",a=>{t.next({clientX:a.touches[0].clientX,clientY:a.touches[0].clientY,event:a})}))}),()=>{i(),$u&&r()}}).pipe($l()),this.pointerMove=new Rr(t=>{let i,r;return e.runOutsideAngular(()=>{i=o.listen("document","mousemove",a=>{t.next({clientX:a.clientX,clientY:a.clientY,event:a})}),$u&&(r=o.listen("document","touchmove",a=>{t.next({clientX:a.targetTouches[0].clientX,clientY:a.targetTouches[0].clientY,event:a})}))}),()=>{i(),$u&&r()}}).pipe($l()),this.pointerUp=new Rr(t=>{let i,r,a;return e.runOutsideAngular(()=>{i=o.listen("document","mouseup",c=>{t.next({clientX:c.clientX,clientY:c.clientY,event:c})}),$u&&(r=o.listen("document","touchend",c=>{t.next({clientX:c.changedTouches[0].clientX,clientY:c.changedTouches[0].clientY,event:c})}),a=o.listen("document","touchcancel",c=>{t.next({clientX:c.changedTouches[0].clientX,clientY:c.changedTouches[0].clientY,event:c})}))}),()=>{i(),$u&&(r(),a())}}).pipe($l())}},Ll=(()=>{class n{constructor(){this.renderer=f(Si),this.element=f(Jt),this.zone=f(Ai),this.resizableDirective=f(Us,{optional:!0}),this.resizeEdges={},this.eventListeners={},this.destroy$=new We}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)}),$u&&(this.listenOnTheHost("touchstart").subscribe(e=>{this.onMousedown(e,e.touches[0].clientX,e.touches[0].clientY)}),Wn(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,i){e.cancelable&&!tj(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:i,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,i){this.resizable.mousemove.next({clientX:t,clientY:i,edges:this.resizeEdges,event:e})}unsubscribeEventListeners(){Object.keys(this.eventListeners).forEach(e=>{this.eventListeners[e](),delete this.eventListeners[e]})}listenOnTheHost(e){return No(this.element.nativeElement,e).pipe(Ge(this.destroy$))}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275dir=vt({type:n,selectors:[["","mwlResizeHandle",""]],inputs:{resizeEdges:"resizeEdges",resizableContainer:"resizableContainer"}})}}return n})();var xg=(()=>{class n{httpController;constructor(e){this.httpController=e}getConfigs(e,t){return this.httpController.get(e,`/access/users/${t}/llm-model-configs`).pipe(uo(i=>(console.error("Failed to get user configs:",i),$o(()=>i))))}getOwnConfigs(e,t){return this.httpController.get(e,`/access/users/${t}/llm-model-configs/own`).pipe(uo(i=>(console.error("Failed to get user own configs:",i),$o(()=>i))))}getDefaultConfig(e,t){return this.httpController.get(e,`/access/users/${t}/llm-model-configs/default`).pipe(uo(i=>(console.error("Failed to get default config:",i),$o(()=>i))))}createConfig(e,t,i){return this.httpController.post(e,`/access/users/${t}/llm-model-configs`,i).pipe(uo(r=>(console.error("Failed to create config:",r),$o(()=>r))))}updateConfig(e,t,i,r){return this.httpController.put(e,`/access/users/${t}/llm-model-configs/${i}`,r).pipe(uo(a=>(console.error("Failed to update config:",a),$o(()=>a))))}deleteConfig(e,t,i){return this.httpController.delete(e,`/access/users/${t}/llm-model-configs/${i}`).pipe(uo(r=>(console.error("Failed to delete config:",r),$o(()=>r))))}setDefaultConfig(e,t,i){return this.httpController.put(e,`/access/users/${t}/llm-model-configs/default/${i}`,{}).pipe(uo(r=>(console.error("Failed to set default config:",r),$o(()=>r))))}unsetDefaultConfig(e,t,i){return this.httpController.put(e,`/access/users/${t}/llm-model-configs/${i}`,{is_default:!1}).pipe(uo(r=>(console.error("Failed to unset default config:",r),$o(()=>r))))}getGroupConfigs(e,t){return this.httpController.get(e,`/access/groups/${t}/llm-model-configs`).pipe(uo(i=>(console.error("Failed to get group configs:",i),$o(()=>i))))}getDefaultGroupConfig(e,t){return this.httpController.get(e,`/access/groups/${t}/llm-model-configs/default`).pipe(uo(i=>(console.error("Failed to get default group config:",i),$o(()=>i))))}createGroupConfig(e,t,i){return this.httpController.post(e,`/access/groups/${t}/llm-model-configs`,i).pipe(uo(r=>(console.error("Failed to create group config:",r),$o(()=>r))))}updateGroupConfig(e,t,i,r){return this.httpController.put(e,`/access/groups/${t}/llm-model-configs/${i}`,r).pipe(uo(a=>(console.error("Failed to update group config:",a),$o(()=>a))))}deleteGroupConfig(e,t,i){return this.httpController.delete(e,`/access/groups/${t}/llm-model-configs/${i}`).pipe(uo(r=>(console.error("Failed to delete group config:",r),$o(()=>r))))}setDefaultGroupConfig(e,t,i){return this.httpController.put(e,`/access/groups/${t}/llm-model-configs/default/${i}`,{}).pipe(uo(r=>(console.error("Failed to set default group config:",r),$o(()=>r))))}unsetDefaultGroupConfig(e,t,i){return this.httpController.put(e,`/access/groups/${t}/llm-model-configs/${i}`,{is_default:!1}).pipe(uo(r=>(console.error("Failed to unset default group config:",r),$o(()=>r))))}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Vl=(()=>{class n{defaultConfig={minVisibleSize:100,minWidth:500,minHeight:400};config$=new tn(this.defaultConfig);constructor(){}getConfig(){return this.config$.asObservable()}getConfigValue(){return this.config$.value}setConfig(e){let t=this.config$.value;this.config$.next(Z(Z({},t),e))}resetConfig(){this.config$.next(this.defaultConfig)}constrainDragPosition(e,t,i){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,g=window.innerWidth-a;u=Math.max(h,Math.min(g,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)+i,h=r.topOffset||0,g=window.innerHeight-c;u=Math.max(h,Math.min(g,u)),p.top=`${u}px`}else if(e.bottom!==void 0){let u=this.parsePx(e.bottom)-i,h=0,g=window.innerHeight-c-(r.topOffset||0);u=Math.max(h,Math.min(g,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 i=Number(e.split("px")[0])||0;return this.parsePxCache.set(e,i),i}parsePxCache=new Map;constrainResizeSize(e,t,i,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-(i||0),h=window.innerHeight-(r||0);return c=Math.min(c,u),p=Math.min(p,h),{width:c,height:p,left:i,top:r}}constrainWindowPosition(e){let t=this.config$.value,i=Number(e.width?.split("px")[0])||0,r=Number(e.height?.split("px")[0])||0,a=Z({},e);if(e.right!==void 0){let c=Number(e.right.split("px")[0]),p=0,u=window.innerWidth-i;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-i,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 i=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=i>=a.minWidth,p=r>=a.minHeight;return a.maxWidth&&i>a.maxWidth||a.maxHeight&&r>a.maxHeight?!1:c&&p}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function j2(n){let o=n.config.model,e=n.config.base_url,t=n.config.provider,i=t;if(e)try{i=new URL(e).hostname.replace(/^www\./,""),i=i.replace(/:\d+$/,"")}catch{i=t}return`${o} (${i})`}function Qv(n){let o=n.split("/");return o[o.length-1].replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase())}var S2e=(n,o)=>o.thread_id;function w2e(n,o){n&1&&(s(0,"mat-icon",12),d(1,"bug_report"),l())}function M2e(n,o){n&1&&(ti(),s(0,"svg",13),R(1,"path",27),l())}function k2e(n,o){if(n&1&&(s(0,"span",15),d(1),l()),n&2){let e=v().$implicit;m(),B(e.title||"New chat")}}function T2e(n,o){if(n&1){let e=z();s(0,"mat-form-field",31),_("click",function(i){return i.stopPropagation()}),s(1,"input",32,1),_("keydown.enter",function(){k(e);let i=ke(2),r=v().$implicit,a=v(2);return T(a.finishRename(r,i.value))})("keydown.escape",function(){k(e);let i=v().$implicit,r=v(2);return T(r.cancelRename(i))})("blur",function(){k(e);let i=ke(2),r=v().$implicit,a=v(2);return T(a.finishRename(r,i.value))}),l()()}if(n&2){let e=v().$implicit;m(),C("value",e.title)}}function E2e(n,o){if(n&1){let e=z();s(0,"div",10),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.selectSession(i.thread_id))}),s(1,"div",11),I(2,w2e,2,0,"mat-icon",12),I(3,M2e,2,0,":svg:svg",13),l(),s(4,"div",14),I(5,k2e,2,1,"span",15),I(6,T2e,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),_("click",function(i){return i.stopPropagation()}),ti(),s(13,"svg",21),R(14,"path",22),l()(),Vr(),s(15,"mat-menu",23,0),_("opened",function(){k(e);let i=v(2);return T(i.onMenuOpened())})("closed",function(){k(e);let i=v(2);return T(i.onMenuClosed())}),s(17,"button",24),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.renameSession(i))}),ti(),s(18,"svg",25),R(19,"path",26),l(),Vr(),s(20,"span"),d(21,"Rename"),l()(),s(22,"button",24),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.togglePinSession(i))}),ti(),s(23,"svg",25),R(24,"path",27),l(),Vr(),s(25,"span"),d(26),l()(),R(27,"mat-divider"),s(28,"button",28),_("click",function(i){let r=k(e).$implicit,a=v(2);return T(a.deleteSession(r,i))}),ti(),s(29,"svg",29),R(30,"path",30),l(),Vr(),s(31,"span"),d(32,"Delete"),l()()()()}if(n&2){let e=o.$implicit,t=ke(16),i=v(2);Ae("gns3-chat-session-list__session--active",e.thread_id===i.currentSessionId()),m(2),A(i.isFaultInjectionSession(e)?2:-1),m(),A(e.pinned?3:-1),m(2),A(e.editing?-1:5),m(),A(e.editing?6:-1),m(3),ee("",e.message_count," messages"),m(2),B(i.formatTime(e.updated_at)),m(),C("matMenuTriggerFor",t),m(14),B(e.pinned?"Unpin":"Pin")}}function D2e(n,o){if(n&1&&K(0,E2e,33,10,"div",9,S2e),n&2){let e=v();Y(e.sortedSessions)}}function P2e(n,o){n&1&&(s(0,"div",8),ti(),s(1,"svg",33),R(2,"path",34),l(),Vr(),s(3,"p",35),d(4,"No sessions"),l(),s(5,"p",36),d(6,"Click button above to create new session"),l()())}var $2=(()=>{class n{dialog=f(it);aiChatService=f(sh);snackBar=f(br);sessions=ae([]);currentSessionId=ae(null);controller=ae(void 0);projectId=ae(void 0);sessionSelected=new _e;sessionCreated=new _e;sessionRenamed=new _e;sessionDeleted=new _e;sessionPinned=new _e;sessionUnpinned=new _e;constructor(){}onMenuOpened(){}onMenuClosed(){}get sortedSessions(){let e=this.sessions().filter(r=>r.pinned),t=this.sessions().filter(r=>!r.pinned),i=(r,a)=>{let c=new Date(r.updated_at).getTime();return new Date(a.updated_at).getTime()-c};return[...e.sort(i),...t.sort(i)]}selectSession(e){this.sessionSelected.emit(e)}createNewSession(){this.sessionCreated.emit()}renameSession(e){e.editing=!0}finishRename(e,t){let i=t.trim();i&&this.sessionRenamed.emit({sessionId:e.thread_id,title:i}),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 i=`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,g=c-u/2,y=p-h/2,b=window.innerWidth,x=window.innerHeight;g<10&&(g=10),g+u>b-10&&(g=b-u-10),y<10&&(y=10),y+h>x-10&&(y=x-h-10),r={top:`${y}px`,left:`${g}px`}}this.dialog.open(Ga,{data:{message:i},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 i=t?.error?.message||t?.message||"Failed to delete session";this.snackBar.open(i,"Close",{duration:6e3,panelClass:["ai-chat-snack-error"],horizontalPosition:"center",verticalPosition:"bottom"})}})}formatTime(e){if(!e)return"";let i=/[Z+-]\d{2}:?\d{2}$/.test(e)?e:e+"Z",r=new Date(i),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 p5(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,i){t&1&&(s(0,"div",2)(1,"div",3)(2,"button",4),_("click",function(){return i.createNewSession()}),ti(),s(3,"svg",5),R(4,"path",6),l(),Vr(),s(5,"span"),d(6,"New Chat"),l()()(),s(7,"div",7),I(8,D2e,2,0)(9,P2e,7,0,"div",8),l()()),t&2&&(m(8),A(i.sessions().length>0?8:9))},dependencies:[ne,oe,de,Se,Te,Me,we,qe,Kn,tt,Fn,G,pe,ze,ve,ns,yr,qr],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 I2e=n=>["segment",n],A2e=(n,o)=>({"segment-main":!0,expandable:n,expanded:o});function O2e(n,o){n&1&&R(0,"div",9)}function N2e(n,o){if(n&1&&(s(0,"span",10),d(1),l()),n&2){let e=v().$implicit;m(),B(e.description)}}function F2e(n,o){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 R2e(n,o){if(n&1){let e=z();s(0,"section",2)(1,"section",3),_("click",function(){let i=k(e).$implicit,r=v();return T(r.toggle(i))}),Ce(2,O2e,1,0,"div",4),s(3,"span",5),d(4),l(),s(5,"span",6),d(6,": "),l(),Ce(7,N2e,2,1,"span",7),l(),Ce(8,F2e,2,4,"section",8),l()}if(n&2){let e=o.$implicit,t=v();C("ngClass",un(6,I2e,"segment-type-"+e.type)),m(),C("ngClass",aa(8,A2e,t.isExpandable(e),e.expanded)),m(),C("ngIf",t.isExpandable(e)),m(2),B(e.key),m(3),C("ngIf",!e.expanded||!t.isExpandable(e)),m(),C("ngIf",e.expanded&&t.isExpandable(e))}}var nj=(()=>{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 i={key:e,value:t,type:void 0,description:""+t,expanded:this.isExpanded()};switch(typeof i.value){case"number":{i.type="number";break}case"boolean":{i.type="boolean";break}case"function":{i.type="function";break}case"string":{i.type="string",i.description='"'+i.value+'"';break}case"undefined":{i.type="undefined",i.description="undefined";break}case"object":{i.value===null?(i.type="null",i.description="null"):Array.isArray(i.value)?(i.type="array",i.description="Array["+i.value.length+"] "+JSON.stringify(i.value)):i.value instanceof Date?i.type="date":(i.type="object",i.description="Object "+JSON.stringify(i.value));break}}return i}isExpanded(){return this.expanded&&!(this.depth>-1&&this._currentDepth>=this.depth)}decycle(e){let t=new WeakMap;return(function i(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]=i(u,a+"["+h+"]")})):(p={},Object.keys(r).forEach(function(u){p[u]=i(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:[Pn],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),Ce(1,R2e,9,11,"section",1),l()),e&2&&(m(),C("ngForOf",t.segments))},dependencies:[Ji,n4,i4,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})(),ij=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=Gt({type:n}),n.\u0275inj=Wt({imports:[ne]}),n})();function V2e(n,o){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),B(e.toolCall().function.name),m(5),C("json",e.parsedArguments())("expanded",!0)}}function B2e(n,o){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),B(e.toolName()),m(5),C("json",e.parsedOutput())("expanded",!1)}}var Xv=(()=>{class n{dialogRef;data;type=Q("tool_call");toolCall=Q(void 0);toolName=Q(void 0);toolOutput=Q(void 0);parsedArguments=Q(null);parsedOutput=Q(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 i=e.function.arguments;typeof i=="string"?this.parsedArguments.set(JSON.parse(i)):i.tool_input&&typeof i.tool_input=="string"?this.parsedArguments.set(JSON.parse(i.tool_input)):this.parsedArguments.set(i)}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)(at(Ie),at(Ct))};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,i){t&1&&(s(0,"h1",0),d(1),l(),s(2,"div",1),I(3,V2e,10,3),I(4,B2e,10,3),l(),s(5,"div",2)(6,"button",3),_("click",function(){return i.closeDialog()}),d(7,"Close"),l()()),t&2&&(m(),B(i.title),m(2),A(i.type()==="tool_call"&&i.toolCall()?3:-1),m(),A(i.type()==="tool_result"?4:-1))},dependencies:[ne,ve,Le,Ve,St,G,pe,ij,nj],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 z2e(n,o){if(n&1&&(s(0,"span",3),d(1),l()),n&2){let e=v();m(),B(e.data.language)}}var oj=(()=>{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)(at(Ie),at(Ct))};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,i){t&1&&(s(0,"h2",0)(1,"mat-icon",1),d(2,"code"),l(),s(3,"span",2),d(4,"Code Block"),l(),I(5,z2e,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),_("click",function(){return i.close()}),s(11,"mat-icon"),d(12,"close"),l(),s(13,"span"),d(14,"Close"),l()()()),t&2&&(m(5),A(i.data.language?5:-1),m(3),C("innerHTML",i.data.code,wp))},dependencies:[Le,St,Ve,G,pe,oe,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 j2e=["messageContainer"],rj=(n,o)=>o.id;function $2e(n,o){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),B(t.formatTime(e.created_at))}}function H2e(n,o){n&1&&(ti(),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 U2e(n,o){if(n&1){let e=z();s(0,"div",27),_("click",function(){let i=k(e).$implicit,r=v(4);return T(r.openToolCallDialog(i))}),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=o.$implicit;m(4),B(e.function.name)}}function W2e(n,o){if(n&1&&(s(0,"div",16),K(1,U2e,7,1,"div",26,rj),l()),n&2){let e=v(2).$implicit;m(),Y(e.tool_calls)}}function G2e(n,o){if(n&1){let e=z();s(0,"div",32),_("click",function(){let i=k(e).$implicit,r=v(4);return T(r.openAssistantToolResultDialog(i))}),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=o.$implicit;m(4),B(e.toolName)}}function q2e(n,o){if(n&1&&(s(0,"div",17),K(1,G2e,7,1,"div",31,Ni),l()),n&2){let e=v(2).$implicit;m(),Y(e.tool_result)}}function Q2e(n,o){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),I(6,H2e,10,0,":svg:svg",15),l(),I(7,W2e,3,0,"div",16),I(8,q2e,3,0,"div",17),s(9,"div",11),d(10),l()()()),n&2){let e=v().$implicit,t=v();m(4),Ae("gns3-chat-message-list__bubble--streaming",t.isStreaming()&&e===t.lastAssistantMessage),m(),C("data",e.content),m(),A(t.isStreaming()&&e===t.lastAssistantMessage&&e.content?6:-1),m(),A(e.tool_calls&&e.tool_calls.length>0?7:-1),m(),A(e.tool_result&&e.tool_result.length>0?8:-1),m(2),B(t.formatTime(e.created_at))}}function X2e(n,o){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 K2e(n,o){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),B(e.metadata.error)}}function Y2e(n,o){if(n&1&&(I(0,$2e,9,2,"div",4),I(1,Q2e,11,7,"div",5),I(2,X2e,3,1,"div",5),I(3,K2e,6,1,"div",5)),n&2){let e=o.$implicit;A(e.role==="user"?0:-1),m(),A(e.role==="assistant"?1:-1),m(),A(e.role==="system"?2:-1),m(),A(e.metadata!=null&&e.metadata.error?3:-1)}}function Z2e(n,o){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),_("click",function(){k(e);let i=v();return T(i.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),_("click",function(){k(e);let i=v();return T(i.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),_("click",function(){k(e);let i=v();return T(i.sendSuggestion("Find potential network issues"))}),s(20,"mat-icon"),d(21,"search"),l(),s(22,"span"),d(23,"Find network issues"),l()()()()()}}var H2=(()=>{class n{messages=ae([]);isStreaming=ae(!1);autoScroll=ae(!0);scrollToEnd=new _e;suggestionClicked=new _e;messageContainer=Rt.required("messageContainer");shouldScrollToBottom=!1;dialog=f(it);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(i=>{if(i.hasAttribute("data-code-processed"))return;let r=i.querySelector("code");if(!r)return;let a=r.textContent?.split(`
|
||
`).length||0;i.setAttribute("data-code-processed","true"),a>50&&(i.classList.add("code-block-collapsible"),i.setAttribute("title",`Click to view full code (${a} lines)`),i.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),this.openCodeBlockDialog(r.innerHTML,r.className)}))})}wrapTables(e){e.querySelectorAll("markdown table").forEach(i=>{if(i.parentElement?.classList.contains("markdown-table-wrapper"))return;let r=document.createElement("div");r.className="markdown-table-wrapper",i.parentNode?.insertBefore(r,i),r.appendChild(i)})}openCodeBlockDialog(e,t){let i=t.match(/language-(\w+)/)?.[1]||void 0,r={code:e,language:i};this.dialog.open(oj,{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 i;t!==void 0?i=t:i=e;let r={type:"tool_call",toolCall:i};this.dialog.open(Xv,{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(Xv,{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,i){t&1&&Xt(i.messageContainer,j2e,5),t&2&&Kt()},inputs:{messages:[1,"messages"],isStreaming:[1,"isStreaming"],autoScroll:[1,"autoScroll"]},outputs:{scrollToEnd:"scrollToEnd",suggestionClicked:"suggestionClicked"},features:[Pn],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,i){t&1&&(s(0,"div",1,0)(2,"div",2),K(3,Y2e,4,4,null,null,rj),I(5,Z2e,24,0,"div",3),l()()),t&2&&(Ae("gns3-chat-message-list--auto-scroll",i.autoScroll()),m(3),Y(i.messages()),m(2),A(i.messages().length===0?5:-1))},dependencies:[ne,oe,de,ve,ng,dw],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 J2e=["messageInput"],eMe=["menuTrigger"],tMe=(n,o)=>o.config_id;function nMe(n,o){n&1&&(s(0,"mat-icon",7),d(1,"stop"),l())}function iMe(n,o){n&1&&(s(0,"mat-icon"),d(1,"send"),l())}function oMe(n,o){n&1&&(s(0,"mat-icon",7),d(1,"refresh"),l())}function rMe(n,o){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(),Ae("gns3-chat-input-area__char-count--warning",e.isNearLimit),m(),B(e.message().length),m(4),B(e.maxLength())}}function aMe(n,o){n&1&&(s(0,"span",21),d(1,"Group"),l())}function sMe(n,o){if(n&1){let e=z();s(0,"button",19),_("click",function(){let i=k(e).$implicit,r=v();return T(r.selectModel(i))}),s(1,"mat-icon"),d(2),l(),s(3,"span",20),d(4),l(),I(5,aMe,2,0,"span",21),l()}if(n&2){let e=o.$implicit,t=v();Ae("selected",e.config_id===t.currentModelId()),m(2),B(e.config_id===t.currentModelId()?"check_circle":"radio_button_unchecked"),m(2),B(t.getModelDisplayName(e)),m(),A(e.source==="group"?5:-1)}}function lMe(n,o){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 cMe(n,o){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),_("click",function(){k(e);let i=v();return T(i.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),_("click",function(){k(e);let i=v();return T(i.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),Ae("selected",e.currentCopilotMode()==="teaching_assistant"),m(2),B(e.currentCopilotMode()==="teaching_assistant"?"check_circle":"radio_button_unchecked"),m(6),Ae("selected",e.currentCopilotMode()==="lab_automation_assistant"),m(2),B(e.currentCopilotMode()==="lab_automation_assistant"?"check_circle":"radio_button_unchecked")}}var U2=(()=>{class n{placeholder=ae("Message (Ctrl+Enter to send)");disabled=ae(!1);isStreaming=ae(!1);maxLength=ae(4e3);showCharCount=ae(!1);warningThreshold=ae(.9);modelConfigs=ae([]);currentModelId=ae(null);currentCopilotMode=ae("teaching_assistant");messageSent=new _e;inputChanged=new _e;modelSelected=new _e;copilotModeSelected=new _e;abortClicked=new _e;messageInput=Rt.required("messageInput");menuTrigger=Rt.required("menuTrigger");message=U("");textareaHeight=48;destroy$=new We;previousMessageLength=0;currentTheme="";themeService=f(pi);cdr=f(X);overlayContainer=f(eh);constructor(){this.currentTheme=this.themeService.savedTheme}ngOnInit(){setTimeout(()=>{this.adjustTextareaHeight()},0),this.themeService.themeChanged.pipe(Ge(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 i=t.scrollHeight,r=Math.min(Math.max(i,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(i=>i.config_id===this.currentModelId());return t?Qv(t.config.model):Qv(e[0].config.model)}getFullModelDisplayName(){let e=this.modelConfigs();if(!e||e.length===0)return"No model configured";let t=e.find(i=>i.config_id===this.currentModelId());return t?j2(t):j2(e[0])}getModelDisplayName(e){return j2(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,i){t&1&&Xt(i.messageInput,J2e,5)(i.menuTrigger,eMe,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,i){if(t&1&&(s(0,"div",3)(1,"div",4)(2,"textarea",5,0),_("input",function(a){return i.onInputChange(a.target.value)})("keydown",function(a){return i.handleKeyDown(a)}),l(),s(4,"button",6),_("click",function(){return i.sendMessage()}),I(5,nMe,2,0,"mat-icon",7)(6,iMe,2,0,"mat-icon")(7,oMe,2,0,"mat-icon",7),l(),s(8,"button",8,1),_("menuOpened",function(){return i.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()()(),I(16,rMe,7,4,"div",12),l(),s(17,"mat-menu",13,2)(19,"div",14),d(20,"Select AI Model"),l(),R(21,"mat-divider"),K(22,sMe,6,5,"button",15,tMe),I(24,lMe,6,0),I(25,cMe,20,6),l()),t&2){let r=ke(18);m(2),Yt("height",i.textareaHeight,"px"),C("placeholder",i.placeholder())("disabled",i.disabled())("value",i.message())("rows",1)("maxLength",i.maxLength()),m(2),Ae("gns3-chat-input-area__send-button--abort",i.isStreaming()),C("disabled",(!i.canSend||i.disabled())&&!i.isStreaming()),m(),A(i.isStreaming()?5:i.disabled()?7:6),m(3),C("matMenuTriggerFor",r)("disabled",i.disabled()||!i.modelConfigs()||i.modelConfigs().length===0)("title",i.getFullModelDisplayName()),m(5),B(i.getCurrentModelDisplayName()),m(3),A(i.showCharCount()?16:-1),m(6),Y(i.modelConfigs()),m(2),A(!i.modelConfigs()||i.modelConfigs().length===0?24:-1),m(),A(i.modelConfigs()&&i.modelConfigs().length>0?25:-1)}},dependencies:[ne,oe,de,_c,Zs,qe,Kn,tt,Fn,yr,qr],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 dMe=()=>({top:!0}),mMe=()=>({right:!0}),pMe=()=>({bottom:!0}),uMe=()=>({left:!0}),hMe=()=>({top:!0,left:!0}),fMe=()=>({top:!0,right:!0}),gMe=()=>({bottom:!0,left:!0}),_Me=()=>({bottom:!0,right:!0});function vMe(n,o){if(n&1){let e=z();s(0,"div",2),_("mousemove",function(i){k(e);let r=v();return T(r.dragWidget(i))},qu)("mouseup",function(){k(e);let i=v();return T(i.toggleDragging(!1))},qu),l()}}function CMe(n,o){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",Tt(8,dMe)),m(),C("resizeEdges",Tt(9,mMe)),m(),C("resizeEdges",Tt(10,pMe)),m(),C("resizeEdges",Tt(11,uMe)),m(),C("resizeEdges",Tt(12,hMe)),m(),C("resizeEdges",Tt(13,fMe)),m(),C("resizeEdges",Tt(14,gMe)),m(),C("resizeEdges",Tt(15,_Me)))}function xMe(n,o){n&1&&(s(0,"span",15),d(1,"Assistant"),l())}function bMe(n,o){if(n&1){let e=z();s(0,"div",16)(1,"button",33),_("click",function(){k(e);let i=v(2);return T(i.onSessionCreated())}),s(2,"mat-icon"),d(3,"add"),l()()()}}function yMe(n,o){if(n&1){let e=z();s(0,"div",16)(1,"app-chat-session-list",34),_("sessionSelected",function(i){k(e);let r=v(2);return T(r.onSessionSelected(i))})("sessionCreated",function(){k(e);let i=v(2);return T(i.onSessionCreated())})("sessionRenamed",function(i){k(e);let r=v(2);return T(r.onSessionRenamed(i))})("sessionDeleted",function(i){k(e);let r=v(2);return T(r.onSessionDeleted(i))})("sessionPinned",function(i){k(e);let r=v(2);return T(r.onSessionPinned(i))})("sessionUnpinned",function(i){k(e);let r=v(2);return T(r.onSessionUnpinned(i))}),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 SMe(n,o){n&1&&(ti(),R(0,"path",25))}function wMe(n,o){n&1&&(ti(),R(0,"path",26))}function MMe(n,o){if(n&1){let e=z();s(0,"div",11)(1,"div",12)(2,"h3",13),_("mousedown",function(i){return i.stopPropagation()})("click",function(){k(e);let i=v();return T(i.toggleSidebar())}),s(3,"span",14),d(4,"AI"),l(),I(5,xMe,2,0,"span",15),l()(),I(6,bMe,4,0,"div",16),I(7,yMe,2,4,"div",16),l(),s(8,"div",17)(9,"div",18),_("mousedown",function(){k(e);let i=v();return T(!i.isMaximized&&i.toggleDragging(!0))}),s(10,"div",19)(11,"span"),d(12),l()(),s(13,"div",20)(14,"button",21),_("mousedown",function(i){return i.stopPropagation()})("click",function(i){k(e);let r=v();return i.stopPropagation(),T(r.minimizeChat())}),ti(),s(15,"svg",22),R(16,"path",23),l()(),Vr(),s(17,"button",24),_("mousedown",function(i){return i.stopPropagation()})("click",function(i){k(e);let r=v();return i.stopPropagation(),T(r.maximizeChat())}),ti(),s(18,"svg",22),I(19,SMe,1,0,":svg:path",25),I(20,wMe,1,0,":svg:path",26),l()(),Vr(),s(21,"button",27),_("mousedown",function(i){return i.stopPropagation()})("click",function(i){k(e);let r=v();return i.stopPropagation(),T(r.closeChat())}),ti(),s(22,"svg",22),R(23,"path",28),l()()()(),Vr(),s(24,"div",29)(25,"app-chat-message-list",30),_("scrollToEnd",function(){k(e);let i=v();return T(i.onScrollToEnd())})("suggestionClicked",function(i){k(e);let r=v();return T(r.onSuggestionClicked(i))}),l()(),s(26,"div",31)(27,"app-chat-input-area",32),_("messageSent",function(i){k(e);let r=v();return T(r.onMessageSent(i))})("modelSelected",function(i){k(e);let r=v();return T(r.onModelSelected(i))})("copilotModeSelected",function(i){k(e);let r=v();return T(r.onCopilotModeSelected(i))})("abortClicked",function(){k(e);let i=v();return T(i.onAbortClicked())}),l()()()}if(n&2){let e=v();Ae("gns3-ai-chat__sidebar--collapsed",e.sidebarCollapsed),m(2),Ae("gns3-ai-chat__sidebar-title--clickable",!0),m(3),A(e.sidebarCollapsed?-1:5),m(),A(e.sidebarCollapsed?6:-1),m(),A(e.sidebarCollapsed?-1:7),m(5),B(e.currentSessionTitle),m(7),A(e.isMaximized?-1:19),m(),A(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 W2=(()=>{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=ae.required();controller;zIndex=ae(1e3);closed=new _e;windowFocused=new _e;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 We;saveStateTimer=null;dragRafId=null;aiChatService=f(sh);controllerService=f(nt);aiProfilesService=f(xg);loginService=f(vl);aiChatStore=f(vg);snackBar=f(br);cdr=f(X);boundaryService=f(Vl);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,i=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:`${i}px`},this.previousStyle=Z({},this.style),this.resizedWidth=t,this.resizedHeight=i,this.isMaximized?this.applyMaximizedStyle():this.isMinimized&&this.applyMinimizedStyle()}subscribeToStateChanges(){this.aiChatStore.getSessions().pipe(Ge(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(Ge(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(Ge(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(Ge(this.destroy$)).subscribe({next:e=>{let t=this.isMinimized,i=this.isMaximized;if(this.isMinimized=e.isMinimized,this.isMaximized=e.isMaximized,t&&!e.isMinimized?(Object.keys(this.previousStyle).length>0&&(this.style=Z({},this.previousStyle)),this.cdr.markForCheck()):!t&&e.isMinimized&&(this.previousStyle=Z({},this.style),this.style={position:"fixed",left:"-9999px",top:"-9999px",width:"0px",height:"0px"},this.cdr.markForCheck()),i&&!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(yi(t=>{this.aiChatStore.setSessions(t)}),Ge(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(yi(i=>{let r=this.convertLegacyToolMessages(i.messages);this.aiChatStore.setMessages(e,r),this.currentMessages=r,this.cdr.markForCheck()}),Ge(this.destroy$)).subscribe({error:i=>{this.logError("Failed to load session history:",i),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(yi(i=>{this.aiChatStore.updateSession(i)}),Ge(this.destroy$)).subscribe({error:i=>{this.logError("Failed to rename session:",i),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(yi(i=>{this.aiChatStore.updateSession(i)}),Ge(this.destroy$)).subscribe({error:i=>{this.logError("Failed to pin session:",i),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(yi(i=>{this.aiChatStore.updateSession(i)}),Ge(this.destroy$)).subscribe({error:i=>{this.logError("Failed to unpin session:",i),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()},i=[...this.currentMessages,t];this.currentMessages=i;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(i=>{this.controller=i,this.aiChatStore.setStreamingState(!0),this.aiChatStore.clearError(),this.aiChatService.streamChat(this.controller,this.project().project_id,{message:e,session_id:t,stream:!0}).pipe(Ge(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(i=>{this.logError("Failed to get fresh controller:",i),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 i=this.currentAssistantMessage.tool_calls.find(r=>r.id===t.id);i?(i.function.arguments=t.function.arguments,i.function.complete=t.function.complete):this.currentAssistantMessage.tool_calls.push(Z({},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(i=>i.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 i=this.currentMessages.length-1;i>=0;i--){let r=this.currentMessages[i];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 i={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,i]}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=Z({},this.style),this.isMaximized=!0,this.isMinimized=!1,this.aiChatStore.maximizePanel(),this.applyMaximizedStyle()}minimizeChat(){if(this.isMinimized){this.restoreChat();return}this.previousStyle=Z({},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 i=300,r=t;r.length>i&&(r=r.substring(0,i)+"..."),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 i=e.match(/Error code:\s*(\d+)\s*-\s*(.+)/);if(i){let a=i[1],c=i[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 i=0;i<e.length;i++)e[i]=Math.floor(Math.random()*256);let t=Array.from(e,i=>i.toString(16).padStart(2,"0")).join("");return`msg_${Date.now()}_${t}`}convertLegacyToolMessages(e){let t=[],i=-1;for(let r of e)if(r.role==="tool")if(i>=0){let a=t[i];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),i=t.length-1}else t.push(Z({},r)),r.role==="assistant"&&(i=t.length-1);return t}generateUUID(){let e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let i=0;i<e.length;i++)e[i]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,i=>i.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),i=this.style.left!==void 0,r={position:"fixed",top:t.top!==void 0?`${t.top}px`:this.style.top};if(i)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=Ye(Z({},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]),i=Number(this.style.width?.split("px")[0]),r=Number(this.style.height?.split("px")[0]);!isNaN(i)&&!isNaN(r)&&this.aiChatStore.updatePanelSize(i,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(Ge(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(Ge(this.destroy$)).subscribe({next:i=>{this.currentModelId=i.config_id,this.currentCopilotMode=i.config?.copilot_mode||"teaching_assistant",this.cdr.markForCheck();let r=Qv(e.config.model);this.snackBar.open(`Switched to ${r}`,"Close",{duration:3e3,horizontalPosition:"center",verticalPosition:"bottom"})},error:i=>{this.logError("Failed to set default model:",i),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(Ge(this.destroy$)).subscribe({next:i=>{this.currentCopilotMode=i.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:i=>{this.logError("Failed to update copilot mode:",i),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(Ge(this.destroy$)).subscribe({next:()=>{this.logError("Chat aborted successfully")},error:i=>{this.logError("Failed to abort chat:",i),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,i){t&1&&_("resize",function(){return i.onWindowResize()},Zo)},inputs:{project:[1,"project"],controller:"controller",zIndex:[1,"zIndex"]},outputs:{closed:"closed",windowFocused:"windowFocused"},features:[Pn],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,i){t&1&&(I(0,vMe,1,0,"div",0),s(1,"div",1),_("mousedown",function(){return i.onWindowFocus()})("resizeStart",function(){return i.toggleDragging(!1)})("resizeEnd",function(a){return i.onResizeEnd(a)}),I(2,CMe,8,16),I(3,MMe,28,17),l()),t&2&&(A(i.isDraggingEnabled&&!i.isMaximized&&!i.isMinimized?0:-1),m(),Yt("z-index",i.zIndex()),Ae("gns3-ai-chat--maximized",i.isMaximized)("gns3-ai-chat--minimized",i.isMinimized),C("ngStyle",i.style)("validateResize",i.validate)("enableGhostResize",!0),m(),A(i.isMinimized?-1:2),m(),A(i.isMinimized?-1:3))},dependencies:[ne,Xs,Us,Ll,ns,oe,de,G,ze,$2,H2,U2],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 aj="gns3_console_appearance",Kv=16,_O=8,vO=28,kMe="ui-monospace, 'Cascadia Code', 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, 'Courier New', monospace",sj=[{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"}],bg=(()=>{class n{themeService;_allowedFontFamilies=new Set(sj.map(e=>e.value).filter(e=>e!==null));_settingsChanged=new We;settingsChanged$=this._settingsChanged.asObservable();_settings={fontSize:Kv,fontFamily:null,foregroundColor:null,backgroundColor:null};constructor(e){this.themeService=e,this.loadSettings()}get settings(){return Z({},this._settings)}loadSettings(){try{let e=localStorage.getItem(aj);if(e){let t=JSON.parse(e);this._settings=this._sanitizeSettings(t)}}catch{}}updateSettings(e){this._settings=this._sanitizeSettings(Z(Z({},this._settings),e));try{localStorage.setItem(aj,JSON.stringify(this._settings))}catch{}this._settingsChanged.next(Z({},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)?Kv:Math.max(_O,Math.min(vO,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 i=t.getContext("2d");if(!i)return"#000000";i.fillStyle=e,i.fillRect(0,0,1,1);let[r,a,c]=i.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),i={};for(let r of e)i[r]=t.getPropertyValue(r).trim();return i}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"]),i=this._settings.foregroundColor||t["--mat-sys-on-surface"],r=this._settings.backgroundColor||t["--mat-sys-surface"],a={background:r,foreground:i,cursor:i,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 i=this.themeService.getActualTheme()==="light";e.options.theme=this.buildTerminalTheme(i),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`:kMe}initTerminal(e,t){e.loadAddon(t),t.activate(e)}getInstalledFonts(){return sj.filter(e=>e.value?this._isFontInstalled(e.value):!0)}_isFontInstalled(e){try{if(document.fonts.check(`16px "${e}"`))return!0;let i=document.createElement("canvas").getContext("2d");if(!i)return!1;let r="abcdefghijklmnopqrstuvwxyz0123456789".repeat(2);i.font=`16px "${e}", monospace`;let a=i.measureText(r).width;i.font="16px monospace";let c=i.measureText(r).width;return Math.abs(a-c)>1}catch{return!1}}applySettingsToTerminal(e,t,i){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),i?.markForCheck()}calculateTerminalDimensions(e,t,i){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(i/a.height)}}return{cols:Math.floor(t/8.4),rows:Math.floor(i/17)}}static \u0275fac=function(t){return new(t||n)(ge(pi))};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var lj=n=>({lightTheme:n}),TMe=(n,o)=>o.node_id;function EMe(n,o){n&1&&(s(0,"span",4),d(1,"Devices"),l())}function DMe(n,o){if(n&1){let e=z();s(0,"div",8),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.onDeviceClick(i))}),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=o.$implicit,t=v(2);Ae("started",t.isDeviceStarted(e)),m(2),Yt("background-color",t.getStatusColor(e.status)),m(3),B(e.name),m(),Ae("disabled",!t.isDeviceStarted(e))}}function PMe(n,o){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 IMe(n,o){if(n&1&&(s(0,"div",5),K(1,DMe,8,7,"div",6,TMe),I(3,PMe,5,0,"div",7),l()),n&2){let e=v();m(),Y(e.nodes()),m(2),A(e.nodes().length===0?3:-1)}}var G2=(()=>{class n{nodesDataSource=f(ui);cdr=f(X);deviceSelected=new _e;isLightTheme=ae(!1);nodes=Q([]);collapsed=Q(!0);destroy$=new We;constructor(){}ngOnInit(){this.nodesDataSource.changes.pipe(Ge(this.destroy$)).subscribe(e=>{let t=e.filter(i=>{let r=i.console_type==="none"||!i.console_type,a=i.console_type==="vnc",c=i.console_type&&i.console_type.startsWith("http");return!r&&!a&&!c});this.nodes.set(t),this.sortNodes(),this.cdr.markForCheck()}),this.nodesDataSource.itemChanged.pipe(Ge(this.destroy$)).subscribe(e=>{let t=this.nodes(),i=t.findIndex(r=>r.node_id===e.node_id);i>=0&&(t[i]=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,i)=>{let r=t.status==="started",a=i.status==="started";return r&&!a?-1:!r&&a?1:t.name.localeCompare(i.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,i){t&1&&(s(0,"div",0)(1,"div",1),_("mousedown",function(a){return a.stopPropagation()})("click",function(){return i.togglePanel()}),s(2,"div",2)(3,"mat-icon",3),d(4,"devices"),l(),I(5,EMe,2,0,"span",4),l()(),I(6,IMe,4,1,"div",5),l()),t&2&&(Ae("collapsed",i.collapsed()),C("ngClass",un(8,lj,i.isLightTheme())),m(),Ae("clickable",!0),C("ngClass",un(10,lj,i.isLightTheme())),m(4),A(i.collapsed()?-1:5),m(),A(i.collapsed()?-1:6))},dependencies:[ne,Ji,oe,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 dj=Gs(xO()),mj=Gs(yO()),pj=Gs(wO());var K2=(()=>{class n{toaster=f(ie);currentMenu=null;attachContextMenu(e,t){let i=r=>{r.preventDefault(),this.showContextMenu(r,e)};return t.addEventListener("contextmenu",i),()=>{t.removeEventListener("contextmenu",i)}}showContextMenu(e,t){this.dismissCurrentMenu();let i=!1;try{if(typeof t.hasSelection=="function")i=t.hasSelection();else{let p=t.getSelection();i=p!=null&&p.trim().length>0}}catch(p){console.error("Error checking selection:",p);let u=t.getSelection();i=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,i),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,i=e.clientY,r=180,a=120;return t+r>window.innerWidth&&(t=window.innerWidth-r-10),i+a>window.innerHeight&&(i=window.innerHeight-a-10),t=Math.max(10,t),i=Math.max(10,i),{left:t,top:i}}createMenuItems(e,t,i){if(i){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),i){let p=this.createMenuItem("Clear Selection","",()=>{try{t.clearSelection()}catch(u){console.error("Error clearing selection:",u)}});e.appendChild(p)}}createMenuItem(e,t,i){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",()=>{i(),this.dismissCurrentMenu()}),r.addEventListener("keydown",a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),r.click())}),r}setupMenuCleanup(e,t){let i=!1,r=()=>{i||(i=!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 g=Array.from(h.removedNodes);for(let y of g)if(y===e){document.removeEventListener("click",a),document.removeEventListener("keydown",c),p.disconnect();return}}});p.observe(document.body,{childList:!0,subtree:!1}),setTimeout(()=>{i||(document.addEventListener("click",a),document.addEventListener("keydown",c))},0)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var AMe=["terminal"],yg=(()=>{class n{controller=ae(void 0);project=ae(void 0);node=ae(void 0);consoleService=f(mr);themeService=f(pi);cdr=f(X);contextMenuService=f(K2);xtermService=f(bg);term=new dj.Terminal(Z({cols:100,rows:32},this.xtermService.getDefaultTerminalOptions()));fitAddon=new pj.FitAddon;socket=null;isLightThemeEnabled=!1;resizeObserver=null;contextMenuCleanup=null;destroy$=new We;isDestroying=!1;terminal=Rt("terminal");constructor(){}ngOnInit(){this.isLightThemeEnabled=this.themeService.getActualTheme()==="light",this.cdr.markForCheck(),this.themeService.themeChanged.pipe(Ge(this.destroy$)).subscribe(()=>{this.xtermService.updateTerminalTheme(this.term,this.cdr),this.isLightThemeEnabled=this.themeService.getActualTheme()==="light"}),this.consoleService.consoleResized.pipe(Ge(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 i=this.node();i&&this.consoleService.closeConsoleForNode(i)}};let t=new mj.AttachAddon(this.socket);this.term.loadAddon(t),this.xtermService.initTerminal(this.term,this.fitAddon),this.fitAddon.fit(),this.term.focus(),this.term.attachCustomKeyEventHandler(i=>{if(i.altKey&&i.key>="1"&&i.key<="9"){let r=new CustomEvent("consoleTabShortcut",{detail:{key:i.key},bubbles:!0});return this.term.element.dispatchEvent(r),!1}return!((i.code==="KeyC"||i.code==="KeyV")&&i.ctrlKey&&i.shiftKey)}),this.setupResizeObserver(),this.xtermService.settingsChanged$.pipe(Ge(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 i of t){let{width:r,height:a}=i.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,i){t&1&&Xt(i.terminal,AMe,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,i){t&1&&ks(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 uj={name:"gns3-web-ui",version:"3.1.0a5",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",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 Sg=uj.version;var Y2=(()=>{class n extends em{getItemKey(e){return e}static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var hj=Gs(mO());var NMe=["console"],FMe=["commandInput"],Z2=n=>({lightTheme:n});function RMe(n,o){if(n&1&&(s(0,"span",9),d(1),R(2,"br"),l()),n&2){let e=o.$implicit;m(),ee(" ",e.message," ")}}var wg=(()=>{class n{projectWebServiceHandler=f(Jf);nodeService=f(ut);nodesDataSource=f(ui);protocolHandlerService=f(vp);logEventsDataSource=f(Y2);httpService=f(mn);themeService=f(pi);cd=f(X);nodeConsoleService=f(mr);controller;project=ae(void 0);console=Rt("console");commandInput=Rt("commandInput");focusInput(){let e=this.commandInput();e?.nativeElement&&e.nativeElement.focus()}version=Sg;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 $e(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,i="";t.label?i=`Event received: ${e.action} - ${this.printNode(t)}.`:i=`Event received: ${e.action} - ${t.name}.`,this.showMessage({type:"map update",message:i})}),this.linkSubscription=this.projectWebServiceHandler.linkNotificationEmitter.subscribe(e=>{let t=e.event,i=`Event received: ${e.action} - ${this.printLink(t)}.`;this.showMessage({type:"map update",message:i})}),this.drawingSubscription=this.projectWebServiceHandler.drawingNotificationEmitter.subscribe(e=>{let t=e.event,i=`Event received: ${e.action} - ${this.printDrawing(t)}.`;this.showMessage({type:"map update",message:i})}),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(/[ ,]+/),i=this.nodesDataSource.getItems().find(r=>r.name.valueOf()===t[1].valueOf());if(i)if(this.regexStart.test(this.command()))this.showCommand(`Starting node ${t[1]}...`),this.nodeService.start(this.controller,i).subscribe(()=>this.showCommand(`Node ${i.name} started.`));else if(this.regexStop.test(this.command()))this.showCommand(`Stopping node ${t[1]}...`),this.nodeService.stop(this.controller,i).subscribe(()=>this.showCommand(`Node ${i.name} stopped.`));else if(this.regexSuspend.test(this.command()))this.showCommand(`Suspending node ${t[1]}...`),this.nodeService.suspend(this.controller,i).subscribe(()=>this.showCommand(`Node ${i.name} suspended.`));else if(this.regexReload.test(this.command()))this.showCommand(`Reloading node ${t[1]}...`),this.nodeService.reload(this.controller,i).subscribe(()=>this.showCommand(`Node ${i.name} reloaded.`));else if(this.regexConsole.test(this.command()))if(i.status==="started"){this.showCommand(`Launching console for node ${t[1]}...`);var e=i.console_host;(e==="0.0.0.0"||e==="::"||e==="0:0:0:0:0:0:0:0")&&(e=this.controller.host),hj.IPv6.isValid(e)&&(e=`[${e}]`),i.console_type==="telnet"||i.console_type==="ssh"||i.console_type==="docker_exec"?this.protocolHandlerService.open(`gns3+${i.console_type}://${e}:${i.console}?name=${encodeURIComponent(i.name)}&project_id=${i.project_id}&node_id=${i.node_id}`):i.console_type==="vnc"?this.protocolHandlerService.open(`gns3+vnc://${e}:${i.console}?name=${encodeURIComponent(i.name)}&project_id=${i.project_id}&node_id=${i.node_id}`):i.console_type&&i.console_type.startsWith("spice")?this.protocolHandlerService.open(`gns3+spice://${e}:${i.console}?name=${encodeURIComponent(i.name)}&project_id=${i.project_id}&node_id=${i.node_id}`):i.console_type&&i.console_type.startsWith("http")?window.open(`${i.console_type}://${e}:${i.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 ${i.name}:`),this.showCommand(this.printNode(i)));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(i=>{t=t+`adapter_number: ${i.adapter_number},
|
||
link_type: ${i.link_type},
|
||
name: ${i.name},
|
||
port_number: ${i.port_number},
|
||
short_name: ${i.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,i){t&1&&Xt(i.console,NMe,5)(i.commandInput,FMe,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,i){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),_("click",function(){return i.applyFilter("all")}),d(7,"all"),l(),s(8,"button",7),_("click",function(){return i.applyFilter("errors")}),d(9,"errors"),l(),s(10,"button",7),_("click",function(){return i.applyFilter("warnings")}),d(11,"warnings"),l(),s(12,"button",7),_("click",function(){return i.applyFilter("info")}),d(13,"info"),l(),s(14,"button",7),_("click",function(){return i.applyFilter("map updates")}),d(15,"map updates"),l(),s(16,"button",7),_("click",function(){return i.applyFilter("controller requests")}),d(17,"controller requests"),l()()()(),s(18,"div",8,1),K(20,RMe,3,1,"span",9,Oe),l(),s(22,"div",10)(23,"mat-icon",11),d(24,"keyboard_arrow_right"),l(),s(25,"input",12,2),_("keydown",function(a){return i.onKeyDown(a)})("input",function(a){return i.command.set(a.target.value)}),l()()),t&2){let r=ke(5);m(2),C("ngClass",un(7,Z2,i.isLightThemeEnabled))("matMenuTriggerFor",r),m(16),C("ngClass",un(9,Z2,i.isLightThemeEnabled))("ngStyle",i.style),m(2),Y(i.filteredEvents),m(2),C("ngClass",un(11,Z2,i.isLightThemeEnabled)),m(3),C("ngClass",un(13,Z2,i.isLightThemeEnabled))("value",i.command())}},dependencies:[ne,Ji,Xs,oe,de,G,qe,Kn,tt,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 LMe=["consoleWrapper"],VMe=(n,o,e,t)=>({lightTheme:n,"console-active":o,"is-minimized":e,"is-dragging":t}),BMe=()=>({top:!0}),zMe=()=>({right:!0}),jMe=()=>({bottom:!0}),$Me=()=>({left:!0}),HMe=()=>({top:!0,left:!0}),UMe=()=>({top:!0,right:!0}),WMe=()=>({bottom:!0,left:!0}),GMe=()=>({bottom:!0,right:!0}),qMe=(n,o)=>o.name;function QMe(n,o){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",Tt(8,BMe)),m(),C("resizeEdges",Tt(9,zMe)),m(),C("resizeEdges",Tt(10,jMe)),m(),C("resizeEdges",Tt(11,$Me)),m(),C("resizeEdges",Tt(12,HMe)),m(),C("resizeEdges",Tt(13,UMe)),m(),C("resizeEdges",Tt(14,WMe)),m(),C("resizeEdges",Tt(15,GMe)))}function XMe(n,o){if(n&1){let e=z();R(0,"span",23),s(1,"span",24),d(2),l(),s(3,"button",25),_("mousedown",function(i){return i.stopPropagation()})("click",function(){k(e);let i=v().$index,r=v();return T(r.removeTab(i))}),s(4,"mat-icon"),d(5,"close"),l()()}if(n&2){let e=v().$implicit;m(2),B(e.name)}}function KMe(n,o){n&1&&(s(0,"mat-tab"),Ce(1,XMe,6,1,"ng-template",7),l())}function YMe(n,o){n&1&&(s(0,"span",24),d(1,"GNS3 console"),l())}function ZMe(n,o){if(n&1){let e=z();s(0,"button",46),_("click",function(){k(e);let i=v(2);return T(i.resetBgColor())}),s(1,"mat-icon"),d(2,"restart_alt"),l()()}}function JMe(n,o){n&1&&(s(0,"span",35),d(1,"auto"),l())}function eke(n,o){if(n&1){let e=z();s(0,"button",47),_("click",function(){k(e);let i=v(2);return T(i.resetFgColor())}),s(1,"mat-icon"),d(2,"restart_alt"),l()()}}function tke(n,o){n&1&&(s(0,"span",35),d(1,"auto"),l())}function nke(n,o){if(n&1){let e=z();s(0,"button",48),_("click",function(){k(e);let i=v(2);return T(i.resetFontSize())}),s(1,"mat-icon"),d(2,"restart_alt"),l()()}}function ike(n,o){if(n&1&&(s(0,"option",45),d(1),l()),n&2){let e=o.$implicit;C("value",e.value||""),m(),B(e.name)}}function oke(n,o){if(n&1){let e=z();s(0,"div",26),_("click",function(){k(e);let i=v();return T(i.closeSettingsPanel())}),l(),s(1,"div",27),_("mousedown",function(i){return i.stopPropagation()})("click",function(i){return i.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),_("change",function(i){k(e);let r=v();return T(r.onBgColorChange(i))}),l()(),I(10,ZMe,3,0,"button",34)(11,JMe,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),_("change",function(i){k(e);let r=v();return T(r.onFgColorChange(i))}),l()(),I(18,eke,3,0,"button",37)(19,tke,2,0,"span",35),l()(),s(20,"div",29)(21,"span",30),d(22,"Font Size"),l(),s(23,"div",38)(24,"button",39),_("click",function(){k(e);let i=v();return T(i.changeFontSize(-1))}),s(25,"mat-icon"),d(26,"remove"),l()(),s(27,"span",40),d(28),l(),s(29,"button",41),_("click",function(){k(e);let i=v();return T(i.changeFontSize(1))}),s(30,"mat-icon"),d(31,"add"),l()(),I(32,nke,3,0,"button",42),l()(),s(33,"div",43)(34,"span",30),d(35,"Font"),l(),s(36,"select",44),_("change",function(i){k(e);let r=v();return T(r.onFontFamilyChange(i.target.value))}),K(37,ike,2,2,"option",45,qMe),l()()()}if(n&2){let e=v();m(8),Yt("--swatch-color",e.effectiveBgHex()),Ae("color-swatch--custom",e.currentSettings().backgroundColor),m(),C("value",e.effectiveBgHex()),m(),A(e.currentSettings().backgroundColor?10:11),m(6),Yt("--swatch-color",e.effectiveFgHex()),Ae("color-swatch--custom",e.currentSettings().foregroundColor),m(),C("value",e.effectiveFgHex()),m(),A(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),A(e.currentSettings().fontSize!==e.defaultFontSize?32:-1),m(4),C("value",e.currentSettings().fontFamily||""),m(),Y(e.terminalFonts)}}function rke(n,o){if(n&1&&R(0,"app-web-console",14),n&2){let e=o.$index,t=v();C("hidden",t.selected.value!==e)("controller",t.controller())("node",t.nodes[e])}}var J2=(()=>{class n{CONSOLE_HEADER_HEIGHT=40;DEFAULT_WIDTH=848;DEFAULT_HEIGHT=600;DEFAULT_LEFT="80px";DEFAULT_BOTTOM="100px";destroy$=new We;themeSubscription=null;controller=ae(void 0);project=ae(void 0);zIndex=ae(1e3);closeConsole=new _e;deviceSelected=new _e;consoleDeactivated=new _e;windowFocused=new _e;windowMinimized=new _e;style={};styleInside={height:"120px"};isDraggingSignal=Q(!1);isMinimizedSignal=Q(!1);isMaximizedSignal=Q(!1);isConsoleActiveSignal=Q(!1);isLightThemeEnabledSignal=Q(!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(mr);themeService=f(pi);mapSettingsService=f(_o);boundaryService=f(Vl);windowManagement=f(Rl);cdr=f(X);renderer=f(Si);xtermService=f(bg);showSettingsPanelSignal=Q(!1);settingsSignal=Q(this.xtermService.settings);terminalFonts=this.xtermService.getInstalledFonts();defaultFontSize=Kv;minFontSize=_O;maxFontSize=vO;showSettingsPanel=this.showSettingsPanelSignal.asReadonly();currentSettings=this.settingsSignal.asReadonly();effectiveBgHex=$t(()=>{let e=this.settingsSignal().backgroundColor;return e||this.xtermService.getEffectiveBackgroundHex()});effectiveFgHex=$t(()=>{let e=this.settingsSignal().foregroundColor;return e||this.xtermService.getEffectiveForegroundHex()});dragStartX=0;dragStartY=0;dragStartLeft=0;dragStartBottom=0;preMinimizeStyle=null;constructor(){ur(()=>{let t=this.windowManagement.minimizedWindows().some(i=>i.id==="console");t&&!this.isMinimizedSignal()?this.isMinimizedSignal.set(!0):!t&&this.isMinimizedSignal()&&this.isMinimizedSignal.set(!1)})}nodes=[];selected=new $e(0);webConsoleComponents=t4(yg);logConsoleComponent=Rt(wg);consoleWrapper=Rt("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(Ge(this.destroy$)).subscribe(t=>{this.addTab(t,!0)}),this.consoleService.closeNodeConsoleTrigger.pipe(Ge(this.destroy$)).subscribe(t=>{let i=this.nodes.findIndex(r=>r.node_id===t.node_id);i>=0&&this.removeTab(i)}),this.selected.valueChanges.pipe(Ge(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=Z({},this.style);else{if(this.preMinimizeStyle){let i=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:i,width:`${this.resizedWidth}px`,height:`${p}px`})}else this.updateStyle({bottom:r,left:i,width:`${this.resizedWidth}px`,height:`${this.resizedHeight}px`});this.preMinimizeStyle=null}else{let i=this.style.left||this.DEFAULT_LEFT,r=this.style.bottom||this.DEFAULT_BOTTOM;this.updateStyle({bottom:r,left:i,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,i=window.innerHeight-e-20,r=this.style.left||this.DEFAULT_LEFT;this.updateStyle({bottom:"0px",left:r,width:`${this.resizedWidth}px`,height:`${i}px`}),this.notifyConsoleResized(i)}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 i=this.nodes.findIndex(r=>r.node_id===e.node_id);if(i>=0)t&&(this.selected.setValue(i),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,i=this.nodes.length;i===0?this.selected.setValue(0):e<=t&&t<i?this.selected.setValue(Math.max(0,t-1)):t>=i&&this.selected.setValue(i-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,i=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(i){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 i=parseInt(t)-1;i<this.nodes.length&&this.switchToTab(i)}}onXtermTabShortcut(e){if(!this.isConsoleActiveSignal())return;e.preventDefault(),e.stopPropagation();let t=e.detail.key,i=parseInt(t)-1;this.switchToTab(i)}onConsoleActivate(){this.isConsoleActiveSignal.set(!0),this.cdr.markForCheck()}onWindowFocus(){this.windowFocused.emit()}onDocumentClick(e){setTimeout(()=>{let t=document.querySelector(".consoleWrapper"),i=e.target;t&&!t.contains(i)&&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,i=window.innerHeight-e-20;this.consoleService.consoleResized.next({width:this.resizedWidth,height:i-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 i=No(t,"mousedown"),r=No(document,"mousemove"),a=No(document,"mouseup");i.pipe(yi(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")}),Vn(()=>r.pipe(Qs(0,qs),Ge(a.pipe(yi(()=>{this.onDragEnd()}))))),Ge(this.destroy$)).subscribe(c=>{let p=c.clientX-this.dragStartX,u=c.clientY-this.dragStartY,h=this.dragStartLeft+p,g=this.dragStartBottom-u,y=this.resizedWidth,b=this.isMinimizedSignal()?48:this.resizedHeight,x=window.innerWidth-y,M=this.boundaryService.getConfigValue().topOffset||0,w=window.innerHeight-b-M;h=Math.max(0,Math.min(x,h)),g=Math.max(0,Math.min(w,g)),this.renderer.setStyle(e,"left",`${h}px`),this.renderer.setStyle(e,"bottom",`${g}px`),this.style.left=`${h}px`,this.style.bottom=`${g}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(i=>{this.renderer.setStyle(i,"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:Kv})}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 i=JSON.parse(t);if(this.resizedWidth=i.width||this.DEFAULT_WIDTH,this.resizedHeight=i.height||this.DEFAULT_HEIGHT,this.isMaximizedSignal.set(i.isMaximized||!1),this.isMaximizedSignal()){let r=window.innerWidth<=768?56:64,c=window.innerHeight-r-20;this.style={bottom:"0px",left:i.left||this.DEFAULT_LEFT,width:`${this.resizedWidth}px`,height:`${c}px`}}else this.style={bottom:i.bottom||this.DEFAULT_BOTTOM,left:i.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,i){t&1&&Xt(i.webConsoleComponents,yg,5)(i.logConsoleComponent,wg,5)(i.consoleWrapper,LMe,5),t&2&&Kt(3)},hostBindings:function(t,i){t&1&&_("keydown.alt.1",function(a){return i.handleTabShortcut(a)},Zo)("keydown.alt.2",function(a){return i.handleTabShortcut(a)},Zo)("keydown.alt.3",function(a){return i.handleTabShortcut(a)},Zo)("keydown.alt.4",function(a){return i.handleTabShortcut(a)},Zo)("keydown.alt.5",function(a){return i.handleTabShortcut(a)},Zo)("keydown.alt.6",function(a){return i.handleTabShortcut(a)},Zo)("keydown.alt.7",function(a){return i.handleTabShortcut(a)},Zo)("keydown.alt.8",function(a){return i.handleTabShortcut(a)},Zo)("keydown.alt.9",function(a){return i.handleTabShortcut(a)},Zo)("consoleTabShortcut",function(a){return i.onXtermTabShortcut(a)},qu)("click",function(a){return i.onDocumentClick(a)},qu)("resize",function(){return i.onWindowResize()},Zo)},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,i){t&1&&(s(0,"div",1,0),_("mousedown",function(){return i.onWindowFocus()})("resizeEnd",function(a){return i.onResizeEnd(a)})("click",function(){return i.onConsoleActivate()})("focus",function(){return i.onConsoleActivate()}),I(2,QMe,8,16),s(3,"div",2)(4,"app-console-devices-panel",3),_("deviceSelected",function(a){return i.onDeviceSelected(a)}),l(),s(5,"div",4)(6,"div",5)(7,"mat-tab-group",6),_("selectedIndexChange",function(a){return i.selected.setValue(a)}),K(8,KMe,2,0,"mat-tab",null,Ni),s(10,"mat-tab"),Ce(11,YMe,2,0,"ng-template",7),l()(),s(12,"div",8)(13,"button",9),_("mousedown",function(a){return a.stopPropagation()})("click",function(){return i.toggleSettingsPanel()}),s(14,"mat-icon"),d(15,"tune"),l()(),s(16,"button",10),_("mousedown",function(a){return a.stopPropagation()})("click",function(){return i.toggleMaximize()}),s(17,"mat-icon"),d(18),l()(),s(19,"button",11),_("mousedown",function(a){return a.stopPropagation()})("click",function(){return i.minimize(!0)}),s(20,"mat-icon"),d(21,"remove"),l()(),s(22,"button",12),_("mousedown",function(a){return a.stopPropagation()})("click",function(){return i.close()}),s(23,"mat-icon"),d(24,"close"),l()()()(),I(25,oke,39,17),R(26,"app-log-console",13),K(27,rke,1,3,"app-web-console",14,Ni),l()()()),t&2&&(Yt("z-index",i.zIndex()),C("ngClass",pC(17,VMe,i.isLightThemeEnabled(),i.isConsoleActive(),i.isMinimized(),i.isDragging()))("validateResize",i.validate)("enableGhostResize",!0),m(2),A(i.isMinimized()?-1:2),m(2),C("isLightTheme",i.isLightThemeEnabled()),m(3),C("selectedIndex",i.selected.value),m(),Y(i.nodes),m(5),Ae("active",i.showSettingsPanel()),m(3),C("title",i.isMaximized()?"Restore":"Maximize height"),Qt("aria-label",i.isMaximized()?"Restore console height":"Maximize console height"),m(2),B(i.isMaximized()?"fullscreen_exit":"fullscreen"),m(7),A(i.showSettingsPanel()?25:-1),m(),C("hidden",i.selected.value!==i.nodes.length)("controller",i.controller())("project",i.project()),m(),Y(i.nodes))},dependencies:[ne,Ji,Je,D4,P4,ho,a5,Wo,Go,oe,de,G,ze,ht,Us,Ll,G2,yg,wg],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 ake=["windowWrapper"],ske=()=>({top:!0}),lke=()=>({right:!0}),cke=()=>({bottom:!0}),dke=()=>({left:!0}),mke=()=>({top:!0,left:!0}),pke=()=>({top:!0,right:!0}),uke=()=>({bottom:!0,left:!0}),hke=()=>({bottom:!0,right:!0});function fke(n,o){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",Tt(8,ske)),m(),C("resizeEdges",Tt(9,lke)),m(),C("resizeEdges",Tt(10,cke)),m(),C("resizeEdges",Tt(11,dke)),m(),C("resizeEdges",Tt(12,mke)),m(),C("resizeEdges",Tt(13,pke)),m(),C("resizeEdges",Tt(14,uke)),m(),C("resizeEdges",Tt(15,hke)))}function gke(n,o){n&1&&(s(0,"div",14)(1,"mat-icon",25),d(2,"loading"),l(),s(3,"span"),d(4,"Starting Web Wireshark..."),l()())}function _ke(n,o){n&1&&(s(0,"div",15),R(1,"img",26),s(2,"span"),d(3,"Restarting Web Wireshark..."),l()())}var fj=(()=>{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 We;link=ae.required();controller=ae.required();project=ae.required();zIndex=ae(1e3);closeWindow=new _e;windowFocused=new _e;windowMinimized=new _e;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=Q(!1);isResizingSignal=Q(!1);isLoadingSignal=Q(!0);isMinimizedSignal=Q(!1);isRestartingSignal=Q(!1);isDownloadingSignal=Q(!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(pg);boundaryService=f(Vl);toasterService=f(ie);cdr=f(X);renderer=f(Si);sanitizer=f(xr);windowManagement=f(Rl);linkService=f(Pi);dragStartX=0;dragStartY=0;dragStartLeft=0;dragStartTop=0;windowWrapper=Rt("windowWrapper");constructor(){ur(()=>{let e=this.link(),t=this.windowManagement.minimizedWindows(),i=`wireshark-${e?.link_id}`,r=t.some(a=>a.id===i);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(),i=this.xpraConsoleService.buildXpraWebSocketUrlForWebWireshark(t,e),r=this.xpraConsoleService.buildXpraConsolePageUrl(i);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),i=document.createElement("a");i.href=t;let r=this.link().capture_file_name||"capture";i.download=r.endsWith(".pcap")?r:`${r}.pcap`,document.body.appendChild(i),i.click(),document.body.removeChild(i),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 i=No(t,"mousedown"),r=No(document,"mousemove"),a=No(document,"mouseup");i.pipe(yi(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")}),Vn(()=>r.pipe(Ge(a.pipe(yi(()=>{this.onDragEnd()}))))),Ge(this.destroy$)).subscribe(c=>{let p=c.clientX-this.dragStartX,u=c.clientY-this.dragStartY,h=this.dragStartLeft+p,g=this.dragStartTop+u,y=this.resizedWidth,b=this.resizedHeight,x=window.innerWidth-y,M=this.boundaryService.getConfigValue().topOffset||0,w=window.innerHeight-b-M;h=Math.max(0,Math.min(x,h)),g=Math.max(M,Math.min(w,g)),this.renderer.setStyle(e,"left",`${h}px`),this.renderer.setStyle(e,"top",`${g}px`),this.style.left=`${h}px`,this.style.top=`${g}px`})}onDragEnd(){this.isDraggingSignal.set(!1),this.setIframePointerEvents(""),this.cdr.markForCheck()}setIframePointerEvents(e){let t=this.windowWrapper()?.nativeElement;t&&t.querySelectorAll("iframe").forEach(i=>{this.renderer.setStyle(i,"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,i){t&1&&Xt(i.windowWrapper,ake,5),t&2&&Kt()},hostBindings:function(t,i){t&1&&_("resize",function(){return i.onWindowResize()},Zo)},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,i){t&1&&(s(0,"div",1,0),_("mousedown",function(){return i.onWindowFocus()})("resizeStart",function(){return i.onResizeStart()})("resizeEnd",function(a){return i.onResizeEnd(a)}),I(2,fke,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),_("click",function(){return i.downloadPcapFile()}),s(14,"mat-icon"),d(15,"download"),l()(),s(16,"button",9),_("click",function(){return i.restartWireshark()}),s(17,"mat-icon",10),d(18,"restart_alt"),l()(),s(19,"button",11),_("click",function(){return i.toggleMinimize()}),s(20,"mat-icon"),d(21,"remove"),l()(),s(22,"button",12),_("click",function(){return i.close()}),s(23,"mat-icon"),d(24,"close"),l()()()(),s(25,"div",13),I(26,gke,5,0,"div",14),I(27,_ke,4,0,"div",15),s(28,"iframe",16),_("load",function(){return i.onIframeLoad()}),l()()()()),t&2&&(Yt("z-index",i.zIndex()),Ae("is-dragging",i.isDragging())("is-resizing",i.isResizing())("is-minimized",i.isMinimized()),C("ngStyle",i.style)("validateResize",i.validate)("enableGhostResize",!1),m(2),A(i.isMinimized()?-1:2),m(9),B(i.link().capture_file_name),m(2),C("disabled",i.isDownloading()),m(),Ae("is-downloading",i.isDownloading()),m(2),C("disabled",i.isRestarting()),m(),Ae("is-spinning",i.isRestarting()),m(9),A(i.isLoading()?26:-1),m(),A(i.isRestarting()?27:-1),m(),C("src",i.wiresharkUrl,lC))},dependencies:[ne,Xs,oe,de,G,ze,Us,Ll],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 vke=["windowWrapper"],Cke=()=>({top:!0}),xke=()=>({right:!0}),bke=()=>({bottom:!0}),yke=()=>({left:!0}),Ske=()=>({top:!0,left:!0}),wke=()=>({top:!0,right:!0}),Mke=()=>({bottom:!0,left:!0}),kke=()=>({bottom:!0,right:!0});function Tke(n,o){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",Tt(8,Cke)),m(),C("resizeEdges",Tt(9,xke)),m(),C("resizeEdges",Tt(10,bke)),m(),C("resizeEdges",Tt(11,yke)),m(),C("resizeEdges",Tt(12,Ske)),m(),C("resizeEdges",Tt(13,wke)),m(),C("resizeEdges",Tt(14,Mke)),m(),C("resizeEdges",Tt(15,kke)))}function Eke(n,o){n&1&&(s(0,"div",11)(1,"mat-icon",21),d(2,"loading"),l(),s(3,"span"),d(4,"Starting Web Console..."),l()())}function Dke(n,o){if(n&1){let e=z();s(0,"iframe",22),_("load",function(){k(e);let i=v();return T(i.onIframeLoad())}),l()}if(n&2){let e=v();C("src",e.consoleUrl,lC)}}var gj=(()=>{class n{DEFAULT_WIDTH=1024;DEFAULT_HEIGHT=768;DEFAULT_LEFT="100px";DEFAULT_TOP="100px";MIN_WIDTH=400;MIN_HEIGHT=300;destroy$=new We;node=ae.required();controller=ae.required();project=ae.required();zIndex=ae(1e3);closeWindow=new _e;windowFocused=new _e;windowMinimized=new _e;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=Q(!1);isResizingSignal=Q(!1);isLoadingSignal=Q(!0);isMinimizedSignal=Q(!1);isDragging=this.isDraggingSignal.asReadonly();isResizing=this.isResizingSignal.asReadonly();isLoading=this.isLoadingSignal.asReadonly();isMinimized=this.isMinimizedSignal.asReadonly();consoleUrl="";boundaryService=f(Vl);toasterService=f(ie);cdr=f(X);renderer=f(Si);sanitizer=f(xr);windowManagement=f(Rl);dragStartX=0;dragStartY=0;dragStartLeft=0;dragStartTop=0;windowWrapper=Rt("windowWrapper");constructor(){ur(()=>{let e=this.windowManagement.minimizedWindows(),t=this.getWindowId(),i=e.some(r=>r.id===t);i&&!this.isMinimizedSignal()?this.isMinimizedSignal.set(!0):!i&&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,i=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)&&(i=u+t,r=h+t,this.style={position:"fixed",left:this.DEFAULT_LEFT,top:this.DEFAULT_TOP,width:`${i}px`,height:`${r}px`},this.resizedWidth=i,this.resizedHeight=r)}}}}getWindowId(){return`console-${this.node().node_id}`}buildConsoleUrl(){let e=this.node(),t=this.controller();if(e.console_type==="vnc"){let i=this.buildVncWebSocketUrl(t,e),r=this.buildVncConsolePageUrl(i,e);return this.sanitizer.bypassSecurityTrustResourceUrl(r)}else if(e.console_type&&e.console_type.startsWith("http")){let i=e.console_host;(i==="0.0.0.0"||i==="0:0:0:0:0:0:0:0"||i==="::")&&(i=t.host);let r=`${e.console_type}://${i}:${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 i=No(t,"mousedown"),r=No(document,"mousemove"),a=No(document,"mouseup");i.pipe(yi(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")}),Vn(()=>r.pipe(Qs(0,qs),Ge(a.pipe(yi(()=>{this.onDragEnd()}))))),Ge(this.destroy$)).subscribe(c=>{let p=c.clientX-this.dragStartX,u=c.clientY-this.dragStartY,h=this.dragStartLeft+p,g=this.dragStartTop+u,y=this.resizedWidth,b=this.resizedHeight,x=window.innerWidth-y,M=this.boundaryService.getConfigValue().topOffset||0,w=window.innerHeight-b-M;h=Math.max(0,Math.min(x,h)),g=Math.max(M,Math.min(w,g)),this.renderer.setStyle(e,"left",`${h}px`),this.renderer.setStyle(e,"top",`${g}px`),this.style.left=`${h}px`,this.style.top=`${g}px`})}onDragEnd(){this.isDraggingSignal.set(!1),this.setIframePointerEvents(""),this.cdr.markForCheck()}setIframePointerEvents(e){let t=this.windowWrapper()?.nativeElement;t&&t.querySelectorAll("iframe").forEach(i=>{this.renderer.setStyle(i,"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,i){t&1&&Xt(i.windowWrapper,vke,5),t&2&&Kt()},hostBindings:function(t,i){t&1&&_("resize",function(){return i.onWindowResize()},Zo)},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,i){t&1&&(s(0,"div",1,0),_("mousedown",function(){return i.onWindowFocus()})("resizeStart",function(){return i.onResizeStart()})("resizeEnd",function(a){return i.onResizeEnd(a)}),I(2,Tke,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),_("click",function(){return i.toggleMinimize()}),s(14,"mat-icon"),d(15,"remove"),l()(),s(16,"button",9),_("click",function(){return i.close()}),s(17,"mat-icon"),d(18,"close"),l()()()(),s(19,"div",10),I(20,Eke,5,0,"div",11),I(21,Dke,1,1,"iframe",12),l()()()),t&2&&(Yt("z-index",i.zIndex()),Ae("is-dragging",i.isDragging())("is-resizing",i.isResizing())("is-minimized",i.isMinimized()),C("ngStyle",i.style)("validateResize",i.validate)("enableGhostResize",!1),m(2),A(i.isMinimized()?-1:2),m(9),B(i.node().name),m(9),A(i.isLoading()?20:-1),m(),A(i.consoleUrl?21:-1))},dependencies:[ne,Xs,oe,de,G,ze,Us,Ll],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 MO=class{_document;_textarea;constructor(o,e){this._document=e;let t=this._textarea=this._document.createElement("textarea"),i=t.style;i.position="fixed",i.top=i.opacity="0",i.left="-999em",t.setAttribute("aria-hidden","true"),t.value=o,t.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(t)}copy(){let o=this._textarea,e=!1;try{if(o){let t=this._document.activeElement;o.select(),o.setSelectionRange(0,o.value.length),e=this._document.execCommand("copy"),t&&t.focus()}}catch{}return e}destroy(){let o=this._textarea;o&&(o.remove(),this._textarea=void 0)}},eM=(()=>{class n{_document=f(Qi);constructor(){}copy(e){let t=this.beginCopy(e),i=t.copy();return t.destroy(),i}beginCopy(e){return new MO(e,this._document)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var _j=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({})}return n})();var Pke=["menuTrigger"],Ike=["editorGutter"],vj=(n,o)=>o.path;function Ake(n,o){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(),Yt("width",e.downloadProgress(),"%"),m(4),ee(" ",e.downloadProgress(),"% ")}}function Oke(n,o){n&1&&(s(0,"div",11),R(1,"mat-progress-spinner",18),l())}function Nke(n,o){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),B(e.error())}}function Fke(n,o){n&1&&(s(0,"div",11),R(1,"mat-progress-spinner",18),l())}function Rke(n,o){if(n&1&&(s(0,"div",26),R(1,"span",28),s(2,"span",29),d(3),l()()),n&2){let e=o.$implicit,t=v(3);m(),Ae("editor-line-marker--modified",t.getLineState(e)==="modified")("editor-line-marker--added",t.getLineState(e)==="added"),m(2),B(e)}}function Lke(n,o){if(n&1){let e=z();s(0,"div",24)(1,"div",25,2),K(3,Rke,4,5,"div",26,Oe),l(),s(5,"textarea",27),_("input",function(i){k(e);let r=v(2);return T(r.onContentChange(i.target.value))})("scroll",function(i){k(e);let r=v(2);return T(r.onEditorScroll(i))}),l()()}if(n&2){let e=v(2);m(3),Y(e.lineNumbers()),m(2),C("value",e.editContent())}}function Vke(n,o){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),_("click",function(){k(e);let i=v();return T(i.cancelEdit())}),d(6,"Cancel"),l(),s(7,"button",23),_("click",function(){k(e);let i=v();return T(i.saveEdit())}),d(8,"Save"),l()()(),I(9,Fke,2,0,"div",11)(10,Lke,6,1,"div",24),l()}if(n&2){let e=v();m(3),ee("Editing: ",o.path),m(2),C("disabled",e.saving()),m(2),C("disabled",e.saving()||e.loadingContent()),m(2),A(e.loadingContent()?9:10)}}function Bke(n,o){if(n&1){let e=z();s(0,"div",50),_("click",function(){k(e);let i=v().$implicit,r=v(2);return T(r.navigateToDir(i.path))}),R(1,"span"),s(2,"span",51),_("click",function(i){k(e);let r=v().$implicit;return v(2).expandDir(r),T(i.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),i=t.treeDepth(e.path);Ae("node-file-manager__tree-row--active",t.currentPath()===e.path),m(),Yt("width",i*16,"px"),m(3),B(t.isExpanded(e.path)?"expand_more":"chevron_right"),m(4),B(e.name)}}function zke(n,o){if(n&1&&I(0,Bke,9,6,"div",49),n&2){let e=o.$implicit,t=v(2);A(t.isNodeVisible(e)?0:-1)}}function jke(n,o){n&1&&(s(0,"span",55),d(1,"/"),l())}function $ke(n,o){if(n&1){let e=z();I(0,jke,2,0,"span",55),s(1,"button",56),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.currentPath.set(i.path))}),d(2),l()}if(n&2){let e=o.$implicit,t=o.$index;A(t!==0?0:-1),m(2),B(e.label)}}function Hke(n,o){n&1&&R(0,"mat-header-cell",57)}function Uke(n,o){if(n&1&&(s(0,"mat-cell",57)(1,"mat-icon",58),d(2),l()()),n&2){let e=o.$implicit;m(),Yt("color",e.isDir?"var(--mat-sys-primary)":""),m(),B(e.isDir?"folder":"description")}}function Wke(n,o){n&1&&(s(0,"mat-header-cell"),d(1,"Name"),l())}function Gke(n,o){if(n&1){let e=z();s(0,"mat-cell",59),_("dblclick",function(){let i=k(e).$implicit,r=v(2);return T(i.isDir?r.navigateToDir(i.path):r.isEditableFile(i)&&r.editFile(i))}),s(1,"span"),d(2),l()()}if(n&2){let e=o.$implicit,t=v(2);Yt("cursor",e.isDir||t.isEditableFile(e)?"pointer":"default"),m(2),B(e.isDir?e.name:t.fileName(e))}}function qke(n,o){n&1&&(s(0,"mat-header-cell"),d(1,"Type"),l())}function Qke(n,o){if(n&1&&(s(0,"mat-cell",60),d(1),l()),n&2){let e=o.$implicit,t=v(2);m(),B(e.isDir?"Dir":t.shortFileType(e.file_type))}}function Xke(n,o){n&1&&(s(0,"mat-header-cell"),d(1,"Size"),l())}function Kke(n,o){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=o.$implicit,t=v(2);m(),B(e.isDir?"-":t.formatFileSize(e.size))}}function Yke(n,o){n&1&&(s(0,"mat-header-cell"),d(1,"Modified"),l())}function Zke(n,o){if(n&1&&(s(0,"mat-cell",60),d(1),l()),n&2){let e=o.$implicit,t=v(2);m(),B(e.isDir?"-":t.formatDate(e.modified_at))}}function Jke(n,o){n&1&&R(0,"mat-header-row",61),n&2&&C("sticky",!0)}function eTe(n,o){if(n&1){let e=z();s(0,"mat-row",62),_("contextmenu",function(i){let r=k(e).$implicit,a=v(2);return T(a.onRowContextMenu(i,r))}),l()}n&2&&Yt("cursor","context-menu")}function tTe(n,o){if(n&1&&(s(0,"div",30),K(1,zke,1,1,null,null,vj),l(),s(3,"div",31)(4,"div",32),K(5,$ke,3,2,null,null,vj),l(),s(7,"div",33)(8,"mat-table",34),Fe(9,35),Ce(10,Hke,1,0,"mat-header-cell",36)(11,Uke,3,3,"mat-cell",37),Re(),Fe(12,38),Ce(13,Wke,2,0,"mat-header-cell",39)(14,Gke,3,3,"mat-cell",40),Re(),Fe(15,41),Ce(16,qke,2,0,"mat-header-cell",39)(17,Qke,2,1,"mat-cell",42),Re(),Fe(18,43),Ce(19,Xke,2,0,"mat-header-cell",39)(20,Kke,2,1,"mat-cell",44),Re(),Fe(21,45),Ce(22,Yke,2,0,"mat-header-cell",39)(23,Zke,2,1,"mat-cell",42),Re(),Ce(24,Jke,1,1,"mat-header-row",46)(25,eTe,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(),Y(e.treeNodes()),m(4),Y(e.breadcrumbs()),m(3),C("dataSource",e.viewItems()),m(16),C("matHeaderRowDef",e.displayedColumns),m(),C("matRowDefColumns",e.displayedColumns)}}function nTe(n,o){if(n&1){let e=z();s(0,"button",63),_("click",function(){let i=k(e).file,r=v();return T(r.downloadFile(i))}),s(1,"mat-icon"),d(2,"download"),l(),d(3," Download "),l(),s(4,"button",64),_("click",function(){let i=k(e).file,r=v();return T(r.copyPath(i.path))}),s(5,"mat-icon"),d(6),l(),d(7),l(),R(8,"mat-divider"),s(9,"button",64),_("click",function(){let i=k(e).file,r=v();return T(r.deleteFile(i))}),s(10,"mat-icon"),d(11,"delete"),l(),d(12),l()}if(n&2){let e=o.file,t=v();C("disabled",e.isDir),m(6),B(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 tM=(()=>{class n{route=f(lt);nodeService=f(ut);controllerService=f(nt);dialog=f(it);toaster=f(ie);clipboard=f(eM);cd=f(X);inputNode=ae(void 0);inputController=ae(void 0);controllerId="";projectId="";nodeId="";nodeName=Q("");controller=Q(null);currentPath=Q("");loading=Q(!0);error=Q(null);copied=Q(null);selectedFile=Q(null);contextMenuTrigger=Rt("menuTrigger");menuPosition=Q({left:0,top:0});editorGutter=Rt("editorGutter");uploading=Q(!1);uploadProgress=Q(0);downloading=Q(!1);downloadProgress=Q(0);editingFile=Q(null);editContent=U("");saving=Q(!1);loadingContent=Q(!1);lineCount=Q(1);originalLines=Q([]);currentLines=Q([]);displayedColumns=["icon","path","file_type","size","modified_at"];dirCache=Q(new Map);setDirCache(e,t){let i=this.dirCache();i.set(e,t),this.dirCache.set(new Map(i))}getDirCache(e){return this.dirCache().get(e)||[]}breadcrumbs=$t(()=>{let e=this.currentPath().split("/").filter(Boolean),t=[{label:"root",path:""}],i="";for(let r of e)i=i?`${i}/${r}`:r,t.push({label:r,path:i});return t});currentFiles=$t(()=>this.getDirCache(this.currentPath()).filter(t=>t.file_type!=="directory"));subdirs=$t(()=>this.getDirCache(this.currentPath()).filter(t=>t.file_type==="directory").map(t=>({name:t.path.split("/").pop(),path:t.path})));viewItems=$t(()=>{let e=this.subdirs().map(i=>({isDir:!0,name:i.name,path:i.path,size:0,created_at:"",modified_at:"",file_type:"directory"})),t=this.currentFiles().map(i=>Z({isDir:!1,name:this.fileName(i)},i));return[...e,...t]});treeNodes=Q([]);expandedDirs=Q(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 i=this.treeNodes();if(i.some(c=>c.path===e))return;let a=e.split("/").pop()||e;i.push({name:a,path:e,expanded:!1,loading:!1}),i.sort((c,p)=>c.path.localeCompare(p.path)),this.treeNodes.set([...i])}isExpanded(e){return this.expandedDirs().has(e)}treeDepth(e){return e.split("/").length}isNodeVisible(e){let t=e.path.split("/");for(let i=1;i<t.length;i++)if(!this.expandedDirs().has(t.slice(0,i).join("/")))return!1;return!0}treeIsLastChild(e){let i=e.split("/").slice(0,-1).join("/"),r=this.treeNodes().filter(a=>{let c=a.path.split("/");return c.pop(),c.join("/")===i});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(i=>{this.controller.set(i),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 i of t)i.file_type==="directory"&&this.addToTree(i.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+"/",i=this.controller();this.nodeService.getNodeFiles(i,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 i=this.contextMenuTrigger();i&&(i.menuData={file:t},i.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:i=>{this.editContent.set(i),this.originalLines.set(i.split(`
|
||
`)),this.currentLines.set(i.split(`
|
||
`)),this.loadingContent.set(!1),this.updateLineCount(i),this.cd.markForCheck()},error:i=>{this.toaster.error(i.error?.message||i.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:i=>{this.toaster.error(i.error?.message||i.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,i=this.editorGutter()?.nativeElement;i&&(i.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(),i=this.currentLines(),r=e-1;return r<t.length&&r<i.length?t[r]!==i[r]?"modified":"unchanged":r<i.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 i=t.files[0];this.uploading.set(!0),this.uploadProgress.set(0);let r=this.controller(),a=this.currentPath()?`${this.currentPath()}/${i.name}`:i.name;this.nodeService.uploadNodeFileWithProgress(r,this.projectId,this.nodeId,a,i).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 "${i.name}" uploaded.`);let c=this.getDirCache(this.currentPath()),p={path:a,size:i.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 i;try{i=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,i,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 i=await RO(this.nodeService.downloadNodeFile(this.controller(),this.projectId,this.nodeId,e.path)),r=URL.createObjectURL(i),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(i){this.downloading.set(!1),this.toaster.error(i.message||"Download failed"),this.cd.markForCheck()}}deleteFile(e){let t=e.isDir||e.file_type==="directory";this.dialog.open(Ga,{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,i){t&1&&Xt(i.contextMenuTrigger,Pke,5)(i.editorGutter,Ike,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,i){if(t&1&&(s(0,"div",3)(1,"span",4),d(2),l(),s(3,"div",5),I(4,Ake,6,3,"div",6),s(5,"div",6),R(6,"div",7),s(7,"button",8),_("click",function(){return i.onUploadClick()}),s(8,"mat-icon",9),d(9),l(),d(10),l()()()(),s(11,"div",10),I(12,Oke,2,0,"div",11)(13,Nke,5,1,"div",12)(14,Vke,11,4,"div",13)(15,tTe,28,3),l(),s(16,"mat-menu",null,0),Ce(18,nTe,13,4,"ng-template",14),l(),R(19,"span",15,1)),t&2){let r,a=ke(17);m(2),ee("",i.nodeName()," - Files"),m(2),A(i.downloading()?4:-1),m(2),Yt("width",i.uploadProgress(),"%"),m(),C("disabled",i.uploading()),m(2),B(i.uploading()?"cloud_upload":"upload"),m(),ee(" ",i.uploading()?i.uploadProgress()+"%":"Upload file"," "),m(2),A(i.loading()?12:i.error()?13:(r=i.editingFile())?14:15,r),m(7),Yt("left",i.menuPosition().left,"px")("top",i.menuPosition().top,"px"),C("matMenuTriggerFor",a)}},dependencies:[ne,G,pe,oe,de,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,dn,qn,gs,_j,qe,Kn,tt,y8,Fn,yr,qr],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 iTe=["windowWrapper"],oTe=()=>({top:!0}),rTe=()=>({right:!0}),aTe=()=>({bottom:!0}),sTe=()=>({left:!0}),lTe=()=>({top:!0,left:!0}),cTe=()=>({top:!0,right:!0}),dTe=()=>({bottom:!0,left:!0}),mTe=()=>({bottom:!0,right:!0});function pTe(n,o){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",Tt(8,oTe)),m(),C("resizeEdges",Tt(9,rTe)),m(),C("resizeEdges",Tt(10,aTe)),m(),C("resizeEdges",Tt(11,sTe)),m(),C("resizeEdges",Tt(12,lTe)),m(),C("resizeEdges",Tt(13,cTe)),m(),C("resizeEdges",Tt(14,dTe)),m(),C("resizeEdges",Tt(15,mTe)))}var Cj=(()=>{class n{DEFAULT_WIDTH=900;DEFAULT_HEIGHT=600;DEFAULT_LEFT="120px";DEFAULT_TOP="80px";MIN_WIDTH=600;MIN_HEIGHT=400;destroy$=new We;node=ae();controller=ae();zIndex=ae(1e3);closeWindow=new _e;windowFocused=new _e;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=Q(!1);isResizingSignal=Q(!1);isMinimizedSignal=Q(!1);isDragging=this.isDraggingSignal.asReadonly();isResizing=this.isResizingSignal.asReadonly();isMinimized=this.isMinimizedSignal.asReadonly();boundaryService=f(Vl);windowManagement=f(Rl);cdr=f(X);router=f(_t);dragStartX=0;dragStartY=0;dragStartLeft=0;dragStartTop=0;windowWrapper=Rt("windowWrapper");constructor(){ur(()=>{if(!this.node())return;let t=this.getWindowId(),i=this.windowManagement.minimizedWindows();i.some(r=>r.id===t)&&!this.isMinimizedSignal()?this.isMinimizedSignal.set(!0):!i.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 i=No(t,"mousedown"),r=No(document,"mousemove"),a=No(document,"mouseup");i.pipe(Ge(this.destroy$),yi(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")}),Vn(()=>r.pipe(Qs(0,qs),Ge(a.pipe(yi(()=>{this.onDragEnd()})))))).subscribe(c=>{let p=c.clientX-this.dragStartX,u=c.clientY-this.dragStartY,h=this.dragStartLeft+p,g=this.dragStartTop+u;this.style={position:"fixed",left:`${h}px`,top:`${g}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 i=t.querySelector("app-node-file-manager-page");i&&(i.style.pointerEvents=e)}openInNewTab(){let e=this.node(),t=this.controller();if(!e||!t)return;let i=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(i);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,i){t&1&&Xt(i.windowWrapper,iTe,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,i){if(t&1&&(s(0,"div",1,0),_("mousedown",function(){return i.onWindowFocus()})("resizeStart",function(){return i.onResizeStart()})("resizeEnd",function(a){return i.onResizeEnd(a)}),I(2,pTe,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),_("click",function(){return i.openInNewTab()}),s(14,"mat-icon"),d(15,"open_in_new"),l()(),s(16,"button",9),_("click",function(){return i.toggleMinimize()}),s(17,"mat-icon"),d(18,"remove"),l()(),s(19,"button",10),_("click",function(){return i.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;Yt("z-index",i.zIndex()),Ae("is-dragging",i.isDragging())("is-resizing",i.isResizing())("is-minimized",i.isMinimized()),C("ngStyle",i.style)("validateResize",i.validate)("enableGhostResize",!1),m(2),A(i.isMinimized()?-1:2),m(9),B((r=i.node())==null?null:r.name),m(12),C("inputNode",i.node())("inputController",i.controller())}},dependencies:[ne,Xs,oe,de,G,ze,Us,Ll,tM],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 nM=class{sourceNode;sourcePort;targetNode;targetPort;constructor(o,e,t,i){this.sourceNode=o,this.sourcePort=e,this.targetNode=t,this.targetPort=i}};var uTe=(n,o)=>o.name;function hTe(n,o){n&1&&(ti(),s(0,"svg",8),R(1,"rect",10),l())}function fTe(n,o){n&1&&(ti(),s(0,"svg",8),R(1,"rect",11),l())}function gTe(n,o){if(n&1){let e=z();s(0,"button",6),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.chooseInterface(i))}),s(1,"span",7),I(2,hTe,2,0,":svg:svg",8),I(3,fTe,2,0,":svg:svg",8),s(4,"span",9),d(5),l()()()}if(n&2){let e=o.$implicit;C("disabled",!e.available),m(2),A(e.available?2:-1),m(),A(e.available?-1:3),m(2),B(e.name)}}function _Te(n,o){if(n&1&&(s(0,"div",2),R(1,"span",3),s(2,"mat-menu",4,0),K(4,gTe,6,4,"button",5,uTe),l()()),n&2){let e=ke(3),t=v();Yt("left",t.leftPosition)("top",t.topPosition),m(),C("matMenuTriggerFor",e),m(),Yt("min-height",0),m(2),Y(t.ports)}}var Mg=(()=>{class n{links=ae(void 0);chooseInterfaceChange=new _e;contextMenu=Rt(Fn);sanitizer=f(xr);changeDetector=f(X);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,i){this.node=e,this.filterNodePorts(),this.setPosition(t,i),this.contextMenu().openMenu()}filterNodePorts(){let e=[];this.links().forEach(t=>{t.nodes.forEach(i=>{i.node_id===this.node.node_id&&e.push(i)})}),this.ports=[],this.node.ports.forEach(t=>{let i=e.filter(r=>r.adapter_number===t.adapter_number);i.length===0||i.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,i){t&1&&Xt(i.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,i){t&1&&I(0,_Te,6,7,"div",1),t&2&&A(i.node?0:-1)},dependencies:[ne,qe,Kn,tt,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 iM=(()=>{class n{links=ae(void 0);nodeSelectInterfaceMenu=Rt(Mg);nodeClicked$;drawingLineTool=f(Wf);nodesEventSource=f(Fl);linksEventSource=f(Aa);mapNodeToNode=f(hp);nodeToMapNode=f(Of);portToMapPort=f(Af);toasterService=f(ie);cdr=f(X);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),i=this.portToMapPort.convert(e.port);if(this.drawingLineTool.isDrawing()){let r=this.drawingLineTool.stop();this.linksEventSource.created.emit(new nM(r.node,r.port,t,i))}else this.drawingLineTool.start(t.x+t.width/2,t.y+t.height/2,{node:t,port:i})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-draw-link-tool"]],viewQuery:function(t,i){t&1&&Xt(i.nodeSelectInterfaceMenu,Mg,5),t&2&&Kt()},inputs:{links:[1,"links"]},decls:1,vars:1,consts:[[3,"chooseInterfaceChange","links"]],template:function(t,i){t&1&&(s(0,"app-node-select-interface",0),_("chooseInterfaceChange",function(a){return i.onChooseInterface(a)}),l()),t&2&&C("links",i.links())},dependencies:[ne,Mg],encapsulation:2,changeDetection:0})}return n})();var oM=(()=>{class n{project=ae(void 0);controller=ae(void 0);uploader;template;toasterService=f(ie);dockerService=f(fs);qemuService=f(na);iouService=f(vs);iosService=f(_s);cdr=f(X);constructor(){}ngOnInit(){this.uploader=new Wa({url:""}),this.uploader.onAfterAddingFile=e=>{e.withCredentials=!1},this.uploader.onErrorItem=(e,t,i,r)=>{this.toasterService.error("An error has occured")},this.uploader.onCompleteItem=(e,t,i,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],i=t.name,r=new FileReader,a;r.onloadend=()=>{let c=JSON.parse(r.result),p;if(c.qemu)a=new Bm,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 Vm,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 Rm,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 fg,a.template_type="docker",a.adapters=c.docker.adapters,a.console_type=c.docker.console_type,a.image=c.docker.image,a.start_command=c.docker.start_command,a.environment=c.docker.environment,a.extra_hosts=c.docker.extra_hosts,a.extra_volumes=c.docker.extra_volumes||[],a.extra_configs=(c.docker.extra_configs||[]).filter(g=>(g.target||"").trim()).map(g=>({target:g.target.trim(),content:g.content??""})),a.custom_adapters=c.custom_adapters||[],a.mac_address=c.docker.mac_address,a.cpus=c.docker.cpus,a.memory=c.docker.mem_limit,a.console_http_path=c.docker.console_http_path,a.console_http_port=c.docker.console_http_port,a.console_resolution=c.docker.console_resolution,a.usage=c.usage;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(),i);this.uploader.queue.forEach(g=>g.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}/${ki.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,i){},dependencies:[ne],encapsulation:2,changeDetection:0})}return n})();var rM=(()=>{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)(at(Ct))};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,i){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),_("click",function(){return i.confirmAction()}),d(9,"Yes"),l()()),t&2&&(m(),ee("Confirm ",i.confirmActionData.actionType," All"),m(3),ee(" Are you sure you want to ",i.confirmActionData.actionType,` all devices?
|
||
`))},dependencies:[ve,vc,Le,Ve,St,G,pe,yr,qr],encapsulation:2,changeDetection:0})}return n})();var aM=(()=>{class n{nodeService=f(ut);nodeConsoleService=f(mr);nodesDataSource=f(ui);toasterService=f(ie);controllerService=f(nt);settingsService=f(Qr);mapSettingsService=f(_o);dialog=f(it);cdr=f(X);project=ae(void 0);controller=ae(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(rM,{panelClass:["base-confirmation-dialog-panel","confirmation-warning-panel"],autoFocus:!1,disableClose:!0,data:e}).afterClosed().subscribe(i=>{!i||!i.isAction||(i.actionType=="start"?this.startNodes():i.actionType=="stop"?this.stopNodes():i.actionType=="reload"?this.reloadNodes():i.actionType=="suspend"?this.suspendNodes():i.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,i){t&1&&(s(0,"div",0)(1,"button",1),_("click",function(){return i.startConsoleForAllNodes()}),s(2,"mat-icon"),d(3,"web_asset"),l()(),s(4,"button",2),_("click",function(){return i.confirmControlsActions("start")}),s(5,"mat-icon"),d(6,"play_arrow"),l()(),s(7,"button",3),_("click",function(){return i.confirmControlsActions("suspend")}),s(8,"mat-icon"),d(9,"pause"),l()(),s(10,"button",4),_("click",function(){return i.confirmControlsActions("stop")}),s(11,"mat-icon"),d(12,"stop"),l()(),s(13,"button",5),_("click",function(){return i.confirmControlsActions("reload")}),s(14,"mat-icon"),d(15,"replay"),l()(),s(16,"button",6),_("click",function(){return i.confirmControlsActions("reset")}),s(17,"mat-icon"),d(18,"compare_arrows"),l()()())},dependencies:[ne,ve,G,ze,oe,de,ht,Mt],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 xj=(()=>{class n{transform(e,t){return e?t?(t=t.toLowerCase(),e.filter(i=>i.name.toLowerCase().includes(t))):e:[]}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Br({name:"templatefilter",type:n,pure:!0})}return n})();var vTe=(n,o)=>o.name,CTe=(n,o)=>o.value;function xTe(n,o){if(n&1&&(s(0,"mat-option",8),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function bTe(n,o){if(n&1&&(s(0,"mat-option",8),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e.name," ")}}function yTe(n,o){if(n&1&&(s(0,"mat-option",8),d(1),l()),n&2){let e=o.$implicit;C("value",e.value),m(),ee(" ",e.display," ")}}function STe(n,o){if(n&1){let e=z();s(0,"mat-form-field",12)(1,"mat-select",18),uc("valueChange",function(i){k(e);let r=v();return pc(r.selectedTemplate().compute_id,i)||(r.selectedTemplate().compute_id=i),T(i)}),K(2,yTe,2,2,"mat-option",8,CTe),l()()}if(n&2){let e=v();m(),mc("value",e.selectedTemplate().compute_id),C("compareWith",e.compareControllers),m(),Y(e.nodeControllers)}}var sM=(()=>{class n{data;dialogRef=f(Ie);templateService=f(bl);computeService=f(Eo);formBuilder=f(Bn);toasterService=f(ie);nonNegativeValidator=f(Cp);cd=f(X);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 $e(1,[je.compose([je.required,this.nonNegativeValidator.get])])}),this.positionForm=this.formBuilder.group({top:new $e(0,je.required),left:new $e(0,je.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(i=>i.compute_id!=="local").map(i=>{let r=i.compute_id.slice(-8);return{display:`${i.name||i.compute_id} (${r})`,value:i.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 i={template:this.selectedTemplate(),controller:this.selectedTemplate().compute_id,numberOfNodes:this.configurationForm.get("numberOfNodes").value,x:e,y:t};this.dialogRef.close(i)}}}static \u0275fac=function(t){return new(t||n)(at(Ct))};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,i){t&1&&(s(0,"div",0)(1,"h1",1),d(2,"Add a node"),l(),s(3,"button",2),_("click",function(){return i.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),_("input",function(a){return i.searchText.set(a.target.value),i.filterTemplates()}),l()(),s(11,"mat-form-field",6)(12,"mat-select",7),_("selectionChange",function(a){return i.selectedType.set(a.value),i.filterTemplates()}),K(13,xTe,2,2,"mat-option",8,Oe),l()(),s(15,"mat-form-field",6)(16,"mat-select",9),_("selectionChange",function(a){return i.selectedTemplate.set(a.value),i.chooseTemplate()}),K(17,bTe,2,2,"mat-option",8,vTe),nn(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()(),I(26,STe,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),_("click",function(){return i.onNoClick()}),d(39,"Close"),l(),s(40,"button",17),_("click",function(){return i.onAddClick()}),d(41," Add "),l()()),t&2&&(m(3),C("routerLink",Hi("/controller/",i.controller==null?null:i.controller.id,"/preferences")),m(7),C("value",i.searchText()),m(2),C("value",i.selectedType()),m(),Y(i.templateTypes),m(3),C("value",i.selectedTemplate())("compareWith",i.compareControllers),m(),Y(sa(19,9,i.filteredTemplates,i.searchText())),m(6),C("formGroup",i.configurationForm),m(3),A(i.selectedTemplate()?26:-1),m(4),C("formGroup",i.positionForm))},dependencies:[ne,Et,rt,Nt,Uo,Dt,ot,Ft,Vt,dt,vn,ve,Le,Ve,St,G,pe,we,Me,Se,Te,gt,Pt,ft,xj],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 wTe=["selectorContainer"],MTe=(n,o)=>o.compute_id;function kTe(n,o){n&1&&(s(0,"mat-icon",7),d(1,"check_circle"),l())}function TTe(n,o){n&1&&(s(0,"mat-icon",8),d(1,"cancel"),l())}function ETe(n,o){if(n&1){let e=z();s(0,"button",4),_("click",function(){let i=k(e).$implicit,r=v();return T(r.selectCompute(i.compute_id))}),s(1,"div",5)(2,"span",6),d(3),l(),I(4,kTe,2,0,"mat-icon",7)(5,TTe,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=o.$implicit,t=o.$index,i=v();Ae("compute-selector__item--even",t%2===1),m(3),B(i.getComputeDisplayName(e)),m(),A(e.connected?4:5),m(6),ar(i.getUsageColorClass(e,"cpu")),m(),B(i.getCpuInfo(e)),m(4),ar(i.getUsageColorClass(e,"mem")),m(),B(i.getMemoryInfo(e)),m(4),ar(i.getUsageColorClass(e,"disk")),m(),B(i.getDiskInfo(e))}}var bj=(()=>{class n{cd=f(X);selectorContainer;computes=ae.required();x=ae.required();y=ae.required();MARGIN=10;actualWidth=Q(200);actualHeight=Q(120);resizeObserver;computeSelected=new _e;selectorX=$t(()=>{let e=this.x(),t=window.innerWidth,i=this.actualWidth();return e+i+this.MARGIN>t?e-i-this.MARGIN:e+this.MARGIN});selectorY=$t(()=>{let e=this.y(),t=window.innerHeight,i=this.actualHeight();return e+i+this.MARGIN>t?e-i-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,i=e.memory_usage_percent||0,r=this.bytesToGB(t);return`${(r*i/100).toFixed(1)}/${r.toFixed(0)} GB`}getDiskInfo(e){return`${e.disk_usage_percent||0}%`}getUsageColorClass(e,t){let i;switch(t){case"cpu":i=e.cpu_usage_percent||0;break;case"mem":i=e.memory_usage_percent||0;break;case"disk":i=e.disk_usage_percent||0;break}return i<60?"compute-selector__usage--low":i<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,i){if(t&1&&In(wTe,5),t&2){let r;mt(r=pt())&&(i.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,i){t&1&&(s(0,"div",1,0)(2,"div",2),K(3,ETe,22,13,"button",3,MTe),l()()),t&2&&(Yt("left",i.selectorX(),"px")("top",i.selectorY(),"px"),m(3),Y(i.computes()))},dependencies:[ne,oe,de,G,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 DTe=["menuTrigger"],yj=()=>({standalone:!0}),PTe=(n,o)=>o.id;function ITe(n,o){if(n&1&&(s(0,"mat-option",10),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function ATe(n,o){if(n&1){let e=z();s(0,"div",16)(1,"div",17),_("dragStart",function(i){k(e);let r=v(2).$index,a=v();return T(a.dragStart(i,a.filteredTemplates[r]))})("dragEnd",function(i){k(e);let r=v(2).$index,a=v();return T(a.dragEnd(i,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]),Na),m(2),B(t.filteredTemplates[e+1].name)}}function OTe(n,o){if(n&1){let e=z();s(0,"div",16)(1,"div",17),_("dragStart",function(i){k(e);let r=v(2).$index,a=v();return T(a.dragStart(i,a.filteredTemplates[r]))})("dragEnd",function(i){k(e);let r=v(2).$index,a=v();return T(a.dragEnd(i,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]),Na),m(2),B(t.filteredTemplates[e+2].name)}}function NTe(n,o){if(n&1){let e=z();s(0,"div",16)(1,"div",17),_("dragStart",function(i){k(e);let r=v(2).$index,a=v();return T(a.dragStart(i,a.filteredTemplates[r]))})("dragEnd",function(i){k(e);let r=v(2).$index,a=v();return T(a.dragEnd(i,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]),Na),m(2),B(t.filteredTemplates[e+3].name)}}function FTe(n,o){if(n&1){let e=z();s(0,"div",15)(1,"div",16)(2,"div",17),_("dragStart",function(i){k(e);let r=v().$index,a=v();return T(a.dragStart(i,a.filteredTemplates[r]))})("dragEnd",function(i){k(e);let r=v().$index,a=v();return T(a.dragEnd(i,a.filteredTemplates[r]))}),R(3,"img",18),l(),s(4,"span",19),d(5),l()(),I(6,ATe,5,3,"div",16),I(7,OTe,5,3,"div",16),I(8,NTe,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]),Na),m(2),B(t.filteredTemplates[e].name),m(),A(t.filteredTemplates[e+1]?6:-1),m(),A(t.filteredTemplates[e+2]?7:-1),m(),A(t.filteredTemplates[e+3]?8:-1)}}function RTe(n,o){if(n&1&&I(0,FTe,9,6,"div",15),n&2){let e=o.$index;A(e%4===0?0:-1)}}function LTe(n,o){if(n&1){let e=z();s(0,"div",20),_("click",function(){k(e);let i=v();return T(i.onComputeSelectorCancelled())}),l()}}function VTe(n,o){if(n&1){let e=z();s(0,"app-compute-selector",21),_("computeSelected",function(i){k(e);let r=v();return T(r.onComputeSelected(i))}),l()}if(n&2){let e=v();C("computes",e.availableComputes())("x",e.lastPageX())("y",e.lastPageY())}}function BTe(n,o){n&1&&(s(0,"div",25)(1,"mat-icon",26),d(2,"error"),l()())}function zTe(n,o){if(n&1&&(s(0,"div",22)(1,"div",23),d(2),l(),R(3,"img",24),I(4,BTe,3,0,"div",25),l()),n&2){let e=o.$implicit,t=v(),i=t.getCreatingNodeScreenPosition(e),r=e.status==="success";Yt("left",i.x,"px")("top",i.y,"px"),Ae("template__ghost-icon--fading",r),m(2),B(e.template.name),m(),Ae("template__ghost-icon-img--error",e.status==="error"),C("src",t.getImageSourceForTemplate(e.template),Na),m(),A(e.status==="error"?4:-1)}}var kg=(()=>{class n{document;dialog=f(it);templateService=f(bl);symbolService=f(Cl);domSanitizer=f(xr);themeService=f(pi);overlayContainer=f(eh);context=f(Ao);cd=f(X);computeService=f(Eo);notificationService=f(Js);toasterService=f(ie);controller=ae(void 0);project=ae(void 0);nodeCreationChange=new _e;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=Q(0);lastPageY=Q(0);isDragging=Q(!1);mouseOffsetX=0;mouseOffsetY=0;dragElement=null;showComputeSelector=Q(!1);availableComputes=Q([]);pendingNodePosition=Q(null);pendingTemplate=Q(null);cachedComputes=Q([]);creatingNodes=Q(new Map);pendingCreationId=Q(null);ghostIconScreenPosition=$t(()=>{let e=this.pendingNodePosition();if(!e)return{x:0,y:0};let t=this.context.transformation.k,i=this.context.getZeroZeroTransformationPoint(),r=e.x*t+i.x+this.context.transformation.x,a=e.y*t+i.y+this.context.transformation.y;return{x:r,y:a}});subscription;themeSubscription;isLightThemeEnabled=!1;controllerWatcher=ur(()=>{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 i=Array.from(t.values());Yi(i.map(r=>this.symbolService.getSymbolBlobUrl(this.controller(),r))).subscribe({next:r=>{i.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 i=window.event,r=i?.clientX||0,a=i?.clientY||0,c=i?.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 i=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=(i-(c+this.context.transformation.x))/this.context.transformation.k,h=(r-(p+this.context.transformation.y))/this.context.transformation.k,g=Math.round(u-this.mouseOffsetX),y=Math.round(h-this.mouseOffsetY),b=this.cachedComputes();b.length===0?this.computeService.getComputes(this.controller()).subscribe({next:x=>{this.notificationService.setInitialComputes(x),this.cachedComputes.set(x),this.processNodeCreation(t,g,y,x)},error:x=>{let M=x.error?.message||x.message||"Failed to load computes";this.toasterService.error(M),this.cd.markForCheck();let w={template:t,controller:"local",numberOfNodes:1,x:g,y};this.nodeCreationChange.emit(w)}}):this.processNodeCreation(t,g,y,b)}processNodeCreation(e,t,i,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:i,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,g)=>h.compute_id==="local"?-1:g.compute_id==="local"?1:(h.name||"").localeCompare(g.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 i=new Map(this.creatingNodes()),r=i.get(e);r&&(r.computeId=t,r.status="creating",i.set(e,r),this.creatingNodes.set(i),this.cd.markForCheck())}updateCreatingNodeStatus(e,t,i){let r=new Map(this.creatingNodes()),a=r.get(e);a&&(a.status=t,a.errorMessage=i,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,i=this.context.getZeroZeroTransformationPoint(),r=e.x*t+i.x+this.context.transformation.x,a=e.y*t+i.y+this.context.transformation.y;return{x:r,y:a}}startNodeCreation(e,t){let i=this.creatingNodes().get(e);if(!i)return;let r={template:i.template,controller:t,numberOfNodes:1,x:i.x,y:i.y,creationId:e};this.nodeCreationChange.emit(r)}onNodeCreated(e,t,i){this.updateCreatingNodeStatus(e,t?"success":"error",i),setTimeout(()=>{this.removeCreatingNode(e)},t?1e3:3e3)}openDialog(){this.dialog.open(sM,{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)(at(Qi))};static \u0275cmp=F({type:n,selectors:[["app-template"]],viewQuery:function(t,i){if(t&1&&In(DTe,5),t&2){let r;mt(r=pt())&&(i.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,i){if(t&1){let r=z();s(0,"button",2,0)(2,"mat-icon"),d(3,"add"),l()(),s(4,"mat-menu",3,1),_("closed",function(){return i.onMenuClosed()}),s(6,"button",4),_("click",function(){return i.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),_("click",function(c){return c.stopPropagation()}),s(13,"input",7),_("keyup",function(){return i.filterTemplates()})("ngModelChange",function(c){return i.searchText.set(c)}),l()(),s(14,"mat-form-field",8),_("click",function(c){return c.stopPropagation()}),s(15,"mat-select",9),_("selectionChange",function(c){return k(r),i.selectedType.set(c.value),T(i.filterTemplates())}),K(16,ITe,2,2,"mat-option",10,Oe),l()()(),s(18,"div",11),K(19,RTe,1,1,null,null,Ni),l()(),I(21,LTe,1,0,"div",12),I(22,VTe,1,3,"app-compute-selector",13),K(23,zTe,5,11,"div",14,PTe)}if(t&2){let r=ke(5);C("matMenuTriggerFor",r),m(13),C("ngModel",i.searchText())("ngModelOptions",Tt(7,yj)),m(2),C("ngModelOptions",Tt(8,yj))("ngModel",i.selectedType()),m(),Y(i.templateTypes),m(3),Y(i.filteredTemplates),m(2),A(i.showComputeSelector()?21:-1),m(),A(i.showComputeSelector()?22:-1),m(),Y(i.creatingNodes().values())}},dependencies:[ne,Je,Nt,Dt,k4,ve,oe,de,G,ze,qe,Kn,tt,Fn,we,Me,Se,Te,gt,Pt,ft,Vo,eo,Zx,v8,bj],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 Tg=(()=>{class n{httpController;constructor(e){this.httpController=e}create(e,t,i){return this.httpController.post(e,`/projects/${t}/snapshots`,i)}delete(e,t,i){return this.httpController.delete(e,`/projects/${t}/snapshots/${i}`)}list(e,t){return this.httpController.get(e,`/projects/${t}/snapshots`)}restore(e,t,i){return this.httpController.post(e,`/projects/${t}/snapshots/${i}/restore`,{})}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Eg=(()=>{class n{data;dialogRef=f(Ie);static CANCELLED;value=Q(50);constructor(e){this.data=e}onCancelClick(){this.dialogRef.close(n.CANCELLED)}static \u0275fac=function(t){return new(t||n)(at(Ct))};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,i){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),_("click",function(){return i.onCancelClick()}),d(6,"Cancel"),l()()),t&2&&(m(3),C("value",i.value()))},dependencies:[ve,Le,Ve,St,G,pe,dn,gs,Hc],encapsulation:2,changeDetection:0})}return n})();var lM=(()=>{class n{dialog;constructor(e){this.dialog=e}open(){return this.dialog.open(Eg,{width:"250px",autoFocus:!1,disableClose:!0})}static \u0275fac=function(t){return new(t||n)(ge(it))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var cM=class{snapshot_id;name;created_at;project_id};var dM=(()=>{class n{data;dialogRef=f(Ie);formBuilder=f(Bn);toasterService=f(ie);snapshotService=f(Tg);cd=f(X);controller;project;snapshot=new cM;inputForm;existingSnapshotNames=[];constructor(e){this.data=e,this.controller=e.controller,this.project=e.project,this.inputForm=this.formBuilder.group({snapshotName:new $e("",je.required)}),this.project?.project_id&&this.snapshotService.list(this.controller,this.project.project_id).subscribe({next:t=>{this.existingSnapshotNames=t.map(i=>i.name),this.cd.markForCheck()},error:t=>{let i=t.error?.message||t.message||"Failed to load snapshots";this.toasterService.error(i),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)(at(Ct))};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,i){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),_("click",function(){return i.onAddClick()}),d(10,"Add"),l()()),t&2&&(m(3),C("formGroup",i.inputForm))},dependencies:[ne,Et,rt,Nt,Dt,ot,Ft,Vt,ve,vc,Le,Ve,St,G,pe,Se,Te,Me,we,dn],styles:[".name-input[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var Ud=(()=>{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)(at(Ct))};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,i){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),_("click",function(){return i.onNoClick()}),d(7,"No"),l(),s(8,"button",3),_("click",function(){return i.onYesClick()}),d(9,"Yes"),l()()),t&2&&(m(),B(i.data.title),m(3),B(i.data.question))},dependencies:[ve,Le,Ve,St,G,pe],encapsulation:2,changeDetection:0})}return n})();var Sj=(()=>{class n{transform(e){let t=new Date(+e*1e3),i=t.getHours(),r="0"+t.getMinutes(),a="0"+t.getSeconds(),c=t.getFullYear(),p=t.getMonth()+1,u=t.getDate();return i+":"+r.substr(-2)+":"+a.substr(-2)+" "+u+"/"+p+"/"+c}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Br({name:"datefilter",type:n,pure:!0})}return n})();function jTe(n,o){n&1&&(s(0,"mat-header-cell",23),d(1,"Name"),l())}function $Te(n,o){if(n&1&&(s(0,"mat-cell",23),d(1),l()),n&2){let e=o.$implicit;m(),B(e.name)}}function HTe(n,o){n&1&&(s(0,"mat-header-cell",24),d(1,"Date"),l())}function UTe(n,o){if(n&1&&(s(0,"mat-cell",24),d(1),nn(2,"datefilter"),l()),n&2){let e=o.$implicit;m(),B($n(2,1,e.created_at))}}function WTe(n,o){n&1&&(s(0,"mat-header-cell",25),d(1,"Actions"),l())}function GTe(n,o){if(n&1){let e=z();s(0,"mat-cell",25)(1,"div",26)(2,"button",27),_("click",function(){let i=k(e).$implicit,r=v();return T(r.restoreSnapshot(i))}),s(3,"mat-icon"),d(4,"restore"),l()(),s(5,"button",28),_("click",function(){let i=k(e).$implicit,r=v();return T(r.deleteSnapshot(i))}),s(6,"mat-icon"),d(7,"delete"),l()()()()}}function qTe(n,o){n&1&&R(0,"mat-header-row")}function QTe(n,o){n&1&&R(0,"mat-row")}function XTe(n,o){n&1&&(s(0,"div",20),d(1,"No snapshots available"),l())}var wj=(()=>{class n{data;dialogRef=f(Ie);snapshotService=f(Tg);progressDialogService=f(lM);toaster=f(ie);dialog=f(it);cd=f(X);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=$t(()=>{let e=this.searchText().toLowerCase();return e?this.snapshots().filter(t=>t.name.toLowerCase().includes(e)):this.snapshots()});openCreateDialog(){this.dialog.open(dM,{panelClass:["base-dialog-panel","simple-dialog-panel"],data:{controller:this.controller,project:this.project},autoFocus:!1}).afterClosed().subscribe(t=>{if(t){let i=this.progressDialogService.open();this.snapshotService.create(this.controller,this.project.project_id,t).subscribe({next:()=>{i.close(),this.loadSnapshots(),this.toaster.success(`Snapshot '${t.name}' has been created.`)},error:r=>{i.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(Ud,{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(i=>{if(!i)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===Eg.CANCELLED&&a.unsubscribe()})})}deleteSnapshot(e){this.dialog.open(Ud,{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(i=>{i&&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)(at(Ct))};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,i){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),_("input",function(a){return i.searchText.set(a.target.value)}),l()(),s(8,"button",6),_("click",function(){return i.openCreateDialog()}),s(9,"mat-icon"),d(10,"add_circle_outline"),l(),d(11," Create snapshot "),l()(),s(12,"div",7)(13,"mat-table",8),Fe(14,9),Ce(15,jTe,2,0,"mat-header-cell",10)(16,$Te,2,1,"mat-cell",11),Re(),Fe(17,12),Ce(18,HTe,2,0,"mat-header-cell",13)(19,UTe,3,3,"mat-cell",14),Re(),Fe(20,15),Ce(21,WTe,2,0,"mat-header-cell",16)(22,GTe,8,0,"mat-cell",17),Re(),Ce(23,qTe,1,0,"mat-header-row",18)(24,QTe,1,0,"mat-row",19),l(),I(25,XTe,2,0,"div",20),l()(),s(26,"div",21)(27,"button",22),d(28,"Close"),l()()),t&2&&(m(7),C("value",i.searchText()),m(6),C("dataSource",i.filteredSnapshots()),m(10),C("matHeaderRowDef",i.displayedColumns),m(),C("matRowDefColumns",i.displayedColumns),m(),A(i.snapshots().length===0?25:-1))},dependencies:[ne,ve,vc,Le,Ve,St,G,pe,ze,oe,de,ht,Mt,we,Me,ts,Se,Te,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,Sj],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 mM=(()=>{class n{project=ae(void 0);controller=ae(void 0);dialog=f(it);openSnapshotDialog(){let e=this.project(),t=this.controller();!e||!t||this.dialog.open(wj,{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,i){t&1&&(s(0,"button",0),_("click",function(){return i.openSnapshotDialog()}),s(1,"mat-icon"),d(2,"filter_none"),l()())},dependencies:[ne,ve,ht,Mt,oe,de,G,ze],styles:[".snapshot-button[_ngcontent-%COMP%]{transition:transform .1s ease}.snapshot-button[_ngcontent-%COMP%]:hover{transform:scale(1.3)}"],changeDetection:0})}return n})();var Mj=(()=>{class n{controller=ae(void 0);project=ae(void 0);drawingDragged;drawingService=f(ji);drawingsDataSource=f(zi);drawingsEventSource=f(Ko);mapChangeDetectorRef=f(Ol);toasterService=f(ie);cdr=f(X);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:i=>{this.drawingsDataSource.update(i),this.mapChangeDetectorRef.detectChanges()},error:i=>{let r=i.error?.message||i.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,i){},encapsulation:2,changeDetection:0})}return n})();var kj=(()=>{class n{controller=ae(void 0);drawingResized;drawingService=f(ji);drawingsDataSource=f(zi);drawingsEventSource=f(Ko);mapDrawingToSvgConverter=f(Ss);toasterService=f(ie);cdr=f(X);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,i){},encapsulation:2,changeDetection:0})}return n})();var Tj=(()=>{class n{controller=ae(void 0);interfaceDragged;linkService=f(Pi);linksDataSource=f(qo);linksEventSource=f(Aa);toasterService=f(ie);cdr=f(X);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:i=>{this.linksDataSource.update(i)},error:i=>{let r=i.error?.message||i.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,i){},encapsulation:2,changeDetection:0})}return n})();var Ej=(()=>{class n{controller=ae(void 0);project;linkCreated;projectService=f(Ei);linkService=f(Pi);linksDataSource=f(qo);linksEventSource=f(Aa);mapNodeToNode=f(hp);mapPortToPort=f(Yf);toasterService=f(ie);cdr=f(X);ngOnInit(){this.linkCreated=this.linksEventSource.created.subscribe(e=>this.onLinkCreated(e))}onLinkCreated(e){let t=Math.abs(e.sourceNode.x-e.targetNode.x),i=Math.abs(e.sourceNode.y-e.targetNode.y),r=Math.sqrt(Math.pow(t,2)+Math.pow(i,2)),a=i/r,c=45/r*t,p=45/r*i,u=0,h=0,g=0,y=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,g=Math.floor(e.targetNode.width/2)-Math.round(c)-5-Math.round(20*a),y=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),g=Math.floor(e.targetNode.width/2)+Math.round(c)+5,y=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),g=Math.floor(e.targetNode.width/2)-Math.round(c)-5,y=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),g=Math.floor(e.targetNode.width/2)+Math.round(c)+5,y=Math.floor(e.targetNode.height/2)+Math.round(p)+5);let b=this.mapNodeToNode.convert(e.sourceNode),x=this.mapPortToPort.convert(e.sourcePort),M=this.mapNodeToNode.convert(e.targetNode),w=this.mapPortToPort.convert(e.targetPort);this.linkService.createLink(this.controller(),b,x,M,w,u,h,g,y).subscribe({next:()=>{this.projectService.links(this.controller(),this.project.project_id).subscribe(S=>{this.linksDataSource.set(S)})},error:S=>{let E=S.error?.message||S.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,i){},encapsulation:2,changeDetection:0})}return n})();var Dj=(()=>{class n{controller=ae(void 0);project=ae(void 0);nodeDragged;nodesDataSource=f(ui);nodeService=f(ut);nodesEventSource=f(Fl);mapChangeDetectorRef=f(Ol);toasterService=f(ie);cdr=f(X);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:i=>{this.nodesDataSource.update(i),this.mapChangeDetectorRef.detectChanges()},error:i=>{let r=i.error?.message||i.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,i){},encapsulation:2,changeDetection:0})}return n})();var Pj=(()=>{class n{controller=ae(void 0);nodeLabelDragged;nodesDataSource=f(ui);nodeService=f(ut);nodesEventSource=f(Fl);mapLabelToLabel=f(rd);toasterService=f(ie);cdr=f(X);ngOnInit(){this.nodeLabelDragged=this.nodesEventSource.labelDragged.subscribe(e=>this.onNodeLabelDragged(e))}onNodeLabelDragged(e){let t=this.nodesDataSource.get(e.datum.nodeId),i=e.datum,r=this.mapLabelToLabel.convert(i);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,i){},encapsulation:2,changeDetection:0})}return n})();var Ij=(()=>{class n{controller=ae(void 0);project;drawingSaved=new _e;textAdded;drawingService=f(ji);drawingsDataSource=f(zi);drawingsEventSource=f(Ko);drawingsFactory=f(_g);mapDrawingToSvgConverter=f(Ss);context=f(Ao);toasterService=f(ie);cdr=f(X);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 i=this.mapDrawingToSvgConverter.convert(t);this.drawingService.add(this.controller(),this.project.project_id,e.x,e.y,i).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,i){},encapsulation:2,changeDetection:0})}return n})();var KTe=(n,o)=>o.name;function YTe(n,o){if(n&1&&(s(0,"span",2),R(1,"span",4),s(2,"span",5),d(3),l()()),n&2){let e=o.$implicit;C("matTooltip",e.bpf),m(),Yt("background",e.color),Ae("marker-legend__swatch--default",!e.color),m(2),B(e.name)}}function ZTe(n,o){if(n&1){let e=z();s(0,"div",1),_("click",function(){k(e);let i=v();return T(i.onClick())}),K(1,YTe,4,6,"span",2,KTe),s(3,"span",3),d(4,"Markers"),l()()}if(n&2){let e=v();m(),Y(e.entries())}}var Aj=(()=>{class n{registry=f(ad);openMarkerManager=new _e;entries=$t(()=>{let e=this.registry.entries(),t=new Map;for(let r of e)t.has(r.name)||t.set(r.name,{bpf:r.bpf,color:r.color});let i=[];for(let[r,a]of t)i.push({name:r,bpf:a.bpf,color:a.color});return i});onClick(){this.openMarkerManager.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-marker-legend"]],outputs:{openMarkerManager:"openMarkerManager"},decls:1,vars:1,consts:[["title","Click to open Marker Manager",1,"marker-legend"],["title","Click to open Marker Manager",1,"marker-legend",3,"click"],["matTooltipPosition","above","matTooltipClass","marker-legend-tooltip",1,"marker-legend__pill",3,"matTooltip"],[1,"marker-legend__label"],[1,"marker-legend__swatch"],[1,"marker-legend__name"]],template:function(t,i){t&1&&I(0,ZTe,5,0,"div",0),t&2&&A(i.entries().length>0?0:-1)},dependencies:[ne,ht,Mt],styles:[".marker-legend[_ngcontent-%COMP%]{position:fixed;bottom:76px;left:50%;transform:translate(-50%);z-index:900;display:flex;align-items:center;gap:2px;padding:4px 6px;border-radius:8px;background-color:var(--mat-sys-surface);box-shadow:0 1px 4px color-mix(in srgb,var(--mat-sys-shadow) 15%,transparent),0 0 0 1px var(--mat-sys-outline-variant);cursor:pointer;user-select:none;transition:box-shadow .15s ease}.marker-legend[_ngcontent-%COMP%]:hover{box-shadow:0 2px 8px color-mix(in srgb,var(--mat-sys-shadow) 20%,transparent),0 0 0 1px var(--mat-sys-outline)}.marker-legend__pill[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;padding:2px 6px;border-radius:4px;transition:background-color .1s ease}.marker-legend__pill[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-surface-container-highest)}.marker-legend__swatch[_ngcontent-%COMP%]{width:10px;height:10px;border-radius:2px;flex-shrink:0}.marker-legend__swatch--default[_ngcontent-%COMP%]{background-color:var(--mat-sys-primary)}.marker-legend__name[_ngcontent-%COMP%]{font-size:11px;font-weight:500;color:var(--mat-sys-on-surface);white-space:nowrap}.marker-legend__label[_ngcontent-%COMP%]{font-size:10px;color:var(--mat-sys-on-surface-variant);margin-left:4px;padding-left:6px;border-left:1px solid var(--mat-sys-outline-variant);white-space:nowrap}"],changeDetection:0})}return n})();var pM=(()=>{class n{httpController;constructor(e){this.httpController=e}list(e,t,i){return this.httpController.get(e,`/projects/${t}/links/${i}/markers`)}create(e,t,i,r){return this.httpController.post(e,`/projects/${t}/links/${i}/markers`,r)}update(e,t,i,r,a){return this.httpController.put(e,`/projects/${t}/links/${i}/markers/${encodeURIComponent(r)}`,a)}delete(e,t,i,r){return this.httpController.delete(e,`/projects/${t}/links/${i}/markers/${encodeURIComponent(r)}`)}setEnabled(e,t,i,r,a){return this.httpController.put(e,`/projects/${t}/links/${i}/markers/${encodeURIComponent(r)}`,{enabled:a})}listDefinitions(e,t){return this.httpController.get(e,`/projects/${t}/marker-definitions`)}createDefinition(e,t,i){return this.httpController.post(e,`/projects/${t}/marker-definitions`,i)}updateDefinition(e,t,i,r){return this.httpController.put(e,`/projects/${t}/marker-definitions/${encodeURIComponent(i)}`,r)}deleteDefinition(e,t,i){return this.httpController.delete(e,`/projects/${t}/marker-definitions/${encodeURIComponent(i)}`)}pauseDefinition(e,t,i){return this.httpController.post(e,`/projects/${t}/marker-definitions/${encodeURIComponent(i)}/pause`,{})}resumeDefinition(e,t,i){return this.httpController.post(e,`/projects/${t}/marker-definitions/${encodeURIComponent(i)}/resume`,{})}aggregateList(e,t){return this.httpController.get(e,`/projects/${t}/markers`)}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var JTe=(n,o)=>o.id,eEe=(n,o)=>o.value;function tEe(n,o){n&1&&(s(0,"mat-error"),d(1,"BPF is required"),l())}function nEe(n,o){n&1&&(s(0,"mat-error"),d(1,"Name is required"),l())}function iEe(n,o){n&1&&(s(0,"mat-error"),d(1,'Name cannot start with "global"'),l())}function oEe(n,o){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=o.$implicit;C("value",e.id),m(),B(e.name)}}function rEe(n,o){if(n&1&&(s(0,"mat-option",7),d(1),l()),n&2){let e=o.$implicit;C("value",e.value),m(),B(e.label)}}function aEe(n,o){if(n&1&&(s(0,"mat-form-field",2)(1,"mat-label"),d(2,"Serial encapsulation"),l(),s(3,"mat-select",19),K(4,rEe,2,2,"mat-option",7,eEe),l()()),n&2){let e=v();m(4),Y(e.dataLinkOptions())}}function sEe(n,o){n&1&&(s(0,"mat-error"),d(1,"Required"),l())}function lEe(n,o){n&1&&(s(0,"mat-error"),d(1,"Must be \u2265 1"),l())}function cEe(n,o){if(n&1&&(R(0,"mat-spinner",20),d(1)),n&2){let e=v();C("diameter",16),m(),ee(" ",e.mode()==="edit"?"Saving\u2026":"Adding\u2026"," ")}}function dEe(n,o){if(n&1&&d(0),n&2){let e=v();ee(" ",e.submitLabel()," ")}}var Oj=(()=>{class n{form=ae.required();mode=ae("create");captureOptions=ae([]);dataLinkOptions=ae([]);linkType=ae("ethernet");isSerial=$t(()=>this.linkType()==="serial");submitLabel=$t(()=>this.mode()==="edit"?"Save":"Add");submitting=ae(!1);save=$g();cancel=$g();static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-marker-form"]],inputs:{form:[1,"form"],mode:[1,"mode"],captureOptions:[1,"captureOptions"],dataLinkOptions:[1,"dataLinkOptions"],linkType:[1,"linkType"],submitting:[1,"submitting"]},outputs:{save:"save",cancel:"cancel"},decls:54,vars:10,consts:[[1,"marker-form",3,"ngSubmit","formGroup"],[1,"marker-form__row","marker-form__row--full"],[1,"marker-form__field"],["matInput","","formControlName","bpf","placeholder","tcp port 80","rows","1","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","4"],[1,"marker-form__row","marker-form__row--identity"],["matInput","","formControlName","name","placeholder","my-filter"],["formControlName","capture_node_id"],[3,"value"],["formControlName","direction"],["value","both"],["value","tx"],["value","rx"],[1,"marker-form__row","marker-form__row--style"],["matInput","","type","number","formControlName","highlight_duration","placeholder","500"],["matInput","","type","color","formControlName","color",1,"marker-form__color"],["matInput","","type","number","formControlName","tag","placeholder","\u2014"],[1,"marker-form__actions"],["mat-flat-button","","color","primary","type","submit",3,"disabled"],["mat-stroked-button","","type","button",3,"click"],["formControlName","data_link_type","matTooltip","WAN encapsulation (matches the router's IOS setting)"],[1,"marker-form__submit-spinner",3,"diameter"]],template:function(t,i){if(t&1&&(s(0,"form",0),_("ngSubmit",function(){return i.save.emit()}),s(1,"div",1)(2,"mat-form-field",2)(3,"mat-label"),d(4,"BPF expression"),l(),R(5,"textarea",3),I(6,tEe,2,0,"mat-error"),l()(),s(7,"div",4)(8,"mat-form-field",2)(9,"mat-label"),d(10,"Name"),l(),R(11,"input",5),I(12,nEe,2,0,"mat-error"),I(13,iEe,2,0,"mat-error"),l(),s(14,"mat-form-field",2)(15,"mat-label"),d(16,"Capture node"),l(),s(17,"mat-select",6)(18,"mat-option",7),d(19,"Auto"),l(),K(20,oEe,2,2,"mat-option",7,JTe),l()(),s(22,"mat-form-field",2)(23,"mat-label"),d(24,"Direction"),l(),s(25,"mat-select",8)(26,"mat-option",9),d(27,"Both"),l(),s(28,"mat-option",10),d(29,"Tx"),l(),s(30,"mat-option",11),d(31,"Rx"),l()()(),I(32,aEe,6,0,"mat-form-field",2),l(),s(33,"div",12)(34,"mat-form-field",2)(35,"mat-label"),d(36,"Highlight ms"),l(),R(37,"input",13),I(38,sEe,2,0,"mat-error"),I(39,lEe,2,0,"mat-error"),l(),s(40,"mat-form-field",2)(41,"mat-label"),d(42,"Color"),l(),R(43,"input",14),l(),s(44,"mat-form-field",2)(45,"mat-label"),d(46,"Tag"),l(),R(47,"input",15),l(),s(48,"div",16)(49,"button",17),I(50,cEe,2,2)(51,dEe,1,1),l(),s(52,"button",18),_("click",function(){return i.cancel.emit()}),d(53,"Cancel"),l()()()()),t&2){let r,a,c,p,u;C("formGroup",i.form()),m(6),A((r=i.form().get("bpf"))!=null&&r.hasError("required")?6:-1),m(6),A((a=i.form().get("name"))!=null&&a.hasError("required")?12:-1),m(),A((c=i.form().get("name"))!=null&&c.hasError("notGlobalName")?13:-1),m(5),C("value",null),m(2),Y(i.captureOptions()),m(12),A(i.isSerial()?32:-1),m(6),A((p=i.form().get("highlight_duration"))!=null&&p.hasError("required")?38:-1),m(),A((u=i.form().get("highlight_duration"))!=null&&u.hasError("min")?39:-1),m(10),C("disabled",i.form().invalid||i.submitting()),m(),A(i.submitting()?50:51)}},dependencies:[ne,Et,rt,Nt,Uo,Dt,ot,Ft,Vt,we,Me,Xe,ni,Se,Te,Bc,gt,Pt,ft,G,pe,ht,Mt,dn,qn],styles:[".marker-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px;margin:8px 0 4px;padding:8px;background:var(--mat-sys-surface-container);border-radius:6px}.marker-form__row[_ngcontent-%COMP%]{display:grid;align-items:start;gap:16px}.marker-form__row--full[_ngcontent-%COMP%]{grid-template-columns:1fr}.marker-form__row--identity[_ngcontent-%COMP%]{grid-template-columns:2.5fr 1.5fr .9fr}.marker-form__row--style[_ngcontent-%COMP%]{grid-template-columns:minmax(7rem,1.3fr) minmax(6rem,1fr) minmax(6rem,1fr) 1fr}.marker-form__field[_ngcontent-%COMP%]{width:100%;margin-bottom:4px}.marker-form__color[_ngcontent-%COMP%]{cursor:pointer;block-size:20px;inline-size:100%;box-sizing:border-box}.marker-form__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:8px;align-self:start;margin-top:18px}.marker-form__submit-spinner[_ngcontent-%COMP%]{--mdc-circular-progress-active-indicator-color: var(--mat-sys-on-primary)}"],changeDetection:0})}return n})();var mEe=["windowWrapper"],pEe=()=>({top:!0}),uEe=()=>({right:!0}),hEe=()=>({bottom:!0}),fEe=()=>({left:!0}),gEe=()=>({top:!0,left:!0}),_Ee=()=>({top:!0,right:!0}),vEe=()=>({bottom:!0,left:!0}),CEe=()=>({bottom:!0,right:!0}),Fj=(n,o)=>({$implicit:n,off:o}),Rj=(n,o)=>({$implicit:n,linkId:o}),xEe=(n,o)=>o.value,TO=(n,o)=>o.name,Nj=(n,o)=>o.id,bEe=(n,o)=>o.linkId;function yEe(n,o){n&1&&R(0,"div",18)(1,"div",19)(2,"div",20)(3,"div",21)(4,"div",22)(5,"div",23)(6,"div",24)(7,"div",25),n&2&&(C("resizeEdges",Tt(8,pEe)),m(),C("resizeEdges",Tt(9,uEe)),m(),C("resizeEdges",Tt(10,hEe)),m(),C("resizeEdges",Tt(11,fEe)),m(),C("resizeEdges",Tt(12,gEe)),m(),C("resizeEdges",Tt(13,_Ee)),m(),C("resizeEdges",Tt(14,vEe)),m(),C("resizeEdges",Tt(15,CEe)))}function SEe(n,o){n&1&&(s(0,"mat-error"),d(1,"BPF is required"),l())}function wEe(n,o){n&1&&(s(0,"mat-error"),d(1,"Name is required"),l())}function MEe(n,o){n&1&&(s(0,"mat-error"),d(1,'Name cannot start with "global"'),l())}function kEe(n,o){if(n&1&&(s(0,"mat-option",35),d(1),l()),n&2){let e=o.$implicit;C("value",e.value),m(),B(e.label)}}function TEe(n,o){n&1&&(s(0,"mat-error"),d(1,"Required"),l())}function EEe(n,o){n&1&&(s(0,"mat-error"),d(1,"Must be \u2265 1"),l())}function DEe(n,o){if(n&1&&(R(0,"mat-spinner",44),d(1)),n&2){let e=v(2);C("diameter",18),m(),ee(" ",e.editingDefinition()?"Saving\u2026":"Creating\u2026"," ")}}function PEe(n,o){if(n&1&&d(0),n&2){let e=v(2);ee(" ",e.editingDefinition()?"Save":"Create"," ")}}function IEe(n,o){if(n&1){let e=z();s(0,"button",45),_("click",function(){k(e);let i=v(2);return T(i.cancelEditDefinition())}),d(1,"Cancel"),l()}}function AEe(n,o){if(n&1&&(s(0,"div",40),d(1),l()),n&2){let e=v(2);m(),B(e.defError())}}function OEe(n,o){n&1&&(s(0,"div",42),d(1,"Loading\u2026"),l())}function NEe(n,o){n&1&&(s(0,"div",42),d(1,"No definitions. Create one above \u2014 it applies to all capable links."),l())}function FEe(n,o){if(n&1&&(s(0,"span",50),d(1),l()),n&2){let e=v().$implicit;m(),ee("",e.highlight_duration,"ms")}}function REe(n,o){if(n&1&&(s(0,"span",51),d(1),l()),n&2){let e=v().$implicit;m(),B(e.direction)}}function LEe(n,o){n&1&&R(0,"mat-spinner",58),n&2&&C("diameter",18)}function VEe(n,o){n&1&&(s(0,"mat-icon"),d(1,"delete"),l())}function BEe(n,o){if(n&1){let e=z();s(0,"div",46),R(1,"span",47),s(2,"span",48),d(3),l(),s(4,"span",49),d(5),l(),I(6,FEe,2,1,"span",50),I(7,REe,2,1,"span",51),s(8,"span",52),d(9),l(),R(10,"span",53),s(11,"button",54),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.toggleDefinitionPaused(i))}),Fi(12,55),l(),s(13,"button",56),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.startEditDefinition(i))}),s(14,"mat-icon"),d(15,"edit"),l()(),s(16,"button",57),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.deleteDefinition(i))}),I(17,LEe,1,1,"mat-spinner",58)(18,VEe,2,0,"mat-icon"),l()()}if(n&2){let e=o.$implicit,t=v(2),i=ke(24);Ae("marker-manager__row--editing",t.editingDefinition()===e.name)("marker-manager__row--paused",e.paused),m(),Yt("background",e.color),Ae("marker-manager__swatch--default",!e.color),C("title",e.color||"default color"),m(2),ee("global-",e.name),m(2),B(e.bpf),m(),A(e.highlight_duration!==null?6:-1),m(),A(e.direction?7:-1),m(2),mi(" \u2192 ",e.linkCount," link",e.linkCount===1?"":"s"," "),m(2),C("matTooltip",e.paused?"Resume rule (all copies)":"Pause rule (disables all copies)"),m(),C("ngTemplateOutlet",i)("ngTemplateOutletContext",aa(19,Fj,t.togglingDefinition()===e.name,e.paused)),m(5),A(t.deletingDefinition()===e.name?17:18)}}function zEe(n,o){if(n&1){let e=z();s(0,"div",16)(1,"form",26),_("ngSubmit",function(){k(e);let i=v();return T(i.submitDefinition())}),s(2,"div",27),d(3),l(),s(4,"div",28)(5,"mat-form-field",29)(6,"mat-label"),d(7,"BPF expression"),l(),R(8,"textarea",30),I(9,SEe,2,0,"mat-error"),l()(),s(10,"div",31)(11,"mat-form-field",29)(12,"mat-label"),d(13,"Name"),l(),s(14,"span",32),d(15,"global-\xA0"),l(),R(16,"input",33),I(17,wEe,2,0,"mat-error"),I(18,MEe,2,0,"mat-error"),l(),s(19,"mat-form-field",29)(20,"mat-label"),d(21,"Serial encapsulation"),l(),s(22,"mat-select",34),K(23,kEe,2,2,"mat-option",35,xEe),l()(),s(25,"mat-form-field",29)(26,"mat-label"),d(27,"Highlight ms"),l(),R(28,"input",36),I(29,TEe,2,0,"mat-error"),I(30,EEe,2,0,"mat-error"),l(),s(31,"mat-form-field",29)(32,"mat-label"),d(33,"Color"),l(),R(34,"input",37),l(),s(35,"button",38),I(36,DEe,2,2)(37,PEe,1,1),l(),I(38,IEe,2,0,"button",39),l()(),R(39,"mat-divider"),I(40,AEe,2,1,"div",40),s(41,"div",41),I(42,OEe,2,0,"div",42),I(43,NEe,2,0,"div",42),K(44,BEe,19,22,"div",43,TO),l()()}if(n&2){let e,t,i,r,a,c=v();m(),C("formGroup",c.definitionForm),m(2),ee(" ",c.editingDefinition()?"Edit definition":"New definition"," "),m(6),A((e=c.definitionForm.get("bpf"))!=null&&e.hasError("required")?9:-1),m(8),A((t=c.definitionForm.get("name"))!=null&&t.hasError("required")?17:-1),m(),A((i=c.definitionForm.get("name"))!=null&&i.hasError("notGlobalName")?18:-1),m(5),Y(c.serialDataLinkTypes),m(6),A((r=c.definitionForm.get("highlight_duration"))!=null&&r.hasError("required")?29:-1),m(),A((a=c.definitionForm.get("highlight_duration"))!=null&&a.hasError("min")?30:-1),m(5),C("disabled",c.definitionForm.invalid||c.submittingDefinition()),m(),A(c.submittingDefinition()?36:37),m(2),A(c.editingDefinition()?38:-1),m(2),A(c.defError()?40:-1),m(2),A(c.loading()?42:-1),m(),A(!c.loading()&&c.definitions().length===0?43:-1),m(),Y(c.definitions())}}function jEe(n,o){n&1&&(s(0,"div",40),d(1),l()),n&2&&(m(),B(o))}function $Ee(n,o){if(n&1&&(s(0,"mat-option",35),d(1),l()),n&2){let e=o.$implicit;C("value",e.id),m(),B(e.name)}}function HEe(n,o){if(n&1&&(s(0,"mat-option",35),d(1),l()),n&2){let e=o.$implicit;C("value",e.id),m(),B(e.name)}}function UEe(n,o){n&1&&(s(0,"div",40),d(1),l()),n&2&&(m(),B(o))}function WEe(n,o){n&1&&(s(0,"div",69)(1,"mat-icon"),d(2,"info"),l(),d(3," Definitions are active \u2014 inherited markers on this link are managed via the Definitions tab. "),l())}function GEe(n,o){if(n&1){let e=z();s(0,"app-marker-form",71),_("save",function(){k(e);let i=v(),r=v(2);return T(r.submitMarker(i.linkId))})("cancel",function(){k(e);let i=v(),r=v(2);return T(r.toggleAddMarker(i.linkId))}),l()}if(n&2){let e=v(),t=v(2);C("form",t.markerForm)("captureOptions",t.linkEndpoints(e.linkId))("dataLinkOptions",t.serialDataLinkTypes)("linkType",t.linkTypeOf(e.linkId))("submitting",t.submittingMarker()===e.linkId)}}function qEe(n,o){if(n&1&&Fi(0,55),n&2){let e=o.$implicit,t=v();v(2);let i=ke(26);C("ngTemplateOutlet",i)("ngTemplateOutletContext",aa(2,Rj,e,t.linkId))}}function QEe(n,o){if(n&1){let e=z();s(0,"div",63)(1,"div",64)(2,"span",65),d(3),l(),s(4,"span",66),d(5),l(),R(6,"span",53),s(7,"button",67),_("click",function(){let i=k(e),r=v(2);return T(r.toggleAddMarker(i.linkId))}),s(8,"mat-icon"),d(9,"add"),l(),d(10," Marker "),l(),s(11,"button",68),_("click",function(){k(e);let i=v(2);return T(i.resetLinkSelect())}),s(12,"mat-icon"),d(13,"arrow_back"),l()()(),I(14,UEe,2,1,"div",40),I(15,WEe,4,0,"div",69),I(16,GEe,1,5,"app-marker-form",70),K(17,qEe,1,5,"ng-container",55,TO),l()}if(n&2){let e,t=o,i=v(2);m(2),C("title",t.linkId),m(),B(t.name),m(2),B(t.markers.length),m(2),Ae("add-button--active",i.addingToLink()===t.linkId),m(7),A((e=i.groupError(t.linkId))?14:-1,e),m(),A(i.definitions().length>0?15:-1),m(),A(i.addingToLink()===t.linkId?16:-1),m(),Y(t.markers)}}function XEe(n,o){n&1&&(s(0,"div",42),d(1," No markers on any link yet. Use the selector above to pick a link and add one. "),l())}function KEe(n,o){if(n&1&&(s(0,"div",42),d(1),s(2,"strong"),d(3,"Node / Link"),l(),d(4," selector above to filter by a specific link. "),l()),n&2){let e=v(3);m(),ee(" ",e.linkGroups().length," links have markers. Use the ")}}function YEe(n,o){n&1&&(s(0,"div",40),d(1),l()),n&2&&(m(),B(o))}function ZEe(n,o){if(n&1){let e=z();s(0,"app-marker-form",71),_("save",function(){k(e);let i=v(2).$implicit,r=v(4);return T(r.submitMarker(i.linkId))})("cancel",function(){k(e);let i=v(2).$implicit,r=v(4);return T(r.toggleAddMarker(i.linkId))}),l()}if(n&2){let e=v(2).$implicit,t=v(4);C("form",t.markerForm)("captureOptions",t.linkEndpoints(e.linkId))("dataLinkOptions",t.serialDataLinkTypes)("linkType",t.linkTypeOf(e.linkId))("submitting",t.submittingMarker()===e.linkId)}}function JEe(n,o){if(n&1&&Fi(0,55),n&2){let e=o.$implicit,t=v(2).$implicit;v(4);let i=ke(26);C("ngTemplateOutlet",i)("ngTemplateOutletContext",aa(2,Rj,e,t.linkId))}}function eDe(n,o){if(n&1&&(I(0,YEe,2,1,"div",40),I(1,ZEe,1,5,"app-marker-form",70),K(2,JEe,1,5,"ng-container",55,TO)),n&2){let e,t=v().$implicit,i=v(4);A((e=i.groupError(t.linkId))?0:-1,e),m(),A(i.addingToLink()===t.linkId?1:-1),m(),Y(t.markers)}}function tDe(n,o){if(n&1){let e=z();s(0,"div",63)(1,"div",72),_("click",function(){let i=k(e).$implicit,r=v(4);return T(r.toggleGroup(i.linkId))}),s(2,"mat-icon",73),d(3),l(),s(4,"span",65),d(5),l(),s(6,"span",66),d(7),l(),R(8,"span",53),s(9,"button",67),_("click",function(i){let r=k(e).$implicit,a=v(4);return i.stopPropagation(),T(a.toggleAddMarker(r.linkId))}),s(10,"mat-icon"),d(11,"add"),l(),d(12," Marker "),l()(),I(13,eDe,4,2),l()}if(n&2){let e=o.$implicit,t=v(4);m(3),ee(" ",t.isGroupCollapsed(e.linkId)?"chevron_right":"expand_more"," "),m(),C("title",e.linkId),m(),B(e.name),m(2),B(e.markers.length),m(2),Ae("add-button--active",t.addingToLink()===e.linkId),m(4),A(t.isGroupCollapsed(e.linkId)?-1:13)}}function nDe(n,o){if(n&1&&K(0,tDe,14,7,"div",63,bEe),n&2){let e=v(3);Y(e.linkGroups())}}function iDe(n,o){if(n&1&&(s(0,"div",41),I(1,XEe,2,0,"div",42)(2,KEe,5,1,"div",42)(3,nDe,2,0),l()),n&2){let e=v(2);m(),A(e.linkGroups().length===0?1:e.linkGroups().length>50?2:3)}}function oDe(n,o){if(n&1){let e=z();s(0,"div",16),I(1,jEe,2,1,"div",40),s(2,"div",59)(3,"mat-form-field",29)(4,"mat-label"),d(5,"Node"),l(),s(6,"input",60),_("input",function(i){k(e);let r=v();return T(r.nodeSearchText.set(i.target.value))}),l(),s(7,"mat-autocomplete",61,3),_("optionSelected",function(i){k(e);let r=v();return T(r.onNodeSelect(i.option.value))}),s(9,"mat-option",35),d(10,"All nodes"),l(),K(11,$Ee,2,2,"mat-option",35,Nj),l()(),s(13,"mat-form-field",29)(14,"mat-label"),d(15,"Link"),l(),s(16,"input",62),_("input",function(i){k(e);let r=v();return T(r.linkSearchText.set(i.target.value))}),l(),s(17,"mat-autocomplete",61,4),_("optionSelected",function(i){k(e);let r=v();return T(r.onLinkSelect(i.option.value))}),s(19,"mat-option",35),d(20,"All links"),l(),K(21,HEe,2,2,"mat-option",35,Nj),l()()(),I(23,QEe,19,8,"div",63),I(24,iDe,4,1,"div",41),l()}if(n&2){let e,t,i=ke(8),r=ke(18),a=v();m(),A((e=a.panelError())?1:-1,e),m(5),C("value",a.nodeSearchText())("matAutocomplete",i),m(),C("displayWith",a.displayNode),m(2),C("value",null),m(2),Y(a.filteredNodeOptions()),m(5),C("value",a.linkSearchText())("matAutocomplete",r)("placeholder",a.selectedNodeId()?"Select a link\u2026":"Pick a node first\u2026"),m(),C("displayWith",a.displayLink),m(2),C("value",null),m(2),Y(a.filteredLinkOptions()),m(2),A((t=a.selectedLinkGroup())?23:-1,t),m(),A(a.selectedLinkId()?-1:24)}}function rDe(n,o){n&1&&R(0,"mat-spinner",58),n&2&&C("diameter",18)}function aDe(n,o){if(n&1&&(s(0,"mat-icon"),d(1),l()),n&2){let e=v().off;m(),B(e?"sensors_off":"sensors")}}function sDe(n,o){if(n&1&&I(0,rDe,1,1,"mat-spinner",58)(1,aDe,2,1,"mat-icon"),n&2){let e=o.$implicit;A(e?0:1)}}function lDe(n,o){if(n&1){let e=z();s(0,"app-marker-form",76),_("save",function(){k(e);let i=v(2).linkId,r=v();return T(r.submitEditMarker(i))})("cancel",function(){k(e);let i=v(3);return T(i.cancelEditMarker())}),l()}if(n&2){let e=v(2).linkId,t=v();C("form",t.markerEditForm)("captureOptions",t.linkEndpoints(e))("dataLinkOptions",t.serialDataLinkTypes)("linkType",t.linkTypeOf(e))("submitting",t.submittingEditMarker())}}function cDe(n,o){if(n&1&&I(0,lDe,1,5,"app-marker-form",75),n&2){let e=o,t=v(),i=t.$implicit,r=t.linkId;A(e.linkId===r&&e.name===i.name?0:-1)}}function dDe(n,o){if(n&1&&(s(0,"span",78),d(1),l()),n&2){let e=v(2).$implicit,t=v();m(),B(t.nodeName(e.capture_node_id))}}function mDe(n,o){if(n&1&&(s(0,"span",51),d(1),l()),n&2){let e=v(2).$implicit;m(),B(e.direction)}}function pDe(n,o){n&1&&(s(0,"span",79),d(1," inherited "),l())}function uDe(n,o){n&1&&(s(0,"button",80)(1,"mat-icon"),d(2,"lock"),l()())}function hDe(n,o){n&1&&R(0,"mat-spinner",58),n&2&&C("diameter",18)}function fDe(n,o){n&1&&(s(0,"mat-icon"),d(1,"delete"),l())}function gDe(n,o){if(n&1){let e=z();s(0,"button",54),_("click",function(){k(e);let i=v(2),r=i.$implicit,a=i.linkId,c=v();return T(c.toggleMarkerEnabled(a,r))}),Fi(1,55),l(),s(2,"button",56),_("click",function(){k(e);let i=v(2),r=i.$implicit,a=i.linkId,c=v();return T(c.startEditMarker(a,r))}),s(3,"mat-icon"),d(4,"edit"),l()(),s(5,"button",81),_("click",function(){k(e);let i=v(2),r=i.$implicit,a=i.linkId,c=v();return T(c.deleteMarker(a,r.name))}),I(6,hDe,1,1,"mat-spinner",58)(7,fDe,2,0,"mat-icon"),l()}if(n&2){let e=v(2),t=e.$implicit,i=e.linkId,r=v(),a=ke(24);C("matTooltip",t.enabled===!1?"Enable (signal + capture)":"Disable (signal + capture)"),m(),C("ngTemplateOutlet",a)("ngTemplateOutletContext",aa(4,Fj,r.isTogglingMarker(i,t.name),t.enabled===!1)),m(5),A(r.isDeletingMarker(i,t.name)?6:7)}}function _De(n,o){if(n&1&&(s(0,"div",46),R(1,"span",77),s(2,"span",48),d(3),l(),s(4,"span",49),d(5),l(),I(6,dDe,2,1,"span",78),I(7,mDe,2,1,"span",51),I(8,pDe,2,0,"span",79),R(9,"span",53),I(10,uDe,3,0,"button",80)(11,gDe,8,7),l()),n&2){let e=v().$implicit;Ae("marker-manager__row--disabled",e.enabled===!1),m(),Yt("background",e.color),Ae("marker-manager__swatch--default",!e.color),m(2),B(e.name),m(2),B(e.bpf),m(),A(e.capture_node_id?6:-1),m(),A(e.direction?7:-1),m(),A(e.inherited_from?8:-1),m(2),A(e.inherited_from?10:11)}}function vDe(n,o){if(n&1&&I(0,cDe,1,1)(1,_De,12,12,"div",74),n&2){let e,t=v();A((e=t.editingMarker())?0:1,e)}}function kO(n){let o=n.value;return typeof o=="string"&&o.trim().toLowerCase().startsWith("global")?{notGlobalName:!0}:null}var Lj=(()=>{class n{DEFAULT_WIDTH=800;DEFAULT_HEIGHT=600;DEFAULT_LEFT="120px";DEFAULT_TOP="80px";MIN_WIDTH=560;MIN_HEIGHT=400;WINDOW_ID="marker-manager";destroy$=new We;controller=ae();project=ae();zIndex=ae(1e3);closeWindow=new _e;windowFocused=new _e;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=Q(!1);isResizingSignal=Q(!1);isMinimizedSignal=Q(!1);isDragging=this.isDraggingSignal.asReadonly();isResizing=this.isResizingSignal.asReadonly();isMinimized=this.isMinimizedSignal.asReadonly();definitions=Q([]);linkGroups=Q([]);loading=Q(!1);defError=Q(null);linkError=Q(null);activeTabIndex=Q(0);editingDefinition=Q(null);addingToLink=Q(null);editingMarker=Q(null);collapsedGroups=Q(new Set);togglingDefinition=Q(null);togglingMarker=Q(null);deletingDefinition=Q(null);submittingDefinition=Q(!1);deletingMarker=Q(null);submittingMarker=Q(null);submittingEditMarker=Q(!1);nodeOptions=Q([]);nodeSearchText=Q("");filteredNodeOptions=$t(()=>{let e=this.nodeSearchText().trim().toLowerCase(),t=this.nodeOptions();return e?t.filter(i=>i.name.toLowerCase().includes(e)):t});selectedNodeId=Q(null);linkOptions=Q([]);linkSearchText=Q("");filteredLinkOptions=$t(()=>{let e=this.linkSearchText().trim().toLowerCase(),t=this.selectedNodeId(),i=this.linkOptions();return t&&(i=i.filter(r=>this.linksDataSource.get(r.id)?.nodes?.some(c=>c.node_id===t))),e?i.filter(r=>r.name.toLowerCase().includes(e)):i});selectedLinkId=Q(null);selectedLinkGroup=$t(()=>{let e=this.selectedLinkId();return e?this.linkGroups().find(i=>i.linkId===e)??{linkId:e,name:this.linkName(e),markers:[]}:null});definitionForm=new Ho({name:new $e("",[je.required,kO]),bpf:new $e("",[je.required]),tag:new $e(null),color:new $e(null),highlight_duration:new $e(800,{nonNullable:!0,validators:[je.required,je.min(1)]}),direction:new $e("both"),data_link_type:new $e(null)});markerForm=new Ho({name:new $e("",[je.required,kO]),bpf:new $e("",[je.required]),tag:new $e(null),color:new $e(null),highlight_duration:new $e(800,{nonNullable:!0,validators:[je.required,je.min(1)]}),direction:new $e("both"),data_link_type:new $e(null),capture_node_id:new $e(null)});markerEditForm=new Ho({name:new $e({value:"",disabled:!0},[je.required,kO]),bpf:new $e("",[je.required]),tag:new $e(null),color:new $e(null),highlight_duration:new $e(800,{nonNullable:!0,validators:[je.required,je.min(1)]}),direction:new $e("both"),data_link_type:new $e({value:"DLT_EN10MB",disabled:!0}),capture_node_id:new $e({value:null,disabled:!0})});serialDataLinkTypes=[{label:"Cisco HDLC",value:"DLT_C_HDLC"},{label:"Cisco PPP",value:"DLT_PPP_SERIAL"},{label:"Frame Relay",value:"DLT_FRELAY"},{label:"ATM",value:"DLT_ATM_RFC1483"}];boundaryService=f(Vl);windowManagement=f(Rl);cdr=f(X);markerService=f(pM);linkService=f(Pi);linksDataSource=f(qo);mapLinksDataSource=f(kl);nodesDataSource=f(ui);markerRegistryService=f(ad);toasterService=f(ie);dialog=f(it);dragStartX=0;dragStartY=0;dragStartLeft=0;dragStartTop=0;windowWrapper=Rt("windowWrapper");constructor(){ur(()=>{let e=this.WINDOW_ID,i=this.windowManagement.minimizedWindows().some(r=>r.id===e);i!==this.isMinimizedSignal()&&this.isMinimizedSignal.set(i)})}ngOnInit(){let e=window.innerWidth<=768?56:64;this.boundaryService.setConfig({topOffset:e}),this.setupDragHandling(),this.buildNodeOptions(),this.buildLinkOptions(),this.loadDefinitions(),this.loadAggregate()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}close(){this.windowManagement.restoreWindow(this.WINDOW_ID),this.closeWindow.emit()}toggleMinimize(){this.windowManagement.toggleMinimize(this.WINDOW_ID,"marker"),this.cdr.markForCheck()}onWindowFocus(){if(this.isMinimizedSignal()){this.toggleMinimize();return}this.windowFocused.emit(),this.cdr.markForCheck()}loadDefinitions(){let e=this.controller(),t=this.project();!e||!t||(this.loading.set(!0),this.markerService.listDefinitions(e,t.project_id).pipe(Ge(this.destroy$)).subscribe({next:i=>{this.definitions.set(this.toDefinitionRows(i)),this.loading.set(!1),this.cdr.markForCheck()},error:i=>{this.defError.set(i.error?.message||i.message||"Failed to load definitions"),this.loading.set(!1),this.cdr.markForCheck()}}))}buildNodeOptions(){let e=this.nodesDataSource.getItems(),t=[];for(let i of e)i&&t.push({id:i.node_id,name:i.name});t.sort((i,r)=>i.name.localeCompare(r.name)),this.nodeOptions.set(t)}buildLinkOptions(){let e=this.linksDataSource.getItems(),t=[];for(let i of e)i&&t.push({id:i.link_id,name:this.linkName(i.link_id)});t.sort((i,r)=>i.name.localeCompare(r.name)),this.linkOptions.set(t)}loadAggregate(){let e=this.controller(),t=this.project();!e||!t||this.markerService.aggregateList(e,t.project_id).pipe(Ge(this.destroy$)).subscribe({next:i=>{this.linkGroups.set(this.buildGroups(i)),this.markerRegistryService.rebuildFromAggregate(i),this.syncLinkMarkersFromAggregate(i),this.cdr.markForCheck()},error:i=>{this.linkError.set({linkId:null,message:i.error?.message||i.message||"Failed to load markers"}),this.cdr.markForCheck()}})}toDefinitionRows(e){return Object.entries(e).map(([t,i])=>({name:t,bpf:i.bpf,tag:i.tag??null,color:i.color??null,highlight_duration:i.highlight_duration??null,direction:i.direction??null,data_link_type:i.data_link_type&&i.data_link_type!=="DLT_EN10MB"?i.data_link_type:null,linkCount:i.link_ids?.length??0,paused:i.paused??!1}))}buildGroups(e){let t=new Map;for(let[r,a]of Object.entries(e)){let c=r.indexOf("/"),p=c>=0?r.slice(c+1):r,u=t.get(a.link_id)??[];u.push(Ye(Z({},a),{name:p})),t.set(a.link_id,u)}let i=[];for(let[r,a]of t)i.push({linkId:r,name:this.linkName(r),markers:a});return i.sort((r,a)=>r.name.localeCompare(a.name)),i}syncLinkMarkersFromAggregate(e){let t=new Map;for(let[r,a]of Object.entries(e)){let c=a.link_id;if(!c)continue;let p=r.indexOf("/"),u=p>=0?r.slice(p+1):r,h=t.get(c);h||(h={},t.set(c,h));let i=a,{link_id:g,node_id:y}=i,b=rC(i,["link_id","node_id"]);h[u]=b}for(let[r,a]of t){let c=this.linksDataSource.get(r);c&&(c.markers=a);let p=this.mapLinksDataSource.get(r);p&&(p.markers=a)}}linkName(e){let i=this.linksDataSource.get(e)?.nodes;if(!i||i.length<2)return e.slice(0,8);let r=this.nodesDataSource.get(i[0].node_id),a=this.nodesDataSource.get(i[1].node_id);if(!r||!a)return e.slice(0,8);let c=i[0].label?.text??"",p=i[1].label?.text??"";return`${r.name} ${c} \u2192 ${a.name} ${p}`.replace(/\s+/g," ").trim()}linkEndpoints(e){let i=this.linksDataSource.get(e)?.nodes;return!i||i.length===0?[]:i.map(r=>{let a=this.nodesDataSource.get(r.node_id);return{id:r.node_id,name:a?.name??r.node_id}})}nodeName(e){return this.nodesDataSource.get(e)?.name??e}linkTypeOf(e){return this.linksDataSource.get(e)?.link_type??"ethernet"}submitDefinition(){if(this.definitionForm.invalid){this.definitionForm.markAllAsTouched();return}let e=this.controller(),t=this.project();if(!e||!t)return;this.defError.set(null),this.submittingDefinition.set(!0);let i=this.definitionForm.getRawValue(),r={name:i.name.trim(),bpf:i.bpf.trim()},a=this.asNumber(i.tag);a!==null&&(r.tag=a),i.color&&(r.color=i.color);let c=this.asNumber(i.highlight_duration);c!==null&&(r.highlight_duration=c);let p=this.dirToBody(i.direction);p&&(r.direction=p),i.data_link_type&&(r.data_link_type=i.data_link_type);let u=this.editingDefinition(),h=u?this.definitions().find(M=>M.name===u)?.data_link_type??null:null,g=!!u&&h!==(i.data_link_type??null),y=()=>{this.submittingDefinition.set(!1),this.cancelEditDefinition(),this.loadDefinitions(),this.loadAggregate()},b=M=>{this.submittingDefinition.set(!1),this.defError.set(M.error?.message||M.message||"Failed to save definition"),this.cdr.markForCheck()},x=()=>{this.markerService.updateDefinition(e,t.project_id,u,r).pipe(Ge(this.destroy$)).subscribe({next:()=>y(),error:b})};u?g?this.dialog.open(Ga,{data:{title:"Confirm encapsulation change",message:"Changing the encapsulation rebuilds this definition\u2019s markers and restarts capture on every link it applies to. uBridge itself is unaffected. Continue?",confirmButtonText:"Save",cancelButtonText:"Cancel"},panelClass:["base-confirmation-dialog-panel","confirmation-warning-panel"],autoFocus:!1,restoreFocus:!1}).afterClosed().subscribe(w=>{w?x():(this.submittingDefinition.set(!1),this.cdr.markForCheck())}):x():this.markerService.createDefinition(e,t.project_id,r).pipe(Ge(this.destroy$)).subscribe({next:()=>y(),error:b})}startEditDefinition(e){this.editingDefinition.set(e.name),this.defError.set(null),this.definitionForm.reset({name:e.name,bpf:e.bpf,tag:e.tag,color:e.color,highlight_duration:e.highlight_duration,direction:this.dirFromMarker(e.direction),data_link_type:e.data_link_type??null}),this.definitionForm.get("name")?.disable(),this.cdr.markForCheck()}cancelEditDefinition(){this.editingDefinition.set(null),this.definitionForm.reset(),this.definitionForm.get("name")?.enable(),this.defError.set(null),this.cdr.markForCheck()}deleteDefinition(e){let t=this.controller(),i=this.project();!t||!i||this.deletingDefinition()!==e.name&&(this.defError.set(null),this.deletingDefinition.set(e.name),this.markerService.deleteDefinition(t,i.project_id,e.name).pipe(Ge(this.destroy$)).subscribe({next:()=>{this.deletingDefinition.set(null),this.editingDefinition()===e.name&&this.cancelEditDefinition(),this.loadDefinitions(),this.loadAggregate()},error:r=>{this.deletingDefinition.set(null),this.defError.set(r.error?.message||r.message||"Failed to delete definition"),this.cdr.markForCheck()}}))}onNodeSelect(e){if(this.selectedNodeId.set(e),this.selectedLinkId.set(null),this.addingToLink.set(null),this.editingMarker.set(null),this.linkSearchText.set(""),this.markerForm.reset(),this.linkError.set(null),e){let t=this.nodeOptions().find(i=>i.id===e);t&&this.nodeSearchText.set(t.name)}else this.nodeSearchText.set("");this.cdr.markForCheck()}onLinkSelect(e){this.selectedLinkId.set(e),this.addingToLink.set(null),this.editingMarker.set(null),this.markerForm.reset(),this.linkError.set(null),this.linkSearchText.set(e?this.linkName(e):""),this.cdr.markForCheck()}displayNode=e=>e?this.nodeOptions().find(t=>t.id===e)?.name??e:"";displayLink=e=>e?this.linkName(e):"";resetLinkSelect(){this.selectedNodeId.set(null),this.nodeSearchText.set(""),this.selectedLinkId.set(null),this.addingToLink.set(null),this.editingMarker.set(null),this.linkSearchText.set(""),this.linkError.set(null),this.cdr.markForCheck()}isGroupCollapsed(e){return this.collapsedGroups().has(e)}isTogglingMarker(e,t){return this.togglingMarker()===`${e}/${t}`}isDeletingMarker(e,t){return this.deletingMarker()===`${e}/${t}`}panelError(){let e=this.linkError();return e&&!e.linkId?e.message:null}groupError(e){let t=this.linkError();return t&&t.linkId===e?t.message:null}toggleGroup(e){let t=new Set(this.collapsedGroups());t.has(e)?t.delete(e):t.add(e),this.collapsedGroups.set(t)}expandGroup(e){if(this.collapsedGroups().has(e)){let t=new Set(this.collapsedGroups());t.delete(e),this.collapsedGroups.set(t)}}toggleAddMarker(e){let t=this.addingToLink()!==e;this.addingToLink.set(t?e:null),this.editingMarker.set(null),t&&this.expandGroup(e),this.markerForm.reset(),t&&this.linkTypeOf(e)==="serial"&&this.markerForm.get("data_link_type")?.setValue(this.serialDataLinkTypes[0]?.value??null),this.linkError.set(null),this.cdr.markForCheck()}submitMarker(e){if(this.markerForm.invalid){this.markerForm.markAllAsTouched();return}let t=this.controller(),i=this.project();if(!t||!i)return;this.linkError.set(null),this.submittingMarker.set(e);let r=this.markerForm.getRawValue(),a={bpf:r.bpf.trim(),name:r.name.trim()},c=this.asNumber(r.tag);c!==null&&(a.tag=c),r.color&&(a.color=r.color);let p=this.asNumber(r.highlight_duration);p!==null&&(a.highlight_duration=p);let u=this.dirToBody(r.direction);u&&(a.direction=u),r.capture_node_id&&(a.capture_node_id=r.capture_node_id),r.data_link_type&&(a.data_link_type=r.data_link_type),this.markerService.create(t,i.project_id,e,a).pipe(Ge(this.destroy$)).subscribe({next:()=>{this.submittingMarker.set(null),this.toggleAddMarker(e),this.refreshLink(e),this.loadAggregate()},error:h=>{this.submittingMarker.set(null),this.linkError.set({linkId:e,message:h.error?.message||h.message||"Failed to create marker"}),this.cdr.markForCheck()}})}deleteMarker(e,t){let i=this.controller(),r=this.project();if(!i||!r)return;let a=`${e}/${t}`;this.deletingMarker()!==a&&(this.linkError.set(null),this.deletingMarker.set(a),this.markerService.delete(i,r.project_id,e,t).pipe(Ge(this.destroy$)).subscribe({next:()=>{this.deletingMarker.set(null),this.refreshLink(e),this.loadAggregate()},error:c=>{this.deletingMarker.set(null),this.linkError.set({linkId:e,message:c.error?.message||c.message||"Failed to delete marker"}),this.cdr.markForCheck()}}))}startEditMarker(e,t){this.editingMarker.set({linkId:e,name:t.name}),this.addingToLink.set(null),this.expandGroup(e),this.linkError.set(null),this.markerEditForm.reset({name:t.name,bpf:t.bpf,tag:t.tag??null,color:t.color??null,highlight_duration:t.highlight_duration??800,direction:this.dirFromMarker(t.direction),data_link_type:t.data_link_type??"DLT_EN10MB",capture_node_id:t.capture_node_id??null}),this.markerEditForm.get("name")?.disable(),this.markerEditForm.get("data_link_type")?.disable(),this.markerEditForm.get("capture_node_id")?.disable(),this.cdr.markForCheck()}cancelEditMarker(){this.editingMarker.set(null),this.cdr.markForCheck()}submitEditMarker(e){if(this.markerEditForm.invalid){this.markerEditForm.markAllAsTouched();return}let t=this.editingMarker();if(!t)return;let i=this.controller(),r=this.project();if(!i||!r)return;this.linkError.set(null),this.submittingEditMarker.set(!0);let a=this.markerEditForm.getRawValue(),c={bpf:a.bpf.trim()},p=this.asNumber(a.tag);p!==null&&(c.tag=p),a.color&&(c.color=a.color);let u=this.asNumber(a.highlight_duration);u!==null&&(c.highlight_duration=u);let h=this.dirToBody(a.direction);h&&(c.direction=h),this.markerService.update(i,r.project_id,e,t.name,c).pipe(Ge(this.destroy$)).subscribe({next:()=>{this.submittingEditMarker.set(!1),this.editingMarker.set(null),this.refreshLink(e),this.loadAggregate()},error:g=>{this.submittingEditMarker.set(!1),this.linkError.set({linkId:e,message:g.error?.message||g.message||"Failed to update marker"}),this.cdr.markForCheck()}})}toggleDefinitionPaused(e){if(this.togglingDefinition()===e.name)return;let t=this.controller(),i=this.project();if(!t||!i)return;let r=!e.paused;this.togglingDefinition.set(e.name),(r?this.markerService.pauseDefinition(t,i.project_id,e.name):this.markerService.resumeDefinition(t,i.project_id,e.name)).pipe(Ge(this.destroy$)).subscribe({next:()=>{this.togglingDefinition.set(null),this.applyDefinitionPausedLocal(e.name,r),this.loadAggregate()},error:c=>{this.togglingDefinition.set(null),this.defError.set(c.error?.message||c.message||"Failed to toggle definition"),this.cdr.markForCheck()}})}applyDefinitionPausedLocal(e,t){let i=this.definitions().map(r=>r.name===e?Ye(Z({},r),{paused:t}):r);this.definitions.set(i)}toggleMarkerEnabled(e,t){if(t.inherited_from)return;let i=this.controller(),r=this.project();if(!i||!r||this.isTogglingMarker(e,t.name))return;let a=t.enabled===!1;this.togglingMarker.set(`${e}/${t.name}`),this.markerService.setEnabled(i,r.project_id,e,t.name,a).pipe(Ge(this.destroy$)).subscribe({next:()=>{this.togglingMarker.set(null),this.applyEnabledLocal(e,t.name,a),this.refreshLink(e),this.loadAggregate()},error:c=>{this.togglingMarker.set(null),this.toasterService.error(c.error?.message||c.message||"Failed to toggle marker"),this.cdr.markForCheck()}})}applyEnabledLocal(e,t,i){let r=this.linkGroups().map(a=>a.linkId!==e?a:Ye(Z({},a),{markers:a.markers.map(c=>c.name===t?Ye(Z({},c),{enabled:i}):c)}));this.linkGroups.set(r)}refreshLink(e){let t=this.controller(),i=this.project();!t||!i||this.linkService.getLink(t,i.project_id,e).pipe(Ge(this.destroy$)).subscribe({next:r=>{this.linksDataSource.update(r);let a=this.mapLinksDataSource.get(e);a&&(a.markers=r.markers,this.mapLinksDataSource.update(a)),this.markerRegistryService.reconcileLink(r)},error:r=>this.toasterService.error(r.error?.message||r.message||"Failed to refresh link")})}asNumber(e){if(e==null||e==="")return null;let t=Number(e);return isNaN(t)?null:t}dirToBody(e){return e==="tx"||e==="rx"?e:"both"}dirFromMarker(e){return e==="tx"||e==="rx"?e:"both"}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(".marker-manager__header");if(!t)return;let i=No(t,"mousedown"),r=No(document,"mousemove"),a=No(document,"mouseup");i.pipe(Ge(this.destroy$),yi(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")}),Vn(()=>r.pipe(Qs(0,qs),Ge(a.pipe(yi(()=>{this.onDragEnd()})))))).subscribe(c=>{let p=c.clientX-this.dragStartX,u=c.clientY-this.dragStartY,h=this.dragStartLeft+p,g=this.dragStartTop+u,y=this.resizedWidth,b=this.resizedHeight,x=window.innerWidth-y,M=this.boundaryService.getConfigValue().topOffset||0,w=window.innerHeight-b-M;h=Math.max(0,Math.min(x,h)),g=Math.max(M,Math.min(w,g)),this.style={position:"fixed",left:`${h}px`,top:`${g}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 i=t.querySelector(".marker-manager__body");i&&(i.style.pointerEvents=e)}onWindowResize(){this.style=this.boundaryService.constrainWindowPosition(this.style)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-marker-manager"]],viewQuery:function(t,i){t&1&&Xt(i.windowWrapper,mEe,5),t&2&&Kt()},hostBindings:function(t,i){t&1&&_("resize",function(){return i.onWindowResize()},Zo)},inputs:{controller:[1,"controller"],project:[1,"project"],zIndex:[1,"zIndex"]},outputs:{closeWindow:"closeWindow",windowFocused:"windowFocused"},decls:27,vars:15,consts:[["windowWrapper",""],["onOffIcon",""],["markerSlot",""],["nodeAuto","matAutocomplete"],["linkAuto","matAutocomplete"],["mwlResizable","",1,"marker-manager",3,"mousedown","resizeStart","resizeEnd","ngStyle","validateResize","enableGhostResize"],[1,"marker-manager__content"],[1,"marker-manager__header"],[1,"marker-manager__header-title"],[1,"header-icon"],[1,"marker-manager__header-actions"],["mat-icon-button","","title","Minimize",1,"minimize-button",3,"click"],["mat-icon-button","","title","Close",1,"close-button",3,"click"],[1,"marker-manager__body"],[3,"selectedIndexChange","selectedIndex"],["label","Definitions"],[1,"marker-manager__panel"],["label","Links"],["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"],[3,"ngSubmit","formGroup"],[1,"marker-manager__form-title"],[2,"display","grid","grid-template-columns","1fr","gap","16px","align-items","start"],[1,"form-field"],["matInput","","formControlName","bpf","placeholder","arp or icmp","rows","1","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","4"],[2,"display","grid","grid-template-columns","3.0fr 0.9fr 0.8fr 0.5fr auto auto","gap","16px","align-items","start"],["matTextPrefix","",1,"global-prefix"],["matInput","","formControlName","name","placeholder","auto"],["formControlName","data_link_type","placeholder","Ethernet only"],[3,"value"],["matInput","","type","number","formControlName","highlight_duration","placeholder","500"],["matInput","","type","color","formControlName","color",1,"color-input"],["mat-flat-button","","color","primary","type","submit",2,"align-self","start","margin-top","18px",3,"disabled"],["mat-stroked-button","","type","button",2,"align-self","start","margin-top","18px"],[1,"marker-manager__error"],[1,"marker-manager__list"],[1,"marker-manager__empty"],[1,"marker-manager__row",3,"marker-manager__row--editing","marker-manager__row--paused"],[1,"marker-manager__btn-spinner",3,"diameter"],["mat-stroked-button","","type","button",2,"align-self","start","margin-top","18px",3,"click"],[1,"marker-manager__row"],[1,"marker-manager__swatch",3,"title"],[1,"marker-manager__row-name"],[1,"marker-manager__row-bpf"],[1,"marker-manager__chip"],["title","Direction filter",1,"marker-manager__chip","marker-manager__chip--dir"],["title","Links carrying this definition",1,"marker-manager__chip","marker-manager__chip--links"],[1,"marker-manager__row-spacer"],["mat-icon-button","",3,"click","matTooltip"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["mat-icon-button","","matTooltip","Edit",3,"click"],["mat-icon-button","","matTooltip","Delete (clears all copies)",3,"click"],[1,"marker-manager__toggle-spinner",3,"diameter"],[2,"display","grid","grid-template-columns","1fr 1fr","gap","16px","align-items","start"],["matInput","","placeholder","Filter by node\u2026",3,"input","value","matAutocomplete"],[3,"optionSelected","displayWith"],["matInput","",3,"input","value","matAutocomplete","placeholder"],[1,"marker-manager__group"],[1,"marker-manager__group-header"],[1,"marker-manager__group-name",3,"title"],[1,"marker-manager__group-count"],["mat-stroked-button","",1,"add-button",3,"click"],["mat-icon-button","","matTooltip","Back to all links",3,"click"],[1,"marker-manager__hint"],["mode","create",3,"form","captureOptions","dataLinkOptions","linkType","submitting"],["mode","create",3,"save","cancel","form","captureOptions","dataLinkOptions","linkType","submitting"],[1,"marker-manager__group-header",3,"click"],[1,"marker-manager__group-chevron"],[1,"marker-manager__row",3,"marker-manager__row--disabled"],["mode","edit",3,"form","captureOptions","dataLinkOptions","linkType","submitting"],["mode","edit",3,"save","cancel","form","captureOptions","dataLinkOptions","linkType","submitting"],[1,"marker-manager__swatch"],["title","Capture node (observer)",1,"marker-manager__chip"],["matTooltip","Inherited \u2014 edit via Definitions",1,"marker-manager__chip","marker-manager__chip--inherited"],["mat-icon-button","","disabled","","matTooltip","Inherited \u2014 edit via Definitions"],["mat-icon-button","","matTooltip","Delete",3,"click"]],template:function(t,i){t&1&&(s(0,"div",5,0),_("mousedown",function(){return i.onWindowFocus()})("resizeStart",function(){return i.onResizeStart()})("resizeEnd",function(a){return i.onResizeEnd(a)}),I(2,yEe,8,16),s(3,"div",6)(4,"div",7)(5,"div",8)(6,"mat-icon",9),d(7,"insights"),l(),s(8,"span"),d(9,"Marker Manager"),l()(),s(10,"div",10)(11,"button",11),_("click",function(){return i.toggleMinimize()}),s(12,"mat-icon"),d(13,"remove"),l()(),s(14,"button",12),_("click",function(){return i.close()}),s(15,"mat-icon"),d(16,"close"),l()()()(),s(17,"div",13)(18,"mat-tab-group",14),_("selectedIndexChange",function(a){return i.activeTabIndex.set(a)}),s(19,"mat-tab",15),I(20,zEe,46,13,"div",16),l(),s(21,"mat-tab",17),I(22,oDe,25,12,"div",16),l()()()()(),Ce(23,sDe,2,1,"ng-template",null,1,Kd)(25,vDe,2,1,"ng-template",null,2,Kd)),t&2&&(Yt("z-index",i.zIndex()),Ae("is-dragging",i.isDragging())("is-resizing",i.isResizing())("is-minimized",i.isMinimized()),C("ngStyle",i.style)("validateResize",i.validate)("enableGhostResize",!1),m(2),A(i.isMinimized()?-1:2),m(16),C("selectedIndex",i.activeTabIndex()),m(2),A(i.activeTabIndex()===0?20:-1),m(2),A(i.activeTabIndex()===1?22:-1))},dependencies:[ne,Hg,Xs,Et,rt,Nt,Uo,Dt,ot,Ft,Vt,oe,de,G,pe,ze,ho,Wo,Go,we,Me,Xe,ni,ts,Se,Te,Bc,lr,Dr,ft,So,gt,Pt,ht,Mt,yr,qr,dn,qn,Us,Ll,Oj],styles:[".marker-manager[_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}.marker-manager[_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)}.marker-manager.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}.marker-manager.is-minimized[_ngcontent-%COMP%]{display:none}.marker-manager__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;height:100%;overflow:hidden;border-radius:6px}.marker-manager__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}.marker-manager__header-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;font-size:12px;font-weight:500;color:var(--mat-sys-on-surface)}.marker-manager__header-title[_ngcontent-%COMP%] .header-icon[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-primary);width:14px;height:14px}.marker-manager__header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px}.marker-manager__header-actions[_ngcontent-%COMP%] .minimize-button[_ngcontent-%COMP%], .marker-manager__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}.marker-manager__header-actions[_ngcontent-%COMP%] .minimize-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], .marker-manager__header-actions[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;vertical-align:middle}.marker-manager__header-actions[_ngcontent-%COMP%] .minimize-button[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-primary-container);color:var(--mat-sys-primary)}.marker-manager__header-actions[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-error-container);color:var(--mat-sys-error)}.marker-manager__body[_ngcontent-%COMP%]{flex:1;overflow:auto;min-height:0}.marker-manager__panel[_ngcontent-%COMP%]{padding:12px 16px 16px}.marker-manager__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px}.marker-manager__form--inline[_ngcontent-%COMP%]{margin:8px 0 4px;padding:8px;background:var(--mat-sys-surface-container);border-radius:6px}.marker-manager__form-title[_ngcontent-%COMP%]{font-size:12px;font-weight:600;color:var(--mat-sys-on-surface-variant);margin-bottom:4px}.marker-manager__form-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start}.marker-manager__form-actions[_ngcontent-%COMP%]{display:flex;gap:8px;margin-top:4px}.marker-manager__error[_ngcontent-%COMP%]{margin:8px 0;padding:6px 10px;background:var(--mat-sys-error-container);color:var(--mat-sys-on-error-container);border-radius:4px;font-size:12px}.marker-manager__hint[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;margin-bottom:6px;padding:4px 8px;background:var(--mat-sys-tertiary-container);color:var(--mat-sys-on-tertiary-container);border-radius:4px;font-size:11px}.marker-manager__hint[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px}.marker-manager__empty[_ngcontent-%COMP%]{padding:16px 4px;color:var(--mat-sys-on-surface-variant);font-size:12px}.marker-manager__list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px;margin-top:8px}.marker-manager__group[_ngcontent-%COMP%]{border:1px solid var(--mat-sys-outline-variant);border-radius:6px;padding:6px 8px;background:color-mix(in srgb,var(--mat-sys-surface-container) 50%,transparent)}.marker-manager__group-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:4px;cursor:pointer}.marker-manager__group-chevron[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--mat-sys-on-surface-variant);flex-shrink:0}.marker-manager__group-name[_ngcontent-%COMP%]{font-size:12px;font-weight:600;color:var(--mat-sys-on-surface);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.marker-manager__group-count[_ngcontent-%COMP%]{font-size:11px;color:var(--mat-sys-on-surface-variant);background:var(--mat-sys-surface-container-highest);border-radius:10px;padding:1px 7px}.marker-manager__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:4px;border-radius:4px}.marker-manager__row[_ngcontent-%COMP%]:hover{background:var(--mat-sys-surface-container)}.marker-manager__row--editing[_ngcontent-%COMP%]{background:var(--mat-sys-secondary-container)}.marker-manager__row--disabled[_ngcontent-%COMP%], .marker-manager__row--paused[_ngcontent-%COMP%]{opacity:.5}.marker-manager__row-name[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:var(--mat-sys-on-surface);min-width:64px}.marker-manager__row-bpf[_ngcontent-%COMP%]{font-size:11px;color:var(--mat-sys-on-surface-variant);font-family:var(--mat-sys-label-large-font, monospace);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px}.marker-manager__row-spacer[_ngcontent-%COMP%]{flex:1}.marker-manager__swatch[_ngcontent-%COMP%]{width:14px;height:14px;border-radius:3px;flex-shrink:0;border:1px solid var(--mat-sys-outline-variant)}.marker-manager__swatch--default[_ngcontent-%COMP%]{background:var(--mat-sys-primary)}.marker-manager__chip[_ngcontent-%COMP%]{font-size:10px;color:var(--mat-sys-on-surface-variant);background:var(--mat-sys-surface-container-highest);border-radius:8px;padding:1px 6px;white-space:nowrap}.marker-manager__chip--links[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.marker-manager__chip--dir[_ngcontent-%COMP%]{color:var(--mat-sys-on-tertiary-container);background:var(--mat-sys-tertiary-container);text-transform:uppercase}.marker-manager__chip--inherited[_ngcontent-%COMP%]{color:var(--mat-sys-on-secondary-container);background:var(--mat-sys-secondary-container)}.marker-manager[_ngcontent-%COMP%] .form-field[_ngcontent-%COMP%]{width:100%;margin-bottom:4px}.marker-manager[_ngcontent-%COMP%] .global-prefix[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant)}.marker-manager[_ngcontent-%COMP%] .color-input[_ngcontent-%COMP%]{cursor:pointer;block-size:20px;inline-size:100%;box-sizing:border-box}.marker-manager[_ngcontent-%COMP%] .add-button[_ngcontent-%COMP%]{height:28px;font-size:11px;line-height:1}.marker-manager[_ngcontent-%COMP%] .add-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px}.marker-manager[_ngcontent-%COMP%] .add-button--active[_ngcontent-%COMP%]{background:var(--mat-sys-primary-container);color:var(--mat-sys-primary)}.marker-manager[_ngcontent-%COMP%] .marker-manager__row[_ngcontent-%COMP%] button.mat-mdc-icon-button[_ngcontent-%COMP%]{width:28px;height:28px;padding:0;display:inline-flex;align-items:center;justify-content:center}.marker-manager[_ngcontent-%COMP%] .marker-manager__row[_ngcontent-%COMP%] button.mat-mdc-icon-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;vertical-align:middle}.marker-manager__toggle-spinner[_ngcontent-%COMP%]{--mdc-circular-progress-active-indicator-color: var(--mat-sys-primary)}.marker-manager__btn-spinner[_ngcontent-%COMP%]{--mdc-circular-progress-active-indicator-color: var(--mat-sys-on-primary)}.resize-handle[_ngcontent-%COMP%]{position:absolute;z-index:100;opacity:0;transition:opacity .15s ease}.marker-manager[_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 Vj=(()=>{class n{controller=ae(void 0);textEdited;drawingService=f(ji);drawingsDataSource=f(zi);drawingsEventSource=f(Ko);mapDrawingToSvgConverter=f(Ss);toasterService=f(ie);cdr=f(X);ngOnInit(){this.textEdited=this.drawingsEventSource.textEdited.subscribe(e=>this.onTextEdited(e))}onTextEdited(e){let t=new Ia;t.element=e.textElement,t.element.text=e.editedText;let i=this.mapDrawingToSvgConverter.convert(t),r=this.drawingsDataSource.get(e.textDrawingId);this.drawingService.updateText(this.controller(),r,i).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,i){},encapsulation:2,changeDetection:0})}return n})();var CDe=["topologySummaryContainer"],xDe=()=>["/controllers"],bDe=n=>["/controller",n,"projects"],yDe=n=>["/controller",n,"image-manager"],SDe=n=>({visible:n}),wDe=n=>({selected:n}),jj=(n,o)=>o.link_id,uM=(n,o)=>o.node_id,Bj=(n,o)=>e=>e.id==="console",MDe=(n,o)=>e=>{let t=k(o).$implicit;return T(e.id==="wireshark-"+t.link_id)},kDe=(n,o)=>e=>{let t=k(o).$implicit;return T(e.id==="console-"+t.node_id)},zj=(n,o)=>e=>e.id==="marker-manager";function TDe(n,o){if(n&1){let e=z();s(0,"div",10)(1,"app-template",40),_("nodeCreationChange",function(i){k(e);let r=v();return T(r.onNodeCreation(i))}),l(),s(2,"button",41),_("click",function(){k(e);let i=v();return T(i.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",un(4,wDe,e.tools.draw_link))("color",e.tools.draw_link?"primary":"basic")}}function EDe(n,o){if(n&1&&R(0,"app-d3-map",21),n&2){let e=v();C("controller",e.controller)("project",e.project)("symbols",e.symbols)("nodes",e.nodes())("links",e.links())("drawings",e.drawings())("width",e.project.scene_width||2e3)("height",e.project.scene_height||1e3)("show-interface-labels",e.isInterfaceLabelVisible)("readonly",e.inReadOnlyMode)}}function DDe(n,o){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 PDe(n,o){if(n&1){let e=z();s(0,"app-marker-manager",42),_("closeWindow",function(){k(e);let i=v();return T(i.closeMarkerManager())})("windowFocused",function(){k(e);let i=v();return T(i.bringMarkerManagerToFront())}),l()}if(n&2){let e=v();C("controller",e.controller)("project",e.project)("zIndex",e.markerManagerZIndex)}}function IDe(n,o){if(n&1&&R(0,"app-draw-link-tool",33),n&2){let e=v();C("links",e.links())}}function ADe(n,o){if(n&1){let e=z();s(0,"app-console-wrapper",43),_("closeConsole",function(i){k(e);let r=v();return T(r.toggleShowConsole(i))})("windowFocused",function(){k(e);let i=v();return T(i.bringConsoleToFront())}),l()}if(n&2){let e=v();C("controller",e.controller)("project",e.project)("zIndex",e.consoleZIndex)}}function ODe(n,o){if(n&1){let e=z();s(0,"app-ai-chat",44),_("closed",function(){k(e);let i=v();return T(i.closeAIChat())})("windowFocused",function(){k(e);let i=v();return T(i.bringAIChatToFront())}),l()}if(n&2){let e=v();C("project",e.project)("controller",e.controller)("zIndex",e.aiChatZIndex)}}function NDe(n,o){if(n&1){let e=z();s(0,"app-web-wireshark-inline",46),_("closeWindow",function(){let i=k(e).$implicit,r=v(2);return T(r.closeWebWiresharkInline(i.link_id))})("windowFocused",function(){let i=k(e).$implicit,r=v(2);return T(r.bringWebWiresharkWindowToFront(i.link_id))}),l()}if(n&2){let e=o.$implicit,t=v(2);C("link",e)("controller",t.controller)("project",t.project)("zIndex",t.getWebWiresharkWindowZIndex(e.link_id))}}function FDe(n,o){if(n&1&&K(0,NDe,1,4,"app-web-wireshark-inline",45,jj),n&2){let e=v();Y(e.getWebWiresharkInlineWindows())}}function RDe(n,o){if(n&1){let e=z();s(0,"app-web-console-inline",48),_("closeWindow",function(){let i=k(e).$implicit,r=v(2);return T(r.closeWebConsoleInline(i.node_id))})("windowFocused",function(){let i=k(e).$implicit,r=v(2);return T(r.bringWebConsoleWindowToFront(i.node_id))}),l()}if(n&2){let e=o.$implicit,t=v(2);C("node",e)("controller",t.controller)("project",t.project)("zIndex",t.getWebConsoleWindowZIndex(e.node_id))}}function LDe(n,o){if(n&1&&K(0,RDe,1,4,"app-web-console-inline",47,uM),n&2){let e=v();Y(e.getWebConsoleInlineWindows())}}function VDe(n,o){if(n&1){let e=z();s(0,"app-node-file-manager-inline",50),_("closeWindow",function(){let i=k(e).$implicit,r=v(2);return T(r.closeFileManagerInline(i.node_id))})("windowFocused",function(){let i=k(e).$implicit,r=v(2);return T(r.bringFileManagerToFront(i.node_id))}),l()}if(n&2){let e=o.$implicit,t=v(2);C("node",e)("controller",t.controller)("zIndex",t.getFileManagerZIndex(e.node_id))}}function BDe(n,o){if(n&1&&K(0,VDe,1,3,"app-node-file-manager-inline",49,uM),n&2){let e=v();Y(e.getFileManagerInlineWindows())}}function zDe(n,o){if(n&1){let e=z();s(0,"div",51),_("click",function(){k(e);let i=v();return T(i.toggleConsoleMinimize())}),s(1,"mat-icon",52),d(2,"terminal"),l(),s(3,"span",53),d(4,"Console"),l()()}if(n&2){let e=v();Yt("left",e.getConsoleTaskbarLeft(),"px"),Ae("inline-taskbar__icon--minimized",e.windowManagement.minimizedWindows().some(Mp(5,Bj,o))),C("title",e.windowManagement.minimizedWindows().some(Mp(6,Bj,o))?"Console - Click to restore":"Console - Click to minimize")}}function jDe(n,o){if(n&1){let e=z();s(0,"div",51),_("click",function(){let i=k(e).$implicit,r=v();return T(r.toggleWiresharkMinimize(i.link_id))}),s(1,"mat-icon",52),d(2,"analytics"),l(),s(3,"span",53),d(4),l()()}if(n&2){let e=o.$implicit,t=v();Yt("left",t.getWiresharkTaskbarLeft(e.link_id),"px"),Ae("inline-taskbar__icon--minimized",t.windowManagement.minimizedWindows().some(Mp(6,MDe,o))),C("title",e.capture_file_name),m(4),B(e.capture_file_name)}}function $De(n,o){if(n&1){let e=z();s(0,"div",51),_("click",function(){let i=k(e).$implicit,r=v();return T(r.toggleWebConsoleMinimize(i.node_id))}),s(1,"mat-icon",52),d(2,"web"),l(),s(3,"span",53),d(4),l()()}if(n&2){let e=o.$implicit,t=v();Yt("left",t.getWebConsoleTaskbarLeft(e.node_id),"px"),Ae("inline-taskbar__icon--minimized",t.windowManagement.minimizedWindows().some(Mp(6,kDe,o))),C("title",e.name),m(4),B(e.name)}}function HDe(n,o){if(n&1){let e=z();s(0,"div",51),_("click",function(){let i=k(e).$implicit,r=v();return T(r.toggleFileManagerMinimize(i.node_id))}),s(1,"mat-icon",52),d(2,"folder"),l(),s(3,"span",53),d(4),l()()}if(n&2){let e=o.$implicit,t=v();Yt("left",t.getFileManagerTaskbarLeft(e.node_id),"px"),Ae("inline-taskbar__icon--minimized",t.isFileManagerMinimized(e.node_id)),C("title","File Manager - "+e.name),m(4),B(e.name)}}function UDe(n,o){if(n&1){let e=z();s(0,"div",51),_("click",function(){k(e);let i=v();return T(i.toggleMarkerManagerMinimize())}),s(1,"mat-icon",52),d(2,"insights"),l(),s(3,"span",53),d(4,"Markers"),l()()}if(n&2){let e=v();Yt("left",e.getMarkerManagerTaskbarLeft(),"px"),Ae("inline-taskbar__icon--minimized",e.windowManagement.minimizedWindows().some(Mp(5,zj,o))),C("title",e.windowManagement.minimizedWindows().some(Mp(6,zj,o))?"Marker Manager - Click to restore":"Marker Manager - Click to minimize")}}function WDe(n,o){}var hM=(()=>{class n{nodes=Q([]);links=Q([]);drawings=Q([]);symbols=[];project={};controller={};projectws;ws;projectWsIntentionalClose=!1;reconnectTimer=null;reconnectAttempt=0;markerWs;markerWsIntentionalClose=!1;markerReconnectTimer=null;markerReconnectAttempt=0;MARKER_WS_LIVENESS_TIMEOUT_MS=15e3;MARKER_WS_LIVENESS_CHECK_MS=5e3;markerLastWsMessageAt=0;markerLivenessTimer=null;WS_LIVENESS_TIMEOUT_MS=15e3;WS_LIVENESS_CHECK_MS=5e3;lastWsMessageAt=0;livenessTimer=null;isProjectMapMenuVisible=!1;isConsoleVisible=!0;isTopologySummaryVisible=!0;isInterfaceLabelVisible=!1;notificationsVisibility=!1;layersVisibility=!1;itemLockStatusVisibility=!1;gridVisibility=!1;toolbarVisibility=!0;symbolScaling=!0;isAIChatVisible=!1;isMarkerManagerVisible=!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;markerManagerZIndex=this.baseZIndex;TASKBAR_BASE_LEFT=20;TASKBAR_ICON_WIDTH=180;TASKBAR_ICON_GAP=8;mapBgClass=$t(()=>{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=Rt(ug);mapChild=Rt(QS);projectMapMenuComponent=Rt.required(Cg);topologySummaryContainer=Rt.required("topologySummaryContainer",{read:ro});templateComponent=Rt(kg);projectMapSubscription=new Mo;startedNodeIds=new Set;route=f(lt);controllerService=f(nt);projectService=f(Ei);nodeService=f(ut);linkService=f(Pi);drawingService=f(ji);progressService=f(io);projectWebServiceHandler=f(Jf);mapChangeDetectorRef=f(Ol);nodeWidget=f(Uf);drawingsWidget=f(od);linkWidget=f(Xf);labelWidget=f(lp);interfaceLabelWidget=f(td);mapNodeToNode=f(hp);mapDrawingToDrawing=f(KS);mapLabelToLabel=f(rd);mapLinkToLink=f(ew);mapLinkNodeToLinkNode=f(Kf);nodesDataSource=f(ui);linksDataSource=f(qo);drawingsDataSource=f(zi);settingsService=f(Qr);toolsService=f(Ml);selectionManager=f(Xo);selectionTool=f(ap);recentlyOpenedProjectService=f(Jd);movingEventSource=f(up);mapScaleService=f(pp);nodeCreatedLabelStylesFixer=f(D2);toasterService=f(ie);dialog=f(it);router=f(_t);mapNodesDataSource=f(mf);mapLinksDataSource=f(kl);markerRegistryService=f(ad);markerFlashService=f(Zf);mapDrawingsDataSource=f(pf);mapSymbolsDataSource=f(uf);mapSettingsService=f(_o);ethernetLinkWidget=f(qf);serialLinkWidget=f(Qf);bottomSheet=f(ec);notificationService=f(Js);title=f(Ku);nodeConsoleService=f(mr);symbolService=f(Cl);themeService=f(pi);cd=f(X);aiChatStore=f(vg);windowManagement=f(Rl);viewContainerRef=f(ro);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-JVPSP3B2.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.set(t)}));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 i=t.filter(c=>!c.symbol_url);if(i.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)}})}),i.length===0){this.nodes.set(t),this.mapSettingsService.getSymbolScaling()&&this.applyScalingOfNodeSymbols();return}let r=new Map;i.forEach(c=>{r.set(c,`/symbols/${c.symbol}/raw`)});let a=Array.from(new Set(r.values()));Yi(a.map(c=>this.symbolService.getSymbolBlobUrl(this.controller,c))).subscribe(c=>{let p=new Map(a.map((u,h)=>[u,c[h]]));i.forEach(u=>{u.symbol_url=p.get(r.get(u))}),this.nodes.set(t),this.mapSettingsService.getSymbolScaling()&&this.applyScalingOfNodeSymbols()},()=>{i.forEach(c=>{c.symbol_url=`${this.controller.protocol}//${this.controller.host}:${this.controller.port}/${ki.current_version}${r.get(c)}`}),this.nodes.set(t),this.mapSettingsService.getSymbolScaling()&&this.applyScalingOfNodeSymbols()})})),this.projectMapSubscription.add(this.linksDataSource.changes.subscribe(t=>{this.links.set(t)})),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 i=t.event,r=this.startedNodeIds.has(i.node_id);i.status==="started"?this.startedNodeIds.add(i.node_id):this.startedNodeIds.delete(i.node_id),!(r||i.status!=="started"||!i.console_auto_start||i.console_type==="none")&&(i.console_type==="vnc"?setTimeout(()=>this.onOpenWebConsoleInline({node:i,controller:this.controller,project:this.project}),500):(this.mapSettingsService.logConsoleSubject.next(!0),setTimeout(()=>this.nodeConsoleService.openConsoleForNode(i),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 i=parseInt(t.get("controller_id"),10),r=t.get("project_id");if(!r){this.router.navigate(["/controllers"]);return}Wu(this.controllerService.get(i)).pipe(dc(a=>(a||this.router.navigate(["/controllers"]),this.controller=a,this.cd.markForCheck(),this.projectService.get(a,r).pipe(Bt(c=>c)))),dc(a=>{if(this.project=a,this.cd.markForCheck(),!a||!a.project_id)return this.router.navigate(["/controllers"]),new Rr(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 Rr(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",i,"projects"],{queryParams:{error:c}}):this.toasterService.error(c),this.cd.markForCheck()},()=>{this.progressService.deactivate(),this.cd.markForCheck()})});this.projectMapSubscription.add(e)}addKeyboardListeners(){Wd.bind("ctrl++",e=>{e.preventDefault(),this.zoomIn()}),Wd.bind("ctrl+-",e=>{e.preventDefault(),this.zoomOut()}),Wd.bind("ctrl+0",e=>{e.preventDefault(),this.resetZoom()}),Wd.bind("ctrl+a",e=>{e.preventDefault();let t=this.mapNodesDataSource.getItems(),i=this.mapDrawingsDataSource.getItems(),r=this.mapLinksDataSource.getItems(),a=this.mapSymbolsDataSource.getItems();this.selectionManager.setSelected(t.concat(i).concat(r).concat(a))}),Wd.bind("ctrl+h",e=>{e.preventDefault(),this.toolbarVisibility=!this.toolbarVisibility}),Wd.bind("ctrl+shift+a",e=>{e.preventDefault(),this.selectionManager.setSelected([])}),Wd.bind("ctrl+shift+s",e=>{e.preventDefault(),this.router.navigate(["/controller",this.controller.id,"preferences"])}),Wd.bind("del",e=>{e.preventDefault(),this.deleteItems()})}deleteItems(){let t=this.bottomSheet.open(Ya,{data:{message:"Do you want to delete all selected objects?"},panelClass:"confirmation-bottom-sheet"}).afterDismissed().subscribe(i=>{if(i){let r=this.selectionManager.getSelected();r.filter(a=>a instanceof qa).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 ku).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 Ia).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.fetchTopologyData(e).subscribe({next:()=>{this.setUpMapCallbacks(),this.connectProjectWS(e),this.connectMarkerWS(e),this.progressService.deactivate()},error:i=>{this.toasterService.error("Failed to load project data: "+(i.error?.message||i.message||"Unknown error")),this.progressService.deactivate(),this.cd.markForCheck()}});this.projectMapSubscription.add(t)}fetchTopologyData(e){return this.projectService.nodes(this.controller,e.project_id).pipe(yi(t=>{this.nodesDataSource.set(t),t.filter(i=>i.status==="started").forEach(i=>this.startedNodeIds.add(i.node_id))}),dc(()=>this.projectService.links(this.controller,e.project_id)),yi(t=>{this.linksDataSource.set(t),this.markerRegistryService.rebuildAll(t)}),dc(()=>this.projectService.drawings(this.controller,e.project_id)),yi(t=>{this.drawingsDataSource.set(t)}))}connectProjectWS(e){this.projectws=new WebSocket(this.notificationService.projectNotificationsPath(this.controller,e.project_id)),this.projectws.onopen=()=>{this.reconnectAttempt>0&&this.projectMapSubscription.add(this.fetchTopologyData(e).subscribe({error:t=>{console.warn("Topology resync after WS reconnect failed",t)}})),this.reconnectAttempt=0,this.startLivenessCheck()},this.projectws.onmessage=t=>{this.lastWsMessageAt=Date.now(),this.projectWebServiceHandler.handleMessage(JSON.parse(t.data))},this.projectws.onclose=()=>{this.stopLivenessCheck(),!this.projectWsIntentionalClose&&this.scheduleReconnect(e)},this.projectws.onerror=()=>{console.warn("Project notifications WebSocket error; will reconnect")}}scheduleReconnect(e){if(this.projectWsIntentionalClose)return;let t=this.reconnectAttempt++,i=Math.min(3e4,1e3*2**t),r=Math.round(i+Math.random()*.25*i);this.reconnectTimer=setTimeout(()=>this.connectProjectWS(e),r)}startLivenessCheck(){this.stopLivenessCheck(),this.lastWsMessageAt=Date.now(),this.livenessTimer=setInterval(()=>{Date.now()-this.lastWsMessageAt>this.WS_LIVENESS_TIMEOUT_MS&&(console.warn("Project WS liveness timeout \u2014 no message received, forcing reconnect"),this.stopLivenessCheck(),this.projectws?.close())},this.WS_LIVENESS_CHECK_MS)}stopLivenessCheck(){this.livenessTimer!==null&&(clearInterval(this.livenessTimer),this.livenessTimer=null)}connectMarkerWS(e){this.markerWs=new WebSocket(this.notificationService.markerNotificationsPath(this.controller,e.project_id)),this.markerWs.onopen=()=>{this.markerReconnectAttempt=0,this.startMarkerLivenessCheck()},this.markerWs.onmessage=t=>{this.markerLastWsMessageAt=Date.now(),this.projectWebServiceHandler.handleMessage(JSON.parse(t.data))},this.markerWs.onclose=()=>{this.stopMarkerLivenessCheck(),!this.markerWsIntentionalClose&&this.scheduleMarkerReconnect(e)},this.markerWs.onerror=()=>{console.warn("Marker notifications WebSocket error; will reconnect")}}scheduleMarkerReconnect(e){if(this.markerWsIntentionalClose)return;let t=this.markerReconnectAttempt++,i=Math.min(3e4,1e3*2**t),r=Math.round(i+Math.random()*.25*i);this.markerReconnectTimer=setTimeout(()=>this.connectMarkerWS(e),r)}startMarkerLivenessCheck(){this.stopMarkerLivenessCheck(),this.markerLastWsMessageAt=Date.now(),this.markerLivenessTimer=setInterval(()=>{Date.now()-this.markerLastWsMessageAt>this.MARKER_WS_LIVENESS_TIMEOUT_MS&&(console.warn("Marker WS liveness timeout \u2014 no message received, forcing reconnect"),this.stopMarkerLivenessCheck(),this.markerWs?.close())},this.MARKER_WS_LIVENESS_CHECK_MS)}stopMarkerLivenessCheck(){this.markerLivenessTimer!==null&&(clearInterval(this.markerLivenessTimer),this.markerLivenessTimer=null)}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 g=this.mapLinkToLink.convert(h.link);this.contextMenu().openMenuForListOfElements([],[],[],[g],h.event.clientY,h.event.clientX)}),t=this.ethernetLinkWidget.onContextMenu.subscribe(h=>{let g=this.mapLinkToLink.convert(h.link);this.contextMenu().openMenuForListOfElements([],[],[],[g],h.event.clientY,h.event.clientX)}),i=this.serialLinkWidget.onContextMenu.subscribe(h=>{let g=this.mapLinkToLink.convert(h.link);this.contextMenu().openMenuForListOfElements([],[],[],[g],h.event.clientY,h.event.clientX)}),r=this.nodeWidget.onContextMenu.subscribe(h=>{let g=this.selectionManager.getSelected();if(this.selectionManager.isSelected(h.node)&&this.openMenuForSelection(g,h.event))return;this.selectionManager.setSelected([h.node]);let y=this.mapNodeToNode.convert(h.node);this.contextMenu().openMenuForNode(y,h.event.clientY,h.event.clientX)}),a=this.drawingsWidget.onContextMenu.subscribe(h=>{let g=this.mapDrawingToDrawing.convert(h.drawing);this.contextMenu().openMenuForDrawing(g,h.event.clientY,h.event.clientX)}),c=this.labelWidget.onContextMenu.subscribe(h=>{let g=this.selectionManager.getSelected();if((this.selectionManager.isSelected(h.label)||g.some(M=>M instanceof qa&&M.id===h.label.nodeId))&&this.openMenuForSelection(g,h.event))return;let b=this.mapLabelToLabel.convert(h.label),x=this.nodes().find(M=>M.node_id===h.label.nodeId);this.contextMenu().openMenuForLabel(b,x,h.event.clientY,h.event.clientX)}),p=this.interfaceLabelWidget.onContextMenu.subscribe(h=>{let g=this.mapLinkNodeToLinkNode.convert(h.interfaceLabel),y=this.links().find(b=>b.link_id===h.interfaceLabel.linkId);this.contextMenu().openMenuForInterfaceLabel(g,y,h.event.clientY,h.event.clientX)}),u=this.selectionTool.contextMenuOpened.subscribe(h=>{let g=this.selectionManager.getSelected();this.openMenuForSelection(g,h)});this.projectMapSubscription.add(e),this.projectMapSubscription.add(t),this.projectMapSubscription.add(i),this.projectMapSubscription.add(r),this.projectMapSubscription.add(a),this.projectMapSubscription.add(u),this.projectMapSubscription.add(c),this.projectMapSubscription.add(p),this.mapChangeDetectorRef.detectChanges()}openMenuForSelection(e,t){if(e.length<2||!(t instanceof MouseEvent))return!1;let i=[],r=[],a=[],c=[];return e.forEach(p=>{p instanceof Ia?i.push(this.mapDrawingToDrawing.convert(p)):p instanceof qa?r.push(this.mapNodeToNode.convert(p)):p instanceof tc?a.push(this.mapLabelToLabel.convert(p)):p instanceof ku&&c.push(this.mapLinkToLink.convert(p))}),this.contextMenu().openMenuForListOfElements(i,r,a,c,t.clientY,t.clientX),!0}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(i=>{t&&this.templateComponent()&&this.templateComponent().onNodeCreated(t,!0),this.toasterService.success(`Node "${i.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()}})},i=>{if(t&&this.templateComponent()){let r=i.error?.message||i.message||"Unknown error";this.templateComponent().onNodeCreated(t,!1,r)}this.toasterService.error(i.error?.message||i.message||"Failed to create node from template")})}centerView(){if(this.project){let e=this.mapChild()?.context,t=document.documentElement.clientWidth,i=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-i/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(i=>{this.project.show_interface_labels=i.show_interface_labels,this.isInterfaceLabelVisible=i.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()}toggleMarkerManager(){if(this.isMarkerManagerVisible&&this.windowManagement.isMinimized("marker-manager")){this.windowManagement.restoreWindow("marker-manager"),this.bringMarkerManagerToFront();return}if(this.isMarkerManagerVisible){this.closeMarkerManager();return}this.isMarkerManagerVisible=!0,this.zIndexCounter++,this.markerManagerZIndex=this.baseZIndex+this.zIndexCounter,this.cd.markForCheck()}closeMarkerManager(){this.isMarkerManagerVisible=!1,this.windowManagement.restoreWindow("marker-manager"),this.cd.markForCheck()}bringMarkerManagerToFront(){this.zIndexCounter++,this.markerManagerZIndex=this.baseZIndex+this.zIndexCounter,this.cd.markForCheck()}getMarkerManagerTaskbarLeft(){let e=this.TASKBAR_ICON_WIDTH+this.TASKBAR_ICON_GAP,t=this.TASKBAR_BASE_LEFT;return this.isConsoleVisible&&(t+=e),t+=this.webWiresharkInlineWindows.size*e,t+=this.webConsoleInlineWindows.size*e,t+=this.fileManagerInlineWindows.size*e,t}toggleMarkerManagerMinimize(){let e="marker-manager";this.windowManagement.minimizedWindows().some(t=>t.id===e)?this.windowManagement.restoreWindow(e):this.windowManagement.minimizeWindow(e,"marker"),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 i=this.getWebWiresharkInlineWindows().findIndex(a=>a.link_id===e),r=this.TASKBAR_ICON_WIDTH+this.TASKBAR_ICON_GAP;return this.TASKBAR_BASE_LEFT+r+i*(this.TASKBAR_ICON_WIDTH+this.TASKBAR_ICON_GAP)}getFileManagerTaskbarLeft(e){let t=Array.from(this.fileManagerInlineWindows.keys()).indexOf(e),i=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+=i),p+=r*i,p+=a*i,p+t*i}getWebConsoleTaskbarLeft(e){if(!e)return this.TASKBAR_BASE_LEFT;let i=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+i*(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(i=>{this.project.show_layers=i.show_layers,this.layersVisibility=i.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 i=`itemLockStatusVisibility_${t}`;e?localStorage.setItem(i,"true"):localStorage.removeItem(i)}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(i=>{this.project.show_grid=i.show_grid,this.gridVisibility=i.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(i=>{this.project.snap_to_grid=i.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(eg,{width:"400px",autoFocus:!1,disableClose:!0}).componentInstance;t.controller=this.controller}saveProject(){let t=this.dialog.open(uw,{width:"400px",autoFocus:!1,disableClose:!0}).componentInstance;t.controller=this.controller,t.project=this.project}editProject(){let e=this.dialog.open(ig,{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(i=>{i&&(this.project=i,this.cd.markForCheck())})}importProject(){let e="",t=this.dialog.open(og,{width:"400px",autoFocus:!1,disableClose:!0}),i=t.componentInstance;i.controller=this.controller;let r=t.componentInstance.onImportProject.subscribe(a=>{e=a});t.afterClosed().subscribe(a=>{if(r.unsubscribe(),e&&!a){this.bottomSheet.open(rg);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 g=h.error?.message||h.message||"Failed to open project";this.toasterService.error(g),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(cf,{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],i=new FileReader,r=new Image;i.onloadend=()=>{let a=i.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=()=>{i.readAsDataURL(t)},r.src=window.URL.createObjectURL(t)}closeProject(){let t=this.bottomSheet.open(Ya,{data:{message:"Do you want to close the project?"},panelClass:"confirmation-bottom-sheet"}).afterDismissed().subscribe(i=>{i&&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(Ya,{data:{message:"Do you want to delete the project?"},panelClass:"confirmation-bottom-sheet"}).afterDismissed().subscribe(i=>{i&&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(gg,{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(B2,{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.projectWsIntentionalClose=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopLivenessCheck(),this.projectws&&this.projectws.OPEN&&this.projectws.close(),this.markerWsIntentionalClose=!0,this.markerReconnectTimer&&(clearTimeout(this.markerReconnectTimer),this.markerReconnectTimer=null),this.stopMarkerLivenessCheck(),this.markerWs&&this.markerWs.OPEN&&this.markerWs.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(i=>i.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,i){t&1&&Xt(i.contextMenu,ug,5)(i.mapChild,QS,5)(i.projectMapMenuComponent,Cg,5)(i.topologySummaryContainer,CDe,5,ro)(i.templateComponent,kg,5),t&2&&Kt(5)},decls:179,vars:74,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"],["matTooltip","Marker manager","matTooltipClass","custom-tooltip","matTooltipPosition","left","mat-icon-button","",1,"menu-button",3,"click","color"],[3,"openMarkerManager"],[3,"controller","project","zIndex"],[3,"links"],[3,"controller"],[3,"drawingSaved","controller","project"],[3,"ngClass"],[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,"closeWindow","windowFocused","controller","project","zIndex"],[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,i){if(t&1&&(s(0,"div",5,0)(2,"div",6)(3,"button",7),R(4,"mat-icon",8),l(),s(5,"div",9),I(6,TDe,5,6,"div",10),s(7,"div",11),R(8,"app-nodes-menu",12),s(9,"app-context-menu",13),_("openWebWiresharkInline",function(a){return i.openWebWiresharkInline(a)})("openWebConsoleInline",function(a){return i.onOpenWebConsoleInline(a)})("openFileManagerInline",function(a){return i.onOpenFileManagerInline(a)}),l()()(),s(10,"div")(11,"button",14),_("click",function(){return i.toggleShowTopologySummary(!i.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),_("click",function(){return i.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),_("click",function(){return i.addNewProject()}),s(61,"mat-icon"),d(62,"add"),l(),s(63,"span"),d(64,"Add new blank project"),l()(),s(65,"button",17),_("click",function(){return i.saveProject()}),s(66,"mat-icon"),d(67,"save"),l(),s(68,"span"),d(69,"Save project as"),l()(),s(70,"button",17),_("click",function(){return i.editProject()}),s(71,"mat-icon"),d(72,"edit"),l(),s(73,"span"),d(74,"Edit project"),l()(),s(75,"button",17),_("click",function(){return i.exportProject()}),s(76,"mat-icon"),d(77,"call_made"),l(),s(78,"span"),d(79,"Export project"),l()(),s(80,"button",17),_("click",function(){return i.importProject()}),s(81,"mat-icon"),d(82,"call_received"),l(),s(83,"span"),d(84,"Import project"),l()(),s(85,"button",17),_("click",function(){return i.closeProject()}),s(86,"mat-icon"),d(87,"close"),l(),s(88,"span"),d(89,"Close project"),l()(),s(90,"button",17),_("click",function(){return i.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),_("change",function(a){return i.toggleShowInterfaceLabels(a.checked)}),d(99," Show interface labels "),l(),R(100,"br"),s(101,"mat-checkbox",20),_("change",function(a){return i.toggleShowConsole(a.checked)}),d(102," Show console "),l(),R(103,"br"),s(104,"mat-checkbox",20),_("change",function(a){return i.toggleShowTopologySummary(a.checked)}),d(105," Show topology/controllers summary "),l(),R(106,"br"),s(107,"mat-checkbox",20),_("change",function(a){return i.toggleNotifications(a.checked)}),d(108," Show notifications "),l(),R(109,"br"),s(110,"mat-checkbox",20),_("change",function(a){return i.toggleLayers(a.checked)}),d(111," Show layers "),l(),R(112,"br"),s(113,"mat-checkbox",20),_("change",function(a){return i.toggleItemLockStatus(a.checked)}),d(114," Show item lock status "),l(),R(115,"br"),s(116,"mat-checkbox",20),_("change",function(a){return i.toggleGrid(a.checked)}),d(117," Show grid "),l(),R(118,"br"),s(119,"mat-checkbox",20),_("change",function(a){return i.toggleSnapToGrid(a.checked)}),d(120," Snap to grid "),l(),R(121,"br"),s(122,"mat-checkbox",20),_("change",function(a){return i.toggleSymbolScaling(a.checked)}),d(123," Scale symbols "),l(),R(124,"br"),l()()(),I(125,EDe,1,10,"app-d3-map",21),s(126,"div",22)(127,"div",23)(128,"button",24),_("click",function(){return i.toggleMovingMode()}),s(129,"mat-icon"),d(130,"near_me"),l()(),s(131,"button",25),_("click",function(){return i.toggleMovingMode()}),s(132,"mat-icon"),d(133,"zoom_out_map"),l()(),s(134,"button",26),_("click",function(){return i.zoomIn()}),s(135,"mat-icon"),d(136,"zoom_in"),l()(),s(137,"button",27),_("click",function(){return i.resetZoom()}),s(138,"mat-icon"),d(139,"adjust"),l()(),s(140,"button",28),_("click",function(){return i.zoomOut()}),s(141,"mat-icon"),d(142,"zoom_out"),l()()(),s(143,"div",23)(144,"app-project-map-menu",29),_("aiChatOpened",function(){return i.onAIChatOpened()}),l()(),s(145,"div",23)(146,"button",30),_("click",function(){return i.toggleMarkerManager()}),s(147,"mat-icon"),d(148,"insights"),l()()(),I(149,DDe,2,2,"div",23),l(),s(150,"app-marker-legend",31),_("openMarkerManager",function(){return i.toggleMarkerManager()}),l(),I(151,PDe,1,3,"app-marker-manager",32),R(152,"app-progress"),I(153,IDe,1,1,"app-draw-link-tool",33),R(154,"app-drawing-dragged",12)(155,"app-drawing-resized",34)(156,"app-interface-label-dragged",34)(157,"app-link-created",12)(158,"app-node-dragged",12)(159,"app-node-label-dragged",34),s(160,"app-text-added",35),_("drawingSaved",function(){return i.onDrawingSaved()}),l(),R(161,"app-text-edited",34),s(162,"div",36),I(163,ADe,1,3,"app-console-wrapper",32),l(),I(164,ODe,1,3,"app-ai-chat",37),I(165,FDe,2,0),I(166,LDe,2,0),I(167,BDe,2,0),s(168,"div",38),I(169,zDe,5,7,"div",39),K(170,jDe,5,7,"div",39,jj),K(172,$De,5,7,"div",39,uM),K(174,HDe,5,6,"div",39,uM),I(176,UDe,5,7,"div",39),l()(),Ce(177,WDe,0,0,"ng-template",null,4,Kd)),t&2){let r=ke(15),a=ke(58),c=ke(96);Ae("pan-mode",i.tools.moving),C("ngClass",i.mapBgClass()),m(3),C("matMenuTriggerFor",r),m(3),A(i.readonly?-1:6),m(2),C("controller",i.controller)("project",i.project),m(),C("project",i.project)("controller",i.controller),m(5),C("overlapTrigger",!1),m(2),C("routerLink",Tt(67,xDe)),m(5),C("routerLink",un(68,bDe,i.controller.id)),m(5),C("routerLink",Hi("/controller/",i.controller.id,"/computes")),m(5),C("routerLink",Hi("/controller/",i.controller.id,"/preferences")),m(5),C("routerLink",un(70,yDe,i.controller.id)),m(10),C("controller",i.controller)("project",i.project),m(),C("matMenuTriggerFor",a),m(5),C("matMenuTriggerFor",c),m(5),C("overlapTrigger",!1),m(38),C("overlapTrigger",!1),m(3),C("checked",i.isInterfaceLabelVisible),m(3),C("checked",i.isConsoleVisible),m(3),C("checked",i.isTopologySummaryVisible),m(3),C("checked",i.notificationsVisibility),m(3),C("checked",i.layersVisibility),m(3),C("checked",i.itemLockStatusVisibility),m(3),C("checked",i.gridVisibility),m(3),C("checked",i.project.snap_to_grid),m(3),C("checked",i.symbolScaling),m(3),A(i.controller.id&&i.project.project_id?125:-1),m(3),Ae("tool-active",!i.tools.moving),C("color",i.tools.moving?"basic":"primary"),m(3),Ae("tool-active",i.tools.moving),C("color",i.tools.moving?"primary":"basic"),m(13),C("controller",i.controller)("project",i.project),m(2),Ae("tool-active",i.isMarkerManagerVisible),C("color",i.isMarkerManagerVisible?"primary":"basic"),m(3),A(i.readonly?-1:149),m(2),A(i.project&&i.isMarkerManagerVisible?151:-1),m(2),A(i.tools.draw_link?153:-1),m(),C("controller",i.controller)("project",i.project),m(),C("controller",i.controller),m(),C("controller",i.controller),m(),C("controller",i.controller)("project",i.project),m(),C("controller",i.controller)("project",i.project),m(),C("controller",i.controller),m(),C("controller",i.controller)("project",i.project),m(),C("controller",i.controller),m(),C("ngClass",un(72,SDe,!i.isConsoleVisible)),m(),A(i.project?163:-1),m(),A(i.project&&i.isAIChatVisible?164:-1),m(),A(i.project&&i.webWiresharkInlineWindows.size>0?165:-1),m(),A(i.project&&i.webConsoleInlineWindows.size>0?166:-1),m(),A(i.project&&i.fileManagerInlineWindows.size>0?167:-1),m(2),A(i.project&&i.isConsoleVisible?169:-1),m(),Y(i.getWebWiresharkInlineWindows()),m(2),Y(i.getWebConsoleInlineWindows()),m(2),Y(i.getFileManagerInlineWindows()),m(2),A(i.project&&i.isMarkerManagerVisible?176:-1)}},dependencies:[ne,Ji,Je,G,ze,Lt,qt,oe,de,qe,Kn,tt,Fn,ht,Mt,dt,vn,QS,ug,Cg,iM,aM,mM,kg,oM,J2,W2,fj,gj,Cj,Em,Mj,kj,Tj,Ej,Dj,Pj,Ij,Vj,Aj,Lj],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}.visible[_ngcontent-%COMP%]{display:none}.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 fM=(()=>{class n{dialogRef=f(Ie);projectService=f(Ei);toasterService=f(ie);cd=f(X);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,i){t&1&&(s(0,"h1",0),d(1,"Save project as"),l(),s(2,"div",1)(3,"mat-form-field",2)(4,"input",3),_("input",function(a){return i.name.set(a.target.value)}),l()()(),s(5,"div",4)(6,"button",5),_("click",function(){return i.onCloseClick()}),d(7,"Cancel"),l(),s(8,"button",6),_("click",function(){return i.onSaveClick()}),d(9,"Save project"),l()()),t&2&&(m(4),C("value",i.name()))},dependencies:[ne,Je,ve,Le,Ve,G,pe,Se,Te,Me,we],styles:[".form-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();function GDe(n,o){if(n&1&&(s(0,"p"),d(1),l()),n&2){let e=o.$implicit,t=o.$index;m(),mi("",t+1,". ",e==null?null:e.filename)}}function qDe(n,o){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(),K(5,GDe,2,2,"p",null,Ni),l(),s(7,"div",2)(8,"button",3),_("click",function(){k(e);let i=v();return T(i.deleteAll())}),d(9,"Delete"),l(),s(10,"button",4),d(11,"Cancel"),l()()}if(n&2){let e=v();m(5),Y(e.deleteData==null?null:e.deleteData.deleteFilesPaths)}}function QDe(n,o){n&1&&(s(0,"h1",5),d(1,"Please wait."),l(),s(2,"div",6),R(3,"mat-spinner",7),l())}function XDe(n,o){if(n&1&&(s(0,"p"),d(1),l()),n&2){let e=o.$implicit,t=o.$index;m(),mi("",t+1,". ",(e==null?null:e.filename)||(e==null?null:e.project_id))}}function KDe(n,o){if(n&1&&(s(0,"h2",0),d(1),l(),K(2,XDe,2,2,"p",null,Oe)),n&2){let e=v(2);m(),mi("\u2713 ",e.successfulDeletions().length," ",e.successfulDeletions().length===1?"Project":"Projects"," deleted successfully"),m(),Y(e.successfulDeletions())}}function YDe(n,o){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=o.$implicit,t=o.$index;m(),ee(" ",t+1,". "),m(2),B((e.project==null?null:e.project.filename)||(e.project==null?null:e.project.project_id)),m(3),B((e.error==null||e.error.error==null?null:e.error.error.message)||(e.error==null?null:e.error.message)||"Unknown error")}}function ZDe(n,o){if(n&1&&(s(0,"h2",9),d(1),l(),K(2,YDe,7,3,"p",null,Ni)),n&2){let e=v(2);m(),mi("\u2717 ",e.failedDeletions().length," ",e.failedDeletions().length===1?"Project":"Projects"," failed to delete"),m(),Y(e.failedDeletions())}}function JDe(n,o){if(n&1){let e=z();s(0,"div",1),I(1,KDe,4,2),I(2,ZDe,4,2),l(),s(3,"div",2)(4,"button",8),_("click",function(){k(e);let i=v();return T(i.dialogRef.close(i.successfulDeletions().length>0))}),d(5,"Close"),l()()}if(n&2){let e=v();m(),A(e.successfulDeletions().length>0?1:-1),m(),A(e.failedDeletions().length>0?2:-1)}}var gM=(()=>{class n{deleteData;dialogRef=f(Ie);projectService=f(Ei);toasterService=f(ie);cd=f(X);isDelete=Q(!1);isUsedFiles=Q(!1);successfulDeletions=Q([]);failedDeletions=Q([]);constructor(e){this.deleteData=e}async deleteAll(){this.isDelete.set(!0),await this.deleteFile()}deleteFile(){let e=this.deleteData.deleteFilesPaths.map((t,i)=>this.projectService.delete(this.deleteData.controller,t.project_id).pipe(uo(r=>Nn({error:!0,data:r,projectIndex:i}))));Yi(e).subscribe({next:t=>{let i=[],r=[];t.forEach((a,c)=>{a&&a.error===!0?r.push({project:this.deleteData.deleteFilesPaths[c],error:a.data}):a==null?i.push(this.deleteData.deleteFilesPaths[c]):r.push({project:this.deleteData.deleteFilesPaths[c],error:a})}),this.successfulDeletions.set(i),this.failedDeletions.set(r),this.isUsedFiles.set(!0),this.isDelete.set(!0),this.cd.markForCheck()},error:t=>{let i=t.error?.message||t.message||"Failed to delete projects";this.toasterService.error(i),this.cd.markForCheck()}})}static \u0275fac=function(t){return new(t||n)(at(Ct))};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,i){t&1&&(I(0,qDe,12,0),I(1,QDe,4,0),I(2,JDe,6,2)),t&2&&(A(!i.isDelete()&&!i.isUsedFiles()?0:-1),m(),A(i.isDelete()&&!i.isUsedFiles()?1:-1),m(),A(i.isDelete()&&i.isUsedFiles()?2:-1))},dependencies:[ne,ve,vc,Le,Ve,St,G,pe,dn,qn],encapsulation:2,changeDetection:0})}return n})();var ePe=(n,o)=>["/controller",n,"project",o];function tPe(n,o){if(n&1){let e=z();s(0,"mat-header-cell")(1,"mat-checkbox",35),_("change",function(i){k(e);let r=v();return T(i.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 nPe(n,o){if(n&1){let e=z();s(0,"mat-cell")(1,"mat-checkbox",36),_("click",function(i){return i.stopPropagation()})("change",function(i){let r=k(e).$implicit,a=v();return T(i?a.selection.toggle(r):null)}),l()()}if(n&2){let e=o.$implicit,t=v();m(),C("checked",t.selection.isSelected(e))}}function iPe(n,o){n&1&&(s(0,"mat-header-cell",37),d(1," Name "),l())}function oPe(n,o){if(n&1&&(s(0,"mat-cell")(1,"a",38),d(2),l()()),n&2){let e=o.$implicit,t=v();m(),C("routerLink",aa(2,ePe,t.controller.id,e.project_id)),m(),ee(" ",e.name," ")}}function rPe(n,o){n&1&&(s(0,"mat-header-cell",37),d(1," Created By "),l())}function aPe(n,o){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=o.$implicit;m(),ee(" ",e.created_by," ")}}function sPe(n,o){n&1&&(s(0,"mat-header-cell",39),d(1," Actions "),l())}function lPe(n,o){if(n&1){let e=z();s(0,"button",48),_("click",function(){k(e);let i=v().$implicit,r=v();return T(r.open(i))}),s(1,"mat-icon",49),d(2,"play_arrow"),l()()}}function cPe(n,o){n&1&&R(0,"mat-progress-spinner",51)}function dPe(n,o){n&1&&(s(0,"mat-icon",52),d(1,"pause"),l())}function mPe(n,o){if(n&1){let e=z();s(0,"button",50),_("click",function(){k(e);let i=v().$implicit,r=v();return T(r.close(i))}),I(1,cPe,1,0,"mat-progress-spinner",51)(2,dPe,2,0,"mat-icon",52),l()}if(n&2){let e=v().$implicit,t=v();C("disabled",t.isProjectLoading(e.project_id)),m(),A(t.isProjectLoading(e.project_id)?1:2)}}function pPe(n,o){if(n&1){let e=z();s(0,"button",53),_("click",function(){k(e);let i=v().$implicit,r=v();return T(r.duplicate(i))}),s(1,"mat-icon",54),d(2,"content_copy"),l()()}}function uPe(n,o){if(n&1){let e=z();s(0,"mat-cell",39)(1,"div",40),I(2,lPe,3,0,"button",41),I(3,mPe,3,2,"button",42),s(4,"button",43),_("click",function(){let i=k(e).$implicit,r=v();return T(r.editProject(i))}),s(5,"mat-icon",44),d(6,"edit"),l()(),I(7,pPe,3,0,"button",45),s(8,"button",46),_("click",function(){let i=k(e).$implicit,r=v();return T(r.exportSelectProject(i))}),s(9,"mat-icon",47),d(10,"file_download"),l()()()()}if(n&2){let e=o.$implicit;m(2),A(e.status==="closed"?2:-1),m(),A(e.status==="opened"?3:-1),m(4),A(e.status==="closed"?7:-1)}}function hPe(n,o){if(n&1){let e=z();s(0,"button",56),_("click",function(){k(e);let i=v(2);return T(i.deleteAllFiles())}),s(1,"mat-icon"),d(2,"delete"),l()()}}function fPe(n,o){if(n&1&&(s(0,"mat-header-cell",39),I(1,hPe,3,0,"button",55),l()),n&2){let e=v();m(),A(e.selection.selected.length>1?1:-1)}}function gPe(n,o){n&1&&R(0,"mat-progress-spinner",51)}function _Pe(n,o){n&1&&(s(0,"mat-icon",59),d(1,"delete"),l())}function vPe(n,o){if(n&1){let e=z();s(0,"button",58),_("click",function(){k(e);let i=v().$implicit,r=v();return T(r.delete(i))}),I(1,gPe,1,0,"mat-progress-spinner",51)(2,_Pe,2,0,"mat-icon",59),l()}if(n&2){let e=v().$implicit,t=v();C("disabled",t.isProjectLoading(e.project_id)),m(),A(t.isProjectLoading(e.project_id)?1:2)}}function CPe(n,o){if(n&1&&(s(0,"mat-cell",39),I(1,vPe,3,2,"button",57),l()),n&2){let e=o.$implicit,t=v();m(),A(e.status==="closed"&&t.selection.isSelected(e)?1:-1)}}function xPe(n,o){n&1&&R(0,"mat-header-row")}function bPe(n,o){n&1&&R(0,"mat-row")}function yPe(n,o){n&1&&R(0,"mat-icon",33)}function SPe(n,o){n&1&&R(0,"mat-icon",34)}var _M=(()=>{class n{controller;settings;project;displayedColumns=["select","name","created_by","actions","delete"];version=Sg;currentYear=new Date().getFullYear();isAllDelete=!1;selection=new Ra(!0,[]);sort=Rt(po);searchText=U("");_projects=Q([]);_sortActive=Q("name");_sortDirection=Q("asc");_loadingProjects=Q(new Set);displayProjects=$t(()=>{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 i=this._sortActive(),r=this._sortDirection();return i&&r&&(t=[...t].sort((a,c)=>{let p=a[i],u=c[i],h=isNaN(+p)?p:+p,g=isNaN(+u)?u:+u;return(h<g?-1:1)*(r==="asc"?1:-1)})),t});_displayProjects$=ow(this.displayProjects);dataSource=this._displayProjects$;destroyRef=f(Ms);route=f(lt);projectService=f(Ei);notificationService=f(Js);settingsService=f(Qr);progressService=f(io);dialog=f(it);router=f(_t);bottomSheet=f(ec);toasterService=f(ie);recentlyOpenedProjectService=f(Jd);themeService=f(pi);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(Hs(this.destroyRef)).subscribe(()=>this.refresh()),this.notificationService.projectNotificationEmitter.pipe(Hs(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 i=[...t],r=i.findIndex(a=>a.project_id===e.event.project_id);switch(e.action){case"project.created":r===-1&&i.push(e.event);break;case"project.opened":case"project.closed":case"project.updated":r>=0&&(i[r]=e.event);break;case"project.deleted":r>=0&&i.splice(r,1);break}return i})}isProjectLoading(e){return this._loadingProjects().has(e)}setProjectLoading(e,t){this._loadingProjects.update(i=>{let r=new Set(i);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 i=this.bottomSheet.open(Ya,{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 i=t.error?.message||t.message||"Project was deleted";this.refresh(),this.progressService.deactivate(),this.toasterService.error(i)},complete:()=>{this.progressService.deactivate()}})}close(e){let i=this.bottomSheet.open(Ya,{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(fM,{panelClass:["base-dialog-panel","choose-name-dialog-panel"],autoFocus:!1,disableClose:!0}),i=t.componentInstance;i.controller=this.controller,i.project=e,t.afterClosed().subscribe(()=>{this.refresh()})}editProject(e){let t=this.dialog.open(ig,{autoFocus:!1,disableClose:!0,panelClass:["base-dialog-panel","configurator-dialog-panel","edit-project-dialog-panel"]}),i=t.componentInstance;i.controller=this.controller,i.project=e,t.afterClosed().subscribe(()=>{this.refresh()})}addBlankProject(){let t=this.dialog.open(eg,{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(og,{panelClass:["base-dialog-panel","import-project-dialog-panel"],autoFocus:!1,disableClose:!0}),i=t.componentInstance;i.controller=this.controller;let r=t.componentInstance.onImportProject.subscribe(a=>{e=a});t.afterClosed().subscribe(()=>{if(this.refresh(),r.unsubscribe(),e){this.bottomSheet.open(rg);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(gM,{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(cf,{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,i){t&1&&Xt(i.sort,po,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,i){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),_("click",function(){return i.addBlankProject()}),s(7,"mat-icon"),d(8,"add"),l(),d(9," Add Blank Project "),l(),s(10,"button",6),_("click",function(){return i.importProject()}),s(11,"mat-icon"),d(12,"cloud_upload"),l(),d(13," Import Project "),l(),s(14,"button",6),_("click",function(){return i.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),_("input",function(a){return i.searchText.set(a.target.value)}),l()()(),s(23,"div",11)(24,"cdk-virtual-scroll-viewport",12)(25,"mat-table",13,0),_("matSortChange",function(a){return i.onSortChange(a)}),Fe(27,14),Ce(28,tPe,2,2,"mat-header-cell",15)(29,nPe,2,1,"mat-cell",16),Re(),Fe(30,17),Ce(31,iPe,2,0,"mat-header-cell",18)(32,oPe,3,5,"mat-cell",16),Re(),Fe(33,19),Ce(34,rPe,2,0,"mat-header-cell",18)(35,aPe,2,1,"mat-cell",16),Re(),Fe(36,20),Ce(37,sPe,2,0,"mat-header-cell",21)(38,uPe,11,3,"mat-cell",22),Re(),Fe(39,23),Ce(40,fPe,2,1,"mat-header-cell",21)(41,CPe,2,1,"mat-cell",22),Re(),Ce(42,xPe,1,0,"mat-header-row",24)(43,bPe,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),I(52,yPe,1,0,"mat-icon",33),I(53,SPe,1,0,"mat-icon",34),l()()()()()()),t&2&&(m(22),C("value",i.searchText()),m(3),C("dataSource",i.dataSource),m(17),C("matHeaderRowDef",i.displayedColumns)("matHeaderRowDefSticky",!0),m(),C("matRowDefColumns",i.displayedColumns),m(4),mi("GNS3 Web-UI \xA92018-",i.currentYear," v",i.version),m(5),A(i.isLightThemeEnabled()?-1:52),m(),A(i.isLightThemeEnabled()?53:-1))},dependencies:[ne,Je,rt,ot,Gn,dt,vn,qc,ve,pr,po,Nr,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,G,pe,ze,oe,de,we,Me,ts,Se,Te,Lt,qt,dn,qn,yC,_4,C4],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 Dg=(()=>{class n{controllerStatusChanged=new We;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=te({token:n,factory:n.\u0275fac})}return n})();var wPe=(n,o)=>o.key;function MPe(n,o){n&1&&(s(0,"mat-error"),d(1,"You must enter a value"),l())}function kPe(n,o){if(n&1&&(s(0,"mat-option",8),d(1),l()),n&2){let e=o.$implicit;C("value",e.key),m(),ee(" ",e.name," ")}}function TPe(n,o){if(n&1&&(s(0,"div",2)(1,"mat-error"),d(2),l()()),n&2){let e=v();m(2),B(e.connectionError)}}function EPe(n,o){if(n&1&&(s(0,"div",2)(1,"mat-error"),d(2),l()()),n&2){let e=v();m(2),B(e.duplicateNameError)}}function DPe(n,o){n&1&&R(0,"mat-spinner",12)}function PPe(n,o){n&1&&d(0," Add ")}function IPe(n,o){if(n&1){let e=z();s(0,"button",14),_("click",function(){k(e);let i=v();return T(i.onAddAnywayClick())}),d(1,"Add anyway"),l()}}var vM=(()=>{class n{dialogRef=f(Ie);controllerService=f(nt);toasterService=f(ie);changeDetector=f(X);data=f(Ct);protocols=[{key:"http:",name:"HTTP"},{key:"https:",name:"HTTPS"}];connectionError="";canAddAnyway=!1;isCheckingConnection=!1;duplicateNameError="";controllerForm=new Ho({name:new $e("",[je.required]),host:new $e("",[je.required]),port:new $e("",[je.required,je.min(1)]),protocol:new $e("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:i=>{this.isCheckingConnection=!1,i.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:i=>{this.isCheckingConnection=!1,this.connectionError="Cannot connect to the controller. It appears offline.",this.canAddAnyway=!0;let r=i.error?.message||i.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,i){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),I(8,MPe,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),K(21,kPe,2,2,"mat-option",8,wPe),l()()(),I(23,TPe,3,1,"div",2),I(24,EPe,3,1,"div",2),s(25,"div",9)(26,"button",10),_("click",function(){return i.onNoClick()}),d(27,"Cancel"),l(),s(28,"button",11),_("click",function(){return i.onAddClick()}),I(29,DPe,1,0,"mat-spinner",12)(30,PPe,1,0),l(),I(31,IPe,2,0,"button",13),l()()),t&2&&(m(2),C("formGroup",i.controllerForm),m(6),A(i.controllerForm.get("name").hasError("required")?8:-1),m(13),Y(i.protocols),m(2),A(i.connectionError?23:-1),m(),A(i.duplicateNameError?24:-1),m(4),C("disabled",i.isCheckingConnection),m(),A(i.isCheckingConnection?29:30),m(2),A(i.canAddAnyway?31:-1))},dependencies:[ne,Et,rt,Nt,Uo,Dt,ot,Ft,Vt,ve,Le,Ve,St,G,pe,we,Me,Xe,ni,Se,Te,gt,Pt,ft,Vo,dn,qn],encapsulation:2,changeDetection:0})}return n})();function APe(n,o){n&1&&(s(0,"mat-error"),d(1,"Name is required"),l())}function OPe(n,o){n&1&&(s(0,"mat-error"),d(1,"Host is required"),l())}function NPe(n,o){n&1&&(s(0,"mat-error"),d(1,"Port is required"),l())}function FPe(n,o){n&1&&(s(0,"mat-error"),d(1,"Port must be at least 1"),l())}function RPe(n,o){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v();m(),B(e.duplicateNameError)}}var $j=(()=>{class n{dialogRef=f(Ie);controllerService=f(nt);toasterService=f(ie);changeDetector=f(X);controller;controllerForm;duplicateNameError="";ngOnInit(){this.controllerForm=new Ho({name:new $e(this.controller.name,[je.required]),host:new $e(this.controller.host,[je.required]),port:new $e(this.controller.port,[je.required,je.min(1)]),protocol:new $e(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=Ye(Z({},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.`)},i=>{let r=i.error?.message||i.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,i){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),I(8,APe,2,0,"mat-error"),l(),s(9,"mat-form-field",2)(10,"mat-label"),d(11,"Host"),l(),R(12,"input",4),I(13,OPe,2,0,"mat-error"),l(),s(14,"mat-form-field",2)(15,"mat-label"),d(16,"Port"),l(),R(17,"input",5),I(18,NPe,2,0,"mat-error"),I(19,FPe,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()()(),I(28,RPe,2,1,"mat-error"),l()(),s(29,"mat-dialog-actions",9)(30,"button",10),_("click",function(){return i.onCancel()}),d(31,"Cancel"),l(),s(32,"button",11),_("click",function(){return i.onSave()}),d(33,"Save"),l()()),t&2&&(m(3),C("formGroup",i.controllerForm),m(5),A(i.controllerForm.get("name").hasError("required")?8:-1),m(5),A(i.controllerForm.get("host").hasError("required")?13:-1),m(5),A(i.controllerForm.get("port").hasError("required")?18:-1),m(),A(i.controllerForm.get("port").hasError("min")?19:-1),m(9),A(i.duplicateNameError?28:-1),m(4),C("disabled",!i.controllerForm.valid))},dependencies:[ne,Et,rt,Nt,Uo,Dt,ot,Ft,Vt,ve,Le,Ve,St,G,pe,we,Me,Xe,ni,Se,Te,gt,Pt,ft,Vo],encapsulation:2,changeDetection:0})}return n})();var LPe=n=>["/controller",n,"projects"];function VPe(n,o){n&1&&R(0,"mat-icon",4)}function BPe(n,o){n&1&&R(0,"mat-icon",5)}function zPe(n,o){n&1&&(s(0,"mat-header-cell",40),d(1," ID "),l())}function jPe(n,o){if(n&1&&(s(0,"mat-cell",41),d(1),l()),n&2){let e=o.$implicit;m(),ee(" ",e.id," ")}}function $Pe(n,o){n&1&&(s(0,"mat-header-cell",42),d(1," Name "),l())}function HPe(n,o){if(n&1&&(s(0,"a",43),d(1),l()),n&2){let e=v().$implicit;C("routerLink",un(2,LPe,e.id)),m(),ee(" ",e.name," ")}}function UPe(n,o){if(n&1&&(s(0,"span",44),d(1),l()),n&2){let e=v().$implicit;m(),B(e.name)}}function WPe(n,o){if(n&1&&(s(0,"mat-cell"),I(1,HPe,2,4,"a",43)(2,UPe,2,1,"span",44),l()),n&2){let e=o.$implicit,t=v();m(),A(t.getControllerStatus(e)==="running"?1:2)}}function GPe(n,o){n&1&&(s(0,"mat-header-cell",42),d(1," Status "),l())}function qPe(n,o){n&1&&(s(0,"div",45),R(1,"span",48),s(2,"span"),d(3,"Running"),l()())}function QPe(n,o){n&1&&(s(0,"div",46),R(1,"span",48),s(2,"span"),d(3,"Starting"),l()())}function XPe(n,o){n&1&&(s(0,"div",47),R(1,"span",48),s(2,"span"),d(3,"Stopped"),l()())}function KPe(n,o){if(n&1&&(s(0,"mat-cell"),I(1,qPe,4,0,"div",45)(2,QPe,4,0,"div",46)(3,XPe,4,0,"div",47),l()),n&2){let e,t=o.$implicit,i=v();m(),A((e=i.getControllerStatus(t))==="running"?1:e==="starting"?2:3)}}function YPe(n,o){n&1&&(s(0,"mat-header-cell",40),d(1," Location "),l())}function ZPe(n,o){if(n&1&&(s(0,"mat-cell",41),d(1),l()),n&2){let e=o.$implicit;m(),ee(" ",e.location," ")}}function JPe(n,o){n&1&&(s(0,"mat-header-cell",42),d(1," Host "),l())}function eIe(n,o){if(n&1&&(s(0,"mat-cell")(1,"span",49),d(2),l(),s(3,"span",41),d(4),l()()),n&2){let e=o.$implicit;m(2),mi("",e.host,":",e.port),m(2),B(e.host)}}function tIe(n,o){n&1&&(s(0,"mat-header-cell",40),d(1," Port "),l())}function nIe(n,o){if(n&1&&(s(0,"mat-cell",41),d(1),l()),n&2){let e=o.$implicit;m(),ee(" ",e.port," ")}}function iIe(n,o){n&1&&(s(0,"mat-header-cell"),d(1," Actions "),l())}function oIe(n,o){if(n&1){let e=z();s(0,"button",54),_("click",function(){k(e);let i=v().$implicit,r=v();return T(r.openProjects(i))}),s(1,"mat-icon"),d(2,"folder_open"),l()()}}function rIe(n,o){if(n&1){let e=z();s(0,"mat-cell")(1,"div",50),I(2,oIe,3,0,"button",51),s(3,"button",52),_("click",function(){let i=k(e).$implicit,r=v();return T(r.editController(i))}),s(4,"mat-icon"),d(5,"edit"),l()(),s(6,"button",53),_("click",function(){let i=k(e).$implicit,r=v();return T(r.deleteController(i))}),s(7,"mat-icon"),d(8,"delete"),l()()()()}if(n&2){let e=o.$implicit,t=v();m(2),A(t.getControllerStatus(e)==="running"?2:-1)}}function aIe(n,o){n&1&&R(0,"mat-header-row")}function sIe(n,o){if(n&1&&R(0,"mat-row"),n&2){let e=o.$implicit,t=v();Ae("controllers__row--running",t.getControllerStatus(e)==="running")("controllers__row--starting",t.getControllerStatus(e)==="starting")("controllers__row--stopped",t.getControllerStatus(e)==="stopped")}}function lIe(n,o){n&1&&R(0,"mat-icon",38)}function cIe(n,o){n&1&&R(0,"mat-icon",39)}var CM=(()=>{class n{dialog=f(it);controllerService=f(nt);controllerDatabase=f(Im);controllerManagement=f(Dg);changeDetector=f(X);bottomSheet=f(ec);route=f(lt);router=f(_t);themeService=f(pi);toasterService=f(ie);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=Sg;currentYear=new Date().getFullYear();sort;constructor(){}getControllers(){let e=this.controllerManagement.getRunningControllers();this.controllerService.findAll().then(t=>{t.forEach(i=>{i.status="stopped",e.findIndex(a=>i.name===a)>=0&&(i.status="running"),i.protocol||(i.protocol=location.protocol)}),this.controllerDatabase.addControllers(t),this.changeDetector.markForCheck(),t.forEach(i=>{this.updateControllerOnlineStatus(i)})},t=>{let i=t.error?.message||t.message||"Failed to load controllers";this.toasterService.error(i),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 i=this.startingTimeouts.get(t.name);if(i&&e.status!=="started"&&(clearTimeout(i),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 EO(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(vM,{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(i=>{i.status="stopped",this.controllerDatabase.addController(i),this.updateControllerOnlineStatus(i),this.changeDetector.markForCheck()},i=>{let r=i.error?.message||i.message||"Failed to create controller";this.toasterService.error(r),this.changeDetector.markForCheck()})})}startStatusAutoRefresh(){this.statusRefreshSubscription=aC(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 i=this.bottomSheet.open(Ya,{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($j,{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(i=>{i&&(this.controllerDatabase.update(i),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,i){if(t&1&&In(po,5),t&2){let r;mt(r=pt())&&(i.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,i){t&1&&(s(0,"div",1)(1,"div",2)(2,"div",3),I(3,VPe,1,0,"mat-icon",4),I(4,BPe,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),_("input",function(a){return i.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),_("click",function(){return i.createModal()}),s(21,"mat-icon"),d(22,"add"),l(),d(23," Add Controller "),l()(),s(24,"div",13)(25,"mat-table",14,0),Fe(27,15),Ce(28,zPe,2,0,"mat-header-cell",16)(29,jPe,2,1,"mat-cell",17),Re(),Fe(30,18),Ce(31,$Pe,2,0,"mat-header-cell",19)(32,WPe,3,1,"mat-cell",20),Re(),Fe(33,21),Ce(34,GPe,2,0,"mat-header-cell",19)(35,KPe,4,1,"mat-cell",20),Re(),Fe(36,22),Ce(37,YPe,2,0,"mat-header-cell",16)(38,ZPe,2,1,"mat-cell",17),Re(),Fe(39,23),Ce(40,JPe,2,0,"mat-header-cell",19)(41,eIe,5,3,"mat-cell",20),Re(),Fe(42,24),Ce(43,tIe,2,0,"mat-header-cell",16)(44,nIe,2,1,"mat-cell",17),Re(),Fe(45,25),Ce(46,iIe,2,0,"mat-header-cell",26)(47,rIe,9,1,"mat-cell",20),Re(),Ce(48,aIe,1,0,"mat-header-row",27)(49,sIe,1,6,"mat-row",28),l()(),s(50,"div",29)(51,"button",30),_("click",function(){return i.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),I(63,lIe,1,0,"mat-icon",38),I(64,cIe,1,0,"mat-icon",39),l()()()()()()),t&2&&(m(3),A(i.isLightThemeEnabled()?-1:3),m(),A(i.isLightThemeEnabled()?4:-1),m(8),C("value",i.searchText()),m(),Ae("controllers__empty-state--hidden",i.controllerDatabase&&i.controllerDatabase.data.length>0),m(11),Ae("controllers__table-container--hidden",!i.controllerDatabase||i.controllerDatabase.data.length===0),m(),C("dataSource",i.dataSource),m(23),C("matHeaderRowDef",i.displayedColumns)("matHeaderRowDefSticky",!0),m(),C("matRowDefColumns",i.displayedColumns),m(),Ae("controllers__buttons-bar--hidden",!i.controllerDatabase||i.controllerDatabase.data.length===0),m(8),mi("GNS3 Web-UI \xA92018-",i.currentYear," v",i.version),m(5),A(i.isLightThemeEnabled()?-1:63),m(),A(i.isLightThemeEnabled()?64:-1))},dependencies:[ne,Je,rt,ot,Gn,dt,vn,ve,pr,po,Nr,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,we,Me,ts,Se,Te,oe,de,G,pe,ze,qc,qe,ht,Mt],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})(),EO=class extends ud{controllerDatabase;sort;filterChange=new tn("");constructor(o,e){super(),this.controllerDatabase=o,this.sort=e}setFilter(o){this.filterChange.next((o||"").trim().toLowerCase())}connect(){return Wn(this.controllerDatabase.dataChange,this.sort.sortChange,this.filterChange).pipe(Bt(()=>{let o=this.controllerDatabase.data.slice(),e=this.filterChange.value;return e&&(o=o.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===""?o:o.sort((t,i)=>{let r=t[this.sort.active]!==void 0?t[this.sort.active]:"",a=i[this.sort.active]!==void 0?i[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 xM=(()=>{class n{constructor(){}get(){}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var bM=(()=>{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(xM),ge(Qr))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var yM=(()=>{class n{consoleForm=new Ho({command:new $e("")});router=f(_t);consoleService=f(bM);toasterService=f(ie);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,i){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),_("click",function(){return i.goBack()}),d(26,"Cancel"),l(),s(27,"button",11),_("click",function(){return i.save()}),d(28,"Save"),l(),R(29,"br"),l()()()),t&2&&(m(7),C("formGroup",i.consoleForm))},dependencies:[Et,rt,Nt,Dt,ot,Ft,Vt,G,pe,kt,On,we,Me,Se,Te],styles:[".help[_ngcontent-%COMP%]{font-size:14px}"],changeDetection:0})}return n})();var SM=(()=>{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(Ks))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var wM=(n,o)=>o.key;function pIe(n,o){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=o.$implicit;C("value",e.key),m(2),Yt("background",e.primaryColor),m(2),B(e.label)}}function uIe(n,o){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=o.$implicit;C("value",e.key),m(2),Yt("background",e.primaryColor),m(2),B(e.label)}}function hIe(n,o){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),B(e.autoMapBackground.label)}}function fIe(n,o){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=o.$implicit;C("value",e.key),m(2),Yt("background",e.background)("color",e.textColor),m(4),B(e.label)}}function gIe(n,o){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=o.$implicit;C("value",e.key),m(2),Yt("background",e.background)("color",e.textColor),m(4),B(e.label)}}function _Ie(n,o){n&1&&R(0,"mat-spinner",21)}function vIe(n,o){n&1&&(s(0,"span"),d(1,"Check for update AI skills"),l())}var MM=(()=>{class n{settingsService=f(Qr);toaster=f(ie);themeService=f(pi);mapSettingsService=f(_o);updatesService=f(SM);cdr=f(X);route=f(lt);controllerService=f(nt);aiChatService=f(sh);settings;integrateLinksLabelsToLinks=U(!1);openReadme=U(!1);openConsolesInWidget=U(!1);crashReports=U(!1);anonymousStatistics=U(!1);isLoadingAiSkills=Q(!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:i=>{let r=i?.error?.message||i?.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,i){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),_("change",function(a){return i.crashReports.set(a.checked)}),d(15,"Send anonymous crash reports"),l(),s(16,"mat-checkbox",7),_("change",function(a){return i.integrateLinksLabelsToLinks.set(a.checked)}),d(17,"Integrate link labels to links"),l(),s(18,"mat-checkbox",7),_("change",function(a){return i.openReadme.set(a.checked)}),d(19,"Automatically open project README files"),l(),s(20,"mat-checkbox",7),_("change",function(a){return i.anonymousStatistics.set(a.checked)}),d(21,"Send anonymous usage statistics"),l(),s(22,"mat-checkbox",7),_("change",function(a){return i.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),_("change",function(a){return i.setTheme(a.value)}),s(34,"div",11)(35,"span",12),d(36,"Light"),l(),K(37,pIe,5,4,"mat-radio-button",13,wM),l(),s(39,"div",11)(40,"span",12),d(41,"Dark"),l(),K(42,uIe,5,4,"mat-radio-button",13,wM),l()()(),s(44,"div",14)(45,"label",9),d(46,"Project map background"),l(),s(47,"mat-radio-group",15),_("change",function(a){return i.setMapTheme(a.value)}),I(48,hIe,6,2,"div",16),s(49,"div",17)(50,"div",11)(51,"span",12),d(52,"Light"),l(),K(53,fIe,7,6,"mat-radio-button",13,wM),l(),s(55,"div",11)(56,"span",12),d(57,"Dark"),l(),K(58,gIe,7,6,"mat-radio-button",13,wM),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),_("click",function(){return i.checkForUpdates()}),d(68," Check for updates "),l(),s(69,"button",20),_("click",function(){return i.checkForAiSkillsUpdates()}),I(70,_Ie,1,0,"mat-spinner",21)(71,vIe,2,0,"span"),l()()()()(),s(72,"div",22)(73,"button",23),_("click",function(){return i.save()}),d(74,"Save settings"),l()()()()),t&2&&(m(7),C("expanded",!0),m(7),C("checked",i.crashReports()),m(2),C("checked",i.integrateLinksLabelsToLinks()),m(2),C("checked",i.openReadme()),m(2),C("checked",i.anonymousStatistics()),m(2),C("checked",i.openConsolesInWidget()),m(2),C("expanded",!1),m(9),C("value",i.currentTheme),m(4),Y(i.lightThemes),m(5),Y(i.darkThemes),m(5),C("value",i.mapTheme),m(),A(i.autoMapBackground?48:-1),m(5),Y(i.lightMapBackgrounds),m(5),Y(i.darkMapBackgrounds),m(2),C("expanded",!1),m(9),C("disabled",i.isLoadingAiSkills())("matTooltip",i.isLoadingAiSkills()?"Updating AI skills...":""),m(),A(i.isLoadingAiSkills()?70:71))},dependencies:[ne,Je,gl,Om,Pd,Id,Am,ob,Lt,qt,G,pe,oo,yo,fo,dn,qn,ht,Mt],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 Hj=(n,o)=>o[0];function CIe(n,o){if(n&1&&(s(0,"div",13)(1,"span",15),d(2),l(),s(3,"span",16),d(4),l()()),n&2){let e=o.$implicit;m(2),B(e[0]),m(2),B(e[1])}}function xIe(n,o){n&1&&(s(0,"span",14),d(1,"No nodes"),l())}function bIe(n,o){if(n&1&&(s(0,"div",13)(1,"span",15),d(2),l(),s(3,"span",16),d(4),l()()),n&2){let e=o.$implicit;m(2),B(e[0]),m(2),B(e[1])}}function yIe(n,o){if(n&1&&(s(0,"div",1)(1,"h3",2),d(2,"Nodes by Status"),l(),s(3,"div",12),K(4,bIe,5,2,"div",13,Hj),l()()),n&2){let e=v(2);m(4),Y(e.getNodeStatusEntries())}}function SIe(n,o){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),K(38,CIe,5,2,"div",13,Hj,!1,xIe,2,0,"span",14),l()(),I(41,yIe,6,0,"div",1)),n&2){let e=v();m(6),B(e.projectStats().total),m(5),B(e.projectStats().opened),m(5),B(e.projectStats().closed),m(5),B(e.nodeStats().total),m(5),B(e.linkStats().total),m(5),B(e.linkStats().capturing),m(7),Y(e.getNodeTypeEntries()),m(3),A(e.getNodeStatusEntries().length>0?41:-1)}}function wIe(n,o){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),dC(" ",e.computeStatistics().statistics.load_average_percent[0]," / ",e.computeStatistics().statistics.load_average_percent[1]," / ",e.computeStatistics().statistics.load_average_percent[2]," "),m(5),dC(" ",e.formatBytes(e.computeStatistics().statistics.memory_used)," / ",e.formatBytes(e.computeStatistics().statistics.memory_total)," (",e.formatBytes(e.computeStatistics().statistics.memory_free)," free) "),m(5),dC(" ",e.formatBytes(e.computeStatistics().statistics.swap_used)," / ",e.formatBytes(e.computeStatistics().statistics.swap_total)," (",e.formatBytes(e.computeStatistics().statistics.swap_free)," free) ")}}var kM=(()=>{class n{computeStatistics=ae(void 0);projectStats=ae(void 0);nodeStats=ae(void 0);linkStats=ae(void 0);formatBytes(e,t=2){if(e==null||e===0)return"0 Bytes";let i=1024,r=t<0?0:t,a=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],c=Math.floor(Math.log(e)/Math.log(i));return parseFloat((e/Math.pow(i,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,i){t&1&&(s(0,"mat-card",0),I(1,SIe,42,8),I(2,wIe,40,14,"div",1),l()),t&2&&(m(),A(i.projectStats()?1:-1),m(),A(i.computeStatistics()?2:-1))},dependencies:[ne,kt,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 MIe=(n,o)=>o.compute_name;function kIe(n,o){n&1&&(s(0,"div"),d(1,"Statistics not loaded"),l())}function TIe(n,o){if(n&1&&(s(0,"div",2)(1,"h3",3),d(2),l(),R(3,"app-status-chart",4),l()),n&2){let e=o.$implicit;m(2),B(e.compute_name),m(),C("computeStatistics",e)}}var TM=(()=>{class n{route=f(lt);computeService=f(Eo);controllerService=f(nt);toasterService=f(ie);cd=f(X);controllerId="";computeStatistics=Q([]);projectStats=Q({total:0,opened:0,closed:0});nodeStats=Q({total:0,open_project_nodes:0,closed_project_nodes:0,by_type:{},by_status:{}});linkStats=Q({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 i=t.error?.message||t.message||"Failed to load statistics";this.toasterService.error(i),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,i){t&1&&(I(0,kIe,2,0,"div"),s(1,"div",0),R(2,"app-status-chart",1),l(),K(3,TIe,4,2,"div",2,MIe)),t&2&&(A(!i.projectStats().total&&!i.nodeStats().total&&!i.linkStats().total&&!i.computeStatistics().length?0:-1),m(2),C("projectStats",i.projectStats())("nodeStats",i.nodeStats())("linkStats",i.linkStats()),m(),Y(i.computeStatistics()))},dependencies:[ne,kM],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 EM=(()=>{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,i){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:[TM],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 Uj=Gs(xO()),Wj=Gs(yO()),Gj=Gs(wO());var EIe=["terminal"],Yv=(()=>{class n{controllerId;projectId;nodeId;destroy$=new We;controller;node;contextMenuCleanup=null;socket=null;consoleService=f(mr);controllerService=f(nt);route=f(lt);title=f(Ku);nodeService=f(ut);themeService=f(pi);contextMenuService=f(K2);cdr=f(X);xtermService=f(bg);toasterService=f(ie);term=new Uj.Terminal(Z({},this.xtermService.getDefaultTerminalOptions()));fitAddon=new Gj.FitAddon;terminal=Rt("terminal");constructor(){}ngOnInit(){this.themeService.themeChanged.pipe(Ge(this.destroy$)).subscribe(()=>{this.xtermService.updateTerminalTheme(this.term,this.cdr)}),this.controllerService.isServiceInitialized?this.getData():this.controllerService.serviceInitialized.pipe(Ge(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(Ge(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(Ge(this.destroy$)).subscribe({next:t=>{this.node=t,this.title.setTitle(this.node.name),this.openTerminal()},error:t=>{let i=t.error?.message||t.message||"Failed to load node";this.toasterService.error(i),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 Wj.AttachAddon(this.socket);this.term.loadAddon(t),this.xtermService.initTerminal(this.term,this.fitAddon),this.fitAddon.fit(),this.term.focus(),this.term.attachCustomKeyEventHandler(i=>!((i.code==="KeyC"||i.code==="KeyV")&&i.ctrlKey&&i.shiftKey)),this.xtermService.settingsChanged$.pipe(Ge(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,i){t&1&&Xt(i.terminal,EIe,5),t&2&&Kt()},decls:2,vars:0,consts:[["terminal",""],[1,"terminal",2,"width","100%","height","100%"]],template:function(t,i){t&1&&ks(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 DM=(()=>{class n{consoleService;bottomSheet;constructor(e,t){this.consoleService=e,this.bottomSheet=t}canDeactivate(){return this.consoleService.openConsoles>0?this.bottomSheet.open(Ya,{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(mr),ge(ec))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var ri=(()=>{class n{controllerService;loginService;router;constructor(e,t,i){this.controllerService=e,this.loginService=t,this.router=i}async canActivate(e,t){let i=e.paramMap.get("controller_id");this.loginService.controller_id=i;let r=await this.controllerService.get(parseInt(i,10));try{await this.loginService.getLoggedUser(r)}catch{}return this.controllerService.get(parseInt(i,10)).then(a=>a?a.authToken&&!a.tokenExpired?!0:(this.router.navigate(["/controller",a.id,"login"],{queryParams:{returnUrl:t.url}}),!1):(this.router.navigate(["/controllers"]),!1))}static \u0275fac=function(t){return new(t||n)(ge(nt),ge(vl),ge(_t))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var Fr=(()=>{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,i){return i?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=te({token:n,factory:n.\u0275fac})}return n})();function PM(n){if(n.get("password").value!==n.get("confirmPassword").value){n.get("confirmPassword").setErrors({confirmPasswordMatch:!0});return}}function PIe(n,o){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 IIe(n,o){n&1&&(s(0,"mat-error"),d(1,"Password and Confirm password must be the same."),l())}var Pg=(()=>{class n{dialogRef=f(Ie);userService=f(Fr);toasterService=f(ie);cd=f(X);data=f(Ct);user=Q(this.data.user);editPasswordForm=new Ho({password:new $e(null,[je.minLength(6),je.maxLength(100),je.pattern(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}$/),je.required]),confirmPassword:new $e(null,[je.minLength(6),je.maxLength(100),je.pattern(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}$/),je.required])},{validators:[PM]});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 i=t.error?.message||t.message||"Failed to update password";this.toasterService.error(i),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,i){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),I(6,PIe,2,0,"mat-error"),l(),s(7,"mat-form-field",2),R(8,"input",4),I(9,IIe,2,0,"mat-error"),l(),s(10,"div",5)(11,"button",6),_("click",function(){return i.onCancel()}),d(12,"Cancel"),l(),s(13,"button",7),_("click",function(){return i.onPasswordSave()}),d(14," Change password "),l()()()()),t&2){let r;m(),ee("Change password for ",(r=i.user())==null?null:r.username),m(2),C("formGroup",i.editPasswordForm),m(3),A(i.passwordForm.password!=null&&i.passwordForm.password.touched&&(i.passwordForm.password!=null&&i.passwordForm.password.errors)?6:-1),m(3),A(i.passwordForm.confirmPassword!=null&&i.passwordForm.confirmPassword.touched&&(i.passwordForm.confirmPassword!=null&&i.passwordForm.confirmPassword.errors)?9:-1),m(4),C("disabled",!i.editPasswordForm.valid)}},dependencies:[ne,Et,rt,Nt,Dt,ot,Ft,Vt,ve,Le,Ve,G,pe,we,Me,ni,Se,Te],styles:[".input-field[_ngcontent-%COMP%]{width:100%;padding:0 16px}.button-div[_ngcontent-%COMP%]{float:right}"],changeDetection:0})}return n})();function AIe(n,o){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=o;m(5),B(e.username),m(5),B(e.full_name),m(5),B(e.email)}}var qj=(()=>{class n{dialogRef;data;controllerService;userService;toasterService;dialog;user=Q(void 0);controller;constructor(e,t,i,r,a,c){this.dialogRef=e,this.data=t,this.controllerService=i,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(Pg,{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)(at(Ie),at(Ct),at(nt),at(Fr),at(ie),at(it))};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,i){if(t&1&&(s(0,"h2",0),d(1,"Logged in user info"),l(),s(2,"mat-dialog-content"),I(3,AIe,16,3,"div",1),l(),s(4,"mat-dialog-actions",2)(5,"button",3),_("click",function(){return i.changePassword()}),d(6," Change password "),l(),s(7,"button",3),_("click",function(){return i.copyToken()}),d(8," Copy access token "),l(),s(9,"button",4),_("click",function(){return i.close()}),d(10,"Close"),l()()),t&2){let r;m(3),A((r=i.user())?3:-1,r)}},dependencies:[ne,ve,Le,Ve,St,G,pe,oe],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 Qj=(()=>{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,i){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),_("click",function(){return i.close()}),d(268,"Got it"),l()())},dependencies:[ve,Le,Ve,St,G,pe,oe,de,kt,On,fl],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 OIe=(n,o)=>o.id,DO=(n,o)=>o.value;function NIe(n,o){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v(2);m(),B(e.getErrorMessage("name"))}}function FIe(n,o){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=o.$implicit;C("value",e.id),m(),ee(" ",e.label," ")}}function RIe(n,o){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function LIe(n,o){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),_("selectionChange",function(i){k(e);let r=v(2);return T(r.onModelChange(i.value))}),K(4,RIe,2,2,"mat-option",16,Oe),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(),Y(t.selectedPreset.models)}}function VIe(n,o){n&1&&(s(0,"mat-error"),d(1,"Model name is required"),l())}function BIe(n,o){if(n&1&&(s(0,"mat-form-field",13)(1,"mat-label"),d(2,"Model Name"),l(),R(3,"input",24),I(4,VIe,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),A((e=t.form.get("model"))!=null&&e.value?-1:4)}}function zIe(n,o){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v(2);m(),B(e.getErrorMessage("api_key"))}}function jIe(n,o){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 $Ie(n,o){n&1&&(s(0,"span"),d(1,"API key will be encrypted on the server. Minimum length: 10 characters"),l())}function HIe(n,o){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=o.$implicit;C("value",e.value),m(),ee(" ",e.label," ")}}function UIe(n,o){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),I(8,NIe,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),_("selectionChange",function(i){k(e);let r=v();return T(r.onPresetChange(i.value))}),K(15,FIe,2,2,"mat-option",16,OIe),l(),s(17,"mat-hint"),d(18,"Select a preset to auto-configure"),l()(),I(19,LIe,8,1,"mat-form-field",13),I(20,BIe,7,1,"mat-form-field",13),s(21,"mat-form-field",13)(22,"mat-label"),d(23,"API Key"),l(),R(24,"input",17),I(25,zIe,2,1,"mat-error"),s(26,"mat-hint"),I(27,jIe,2,0,"span",18),I(28,$Ie,2,0,"span"),l()(),s(29,"mat-form-field",13)(30,"mat-label"),d(31,"Copilot Mode"),l(),s(32,"mat-select",19),K(33,HIe,2,2,"mat-option",16,DO),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),A(e.hasError("name")?8:-1),m(6),C("value",e.selectedPresetId),m(),Y(e.basicModePresets),m(4),A(e.selectedPreset&&e.selectedPresetId!=="custom"&&!e.useCustomModel?19:-1),m(),A(e.selectedPresetId==="custom"||e.useCustomModel?20:-1),m(4),C("placeholder",e.mode==="edit"?"Leave empty to keep existing key":""),m(),A(e.hasError("api_key")?25:-1),m(2),A(e.mode==="edit"?27:-1),m(),A(e.mode==="create"?28:-1),m(5),Y(e.copilotModes),m(3),B(e.getCopilotModeDescription())}}function WIe(n,o){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v(2);m(),B(e.getErrorMessage("name"))}}function GIe(n,o){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v(2);m(),B(e.getErrorMessage("api_key"))}}function qIe(n,o){n&1&&(s(0,"mat-error"),d(1,"Model name is required"),l())}function QIe(n,o){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v(2);m(),B(e.getErrorMessage("temperature"))}}function XIe(n,o){if(n&1&&(s(0,"mat-error"),d(1),l()),n&2){let e=v(2);m(),B(e.getErrorMessage("context_limit"))}}function KIe(n,o){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=o.$implicit;C("value",e.value),m(),ee(" ",e.label," ")}}function YIe(n,o){if(n&1&&(s(0,"mat-option",16),d(1),l()),n&2){let e=o.$implicit;C("value",e.value),m(),ee(" ",e.label," ")}}function ZIe(n,o){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),_("click",function(){let i=k(e).$index,r=v(3);return T(r.removeCustomField(i))}),s(10,"mat-icon"),d(11,"delete"),l()()()}if(n&2){let e=o.$index;C("formGroupName",e)}}function JIe(n,o){if(n&1&&(s(0,"div",39),K(1,ZIe,12,1,"div",41,Ni),l()),n&2){let e=v(2);C("formGroup",e.form),m(),Y(e.customFieldsArray.controls)}}function e3e(n,o){n&1&&(s(0,"div",40)(1,"mat-icon",47),d(2,"info"),l(),s(3,"p"),d(4,"No custom fields"),l()())}function t3e(n,o){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),_("click",function(){k(e);let i=v();return T(i.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),I(16,WIe,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),I(38,GIe,2,1,"mat-error"),l(),s(39,"mat-form-field",13)(40,"mat-label"),d(41,"Model Name"),l(),R(42,"input",31),I(43,qIe,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),I(52,QIe,2,1,"mat-error"),l(),s(53,"mat-form-field",33)(54,"mat-label"),d(55,"Context Limit"),l(),R(56,"input",35),I(57,XIe,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),K(63,KIe,2,2,"mat-option",16,DO),l()(),s(65,"mat-form-field",33)(66,"mat-label"),d(67,"Copilot Mode"),l(),s(68,"mat-select",19),K(69,YIe,2,2,"mat-option",16,DO),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),_("click",function(){k(e);let i=v();return T(i.addCustomField())}),s(79,"mat-icon"),d(80,"add_circle"),l()()(),I(81,JIe,3,1,"div",39)(82,e3e,5,0,"div",40),l()()}if(n&2){let e,t=v();m(16),A(t.hasError("name")?16:-1),m(21),C("placeholder",t.mode==="edit"?"Leave empty to keep existing key":""),m(),A(t.hasError("api_key")?38:-1),m(5),A((e=t.form.get("model"))!=null&&e.value?-1:43),m(9),A(t.hasError("temperature")?52:-1),m(5),A(t.hasError("context_limit")?57:-1),m(6),Y(t.contextStrategies),m(6),Y(t.copilotModes),m(12),A(t.customFieldsArray.length>0?81:82)}}var n3e=[{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}}],i3e=[{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"}],o3e=[{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"}],r3e=[{value:"teaching_assistant",label:"Teaching Assistant",description:"Diagnostics only"},{value:"lab_automation_assistant",label:"Lab Automation Assistant",description:"Full configuration access"}],a3e=["name","model_type","provider","model","api_key","base_url","temperature","context_limit","context_strategy","copilot_mode","is_default"],xp=(()=>{class n{fb;dialogRef;dialog;cd;data;form;mode;existingNames;customFieldsArray;configMode="basic";providerPresets=n3e;selectedPresetId="custom";selectedPreset=null;useCustomModel=!1;get basicModePresets(){return this.providerPresets.filter(e=>e.id!=="custom")}modelTypes=i3e;contextStrategies=o3e;copilotModes=r3e;get isPresetSelected(){return this.selectedPresetId!=="custom"&&this.selectedPreset!==null}constructor(e,t,i,r,a){this.fb=e,this.dialogRef=t,this.dialog=i,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([je.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 i=Object.entries(e.config).filter(([r])=>!a3e.includes(r)&&r!=="max_tokens");for(;this.customFieldsArray.length!==0;)this.customFieldsArray.removeAt(0);i.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:["",[je.required,je.minLength(1),je.maxLength(100),je.pattern(/^[a-zA-Z0-9_-]+$/),this.duplicateNameValidator()]],model_type:["text",je.required],provider:["",je.required],model:["",je.required],api_key:["",[je.required,je.minLength(10)]],base_url:[""],temperature:[.7,[je.min(0),je.max(2)]],context_limit:[128,[je.required,je.min(1),je.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,i=this.providerPresets.find(r=>r.id!=="custom"&&r.provider===e&&r.baseUrl===t);i?(this.selectedPresetId=i.id,this.selectedPreset=i,this.setPresetMode(!0),i.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 i=t.errors;return e==="name"?i.required?"Name is required":i.minlength?"Name must be at least 1 character":i.maxlength?"Name cannot exceed 100 characters":i.pattern?"Name can only contain letters, numbers, underscores and hyphens":i.duplicateName?"Name already exists":"Invalid name format":e==="api_key"?i.required?"API Key is required":i.minlength?"API Key is too short (minimum 10 characters)":"Invalid API Key format":e==="temperature"?i.min?"Temperature cannot be less than 0":i.max?"Temperature cannot be greater than 2":"Invalid temperature value":e==="context_limit"?i.required?"Context limit is required":i.min?"Context limit must be at least 1K":i.max?"Context limit cannot exceed 10000K":"Invalid context limit":i.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(i=>i.value===e);return t?t.description:""}getCopilotModeDescription(){let e=this.form.get("copilot_mode")?.value,t=this.copilotModes.find(i=>i.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(i=>{let r=i.get("key")?.value,a=i.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(Qj,{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)(at(PC),at(Ie),at(it),at(X),at(Ct))};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,i){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),uc("valueChange",function(a){return pc(i.configMode,a)||(i.configMode=a),a}),_("change",function(a){return i.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()()(),I(19,UIe,50,9,"div",7),I(20,t3e,83,7,"div",8),l()(),s(21,"mat-dialog-actions",9)(22,"button",10),_("click",function(){return i.onCancel()}),d(23,"Cancel"),l(),s(24,"button",11),_("click",function(){return i.onSubmit()}),d(25),l()()),t&2&&(m(),ee(" ",i.mode==="create"?"Create LLM Model Configuration":"Edit LLM Model Configuration",`
|
||
`),m(2),C("formGroup",i.form),m(2),mc("value",i.configMode),m(14),A(i.configMode==="basic"?19:-1),m(),A(i.configMode==="custom"?20:-1),m(4),C("disabled",i.form.invalid),m(),ee(" ",i.mode==="create"?"Create":"Save"," "))},dependencies:[ne,Et,rt,Nt,Uo,Dt,ot,gc,nh,Ft,Vt,T4,E4,ve,Le,Ve,St,zC,d5,m5,oe,de,we,Me,Xe,RC,ni,Se,Te,gt,Pt,ft,Vo,Lt,qt,G,pe,ze,ht,Mt,kt],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 s3e=(n,o)=>o.name;function l3e(n,o){if(n&1&&(s(0,"p"),d(1),l()),n&2){let e=v();m(),B(e.data.message)}}function c3e(n,o){if(n&1&&(s(0,"li"),d(1),l()),n&2){let e=o.$implicit;m(),mi("",e.name,"",e.description?" ("+e.description+")":"")}}function d3e(n,o){if(n&1&&(s(0,"ul"),K(1,c3e,2,2,"li",null,s3e),l()),n&2){let e=v();m(),Y(e.data.items)}}var Ig=(()=>{class n{dialogRef=f(Ie);data=f(Ct);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,i){t&1&&(s(0,"h2",0),d(1),l(),s(2,"mat-dialog-content"),I(3,l3e,2,1,"p"),I(4,d3e,3,0,"ul"),l(),s(5,"mat-dialog-actions",1)(6,"button",2),_("click",function(){return i.onCancel()}),d(7),l(),s(8,"button",3),_("click",function(){return i.onConfirm()}),d(9),l()()),t&2&&(m(),B(i.data.title),m(2),A(i.data.message?3:-1),m(),A(i.data.items!=null&&i.data.items.length?4:-1),m(3),ee(" ",i.data.cancelText||"Cancel"," "),m(2),ee(" ",i.data.confirmText||"Confirm"," "))},dependencies:[ve,Le,Ve,St,G,pe],encapsulation:2,changeDetection:0})}return n})();function m3e(n,o){n&1&&(s(0,"div",8),R(1,"mat-spinner",10),s(2,"p"),d(3,"Loading..."),l()())}function p3e(n,o){n&1&&(s(0,"th",24),d(1,"Name"),l())}function u3e(n,o){n&1&&(s(0,"mat-icon",26),d(1,"group"),l())}function h3e(n,o){if(n&1&&(s(0,"span",28),d(1),l()),n&2){let e=v().$implicit;m(),B(e.group_name)}}function f3e(n,o){if(n&1&&(s(0,"td",25),I(1,u3e,2,0,"mat-icon",26),s(2,"span",27),d(3),l(),I(4,h3e,2,1,"span",28),l()),n&2){let e=o.$implicit;m(),A(e.source==="group"?1:-1),m(2),B(e.name),m(),A(e.source==="group"?4:-1)}}function g3e(n,o){n&1&&(s(0,"th",24),d(1,"API Domain"),l())}function _3e(n,o){if(n&1&&(s(0,"td",25)(1,"span",29),d(2),l()()),n&2){let e=o.$implicit,t=v(3);m(2),B(t.getProviderDisplay(e))}}function v3e(n,o){n&1&&(s(0,"th",24),d(1,"Model"),l())}function C3e(n,o){if(n&1&&(s(0,"td",25)(1,"span",30),d(2),l()()),n&2){let e=o.$implicit;m(2),B(e.config.model)}}function x3e(n,o){n&1&&(s(0,"th",24),d(1,"Context Limit"),l())}function b3e(n,o){if(n&1&&(s(0,"span",32),d(1),l()),n&2){let e=v().$implicit;m(),ee(" ",e.config.context_strategy," ")}}function y3e(n,o){if(n&1&&(s(0,"td",25)(1,"span",31),d(2),l(),I(3,b3e,2,1,"span",32),l()),n&2){let e=o.$implicit;m(2),ee("",e.config.context_limit,"K"),m(),A(e.config.context_strategy?3:-1)}}function S3e(n,o){n&1&&(s(0,"th",24),d(1,"Actions"),l())}function w3e(n,o){if(n&1){let e=z();s(0,"td",25)(1,"div",33)(2,"button",34),nn(3,"async"),_("click",function(){let i=k(e).$implicit,r=v(3);return T(r.toggleDefaultConfig(i))}),s(4,"mat-icon"),d(5,"check_circle"),l()(),s(6,"button",34),_("click",function(){let i=k(e).$implicit,r=v(3);return T(r.openEditDialog(i))}),s(7,"mat-icon"),d(8,"edit"),l()(),s(9,"button",35),_("click",function(){let i=k(e).$implicit,r=v(3);return T(r.deleteConfig(i))}),s(10,"mat-icon"),d(11,"delete"),l()()()()}if(n&2){let e,t=o.$implicit,i=v(3);m(2),Ae("active-btn",i.isDefault(t)),C("disabled",((e=$n(3,5,i.settingDefault$))==null?null:e.has(t.config_id))||!i.isEditable(t)),m(4),C("disabled",!i.isEditable(t)),m(3),C("disabled",!i.isEditable(t))}}function M3e(n,o){n&1&&R(0,"tr",36)}function k3e(n,o){if(n&1&&R(0,"tr",37),n&2){let e=o.$implicit,t=v(3);Ae("active-row",t.isDefault(e))("inherited-row",e.source==="group")}}function T3e(n,o){if(n&1&&(s(0,"div",12)(1,"table",14),Fe(2,15),Ce(3,p3e,2,0,"th",16)(4,f3e,5,3,"td",17),Re(),Fe(5,18),Ce(6,g3e,2,0,"th",16)(7,_3e,3,1,"td",17),Re(),Fe(8,19),Ce(9,v3e,2,0,"th",16)(10,C3e,3,1,"td",17),Re(),Fe(11,20),Ce(12,x3e,2,0,"th",16)(13,y3e,4,2,"td",17),Re(),Fe(14,21),Ce(15,S3e,2,0,"th",16)(16,w3e,12,7,"td",17),Re(),Ce(17,M3e,1,0,"tr",22)(18,k3e,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 E3e(n,o){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 D3e(n,o){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"),I(6,T3e,19,3,"div",12),I(7,E3e,7,0,"div",13),l()()()),n&2){let e=v();m(6),A(e.configs().length>0?6:-1),m(),A(e.configs().length===0?7:-1)}}var IM=(()=>{class n{destroy$=new We;controller=ae(void 0);user=ae(void 0);loading$=new tn(!1);settingDefault$=new tn(new Set);error$=new tn(null);configs$=new tn([]);defaultConfig$=new tn(null);configs=Q([]);defaultConfig=Q(null);settingDefaultConfigs=new Set;displayedColumns=["name","provider","model","context_limit","actions"];aiProfilesService=f(xg);dialog=f(it);snackBar=f(br);constructor(){}ngOnInit(){if(!this.controller()||!this.user()){console.error("AiProfileTabComponent: controller or user inputs are not set");return}this.loadConfigs(),Lr([this.configs$,this.defaultConfig$]).pipe(Ge(this.destroy$)).subscribe(([e,t])=>{this.configs.set(e),this.defaultConfig.set(t)}),this.error$.pipe(Ge(this.destroy$),ci(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(Ge(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(xp,{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(Ge(this.destroy$)).subscribe(t=>{t&&this.createConfig(t)})}openEditDialog(e){this.dialog.open(xp,{panelClass:["base-dialog-panel","ai-profile-dialog-panel"],data:{mode:"edit",config:Z({},e),existingNames:this.configs().filter(i=>i.source==="user"&&i.config_id!==e.config_id).map(i=>i.name)}}).afterClosed().pipe(Ge(this.destroy$)).subscribe(i=>{i&&this.updateConfig(e.config_id,i)})}createConfig(e){this.loading$.next(!0),this.aiProfilesService.createConfig(this.controller(),this.user().user_id,e).pipe(Ge(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(Ge(this.destroy$)).subscribe({next:()=>{this.loadConfigs(),this.showSuccess("Configuration updated successfully")},error:i=>{i.status===409?this.handleConflict(i):this.handleError(i,"Failed to update configuration")}})}deleteConfig(e){this.dialog.open(Ig,{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(Ge(this.destroy$)).subscribe(i=>{i&&(this.loading$.next(!0),this.aiProfilesService.deleteConfig(this.controller(),this.user().user_id,e.config_id).pipe(Ge(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 i=e.is_default,r=this.defaultConfig(),a=[...this.configs()],c=a.map(p=>Ye(Z({},p),{is_default:i?!1:p.config_id===t}));this.configs.set(c),this.defaultConfig.set(i?null:e),this.settingDefaultConfigs.add(t),this.settingDefault$.next(new Set(this.settingDefaultConfigs)),i?this.aiProfilesService.unsetDefaultConfig(this.controller(),this.user().user_id,t).pipe(Ge(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(Ge(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(Ge(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 i=t;e?.error?.detail?i=e.error.detail:e?.message&&(i=e.message),this.error$.next(i),this.loading$.next(!1),this.showError(i)}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,i){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),nn(11,"async"),_("click",function(){return i.loadConfigs()}),s(12,"mat-icon"),d(13,"refresh"),l(),d(14," Refresh "),l(),s(15,"button",7),_("click",function(){return i.openCreateDialog()}),s(16,"mat-icon"),d(17,"add"),l(),d(18," New Configuration "),l()()(),I(19,m3e,4,0,"div",8),nn(20,"async"),I(21,D3e,8,2,"div",9),nn(22,"async"),l()),t&2&&(m(10),C("disabled",$n(11,3,i.loading$)),m(9),A($n(20,5,i.loading$)?19:-1),m(2),A($n(22,7,i.loading$)?-1:21))},dependencies:[ne,ve,ns,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,G,pe,ze,oe,de,we,Se,gt,Lt,kt,On,fl,jc,zc,dn,qn,Gr],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 AM=(()=>{class n{dialogRef=f(Ie);data=f(Ct);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,i){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),_("click",function(){return i.close()}),d(6,"Close"),l()()),t&2&&(m(),ee("AI Profiles - ",i.data.user.username),m(2),C("controller",i.data.controller)("user",i.data.user))},dependencies:[ne,ve,Le,Ve,St,G,pe,oe,IM],styles:[".ai-profile-dialog__content[_ngcontent-%COMP%]{padding:16px 0}"],changeDetection:0})}return n})();var Xj=(()=>{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=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Kj=(()=>{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,i){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),_("input",function(a){return i.name.set(a.target.value)})("keyup.enter",function(){return i.onSubmit()}),l()()(),s(7,"mat-dialog-actions",3)(8,"button",4),_("click",function(){return i.onCancel()}),d(9,"Cancel"),l(),s(10,"button",5),_("click",function(){return i.onSubmit()}),d(11,"Create"),l()()),t&2&&(m(6),C("value",i.name()),m(4),C("disabled",!i.name().trim()))},dependencies:[ne,Je,ve,Le,Ve,St,G,pe,we,Me,Xe,Se,Te],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var Yj=(()=>{class n{data;dialogRef=f(Ie);snackBar=f(br);clipboard=f(eM);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)(at(Ct))};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,i){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),_("click",function(){return i.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),_("click",function(){return i.onClose()}),d(28,"I've saved the key"),l()()),t&2&&(m(11),B(i.data.response.name),m(6),B(i.data.response.api_key),m(8),B(i.data.response.created_at))},dependencies:[ne,ve,Le,Ve,St,G,pe,ze,oe,de,ns],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 P3e(n,o){n&1&&(s(0,"div",3),R(1,"mat-progress-spinner",8),l())}function I3e(n,o){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),_("click",function(){k(e);let i=v();return T(i.onCreate())}),d(6,"Create your first API key"),l()()}}function A3e(n,o){n&1&&(s(0,"mat-header-cell",26),d(1,"Name"),l())}function O3e(n,o){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=o.$implicit;m(),B(e.name)}}function N3e(n,o){n&1&&(s(0,"mat-header-cell",27),d(1,"Key Prefix"),l())}function F3e(n,o){if(n&1&&(s(0,"mat-cell",27)(1,"code"),d(2),l()()),n&2){let e=o.$implicit;m(2),B(e.key_prefix)}}function R3e(n,o){n&1&&(s(0,"mat-header-cell",26),d(1,"Created"),l())}function L3e(n,o){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=o.$implicit;m(),B(e.created_at)}}function V3e(n,o){n&1&&(s(0,"mat-header-cell",28),d(1,"Status"),l())}function B3e(n,o){n&1&&(s(0,"span",29),d(1,"Revoked"),l())}function z3e(n,o){n&1&&(s(0,"span",30),d(1,"Active"),l())}function j3e(n,o){if(n&1&&(s(0,"mat-cell",28),I(1,B3e,2,0,"span",29)(2,z3e,2,0,"span",30),l()),n&2){let e=o.$implicit;m(),A(e.revoked?1:2)}}function $3e(n,o){n&1&&(s(0,"mat-header-cell",31),d(1,"Actions"),l())}function H3e(n,o){if(n&1){let e=z();s(0,"button",33),_("click",function(){k(e);let i=v().$implicit,r=v(2);return T(r.onRevoke(i))}),s(1,"mat-icon"),d(2,"block"),l()()}}function U3e(n,o){if(n&1){let e=z();s(0,"button",34),_("click",function(){k(e);let i=v().$implicit,r=v(2);return T(r.onRestore(i))}),s(1,"mat-icon"),d(2,"restart_alt"),l()(),s(3,"button",35),_("click",function(){k(e);let i=v().$implicit,r=v(2);return T(r.onPermanentDelete(i))}),s(4,"mat-icon"),d(5,"delete_forever"),l()()}}function W3e(n,o){if(n&1&&(s(0,"mat-cell",31),I(1,H3e,3,0,"button",32)(2,U3e,6,0),l()),n&2){let e=o.$implicit;m(),A(e.revoked?2:1)}}function G3e(n,o){n&1&&R(0,"mat-header-row")}function q3e(n,o){if(n&1&&R(0,"mat-row"),n&2){let e=o.$implicit;Ae("mat-row--revoked",e.revoked)}}function Q3e(n,o){if(n&1){let e=z();s(0,"table",10),_("matSortChange",function(i){k(e);let r=v();return T(r.onSortChange(i))}),Fe(1,11),Ce(2,A3e,2,0,"mat-header-cell",12)(3,O3e,2,1,"mat-cell",13),Re(),Fe(4,14),Ce(5,N3e,2,0,"mat-header-cell",15)(6,F3e,3,1,"mat-cell",16),Re(),Fe(7,17),Ce(8,R3e,2,0,"mat-header-cell",12)(9,L3e,2,1,"mat-cell",13),Re(),Fe(10,18),Ce(11,V3e,2,0,"mat-header-cell",19)(12,j3e,3,1,"mat-cell",20),Re(),Fe(13,21),Ce(14,$3e,2,0,"mat-header-cell",22)(15,W3e,3,1,"mat-cell",23),Re(),Ce(16,G3e,1,0,"mat-header-row",24)(17,q3e,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 Zj=(()=>{class n{data;dialogRef=f(Ie);apiKeyService=f(Xj);toasterService=f(ie);dialog=f(it);destroyRef=f(Ms);displayedColumns=["name","key_prefix","created_at","status","actions"];_keys=Q([]);isLoading=Q(!0);_sortActive=Q("");_sortDirection=Q("");sortedKeys=$t(()=>{let e=this._keys(),t=this._sortActive(),i=this._sortDirection();return!t||!i?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)*(i==="asc"?1:-1)})});_sortedKeys$=ow(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(Hs(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(Kj,{panelClass:["base-dialog-panel","simple-dialog-panel","add-api-key-dialog-panel"],autoFocus:!1,disableClose:!0}).afterClosed().pipe(ci(Boolean),Hs(this.destroyRef)).subscribe(e=>{this.apiKeyService.create(this.data.controller,e).pipe(Hs(this.destroyRef)).subscribe({next:t=>{this.loadKeys(),this.dialog.open(Yj,{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(Ga,{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(ci(Boolean),Hs(this.destroyRef)).subscribe(()=>{this.apiKeyService.revoke(this.data.controller,e.api_key_id).pipe(Hs(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(Ga,{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(ci(Boolean),Hs(this.destroyRef)).subscribe(()=>{this.apiKeyService.restore(this.data.controller,e.api_key_id).pipe(Hs(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(Ga,{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(ci(Boolean),Hs(this.destroyRef)).subscribe(()=>{this.apiKeyService.delete(this.data.controller,e.api_key_id).pipe(Hs(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)(at(Ct))};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,i){t&1&&(s(0,"h2",0),d(1," API Keys "),s(2,"span",1)(3,"button",2),_("click",function(){return i.onCreate()}),s(4,"mat-icon"),d(5,"add"),l(),d(6," Create "),l()()(),s(7,"mat-dialog-content"),I(8,P3e,2,0,"div",3)(9,I3e,7,0,"div",4)(10,Q3e,18,3,"table",5),l(),s(11,"mat-dialog-actions",6)(12,"button",7),_("click",function(){return i.onClose()}),d(13,"Close"),l()()),t&2&&(m(8),A(i.isLoading()?8:i.sortedKeys().length===0?9:10))},dependencies:[ne,ve,Le,Ve,St,G,pe,ze,oe,de,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,pr,po,Nr,ht,Mt,dn,qn],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 X3e=["*",[["mat-toolbar-row"]]],K3e=["*","mat-toolbar-row"],Y3e=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["mat-toolbar-row"]],hostAttrs:[1,"mat-toolbar-row"],exportAs:["matToolbarRow"]})}return n})(),Jj=(()=>{class n{_elementRef=f(Jt);_platform=f(Es);_document=f(Qi);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,i,r){if(t&1&&Zi(r,Y3e,5),t&2){let a;mt(a=pt())&&(i._toolbarRows=a)}},hostAttrs:[1,"mat-toolbar"],hostVars:6,hostBindings:function(t,i){t&2&&(ar(i.color?"mat-"+i.color:""),Ae("mat-toolbar-multiple-rows",i._toolbarRows.length>0)("mat-toolbar-single-row",i._toolbarRows.length===0))},inputs:{color:"color"},exportAs:["matToolbar"],ngContentSelectors:K3e,decls:2,vars:0,template:function(t,i){t&1&&(ai(X3e),an(0),an(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 OM=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[_i]})}return n})();var J3e=n=>["controller",n,"systemstatus"],eAe=n=>["controller",n,"settings"],tAe=n=>["controller",n,"management","users"],nAe=n=>["controller",n,"help"],iAe=()=>["/controllers"],oAe=n=>["/controller",n,"projects"],rAe=n=>["controller",n,"preferences"],aAe=n=>["controller",n,"computes"],sAe=n=>["controller",n,"image-manager"];function lAe(n,o){if(n&1){let e=z();s(0,"button",14),_("click",function(){k(e);let i=v();return T(i.listProjects())}),d(1,"Projects"),l()}}function cAe(n,o){if(n&1){let e=z();s(0,"button",15),_("click",function(){k(e);let i=v();return T(i.backToProject())}),d(1,"Back to project"),l()}}var NM=(()=>{class n{isInstalledSoftwareAvailable=!1;isLoginPage=!1;routeSubscription;controllerStatusSubscription;shouldStopControllersOnClosing=!0;recentlyOpenedcontrollerId;recentlyOpenedProjectId;controllerIdProjectList;controllerId;controller;project;projectMapSubscription=new Mo;recentlyOpenedProjectService=f(Jd);controllerManagement=f(Dg);toasterService=f(ie);userService=f(Fr);progressService=f(io);dialog=f(it);router=f(_t);route=f(lt);controllerService=f(nt);projectService=f(Ei);cd=f(X);connectionManager=f(Nm);ngOnInit(){this.routeSubscription=this.router.events.pipe(ci(e=>e instanceof Tp)).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 i=e;for(;i.firstChild;){i=i.firstChild;let r=i.snapshot.paramMap.get(t);if(r)return r}return i.snapshot.paramMap.get(t)}openLoggedUserDialog(){this.dialog.open(qj,{panelClass:["base-dialog-panel"],autoFocus:!1,data:{controllerId:+this.controllerId}})}openApiKeyManagementDialog(){this.controllerService.get(+this.controllerId).then(e=>{this.dialog.open(Zj,{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(AM,{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(gg,{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,i){t&1&&_("beforeunload",function(a){return i.onBeforeUnload(a)},Zo)},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,i){if(t&1&&(s(0,"header",2)(1,"mat-toolbar",3)(2,"button",4),R(3,"mat-icon",5),l(),I(4,lAe,2,0,"button",6),I(5,cAe,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),_("click",function(){return i.openLoggedUserDialog()}),s(33,"mat-icon"),d(34,"person"),l(),s(35,"span"),d(36,"User info"),l()(),s(37,"button",11),_("click",function(){return i.openApiKeyManagementDialog()}),s(38,"mat-icon"),d(39,"vpn_key"),l(),s(40,"span"),d(41,"API Keys"),l()(),s(42,"button",11),_("click",function(){return i.openAiProfileDialog()}),s(43,"mat-icon"),d(44,"psychology"),l(),s(45,"span"),d(46,"AI Profile"),l()(),s(47,"button",11),_("click",function(){return i.goToDocumentation()}),s(48,"mat-icon"),d(49,"person"),l(),s(50,"span"),d(51,"API documentation"),l()(),s(52,"button",11),_("click",function(){return i.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),_("click",function(){return i.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=ke(11),a=ke(58);m(2),C("matMenuTriggerFor",a),m(2),A(!i.recentlyOpenedProjectId&&i.controllerIdProjectList?4:-1),m(),A(i.recentlyOpenedProjectId&&i.recentlyOpenedcontrollerId?5:-1),m(2),C("matMenuTriggerFor",r),m(5),C("disabled",!i.controllerId)("routerLink",un(27,J3e,i.controllerId)),m(5),C("disabled",!i.controllerId)("routerLink",un(29,eAe,i.controllerId)),m(5),C("disabled",!i.controllerId)("routerLink",un(31,tAe,i.controllerId)),m(5),C("disabled",!i.controllerId)("routerLink",un(33,nAe,i.controllerId)),m(5),C("disabled",!i.controllerId),m(5),C("disabled",!i.controllerId),m(5),C("disabled",!i.controllerId),m(5),C("disabled",!i.controllerId),m(5),C("disabled",!i.controllerId),m(7),C("routerLink",Tt(35,iAe)),m(5),C("disabled",!i.controllerId)("routerLink",un(36,oAe,i.controllerId)),m(5),C("disabled",!i.controllerId)("routerLink",un(38,rAe,i.controllerId)),m(5),C("disabled",!i.controllerId)("routerLink",un(40,aAe,i.controllerId)),m(5),C("disabled",!i.controllerId)("routerLink",un(42,sAe,i.controllerId)),m(5),C("disabled",!i.controllerId)}},dependencies:[ne,dt,ih,vn,OM,Jj,G,pe,ze,oe,de,qe,Kn,tt,Fn,ht,Em],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 Ag=(()=>{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(nt))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var FM=(n,o,e="")=>t=>Ca(500).pipe(Vn(()=>o.list(n)),Bt(i=>i.find(r=>r.username===t.value&&t.value!==e)?{userExists:!0}:null));var RM=(n,o,e="")=>t=>Ca(500).pipe(Vn(()=>o.list(n)),Bt(i=>i.find(r=>r.email===t.value&&t.value!==e)?{emailExists:!0}:null));var Bl=(()=>{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,i){return this.httpController.put(e,`/access/groups/${t.user_group_id}/members/${i.user_id}`,{})}removeUser(e,t,i){return this.httpController.delete(e,`/access/groups/${t.user_group_id}/members/${i.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,i){return this.httpController.delete(e,`/access/groups/${t.user_group_id}/roles/${i.role_id}`)}addRoleToGroup(e,t,i){return this.httpController.put(e,`/access/groups/${t.user_group_id}/roles/${i.role_id}`,{})}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var dAe=(n,o)=>o.name;function mAe(n,o){n&1&&(s(0,"mat-error"),d(1,"Username is required"),l())}function pAe(n,o){n&1&&(s(0,"mat-error"),d(1,"Username is incorrect"),l())}function uAe(n,o){n&1&&(s(0,"mat-error"),d(1,"User with this username exists"),l())}function hAe(n,o){n&1&&(s(0,"mat-error"),d(1,"Email is required"),l())}function fAe(n,o){n&1&&(s(0,"mat-error"),d(1,"Email must include a valid domain (e.g., user@example.com)"),l())}function gAe(n,o){n&1&&(s(0,"mat-error"),d(1,"A password between 6 and 100 characters is required."),l())}function _Ae(n,o){n&1&&(s(0,"mat-error"),d(1,"Password and Confirm password must be the same."),l())}function vAe(n,o){if(n&1&&(s(0,"mat-option",18),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e.name," ")}}function CAe(n,o){if(n&1){let e=z();s(0,"mat-chip",22),_("removed",function(){let i=k(e).$implicit,r=v();return T(r.deleteGroup(i))}),d(1),s(2,"button",23)(3,"mat-icon"),d(4,"cancel"),l()()()}if(n&2){let e=o.$implicit;m(),ee(" ",e.name," ")}}var LM=(()=>{class n{dialogRef=f(Ie);userService=f(Fr);toasterService=f(ie);groupService=f(Bl);cd=f(X);addUserForm;controller;hidePassword=!0;hideConfirmPassword=!0;groups=[];groupsToAdd=new Set([]);autocompleteControl=new $e;filteredGroups;autocompleteTrigger;constructor(){}ngOnInit(){this.addUserForm=new Ho({username:new $e(null,[je.required,je.minLength(3),je.pattern("[a-zA-Z0-9_-]+$")],[FM(this.controller,this.userService)]),full_name:new $e,email:new $e(null,[je.email,je.pattern(/^[^\s@]+@[^\s@]+\.[^\s@]+$/),je.required],[RM(this.controller,this.userService)]),password:new $e(null,[je.required,je.minLength(6),je.maxLength(100)]),confirmPassword:new $e(null,[je.minLength(6),je.maxLength(100),je.required]),is_active:new $e(!0)},{validators:[PM]}),this.groupService.getGroups(this.controller).subscribe({next:e=>{this.groups=e,this.filteredGroups=this.autocompleteControl.valueChanges.pipe(gi(""),Bt(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(i=>i.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:i=>{this.toasterService.success(`User ${i.username} added`),t.forEach(r=>{this.groupService.addMemberToGroup(this.controller,r,i).subscribe({next:()=>{this.toasterService.success(`user ${i.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:i=>{let r=i.error?.message||i.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,i){if(t&1&&In(So,5),t&2){let r;mt(r=pt())&&(i.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,i){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),I(9,mAe,2,0,"mat-error"),I(10,pAe,2,0,"mat-error"),I(11,uAe,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),I(20,hAe,2,0,"mat-error"),I(21,fAe,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),_("click",function(){return i.hidePassword=!i.hidePassword}),d(28),l(),I(29,gAe,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),_("click",function(){return i.hideConfirmPassword=!i.hideConfirmPassword}),d(35),l(),I(36,_Ae,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),_("click",function(){return i.openGroupPanel()}),l(),s(47,"mat-autocomplete",17,1),_("optionSelected",function(a){return i.selectedGroup(a.option.value)}),K(49,vAe,2,2,"mat-option",18,Oe),nn(51,"async"),l()(),s(52,"mat-chip-set"),K(53,CAe,5,1,"mat-chip",null,dAe),l()(),s(55,"div",19)(56,"button",20),_("click",function(){return i.onCancelClick()}),d(57,"Cancel"),l(),s(58,"button",21),_("click",function(){return i.onAddClick()}),d(59," Add user "),l()()()),t&2){let r=ke(48);m(2),C("formGroup",i.addUserForm),m(7),A(i.form.username!=null&&i.form.username.touched&&(i.form.username!=null&&i.form.username.errors)&&(i.form.username!=null&&i.form.username.errors.required)?9:-1),m(),A(i.form.username!=null&&i.form.username.errors&&(i.form.username!=null&&i.form.username.errors.pattern)?10:-1),m(),A(i.form.username!=null&&i.form.username.errors&&(i.form.username!=null&&i.form.username.errors.userExists)?11:-1),m(9),A(i.form.email!=null&&i.form.email.touched&&(i.form.email!=null&&i.form.email.errors)&&(i.form.email!=null&&i.form.email.errors.required)?20:-1),m(),A(i.form.email!=null&&i.form.email.errors&&(i.form.email!=null&&i.form.email.errors.email)?21:-1),m(5),C("type",i.hidePassword?"password":"text"),m(2),B(i.hidePassword?"visibility_off":"visibility"),m(),A(i.form.password!=null&&i.form.password.touched&&(i.form.password!=null&&i.form.password.errors)?29:-1),m(4),C("type",i.hideConfirmPassword?"password":"text"),m(2),B(i.hideConfirmPassword?"visibility_off":"visibility"),m(),A(i.form.confirmPassword!=null&&i.form.confirmPassword.touched&&(i.form.confirmPassword!=null&&i.form.confirmPassword.errors)?36:-1),m(9),C("matAutocomplete",r)("formControl",i.autocompleteControl),m(2),C("displayWith",i.displayFn),m(2),Y($n(51,16,i.filteredGroups)),m(4),Y(i.groupsToAdd),m(5),C("disabled",!i.addUserForm.valid)}},dependencies:[ne,Et,rt,Nt,Dt,ot,Ys,Ft,Vt,ve,Le,Ve,St,G,pe,oe,de,ht,oi,ei,hi,bP,we,Me,Xe,ni,Ti,Se,Te,Lt,qt,yr,qr,lr,Dr,ft,So,Gr],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 xAe=(n,o)=>o.username;function bAe(n,o){if(n&1&&(s(0,"li"),d(1),l()),n&2){let e=o.$implicit;m(),mi("",e.username,"",e.full_name?" ("+e.full_name+")":"")}}var Jv=(()=>{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)(at(Ct))};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,i){t&1&&(s(0,"h1",0),d(1,"Are you sure you want to delete the following users ?"),l(),s(2,"ul"),K(3,bAe,2,2,"li",null,xAe),l(),s(5,"div",1)(6,"button",2),_("click",function(){return i.onCancel()}),d(7,"No, cancel"),l(),s(8,"button",3),_("click",function(){return i.onDelete()}),d(9," Yes, delete! "),l()()),t&2&&(m(3),Y(i.data.users))},dependencies:[ne,ve,Le,Ve,G,pe],encapsulation:2,changeDetection:0})}return n})();var e$=(()=>{class n{transform(e,t){return e?t?(t=t.toLowerCase(),e.data.filter(i=>i.username&&i.username.toLowerCase().includes(t)||i.full_name&&i.full_name.toLowerCase().includes(t)||i.email&&i.email.toLowerCase().includes(t))):e:[]}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Br({name:"userFilter",type:n,pure:!0})}return n})();var bp=(()=>{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=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var zl=(()=>{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,i){return this.httpController.put(e,`/access/roles/${t}/privileges/${i}`,void 0)}removePrivileges(e,t,i){return this.httpController.delete(e,`/access/roles/${t}/privileges/${i}`)}static \u0275fac=function(t){return new(t||n)(ge(mn))};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var SAe=(n,o)=>o.user_group_id;function wAe(n,o){n&1&&(s(0,"mat-error"),d(1,"Username is required"),l())}function MAe(n,o){n&1&&(s(0,"mat-error"),d(1,"Username is incorrect"),l())}function kAe(n,o){n&1&&(s(0,"mat-error"),d(1,"User with this username exists"),l())}function TAe(n,o){n&1&&(s(0,"mat-error"),d(1,"Email is required"),l())}function EAe(n,o){n&1&&(s(0,"mat-error"),d(1,"Email is invalid"),l())}function DAe(n,o){n&1&&(s(0,"mat-error"),d(1,"User with this email exists"),l())}function PAe(n,o){n&1&&(s(0,"p",21),d(1,"Loading..."),l())}function IAe(n,o){n&1&&(s(0,"p",22),d(1,"User is not member of any group"),l())}function AAe(n,o){if(n&1&&(s(0,"li")(1,"span",26),d(2),l()()),n&2){let e=o.$implicit;m(2),B(e.name)}}function OAe(n,o){if(n&1&&(s(0,"ul"),K(1,AAe,3,1,"li",null,SAe),l()),n&2){let e=v();m(),Y(e.groups)}}function NAe(n,o){n&1&&(s(0,"p",21),d(1,"Loading..."),l())}function FAe(n,o){n&1&&(s(0,"p",22),d(1,"No ACEs found for this user"),l())}function RAe(n,o){n&1&&(s(0,"th",35),d(1,"Endpoint"),l())}function LAe(n,o){if(n&1&&(s(0,"td",36),d(1),l()),n&2){let e=o.$implicit;m(),B(e.endpoint_name)}}function VAe(n,o){n&1&&(s(0,"th",35),d(1,"Role"),l())}function BAe(n,o){if(n&1&&(s(0,"td",36),d(1),l()),n&2){let e=o.$implicit;m(),B(e.role_name)}}function zAe(n,o){n&1&&(s(0,"th",35),d(1,"Propagate"),l())}function jAe(n,o){if(n&1&&(s(0,"td",36),d(1),l()),n&2){let e=o.$implicit;m(),B(e.propagate)}}function $Ae(n,o){n&1&&(s(0,"th",35),d(1,"Allowed"),l())}function HAe(n,o){if(n&1&&(s(0,"td",36),d(1),l()),n&2){let e=o.$implicit;m(),B(e.allowed)}}function UAe(n,o){n&1&&R(0,"tr",37)}function WAe(n,o){n&1&&R(0,"tr",38)}function GAe(n,o){if(n&1&&(s(0,"table",23),Fe(1,27),Ce(2,RAe,2,0,"th",28)(3,LAe,2,1,"td",29),Re(),Fe(4,30),Ce(5,VAe,2,0,"th",28)(6,BAe,2,1,"td",29),Re(),Fe(7,31),Ce(8,zAe,2,0,"th",28)(9,jAe,2,1,"td",29),Re(),Fe(10,32),Ce(11,$Ae,2,0,"th",28)(12,HAe,2,1,"td",29),Re(),Ce(13,UAe,1,0,"tr",33)(14,WAe,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 VM=(()=>{class n{data;dialogRef=f(Ie);userService=f(Fr);toasterService=f(ie);aclService=f(bp);roleService=f(zl);dialog=f(it);cd=f(X);editUserForm;groups=[];aces=[];aceDatasource=new _r;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 Ho({username:new $e(this.user.username,[je.required,je.minLength(3),je.pattern("[a-zA-Z0-9_-]+$")],[FM(this.controller,this.userService,this.user.username)]),full_name:new $e(this.user.full_name),email:new $e(this.user.email,[je.email,je.required],[RM(this.controller,this.userService,this.user.email)]),is_active:new $e(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(){Yi({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:i})=>{this.aces=i.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 Ye(Z({},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 i=t.error?.message||t.message||"Failed to update user";this.toasterService.error(i),this.cd.markForCheck()}})}getUpdatedValues(){let e={};return Object.keys(this.editUserForm.controls).forEach(t=>{let i=this.editUserForm.get(t);i.dirty&&i.value!==this.user[t]&&(e[t]=i.value)}),e}onChangePassword(){this.dialog.open(Pg,{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)(at(Ct))};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,i){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),I(15,wAe,2,0,"mat-error"),I(16,MAe,2,0,"mat-error"),I(17,kAe,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),I(27,TAe,2,0,"mat-error"),I(28,EAe,2,0,"mat-error"),I(29,DAe,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),I(68,PAe,2,0,"p",21)(69,IAe,2,0,"p",22)(70,OAe,3,0,"ul"),l()(),s(71,"section",2)(72,"h3",3),d(73,"ACEs"),l(),I(74,NAe,2,0,"p",21)(75,FAe,2,0,"p",22)(76,GAe,15,3,"table",23),l()()(),s(77,"mat-dialog-actions")(78,"button",24),_("click",function(){return i.onChangePassword()}),d(79,"Change Password"),l(),s(80,"button",24),_("click",function(){return i.onCancel()}),d(81,"Cancel"),l(),s(82,"button",25),_("click",function(){return i.onSaveChanges()}),d(83," Save changes "),l()()),t&2&&(m(),ee("User ",i.user.username),m(8),C("formGroup",i.editUserForm),m(6),A(i.form.username!=null&&i.form.username.touched&&(i.form.username!=null&&i.form.username.errors)&&(i.form.username!=null&&i.form.username.errors.required)?15:-1),m(),A(i.form.username!=null&&i.form.username.errors&&(i.form.username!=null&&i.form.username.errors.pattern)?16:-1),m(),A(i.form.username!=null&&i.form.username.errors&&(i.form.username!=null&&i.form.username.errors.userExists)?17:-1),m(10),A(i.form.email!=null&&i.form.email.touched&&(i.form.email!=null&&i.form.email.errors)&&(i.form.email!=null&&i.form.email.errors.required)?27:-1),m(),A(i.form.email!=null&&i.form.email.errors&&(i.form.email!=null&&i.form.email.errors.email)?28:-1),m(),A(i.form.email!=null&&i.form.email.errors&&(i.form.email!=null&&i.form.email.errors.emailExists)?29:-1),m(14),B(i.user.is_superadmin?"YES":"NO"),m(5),B(i.user.created_at),m(5),B(i.user.updated_at),m(5),B(i.user.last_login||"Never"),m(5),B(i.user.user_id),m(5),A(i.groupsLoaded?i.groups.length===0?69:70:68),m(6),A(i.acesLoaded?i.aces.length===0?75:76:74),m(8),C("disabled",!i.editUserForm.valid))},dependencies:[ne,Je,rt,Nt,Dt,ot,Et,Ft,Vt,dt,ve,Le,Ve,St,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,G,pe,oe,we,Me,Xe,ni,Se,Te,Lt,qt,kt,On,fl,jc,zc],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 qAe=["usersPaginator"],QAe=["usersSort"],XAe=()=>[5,10,20];function KAe(n,o){if(n&1){let e=z();s(0,"mat-header-cell",32)(1,"mat-checkbox",33),_("change",function(i){k(e);let r=v(2);return T(i?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 YAe(n,o){if(n&1){let e=z();s(0,"mat-cell",32)(1,"mat-checkbox",34),_("click",function(i){return i.stopPropagation()})("change",function(i){let r=k(e).$implicit,a=v(2);return T(i?a.selection.toggle(r):null)}),l()()}if(n&2){let e=o.$implicit,t=v(2);m(),C("checked",t.selection.isSelected(e))}}function ZAe(n,o){n&1&&(s(0,"mat-header-cell",35),d(1,"Username"),l())}function JAe(n,o){if(n&1){let e=z();s(0,"mat-cell")(1,"span",36),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.openUserDetailDialog(i))}),d(2),l()()}if(n&2){let e=o.$implicit;m(2),B(e.username)}}function eOe(n,o){n&1&&(s(0,"mat-header-cell",35),d(1,"Full Name"),l())}function tOe(n,o){if(n&1&&(s(0,"mat-cell")(1,"span",37),d(2),l()()),n&2){let e=o.$implicit;m(2),B(e.full_name)}}function nOe(n,o){n&1&&(s(0,"mat-header-cell",35),d(1,"Mail"),l())}function iOe(n,o){if(n&1&&(s(0,"mat-cell")(1,"span",37),d(2),l()()),n&2){let e=o.$implicit;m(2),B(e.email)}}function oOe(n,o){n&1&&(s(0,"mat-header-cell",38),d(1,"Active"),l())}function rOe(n,o){if(n&1&&(s(0,"mat-cell",39),d(1),l()),n&2){let e=o.$implicit;m(),B(e.is_active)}}function aOe(n,o){n&1&&(s(0,"mat-header-cell",35),d(1,"Last Login"),l())}function sOe(n,o){if(n&1&&(s(0,"mat-cell")(1,"span",37),d(2),l()()),n&2){let e=o.$implicit;m(2),B(e.last_login)}}function lOe(n,o){n&1&&(s(0,"mat-header-cell",35),d(1,"Last Update"),l())}function cOe(n,o){if(n&1&&(s(0,"mat-cell")(1,"span",37),d(2),l()()),n&2){let e=o.$implicit;m(2),B(e.updated_at?e.updated_at:e.created_at)}}function dOe(n,o){n&1&&(s(0,"mat-header-cell"),d(1,"Actions"),l())}function mOe(n,o){if(n&1){let e=z();s(0,"mat-cell",40)(1,"button",41),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.openUserDetailDialog(i))}),s(2,"mat-icon"),d(3,"edit"),l()(),s(4,"button",42),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.openAiProfileDialog(i))}),s(5,"mat-icon"),d(6,"psychology"),l()()()}}function pOe(n,o){n&1&&R(0,"mat-header-row")}function uOe(n,o){n&1&&R(0,"mat-row")}function hOe(n,o){if(n&1){let e=z();s(0,"header",3)(1,"h1",4),d(2,"Users"),l(),s(3,"div",5)(4,"button",6),_("click",function(){k(e);let i=v();return T(i.deleteMultiple())}),d(5," Delete Users "),l(),s(6,"button",7),_("click",function(){k(e);let i=v();return T(i.addUser())}),d(7,"Add User"),l()()(),s(8,"form",8)(9,"mat-form-field",9)(10,"input",10),_("input",function(i){k(e);let r=v();return T(r.searchText.set(i.target.value))}),l()()(),s(11,"div",11)(12,"mat-table",12,0),nn(14,"userFilter"),Fe(15,13),Ce(16,KAe,2,2,"mat-header-cell",14)(17,YAe,2,1,"mat-cell",15),Re(),Fe(18,16),Ce(19,ZAe,2,0,"mat-header-cell",17)(20,JAe,3,1,"mat-cell",18),Re(),Fe(21,19),Ce(22,eOe,2,0,"mat-header-cell",17)(23,tOe,3,1,"mat-cell",18),Re(),Fe(24,20),Ce(25,nOe,2,0,"mat-header-cell",17)(26,iOe,3,1,"mat-cell",18),Re(),Fe(27,21),Ce(28,oOe,2,0,"mat-header-cell",22)(29,rOe,2,1,"mat-cell",23),Re(),Fe(30,24),Ce(31,aOe,2,0,"mat-header-cell",17)(32,sOe,3,1,"mat-cell",18),Re(),Fe(33,25),Ce(34,lOe,2,0,"mat-header-cell",17)(35,cOe,3,1,"mat-cell",18),Re(),Fe(36,26),Ce(37,dOe,2,0,"mat-header-cell",27)(38,mOe,7,0,"mat-cell",28),Re(),Ce(39,pOe,1,0,"mat-header-row",29)(40,uOe,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",sa(14,6,e.dataSource,e.searchText())),m(27),C("matHeaderRowDef",e.displayedColumns),m(),C("matRowDefColumns",e.displayedColumns),m(),C("pageSizeOptions",Tt(9,XAe))}}function fOe(n,o){n&1&&(s(0,"div",2),R(1,"mat-spinner",43),l())}var BM=(()=>{class n{route=f(lt);userService=f(Fr);progressService=f(io);controllerService=f(nt);dialog=f(it);toasterService=f(ie);location=f(uC);cd=f(X);controller;dataSource=new _r;displayedColumns=["select","username","full_name","email","is_active","last_login","updated_at","actions"];selection=new Ra(!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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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(LM,{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(Jv,{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:i=>{let r=i.error?.message||i.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(Jv,{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:i=>{let r=i.error?.message||i.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 i={user:t,controller:this.controller};this.dialog.open(VM,{panelClass:["base-dialog-panel","configurator-dialog-panel"],data:i,disableClose:!1}).afterClosed().subscribe(()=>{this.refresh()})},error:t=>{let i=t.error?.message||t.message||"Failed to load user data";this.toasterService.error(i),this.cd.markForCheck()}})}openAiProfileDialog(e){let t={user:e,controller:this.controller};this.dialog.open(AM,{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,i){if(t&1&&In(qAe,5)(QAe,5),t&2){let r;mt(r=pt())&&(i.usersPaginator=r),mt(r=pt())&&(i.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,i){t&1&&I(0,hOe,43,10)(1,fOe,2,0,"div",2),t&2&&A(i.isReady?0:1)},dependencies:[ne,Je,rt,ot,Gn,dt,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,Lt,qt,we,Me,Se,Te,G,pe,ze,oe,de,Cr,pr,po,Nr,ve,dn,qn,e$],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 Og=(()=>{class n{uploadEvents=new We;cancelRequests=new We;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=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var t$=(()=>{class n{http;imageService;imageUploadSessionService;toasterService;queue=[];activeUploads=new Set;activeUploadSizes=new Map;activeCountSource=new tn(0);activeCount$=this.activeCountSource.asObservable();constructor(e,t,i,r){this.http=e,this.imageService=t,this.imageUploadSessionService=i,this.toasterService=r,this.imageUploadSessionService.cancelRequests$.subscribe(a=>{this.cancelUploadByTempId(a)})}queueFile(e,t,i){let r=`img-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,a={tempId:r,file:t,controller:e,installAppliance:i,cancel$:new We,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(i=>i.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),i={};e.controller.authToken&&!e.controller.tokenExpired&&(i.Authorization=`Bearer ${e.controller.authToken}`);let r=new l4("POST",t,e.file,{headers:new gC(i),reportProgress:!0});this.http.request(r).pipe(Ge(e.cancel$)).subscribe({next:a=>{if(a.type===Xu.UploadProgress)e.progress=a.total?Math.round(100*a.loaded/a.total):0,this.emitEvent(e),this.updateActiveCount();else if(a.type===Xu.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(),i=e.filter(r=>r.file.size<=t);return i.length?i.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(),i=e.file.size,r=this.getInFlightBytesBudget(),a=this.getPendingTasks(),c=a.length?a.reduce((h,g)=>h+g.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+i<=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)),i=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,i*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(),i=this.getAverageKnownSize(),r=e.memoryGiB*1024*1024*1024*.18,a=i*t*1.5,p=Math.max(r,a)*this.getNetworkMultiplier(e.effectiveType);return Math.max(i,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),i=[...e,...t];return i.length?Math.round(i.reduce((r,a)=>r+a,0)/i.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(Ks),ge(Wc),ge(Og),ge(ie))};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function _Oe(n,o){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),_("change",function(i){k(e);let r=v();return T(r.selectInstallApplianceOption(i))}),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),_("click",function(){k(e);let i=v();return T(i.closeDialog())}),d(10,"Cancel"),l(),s(11,"button",6),_("click",function(){k(e);let i=v();return T(i.isInstallAppliance=!i.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 vOe(n,o){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),_("change",function(i){k(e);let r=v();return T(r.onFilesSelected(i))}),l()(),s(9,"mat-dialog-actions",4)(10,"button",5),_("click",function(){k(e);let i=v();return T(i.isInstallAppliance=!1)}),d(11,"Back"),l(),s(12,"button",6),_("click",function(){k(e);let i=ke(8);return T(i.click())}),d(13,"Browse"),l()()}}var zM=(()=>{class n{controller;dialogRef;backgroundUploadService=f(t$);toasterService=f(ie);cd=f(X);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 i=t.files.length;for(let a=0;a<i;a++)this.backgroundUploadService.queueFile(this.controller,t.files[a],this.install_appliance);t.value="";let r=i===1?"1 file":`${i} 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)(at(Ct),at(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,i){t&1&&(I(0,_Oe,13,5),I(1,vOe,14,0)),t&2&&(A(i.isInstallAppliance?-1:0),m(),A(i.isInstallAppliance?1:-1))},dependencies:[ne,ve,Le,Ve,St,G,pe,oe,de,oo,yo,fo],encapsulation:2,changeDetection:0})}return n})();function COe(n,o){if(n&1&&(s(0,"li",5),d(1),l()),n&2){let e=o.$implicit,t=o.$index;m(),mi("",t+1,". ",e==null?null:e.filename)}}function xOe(n,o){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),K(6,COe,2,2,"li",5,Ni),l()(),s(8,"mat-dialog-actions",6)(9,"button",7),_("click",function(){k(e);let i=v();return T(i.deleteAll())}),d(10,"Delete"),l(),s(11,"button",8),d(12,"Cancel"),l()()}if(n&2){let e=v();m(6),Y(e.deleteData==null?null:e.deleteData.deleteFilesPaths)}}function bOe(n,o){n&1&&(s(0,"h1",9),d(1,"Please wait."),l(),s(2,"mat-dialog-content",10),R(3,"mat-spinner",11),l())}function yOe(n,o){if(n&1&&d(0),n&2){let e=v(),t=e.$implicit,i=e.$index;mi(" ",i+1,". ",t==null||t.error==null?null:t.error.message," ")}}function SOe(n,o){if(n&1&&(s(0,"li",5),I(1,yOe,1,2),l()),n&2){let e=o.$implicit;Ae("delete-files__list-item--error",e==null||e.error==null?null:e.error.message),m(),A(e!==null?1:-1)}}function wOe(n,o){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),K(3,SOe,2,3,"li",15,Ni),l()),n&2){let e=v(2);m(3),Y(e.deleteFliesDetails)}}function MOe(n,o){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 kOe(n,o){if(n&1){let e=z();s(0,"mat-dialog-content",2),I(1,wOe,5,0),I(2,MOe,2,1,"h5",12),l(),s(3,"mat-dialog-actions",6)(4,"button",13),_("click",function(){k(e);let i=v();return T(i.dialogRef.close(!1))}),d(5,"Close"),l()()}if(n&2){let e=v();m(),A(e.deleteFliesDetails.length>0?1:-1),m(),A(e.fileNotDeleted.length>0?2:-1)}}var jM=(()=>{class n{deleteData;dialogRef;imageService=f(Wc);toasterService=f(ie);cd=f(X);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(uo(i=>Nn(i))))}),Yi(e).subscribe({next:t=>{this.deleteFliesDetails=t.filter(i=>i!==null),this.fileNotDeleted=t.filter(i=>i===null),this.isUsedFiles=!0,this.isDelete=!0,this.cd.markForCheck()},error:t=>{let i=t.error?.message||t.message||"Failed to delete files";this.toasterService.error(i),this.cd.markForCheck()}})}static \u0275fac=function(t){return new(t||n)(at(Ct),at(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,i){t&1&&(s(0,"div",0),I(1,xOe,13,0),I(2,bOe,4,0),I(3,kOe,6,2),l()),t&2&&(m(),A(!i.isDelete&&!i.isUsedFiles?1:-1),m(),A(i.isDelete&&!i.isUsedFiles?2:-1),m(),A(i.isDelete&&i.isUsedFiles?3:-1))},dependencies:[ne,ve,vc,Le,Ve,St,G,pe,dn,qn],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 $M=class{dataChange=new tn([]);get data(){return this.dataChange.value}addImages(o){this.dataChange.next(o)}},HM=class extends ud{controllerDatabase;sort;paginator;filterChange=new tn("");constructor(o,e,t){super(),this.controllerDatabase=o,this.sort=e,this.paginator=t}setFilter(o){this.filterChange.next((o||"").trim().toLowerCase())}connect(){let o=this.sort?this.sort.sortChange:new tn(null),e=this.paginator?this.paginator.page:new tn(null);return Wn(this.controllerDatabase.dataChange,o,this.filterChange,e).pipe(Bt(()=>{let t=this.controllerDatabase.data.slice(),i=this.filterChange.value;if(i&&(t=t.filter(r=>[r.filename,r.image_type,r.image_size,r.created_at,r.uploadStatus].map(c=>String(c||"").toLowerCase()).join(" ").includes(i))),!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(o,e){let t=o[e];if(e==="image_size")return Number(t||0);if(e==="created_at"||e==="updated_at"){let i=Date.parse(String(t||""));return isNaN(i)?0:i}return String(t||"").toLowerCase()}disconnect(){}};function TOe(n,o){if(n&1){let e=z();s(0,"mat-header-cell")(1,"mat-checkbox",28),_("change",function(i){k(e);let r=v();return T(i?r.selectAllImages():null)}),l()()}if(n&2){let e=v();m(),C("checked",e.hasSelection()&&e.isAllSelected())("indeterminate",e.hasSelection()&&!e.isAllSelected())}}function EOe(n,o){if(n&1){let e=z();s(0,"mat-cell")(1,"mat-checkbox",29),_("click",function(i){let r=k(e).$implicit,a=v();return T(a.onRowCheckboxClick(i,r))}),l()()}if(n&2){let e=o.$implicit,t=v();m(),C("checked",t.isRowSelected(e))("disabled",!t.isPersistedRow(e))}}function DOe(n,o){n&1&&(s(0,"mat-header-cell",30),d(1," File Name "),l())}function POe(n,o){if(n&1&&(s(0,"span"),d(1),l()),n&2){let e=v(2).$implicit;m(),ee(" - ",e.errorMessage)}}function IOe(n,o){if(n&1&&(s(0,"div",33),R(1,"mat-progress-bar",34),s(2,"span",35),d(3),nn(4,"titlecase"),I(5,POe,2,1,"span"),l()()),n&2){let e=v().$implicit;m(),C("value",e.uploadProgress||0),m(),Ae("image-manager__upload-error",e.uploadStatus==="error"),m(),mi(" ",$n(4,6,e.uploadStatus)," ",e.uploadProgress||0,"% "),m(2),A(e.errorMessage?5:-1)}}function AOe(n,o){if(n&1&&(s(0,"mat-cell")(1,"div",31)(2,"span",32),d(3),l(),I(4,IOe,6,8,"div",33),l()()),n&2){let e=o.$implicit,t=v();m(3),B(e.filename),m(),A(t.hasUploadState(e)?4:-1)}}function OOe(n,o){n&1&&(s(0,"mat-header-cell",30),d(1," Image Type "),l())}function NOe(n,o){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=o.$implicit;m(),ee(" ",e.image_type," ")}}function FOe(n,o){n&1&&(s(0,"mat-header-cell",30),d(1," Image Size "),l())}function ROe(n,o){if(n&1&&(s(0,"mat-cell"),d(1),l()),n&2){let e=o.$implicit,t=v();m(),ee(" ",t.formatImageSize(e)," ")}}function LOe(n,o){n&1&&(s(0,"mat-header-cell",30),d(1," Created "),l())}function VOe(n,o){if(n&1&&(s(0,"mat-cell"),d(1),nn(2,"date"),l()),n&2){let e=o.$implicit;m(),ee(" ",e.created_at?sa(2,1,e.created_at,"short"):"-"," ")}}function BOe(n,o){if(n&1){let e=z();s(0,"button",37),_("click",function(){k(e);let i=v(2);return T(i.deleteAllFiles())}),s(1,"mat-icon"),d(2,"delete"),l()()}}function zOe(n,o){if(n&1&&(s(0,"mat-header-cell"),I(1,BOe,3,0,"button",36),l()),n&2){let e=v();m(),A(e.hasSelection()&&e.isAllSelected()||e.selectedCount()>1?1:-1)}}function jOe(n,o){if(n&1){let e=z();s(0,"button",37),_("click",function(){k(e);let i=v().$implicit,r=v();return T(r.deleteFile(i.path))}),s(1,"mat-icon"),d(2,"delete"),l()()}}function $Oe(n,o){if(n&1){let e=z();s(0,"button",39),_("click",function(){k(e);let i=v().$implicit,r=v();return T(r.cancelUpload(i))}),s(1,"mat-icon"),d(2,"cancel"),l()()}}function HOe(n,o){if(n&1&&(s(0,"mat-cell"),I(1,jOe,3,0,"button",36),I(2,$Oe,3,0,"button",38),l()),n&2){let e=o.$implicit,t=v();m(),A(t.isPersistedRow(e)&&t.isRowSelected(e)?1:-1),m(),A(t.hasUploadState(e)&&(e.uploadStatus==="uploading"||e.uploadStatus==="queued")?2:-1)}}function UOe(n,o){n&1&&R(0,"mat-header-row")}function WOe(n,o){if(n&1){let e=z();s(0,"mat-row",40),_("click",function(i){let r=k(e).$implicit,a=v();return T(a.onRowCheckboxClick(i,r))}),l()}if(n&2){let e=o.$implicit,t=v();Ae("image-manager__row-highlight",t.isHighlighted(e))}}var UM=(()=>{class n{controller;controllerId;version;dataSource;imageDatabase=new $M;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=Q(["select","filename","image_type","image_size","created_at","delete"]);sort=Rt(po);paginator=Rt(Cr);imageService=f(Wc);route=f(lt);controllerService=f(nt);dialog=f(it);toasterService=f(ie);imageUploadSessionService=f(Og);router=f(_t);cd=f(X);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 HM(this.imageDatabase,e,t),this.dataRowsSubscription=this.dataSource.connect().subscribe(i=>{this.displayedRows=i||[]}),this.uploadEventsSubscription=this.imageUploadSessionService.events$.subscribe(i=>{this.onUploadEvent(i)}),this.route.queryParams.subscribe(i=>{i.highlight&&(this.flashRow(i.highlight),this.router.navigate([],{relativeTo:this.route,queryParams:{},replaceUrl:!0}))}),this.controllerService.get(this.controllerId).then(i=>{this.controller=i,i.authToken&&this.getImages()},i=>{let r=i.error?.message||i.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(Ud,{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(i=>{i&&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,i=e.size;return i===0?!1:t===i}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(Ud,{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:i=>{let r=i.error?.message||i.message||"Failed to install images";this.toasterService.error(r),this.cd.markForCheck()}})})}pruneImages(){this.dialog.open(Ud,{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:i=>{let r=i.error?.message||i.message||"Failed to prune images";this.toasterService.error(r),this.getImages(),this.unChecked(),this.cd.markForCheck()}})})}addImageDialog(){this.dialog.open(zM,{panelClass:["base-dialog-panel","add-image-dialog-panel"],autoFocus:!1,data:this.controller}).afterClosed().subscribe(t=>{this.getImages(),this.unChecked()})}deleteAllFiles(){this.dialog.open(jM,{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),i={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,Z(Z({},t||{}),i)),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(i=>Ye(Z({},i),{rowType:"image"})),t=Array.from(this.uploadRows.values());this.removeInvalidSelections(e),this.imageDatabase.addImages([...t,...e])}removeInvalidSelections(e){let t=new Set(e.map(i=>i.path).filter(i=>!!i));Array.from(this.selectedPaths).forEach(i=>{t.has(i)||this.selectedPaths.delete(i)}),this.lastSelectedPath&&!e.some(i=>i.path===this.lastSelectedPath)&&(this.lastSelectedPath=null)}syncUploadedRowsWithPersistedData(){let e=new Set(this.images.map(t=>t.filename));this.uploadRows.forEach((t,i)=>{t.uploadStatus==="uploaded"&&e.has(t.filename)&&this.uploadRows.delete(i)})}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,i){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,i)),!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,i){t&1&&Xt(i.sort,po,5)(i.paginator,Cr,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,i){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),_("click",function(){return i.installAllImages()}),s(9,"mat-icon"),d(10,"done_all"),l()(),s(11,"button",7),_("click",function(){return i.pruneImages()}),s(12,"mat-icon"),d(13,"delete"),l()(),s(14,"button",8),_("click",function(){return i.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),_("input",function(a){return i.onSearchChange(a.target.value)}),l()()(),s(23,"div",14)(24,"mat-table",15,0),Fe(26,16),Ce(27,TOe,2,2,"mat-header-cell",17)(28,EOe,2,2,"mat-cell",18),Re(),Fe(29,19),Ce(30,DOe,2,0,"mat-header-cell",20)(31,AOe,5,2,"mat-cell",18),Re(),Fe(32,21),Ce(33,OOe,2,0,"mat-header-cell",20)(34,NOe,2,1,"mat-cell",18),Re(),Fe(35,22),Ce(36,FOe,2,0,"mat-header-cell",20)(37,ROe,2,1,"mat-cell",18),Re(),Fe(38,23),Ce(39,LOe,2,0,"mat-header-cell",20)(40,VOe,3,4,"mat-cell",18),Re(),Fe(41,24),Ce(42,zOe,2,1,"mat-header-cell",17)(43,HOe,3,2,"mat-cell",18),Re(),Ce(44,UOe,1,0,"mat-header-row",25)(45,WOe,1,2,"mat-row",26),l(),R(46,"mat-paginator",27),l()()()),t&2&&(m(2),C("routerLink","/controller/"+i.controllerId+"/projects"),m(20),C("value",i.searchText()),m(2),C("dataSource",i.dataSource)("trackBy",i.trackByRow),m(20),C("matHeaderRowDef",i.displayedColumns())("matHeaderRowDefSticky",!0),m(),C("matRowDefColumns",i.displayedColumns()),m(),C("pageSizeOptions",i.pageSizeOptions))},dependencies:[ne,dt,vn,Je,rt,ot,Gn,ve,pr,po,Nr,hg,Cr,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,G,ze,oe,de,we,Me,ts,Se,Te,Lt,qt,gs,Hc,eo,ht,Mt,o4,hC],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 GOe=(n,o)=>o.route;function qOe(n,o){if(n&1&&(s(0,"a",7,1)(2,"mat-icon",9),d(3),l(),d(4),l()),n&2){let e=o.$implicit;C("routerLink",Hi("./",e.route)),m(3),B(e.icon),m(),ee(" ",e.label," ")}}var WM=(()=>{class n{route=f(lt);router=f(_t);controllerService=f(nt);toasterService=f(ie);cd=f(X);controller;links=Q([{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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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,i){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),K(8,qOe,5,4,"a",7,GOe),l()(),s(10,"section",8),R(11,"router-outlet"),l()),t&2){let r=ke(6);m(7),C("tabPanel",r),m(),Y(i.links())}},dependencies:[ne,dt,ih,vn,B4,ho,s5,c5,l5,oe,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 n$=(n,o)=>e=>Ca(500).pipe(Vn(()=>o.getGroups(n)),Bt(t=>t.find(i=>i.name===e.value)?{projectExist:!0}:null));var GM=(()=>{class n{get(e){return new RegExp(/[~`!#$%\^&*+=\[\]\\';,/{}|\\":<>\?]/).test(e.value)?{invalidName:!0}:null}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var XOe=(n,o)=>o.username;function KOe(n,o){n&1&&(s(0,"mat-error"),d(1,"Group name is required"),l())}function YOe(n,o){n&1&&(s(0,"mat-error"),d(1,"Group name is incorrect"),l())}function ZOe(n,o){n&1&&(s(0,"mat-error"),d(1,"Group with this name exists"),l())}function JOe(n,o){if(n&1&&(s(0,"mat-option",8),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),mi(" ",e.username," - ",e.email," ")}}function e4e(n,o){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),_("click",function(){let i=k(e).$implicit,r=v();return T(r.delUser(i))}),d(7,"delete"),l()()()}if(n&2){let e=o.$implicit;m(3),B(e.username),m(2),B(e.email)}}var qM=(()=>{class n{data;groupNameValidator;dialogRef=f(Ie);formBuilder=f(Bn);groupService=f(Bl);userService=f(Fr);toasterService=f(ie);cd=f(X);groupNameForm;controller;users=[];usersToAdd=new Set([]);filteredUsers;loading=!1;autocompleteControl=new $e;constructor(e,t){this.data=e,this.groupNameValidator=t}ngOnInit(){this.controller=this.data.controller,this.groupNameForm=this.formBuilder.group({groupName:new $e(null,[je.required,this.groupNameValidator.get],[n$(this.data.controller,this.groupService)])}),this.userService.list(this.controller).subscribe({next:e=>{this.users=e,this.filteredUsers=this.autocompleteControl.valueChanges.pipe(gi(""),Bt(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:i=>{t.forEach(r=>{this.groupService.addMemberToGroup(this.controller,i,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:i=>{let r=i.error?.message||i.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(i=>i.username.toLowerCase().includes(t)||i.email?.toLowerCase().includes(t))}}displayFn(e){return e&&e.username?e.username:""}static \u0275fac=function(t){return new(t||n)(at(Ct),at(GM))};static \u0275cmp=F({type:n,selectors:[["app-add-group-dialog"]],features:[fn([GM])],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,i){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),_("keydown",function(a){return i.onKeyDown(a)}),l(),I(8,KOe,2,0,"mat-error"),I(9,YOe,2,0,"mat-error"),I(10,ZOe,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),_("optionSelected",function(a){return i.selectedUser(a.option.value)}),K(19,JOe,2,3,"mat-option",8,Oe),nn(21,"async"),l()(),s(22,"div",9),K(23,e4e,8,2,"div",null,XOe),l()(),s(25,"div",10)(26,"button",11),_("click",function(){return i.onNoClick()}),d(27,"Cancel"),l(),s(28,"button",12),_("click",function(){return i.onAddClick()}),d(29,"Add group"),l()()()),t&2){let r=ke(18);m(2),C("formGroup",i.groupNameForm),m(6),A(i.form.groupName!=null&&i.form.groupName.touched&&(i.form.groupName!=null&&i.form.groupName.errors)&&(i.form.groupName!=null&&i.form.groupName.errors.required)?8:-1),m(),A(i.form.groupName!=null&&i.form.groupName.errors&&(i.form.groupName!=null&&i.form.groupName.errors.invalidName)?9:-1),m(),A(i.form.groupName!=null&&i.form.groupName.errors&&(i.form.groupName!=null&&i.form.groupName.errors.projectExist)?10:-1),m(6),C("matAutocomplete",r)("formControl",i.autocompleteControl),m(),C("displayWith",i.displayFn),m(2),Y($n(21,7,i.filteredUsers)),m(4),Y(i.usersToAdd)}},dependencies:[ne,Et,rt,Nt,Dt,ot,Ys,Ft,Vt,ve,Le,Ve,St,G,pe,we,Me,Xe,ni,Se,Te,lr,Dr,ft,So,oe,de,Gr],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 t4e=(n,o)=>o.name;function n4e(n,o){if(n&1&&(s(0,"li"),d(1),l()),n&2){let e=o.$implicit;m(),B(e.name)}}var QM=(()=>{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)(at(Ct))};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,i){t&1&&(s(0,"h1",0),d(1,"Are you sure you want to delete the following groups?"),l(),s(2,"ul"),K(3,n4e,2,1,"li",null,t4e),l(),s(5,"div",1)(6,"button",2),_("click",function(){return i.onCancel()}),d(7,"No, cancel"),l(),s(8,"button",3),_("click",function(){return i.onDelete()}),d(9," Yes, delete! "),l()()),t&2&&(m(3),Y(i.data.groups))},dependencies:[ne,ve,Le,Ve,G,pe],encapsulation:2,changeDetection:0})}return n})();var i$=(()=>{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=Br({name:"groupFilter",type:n,pure:!0})}return n})();var i4e=(n,o)=>o.username;function o4e(n,o){if(n&1){let e=z();s(0,"div",8)(1,"mat-checkbox",15),_("change",function(){let i=k(e).$implicit,r=v();return T(r.toggleUserSelection(i.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=o.$implicit,t=v();m(),C("checked",t.isUserSelected(e.user_id)),m(3),B(e.username),m(2),B(e.email)}}function r4e(n,o){n&1&&(s(0,"div",19)(1,"mat-icon"),d(2,"person_off"),l(),s(3,"p"),d(4,"No users found"),l()())}function a4e(n,o){n&1&&I(0,r4e,5,0,"div",19),n&2&&A(o.length===0?0:-1)}var XM=(()=>{class n{data;dialogRef=f(Ie);userService=f(Fr);groupService=f(Bl);toastService=f(ie);cd=f(X);users=new tn([]);displayedUsers=new tn([]);searchText=U("");loading=!1;selectedUserIds=Q(new Set);selectedCount=$t(()=>this.selectedUserIds().size);allSelected=$t(()=>{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(){Ca(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(){Yi([this.userService.list(this.data.controller),this.groupService.getGroupMember(this.data.controller,this.data.group.user_group_id)]).subscribe({next:e=>{let[t,i]=e,r=t.filter(a=>!i.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 i=new Set(t);return i.delete(e.user_id),i}),this.loading=!1,this.cd.markForCheck()},error:t=>{let i=t.error?.message||t.message||"Failed to add user to group";this.toastService.error(i),this.loading=!1,this.cd.markForCheck()}})}toggleUserSelection(e){this.selectedUserIds.update(t=>{let i=new Set(t);return i.has(e)?i.delete(e):i.add(e),i})}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 i=new Set(t);e.forEach(r=>i.add(r.user_id)),this.selectedUserIds.set(i)}}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(i=>e.has(i.user_id));this.loading=!0,Yi(t.map(i=>this.groupService.addMemberToGroup(this.data.controller,this.data.group,i))).subscribe({next:()=>{this.toastService.success(`${t.length} user(s) added to group`),this.dialogRef.close(!0)},error:i=>{let r=i.error?.message||i.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,i=this.displayedUsers.value;this.users.next(t.filter(r=>r.user_id!==e.user_id)),this.displayedUsers.next(i.filter(r=>r.user_id!==e.user_id))}static \u0275fac=function(t){return new(t||n)(at(Ct))};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,i){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),_("input",function(a){return i.searchText.set(a.target.value)})("keydown",function(){return i.onSearch()}),l(),s(9,"mat-icon",6),d(10,"search"),l()()(),s(11,"div",7),K(12,o4e,7,3,"div",8,i4e),nn(14,"async"),I(15,a4e,1,1),nn(16,"async"),l()(),s(17,"div",9)(18,"div",10)(19,"mat-checkbox",11),_("change",function(){return i.toggleSelectAll()}),d(20),l()(),s(21,"div",12)(22,"button",13),_("click",function(){return i.onClose()}),d(23,"Cancel"),l(),s(24,"button",14),_("click",function(){return i.addSelectedUsers()}),d(25),l()()()),t&2){let r;m(2),ee("Add User To Group: ",i.data.group.name),m(6),C("value",i.searchText()),m(4),Y($n(14,8,i.displayedUsers)),m(3),A((r=$n(16,10,i.displayedUsers))?15:-1,r),m(4),C("checked",i.allSelected())("indeterminate",i.selectedCount()>0&&!i.allSelected()),m(),ee(" Select All (",i.selectedCount(),") "),m(4),C("disabled",i.selectedCount()===0||i.loading),m(),ee(" Add Selected (",i.selectedCount(),") ")}},dependencies:[ne,Je,ve,we,Me,Xe,ts,Se,Te,oe,de,dn,G,pe,Lt,qt,Gr],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 KM=(()=>{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)(at(Ct))};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,i){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),_("click",function(){return i.onCancel()}),d(10,"Cancel"),l(),s(11,"button",3),_("click",function(){return i.onConfirm()}),d(12,"Remove"),l()()),t&2&&(m(6),B(i.data.name))},dependencies:[ve,Le,Ve,St,G,pe],encapsulation:2,changeDetection:0})}return n})();var s4e=(n,o)=>o.user_id;function l4e(n,o){n&1&&(s(0,"p",24),d(1,"No members in this group"),l())}function c4e(n,o){if(n&1){let e=z();s(0,"li")(1,"span",27),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.openUserDetailDialog(i))}),d(2),l(),s(3,"button",28),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.openRemoveUserDialog(i))}),s(4,"mat-icon"),d(5,"delete"),l()()()}if(n&2){let e=o.$implicit;m(2),B(e.username)}}function d4e(n,o){if(n&1&&(s(0,"ul"),K(1,c4e,6,1,"li",null,s4e),l()),n&2){let e=v();m(),Y(e.filteredMembers())}}function m4e(n,o){n&1&&(s(0,"p",24),d(1,"No ACEs configured for this group"),l())}function p4e(n,o){n&1&&(s(0,"th",37),d(1,"Endpoint"),l())}function u4e(n,o){if(n&1&&(s(0,"td",38),d(1),l()),n&2){let e=o.$implicit;m(),B(e.endpoint_name)}}function h4e(n,o){n&1&&(s(0,"th",37),d(1,"Role"),l())}function f4e(n,o){if(n&1&&(s(0,"td",38),d(1),l()),n&2){let e=o.$implicit;m(),B(e.role_name)}}function g4e(n,o){n&1&&(s(0,"th",37),d(1,"Propagate"),l())}function _4e(n,o){if(n&1&&(s(0,"td",38),d(1),l()),n&2){let e=o.$implicit;m(),B(e.propagate)}}function v4e(n,o){n&1&&(s(0,"th",37),d(1,"Allowed"),l())}function C4e(n,o){if(n&1&&(s(0,"td",38),d(1),l()),n&2){let e=o.$implicit;m(),B(e.allowed)}}function x4e(n,o){n&1&&R(0,"tr",39)}function b4e(n,o){n&1&&R(0,"tr",40)}function y4e(n,o){if(n&1&&(s(0,"table",25),Fe(1,29),Ce(2,p4e,2,0,"th",30)(3,u4e,2,1,"td",31),Re(),Fe(4,32),Ce(5,h4e,2,0,"th",30)(6,f4e,2,1,"td",31),Re(),Fe(7,33),Ce(8,g4e,2,0,"th",30)(9,_4e,2,1,"td",31),Re(),Fe(10,34),Ce(11,v4e,2,0,"th",30)(12,C4e,2,1,"td",31),Re(),Ce(13,x4e,1,0,"tr",35)(14,b4e,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 o$=(()=>{class n{data;dialogRef=f(Ie);dialog=f(it);groupService=f(Bl);aclService=f(bp);roleService=f(zl);toastService=f(ie);cd=f(X);group;controller;editGroupForm;members=Q([]);aces=[];aceDatasource=new _r;aceDisplayedColumns=["endpoint","role","propagate","allowed"];searchMembers=U("");filteredMembers=$t(()=>{let e=this.searchMembers().toLowerCase(),t=this.members();return e?t.filter(i=>i.username.toLowerCase().includes(e)):t});constructor(e){this.data=e,this.group=e.group,this.controller=e.controller}ngOnInit(){this.editGroupForm=new Ho({groupname:new $e(this.group.name,[je.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,i)=>t.username.toLowerCase().localeCompare(i.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:i=>{let r=i.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 Ye(Z({},a),{endpoint_name:c?.name||a.path,role_name:p?.name||"Unknown"})}),this.aceDatasource.data=this.aces,this.cd.markForCheck()},error:i=>{let r=i.error?.message||i.message||"Failed to load ACEs";this.toastService.error(r),this.cd.markForCheck()}})},error:t=>{let i=t.error?.message||t.message||"Failed to load endpoints";this.toastService.error(i),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=Ye(Z({},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 i=t.error?.message||t.message||"Failed to update group";this.toastService.error(i),this.cd.markForCheck()}})}onClose(){this.dialogRef.close()}openAddUserDialog(){this.dialog.open(XM,{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(KM,{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:i=>{let r=i.error?.message||i.message||"Failed to remove user";this.toastService.error(r),this.cd.markForCheck()}})})}openUserDetailDialog(e){this.dialog.open(VM,{panelClass:["base-dialog-panel","configurator-dialog-panel"],data:{user:e,controller:this.controller}})}static \u0275fac=function(t){return new(t||n)(at(Ct))};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,i){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),_("click",function(){return i.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),_("click",function(){return i.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),_("input",function(a){return i.searchMembers.set(a.target.value)}),l()()(),s(55,"div",23),I(56,l4e,2,0,"p",24)(57,d4e,3,0,"ul"),l()()()(),s(58,"section",2)(59,"h3",3),d(60,"ACEs"),l(),s(61,"mat-card",4)(62,"mat-card-content"),I(63,m4e,2,0,"p",24)(64,y4e,15,3,"table",25),l()()()()(),s(65,"mat-dialog-actions")(66,"button",26),_("click",function(){return i.onClose()}),d(67,"Close"),l()()),t&2&&(m(),ee("Group ",i.group.name),m(8),C("formGroup",i.editGroupForm),m(6),C("checked",i.group.is_builtin),m(3),C("disabled",!i.editGroupForm.valid||i.group.is_builtin),m(12),B(i.group.created_at),m(5),B(i.group.updated_at),m(5),B(i.group.user_group_id),m(14),C("value",i.searchMembers()),m(2),A(i.members().length===0?56:57),m(7),A(i.aces.length===0?63:64))},dependencies:[ne,Je,rt,Nt,Dt,ot,Et,Ft,Vt,ve,Le,Ve,St,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,G,pe,ze,oe,de,we,Me,Xe,Se,Te,Lt,qt,kt,On,tb,fl,jc,zc,gt,ht,Mt],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 S4e(n,o){n&1&&(s(0,"div",8),R(1,"mat-spinner",10),s(2,"p"),d(3,"Loading..."),l()())}function w4e(n,o){n&1&&(s(0,"th",24),d(1,"Name"),l())}function M4e(n,o){if(n&1&&(s(0,"td",25)(1,"span",26),d(2),l()()),n&2){let e=o.$implicit;m(2),B(e.name)}}function k4e(n,o){n&1&&(s(0,"th",24),d(1,"API Domain"),l())}function T4e(n,o){if(n&1&&(s(0,"td",25)(1,"span",27),d(2),l()()),n&2){let e=o.$implicit,t=v(3);m(2),B(t.getProviderDisplay(e))}}function E4e(n,o){n&1&&(s(0,"th",24),d(1,"Model"),l())}function D4e(n,o){if(n&1&&(s(0,"td",25)(1,"span",28),d(2),l()()),n&2){let e=o.$implicit;m(2),B(e.config.model)}}function P4e(n,o){n&1&&(s(0,"th",24),d(1,"Context Limit"),l())}function I4e(n,o){if(n&1&&(s(0,"span",30),d(1),l()),n&2){let e=v().$implicit;m(),ee(" ",e.config.context_strategy," ")}}function A4e(n,o){if(n&1&&(s(0,"td",25)(1,"span",29),d(2),l(),I(3,I4e,2,1,"span",30),l()),n&2){let e=o.$implicit;m(2),ee("",e.config.context_limit,"K"),m(),A(e.config.context_strategy?3:-1)}}function O4e(n,o){n&1&&(s(0,"th",24),d(1,"Actions"),l())}function N4e(n,o){if(n&1){let e=z();s(0,"td",25)(1,"div",31)(2,"button",32),nn(3,"async"),_("click",function(){let i=k(e).$implicit,r=v(3);return T(r.toggleDefaultConfig(i))}),s(4,"mat-icon"),d(5,"check_circle"),l()(),s(6,"button",33),_("click",function(){let i=k(e).$implicit,r=v(3);return T(r.openEditDialog(i))}),s(7,"mat-icon"),d(8,"edit"),l()(),s(9,"button",34),_("click",function(){let i=k(e).$implicit,r=v(3);return T(r.deleteConfig(i))}),s(10,"mat-icon"),d(11,"delete"),l()()()()}if(n&2){let e,t=o.$implicit,i=v(3);m(2),Ae("active-btn",i.isDefault(t)),C("disabled",(e=$n(3,4,i.settingDefault$))==null?null:e.has(t.config_id))("matTooltip",i.isDefault(t)?"Remove as default":"Set as default")}}function F4e(n,o){n&1&&R(0,"tr",35)}function R4e(n,o){if(n&1&&R(0,"tr",36),n&2){let e=o.$implicit,t=v(3);Ae("active-row",t.isDefault(e))}}function L4e(n,o){if(n&1&&(s(0,"div",12)(1,"table",14),Fe(2,15),Ce(3,w4e,2,0,"th",16)(4,M4e,3,1,"td",17),Re(),Fe(5,18),Ce(6,k4e,2,0,"th",16)(7,T4e,3,1,"td",17),Re(),Fe(8,19),Ce(9,E4e,2,0,"th",16)(10,D4e,3,1,"td",17),Re(),Fe(11,20),Ce(12,P4e,2,0,"th",16)(13,A4e,4,2,"td",17),Re(),Fe(14,21),Ce(15,O4e,2,0,"th",16)(16,N4e,12,6,"td",17),Re(),Ce(17,F4e,1,0,"tr",22)(18,R4e,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 V4e(n,o){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 B4e(n,o){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"),I(6,L4e,19,3,"div",12),I(7,V4e,7,0,"div",13),l()()()),n&2){let e=v();m(6),A(e.configs.length>0?6:-1),m(),A(e.configs.length===0?7:-1)}}var YM=(()=>{class n{destroy$=new We;controller=ae(void 0);group=ae(void 0);loading$=new tn(!1);settingDefault$=new tn(new Set);error$=new tn(null);configs$=new tn([]);defaultConfig$=new tn(null);configs=[];defaultConfig=null;settingDefaultConfigs=new Set;displayedColumns=Q(["name","provider","model","context_limit","actions"]);aiProfilesService=f(xg);dialog=f(it);snackBar=f(br);constructor(){}ngOnInit(){this.loadConfigs(),Lr([this.configs$,this.defaultConfig$]).pipe(Ge(this.destroy$)).subscribe(([e,t])=>{this.configs=e,this.defaultConfig=t}),this.error$.pipe(Ge(this.destroy$),ci(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(Ge(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(xp,{panelClass:["base-dialog-panel","ai-profile-dialog-panel"],data:{mode:"create",config:null,existingNames:this.configs.map(t=>t.name)}}).afterClosed().pipe(Ge(this.destroy$)).subscribe(t=>{t&&this.createConfig(t)})}openEditDialog(e){this.dialog.open(xp,{panelClass:["base-dialog-panel","ai-profile-dialog-panel"],data:{mode:"edit",config:Z({},e),existingNames:this.configs.filter(i=>i.config_id!==e.config_id).map(i=>i.name)}}).afterClosed().pipe(Ge(this.destroy$)).subscribe(i=>{i&&this.updateConfig(e.config_id,i)})}createConfig(e){this.loading$.next(!0),this.aiProfilesService.createGroupConfig(this.controller(),this.group().user_group_id,e).pipe(Ge(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(Ge(this.destroy$)).subscribe({next:()=>{this.loadConfigs(),this.showSuccess("Configuration updated successfully")},error:i=>{i.status===409?this.handleConflict(i):this.handleError(i,"Failed to update configuration")}})}deleteConfig(e){this.dialog.open(Ig,{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(Ge(this.destroy$)).subscribe(i=>{i&&(this.loading$.next(!0),this.aiProfilesService.deleteGroupConfig(this.controller(),this.group().user_group_id,e.config_id).pipe(Ge(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 i=e.is_default,r=this.defaultConfig,a=[...this.configs],c=a.map(p=>Ye(Z({},p),{is_default:i?!1:p.config_id===t}));this.configs=c,this.configs$.next(c),this.defaultConfig=i?null:e,this.defaultConfig$.next(i?null:e),this.settingDefaultConfigs.add(t),this.settingDefault$.next(new Set(this.settingDefaultConfigs)),i?this.aiProfilesService.unsetDefaultGroupConfig(this.controller(),this.group().user_group_id,t).pipe(Ge(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(Ge(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(Ge(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 i=e.error?.message||e.message||t;this.error$.next(i),this.loading$.next(!1),this.showError(i)}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,i){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),nn(11,"async"),_("click",function(){return i.loadConfigs()}),s(12,"mat-icon"),d(13,"refresh"),l(),d(14," Refresh "),l(),s(15,"button",7),_("click",function(){return i.openCreateDialog()}),s(16,"mat-icon"),d(17,"add"),l(),d(18," New Configuration "),l()()(),I(19,S4e,4,0,"div",8),nn(20,"async"),I(21,B4e,8,2,"div",9),nn(22,"async"),l()),t&2&&(m(10),C("disabled",$n(11,3,i.loading$)),m(9),A($n(20,5,i.loading$)?19:-1),m(2),A($n(22,7,i.loading$)?-1:21))},dependencies:[ne,ve,ns,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,G,pe,ze,oe,de,we,Se,gt,Lt,kt,On,fl,jc,zc,dn,qn,Gr],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 r$=(()=>{class n{dialogRef=f(Ie);data=f(Ct);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,i){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),_("click",function(){return i.close()}),d(6,"Close"),l()()),t&2&&(m(),ee("AI Profiles - ",i.data.group.name),m(2),C("controller",i.data.controller)("group",i.data.group))},dependencies:[ne,ve,Le,Ve,St,G,pe,oe,YM],styles:[".group-ai-profile-dialog__content[_ngcontent-%COMP%]{padding:16px 0}"],changeDetection:0})}return n})();var z4e=["groupsPaginator"],j4e=["groupsSort"],$4e=()=>[5,10,20];function H4e(n,o){if(n&1){let e=z();s(0,"th",28)(1,"mat-checkbox",29),_("change",function(i){k(e);let r=v(2);return T(i?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 U4e(n,o){if(n&1){let e=z();s(0,"td",30)(1,"mat-checkbox",31),_("click",function(i){return i.stopPropagation()})("change",function(i){let r=k(e).$implicit,a=v(2);return T(i?a.selection.toggle(r):null)}),l()()}if(n&2){let e=o.$implicit,t=v(2);m(),C("checked",t.selection.isSelected(e))}}function W4e(n,o){n&1&&(s(0,"th",32),d(1,"Name"),l())}function G4e(n,o){if(n&1){let e=z();s(0,"td",33)(1,"span",34),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.openGroupDetailDialog(i))}),d(2),l()()}if(n&2){let e=o.$implicit;m(2),ee(" ",e.name," ")}}function q4e(n,o){n&1&&(s(0,"th",32),d(1,"Creation date"),l())}function Q4e(n,o){if(n&1&&(s(0,"td",33),d(1),l()),n&2){let e=o.$implicit;m(),B(e.created_at)}}function X4e(n,o){n&1&&(s(0,"th",32),d(1,"Last update"),l())}function K4e(n,o){if(n&1&&(s(0,"td",33),d(1),l()),n&2){let e=o.$implicit;m(),B(e.updated_at)}}function Y4e(n,o){n&1&&(s(0,"th",32),d(1,"Built-in"),l())}function Z4e(n,o){if(n&1&&(s(0,"td",33),d(1),l()),n&2){let e=o.$implicit;m(),B(e.is_builtin)}}function J4e(n,o){n&1&&(s(0,"th",35),d(1,"Actions"),l())}function e5e(n,o){if(n&1){let e=z();s(0,"td",36)(1,"button",37),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.openGroupDetailDialog(i))}),s(2,"mat-icon"),d(3,"edit"),l()(),s(4,"button",38),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.openGroupAiProfileDialog(i))}),s(5,"mat-icon"),d(6,"psychology"),l()()()}}function t5e(n,o){n&1&&R(0,"tr",39)}function n5e(n,o){n&1&&R(0,"tr",40)}function i5e(n,o){if(n&1){let e=z();s(0,"header",3)(1,"h1",4),d(2,"Groups"),l(),s(3,"div",5)(4,"button",6),_("click",function(){k(e);let i=v();return T(i.onDelete(i.selection.selected))}),d(5," Delete Selected "),l(),s(6,"button",7),_("click",function(){k(e);let i=v();return T(i.addGroup())}),d(7,"Add Group"),l()()(),s(8,"form",8)(9,"mat-form-field",9)(10,"input",10),_("input",function(i){k(e);let r=v();return T(r.searchText.set(i.target.value))}),l()()(),s(11,"div",11)(12,"table",12,0),nn(14,"groupFilter"),Fe(15,13),Ce(16,H4e,2,2,"th",14)(17,U4e,2,1,"td",15),Re(),Fe(18,16),Ce(19,W4e,2,0,"th",17)(20,G4e,3,1,"td",18),Re(),Fe(21,19),Ce(22,q4e,2,0,"th",17)(23,Q4e,2,1,"td",18),Re(),Fe(24,20),Ce(25,X4e,2,0,"th",17)(26,K4e,2,1,"td",18),Re(),Fe(27,21),Ce(28,Y4e,2,0,"th",17)(29,Z4e,2,1,"td",18),Re(),Fe(30,22),Ce(31,J4e,2,0,"th",23)(32,e5e,7,0,"td",24),Re(),Ce(33,t5e,1,0,"tr",25)(34,n5e,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",sa(14,6,e.dataSource,e.searchText())),m(21),C("matHeaderRowDef",e.displayedColumns()),m(),C("matRowDefColumns",e.displayedColumns()),m(),C("pageSizeOptions",Tt(9,$4e))}}function o5e(n,o){n&1&&(s(0,"div",2),R(1,"mat-spinner",41),l())}var ZM=(()=>{class n{route=f(lt);controllerService=f(nt);toasterService=f(ie);cd=f(X);groupService=f(Bl);dialog=f(it);controller;groupsPaginator;groupsSort;displayedColumns=Q(["select","name","created_at","updated_at","is_builtin","actions"]);selection=new Ra(!0,[]);groups;dataSource=new _r;searchText=U("");isReady=Q(!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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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(qM,{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(QM,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{groups:e}}).afterClosed().subscribe(t=>{if(t){let i=e.map(r=>this.groupService.delete(this.controller,r.user_group_id));Yi(i).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(o$,{panelClass:["base-dialog-panel","configurator-dialog-panel"],data:{group:e,controller:this.controller},maxWidth:"90vw"})}openGroupAiProfileDialog(e){this.dialog.open(r$,{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,i){if(t&1&&In(z4e,5)(j4e,5),t&2){let r;mt(r=pt())&&(i.groupsPaginator=r),mt(r=pt())&&(i.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,i){t&1&&I(0,i5e,37,10)(1,o5e,2,0,"div",2),t&2&&A(i.isReady()?0:1)},dependencies:[ne,Je,rt,ot,Gn,dt,pr,po,Nr,ve,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,Cr,Lt,qt,G,pe,ze,oe,de,we,Me,Se,Te,kt,i$],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 r5e(n,o){n&1&&(s(0,"mat-error"),d(1,"Role name is required"),l())}function a5e(n,o){n&1&&(s(0,"mat-error"),d(1,"Role name is incorrect"),l())}var JM=(()=>{class n{data;dialogRef=f(Ie);formBuilder=f(Bn);cd=f(X);roleNameForm;constructor(e){this.data=e}ngOnInit(){this.roleNameForm=this.formBuilder.group({name:new $e,description:new $e}),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)(at(Ct))};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,i){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),I(8,r5e,2,0,"mat-error"),I(9,a5e,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),_("click",function(){return i.onNoClick()}),d(16,"Cancel"),l(),s(17,"button",8),_("click",function(){return i.onAddClick()}),d(18,"Add Role"),l()()()),t&2&&(m(2),C("formGroup",i.roleNameForm),m(6),A(i.form.name!=null&&i.form.name.touched&&(i.form.name!=null&&i.form.name.errors)&&(i.form.name!=null&&i.form.name.errors.required)?8:-1),m(),A(i.form.name!=null&&i.form.name.errors&&(i.form.name!=null&&i.form.name.errors.invalidName)?9:-1))},dependencies:[ne,Et,rt,Nt,Dt,ot,Ft,Vt,ve,Le,Ve,St,G,pe,we,Me,Xe,ni,Se,Te],styles:[".full-width-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var s5e=(n,o)=>o.name;function l5e(n,o){if(n&1&&(s(0,"li"),d(1),l()),n&2){let e=o.$implicit;m(),B(e.name)}}var ek=(()=>{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)(at(Ct))};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,i){t&1&&(s(0,"h1",0),d(1,"Are you sure you want to delete the following roles?"),l(),s(2,"ul"),K(3,l5e,2,1,"li",null,s5e),l(),s(5,"div",1)(6,"button",2),_("click",function(){return i.onCancel()}),d(7,"No, cancel"),l(),s(8,"button",3),_("click",function(){return i.onDelete()}),d(9," Yes, delete! "),l()()),t&2&&(m(3),Y(i.data.roles))},dependencies:[ne,ve,Le,Ve,G,pe],encapsulation:2,changeDetection:0})}return n})();var a$=(()=>{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=Br({name:"roleFilter",type:n,pure:!0})}return n})();var c5e=["rolesPaginator"],d5e=["rolesSort"],m5e=()=>[5,10,20],p5e=(n,o)=>["/controller",n,"management","roles",o];function u5e(n,o){if(n&1){let e=z();s(0,"mat-header-cell",23)(1,"mat-checkbox",24),_("change",function(i){k(e);let r=v(2);return T(i?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 h5e(n,o){if(n&1){let e=z();s(0,"mat-cell",23)(1,"mat-checkbox",25),_("click",function(i){return i.stopPropagation()})("change",function(i){let r=k(e).$implicit,a=v(2);return T(i?a.selection.toggle(r):null)}),l()()}if(n&2){let e=o.$implicit,t=v(2);m(),C("checked",t.selection.isSelected(e))}}function f5e(n,o){n&1&&(s(0,"mat-header-cell",26),d(1,"Name"),l())}function g5e(n,o){if(n&1&&(s(0,"mat-cell")(1,"a",27),d(2),l()()),n&2){let e=o.$implicit,t=v(2);m(),C("routerLink",aa(2,p5e,t.controller.id,e.role_id)),m(),ee(" ",e.name," ")}}function _5e(n,o){n&1&&(s(0,"mat-header-cell",26),d(1,"Description"),l())}function v5e(n,o){if(n&1&&(s(0,"mat-cell")(1,"span",28),d(2),l()()),n&2){let e=o.$implicit;m(2),B(e.description)}}function C5e(n,o){n&1&&R(0,"mat-header-row")}function x5e(n,o){n&1&&R(0,"mat-row")}function b5e(n,o){if(n&1){let e=z();s(0,"header",3)(1,"h1",4),d(2,"Roles"),l(),s(3,"div",5)(4,"button",6),_("click",function(){k(e);let i=v();return T(i.onDelete(i.selection.selected))}),d(5," Delete roles "),l(),s(6,"button",7),_("click",function(){k(e);let i=v();return T(i.addRole())}),d(7,"Add Role"),l()()(),s(8,"form",8)(9,"mat-form-field",9)(10,"input",10),_("input",function(i){k(e);let r=v();return T(r.searchText.set(i.target.value))}),l()()(),s(11,"div",11)(12,"mat-table",12,0),nn(14,"roleFilter"),Fe(15,13),Ce(16,u5e,2,2,"mat-header-cell",14)(17,h5e,2,1,"mat-cell",15),Re(),Fe(18,16),Ce(19,f5e,2,0,"mat-header-cell",17)(20,g5e,3,5,"mat-cell",18),Re(),Fe(21,19),Ce(22,_5e,2,0,"mat-header-cell",17)(23,v5e,3,1,"mat-cell",18),Re(),Ce(24,C5e,1,0,"mat-header-row",20)(25,x5e,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",sa(14,6,e.dataSource,e.searchText())),m(12),C("matHeaderRowDef",e.displayedColumns),m(),C("matRowDefColumns",e.displayedColumns),m(),C("pageSizeOptions",Tt(9,m5e))}}function y5e(n,o){n&1&&(s(0,"div",2),R(1,"mat-spinner",29),l())}var tk=(()=>{class n{route=f(lt);router=f(_t);roleService=f(zl);progressService=f(io);controllerService=f(nt);dialog=f(it);toasterService=f(ie);cd=f(X);controller;dataSource=new _r;displayedColumns=["select","name","description"];selection=new Ra(!0,[]);searchText=U("");rolesPaginator;rolesSort;isReady=Q(!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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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(JM,{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:i=>{let r=i.error?.message||i.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(ek,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{roles:e}}).afterClosed().subscribe(t=>{if(t){let i=e.map(r=>this.roleService.delete(this.controller,r.role_id));Yi(i).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,i){if(t&1&&In(c5e,5)(d5e,5),t&2){let r;mt(r=pt())&&(i.rolesPaginator=r),mt(r=pt())&&(i.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,i){t&1&&I(0,b5e,28,10)(1,y5e,2,0,"div",2),t&2&&A(i.isReady()?0:1)},dependencies:[ne,Je,rt,ot,Gn,dt,vn,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,Cr,pr,po,Nr,Lt,qt,G,pe,oe,we,Me,Se,Te,ve,dn,qn,a$],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 s$=(()=>{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=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var eC=class{ownedPrivileges;change={add:new Set,delete:new Set};constructor(o){this.ownedPrivileges=o}add(o){this.change.delete.has(o)&&this.change.delete.delete(o),!this.ownedPrivileges.includes(o)&&this.change.add.add(o)}delete(o){this.change.add.has(o)&&this.change.add.delete(o),this.ownedPrivileges.includes(o)&&this.change.delete.add(o)}isAdded(o){return this.change.add.has(o)}isDeleted(o){return this.change.delete.has(o)}get(){return{add:Array.from(this.change.add),delete:Array.from(this.change.delete)}}};var l$=(()=>{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 i=[];for(let[r,a]of Object.entries(t))i.push({key:r,values:a});return i}}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Br({name:"groupPrivileges",type:n,pure:!0})}return n})();var S5e=(n,o)=>o.key,c$=(n,o)=>o.privilege.privilege_id;function w5e(n,o){if(n&1){let e=z();s(0,"button",7),_("click",function(){k(e);let i=v(2);return T(i.editMode=!0)}),s(1,"mat-icon"),d(2,"edit"),l()()}}function M5e(n,o){if(n&1){let e=z();s(0,"button",8),_("click",function(){k(e);let i=v(2);return T(i.editMode=!1)}),d(1,"Cancel"),l(),s(2,"button",9),_("click",function(){k(e);let i=v(2);return T(i.close())}),d(3,"Update"),l()}}function k5e(n,o){if(n&1&&(I(0,w5e,3,0,"button",6),I(1,M5e,4,0)),n&2){let e=v();A(e.editMode?-1:0),m(),A(e.editMode?1:-1)}}function T5e(n,o){if(n&1&&(s(0,"mat-icon",15),d(1,"info"),l()),n&2){let e=v().$implicit;C("matTooltip",e.privilege.description)}}function E5e(n,o){if(n&1){let e=z();s(0,"div",13)(1,"mat-checkbox",14),_("change",function(i){let r=k(e).$implicit,a=v(4);return T(a.onPrivilegeChange(i.checked,r.privilege))}),l(),s(2,"span"),d(3),l(),I(4,T5e,2,1,"mat-icon",15),l()}if(n&2){let e=o.$implicit,t=v(4);m(),C("checked",t.ownedPrivilegesList().includes(e.privilege.privilege_id)),m(),Ae("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(),A(e.privilege.description?4:-1)}}function D5e(n,o){if(n&1&&(s(0,"div",10)(1,"div",11),d(2),l(),s(3,"div",12),K(4,E5e,5,7,"div",13,c$),l()()),n&2){let e=v().$implicit;m(2),ee("",e.key,":"),m(2),Y(e.values)}}function P5e(n,o){if(n&1&&(s(0,"span",13),d(1),l()),n&2){let e=v().$implicit;m(),ee(" ",e.verb," ")}}function I5e(n,o){if(n&1&&I(0,P5e,2,1,"span",13),n&2){let e=o.$implicit,t=v(5);A(t.ownedPrivilegesList().includes(e.privilege.privilege_id)?0:-1)}}function A5e(n,o){if(n&1&&(s(0,"div",10)(1,"div",11),d(2),l(),s(3,"div",12),K(4,I5e,1,1,null,null,c$),l()()),n&2){let e=v(2).$implicit;m(2),ee("",e.key,":"),m(2),Y(e.values)}}function O5e(n,o){if(n&1&&I(0,A5e,6,1,"div",10),n&2){let e=v().$implicit,t=v(2);A(t.ownedPrivilegesName().includes(e.key)?0:-1)}}function N5e(n,o){if(n&1&&I(0,D5e,6,1,"div",10)(1,O5e,1,1),n&2){let e=v(2);A(e.editMode?0:1)}}function F5e(n,o){if(n&1&&(s(0,"div",5),K(1,N5e,2,1,null,null,S5e),nn(3,"groupPrivileges"),l()),n&2){let e=v();m(),Y($n(3,0,e.privileges()))}}var nk=(()=>{class n{disable=ae(!0);privileges=ae([]);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 _e;ownedPrivilegesName=Q([]);ownedPrivilegesList=Q([]);changer=new eC([]);editModeState=Q(!1);collapsedState=Q(!0);get editMode(){return this.editModeState()}set editMode(e){e&&(this.changer=new eC(this.ownedPrivilegesList())),this.editModeState.set(e)}get collapsed(){return this.collapsedState()}toggleCollapsed(){this.collapsedState.set(!this.collapsedState())}constructor(){}onPrivilegeChange(e,t){let i=t.privilege_id;e?this.changer.add(i):this.changer.delete(i)}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,i){t&1&&(s(0,"div",0)(1,"div",1),_("click",function(){return i.collapsed&&i.toggleCollapsed()}),s(2,"h3",2),d(3,"Privileges"),l(),s(4,"div",3)(5,"button",4),_("click",function(){return i.toggleCollapsed()}),s(6,"mat-icon"),d(7),l()(),I(8,k5e,2,2),l()(),I(9,F5e,4,2,"div",5),l()),t&2&&(m(),Ae("privileges__header--clickable",i.collapsed),m(4),C("matTooltip",i.collapsed?"Expand":"Collapse"),m(2),B(i.collapsed?"expand_more":"expand_less"),m(),A(i.disable()?-1:8),m(),A(i.collapsed?-1:9))},dependencies:[ne,G,pe,ze,oe,de,Lt,qt,ht,Mt,l$],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 R5e=n=>["/controller",n,"management","roles"];function L5e(n,o){if(n&1&&(s(0,"div",10)(1,"div",21)(2,"span",22),d(3,"Role name"),l(),s(4,"span",23),d(5),nn(6,"async"),l()(),s(7,"div",21)(8,"span",22),d(9,"Description"),l(),s(10,"span",23),d(11),nn(12,"async"),l()()()),n&2){let e,t,i=v();m(5),B((e=$n(6,2,i.$role))==null?null:e.name),m(6),B(((t=$n(12,4,i.$role))==null?null:t.description)||"-")}}function V5e(n,o){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 ik=(()=>{class n{roleService=f(zl);toastService=f(ie);route=f(lt);privilegeService=f(s$);fb=f(PC);cd=f(X);controller;$role=new tn({role_id:"",description:"",updated_at:"",is_builtin:!1,privileges:[],name:"",created_at:""});editRoleForm;$ownedPrivilegesId=this.$role.pipe(Bt(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 i=t.error?.message||t.message||"Failed to load role";this.toastService.error(i),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 i=t.error?.message||t.message||"Failed to load role after update";this.toastService.error(i),this.cd.markForCheck()}})},error:t=>{let i=t.error?.message||t.message||"Failed to update role";this.toastService.error(i),this.cd.markForCheck()}})}onPrivilegesUpdate(e){let t=[];for(let i of e.add)t.push(this.roleService.setPrivileges(this.controller,this.roleId,i));for(let i of e.delete)t.push(this.roleService.removePrivileges(this.controller,this.roleId,i));Yi(t).subscribe({next:()=>{this.roleService.getById(this.controller,this.roleId).subscribe({next:i=>this.$role.next(i),error:i=>{let r=i.error?.message||i.message||"Failed to load role after privilege update";this.toastService.error(r),this.cd.markForCheck()}})},error:i=>{let r=i.error?.message||i.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,i){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),nn(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"),I(17,L5e,13,6,"div",10),nn(18,"async"),YO(19,V5e,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),nn(26,"async"),l()(),s(27,"div",13)(28,"span",14),d(29,"Last update"),l(),s(30,"span",15),d(31),nn(32,"async"),l()(),s(33,"div",16)(34,"span",14),d(35,"UUID"),l(),s(36,"span",17),d(37),nn(38,"async"),l()(),s(39,"div",13)(40,"span",14),d(41,"Is built-in"),l(),s(42,"span",15),d(43),nn(44,"async"),l()()()(),s(45,"mat-card-actions",18)(46,"button",19),nn(47,"async"),nn(48,"async"),_("click",function(){return i.onUpdate()}),d(49," Update Role "),l()()()(),s(50,"section",8)(51,"app-privilege",20),nn(52,"async"),nn(53,"async"),nn(54,"async"),_("update",function(a){return i.onPrivilegesUpdate(a)}),l()()()()()),t&2){let r,a,c,p,u,h,g,y;m(3),C("routerLink",un(33,R5e,i.controller.id)),m(4),ee("Role ",(r=$n(8,11,i.$role))==null?null:r.name),m(10),A((a=$n(18,13,i.$role))!=null&&a.is_builtin?17:19),m(8),B((c=$n(26,15,i.$role))==null?null:c.created_at),m(6),B((p=$n(32,17,i.$role))==null?null:p.updated_at),m(6),B((u=$n(38,19,i.$role))==null?null:u.role_id),m(6),B((h=$n(44,21,i.$role))!=null&&h.is_builtin?"YES":"NO"),m(3),C("disabled",!$n(47,23,i.editRoleForm.valueChanges)&&i.editRoleForm.valid||((g=$n(48,25,i.$role))==null?null:g.is_builtin)),m(5),C("disable",(y=$n(52,27,i.$role))==null?null:y.is_builtin)("ownedPrivilege",$n(53,29,i.$ownedPrivilegesId))("privileges",$n(54,31,i.privileges))}},dependencies:[ne,Et,rt,Nt,Dt,ot,Ft,Vt,dt,vn,kt,On,tb,fl,jc,zc,we,Me,Xe,Se,Te,G,pe,ze,oe,de,ht,Mt,nk,Gr],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 d$=(()=>{class n{controllerService;roleService;constructor(e,t){this.controllerService=e,this.roleService=t}resolve(e,t){let i=e.paramMap.get("controller_id"),r=e.paramMap.get("role_id");return Wu(this.controllerService.get(+i)).pipe(Vn(a=>this.roleService.getById(a,r)),uo(a=>$o(()=>a)))}static \u0275fac=function(t){return new(t||n)(ge(nt),ge(zl))};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var PO=class{dataNodes;expansionModel=new Ra(!0);trackBy;getLevel;isExpandable;getChildren;toggle(o){this.expansionModel.toggle(this._trackByValue(o))}expand(o){this.expansionModel.select(this._trackByValue(o))}collapse(o){this.expansionModel.deselect(this._trackByValue(o))}isExpanded(o){return this.expansionModel.isSelected(this._trackByValue(o))}toggleDescendants(o){this.expansionModel.isSelected(this._trackByValue(o))?this.collapseDescendants(o):this.expandDescendants(o)}collapseAll(){this.expansionModel.clear()}expandDescendants(o){let e=[o];e.push(...this.getDescendants(o)),this.expansionModel.select(...e.map(t=>this._trackByValue(t)))}collapseDescendants(o){let e=[o];e.push(...this.getDescendants(o)),this.expansionModel.deselect(...e.map(t=>this._trackByValue(t)))}_trackByValue(o){return this.trackBy?this.trackBy(o):o}};var ok=class extends PO{getChildren;options;constructor(o,e){super(),this.getChildren=o,this.options=e,this.options&&(this.trackBy=this.options.trackBy),this.options?.isExpandable&&(this.isExpandable=this.options.isExpandable)}expandAll(){this.expansionModel.clear();let o=this.dataNodes.reduce((e,t)=>[...e,...this.getDescendants(t),t],[]);this.expansionModel.select(...o.map(e=>this._trackByValue(e)))}getDescendants(o){let e=[];return this._getDescendants(e,o),e.splice(1)}_getDescendants(o,e){o.push(e);let t=this.getChildren(e);Array.isArray(t)?t.forEach(i=>this._getDescendants(o,i)):jg(t)&&t.pipe(Fo(1),ci(Boolean)).subscribe(i=>{for(let r of i)this._getDescendants(o,r)})}},AO=new cn("CDK_TREE_NODE_OUTLET_NODE"),Ng=(()=>{class n{viewContainer=f(ro);_node=f(AO,{optional:!0});constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["","cdkTreeNodeOutlet",""]]})}return n})(),IO=class{$implicit;level;index;count;constructor(o){this.$implicit=o}},rk=(()=>{class n{template=f(Ro);when;constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275dir=vt({type:n,selectors:[["","cdkTreeNodeDef",""]],inputs:{when:[0,"cdkTreeNodeDefWhen","when"]}})}return n})();function m$(){return Error("Could not find a tree control, levelAccessor, or childrenAccessor for the tree.")}var tC=(()=>{class n{_differs=f(pd);_changeDetectorRef=f(X);_elementRef=f(Jt);_dir=f(es);_onDestroy=new We;_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 tn({start:0,end:Number.MAX_VALUE});_expansionModel;_flattenedNodes=new tn([]);_nodeType=new tn(null);_nodes=new tn(new Map);_keyManagerNodes=new tn([]);_keyManagerFactory=f(O4);_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 Ra(!0),this._expansionModel)}_subscribeToDataChanges(){if(this._dataSubscription)return;let e;Yu(this._dataSource)?e=this._dataSource.connect(this):jg(this._dataSource)?e=this._dataSource:Array.isArray(this._dataSource)&&(e=Nn(this._dataSource)),e&&(this._dataSubscription=this._getRenderData(e).pipe(Ge(this._onDestroy)).subscribe(t=>{this._renderDataChanges(t)}))}_getRenderData(e){let t=this._getExpansionModel();return Lr([e,this._nodeType,t.changed.pipe(gi(null),yi(i=>{this._emitExpansionChanges(i)}))]).pipe(Vn(([i,r])=>r===null?Nn({renderNodes:i,flattenedNodes:null,nodeType:r}):this._computeRenderingData(i,r).pipe(Bt(a=>Ye(Z({},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 i of e.added)t.get(i)?._emitExpansionState(!0);for(let i of e.removed)t.get(i)?._emitExpansionState(!1)}_initializeKeyManager(){let e=Lr([this._keyManagerNodes,this._nodes]).pipe(Bt(([i,r])=>i.reduce((a,c)=>{let p=r.get(this._getExpansionKey(c));return p&&a.push(p),a},[]))),t={trackBy:i=>this._getExpansionKey(i.data),skipPredicate:i=>!!i.isDisabled,typeAheadDebounceInterval:!0,horizontalOrientation:this._dir.value};this._keyManager=this._keyManagerFactory(e,t)}_initializeDataDiffer(){let e=this.trackBy??((t,i)=>this._getExpansionKey(i));this._dataDiffer=this._differs.find([]).create(e)}_checkTreeControlUsage(){}renderNodeChanges(e,t=this._dataDiffer,i=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,i,r);else if(u==null)i.remove(p);else{let h=i.get(p);i.move(h,u)}}),a?.forEachIdentityChange(c=>{let p=c.item;if(c.currentIndex!=null){let u=i.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 i=this._nodeDefs.find(r=>r.when&&r.when(t,e))||this._defaultNodeDef;return i}insertNode(e,t,i,r){let a=this._getLevelAccessor(),c=this._getNodeDef(e,t),p=this._getExpansionKey(e),u=new IO(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),(i||this._nodeOutlet.viewContainer).createEmbeddedView(c.template,u,t),Fg.mostRecentTreeNode&&(Fg.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(Fo(1),Ge(this._onDestroy)).subscribe(i=>{t.select(...i.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(Fo(1),Ge(this._onDestroy)).subscribe(i=>{t.deselect(...i.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(),i=this._expansionModel??this.treeControl?.expansionModel;if(!i)return Nn([]);let r=this._getExpansionKey(e),a=i.changed.pipe(Vn(p=>p.added.includes(r)?Nn(!0):p.removed.includes(r)?Nn(!1):Uu),gi(this.isExpanded(e)));if(t)return Lr([a,this._flattenedNodes]).pipe(Bt(([p,u])=>p?this._findChildrenByLevel(t,u,e,1):[]));let c=this._getChildrenAccessor();if(c)return OC(c(e)??[]);throw m$()}_findChildrenByLevel(e,t,i,r){let a=this._getExpansionKey(i),c=t.findIndex(g=>this._getExpansionKey(g)===a),p=e(i),u=p+r,h=[];for(let g=c+1;g<t.length;g++){let y=e(t[g]);if(y<=p)break;y<=u&&h.push(t[g])}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),i=this._getExpansionKey(e);return t.findIndex(r=>this._getExpansionKey(r)===i)+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(Bt(t=>t.reduce((i,r)=>{let a=this._nodes.value.get(this._getExpansionKey(r));return a&&i.push(a),i},[])))}_sendKeydownToKeyManager(e){if(e.target===this._elementRef.nativeElement)this._keyManager.onKeydown(e);else{let t=this._nodes.getValue();for(let[,i]of t)if(e.target===i._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(Mk((t,i)=>(t.push(...i),t),[]));throw m$()}_getAllChildrenRecursively(e){return this.childrenAccessor?OC(this.childrenAccessor(e)).pipe(Fo(1),Vn(t=>{for(let i of t)this._parents.set(this._getExpansionKey(i),e);return Nn(...t).pipe(kk(i=>wk(Nn([i]),this._getAllChildrenRecursively(i))))})):Nn([])}_getExpansionKey(e){return this.expansionKey?.(e)??e}_getAriaSet(e){let t=this._getExpansionKey(e),i=this._parents.get(t),r=i?this._getExpansionKey(i):null;return this._ariaSets.get(r)??[e]}_findParentForNode(e,t,i){if(!i.length)return null;let r=this._levels.get(this._getExpansionKey(e))??0;for(let a=t-1;a>=0;a--){let c=i[a];if((this._levels.get(this._getExpansionKey(c))??0)<r)return c}return null}_flattenNestedNodesWithExpansion(e,t=0){let i=this._getChildrenAccessor();return i?Nn(...e).pipe(kk(r=>{let a=this._getExpansionKey(r);this._parents.has(a)||this._parents.set(a,null),this._levels.set(a,t);let c=OC(i(r));return wk(Nn([r]),c.pipe(Fo(1),yi(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)}}),Vn(p=>p?this._flattenNestedNodesWithExpansion(p,t+1).pipe(Bt(u=>this.isExpanded(r)?u:[])):Nn([]))))}),Mk((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(Bt(i=>({renderNodes:i,flattenedNodes:i})));if(this.levelAccessor&&t==="nested"){let i=this.levelAccessor;return Nn(e.filter(r=>i(r)===0)).pipe(Bt(r=>({renderNodes:r,flattenedNodes:e})),yi(({flattenedNodes:r})=>{this._calculateParents(r)}))}else return t==="flat"?Nn({renderNodes:e,flattenedNodes:e}).pipe(yi(({flattenedNodes:i})=>{this._calculateParents(i)})):(this._clearPreviousCache(),this._ariaSets.set(null,[...e]),this._flattenNestedNodesWithExpansion(e).pipe(Bt(i=>({renderNodes:e,flattenedNodes:i}))))}_updateCachedData(e){this._flattenedNodes.next(e)}_updateKeyManagerItems(e){this._keyManagerNodes.next(e)}_calculateParents(e){let t=this._getLevelAccessor();if(t){this._clearPreviousCache();for(let i=0;i<e.length;i++){let r=e[i],a=this._getExpansionKey(r);this._levels.set(a,t(r));let c=this._findParentForNode(r,i,e);this._parents.set(a,c);let p=c?this._getExpansionKey(c):null,u=this._ariaSets.get(p)??[];u.splice(i,0,r),this._ariaSets.set(p,u)}}}_forEachExpansionKey(e){let t=[],i=[];this._nodes.value.forEach(r=>{t.push(this._getExpansionKey(r.data)),i.push(this._getDescendants(r.data))}),i.length>0?Lr(i).pipe(Fo(1),Ge(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,i,r){if(t&1&&Zi(r,rk,5),t&2){let a;mt(a=pt())&&(i._nodeDefs=a)}},viewQuery:function(t,i){if(t&1&&In(Ng,7),t&2){let r;mt(r=pt())&&(i._nodeOutlet=r.first)}},hostAttrs:["role","tree",1,"cdk-tree"],hostBindings:function(t,i){t&1&&_("keydown",function(a){return i._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,i){t&1&&Fi(0,0)},dependencies:[Ng],encapsulation:2})}return n})(),Fg=(()=>{class n{_elementRef=f(Jt);_tree=f(tC);_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 _e;expandedChange=new _e;static mostRecentTreeNode=null;_destroyed=new We;_dataChanges=new We;_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(X);constructor(){n.mostRecentTreeNode=this}ngOnInit(){this._parentNodeAriaLevel=B5e(this._elementRef.nativeElement),this._tree._getExpansionModel().changed.pipe(Bt(()=>this.isExpanded),yp(),Ge(this._destroyed)).pipe(Ge(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=vt({type:n,selectors:[["cdk-tree-node"]],hostAttrs:["role","treeitem",1,"cdk-tree-node"],hostVars:5,hostBindings:function(t,i){t&1&&_("click",function(){return i._setActiveItem()})("focus",function(){return i._focusItem()}),t&2&&(Jo("tabIndex",i._tabindex),Qt("aria-expanded",i._getAriaExpanded())("aria-level",i.level+1)("aria-posinset",i._getPositionInSet())("aria-setsize",i._getSetSize()))},inputs:{role:"role",isExpandable:[2,"isExpandable","isExpandable",yt],isExpanded:"isExpanded",isDisabled:[2,"isDisabled","isDisabled",yt],typeaheadLabel:[0,"cdkTreeNodeTypeaheadLabel","typeaheadLabel"]},outputs:{activation:"activation",expandedChange:"expandedChange"},exportAs:["cdkTreeNode"]})}return n})();function B5e(n){let o=n.parentElement;for(;o&&!z5e(o);)o=o.parentElement;return o?o.classList.contains("cdk-nested-tree-node")?Lo(o.getAttribute("aria-level")):0:-1}function z5e(n){let o=n.classList;return!!(o?.contains("cdk-nested-tree-node")||o?.contains("cdk-tree"))}var OO=(()=>{class n extends Fg{_type="nested";_differs=f(pd);_dataDiffer;_children;nodeOutlet;constructor(){super()}ngAfterContentInit(){this._dataDiffer=this._differs.find([]).create(this._tree.trackBy),this._tree._getDirectChildren(this.data).pipe(Ge(this._destroyed)).subscribe(e=>this.updateChildrenNodes(e)),this.nodeOutlet.changes.pipe(Ge(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 i=t.viewContainer;this._tree.renderNodeChanges(this._children,this._dataDiffer,i,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=vt({type:n,selectors:[["cdk-nested-tree-node"]],contentQueries:function(t,i,r){if(t&1&&Zi(r,Ng,5),t&2){let a;mt(a=pt())&&(i.nodeOutlet=a)}},hostAttrs:[1,"cdk-nested-tree-node"],exportAs:["cdkNestedTreeNode"],features:[fn([{provide:Fg,useExisting:n},{provide:AO,useExisting:n}]),di]})}return n})();var NO=(()=>{class n{_tree=f(tC);_treeNode=f(Fg);recursive=!1;constructor(){}_toggle(e){e.stopPropagation(),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=vt({type:n,selectors:[["","cdkTreeNodeToggle",""]],hostAttrs:["tabindex","-1"],hostBindings:function(t,i){t&1&&_("click",function(a){return i._toggle(a)})("keydown.Enter",function(a){return i._toggle(a),a.preventDefault()})("keydown.Space",function(a){return i._toggle(a),a.preventDefault()})},inputs:{recursive:[2,"cdkTreeNodeToggleRecursive","recursive",yt]}})}return n})();var Rg=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({})}return n})();var ak=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[Rg,_i]})}return n})();var Lg=(function(n){return n.group="group",n.user="user",n})(Lg||{});var jl=(()=>{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 Yi([this.httpController.get(e,`/pools/${t}`),this.httpController.get(e,`/pools/${t}/resources`)]).pipe(Bt(i=>(i[0].resources=i[1],i[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,i){return this.httpController.put(e,`/pools/${t.resource_pool_id}/resources/${i.project_id}`,{})}deleteResource(e,t,i){return this.httpController.delete(e,`/pools/${i.resource_pool_id}/resources/${t.resource_id}`)}getFreeResources(e){return this.projectService.list(e).pipe(Vn(t=>this.getAllNonFreeResources(e).pipe(Bt(i=>i.map(r=>r.resource_id)),Bt(i=>t.filter(r=>!i.includes(r.project_id))))))}getAllNonFreeResources(e){return this.getAll(e).pipe(Vn(t=>Yi(t.map(i=>this.httpController.get(e,`/pools/${i.resource_pool_id}/resources`)))),Bt(t=>{let i=[];for(let r of t)for(let a of r)i.push(a);return i}))}static \u0275fac=function(t){return new(t||n)(ge(mn),ge(Ei))};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var sk=class{endpoints;constructor(o){this.endpoints=o}buildTreeFromEndpoints(){let o=[],e=[];return this.endpoints.forEach(t=>{let i=this.extractParent(t);e.push(i)}),e.forEach(t=>{t.depth>0&&e.filter(r=>r.splitEndp.join("/")==t.splitEndp.slice(0,t.depth-1).join("/"))[0].children.push(t)}),o.push(e.find(t=>t.depth===0)),o}extractParent(o){let e=o.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:o.endpoint,endpoint_type:o.endpoint_type,name:o.name,parent:t}}};var H5e=["userTrigger"],U5e=["groupTrigger"],W5e=["roleTrigger"],G5e=(n,o)=>o.role_id,q5e=(n,o)=>o.resource_pool_id,Q5e=(n,o)=>o.user_id,X5e=(n,o)=>o.name;function K5e(n,o){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),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.endpointSelection(i))}),s(5,"mat-icon"),d(6),l()()()()}if(n&2){let e=o.$implicit,t=v(2);m(),Ae("selected",t.selectedEndpoint&&e.endpoint===t.selectedEndpoint.endpoint),m(2),ee(" ",e.name," "),m(3),B(t.selectedEndpoint&&e.endpoint===t.selectedEndpoint.endpoint?"check_circle":"panorama_fish_eye")}}function Y5e(n,o){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),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.endpointSelection(i))}),s(7,"mat-icon"),d(8),l()()(),s(9,"div"),Fi(10,36),l()()}if(n&2){let e=o.$implicit,t=v(2);m(),Ae("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),B(t.selectedEndpoint&&e.endpoint===t.selectedEndpoint.endpoint?"check_circle":"panorama_fish_eye"),m(),Ae("example-tree-invisible",!t.treeControl.isExpanded(e))}}function Z5e(n,o){if(n&1&&(s(0,"cdk-tree",12),Ce(1,K5e,7,4,"cdk-nested-tree-node",29)(2,Y5e,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 J5e(n,o){n&1&&(s(0,"mat-icon",41),d(1,"check_circle"),l())}function eNe(n,o){n&1&&(s(0,"mat-icon",42),d(1,"panorama_fish_eye"),l())}function tNe(n,o){if(n&1){let e=z();s(0,"div",38),_("click",function(){let i=k(e).$implicit,r=v(2);return T(r.resourcePoolSelection(i))}),s(1,"mat-icon",39),d(2,"folder"),l(),s(3,"span",40),d(4),l(),I(5,J5e,2,0,"mat-icon",41)(6,eNe,2,0,"mat-icon",42),l()}if(n&2){let e=o.$implicit,t=v(2);Ae("selected",t.selectedResourcePool&&t.selectedResourcePool.resource_pool_id===e.resource_pool_id),m(4),B(e.name),m(),A(t.selectedResourcePool&&t.selectedResourcePool.resource_pool_id===e.resource_pool_id?5:6)}}function nNe(n,o){if(n&1&&(s(0,"div",13),K(1,tNe,7,4,"div",37,q5e),l()),n&2){let e=v();m(),Y(e.resourcePools)}}function iNe(n,o){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e.charAt(0).toUpperCase()+e.slice(1))}}function oNe(n,o){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),mi(" ",e.username,"",e.full_name?" - "+e.full_name:""," ")}}function rNe(n,o){if(n&1){let e=z();s(0,"mat-form-field")(1,"mat-label"),d(2,"User"),l(),s(3,"input",18,2),_("click",function(){k(e);let i=v();return T(i.openUserPanel())}),l(),s(5,"mat-autocomplete",19,3),_("optionSelected",function(i){k(e);let r=v();return T(r.userSelection(i.option.value))}),K(7,oNe,2,3,"mat-option",17,Q5e),nn(9,"async"),l()()}if(n&2){let e=ke(6),t=v();m(3),C("matAutocomplete",e)("formControl",t.userAutocompleteControl),m(2),C("displayWith",t.displayFnUser),m(2),Y($n(9,3,t.filteredUsers))}}function aNe(n,o){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e.name)}}function sNe(n,o){if(n&1){let e=z();s(0,"mat-form-field")(1,"mat-label"),d(2,"Group"),l(),s(3,"input",18,4),_("click",function(){k(e);let i=v();return T(i.openGroupPanel())}),l(),s(5,"mat-autocomplete",19,5),_("optionSelected",function(i){k(e);let r=v();return T(r.groupSelection(i.option.value))}),K(7,aNe,2,2,"mat-option",17,X5e),nn(9,"async"),l()()}if(n&2){let e=ke(6),t=v();m(3),C("matAutocomplete",e)("formControl",t.groupAutocompleteControl),m(2),C("displayWith",t.displayFn),m(2),Y($n(9,3,t.filteredGroups))}}function lNe(n,o){if(n&1&&(s(0,"mat-option",17),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),B(e.name)}}var lk=(()=>{class n{data;dialogRef=f(Ie);aclService=f(bp);userService=f(Fr);groupService=f(Bl);roleService=f(zl);resourcePoolsService=f(jl);toasterService=f(ie);cd=f(X);controller;addAceForm;allowed=!0;types=Object.values(Lg);resourcePools=[];selectedResourcePool;showResourcePools=!1;userAutoTrigger;groupAutoTrigger;roleAutoTrigger;endpoints;selectedEndpoint;filteredEndpoint=[];endpointTypes;userAutocompleteControl=new $e;groupAutocompleteControl=new $e;roleAutocompleteControl=new $e;filteredUsers;filteredGroups;filteredRoles;groups=[];selectedGroup;users=[];selectedUser;roles=[];selectedRole;TREE_DATA=[];treeControl=new ok(e=>e.children);treeDataSource;constructor(e){this.data=e,this.endpoints=e.endpoints;let i=new sk(this.endpoints).buildTreeFromEndpoints();this.treeDataSource=new h4(i),console.log(i)}ngOnInit(){this.addAceForm=new Ho({type:new $e(Lg.user),role_id:new $e,propagate:new $e(!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(gi(""),Bt(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(gi(""),Bt(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(gi(""),Bt(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===Lg.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===Lg.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 i=t.error?.message||t.message||"Failed to create ACE";this.toasterService.error(i),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 i=typeof e=="string"?e.toLowerCase():"";return t?t.filter(r=>r.name.toLowerCase().includes(i)):[]}_filterUser(e,t){let i=typeof e=="string"?e.toLowerCase():"";return t?t.filter(r=>(r.full_name?.toLowerCase().includes(i)??!1)||r.username.toLowerCase().includes(i)):[]}_filterRole(e,t){let i=typeof e=="string"?e.toLowerCase():"";return t?t.filter(r=>r.name.toLowerCase().includes(i)):[]}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)(at(Ct))};static \u0275cmp=F({type:n,selectors:[["app-add-ace-dialog"]],viewQuery:function(t,i){if(t&1&&In(H5e,5,So)(U5e,5,So)(W5e,5,So),t&2){let r;mt(r=pt())&&(i.userAutoTrigger=r.first),mt(r=pt())&&(i.groupAutoTrigger=r.first),mt(r=pt())&&(i.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,i){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),_("click",function(){return i.showResourcePools=!1}),d(6," All Endpoints "),l(),s(7,"button",11),_("click",function(){return i.showResourcePools=!0}),d(8," Resource Pools "),l()(),I(9,Z5e,3,3,"cdk-tree",12)(10,nNe,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),K(17,iNe,2,2,"mat-option",17,Oe),l()(),I(19,rNe,10,5,"mat-form-field"),I(20,sNe,10,5,"mat-form-field"),s(21,"mat-form-field")(22,"mat-label"),d(23,"Role"),l(),s(24,"input",18,0),_("click",function(){return i.openRolePanel()}),l(),s(26,"mat-autocomplete",19,1),_("optionSelected",function(a){return i.roleSelection(a.option.value)}),K(28,lNe,2,2,"mat-option",17,G5e),nn(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),_("click",function(){return i.changeAllowed()}),d(38),l()()(),s(39,"div",26)(40,"button",27),_("click",function(){return i.onCancelClick()}),d(41,"Cancel"),l(),s(42,"button",28),_("click",function(){return i.onAddClick()}),d(43," Add ACE "),l()()()()),t&2){let r=ke(27);m(2),C("formGroup",i.addAceForm),m(3),Ae("active",!i.showResourcePools),m(2),Ae("active",i.showResourcePools),m(2),A(i.showResourcePools?10:9),m(2),C("vertical",!0),m(6),Y(i.types),m(2),A(i.form.type.value==="user"?19:-1),m(),A(i.form.type.value==="group"?20:-1),m(4),C("matAutocomplete",r)("formControl",i.roleAutocompleteControl),m(2),C("displayWith",i.displayFn),m(2),Y($n(30,19,i.filteredRoles)),m(7),C("vertical",!0),m(2),Ae("ace-form__action-btn--allow",i.allowed)("ace-form__action-btn--deny",!i.allowed),m(),ee(" ",i.allowed?"ALLOWED":"DENY"," "),m(4),C("disabled",!i.addAceForm.valid)}},dependencies:[ne,Et,rt,Nt,Dt,ot,Ys,Ft,Vt,ve,Le,Ve,G,pe,ze,Lt,qt,yr,qr,we,Me,Xe,oe,de,ht,Mt,Se,Te,gt,Pt,ft,lr,Dr,So,ak,Rg,OO,rk,NO,tC,Ng,Gr],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 cNe=(n,o)=>o.path;function dNe(n,o){if(n&1&&(s(0,"li"),d(1),l()),n&2){let e=o.$implicit;m(),B(e.path)}}var nC=(()=>{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)(at(Ct))};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,i){t&1&&(s(0,"h1",0),d(1,"Are you sure you want to delete the following ACEs ?"),l(),s(2,"ul"),K(3,dNe,2,1,"li",null,cNe),l(),s(5,"div",1)(6,"button",2),_("click",function(){return i.onCancel()}),d(7,"No, cancel"),l(),s(8,"button",3),_("click",function(){return i.onDelete()}),d(9," Yes, delete! "),l()()),t&2&&(m(3),Y(i.data.aces))},dependencies:[ne,ve,Le,Ve,G,pe],encapsulation:2,changeDetection:0})}return n})();var p$=(()=>{class n{transform(e,t,i){if(!e)return[];if(!t)return e;t=t.toLowerCase();let r=i.filter(a=>a.name.toLowerCase().includes(t));return e.data.filter(a=>{let c=this.getEndpoint(a.user_id,i),p=this.getEndpoint(a.group_id,i),u=this.getEndpoint(a.path,i),h=this.getEndpoint(a.role_id,i);return r.some(g=>[c,p,u,h].includes(g.endpoint))})}getEndpoint(e,t){let i=t.filter(r=>r.endpoint.includes(e));return i.length>0?i[0].endpoint.toLowerCase():""}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Br({name:"aceFilter",type:n,pure:!0})}return n})();var mNe=["acesPaginator"],pNe=["acesSort"],uNe=()=>[5,10,20];function hNe(n,o){if(n&1){let e=z();s(0,"th",28)(1,"mat-checkbox",29),_("change",function(i){k(e);let r=v(2);return T(i?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 fNe(n,o){if(n&1){let e=z();s(0,"td",30)(1,"mat-checkbox",31),_("click",function(i){return i.stopPropagation()})("change",function(i){let r=k(e).$implicit,a=v(2);return T(i?a.selection.toggle(r):null)}),l()()}if(n&2){let e=o.$implicit,t=v(2);m(),C("checked",t.selection.isSelected(e))}}function gNe(n,o){n&1&&(s(0,"th",32),d(1,"Path"),l())}function _Ne(n,o){if(n&1&&(s(0,"td",33)(1,"span",34),d(2),l()()),n&2){let e=o.$implicit,t=v(2);m(2),B(t.getNameByUuidFromEndpoint(e.path))}}function vNe(n,o){n&1&&(s(0,"th",32),d(1,"User/Group"),l())}function CNe(n,o){if(n&1&&d(0),n&2){let e=v().$implicit,t=v(2);ee(" ",t.getNameByUuidFromEndpoint(e.user_id)," ")}}function xNe(n,o){if(n&1&&d(0),n&2){let e=v().$implicit,t=v(2);ee(" ",t.getNameByUuidFromEndpoint(e.group_id)," ")}}function bNe(n,o){if(n&1&&(s(0,"td",33)(1,"span",34),I(2,CNe,1,1)(3,xNe,1,1),l()()),n&2){let e=o.$implicit;m(2),A(e.ace_type==="user"?2:3)}}function yNe(n,o){n&1&&(s(0,"th",32),d(1,"Role"),l())}function SNe(n,o){if(n&1&&(s(0,"td",33)(1,"span",34),d(2),l()()),n&2){let e=o.$implicit,t=v(2);m(2),B(t.getNameByUuidFromEndpoint(e.role_id))}}function wNe(n,o){n&1&&(s(0,"th",32),d(1,"Propagate"),l())}function MNe(n,o){if(n&1&&(s(0,"td",33),d(1),l()),n&2){let e=o.$implicit;m(),B(e.propagate)}}function kNe(n,o){n&1&&(s(0,"th",32),d(1,"Allowed"),l())}function TNe(n,o){if(n&1&&(s(0,"td",33),d(1),l()),n&2){let e=o.$implicit;m(),B(e.allowed)}}function ENe(n,o){n&1&&(s(0,"th",32),d(1,"Created"),l())}function DNe(n,o){if(n&1&&(s(0,"td",33)(1,"span",34),d(2),l()()),n&2){let e=o.$implicit;m(2),B(e.created_at)}}function PNe(n,o){n&1&&(s(0,"th",32),d(1,"Last update"),l())}function INe(n,o){if(n&1&&(s(0,"td",33)(1,"span",34),d(2),l()()),n&2){let e=o.$implicit;m(2),B(e.updated_at)}}function ANe(n,o){n&1&&R(0,"tr",35)}function ONe(n,o){n&1&&R(0,"tr",36)}function NNe(n,o){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),_("click",function(){k(e);let i=v();return T(i.deleteMultiple())}),d(5," Delete Selected "),l(),s(6,"button",7),_("click",function(){k(e);let i=v();return T(i.addACE())}),d(7,"Add ACE"),l()()(),s(8,"form",8)(9,"mat-form-field",9)(10,"input",10),_("input",function(i){k(e);let r=v();return T(r.searchText.set(i.target.value))}),l()()(),s(11,"div",11)(12,"table",12,0),nn(14,"aceFilter"),Fe(15,13),Ce(16,hNe,2,2,"th",14)(17,fNe,2,1,"td",15),Re(),Fe(18,16),Ce(19,gNe,2,0,"th",17)(20,_Ne,3,1,"td",18),Re(),Fe(21,19),Ce(22,vNe,2,0,"th",17)(23,bNe,4,1,"td",18),Re(),Fe(24,20),Ce(25,yNe,2,0,"th",17)(26,SNe,3,1,"td",18),Re(),Fe(27,21),Ce(28,wNe,2,0,"th",17)(29,MNe,2,1,"td",18),Re(),Fe(30,22),Ce(31,kNe,2,0,"th",17)(32,TNe,2,1,"td",18),Re(),Fe(33,23),Ce(34,ENe,2,0,"th",17)(35,DNe,3,1,"td",18),Re(),Fe(36,24),Ce(37,PNe,2,0,"th",17)(38,INe,3,1,"td",18),Re(),Ce(39,ANe,1,0,"tr",25)(40,ONe,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",ZO(14,6,e.dataSource,e.searchText(),e.endpoints())),m(27),C("matHeaderRowDef",e.displayedColumns),m(),C("matRowDefColumns",e.displayedColumns),m(),C("pageSizeOptions",Tt(10,uNe))}}function FNe(n,o){n&1&&(s(0,"div",2),R(1,"mat-spinner",37),l())}var ck=(()=>{class n{route=f(lt);controllerService=f(nt);toasterService=f(ie);aclService=f(bp);resourcePoolsService=f(jl);dialog=f(it);cdr=f(X);acesPaginator;acesSort;controller;displayedColumns=["select","path","user/group","role","propagate","allowed","updated_at"];selection=new Ra(!0,[]);aces;dataSource=new _r;isReady=Q(!1);searchText=U("");endpoints=Q([]);resourcePools=Q([]);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:i=>{this.endpoints.set(i),this.refresh()},error:i=>{let r=i.error?.message||i.message||"Failed to load endpoints";this.toasterService.error(r),this.cdr.markForCheck()}}),this.resourcePoolsService.getAll(t).subscribe({next:i=>{this.resourcePools.set(i)},error:i=>{let r=i.error?.message||i.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(lk,{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(nC,{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:i=>{let r=i.error?.message||i.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(nC,{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:i=>{let r=i.error?.message||i.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 i=t[1],r=this.resourcePools().find(a=>a.resource_pool_id===i);return r?`Resource pool "${r.name}"`:`Resource pool (${i.slice(0,8)}...)`}if(this.endpoints()){let i=this.endpoints().filter(r=>r.endpoint.includes(e));if(i.length>=1)return i[0].name}return e}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=F({type:n,selectors:[["app-acl-management"]],viewQuery:function(t,i){if(t&1&&In(mNe,5)(pNe,5),t&2){let r;mt(r=pt())&&(i.acesPaginator=r),mt(r=pt())&&(i.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,i){t&1&&I(0,NNe,43,11)(1,FNe,2,0,"div",2),t&2&&A(i.isReady()?0:1)},dependencies:[ne,Je,rt,ot,Gn,dt,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,Cr,pr,po,Nr,Lt,qt,G,pe,oe,ht,Mt,we,Me,Se,Te,ve,kt,p$],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 dk=(()=>{class n{get(e){return new RegExp(/[~`!#$%\^&*+=\[\]\\';,/{}|\\":<>\?]/).test(e.value)?{invalidName:!0}:null}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var u$=(n,o)=>e=>Ca(500).pipe(Vn(()=>o.getAll(n)),Bt(t=>t.find(i=>i.name===e.value)?{projectExist:!0}:null));function LNe(n,o){n&1&&(s(0,"mat-error"),d(1,"Resource pool name is required"),l())}function VNe(n,o){n&1&&(s(0,"mat-error"),d(1,"Resource pool name is incorrect"),l())}function BNe(n,o){n&1&&(s(0,"mat-error"),d(1,"Resource pool with this name exists"),l())}var mk=(()=>{class n{data;poolNameValidator;dialogRef=f(Ie);formBuilder=f(Bn);resourcePoolsService=f(jl);toasterService=f(ie);cd=f(X);poolNameForm;controller;constructor(e,t){this.data=e,this.poolNameValidator=t}ngOnInit(){this.controller=this.data.controller,this.poolNameForm=this.formBuilder.group({poolName:new $e(null,[je.required,this.poolNameValidator.get],[u$(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 i=t.error?.message||t.message||"Failed to create resource pool";this.toasterService.error(i),this.cd.markForCheck()}})}onNoClick(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)(at(Ct),at(dk))};static \u0275cmp=F({type:n,selectors:[["app-add-resource-pool-dialog"]],features:[fn([dk])],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,i){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),_("keydown",function(a){return i.onKeyDown(a)}),l(),I(8,LNe,2,0,"mat-error"),I(9,VNe,2,0,"mat-error"),I(10,BNe,2,0,"mat-error"),l()(),s(11,"div",5)(12,"button",6),_("click",function(){return i.onNoClick()}),d(13,"Cancel"),l(),s(14,"button",7),_("click",function(){return i.onAddClick()}),d(15,"Add resource pool"),l()()()),t&2&&(m(2),C("formGroup",i.poolNameForm),m(6),A(i.form.poolName!=null&&i.form.poolName.touched&&(i.form.poolName!=null&&i.form.poolName.errors)&&(i.form.poolName!=null&&i.form.poolName.errors.required)?8:-1),m(),A(i.form.poolName!=null&&i.form.poolName.errors&&(i.form.poolName!=null&&i.form.poolName.errors.invalidName)?9:-1),m(),A(i.form.poolName!=null&&i.form.poolName.errors&&(i.form.poolName!=null&&i.form.poolName.errors.projectExist)?10:-1))},dependencies:[ne,Et,rt,Nt,Dt,ot,Ft,Vt,ve,Le,Ve,St,we,Me,Xe,ni,Se,Te,G,pe],styles:[".full-width-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var zNe=(n,o)=>o.name;function jNe(n,o){if(n&1&&(s(0,"li"),d(1),l()),n&2){let e=o.$implicit;m(),B(e.name)}}var pk=(()=>{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)(at(Ct))};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,i){t&1&&(s(0,"h1",0),d(1,"Are you sure you want to delete the following pools?"),l(),s(2,"ul"),K(3,jNe,2,1,"li",null,zNe),l(),s(5,"div",1)(6,"button",2),_("click",function(){return i.onCancel()}),d(7,"No, cancel"),l(),s(8,"button",3),_("click",function(){return i.onDelete()}),d(9," Yes, delete! "),l()()),t&2&&(m(3),Y(i.data.pools))},dependencies:[ne,ve,Le,Ve,G,pe],encapsulation:2,changeDetection:0})}return n})();var h$=(()=>{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=Br({name:"resourcePoolsFilter",type:n,pure:!0})}return n})();var $Ne=["resourcePoolsPaginator"],HNe=["resourcePoolsSort"],UNe=()=>[5,10,20],WNe=(n,o)=>["/controller",n,"management","pools",o];function GNe(n,o){if(n&1){let e=z();s(0,"th",24)(1,"mat-checkbox",25),_("change",function(i){k(e);let r=v(2);return T(i?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 qNe(n,o){if(n&1){let e=z();s(0,"td",26)(1,"mat-checkbox",27),_("click",function(i){return i.stopPropagation()})("change",function(i){let r=k(e).$implicit,a=v(2);return T(i?a.selection.toggle(r):null)}),l()()}if(n&2){let e=o.$implicit,t=v(2);m(),C("checked",t.selection.isSelected(e))}}function QNe(n,o){n&1&&(s(0,"th",28),d(1,"Name"),l())}function XNe(n,o){if(n&1&&(s(0,"td",29)(1,"a",30),d(2),l()()),n&2){let e=o.$implicit,t=v(2);m(),C("routerLink",aa(2,WNe,t.controller.id,e.resource_pool_id)),m(),ee(" ",e.name," ")}}function KNe(n,o){n&1&&(s(0,"th",28),d(1,"Creation date"),l())}function YNe(n,o){if(n&1&&(s(0,"td",29),d(1),l()),n&2){let e=o.$implicit;m(),B(e.created_at)}}function ZNe(n,o){n&1&&(s(0,"th",28),d(1,"Last update"),l())}function JNe(n,o){if(n&1&&(s(0,"td",29),d(1),l()),n&2){let e=o.$implicit;m(),B(e.updated_at)}}function eFe(n,o){n&1&&R(0,"tr",31)}function tFe(n,o){n&1&&R(0,"tr",32)}function nFe(n,o){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),_("click",function(){k(e);let i=v();return T(i.onDelete(i.selection.selected))}),d(5," Delete Selected "),l(),s(6,"button",7),_("click",function(){k(e);let i=v();return T(i.addResourcePool())}),d(7," Add Resource Pool "),l()()(),s(8,"form",8)(9,"mat-form-field",9)(10,"input",10),_("input",function(i){k(e);let r=v();return T(r.searchText.set(i.target.value))}),l()()(),s(11,"div",11)(12,"table",12,0),nn(14,"resourcePoolsFilter"),Fe(15,13),Ce(16,GNe,2,2,"th",14)(17,qNe,2,1,"td",15),Re(),Fe(18,16),Ce(19,QNe,2,0,"th",17)(20,XNe,3,5,"td",18),Re(),Fe(21,19),Ce(22,KNe,2,0,"th",17)(23,YNe,2,1,"td",18),Re(),Fe(24,20),Ce(25,ZNe,2,0,"th",17)(26,JNe,2,1,"td",18),Re(),Ce(27,eFe,1,0,"tr",21)(28,tFe,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",sa(14,6,e.dataSource,e.searchText())),m(15),C("matHeaderRowDef",e.displayedColumns),m(),C("matRowDefColumns",e.displayedColumns),m(),C("pageSizeOptions",Tt(9,UNe))}}function iFe(n,o){n&1&&(s(0,"div",2),R(1,"mat-spinner",33),l())}var uk=(()=>{class n{route=f(lt);controllerService=f(nt);toasterService=f(ie);resourcePoolsService=f(jl);dialog=f(it);cd=f(X);controller;resourcePoolsPaginator;resourcePoolsSort;displayedColumns=["select","name","created_at","updated_at"];selection=new Ra(!0,[]);resourcePools=Q([]);dataSource=new _r;searchText=U("");isReady=Q(!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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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(mk,{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(pk,{panelClass:["base-confirmation-dialog-panel","confirmation-danger-panel"],data:{pools:e}}).afterClosed().subscribe(t=>{if(t){let i=e.map(r=>this.resourcePoolsService.delete(this.controller,r.resource_pool_id));Yi(i).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,i){if(t&1&&In($Ne,5)(HNe,5),t&2){let r;mt(r=pt())&&(i.resourcePoolsPaginator=r),mt(r=pt())&&(i.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,i){t&1&&I(0,nFe,31,10)(1,iFe,2,0,"div",2),t&2&&A(i.isReady()?0:1)},dependencies:[ne,Je,rt,ot,Gn,dt,vn,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,Cr,pr,po,Nr,Lt,qt,G,pe,oe,we,Me,Se,Te,ve,dn,qn,h$],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 hk=(()=>{class n{data;dialogRef=f(Ie);constructor(e){this.data=e}static \u0275fac=function(t){return new(t||n)(at(G4))};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,i){t&1&&(s(0,"h2",0),d(1),l(),s(2,"div",1)(3,"button",2),_("click",function(){return i.dialogRef.close()}),d(4,"No, cancel"),l(),s(5,"button",3),_("click",function(){return i.dialogRef.close(i.data)}),d(6,"Yes, delete!"),l()()),t&2&&(m(),mi("Delete resource ",i.data.resource_type,"/",i.data.name,"?"))},dependencies:[ne,ve,Le,Ve,G,pe],encapsulation:2,changeDetection:0})}return n})();var oFe=n=>["/controller",n,"management","pools"],rFe=(n,o)=>o.name;function aFe(n,o){if(n&1&&(s(0,"mat-option",24),d(1),l()),n&2){let e=o.$implicit;C("value",e),m(),ee(" ",e," ")}}function sFe(n,o){if(n&1){let e=z();s(0,"div",27)(1,"span",29),d(2),l(),s(3,"div",30)(4,"button",31),_("click",function(){let i=k(e).$implicit,r=v();return T(r.deleteResource(i))}),s(5,"mat-icon"),d(6,"delete"),l()()()()}if(n&2){let e=o.$implicit;m(2),B(e.name)}}function lFe(n,o){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 fk=(()=>{class n{toastService=f(ie);route=f(lt);resourcePoolsService=f(jl);dialog=f(it);cd=f(X);controller;pool=Q(void 0);addResourceFormControl=new fc("");addResourceFilteredOptions;projects=Q([]);editPoolForm=new DC({poolname:new fc("")});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&&Ye(Z({},t),{name:e})),this.resourcePoolsService.update(this.controller,this.pool()).subscribe({next:t=>{this.toastService.success(`Pool ${t.name} updated`)},error:t=>{let i=t.error?.message||t.message||"Failed to update pool";this.toastService.error(i),this.cd.markForCheck()}}))}addResource(){let e=this.addResourceFormControl.value,t=this.projects().filter(i=>i.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:i=>{let r=i.error?.message||i.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(hk,{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:i=>{let r=i.error?.message||i.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(gi(""),Bt(t=>this.projects().filter(i=>i.name.toLowerCase().includes(t?.toLowerCase()||"")).map(i=>i.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,i){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),_("ngSubmit",function(){return i.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),nn(20,"date"),l(),s(21,"span",12),d(22,"Last update:"),l(),s(23,"span",13),d(24),nn(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),K(44,aFe,2,2,"mat-option",24,Oe),nn(46,"async"),l()(),s(47,"button",25),_("click",function(){return i.addResource()}),s(48,"mat-icon"),d(49,"add"),l()()(),s(50,"div",26),K(51,sFe,7,1,"div",27,rFe,!1,lFe,5,0,"div",28),l()()()()),t&2){let r=ke(43);m(3),C("routerLink",un(18,oFe,i.controller.id)),m(4),ee("Resource pool: ",i.pool().name),m(3),C("formGroup",i.editPoolForm),m(9),B(sa(20,10,i.pool().created_at,"medium")),m(5),B(sa(25,13,i.pool().updated_at,"medium")),m(5),ee(" ",i.pool().resource_pool_id," "),m(4),C("vertical",!0),m(8),C("formControl",i.addResourceFormControl)("matAutocomplete",r),m(3),Y($n(46,16,i.addResourceFilteredOptions)),m(7),Y(i.pool().resources)}},dependencies:[ne,Je,rt,Nt,Dt,ot,Et,Ys,Ft,Vt,dt,vn,we,Me,Xe,Se,Te,G,pe,ze,oe,de,yr,qr,lr,Dr,ft,So,ve,ht,Mt,Gr,hC],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 f$=(()=>{class n{controllerService;resourcePoolsService;constructor(e,t){this.controllerService=e,this.resourcePoolsService=t}resolve(e,t){let i=e.paramMap.get("controller_id"),r=e.paramMap.get("pool_id");return Wu(this.controllerService.get(+i)).pipe(Vn(a=>this.resourcePoolsService.get(a,r)),uo(a=>$o(()=>a)))}static \u0275fac=function(t){return new(t||n)(ge(nt),ge(jl))};static \u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var cFe=[{path:"controller/:controller_id/login",component:hb},{path:"",component:NM,children:[{path:"controllers",component:CM},{path:"",redirectTo:"controllers",pathMatch:"full"},{path:"bundled",component:Jx},{path:"controller/:controller_id/image-manager",component:UM},{path:"controller/:controller_id/projects",component:_M,canActivate:[ri],resolve:{controller:Ag}},{path:"controller/:controller_id/help",component:ab},{path:"controller/:controller_id/settings",component:MM},{path:"controller/:controller_id/settings/console",component:yM},{path:"controller/:controller_id/management/pools/:pool_id",component:fk,canActivate:[ri],resolve:{pool:f$,controller:Ag}},{path:"installed-software",component:pb},{path:"controller/:controller_id/systemstatus",component:EM,canActivate:[ri]},{path:"controller/:controller_ip/:controller_port/project/:project_id",component:nb,canActivate:[ri]},{path:"controller/:controller_id/preferences",component:zb,canActivate:[ri]},{path:"controller/:controller_id/computes",component:E8,canActivate:[ri]},{path:"controller/:controller_id/preferences/builtin",component:fb,canActivate:[ri]},{path:"controller/:controller_id/preferences/builtin/ethernet-hubs",component:wb,canActivate:[ri]},{path:"controller/:controller_id/preferences/builtin/ethernet-hubs/addtemplate",component:yb,canActivate:[ri]},{path:"controller/:controller_id/preferences/builtin/ethernet-hubs/:template_id",component:Sb,canActivate:[ri]},{path:"controller/:controller_id/preferences/builtin/ethernet-switches",component:Tb,canActivate:[ri]},{path:"controller/:controller_id/preferences/builtin/ethernet-switches/addtemplate",component:Mb,canActivate:[ri]},{path:"controller/:controller_id/preferences/builtin/ethernet-switches/:template_id",component:kb,canActivate:[ri]},{path:"controller/:controller_id/preferences/builtin/cloud-nodes",component:bb,canActivate:[ri]},{path:"controller/:controller_id/preferences/builtin/cloud-nodes/addtemplate",component:Cb,canActivate:[ri]},{path:"controller/:controller_id/preferences/builtin/cloud-nodes/:template_id",component:xb,canActivate:[ri]},{path:"controller/:controller_id/preferences/dynamips/templates",component:Fb,canActivate:[ri]},{path:"controller/:controller_id/preferences/dynamips/templates/addtemplate",component:Ab,canActivate:[ri]},{path:"controller/:controller_id/preferences/dynamips/templates/:template_id",component:Nb,canActivate:[ri]},{path:"controller/:controller_id/preferences/dynamips/templates/:template_id/copy",component:Ob,canActivate:[ri]},{path:"controller/:controller_id/preferences/qemu/templates",component:Ub,canActivate:[ri]},{path:"controller/:controller_id/preferences/qemu/templates/:template_id/copy",component:$b,canActivate:[ri]},{path:"controller/:controller_id/preferences/qemu/templates/:template_id",component:Hb,canActivate:[ri]},{path:"controller/:controller_id/preferences/qemu/addtemplate",component:jb,canActivate:[ri]},{path:"controller/:controller_id/preferences/vpcs/templates",component:qb,canActivate:[ri]},{path:"controller/:controller_id/preferences/vpcs/templates/:template_id",component:Gb,canActivate:[ri]},{path:"controller/:controller_id/preferences/vpcs/addtemplate",component:Wb,canActivate:[ri]},{path:"controller/:controller_id/preferences/docker/templates",component:$0,canActivate:[ri]},{path:"controller/:controller_id/preferences/docker/templates/:template_id",component:Ib,canActivate:[ri]},{path:"controller/:controller_id/preferences/docker/templates/:template_id/copy",component:Pb,canActivate:[ri]},{path:"controller/:controller_id/preferences/docker/addtemplate",component:Db,canActivate:[ri]},{path:"controller/:controller_id/preferences/iou/templates",component:Bb,canActivate:[ri]},{path:"controller/:controller_id/preferences/iou/templates/:template_id",component:Vb,canActivate:[ri]},{path:"controller/:controller_id/preferences/iou/templates/:template_id/copy",component:Lb,canActivate:[ri]},{path:"controller/:controller_id/preferences/iou/addtemplate",component:Rb,canActivate:[ri]},{path:"controller/:controller_id/management",component:WM,children:[{path:"users",component:BM},{path:"groups",component:ZM},{path:"roles",component:tk},{path:"pools",component:uk},{path:"ACL",component:ck}]},{path:"controller/:controller_id/management/roles/:role_id",component:ik,resolve:{role:d$,controller:Ag}}]},{path:"controller/:controller_id/project/:project_id",component:hM,canActivate:[ri],canDeactivate:[DM]},{path:"controller/:controller_id/project/:project_id/nodes/:node_id",component:Yv,canActivate:[ri]},{path:"controller/:controller_id/project/:project_id/nodes/:node_id/files",component:tM,canActivate:[ri]},{path:"static/web-ui/controller/:controller_id/project/:project_id/nodes/:node_id",component:Yv,canActivate:[ri]},{path:"**",component:N8}],g$=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[dt.forRoot(cFe,{anchorScrolling:"enabled",enableTracing:!1,scrollPositionRestoration:"enabled"}),dt]})}return n})();var gk=class{builtin;filename;symbol_id;raw;theme};var _$=(()=>{class n{convert(e){let t=new gk;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=te({token:n,factory:n.\u0275fac})}return n})();var v$=(()=>{class n{convert(e){let t={font_family:void 0,font_size:void 0,font_weight:void 0};return Df(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=te({token:n,factory:n.\u0275fac})}return n})();var C$=[GS,dp,cp,Uf,lp,od,Wf,ap,jf,WS,Xf,IS,td,HS,zS,$S,jS,BS,US];var x$=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({providers:[Pl,ra,_g,A2,O2,N2,F2,R2,Jm,mp,id,Zm,Ol,oy,Ao,Ko,Fl,Aa,up,Ss,Ym,If,Nf,Wy,KS,rd,Kf,ew,hp,Yf,_$,Of,Af,qy,ep,mf,kl,pf,uf,$f,Al,Qc,v$,qf,Qf,...C$],imports:[ne,qe,oe]})}return n})();var b$=(()=>{class n extends em{getItemKey(e){return e.symbol_id}static \u0275fac=(()=>{let e;return function(i){return(e||(e=Oi(n)))(i||n)}})();static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var y$=(()=>{class n{injector=f(rr);extractError(e){return e&&e.ngOriginalError&&(e=e.ngOriginalError),typeof e=="string"||e instanceof Error?e:e instanceof c4?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 i=this.injector.get(ie);e.error?.message?i.error(e.error.message):e.message?i.error(e.message):e.error&&i.error(e.error)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var dFe=(n,o)=>o.value;function mFe(n,o){n&1&&(s(0,"th",11),d(1,"Adapter number"),l())}function pFe(n,o){if(n&1&&(s(0,"td",12),d(1),l()),n&2){let e=o.$implicit;m(),ee("Adapter ",e.adapter_number)}}function uFe(n,o){n&1&&(s(0,"th",11),d(1,"Port name"),l())}function hFe(n,o){if(n&1){let e=z();s(0,"td",12)(1,"input",13),_("input",function(i){let r=k(e).$implicit,a=v();return T(a.onPortNameChange(r.adapter_number,i.target.value))}),l()()}if(n&2){let e=o.$implicit;m(),C("value",e.port_name)}}function fFe(n,o){n&1&&(s(0,"th",11),d(1,"Adapter type"),l())}function gFe(n,o){if(n&1&&(s(0,"mat-option",15),d(1),l()),n&2){let e=o.$implicit;C("value",e.value),m(),ee(" ",e.name," ")}}function _Fe(n,o){if(n&1){let e=z();s(0,"td",12)(1,"mat-select",14),_("selectionChange",function(i){let r=k(e).$implicit,a=v();return T(a.onAdapterTypeChange(r.adapter_number,i.value))}),K(2,gFe,2,2,"mat-option",15,dFe),l()()}if(n&2){let e=o.$implicit,t=v();m(),C("value",e.adapter_type),m(),Y(t.networkTypes())}}function vFe(n,o){n&1&&(s(0,"th",11),d(1,"MAC address"),l())}function CFe(n,o){if(n&1){let e=z();s(0,"td",12)(1,"input",16),_("input",function(i){let r=k(e).$implicit,a=v();return T(a.onMacAddressChange(r.adapter_number,i.target.value))}),l()()}if(n&2){let e=o.$implicit;m(),C("value",e.mac_address)}}function xFe(n,o){n&1&&(s(0,"th",11),d(1,"Actions"),l())}function bFe(n,o){if(n&1){let e=z();s(0,"td",12)(1,"button",17),_("click",function(){let i=k(e).$implicit,r=v();return T(r.delete(i))}),s(2,"mat-icon",18),d(3,"delete"),l()()()}}function yFe(n,o){n&1&&R(0,"tr",19)}function SFe(n,o){n&1&&R(0,"tr",20)}var S$=(()=>{class n{cd=f(X);networkTypes=ae([]);displayedColumns=ae([]);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(i=>i.map(r=>r.adapter_number===e?Ye(Z({},r),{port_name:t}):r)),this.cd.markForCheck()}onAdapterTypeChange(e,t){this.adapters.update(i=>i.map(r=>r.adapter_number===e?Ye(Z({},r),{adapter_type:t}):r)),this.cd.markForCheck()}onMacAddressChange(e,t){this.adapters.update(i=>i.map(r=>r.adapter_number===e?Ye(Z({},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,i){t&1&&(s(0,"table",0),Fe(1,1),Ce(2,mFe,2,0,"th",2)(3,pFe,2,1,"td",3),Re(),Fe(4,4),Ce(5,uFe,2,0,"th",2)(6,hFe,2,1,"td",3),Re(),Fe(7,5),Ce(8,fFe,2,0,"th",2)(9,_Fe,4,1,"td",3),Re(),Fe(10,6),Ce(11,vFe,2,0,"th",2)(12,CFe,2,1,"td",3),Re(),Fe(13,7),Ce(14,xFe,2,0,"th",2)(15,bFe,4,0,"td",3),Re(),Ce(16,yFe,1,0,"tr",8)(17,SFe,1,0,"tr",9),l(),s(18,"button",10),_("click",function(){return i.onAdd()}),d(19,"Add"),l()),t&2&&(C("dataSource",i.adapters()),m(16),C("matHeaderRowDef",i.displayedColumns()),m(),C("matRowDefColumns",i.displayedColumns()))},dependencies:[ne,pn,Cn,bn,Mn,yn,xn,kn,Sn,wn,Tn,En,gt,Pt,ft,Vo,G,pe,ze,oe,de,ht,Mt,Se,Te,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 w$=(()=>{class n{controller=ae(void 0);symbol=ae(void 0);symbolChangedEmitter=new _e;chosenSymbol=Q("");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,i){t&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),d(4,"Symbol selection"),l(),s(5,"button",4),_("click",function(){return i.cancelChooseSymbol()}),d(6,"Cancel"),l(),s(7,"button",5),_("click",function(){return i.chooseSymbol()}),d(8,"Choose symbol"),l()()(),s(9,"div",6)(10,"app-symbols",7),_("symbolChanged",function(a){return i.symbolChanged(a)}),l()()()),t&2&&(m(10),C("controller",i.controller())("symbol",i.symbol()))},dependencies:[ne,G,pe,Fm],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 M$=(()=>{class n{route=f(lt);controllerService=f(nt);toasterService=f(ie);cd=f(X);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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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,i){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),_("input",function(a){return i.dynamipsPath.set(a.target.value)}),l()()()()),t&2&&(m(7),C("value",i.dynamipsPath()))},dependencies:[ne,we,Me,Se,Te],styles:[".top-button[_ngcontent-%COMP%]{height:36px;margin-top:22px}.form-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var _k=(()=>{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=te({token:n,factory:n.\u0275fac})}return n})();function wFe(n,o){if(n&1&&(s(0,"button",4),d(1," QEMU VM templates "),l()),n&2){let e=v();C("routerLink",Hi("/controller/",e.controller.id,"/preferences/qemu/templates"))}}function MFe(n,o){if(n&1){let e=z();s(0,"mat-list-item")(1,"mat-checkbox",10),_("change",function(i){k(e);let r=v(2);return r.settings.require_hardware_acceleration=i.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 kFe(n,o){if(n&1){let e=z();s(0,"mat-nav-list")(1,"mat-list-item")(2,"mat-checkbox",10),_("change",function(i){k(e);let r=v();return r.settings.enable_hardware_acceleration=i.checked,T(r.cd.markForCheck())}),d(3," Enable Hardware Acceleration (KVM/HAXM) "),l()(),I(4,MFe,3,1,"mat-list-item"),l()}if(n&2){let e=v();m(2),C("checked",e.settings.enable_hardware_acceleration),m(2),A(e.settings.enable_hardware_acceleration?4:-1)}}var k$=(()=>{class n{route=f(lt);controllerService=f(nt);controllerSettingsService=f(_k);toasterService=f(ie);cd=f(X);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:i=>{this.settings=i,this.cd.markForCheck()},error:i=>{let r=i.error?.message||i.message||"Failed to load QEMU settings";this.toasterService.error(r),this.cd.markForCheck()}})},t=>{let i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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 i=t.error?.message||t.message||"Failed to restore QEMU settings";this.toasterService.error(i),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,i){t&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),d(4,"QEMU preferences"),l(),I(5,wFe,2,2,"button",4),l()(),s(6,"div",5)(7,"div",6),I(8,kFe,5,2,"mat-nav-list"),l(),s(9,"div",7)(10,"button",8),_("click",function(){return i.restoreDefaults()}),d(11,"Restore defaults"),l(),s(12,"button",9),_("click",function(){return i.apply()}),d(13,"Apply"),l()()()()),t&2&&(m(5),A(i.controller?5:-1),m(3),A(i.settings?8:-1))},dependencies:[ne,dt,vn,G,pe,Lt,qt,eo,o5,Zd],styles:[".top-button[_ngcontent-%COMP%]{height:36px;margin-top:16px}"],changeDetection:0})}return n})();var T$=(()=>{class n{route=f(lt);controllerService=f(nt);toasterService=f(ie);cd=f(X);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 i=t.error?.message||t.message||"Failed to load controller";this.toasterService.error(i),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,i){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),_("input",function(a){return i.vpcsExecutable.set(a.target.value)}),l()()()()),t&2&&(m(7),C("value",i.vpcsExecutable()))},dependencies:[ne,we,Me,Se,Te],styles:[".form-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var TFe=["container"],E$=(()=>{class n{sanitizer=f(xr);changeDetector=f(X);mapSettingsService=f(_o);consoleService=f(mr);toasterService=f(ie);router=f(_t);vncConsoleService=f(gp);project=ae(void 0);controller;contextConsoleMenu=Rt(Fn);container=Rt("container",{read:ro});componentBrowserRef;topPosition=Q(void 0);leftPosition=Q(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,i){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,i),this.contextConsoleMenu().openMenu())}openConsole(){this.mapSettingsService.setConsoleContextMenuAction("console"),this.componentBrowserRef=this.container().createComponent(lg),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.node.console_type==="docker_exec"?(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"||this.node.console_type==="docker_exec"){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,i){t&1&&Xt(i.contextConsoleMenu,Fn,5)(i.container,TFe,5,ro),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,i){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),_("click",function(){return i.openConsole()}),s(7,"mat-icon"),d(8,"web_asset"),l(),s(9,"span"),d(10,"Open console"),l()(),s(11,"button",6),_("click",function(){return i.openWebConsole()}),s(12,"mat-icon"),d(13,"http"),l(),s(14,"span"),d(15,"Open web console"),l()(),s(16,"button",6),_("click",function(){return i.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=ke(3);Yt("left",i.leftPosition())("top",i.topPosition()),m(),C("matMenuTriggerFor",r),m(20),C("hidden",!0)}},dependencies:[ne,qe,Kn,tt,Fn,oe,de],styles:[".context-menu[_ngcontent-%COMP%]{position:absolute;min-height:0}.title[_ngcontent-%COMP%]{margin:8px}"],changeDetection:0})}return n})();var D$=(()=>{class n{controllerService=f(nt);settingsService=f(Qr);toasterService=f(ie);nodeService=f(ut);controller=ae(void 0);nodes=ae([]);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,i){t&1&&(s(0,"button",0),_("click",function(){return i.console()}),s(1,"mat-icon"),d(2,"web_asset"),l(),s(3,"span"),d(4,"Console"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var P$=(()=>{class n{controller=ae(void 0);node=ae(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,i){t&1&&(s(0,"button",0),_("click",function(){return i.open()}),s(1,"mat-icon"),d(2,"tab"),l(),s(3,"span"),d(4,"Open file explorer"),l()())},dependencies:[G,oe,de,qe,tt],encapsulation:2,changeDetection:0})}return n})();var I$=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[Ak,_i,Ak]})}return n})();var A$=[hg,G,qe,kt,OM,oe,we,Se,pn,ve,gs,dn,ns,Lt,eo,gl,pr,gt,ht,yl,oo,I$,ho,ak,qc,oi];var vk=(()=>{class n{settingsService;constructor(e,t){ki.production&&e.events.subscribe(i=>{t.getStatisticsSettings()&&i instanceof Tp&&(gtag("set","page",i.url),gtag("send","pageview"))})}static \u0275fac=function(t){return new(t||n)(ge(_t),ge(Qr))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var O$=(()=>{class n{controllerService;loginService;constructor(e,t){this.controllerService=e,this.loginService=t}intercept(e,t){return t.handle(e).pipe(uo(i=>$o(()=>i)))}async call(){let e=JSON.parse(localStorage.getItem("isRememberMe"))??null,t=this.loginService.controller_id,i=await this.controllerService.get(parseInt(t,10));i.tokenExpired=!0,await this.controllerService.update(i);try{if(e&&e.isRememberMe){let r=await this.loginService.getLoggedUserRefToken(i,e);i.authToken=r.access_token,i.tokenExpired=!1,await this.controllerService.update(i),await this.loginService.getLoggedUser(i),this.reloadCurrentRoute()}}catch(r){throw r}}reloadCurrentRoute(){location.reload()}static \u0275fac=function(t){return new(t||n)(ge(nt),ge(vl))};static \u0275prov=te({token:n,factory:n.\u0275fac})}return n})();var DFe=["switch"],PFe=["*"];function IFe(n,o){n&1&&(s(0,"span",11),ti(),s(1,"svg",13),R(2,"path",14),l(),s(3,"svg",15),R(4,"path",16),l()())}var AFe=new cn("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),Ck=class{source;checked;constructor(o,e){this.source=o,this.checked=e}},OFe=(()=>{class n{_elementRef=f(Jt);_focusMonitor=f(Fa);_changeDetectorRef=f(X);defaults=f(AFe);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(e){return new Ck(this,e)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations=er();_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 _e;toggleChange=new _e;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){f(sr).load(la);let e=f(new hc("tabindex"),{optional:!0}),t=this.defaults;this.tabIndex=e==null?0:parseInt(e)||0,this.color=t.color||"accent",this.id=this._uniqueId=f(To).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 Ck(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,i){if(t&1&&In(DFe,5),t&2){let r;mt(r=pt())&&(i._switchElement=r.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(t,i){t&2&&(Jo("id",i.id),Qt("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),ar(i.color?"mat-"+i.color:""),Ae("mat-mdc-slide-toggle-focused",i._focused)("mat-mdc-slide-toggle-checked",i.checked)("_mat-animation-noopable",i._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",yt],color:"color",disabled:[2,"disabled","disabled",yt],disableRipple:[2,"disableRipple","disableRipple",yt],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:Lo(e)],checked:[2,"checked","checked",yt],hideIcon:[2,"hideIcon","hideIcon",yt],disabledInteractive:[2,"disabledInteractive","disabledInteractive",yt]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[fn([{provide:_d,useExisting:dd(()=>n),multi:!0},{provide:TC,useExisting:n,multi:!0}]),Pn],ngContentSelectors:PFe,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,i){if(t&1&&(ai(),s(0,"div",1)(1,"button",2,0),_("click",function(){return i._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(),I(11,IFe,5,0,"span",11),l()()(),s(12,"label",12),_("click",function(a){return a.stopPropagation()}),an(13),l()()),t&2){let r=ke(2);C("labelPosition",i.labelPosition),m(),Ae("mdc-switch--selected",i.checked)("mdc-switch--unselected",!i.checked)("mdc-switch--checked",i.checked)("mdc-switch--disabled",i.disabled)("mat-mdc-slide-toggle-disabled-interactive",i.disabledInteractive),C("tabIndex",i.disabled&&!i.disabledInteractive?-1:i.tabIndex)("disabled",i.disabled&&!i.disabledInteractive),Qt("id",i.buttonId)("name",i.name)("aria-label",i.ariaLabel)("aria-labelledby",i._getAriaLabelledBy())("aria-describedby",i.ariaDescribedby)("aria-required",i.required||null)("aria-checked",i.checked)("aria-disabled",i.disabled&&i.disabledInteractive?"true":null),m(9),C("matRippleTrigger",r)("matRippleDisabled",i.disableRipple||i.disabled)("matRippleCentered",!0),m(),A(i.hideIcon?-1:11),m(),C("for",i.buttonId),Qt("id",i._labelId)}},dependencies:[Zs,ah],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 transparent;
|
||
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 transparent;
|
||
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: transparent;
|
||
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: 0.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})(),N$=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Gt({type:n});static \u0275inj=Wt({imports:[OFe,_i]})}return n})();function NFe(n,o){if(n&1&&(s(0,"mat-option",4),d(1),l()),n&2){let e=o.$implicit,t=v();C("value",e),m(),ee(" ",t.displayFn()(e)," ")}}var F$=(()=>{class n{data=ae(void 0);filteredData;typeName;autocompleteControl=new $e;eltType=ae(void 0);displayFn=ae(void 0);filterFn=ae(void 0);selectionChange=new _e;constructor(){}ngOnChanges(){this.filteredData=this.autocompleteControl.valueChanges.pipe(gi(""),Bt(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:[Pn],decls:9,vars:6,consts:[["auto","matAutocomplete"],[1,"input-field"],["type","text","matInput","",3,"matAutocomplete","formControl"],[3,"optionSelected","displayWith"],[3,"value"]],template:function(t,i){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),_("optionSelected",function(a){return i.selectionChange.emit(a.option.value)}),K(6,NFe,2,2,"mat-option",4,Oe),nn(8,"async"),l()()),t&2){let r=ke(5);m(2),B(i.eltType()),m(),C("matAutocomplete",r)("formControl",i.autocompleteControl),m(),C("displayWith",i.displayFn()),m(2),Y($n(8,4,i.filteredData))}},dependencies:[ne,Je,Nt,Dt,Et,Ys,we,Me,Xe,Se,Te,lr,Dr,ft,So,Gr],styles:[".input-field[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}return n})();var FFe=(n,o,e,t)=>({"status-uploading":n,"status-done":o,"status-error":e,"status-canceled":t});function RFe(n,o){return this.trackByTempId}function LFe(n,o){if(n&1&&(Fe(0),d(1),Re()),n&2){let e=v(2);m(),mi(" Uploading ",e.activeCount," file",e.activeCount!==1?"s":""," ")}}function VFe(n,o){n&1&&(Fe(0),d(1," Uploads complete "),Re())}function BFe(n,o){if(n&1&&R(0,"mat-progress-bar",6),n&2){let e=v(2);C("value",e.overallProgress)}}function zFe(n,o){n&1&&(Fe(0),d(1,"check_circle"),Re())}function jFe(n,o){n&1&&(Fe(0),d(1,"error"),Re())}function $Fe(n,o){n&1&&(Fe(0),d(1,"cancel"),Re())}function HFe(n,o){n&1&&(Fe(0),d(1,"insert_drive_file"),Re())}function UFe(n,o){n&1&&(s(0,"span",15),d(1,"Queued"),l())}function WFe(n,o){if(n&1&&(s(0,"span",15),d(1),l()),n&2){let e=v().$implicit;m(),ee("",e.progress,"%")}}function GFe(n,o){n&1&&(s(0,"span",16),d(1,"Done"),l())}function qFe(n,o){if(n&1&&(s(0,"span",17),d(1),l()),n&2){let e=v().$implicit;m(),B(e.errorMessage||"Failed")}}function QFe(n,o){n&1&&(s(0,"span",18),d(1,"Canceled"),l())}function XFe(n,o){if(n&1){let e=z();s(0,"button",21),_("click",function(){k(e);let i=v().$implicit,r=v(3);return T(r.cancelUpload(i.tempId))}),s(1,"mat-icon"),d(2,"close"),l()()}}function KFe(n,o){if(n&1&&R(0,"mat-progress-bar",20),n&2){let e=v().$implicit;C("value",e.progress)}}function YFe(n,o){if(n&1){let e=z();s(0,"div",10)(1,"div",11)(2,"mat-icon",12),I(3,zFe,2,0,"ng-container"),I(4,jFe,2,0,"ng-container"),I(5,$Fe,2,0,"ng-container"),I(6,HFe,2,0,"ng-container"),l(),s(7,"div",13),_("click",function(i){let r=k(e).$implicit,a=v(3);return T(a.navigateToFile(r,i))}),s(8,"span",14),d(9),l(),I(10,UFe,2,0,"span",15),I(11,WFe,2,1,"span",15),I(12,GFe,2,0,"span",16),I(13,qFe,2,1,"span",17),I(14,QFe,2,0,"span",18),l(),I(15,XFe,3,0,"button",19),l(),I(16,KFe,1,1,"mat-progress-bar",20),l()}if(n&2){let e=o.$implicit;Ae("dismissing",e.dismissing),m(2),C("ngClass",pC(16,FFe,e.status==="uploading"||e.status==="queued",e.status==="uploaded",e.status==="error",e.status==="canceled")),m(),A(e.status==="uploaded"?3:-1),m(),A(e.status==="error"?4:-1),m(),A(e.status==="canceled"?5:-1),m(),A(e.status==="uploading"||e.status==="queued"?6:-1),m(2),C("title",e.filename),m(),B(e.filename),m(),A(e.status==="queued"?10:-1),m(),A(e.status==="uploading"?11:-1),m(),A(e.status==="uploaded"?12:-1),m(),A(e.status==="error"?13:-1),m(),A(e.status==="canceled"?14:-1),m(),A(e.status==="uploading"||e.status==="queued"?15:-1),m(),A(e.status==="uploading"||e.status==="queued"?16:-1)}}function ZFe(n,o){if(n&1&&(s(0,"div",8),K(1,YFe,17,21,"div",9,RFe,!0),l()),n&2){let e=v(2);m(),Y(e.uploadList)}}function JFe(n,o){if(n&1){let e=z();s(0,"div",0)(1,"div",1),_("click",function(){k(e);let i=v();return T(i.toggleExpanded())}),s(2,"div",2)(3,"mat-icon",3),d(4,"cloud_upload"),l(),s(5,"span",4),I(6,LFe,2,2,"ng-container"),I(7,VFe,2,0,"ng-container"),l()(),s(8,"div",5),I(9,BFe,1,1,"mat-progress-bar",6),s(10,"mat-icon",7),d(11),l()()(),I(12,ZFe,3,0,"div",8),l()}if(n&2){let e=v();m(6),A(e.activeCount>0?6:-1),m(),A(e.activeCount===0?7:-1),m(2),A(e.activeCount>0?9:-1),m(2),B(e.isExpanded()?"expand_more":"expand_less"),m(),A(e.isExpanded()?12:-1)}}var xk=(()=>{class n{imageUploadSessionService=f(Og);router=f(_t);uploads=new Map;isExpanded=Q(!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,i)=>t+(i.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 i=Z(Z({},t||{}),e);e.status==="uploaded"||e.status==="error"||e.status==="canceled"?(i.dismissing=!1,i.dismissTimer=setTimeout(()=>{let r=this.uploads.get(e.tempId);r&&(r.dismissing=!0),setTimeout(()=>{this.uploads.delete(e.tempId)},400)},3e3)):i.dismissing=!1,this.uploads.set(e.tempId,i),!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,i){t&1&&I(0,JFe,13,5,"div",0),t&2&&A(i.hasUploads?0:-1)},dependencies:[ne,Ji,oe,de,gs,Hc,G,ze],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 R$=(()=>{class n{_googleAnalyticsService;constructor(e){this._googleAnalyticsService=e}static \u0275fac=function(t){return new(t||n)(ge(vk))};static \u0275mod=Gt({type:n});static \u0275inj=Wt({providers:[Qr,{provide:GO,useClass:y$},{provide:d4,useClass:O$,multi:!0},ub,Ei,Cl,nt,bl,ut,Pi,pM,Zf,ad,ji,mn,Tg,lM,ie,io,Jf,qo,ui,b$,Y2,Xo,qS,zi,U4,Im,$s,Ml,_k,na,$m,Ma,Tr,_s,cb,lb,sb,Lm,zm,Hm,ka,fs,$c,vs,lf,Jd,Dg,pp,bM,xM,D2,Cp,cg,_o,hw,Eo,mg,vp,Js,Nm,pi,vk,mr,gp,pg,Ag,ri,DM,Ku,P2,SM,vl,Fr],imports:[fC,m4,g$,NM,gg,hM,WM,tk,BM,CM,kg,ug,E$,u5,uk,fk,S2,w2,Jw,Zw,t2,e2,wg,_2,yg,J2,G2,$2,H2,U2,ck,ZM,IM,xp,YM,UM,_M,cf,pb,mb,iM,p2,oM,Pw,Yv,W2,Je,Et,p8,Em,nk,EM,ta,yM,TM,kM,Xv,Rw,Vw,Lw,Bw,Ww,Gw,D$,xk,jw,y2,M2,s2,gw,Yw,k2,u2,h2,C2,x2,c2,d2,m2,P$,Kw,v2,b2,Fw,T2,E2,zw,l2,lg,f2,dg,o2,r2,n2,qw,i2,Qw,fw,L2,a2,qv,Ud,pw,sM,fM,rg,dM,I2,Jx,db,ab,g2,Ya,gM,rM,V2,Ig,Eg,wl,Xw,Jr,Fm,vw,S$,w$,Ow,Dw,_w,Mw,kw,Nw,yw,Aw,Ew,Tw,sf,Sw,ww,Gc,Hb,Wb,Gb,yb,Sb,Cb,xb,Mb,kb,Ab,Db,Ib,Rb,Vb,$b,Ob,Lb,Pb,aM,Cg,qM,LM,QM,Jv,JM,ik,ek,jM,nC,XM,lk,F$,hk,uw,KM,zM,ju,eg,mk,pk,MM,Mg,og,mw,ig,B2,hb,Pg,mM,vM,nb,fb,zb,M$,Ad,T$,k$,Ub,Pm,Vi,qb,$0,$0,Bb,Fb,Nb,jb,Tb,wb,bb,Px,x$,hl,uR,we,qe,Zx,aR,A$,th,N$,Lt,lr,zC,ib,Rg,ng.forRoot()]})}return n})();var L$=(()=>{class n{overlayContainer=f(eh);iconReg=f(z4);sanitizer=f(xr);settingsService=f(Qr);themeService=f(pi);router=f(_t);progressService=f(io);connectionManager=f(Nm);controllerService=f(nt);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(ci(e=>e instanceof Tp)).subscribe(e=>{this.checkAndEstablishConnection(e.url)})}async checkAndEstablishConnection(e){let t=e.match(/\/controller\/(\d+)/);if(!t)return;let i=parseInt(t[1],10);try{let r=await this.controllerService.get(i);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 R4?this.progressService.activate():(e instanceof Tp||e instanceof L4||e instanceof V4)&&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,i){t&1&&R(0,"router-outlet")(1,"app-global-upload-indicator")},dependencies:[ne,dt,ih,xk],styles:["[_nghost-%COMP%]{display:block;height:100%}mat-menu-panel[_ngcontent-%COMP%]{min-height:0px}"],changeDetection:0})}return n})();ki.production&&void 0;a4(L$,{providers:[JO(),UO(R$)]}).then(n=>{p4(n.components[0])}).catch(n=>console.log(n));
|