@whoz-oss/coday-client 0.104.0 → 0.104.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- import{a as Wm,b as ke}from"./chunk-6ZVZINLP.js";import{a as zo,b as $m,c as je,d as Ka,e as Za,f as Ja,g as Be,i as es,k as He,m as ts,n as jo,o as qm,q as is,r as Gm,s as ns,t as os,u as Ym,v as rs,w as Bo,x as Qm,y as Ue}from"./chunk-TMYMW2LL.js";import{A as rc,B as Bm,C as Hm,D as $e,E as lt,F as Pt,G as An,H as In,I as Ke,J as bt,K as Vr,L as le,M as Qa,N as Ot,O as Xa,P as ot,Q as he,R as Me,S as Xm,T as Km,a as Ha,b as Ua,c as tt,d as Nm,e as fi,f as Lr,g as Ni,h as Nt,i as Wa,j as ic,k as Lm,l as Vm,m as Fo,n as $a,o as qa,p as No,q as Ne,r as _t,s as zm,t as jm,u as nc,v as Ga,w as Lo,x as Ya,y as Vo,z as oc}from"./chunk-7NSO7VDA.js";import{a as rn,b as rt}from"./chunk-UPXODNKN.js";import{e as Um}from"./chunk-LBCXFVPY.js";import{$ as ye,$a as eo,$b as Ro,A as Xl,Aa as M,Ab as En,B as Da,Ba as se,Bb as Ye,Ca as xe,Cb as Cm,D as dm,Da as _m,Db as Va,E as Io,Ea as Tt,Eb as xm,Fa as bm,Fb as io,G as Ar,Ga as Re,Gb as wm,Ha as H,Hb as Rr,I as Mt,Ia as pe,J as Qn,Ja as Ft,Jb as Do,K as N,Kb as Sm,L as mm,La as Jl,M as yt,Ma as ec,Mb as ui,N as Ce,Na as J,Nb as no,O as Xn,Ob as Pn,P as L,Pa as C,Pb as Fr,Q as ae,Qa as x,Qb as km,R as oe,Ra as Jn,Rb as Qe,S as Ra,Sa as vm,Sb as ee,T as m,Ta as we,Tb as gi,Ua as Se,Ub as Mm,V as pm,Va as w,Vb as Tm,W as Fa,Wa as s,X as b,Xa as l,Xb as Em,Y as v,Ya as I,Yb as On,Z as nn,Za as ii,Zb as za,_ as Na,_a as ni,_b as ja,a as Z,aa as et,ab as to,ac as Pm,b as ut,ba as Kl,bb as k,bc as Nr,c as rm,cb as Jt,d as te,da as hm,db as f,dc as Fe,e as Ai,ea as La,f as Ii,fa as Oe,fb as u,fc as Om,g as R,ga as nt,gb as We,gc as Am,h as ce,ha as ti,hb as ue,i as am,ia as ne,ib as xt,ja as um,jb as X,k as Rt,kb as U,kc as Xe,l as Oo,lb as W,lc as Im,m as Yl,ma as Ir,mb as ym,mc as Ri,n as sm,nb as Dr,nc as Ba,o as ve,ob as tc,oc as Dm,p as Yn,pa as Zt,pb as Et,pc as Fi,qa as Kn,qb as oi,qc as Rm,r as Ao,ra as gm,rb as E,rc as Fm,sa as d,sb as on,t as lm,ta as Mn,tb as p,u as Di,ua as hi,ub as O,v as me,va as Ct,vb as ie,w as Ql,wb as Tn,x as kn,xa as Zn,xb as V,y as cm,ya as fm,yb as z,z as qt,za as Zl,zb as j}from"./chunk-DYTHVKS2.js";var de=(function(o){return o[o.State=0]="State",o[o.Transition=1]="Transition",o[o.Sequence=2]="Sequence",o[o.Group=3]="Group",o[o.Animate=4]="Animate",o[o.Keyframes=5]="Keyframes",o[o.Style=6]="Style",o[o.Trigger=7]="Trigger",o[o.Reference=8]="Reference",o[o.AnimateChild=9]="AnimateChild",o[o.AnimateRef=10]="AnimateRef",o[o.Query=11]="Query",o[o.Stagger=12]="Stagger",o})(de||{}),ri="*";function ac(o,t){return{type:de.Trigger,name:o,definitions:t,options:{}}}function as(o,t=null){return{type:de.Animate,styles:t,timings:o}}function Zm(o,t=null){return{type:de.Sequence,steps:o,options:t}}function Dn(o){return{type:de.Style,styles:o,offset:null}}function ss(o,t,e=null){return{type:de.Transition,expr:o,animation:t,options:e}}var Li=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(t=0,e=0){this.totalTime=t+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){let e=t=="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},oo=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(t){this.players=t;let e=0,i=0,n=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++e==r&&this._onFinish()}),a.onDestroy(()=>{++i==r&&this._onDestroy()}),a.onStart(()=>{++n==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(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){let e=t*this.totalTime;this.players.forEach(i=>{let n=i.totalTime?Math.min(1,e/i.totalTime):1;i.setPosition(n)})}getPosition(){let t=this.players.reduce((e,i)=>e===null||i.totalTime>e.totalTime?i:e,null);return t!=null?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){let e=t=="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},Ho="!";function Jm(o){return new Ce(3e3,!1)}function Fg(){return new Ce(3100,!1)}function Ng(){return new Ce(3101,!1)}function Lg(o){return new Ce(3001,!1)}function Vg(o){return new Ce(3003,!1)}function zg(o){return new Ce(3004,!1)}function tp(o,t){return new Ce(3005,!1)}function ip(){return new Ce(3006,!1)}function np(){return new Ce(3007,!1)}function op(o,t){return new Ce(3008,!1)}function rp(o){return new Ce(3002,!1)}function ap(o,t,e,i,n){return new Ce(3010,!1)}function sp(){return new Ce(3011,!1)}function lp(){return new Ce(3012,!1)}function cp(){return new Ce(3200,!1)}function dp(){return new Ce(3202,!1)}function mp(){return new Ce(3013,!1)}function pp(o){return new Ce(3014,!1)}function hp(o){return new Ce(3015,!1)}function up(o){return new Ce(3016,!1)}function gp(o,t){return new Ce(3404,!1)}function jg(o){return new Ce(3502,!1)}function fp(o){return new Ce(3503,!1)}function _p(){return new Ce(3300,!1)}function bp(o){return new Ce(3504,!1)}function vp(o){return new Ce(3301,!1)}function yp(o,t){return new Ce(3302,!1)}function Cp(o){return new Ce(3303,!1)}function xp(o,t){return new Ce(3400,!1)}function wp(o){return new Ce(3401,!1)}function Sp(o){return new Ce(3402,!1)}function kp(o,t){return new Ce(3505,!1)}function an(o){switch(o.length){case 0:return new Li;case 1:return o[0];default:return new oo(o)}}function dc(o,t,e=new Map,i=new Map){let n=[],r=[],a=-1,c=null;if(t.forEach(h=>{let g=h.get("offset"),y=g==a,S=y&&c||new Map;h.forEach((A,F)=>{let T=F,B=A;if(F!=="offset")switch(T=o.normalizePropertyName(T,n),B){case Ho:B=e.get(F);break;case ri:B=i.get(F);break;default:B=o.normalizeStyleValue(F,T,B,n);break}S.set(T,B)}),y||r.push(S),c=S,a=g}),n.length)throw jg(n);return r}function ls(o,t,e,i){switch(t){case"start":o.onStart(()=>i(e&&sc(e,"start",o)));break;case"done":o.onDone(()=>i(e&&sc(e,"done",o)));break;case"destroy":o.onDestroy(()=>i(e&&sc(e,"destroy",o)));break}}function sc(o,t,e){let i=e.totalTime,n=!!e.disabled,r=cs(o.element,o.triggerName,o.fromState,o.toState,t||o.phaseName,i??o.totalTime,n),a=o._data;return a!=null&&(r._data=a),r}function cs(o,t,e,i,n="",r=0,a){return{element:o,triggerName:t,fromState:e,toState:i,phaseName:n,totalTime:r,disabled:!!a}}function Gt(o,t,e){let i=o.get(t);return i||o.set(t,i=e),i}function mc(o){let t=o.indexOf(":"),e=o.substring(1,t),i=o.slice(t+1);return[e,i]}var Bg=typeof document>"u"?null:document.documentElement;function ds(o){let t=o.parentNode||o.host||null;return t===Bg?null:t}function Hg(o){return o.substring(1,6)=="ebkit"}var ro=null,ep=!1;function Mp(o){ro||(ro=Ug()||{},ep=ro.style?"WebkitAppearance"in ro.style:!1);let t=!0;return ro.style&&!Hg(o)&&(t=o in ro.style,!t&&ep&&(t="Webkit"+o.charAt(0).toUpperCase()+o.slice(1)in ro.style)),t}function Ug(){return typeof document<"u"?document.body:null}function pc(o,t){for(;t;){if(t===o)return!0;t=ds(t)}return!1}function hc(o,t,e){if(e)return Array.from(o.querySelectorAll(t));let i=o.querySelector(t);return i?[i]:[]}var Wg=1e3,uc="{{",$g="}}",gc="ng-enter",ms="ng-leave",zr="ng-trigger",jr=".ng-trigger",fc="ng-animating",ps=".ng-animating";function Vi(o){if(typeof o=="number")return o;let t=o.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:lc(parseFloat(t[1]),t[2])}function lc(o,t){switch(t){case"s":return o*Wg;default:return o}}function Br(o,t,e){return o.hasOwnProperty("duration")?o:Gg(o,t,e)}var qg=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function Gg(o,t,e){let i,n=0,r="";if(typeof o=="string"){let a=o.match(qg);if(a===null)return t.push(Jm(o)),{duration:0,delay:0,easing:""};i=lc(parseFloat(a[1]),a[2]);let c=a[3];c!=null&&(n=lc(parseFloat(c),a[4]));let h=a[5];h&&(r=h)}else i=o;if(!e){let a=!1,c=t.length;i<0&&(t.push(Fg()),a=!0),n<0&&(t.push(Ng()),a=!0),a&&t.splice(c,0,Jm(o))}return{duration:i,delay:n,easing:r}}function Tp(o){return o.length?o[0]instanceof Map?o:o.map(t=>new Map(Object.entries(t))):[]}function _i(o,t,e){t.forEach((i,n)=>{let r=hs(n);e&&!e.has(n)&&e.set(n,o.style[r]),o.style[r]=i})}function Rn(o,t){t.forEach((e,i)=>{let n=hs(i);o.style[n]=""})}function Uo(o){return Array.isArray(o)?o.length==1?o[0]:Zm(o):o}function Ep(o,t,e){let i=t.params||{},n=_c(o);n.length&&n.forEach(r=>{i.hasOwnProperty(r)||e.push(Lg(r))})}var cc=new RegExp(`${uc}\\s*(.+?)\\s*${$g}`,"g");function _c(o){let t=[];if(typeof o=="string"){let e;for(;e=cc.exec(o);)t.push(e[1]);cc.lastIndex=0}return t}function Wo(o,t,e){let i=`${o}`,n=i.replace(cc,(r,a)=>{let c=t[a];return c==null&&(e.push(Vg(a)),c=""),c.toString()});return n==i?o:n}var Yg=/-+([a-z0-9])/g;function hs(o){return o.replace(Yg,(...t)=>t[1].toUpperCase())}function Pp(o,t){return o===0||t===0}function Op(o,t,e){if(e.size&&t.length){let i=t[0],n=[];if(e.forEach((r,a)=>{i.has(a)||n.push(a),i.set(a,r)}),n.length)for(let r=1;r<t.length;r++){let a=t[r];n.forEach(c=>a.set(c,us(o,c)))}}return t}function Yt(o,t,e){switch(t.type){case de.Trigger:return o.visitTrigger(t,e);case de.State:return o.visitState(t,e);case de.Transition:return o.visitTransition(t,e);case de.Sequence:return o.visitSequence(t,e);case de.Group:return o.visitGroup(t,e);case de.Animate:return o.visitAnimate(t,e);case de.Keyframes:return o.visitKeyframes(t,e);case de.Style:return o.visitStyle(t,e);case de.Reference:return o.visitReference(t,e);case de.AnimateChild:return o.visitAnimateChild(t,e);case de.AnimateRef:return o.visitAnimateRef(t,e);case de.Query:return o.visitQuery(t,e);case de.Stagger:return o.visitStagger(t,e);default:throw zg(t.type)}}function us(o,t){return window.getComputedStyle(o)[t]}var Rc=(()=>{class o{validateStyleProperty(e){return Mp(e)}containsElement(e,i){return pc(e,i)}getParentElement(e){return ds(e)}query(e,i,n){return hc(e,i,n)}computeStyle(e,i,n){return n||""}animate(e,i,n,r,a,c=[],h){return new Li(n,r)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac})}return o})(),so=class{static NOOP=new Rc},lo=class{};var Qg=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"]),vs=class extends lo{normalizePropertyName(t,e){return hs(t)}normalizeStyleValue(t,e,i,n){let r="",a=i.toString().trim();if(Qg.has(e)&&i!==0&&i!=="0")if(typeof i=="number")r="px";else{let c=i.match(/^[+-]?[\d\.]+([a-z]*)$/);c&&c[1].length==0&&n.push(tp(t,i))}return a+r}};var ys="*";function Xg(o,t){let e=[];return typeof o=="string"?o.split(/\s*,\s*/).forEach(i=>Kg(i,e,t)):e.push(o),e}function Kg(o,t,e){if(o[0]==":"){let h=Zg(o,e);if(typeof h=="function"){t.push(h);return}o=h}let i=o.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(i==null||i.length<4)return e.push(hp(o)),t;let n=i[1],r=i[2],a=i[3];t.push(Ap(n,a));let c=n==ys&&a==ys;r[0]=="<"&&!c&&t.push(Ap(a,n))}function Zg(o,t){switch(o){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,i)=>parseFloat(i)>parseFloat(e);case":decrement":return(e,i)=>parseFloat(i)<parseFloat(e);default:return t.push(up(o)),"* => *"}}var gs=new Set(["true","1"]),fs=new Set(["false","0"]);function Ap(o,t){let e=gs.has(o)||fs.has(o),i=gs.has(t)||fs.has(t);return(n,r)=>{let a=o==ys||o==n,c=t==ys||t==r;return!a&&e&&typeof n=="boolean"&&(a=n?gs.has(o):fs.has(o)),!c&&i&&typeof r=="boolean"&&(c=r?gs.has(t):fs.has(t)),a&&c}}var Bp=":self",Jg=new RegExp(`s*${Bp}s*,?`,"g");function Hp(o,t,e,i){return new wc(o).build(t,e,i)}var Ip="",wc=class{_driver;constructor(t){this._driver=t}build(t,e,i){let n=new Sc(e);return this._resetContextStyleTimingState(n),Yt(this,Uo(t),n)}_resetContextStyleTimingState(t){t.currentQuerySelector=Ip,t.collectedStyles=new Map,t.collectedStyles.set(Ip,new Map),t.currentTime=0}visitTrigger(t,e){let i=e.queryCount=0,n=e.depCount=0,r=[],a=[];return t.name.charAt(0)=="@"&&e.errors.push(ip()),t.definitions.forEach(c=>{if(this._resetContextStyleTimingState(e),c.type==de.State){let h=c,g=h.name;g.toString().split(/\s*,\s*/).forEach(y=>{h.name=y,r.push(this.visitState(h,e))}),h.name=g}else if(c.type==de.Transition){let h=this.visitTransition(c,e);i+=h.queryCount,n+=h.depCount,a.push(h)}else e.errors.push(np())}),{type:de.Trigger,name:t.name,states:r,transitions:a,queryCount:i,depCount:n,options:null}}visitState(t,e){let i=this.visitStyle(t.styles,e),n=t.options&&t.options.params||null;if(i.containsDynamicStyles){let r=new Set,a=n||{};i.styles.forEach(c=>{c instanceof Map&&c.forEach(h=>{_c(h).forEach(g=>{a.hasOwnProperty(g)||r.add(g)})})}),r.size&&e.errors.push(op(t.name,[...r.values()]))}return{type:de.State,name:t.name,style:i,options:n?{params:n}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;let i=Yt(this,Uo(t.animation),e),n=Xg(t.expr,e.errors);return{type:de.Transition,matchers:n,animation:i,queryCount:e.queryCount,depCount:e.depCount,options:ao(t.options)}}visitSequence(t,e){return{type:de.Sequence,steps:t.steps.map(i=>Yt(this,i,e)),options:ao(t.options)}}visitGroup(t,e){let i=e.currentTime,n=0,r=t.steps.map(a=>{e.currentTime=i;let c=Yt(this,a,e);return n=Math.max(n,e.currentTime),c});return e.currentTime=n,{type:de.Group,steps:r,options:ao(t.options)}}visitAnimate(t,e){let i=of(t.timings,e.errors);e.currentAnimateTimings=i;let n,r=t.styles?t.styles:Dn({});if(r.type==de.Keyframes)n=this.visitKeyframes(r,e);else{let a=t.styles,c=!1;if(!a){c=!0;let g={};i.easing&&(g.easing=i.easing),a=Dn(g)}e.currentTime+=i.duration+i.delay;let h=this.visitStyle(a,e);h.isEmptyStep=c,n=h}return e.currentAnimateTimings=null,{type:de.Animate,timings:i,style:n,options:null}}visitStyle(t,e){let i=this._makeStyleAst(t,e);return this._validateStyleAst(i,e),i}_makeStyleAst(t,e){let i=[],n=Array.isArray(t.styles)?t.styles:[t.styles];for(let c of n)typeof c=="string"?c===ri?i.push(c):e.errors.push(rp(c)):i.push(new Map(Object.entries(c)));let r=!1,a=null;return i.forEach(c=>{if(c instanceof Map&&(c.has("easing")&&(a=c.get("easing"),c.delete("easing")),!r)){for(let h of c.values())if(h.toString().indexOf(uc)>=0){r=!0;break}}}),{type:de.Style,styles:i,easing:a,offset:t.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(t,e){let i=e.currentAnimateTimings,n=e.currentTime,r=e.currentTime;i&&r>0&&(r-=i.duration+i.delay),t.styles.forEach(a=>{typeof a!="string"&&a.forEach((c,h)=>{let g=e.collectedStyles.get(e.currentQuerySelector),y=g.get(h),S=!0;y&&(r!=n&&r>=y.startTime&&n<=y.endTime&&(e.errors.push(ap(h,y.startTime,y.endTime,r,n)),S=!1),r=y.startTime),S&&g.set(h,{startTime:r,endTime:n}),e.options&&Ep(c,e.options,e.errors)})})}visitKeyframes(t,e){let i={type:de.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(sp()),i;let n=1,r=0,a=[],c=!1,h=!1,g=0,y=t.steps.map(Le=>{let G=this._makeStyleAst(Le,e),fe=G.offset!=null?G.offset:nf(G.styles),re=0;return fe!=null&&(r++,re=G.offset=fe),h=h||re<0||re>1,c=c||re<g,g=re,a.push(re),G});h&&e.errors.push(lp()),c&&e.errors.push(cp());let S=t.steps.length,A=0;r>0&&r<S?e.errors.push(dp()):r==0&&(A=n/(S-1));let F=S-1,T=e.currentTime,B=e.currentAnimateTimings,_e=B.duration;return y.forEach((Le,G)=>{let fe=A>0?G==F?1:A*G:a[G],re=fe*_e;e.currentTime=T+B.delay+re,B.duration=re,this._validateStyleAst(Le,e),Le.offset=fe,i.styles.push(Le)}),i}visitReference(t,e){return{type:de.Reference,animation:Yt(this,Uo(t.animation),e),options:ao(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:de.AnimateChild,options:ao(t.options)}}visitAnimateRef(t,e){return{type:de.AnimateRef,animation:this.visitReference(t.animation,e),options:ao(t.options)}}visitQuery(t,e){let i=e.currentQuerySelector,n=t.options||{};e.queryCount++,e.currentQuery=t;let[r,a]=ef(t.selector);e.currentQuerySelector=i.length?i+" "+r:r,Gt(e.collectedStyles,e.currentQuerySelector,new Map);let c=Yt(this,Uo(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=i,{type:de.Query,selector:r,limit:n.limit||0,optional:!!n.optional,includeSelf:a,animation:c,originalSelector:t.selector,options:ao(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push(mp());let i=t.timings==="full"?{duration:0,delay:0,easing:"full"}:Br(t.timings,e.errors,!0);return{type:de.Stagger,animation:Yt(this,Uo(t.animation),e),timings:i,options:null}}};function ef(o){let t=!!o.split(/\s*,\s*/).find(e=>e==Bp);return t&&(o=o.replace(Jg,"")),o=o.replace(/@\*/g,jr).replace(/@\w+/g,e=>jr+"-"+e.slice(1)).replace(/:animating/g,ps),[o,t]}function tf(o){return o?Z({},o):null}var Sc=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(t){this.errors=t}};function nf(o){if(typeof o=="string")return null;let t=null;if(Array.isArray(o))o.forEach(e=>{if(e instanceof Map&&e.has("offset")){let i=e;t=parseFloat(i.get("offset")),i.delete("offset")}});else if(o instanceof Map&&o.has("offset")){let e=o;t=parseFloat(e.get("offset")),e.delete("offset")}return t}function of(o,t){if(o.hasOwnProperty("duration"))return o;if(typeof o=="number"){let r=Br(o,t).duration;return bc(r,0,"")}let e=o;if(e.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=bc(0,0,"");return r.dynamic=!0,r.strValue=e,r}let n=Br(e,t);return bc(n.duration,n.delay,n.easing)}function ao(o){return o?(o=Z({},o),o.params&&(o.params=tf(o.params))):o={},o}function bc(o,t,e){return{duration:o,delay:t,easing:e}}function Fc(o,t,e,i,n,r,a=null,c=!1){return{type:1,element:o,keyframes:t,preStyleProps:e,postStyleProps:i,duration:n,delay:r,totalTime:n+r,easing:a,subTimeline:c}}var Ur=class{_map=new Map;get(t){return this._map.get(t)||[]}append(t,e){let i=this._map.get(t);i||this._map.set(t,i=[]),i.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}},rf=1,af=":enter",sf=new RegExp(af,"g"),lf=":leave",cf=new RegExp(lf,"g");function Up(o,t,e,i,n,r=new Map,a=new Map,c,h,g=[]){return new kc().buildKeyframes(o,t,e,i,n,r,a,c,h,g)}var kc=class{buildKeyframes(t,e,i,n,r,a,c,h,g,y=[]){g=g||new Ur;let S=new Mc(t,e,g,n,r,y,[]);S.options=h;let A=h.delay?Vi(h.delay):0;S.currentTimeline.delayNextStep(A),S.currentTimeline.setStyles([a],null,S.errors,h),Yt(this,i,S);let F=S.timelines.filter(T=>T.containsAnimation());if(F.length&&c.size){let T;for(let B=F.length-1;B>=0;B--){let _e=F[B];if(_e.element===e){T=_e;break}}T&&!T.allowOnlyTimelineStyles()&&T.setStyles([c],null,S.errors,h)}return F.length?F.map(T=>T.buildKeyframes()):[Fc(e,[],[],[],0,A,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){let i=e.subInstructions.get(e.element);if(i){let n=e.createSubContext(t.options),r=e.currentTimeline.currentTime,a=this._visitSubInstructions(i,n,n.options);r!=a&&e.transformIntoNewTimeline(a)}e.previousNode=t}visitAnimateRef(t,e){let i=e.createSubContext(t.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([t.options,t.animation.options],e,i),this.visitReference(t.animation,i),e.transformIntoNewTimeline(i.currentTimeline.currentTime),e.previousNode=t}_applyAnimationRefDelays(t,e,i){for(let n of t){let r=n?.delay;if(r){let a=typeof r=="number"?r:Vi(Wo(r,n?.params??{},e.errors));i.delayNextStep(a)}}}_visitSubInstructions(t,e,i){let r=e.currentTimeline.currentTime,a=i.duration!=null?Vi(i.duration):null,c=i.delay!=null?Vi(i.delay):null;return a!==0&&t.forEach(h=>{let g=e.appendInstructionToTimeline(h,a,c);r=Math.max(r,g.duration+g.delay)}),r}visitReference(t,e){e.updateOptions(t.options,!0),Yt(this,t.animation,e),e.previousNode=t}visitSequence(t,e){let i=e.subContextCount,n=e,r=t.options;if(r&&(r.params||r.delay)&&(n=e.createSubContext(r),n.transformIntoNewTimeline(),r.delay!=null)){n.previousNode.type==de.Style&&(n.currentTimeline.snapshotCurrentStyles(),n.previousNode=Cs);let a=Vi(r.delay);n.delayNextStep(a)}t.steps.length&&(t.steps.forEach(a=>Yt(this,a,n)),n.currentTimeline.applyStylesToKeyframe(),n.subContextCount>i&&n.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){let i=[],n=e.currentTimeline.currentTime,r=t.options&&t.options.delay?Vi(t.options.delay):0;t.steps.forEach(a=>{let c=e.createSubContext(t.options);r&&c.delayNextStep(r),Yt(this,a,c),n=Math.max(n,c.currentTimeline.currentTime),i.push(c.currentTimeline)}),i.forEach(a=>e.currentTimeline.mergeTimelineCollectedStyles(a)),e.transformIntoNewTimeline(n),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){let i=t.strValue,n=e.params?Wo(i,e.params,e.errors):i;return Br(n,e.errors)}else return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){let i=e.currentAnimateTimings=this._visitTiming(t.timings,e),n=e.currentTimeline;i.delay&&(e.incrementTime(i.delay),n.snapshotCurrentStyles());let r=t.style;r.type==de.Keyframes?this.visitKeyframes(r,e):(e.incrementTime(i.duration),this.visitStyle(r,e),n.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){let i=e.currentTimeline,n=e.currentAnimateTimings;!n&&i.hasCurrentStyleProperties()&&i.forwardFrame();let r=n&&n.easing||t.easing;t.isEmptyStep?i.applyEmptyStep(r):i.setStyles(t.styles,r,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){let i=e.currentAnimateTimings,n=e.currentTimeline.duration,r=i.duration,c=e.createSubContext().currentTimeline;c.easing=i.easing,t.styles.forEach(h=>{let g=h.offset||0;c.forwardTime(g*r),c.setStyles(h.styles,h.easing,e.errors,e.options),c.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(c),e.transformIntoNewTimeline(n+r),e.previousNode=t}visitQuery(t,e){let i=e.currentTimeline.currentTime,n=t.options||{},r=n.delay?Vi(n.delay):0;r&&(e.previousNode.type===de.Style||i==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=Cs);let a=i,c=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!n.optional,e.errors);e.currentQueryTotal=c.length;let h=null;c.forEach((g,y)=>{e.currentQueryIndex=y;let S=e.createSubContext(t.options,g);r&&S.delayNextStep(r),g===e.element&&(h=S.currentTimeline),Yt(this,t.animation,S),S.currentTimeline.applyStylesToKeyframe();let A=S.currentTimeline.currentTime;a=Math.max(a,A)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(a),h&&(e.currentTimeline.mergeTimelineCollectedStyles(h),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){let i=e.parentContext,n=e.currentTimeline,r=t.timings,a=Math.abs(r.duration),c=a*(e.currentQueryTotal-1),h=a*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":h=c-h;break;case"full":h=i.currentStaggerTime;break}let y=e.currentTimeline;h&&y.delayNextStep(h);let S=y.currentTime;Yt(this,t.animation,e),e.previousNode=t,i.currentStaggerTime=n.currentTime-S+(n.startTime-i.currentTimeline.startTime)}},Cs={},Mc=class o{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Cs;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(t,e,i,n,r,a,c,h){this._driver=t,this.element=e,this.subInstructions=i,this._enterClassName=n,this._leaveClassName=r,this.errors=a,this.timelines=c,this.currentTimeline=h||new xs(this._driver,e,0),c.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;let i=t,n=this.options;i.duration!=null&&(n.duration=Vi(i.duration)),i.delay!=null&&(n.delay=Vi(i.delay));let r=i.params;if(r){let a=n.params;a||(a=this.options.params={}),Object.keys(r).forEach(c=>{(!e||!a.hasOwnProperty(c))&&(a[c]=Wo(r[c],a,this.errors))})}}_copyOptions(){let t={};if(this.options){let e=this.options.params;if(e){let i=t.params={};Object.keys(e).forEach(n=>{i[n]=e[n]})}}return t}createSubContext(t=null,e,i){let n=e||this.element,r=new o(this._driver,n,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(n,i||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(t),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(t){return this.previousNode=Cs,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,i){let n={duration:e??t.duration,delay:this.currentTimeline.currentTime+(i??0)+t.delay,easing:""},r=new Tc(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,n,t.stretchStartingKeyframe);return this.timelines.push(r),n}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,i,n,r,a){let c=[];if(n&&c.push(this.element),t.length>0){t=t.replace(sf,"."+this._enterClassName),t=t.replace(cf,"."+this._leaveClassName);let h=i!=1,g=this._driver.query(this.element,t,h);i!==0&&(g=i<0?g.slice(g.length+i,g.length):g.slice(0,i)),c.push(...g)}return!r&&c.length==0&&a.push(pp(e)),c}},xs=class o{_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(t,e,i,n){this._driver=t,this.element=e,this.startTime=i,this._elementTimelineStylesLookup=n,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(t){let e=this._keyframes.size===1&&this._pendingStyles.size;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new o(this._driver,t,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+=rf,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles.set(t,e),this._globalTimelineStyles.set(t,e),this._styleSummary.set(t,{time:this.currentTime,value:e})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&this._previousKeyframe.set("easing",t);for(let[e,i]of this._globalTimelineStyles)this._backFill.set(e,i||ri),this._currentKeyframe.set(e,ri);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,i,n){e&&this._previousKeyframe.set("easing",e);let r=n&&n.params||{},a=df(t,this._globalTimelineStyles);for(let[c,h]of a){let g=Wo(h,r,i);this._pendingStyles.set(c,g),this._localTimelineStyles.has(c)||this._backFill.set(c,this._globalTimelineStyles.get(c)??ri),this._updateStyle(c,g)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((t,e)=>{this._currentKeyframe.set(e,t)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((t,e)=>{this._currentKeyframe.has(e)||this._currentKeyframe.set(e,t)}))}snapshotCurrentStyles(){for(let[t,e]of this._localTimelineStyles)this._pendingStyles.set(t,e),this._updateStyle(t,e)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){t._styleSummary.forEach((e,i)=>{let n=this._styleSummary.get(i);(!n||e.time>n.time)&&this._updateStyle(i,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let t=new Set,e=new Set,i=this._keyframes.size===1&&this.duration===0,n=[];this._keyframes.forEach((c,h)=>{let g=new Map([...this._backFill,...c]);g.forEach((y,S)=>{y===Ho?t.add(S):y===ri&&e.add(S)}),i||g.set("offset",h/this.duration),n.push(g)});let r=[...t.values()],a=[...e.values()];if(i){let c=n[0],h=new Map(c);c.set("offset",0),h.set("offset",1),n=[c,h]}return Fc(this.element,n,r,a,this.duration,this.startTime,this.easing,!1)}},Tc=class extends xs{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(t,e,i,n,r,a,c=!1){super(t,e,a.delay),this.keyframes=i,this.preStyleProps=n,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 t=this.keyframes,{delay:e,duration:i,easing:n}=this.timings;if(this._stretchStartingKeyframe&&e){let r=[],a=i+e,c=e/a,h=new Map(t[0]);h.set("offset",0),r.push(h);let g=new Map(t[0]);g.set("offset",Dp(c)),r.push(g);let y=t.length-1;for(let S=1;S<=y;S++){let A=new Map(t[S]),F=A.get("offset"),T=e+F*i;A.set("offset",Dp(T/a)),r.push(A)}i=a,e=0,n="",t=r}return Fc(this.element,t,this.preStyleProps,this.postStyleProps,i,e,n,!0)}};function Dp(o,t=3){let e=Math.pow(10,t-1);return Math.round(o*e)/e}function df(o,t){let e=new Map,i;return o.forEach(n=>{if(n==="*"){i??=t.keys();for(let r of i)e.set(r,ri)}else for(let[r,a]of n)e.set(r,a)}),e}function Rp(o,t,e,i,n,r,a,c,h,g,y,S,A){return{type:0,element:o,triggerName:t,isRemovalTransition:n,fromState:e,fromStyles:r,toState:i,toStyles:a,timelines:c,queriedElements:h,preStyleProps:g,postStyleProps:y,totalTime:S,errors:A}}var vc={},ws=class{_triggerName;ast;_stateStyles;constructor(t,e,i){this._triggerName=t,this.ast=e,this._stateStyles=i}match(t,e,i,n){return mf(this.ast.matchers,t,e,i,n)}buildStyles(t,e,i){let n=this._stateStyles.get("*");return t!==void 0&&(n=this._stateStyles.get(t?.toString())||n),n?n.buildStyles(e,i):new Map}build(t,e,i,n,r,a,c,h,g,y){let S=[],A=this.ast.options&&this.ast.options.params||vc,F=c&&c.params||vc,T=this.buildStyles(i,F,S),B=h&&h.params||vc,_e=this.buildStyles(n,B,S),Le=new Set,G=new Map,fe=new Map,re=n==="void",it={params:Wp(B,A),delay:this.ast.options?.delay},De=y?[]:Up(t,e,this.ast.animation,r,a,T,_e,it,g,S),Je=0;return De.forEach(wt=>{Je=Math.max(wt.duration+wt.delay,Je)}),S.length?Rp(e,this._triggerName,i,n,re,T,_e,[],[],G,fe,Je,S):(De.forEach(wt=>{let Zi=wt.element,wn=Gt(G,Zi,new Set);wt.preStyleProps.forEach(pi=>wn.add(pi));let ft=Gt(fe,Zi,new Set);wt.postStyleProps.forEach(pi=>ft.add(pi)),Zi!==e&&Le.add(Zi)}),Rp(e,this._triggerName,i,n,re,T,_e,De,[...Le.values()],G,fe,Je))}};function mf(o,t,e,i,n){return o.some(r=>r(t,e,i,n))}function Wp(o,t){let e=Z({},t);return Object.entries(o).forEach(([i,n])=>{n!=null&&(e[i]=n)}),e}var Ec=class{styles;defaultParams;normalizer;constructor(t,e,i){this.styles=t,this.defaultParams=e,this.normalizer=i}buildStyles(t,e){let i=new Map,n=Wp(t,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((a,c)=>{a&&(a=Wo(a,n,e));let h=this.normalizer.normalizePropertyName(c,e);a=this.normalizer.normalizeStyleValue(c,h,a,e),i.set(c,a)})}),i}};function pf(o,t,e){return new Pc(o,t,e)}var Pc=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(t,e,i){this.name=t,this.ast=e,this._normalizer=i,e.states.forEach(n=>{let r=n.options&&n.options.params||{};this.states.set(n.name,new Ec(n.style,r,i))}),Fp(this.states,"true","1"),Fp(this.states,"false","0"),e.transitions.forEach(n=>{this.transitionFactories.push(new ws(t,n,this.states))}),this.fallbackTransition=hf(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,i,n){return this.transitionFactories.find(a=>a.match(t,e,i,n))||null}matchStyles(t,e,i){return this.fallbackTransition.buildStyles(t,e,i)}};function hf(o,t,e){let i=[(a,c)=>!0],n={type:de.Sequence,steps:[],options:null},r={type:de.Transition,animation:n,matchers:i,options:null,queryCount:0,depCount:0};return new ws(o,r,t)}function Fp(o,t,e){o.has(t)?o.has(e)||o.set(e,o.get(t)):o.has(e)&&o.set(t,o.get(e))}var uf=new Ur,Oc=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(t,e,i){this.bodyNode=t,this._driver=e,this._normalizer=i}register(t,e){let i=[],n=[],r=Hp(this._driver,e,i,n);if(i.length)throw fp(i);this._animations.set(t,r)}_buildPlayer(t,e,i){let n=t.element,r=dc(this._normalizer,t.keyframes,e,i);return this._driver.animate(n,r,t.duration,t.delay,t.easing,[],!0)}create(t,e,i={}){let n=[],r=this._animations.get(t),a,c=new Map;if(r?(a=Up(this._driver,e,r,gc,ms,new Map,new Map,i,uf,n),a.forEach(y=>{let S=Gt(c,y.element,new Map);y.postStyleProps.forEach(A=>S.set(A,null))})):(n.push(_p()),a=[]),n.length)throw bp(n);c.forEach((y,S)=>{y.forEach((A,F)=>{y.set(F,this._driver.computeStyle(S,F,ri))})});let h=a.map(y=>{let S=c.get(y.element);return this._buildPlayer(y,new Map,S)}),g=an(h);return this._playersById.set(t,g),g.onDestroy(()=>this.destroy(t)),this.players.push(g),g}destroy(t){let e=this._getPlayer(t);e.destroy(),this._playersById.delete(t);let i=this.players.indexOf(e);i>=0&&this.players.splice(i,1)}_getPlayer(t){let e=this._playersById.get(t);if(!e)throw vp(t);return e}listen(t,e,i,n){let r=cs(e,"","","");return ls(this._getPlayer(t),i,r,n),()=>{}}command(t,e,i,n){if(i=="register"){this.register(t,n[0]);return}if(i=="create"){let a=n[0]||{};this.create(t,e,a);return}let r=this._getPlayer(t);switch(i){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(n[0]));break;case"destroy":this.destroy(t);break}}},Np="ng-animate-queued",gf=".ng-animate-queued",yc="ng-animate-disabled",ff=".ng-animate-disabled",_f="ng-star-inserted",bf=".ng-star-inserted",vf=[],$p={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},yf={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},bi="__ng_removed",Wr=class{namespaceId;value;options;get params(){return this.options.params}constructor(t,e=""){this.namespaceId=e;let i=t&&t.hasOwnProperty("value"),n=i?t.value:t;if(this.value=xf(n),i){let r=t,{value:a}=r,c=rm(r,["value"]);this.options=c}else this.options={};this.options.params||(this.options.params={})}absorbOptions(t){let e=t.params;if(e){let i=this.options.params;Object.keys(e).forEach(n=>{i[n]==null&&(i[n]=e[n])})}}},Hr="void",Cc=new Wr(Hr),Ac=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(t,e,i){this.id=t,this.hostElement=e,this._engine=i,this._hostClassName="ng-tns-"+t,ai(e,this._hostClassName)}listen(t,e,i,n){if(!this._triggers.has(e))throw yp(i,e);if(i==null||i.length==0)throw Cp(e);if(!wf(i))throw xp(i,e);let r=Gt(this._elementListeners,t,[]),a={name:e,phase:i,callback:n};r.push(a);let c=Gt(this._engine.statesByElement,t,new Map);return c.has(e)||(ai(t,zr),ai(t,zr+"-"+e),c.set(e,Cc)),()=>{this._engine.afterFlush(()=>{let h=r.indexOf(a);h>=0&&r.splice(h,1),this._triggers.has(e)||c.delete(e)})}}register(t,e){return this._triggers.has(t)?!1:(this._triggers.set(t,e),!0)}_getTrigger(t){let e=this._triggers.get(t);if(!e)throw wp(t);return e}trigger(t,e,i,n=!0){let r=this._getTrigger(e),a=new $r(this.id,e,t),c=this._engine.statesByElement.get(t);c||(ai(t,zr),ai(t,zr+"-"+e),this._engine.statesByElement.set(t,c=new Map));let h=c.get(e),g=new Wr(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&h&&g.absorbOptions(h.options),c.set(e,g),h||(h=Cc),!(g.value===Hr)&&h.value===g.value){if(!Mf(h.params,g.params)){let B=[],_e=r.matchStyles(h.value,h.params,B),Le=r.matchStyles(g.value,g.params,B);B.length?this._engine.reportError(B):this._engine.afterFlush(()=>{Rn(t,_e),_i(t,Le)})}return}let A=Gt(this._engine.playersByElement,t,[]);A.forEach(B=>{B.namespaceId==this.id&&B.triggerName==e&&B.queued&&B.destroy()});let F=r.matchTransition(h.value,g.value,t,g.params),T=!1;if(!F){if(!n)return;F=r.fallbackTransition,T=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:F,fromState:h,toState:g,player:a,isFallbackTransition:T}),T||(ai(t,Np),a.onStart(()=>{$o(t,Np)})),a.onDone(()=>{let B=this.players.indexOf(a);B>=0&&this.players.splice(B,1);let _e=this._engine.playersByElement.get(t);if(_e){let Le=_e.indexOf(a);Le>=0&&_e.splice(Le,1)}}),this.players.push(a),A.push(a),a}deregister(t){this._triggers.delete(t),this._engine.statesByElement.forEach(e=>e.delete(t)),this._elementListeners.forEach((e,i)=>{this._elementListeners.set(i,e.filter(n=>n.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);let e=this._engine.playersByElement.get(t);e&&(e.forEach(i=>i.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){let i=this._engine.driver.query(t,jr,!0);i.forEach(n=>{if(n[bi])return;let r=this._engine.fetchNamespacesByElement(n);r.size?r.forEach(a=>a.triggerLeaveAnimation(n,e,!1,!0)):this.clearElementCache(n)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(n=>this.clearElementCache(n)))}triggerLeaveAnimation(t,e,i,n){let r=this._engine.statesByElement.get(t),a=new Map;if(r){let c=[];if(r.forEach((h,g)=>{if(a.set(g,h.value),this._triggers.has(g)){let y=this.trigger(t,g,Hr,n);y&&c.push(y)}}),c.length)return this._engine.markElementAsRemoved(this.id,t,!0,e,a),i&&an(c).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){let e=this._elementListeners.get(t),i=this._engine.statesByElement.get(t);if(e&&i){let n=new Set;e.forEach(r=>{let a=r.name;if(n.has(a))return;n.add(a);let h=this._triggers.get(a).fallbackTransition,g=i.get(a)||Cc,y=new Wr(Hr),S=new $r(this.id,a,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:a,transition:h,fromState:g,toState:y,player:S,isFallbackTransition:!0})})}}removeNode(t,e){let i=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let n=!1;if(i.totalAnimations){let r=i.players.length?i.playersByQueriedElement.get(t):[];if(r&&r.length)n=!0;else{let a=t;for(;a=a.parentNode;)if(i.statesByElement.get(a)){n=!0;break}}}if(this.prepareLeaveAnimationListeners(t),n)i.markElementAsRemoved(this.id,t,!1,e);else{let r=t[bi];(!r||r===$p)&&(i.afterFlush(()=>this.clearElementCache(t)),i.destroyInnerAnimations(t),i._onRemovalComplete(t,e))}}insertNode(t,e){ai(t,this._hostClassName)}drainQueuedTransitions(t){let e=[];return this._queue.forEach(i=>{let n=i.player;if(n.destroyed)return;let r=i.element,a=this._elementListeners.get(r);a&&a.forEach(c=>{if(c.name==i.triggerName){let h=cs(r,i.triggerName,i.fromState.value,i.toState.value);h._data=t,ls(i.player,c.phase,h,c.callback)}}),n.markedForDestroy?this._engine.afterFlush(()=>{n.destroy()}):e.push(i)}),this._queue=[],e.sort((i,n)=>{let r=i.transition.ast.depCount,a=n.transition.ast.depCount;return r==0||a==0?r-a:this._engine.driver.containsElement(i.element,n.element)?1:-1})}destroy(t){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}},Ic=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=(t,e)=>{};_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}constructor(t,e,i){this.bodyNode=t,this.driver=e,this._normalizer=i}get queuedPlayers(){let t=[];return this._namespaceList.forEach(e=>{e.players.forEach(i=>{i.queued&&t.push(i)})}),t}createNamespace(t,e){let i=new Ac(t,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(i,e):(this.newHostElements.set(e,i),this.collectEnterElement(e)),this._namespaceLookup[t]=i}_balanceNamespaceList(t,e){let i=this._namespaceList,n=this.namespacesByHostElement;if(i.length-1>=0){let a=!1,c=this.driver.getParentElement(e);for(;c;){let h=n.get(c);if(h){let g=i.indexOf(h);i.splice(g+1,0,t),a=!0;break}c=this.driver.getParentElement(c)}a||i.unshift(t)}else i.push(t);return n.set(e,t),t}register(t,e){let i=this._namespaceLookup[t];return i||(i=this.createNamespace(t,e)),i}registerTrigger(t,e,i){let n=this._namespaceLookup[t];n&&n.register(e,i)&&this.totalAnimations++}destroy(t,e){t&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let i=this._fetchNamespace(t);this.namespacesByHostElement.delete(i.hostElement);let n=this._namespaceList.indexOf(i);n>=0&&this._namespaceList.splice(n,1),i.destroy(e),delete this._namespaceLookup[t]}))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){let e=new Set,i=this.statesByElement.get(t);if(i){for(let n of i.values())if(n.namespaceId){let r=this._fetchNamespace(n.namespaceId);r&&e.add(r)}}return e}trigger(t,e,i,n){if(_s(e)){let r=this._fetchNamespace(t);if(r)return r.trigger(e,i,n),!0}return!1}insertNode(t,e,i,n){if(!_s(e))return;let r=e[bi];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let a=this.collectedLeaveElements.indexOf(e);a>=0&&this.collectedLeaveElements.splice(a,1)}if(t){let a=this._fetchNamespace(t);a&&a.insertNode(e,i)}n&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),ai(t,yc)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),$o(t,yc))}removeNode(t,e,i){if(_s(e)){let n=t?this._fetchNamespace(t):null;n?n.removeNode(e,i):this.markElementAsRemoved(t,e,!1,i);let r=this.namespacesByHostElement.get(e);r&&r.id!==t&&r.removeNode(e,i)}else this._onRemovalComplete(e,i)}markElementAsRemoved(t,e,i,n,r){this.collectedLeaveElements.push(e),e[bi]={namespaceId:t,setForRemoval:n,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:r}}listen(t,e,i,n,r){return _s(e)?this._fetchNamespace(t).listen(e,i,n,r):()=>{}}_buildInstruction(t,e,i,n,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,i,n,t.fromState.options,t.toState.options,e,r)}destroyInnerAnimations(t){let e=this.driver.query(t,jr,!0);e.forEach(i=>this.destroyActiveAnimationsForElement(i)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(t,ps,!0),e.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(t){let e=this.playersByElement.get(t);e&&e.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(t){let e=this.playersByQueriedElement.get(t);e&&e.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return an(this.players).onDone(()=>t());t()})}processLeaveNode(t){let e=t[bi];if(e&&e.setForRemoval){if(t[bi]=$p,e.namespaceId){this.destroyInnerAnimations(t);let i=this._fetchNamespace(e.namespaceId);i&&i.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}t.classList?.contains(yc)&&this.markElementAsDisabled(t,!1),this.driver.query(t,ff,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,n)=>this._balanceNamespaceList(i,n)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;i<this.collectedEnterElements.length;i++){let n=this.collectedEnterElements[i];ai(n,_f)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let i=[];try{e=this._flushAnimations(i,t)}finally{for(let n=0;n<i.length;n++)i[n]()}}else for(let i=0;i<this.collectedLeaveElements.length;i++){let n=this.collectedLeaveElements[i];this.processLeaveNode(n)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(i=>i()),this._flushFns=[],this._whenQuietFns.length){let i=this._whenQuietFns;this._whenQuietFns=[],e.length?an(e).onDone(()=>{i.forEach(n=>n())}):i.forEach(n=>n())}}reportError(t){throw Sp(t)}_flushAnimations(t,e){let i=new Ur,n=[],r=new Map,a=[],c=new Map,h=new Map,g=new Map,y=new Set;this.disabledNodes.forEach($=>{y.add($);let Y=this.driver.query($,gf,!0);for(let K=0;K<Y.length;K++)y.add(Y[K])});let S=this.bodyNode,A=Array.from(this.statesByElement.keys()),F=zp(A,this.collectedEnterElements),T=new Map,B=0;F.forEach(($,Y)=>{let K=gc+B++;T.set(Y,K),$.forEach(be=>ai(be,K))});let _e=[],Le=new Set,G=new Set;for(let $=0;$<this.collectedLeaveElements.length;$++){let Y=this.collectedLeaveElements[$],K=Y[bi];K&&K.setForRemoval&&(_e.push(Y),Le.add(Y),K.hasAnimation?this.driver.query(Y,bf,!0).forEach(be=>Le.add(be)):G.add(Y))}let fe=new Map,re=zp(A,Array.from(Le));re.forEach(($,Y)=>{let K=ms+B++;fe.set(Y,K),$.forEach(be=>ai(be,K))}),t.push(()=>{F.forEach(($,Y)=>{let K=T.get(Y);$.forEach(be=>$o(be,K))}),re.forEach(($,Y)=>{let K=fe.get(Y);$.forEach(be=>$o(be,K))}),_e.forEach($=>{this.processLeaveNode($)})});let it=[],De=[];for(let $=this._namespaceList.length-1;$>=0;$--)this._namespaceList[$].drainQueuedTransitions(e).forEach(K=>{let be=K.player,st=K.element;if(it.push(be),this.collectedEnterElements.length){let ct=st[bi];if(ct&&ct.setForMove){if(ct.previousTriggersValues&&ct.previousTriggersValues.has(K.triggerName)){let Wt=ct.previousTriggersValues.get(K.triggerName),Dt=this.statesByElement.get(K.element);if(Dt&&Dt.has(K.triggerName)){let Sn=Dt.get(K.triggerName);Sn.value=Wt,Dt.set(K.triggerName,Sn)}}be.destroy();return}}let Ie=!S||!this.driver.containsElement(S,st),St=fe.get(st),Ve=T.get(st),ze=this._buildInstruction(K,i,Ve,St,Ie);if(ze.errors&&ze.errors.length){De.push(ze);return}if(Ie){be.onStart(()=>Rn(st,ze.fromStyles)),be.onDestroy(()=>_i(st,ze.toStyles)),n.push(be);return}if(K.isFallbackTransition){be.onStart(()=>Rn(st,ze.fromStyles)),be.onDestroy(()=>_i(st,ze.toStyles)),n.push(be);return}let qe=[];ze.timelines.forEach(ct=>{ct.stretchStartingKeyframe=!0,this.disabledNodes.has(ct.element)||qe.push(ct)}),ze.timelines=qe,i.append(st,ze.timelines);let $n={instruction:ze,player:be,element:st};a.push($n),ze.queriedElements.forEach(ct=>Gt(c,ct,[]).push(be)),ze.preStyleProps.forEach((ct,Wt)=>{if(ct.size){let Dt=h.get(Wt);Dt||h.set(Wt,Dt=new Set),ct.forEach((Sn,wo)=>Dt.add(wo))}}),ze.postStyleProps.forEach((ct,Wt)=>{let Dt=g.get(Wt);Dt||g.set(Wt,Dt=new Set),ct.forEach((Sn,wo)=>Dt.add(wo))})});if(De.length){let $=[];De.forEach(Y=>{$.push(kp(Y.triggerName,Y.errors))}),it.forEach(Y=>Y.destroy()),this.reportError($)}let Je=new Map,wt=new Map;a.forEach($=>{let Y=$.element;i.has(Y)&&(wt.set(Y,Y),this._beforeAnimationBuild($.player.namespaceId,$.instruction,Je))}),n.forEach($=>{let Y=$.element;this._getPreviousPlayers(Y,!1,$.namespaceId,$.triggerName,null).forEach(be=>{Gt(Je,Y,[]).push(be),be.destroy()})});let Zi=_e.filter($=>jp($,h,g)),wn=new Map;Vp(wn,this.driver,G,g,ri).forEach($=>{jp($,h,g)&&Zi.push($)});let pi=new Map;F.forEach(($,Y)=>{Vp(pi,this.driver,new Set($),h,Ho)}),Zi.forEach($=>{let Y=wn.get($),K=pi.get($);wn.set($,new Map([...Y?.entries()??[],...K?.entries()??[]]))});let Wn=[],xo=[],ka={};a.forEach($=>{let{element:Y,player:K,instruction:be}=$;if(i.has(Y)){if(y.has(Y)){K.onDestroy(()=>_i(Y,be.toStyles)),K.disabled=!0,K.overrideTotalTime(be.totalTime),n.push(K);return}let st=ka;if(wt.size>1){let St=Y,Ve=[];for(;St=St.parentNode;){let ze=wt.get(St);if(ze){st=ze;break}Ve.push(St)}Ve.forEach(ze=>wt.set(ze,st))}let Ie=this._buildAnimation(K.namespaceId,be,Je,r,pi,wn);if(K.setRealPlayer(Ie),st===ka)Wn.push(K);else{let St=this.playersByElement.get(st);St&&St.length&&(K.parentPlayer=an(St)),n.push(K)}}else Rn(Y,be.fromStyles),K.onDestroy(()=>_i(Y,be.toStyles)),xo.push(K),y.has(Y)&&n.push(K)}),xo.forEach($=>{let Y=r.get($.element);if(Y&&Y.length){let K=an(Y);$.setRealPlayer(K)}}),n.forEach($=>{$.parentPlayer?$.syncPlayerEvents($.parentPlayer):$.destroy()});for(let $=0;$<_e.length;$++){let Y=_e[$],K=Y[bi];if($o(Y,ms),K&&K.hasAnimation)continue;let be=[];if(c.size){let Ie=c.get(Y);Ie&&Ie.length&&be.push(...Ie);let St=this.driver.query(Y,ps,!0);for(let Ve=0;Ve<St.length;Ve++){let ze=c.get(St[Ve]);ze&&ze.length&&be.push(...ze)}}let st=be.filter(Ie=>!Ie.destroyed);st.length?Sf(this,Y,st):this.processLeaveNode(Y)}return _e.length=0,Wn.forEach($=>{this.players.push($),$.onDone(()=>{$.destroy();let Y=this.players.indexOf($);this.players.splice(Y,1)}),$.play()}),Wn}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,i,n,r){let a=[];if(e){let c=this.playersByQueriedElement.get(t);c&&(a=c)}else{let c=this.playersByElement.get(t);if(c){let h=!r||r==Hr;c.forEach(g=>{g.queued||!h&&g.triggerName!=n||a.push(g)})}}return(i||n)&&(a=a.filter(c=>!(i&&i!=c.namespaceId||n&&n!=c.triggerName))),a}_beforeAnimationBuild(t,e,i){let n=e.triggerName,r=e.element,a=e.isRemovalTransition?void 0:t,c=e.isRemovalTransition?void 0:n;for(let h of e.timelines){let g=h.element,y=g!==r,S=Gt(i,g,[]);this._getPreviousPlayers(g,y,a,c,e.toState).forEach(F=>{let T=F.getRealPlayer();T.beforeDestroy&&T.beforeDestroy(),F.destroy(),S.push(F)})}Rn(r,e.fromStyles)}_buildAnimation(t,e,i,n,r,a){let c=e.triggerName,h=e.element,g=[],y=new Set,S=new Set,A=e.timelines.map(T=>{let B=T.element;y.add(B);let _e=B[bi];if(_e&&_e.removedBeforeQueried)return new Li(T.duration,T.delay);let Le=B!==h,G=kf((i.get(B)||vf).map(Je=>Je.getRealPlayer())).filter(Je=>{let wt=Je;return wt.element?wt.element===B:!1}),fe=r.get(B),re=a.get(B),it=dc(this._normalizer,T.keyframes,fe,re),De=this._buildPlayer(T,it,G);if(T.subTimeline&&n&&S.add(B),Le){let Je=new $r(t,c,B);Je.setRealPlayer(De),g.push(Je)}return De});g.forEach(T=>{Gt(this.playersByQueriedElement,T.element,[]).push(T),T.onDone(()=>Cf(this.playersByQueriedElement,T.element,T))}),y.forEach(T=>ai(T,fc));let F=an(A);return F.onDestroy(()=>{y.forEach(T=>$o(T,fc)),_i(h,e.toStyles)}),S.forEach(T=>{Gt(n,T,[]).push(F)}),F}_buildPlayer(t,e,i){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,i):new Li(t.duration,t.delay)}},$r=class{namespaceId;triggerName;element;_player=new Li;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(t,e,i){this.namespaceId=t,this.triggerName=e,this.element=i}setRealPlayer(t){this._containsRealPlayer||(this._player=t,this._queuedCallbacks.forEach((e,i)=>{e.forEach(n=>ls(t,i,void 0,n))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){let e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){Gt(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}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(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){let e=this._player;e.triggerCallback&&e.triggerCallback(t)}};function Cf(o,t,e){let i=o.get(t);if(i){if(i.length){let n=i.indexOf(e);i.splice(n,1)}i.length==0&&o.delete(t)}return i}function xf(o){return o??null}function _s(o){return o&&o.nodeType===1}function wf(o){return o=="start"||o=="done"}function Lp(o,t){let e=o.style.display;return o.style.display=t??"none",e}function Vp(o,t,e,i,n){let r=[];e.forEach(h=>r.push(Lp(h)));let a=[];i.forEach((h,g)=>{let y=new Map;h.forEach(S=>{let A=t.computeStyle(g,S,n);y.set(S,A),(!A||A.length==0)&&(g[bi]=yf,a.push(g))}),o.set(g,y)});let c=0;return e.forEach(h=>Lp(h,r[c++])),a}function zp(o,t){let e=new Map;if(o.forEach(c=>e.set(c,[])),t.length==0)return e;let i=1,n=new Set(t),r=new Map;function a(c){if(!c)return i;let h=r.get(c);if(h)return h;let g=c.parentNode;return e.has(g)?h=g:n.has(g)?h=i:h=a(g),r.set(c,h),h}return t.forEach(c=>{let h=a(c);h!==i&&e.get(h).push(c)}),e}function ai(o,t){o.classList?.add(t)}function $o(o,t){o.classList?.remove(t)}function Sf(o,t,e){an(e).onDone(()=>o.processLeaveNode(t))}function kf(o){let t=[];return qp(o,t),t}function qp(o,t){for(let e=0;e<o.length;e++){let i=o[e];i instanceof oo?qp(i.players,t):t.push(i)}}function Mf(o,t){let e=Object.keys(o),i=Object.keys(t);if(e.length!=i.length)return!1;for(let n=0;n<e.length;n++){let r=e[n];if(!t.hasOwnProperty(r)||o[r]!==t[r])return!1}return!0}function jp(o,t,e){let i=e.get(o);if(!i)return!1;let n=t.get(o);return n?i.forEach(r=>n.add(r)):t.set(o,i),e.delete(o),!0}var qo=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(t,e)=>{};constructor(t,e,i){this._driver=e,this._normalizer=i,this._transitionEngine=new Ic(t.body,e,i),this._timelineEngine=new Oc(t.body,e,i),this._transitionEngine.onRemovalComplete=(n,r)=>this.onRemovalComplete(n,r)}registerTrigger(t,e,i,n,r){let a=t+"-"+n,c=this._triggerCache[a];if(!c){let h=[],g=[],y=Hp(this._driver,r,h,g);if(h.length)throw gp(n,h);c=pf(n,y,this._normalizer),this._triggerCache[a]=c}this._transitionEngine.registerTrigger(e,n,c)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,i,n){this._transitionEngine.insertNode(t,e,i,n)}onRemove(t,e,i){this._transitionEngine.removeNode(t,e,i)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,i,n){if(i.charAt(0)=="@"){let[r,a]=mc(i),c=n;this._timelineEngine.command(r,e,a,c)}else this._transitionEngine.trigger(t,e,i,n)}listen(t,e,i,n,r){if(i.charAt(0)=="@"){let[a,c]=mc(i);return this._timelineEngine.listen(a,e,c,r)}return this._transitionEngine.listen(t,e,i,n,r)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(t){this._transitionEngine.afterFlushAnimationsDone(t)}};function Tf(o,t){let e=null,i=null;return Array.isArray(t)&&t.length?(e=xc(t[0]),t.length>1&&(i=xc(t[t.length-1]))):t instanceof Map&&(e=xc(t)),e||i?new Ef(o,e,i):null}var Ef=(()=>{class o{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,i,n){this._element=e,this._startStyles=i,this._endStyles=n;let r=o.initialStylesByElement.get(e);r||o.initialStylesByElement.set(e,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&_i(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(_i(this._element,this._initialStyles),this._endStyles&&(_i(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(o.initialStylesByElement.delete(this._element),this._startStyles&&(Rn(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Rn(this._element,this._endStyles),this._endStyles=null),_i(this._element,this._initialStyles),this._state=3)}}return o})();function xc(o){let t=null;return o.forEach((e,i)=>{Pf(i)&&(t=t||new Map,t.set(i,e))}),t}function Pf(o){return o==="display"||o==="position"}var Ss=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(t,e,i,n){this.element=t,this.keyframes=e,this.options=i,this._specialStyles=n,this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;let t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:new Map;let e=()=>this._onFinish();this.domPlayer.addEventListener("finish",e),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",e)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(t){let e=[];return t.forEach(i=>{e.push(Object.fromEntries(i))}),e}_triggerWebAnimation(t,e,i){return t.animate(this._convertKeyframesToObject(e),i)}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),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&&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(t=>t()),this._onDestroyFns=[])}setPosition(t){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let t=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,n)=>{n!=="offset"&&t.set(n,this._finished?i:us(this.element,n))}),this.currentSnapshot=t}triggerCallback(t){let e=t==="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},ks=class{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}containsElement(t,e){return pc(t,e)}getParentElement(t){return ds(t)}query(t,e,i){return hc(t,e,i)}computeStyle(t,e,i){return us(t,e)}animate(t,e,i,n,r,a=[]){let c=n==0?"both":"forwards",h={duration:i,delay:n,fill:c};r&&(h.easing=r);let g=new Map,y=a.filter(F=>F instanceof Ss);Pp(i,n)&&y.forEach(F=>{F.currentSnapshot.forEach((T,B)=>g.set(B,T))});let S=Tp(e).map(F=>new Map(F));S=Op(t,S,g);let A=Tf(t,S);return new Ss(t,S,h,A)}};var bs="@",Gp="@.disabled",Ms=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(t,e,i,n){this.namespaceId=t,this.delegate=e,this.engine=i,this._onDestroy=n}get data(){return this.delegate.data}destroyNode(t){this.delegate.destroyNode?.(t)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,i,n=!0){this.delegate.insertBefore(t,e,i),this.engine.onInsert(this.namespaceId,e,t,n)}removeChild(t,e,i,n){if(n){this.delegate.removeChild(t,e,i);return}this.parentNode(e)&&this.engine.onRemove(this.namespaceId,e,this.delegate)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,i,n){this.delegate.setAttribute(t,e,i,n)}removeAttribute(t,e,i){this.delegate.removeAttribute(t,e,i)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,i,n){this.delegate.setStyle(t,e,i,n)}removeStyle(t,e,i){this.delegate.removeStyle(t,e,i)}setProperty(t,e,i){e.charAt(0)==bs&&e==Gp?this.disableAnimations(t,!!i):this.delegate.setProperty(t,e,i)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,i,n){return this.delegate.listen(t,e,i,n)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}},Dc=class extends Ms{factory;constructor(t,e,i,n,r){super(e,i,n,r),this.factory=t,this.namespaceId=e}setProperty(t,e,i){e.charAt(0)==bs?e.charAt(1)=="."&&e==Gp?(i=i===void 0?!0:!!i,this.disableAnimations(t,i)):this.engine.process(this.namespaceId,t,e.slice(1),i):this.delegate.setProperty(t,e,i)}listen(t,e,i,n){if(e.charAt(0)==bs){let r=Of(t),a=e.slice(1),c="";return a.charAt(0)!=bs&&([a,c]=Af(a)),this.engine.listen(this.namespaceId,r,a,c,h=>{let g=h._data||-1;this.factory.scheduleListenerCallback(g,i,h)})}return this.delegate.listen(t,e,i,n)}};function Of(o){switch(o){case"body":return document.body;case"document":return document;case"window":return window;default:return o}}function Af(o){let t=o.indexOf("."),e=o.substring(0,t),i=o.slice(t+1);return[e,i]}var Ts=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(t,e,i){this.delegate=t,this.engine=e,this._zone=i,e.onRemovalComplete=(n,r)=>{r?.removeChild(null,n)}}createRenderer(t,e){let n=this.delegate.createRenderer(t,e);if(!t||!e?.data?.animation){let g=this._rendererCache,y=g.get(n);if(!y){let S=()=>g.delete(n);y=new Ms("",n,this.engine,S),g.set(n,y)}return y}let r=e.id,a=e.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);let c=g=>{Array.isArray(g)?g.forEach(c):this.engine.registerTrigger(r,a,t,g.name,g)};return e.data.animation.forEach(c),new Dc(this,a,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,i){if(t>=0&&t<this._microtaskId){this._zone.run(()=>e(i));return}let n=this._animationCallbacksBuffer;n.length==0&&queueMicrotask(()=>{this._zone.run(()=>{n.forEach(r=>{let[a,c]=r;a(c)}),this._animationCallbacksBuffer=[]})}),n.push([e,i])}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(t){this.engine.flush(),this.delegate.componentReplaced?.(t)}};var Df=(()=>{class o extends qo{constructor(e,i,n){super(e,i,n)}ngOnDestroy(){this.flush()}static \u0275fac=function(i){return new(i||o)(Ra(et),Ra(so),Ra(lo))};static \u0275prov=L({token:o,factory:o.\u0275fac})}return o})();function Rf(){return new vs}function Ff(o,t,e){return new Ts(o,t,e)}var Yp=[{provide:lo,useFactory:Rf},{provide:qo,useClass:Df},{provide:hi,useFactory:Ff,deps:[Om,qo,pe]}],nS=[{provide:so,useClass:Rc},{provide:Ir,useValue:"NoopAnimations"},...Yp],Nf=[{provide:so,useFactory:()=>new ks},{provide:Ir,useFactory:()=>"BrowserAnimations"},...Yp];function Qp(){return fm("NgEagerAnimations"),[...Nf]}var qr=class{_attachedHost;attach(t){return this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;t!=null&&(this._attachedHost=null,t.detach())}get isAttached(){return this._attachedHost!=null}setAttachedHost(t){this._attachedHost=t}},vi=class extends qr{component;viewContainerRef;injector;projectableNodes;constructor(t,e,i,n){super(),this.component=t,this.viewContainerRef=e,this.injector=i,this.projectableNodes=n}},sn=class extends qr{templateRef;viewContainerRef;context;injector;constructor(t,e,i,n){super(),this.templateRef=t,this.viewContainerRef=e,this.context=i,this.injector=n}get origin(){return this.templateRef.elementRef}attach(t,e=this.context){return this.context=e,super.attach(t)}detach(){return this.context=void 0,super.detach()}},Nc=class extends qr{element;constructor(t){super(),this.element=t instanceof ne?t.nativeElement:t}},Fn=class{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(t){if(t instanceof vi)return this._attachedPortal=t,this.attachComponentPortal(t);if(t instanceof sn)return this._attachedPortal=t,this.attachTemplatePortal(t);if(this.attachDomPortal&&t instanceof Nc)return this._attachedPortal=t,this.attachDomPortal(t)}attachDomPortal=null;detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}},Es=class extends Fn{outletElement;_appRef;_defaultInjector;constructor(t,e,i){super(),this.outletElement=t,this._appRef=e,this._defaultInjector=i}attachComponentPortal(t){let e;if(t.viewContainerRef){let i=t.injector||t.viewContainerRef.injector,n=i.get(Zl,null,{optional:!0})||void 0;e=t.viewContainerRef.createComponent(t.component,{index:t.viewContainerRef.length,injector:i,ngModuleRef:n,projectableNodes:t.projectableNodes||void 0}),this.setDisposeFn(()=>e.destroy())}else{let i=this._appRef,n=t.injector||this._defaultInjector||ye.NULL,r=n.get(Fa,i.injector);e=Tm(t.component,{elementInjector:n,environmentInjector:r,projectableNodes:t.projectableNodes||void 0}),i.attachView(e.hostView),this.setDisposeFn(()=>{i.viewCount>0&&i.detachView(e.hostView),e.destroy()})}return this.outletElement.appendChild(this._getComponentRootNode(e)),this._attachedPortal=t,e}attachTemplatePortal(t){let e=t.viewContainerRef,i=e.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return i.rootNodes.forEach(n=>this.outletElement.appendChild(n)),i.detectChanges(),this.setDisposeFn(()=>{let n=e.indexOf(i);n!==-1&&e.remove(n)}),this._attachedPortal=t,i}attachDomPortal=t=>{let e=t.element;e.parentNode;let i=this.outletElement.ownerDocument.createComment("dom-portal");e.parentNode.insertBefore(i,e),this.outletElement.appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{i.parentNode&&i.parentNode.replaceChild(e,i)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(t){return t.hostView.rootNodes[0]}};var Nn=(()=>{class o extends Fn{_moduleRef=m(Zl,{optional:!0});_document=m(et);_viewContainerRef=m(Zn);_isInitialized=!1;_attachedRef;constructor(){super()}get portal(){return this._attachedPortal}set portal(e){this.hasAttached()&&!e&&!this._isInitialized||(this.hasAttached()&&super.detach(),e&&super.attach(e),this._attachedPortal=e||null)}attached=new H;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(e){e.setAttachedHost(this);let i=e.viewContainerRef!=null?e.viewContainerRef:this._viewContainerRef,n=i.createComponent(e.component,{index:i.length,injector:e.injector||i.injector,projectableNodes:e.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return i!==this._viewContainerRef&&this._getRootNode().appendChild(n.hostView.rootNodes[0]),super.setDisposeFn(()=>n.destroy()),this._attachedPortal=e,this._attachedRef=n,this.attached.emit(n),n}attachTemplatePortal(e){e.setAttachedHost(this);let i=this._viewContainerRef.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=e,this._attachedRef=i,this.attached.emit(i),i}attachDomPortal=e=>{let i=e.element;i.parentNode;let n=this._document.createComment("dom-portal");e.setAttachedHost(this),i.parentNode.insertBefore(n,i),this._getRootNode().appendChild(i),this._attachedPortal=e,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(i,n)})};_getRootNode(){let e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[Tt]})}return o})();var ln=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({})}return o})();var Lf=20,cn=(()=>{class o{_ngZone=m(pe);_platform=m(tt);_renderer=m(hi).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new R;_scrolledCount=0;scrollContainers=new Map;register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe(()=>this._scrolled.next(e)))}deregister(e){let i=this.scrollContainers.get(e);i&&(i.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=Lf){return this._platform.isBrowser?new Ii(i=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let n=e>0?this._scrolled.pipe(Ql(e)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{n.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):Rt()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(e,i){let n=this.getAncestorScrollContainers(e);return this.scrolled(i).pipe(me(r=>!r||n.indexOf(r)>-1))}getAncestorScrollContainers(e){let i=[];return this.scrollContainers.forEach((n,r)=>{this._scrollableContainsElement(r,e)&&i.push(r)}),i}_scrollableContainsElement(e,i){let n=Lr(i),r=e.getElementRef().nativeElement;do if(n==r)return!0;while(n=n.parentElement);return!1}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),dn=(()=>{class o{elementRef=m(ne);scrollDispatcher=m(cn);ngZone=m(pe);dir=m(bt,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new R;_renderer=m(Ct);_cleanupScroll;_elementScrolled=new R;constructor(){}ngOnInit(){this._cleanupScroll=this.ngZone.runOutsideAngular(()=>this._renderer.listen(this._scrollElement,"scroll",e=>this._elementScrolled.next(e))),this.scrollDispatcher.register(this)}ngOnDestroy(){this._cleanupScroll?.(),this._elementScrolled.complete(),this.scrollDispatcher.deregister(this),this._destroyed.next(),this._destroyed.complete()}elementScrolled(){return this._elementScrolled}getElementRef(){return this.elementRef}scrollTo(e){let i=this.elementRef.nativeElement,n=this.dir&&this.dir.value=="rtl";e.left==null&&(e.left=n?e.end:e.start),e.right==null&&(e.right=n?e.start:e.end),e.bottom!=null&&(e.top=i.scrollHeight-i.clientHeight-e.bottom),n&&Vo()!=Lo.NORMAL?(e.left!=null&&(e.right=i.scrollWidth-i.clientWidth-e.left),Vo()==Lo.INVERTED?e.left=e.right:Vo()==Lo.NEGATED&&(e.left=e.right?-e.right:e.right)):e.right!=null&&(e.left=i.scrollWidth-i.clientWidth-e.right),this._applyScrollToOptions(e)}_applyScrollToOptions(e){let i=this.elementRef.nativeElement;Ya()?i.scrollTo(e):(e.top!=null&&(i.scrollTop=e.top),e.left!=null&&(i.scrollLeft=e.left))}measureScrollOffset(e){let i="left",n="right",r=this.elementRef.nativeElement;if(e=="top")return r.scrollTop;if(e=="bottom")return r.scrollHeight-r.clientHeight-r.scrollTop;let a=this.dir&&this.dir.value=="rtl";return e=="start"?e=a?n:i:e=="end"&&(e=a?i:n),a&&Vo()==Lo.INVERTED?e==i?r.scrollWidth-r.clientWidth-r.scrollLeft:r.scrollLeft:a&&Vo()==Lo.NEGATED?e==i?r.scrollLeft+r.scrollWidth-r.clientWidth:-r.scrollLeft:e==i?r.scrollLeft:r.scrollWidth-r.clientWidth-r.scrollLeft}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return o})(),Vf=20,ji=(()=>{class o{_platform=m(tt);_listeners;_viewportSize;_change=new R;_document=m(et);constructor(){let e=m(pe),i=m(hi).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let n=r=>this._change.next(r);this._listeners=[i.listen("window","resize",n),i.listen("window","orientationchange",n)]}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){this._listeners?.forEach(e=>e()),this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){let e=this.getViewportScrollPosition(),{width:i,height:n}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+n,right:e.left+i,height:n,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,i=this._getWindow(),n=e.documentElement,r=n.getBoundingClientRect(),a=-r.top||e.body.scrollTop||i.scrollY||n.scrollTop||0,c=-r.left||e.body.scrollLeft||i.scrollX||n.scrollLeft||0;return{top:a,left:c}}change(e=Vf){return e>0?this._change.pipe(Ql(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var zi=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({})}return o})(),Lc=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({imports:[Vr,zi,Vr,zi]})}return o})();var Xp=Ya();function Qo(o){return new Ps(o.get(ji),o.get(et))}var Ps=class{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(t,e){this._viewportRuler=t,this._document=e}attach(){}enable(){if(this._canBeEnabled()){let t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=lt(-this._previousScrollPosition.left),t.style.top=lt(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let t=this._document.documentElement,e=this._document.body,i=t.style,n=e.style,r=i.scrollBehavior||"",a=n.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),Xp&&(i.scrollBehavior=n.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Xp&&(i.scrollBehavior=r,n.scrollBehavior=a)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let e=this._document.documentElement,i=this._viewportRuler.getViewportSize();return e.scrollHeight>i.height||e.scrollWidth>i.width}};function nh(o,t){return new Os(o.get(cn),o.get(pe),o.get(ji),t)}var Os=class{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(t,e,i,n){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=i,this._config=n}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(this._scrollSubscription)return;let t=this._scrollDispatcher.scrolled(0).pipe(me(e=>!e||!this._overlayRef.overlayElement.contains(e.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(()=>{let e=this._viewportRuler.getViewportScrollPosition().top;Math.abs(e-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}_detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}};var Gr=class{enable(){}disable(){}attach(){}};function Vc(o,t){return t.some(e=>{let i=o.bottom<e.top,n=o.top>e.bottom,r=o.right<e.left,a=o.left>e.right;return i||n||r||a})}function Kp(o,t){return t.some(e=>{let i=o.top<e.top,n=o.bottom>e.bottom,r=o.left<e.left,a=o.right>e.right;return i||n||r||a})}function Bi(o,t){return new As(o.get(cn),o.get(ji),o.get(pe),t)}var As=class{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(t,e,i,n){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=i,this._config=n}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(!this._scrollSubscription){let t=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(t).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let e=this._overlayRef.overlayElement.getBoundingClientRect(),{width:i,height:n}=this._viewportRuler.getViewportSize();Vc(e,[{width:i,height:n,bottom:n,right:i,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}})}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},oh=(()=>{class o{_injector=m(ye);constructor(){}noop=()=>new Gr;close=e=>nh(this._injector,e);block=()=>Qo(this._injector);reposition=e=>Bi(this._injector,e);static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),mn=class{positionStrategy;scrollStrategy=new Gr;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";disableAnimations;width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;constructor(t){if(t){let e=Object.keys(t);for(let i of e)t[i]!==void 0&&(this[i]=t[i])}}};var Is=class{connectionPair;scrollableViewProperties;constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}};var rh=(()=>{class o{_attachedOverlays=[];_document=m(et);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(e){this.remove(e),this._attachedOverlays.push(e)}remove(e){let i=this._attachedOverlays.indexOf(e);i>-1&&this._attachedOverlays.splice(i,1),this._attachedOverlays.length===0&&this.detach()}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),ah=(()=>{class o extends rh{_ngZone=m(pe);_renderer=m(hi).createRenderer(null,null);_cleanupKeydown;add(e){super.add(e),this._isAttached||(this._ngZone.runOutsideAngular(()=>{this._cleanupKeydown=this._renderer.listen("body","keydown",this._keydownListener)}),this._isAttached=!0)}detach(){this._isAttached&&(this._cleanupKeydown?.(),this._isAttached=!1)}_keydownListener=e=>{let i=this._attachedOverlays;for(let n=i.length-1;n>-1;n--)if(i[n]._keydownEvents.observers.length>0){this._ngZone.run(()=>i[n]._keydownEvents.next(e));break}};static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),sh=(()=>{class o extends rh{_platform=m(tt);_ngZone=m(pe);_renderer=m(hi).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(e){if(super.add(e),!this._isAttached){let i=this._document.body,n={capture:!0},r=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[r.listen(i,"pointerdown",this._pointerDownListener,n),r.listen(i,"click",this._clickListener,n),r.listen(i,"auxclick",this._clickListener,n),r.listen(i,"contextmenu",this._clickListener,n)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){this._isAttached&&(this._cleanups?.forEach(e=>e()),this._cleanups=void 0,this._platform.IOS&&this._cursorStyleIsSet&&(this._document.body.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1)}_pointerDownListener=e=>{this._pointerDownEventTarget=Ua(e)};_clickListener=e=>{let i=Ua(e),n=e.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:i;this._pointerDownEventTarget=null;let r=this._attachedOverlays.slice();for(let a=r.length-1;a>-1;a--){let c=r[a];if(c._outsidePointerEvents.observers.length<1||!c.hasAttached())continue;if(Zp(c.overlayElement,i)||Zp(c.overlayElement,n))break;let h=c._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>h.next(e)):h.next(e)}};static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function Zp(o,t){let e=typeof ShadowRoot<"u"&&ShadowRoot,i=t;for(;i;){if(i===o)return!0;i=e&&i instanceof ShadowRoot?i.host:i.parentNode}return!1}var lh=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(i,n){},styles:[`.cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}
2
- `],encapsulation:2,changeDetection:0})}return o})(),Fs=(()=>{class o{_platform=m(tt);_containerElement;_document=m(et);_styleLoader=m(Nt);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e="cdk-overlay-container";if(this._platform.isBrowser||oc()){let n=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let r=0;r<n.length;r++)n[r].remove()}let i=this._document.createElement("div");i.classList.add(e),oc()?i.setAttribute("platform","test"):this._platform.isBrowser||i.setAttribute("platform","server"),this._document.body.appendChild(i),this._containerElement=i}_loadStyles(){this._styleLoader.load(lh)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),zc=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(t,e,i,n){this._renderer=e,this._ngZone=i,this.element=t.createElement("div"),this.element.classList.add("cdk-overlay-backdrop"),this._cleanupClick=e.listen(this.element,"click",n)}detach(){this._ngZone.runOutsideAngular(()=>{let t=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(t,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),t.style.pointerEvents="none",t.classList.remove("cdk-overlay-backdrop-showing")})}dispose=()=>{clearTimeout(this._fallbackTimeout),this._cleanupClick?.(),this._cleanupTransitionEnd?.(),this._cleanupClick=this._cleanupTransitionEnd=this._fallbackTimeout=void 0,this.element.remove()}},Go=class{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new R;_attachments=new R;_detachments=new R;_positionStrategy;_scrollStrategy;_locationChanges=Ai.EMPTY;_backdropRef=null;_detachContentMutationObserver;_detachContentAfterRenderRef;_previousHostParent;_keydownEvents=new R;_outsidePointerEvents=new R;_afterNextRenderRef;constructor(t,e,i,n,r,a,c,h,g,y=!1,S,A){this._portalOutlet=t,this._host=e,this._pane=i,this._config=n,this._ngZone=r,this._keyboardDispatcher=a,this._document=c,this._location=h,this._outsideClickDispatcher=g,this._animationsDisabled=y,this._injector=S,this._renderer=A,n.scrollStrategy&&(this._scrollStrategy=n.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=n.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}attach(t){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let e=this._portalOutlet.attach(t);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=Ft(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._completeDetachContent(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof e?.onDestroy=="function"&&e.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let t=this._portalOutlet.detach();return this._detachments.next(),this._completeDetachContent(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){let t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._backdropRef?.dispose(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=this._backdropRef=null,t&&this._detachments.next(),this._detachments.complete(),this._completeDetachContent()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config=Z(Z({},this._config),t),this._updateElementSize()}setDirection(t){this._config=ut(Z({},this._config),{direction:t}),this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){let t=this._config.direction;return t?typeof t=="string"?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let t=this._pane.style;t.width=lt(this._config.width),t.height=lt(this._config.height),t.minWidth=lt(this._config.minWidth),t.minHeight=lt(this._config.minHeight),t.maxWidth=lt(this._config.maxWidth),t.maxHeight=lt(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){let t="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new zc(this._document,this._renderer,this._ngZone,e=>{this._backdropClick.next(e)}),this._animationsDisabled&&this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropRef.element,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropRef.element,this._host),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this._backdropRef?.element.classList.add(t))}):this._backdropRef.element.classList.add(t)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(t,e,i){let n=ic(e||[]).filter(r=>!!r);n.length&&(i?t.classList.add(...n):t.classList.remove(...n))}_detachContentWhenEmpty(){let t=!1;try{this._detachContentAfterRenderRef=Ft(()=>{t=!0,this._detachContent()},{injector:this._injector})}catch(e){if(t)throw e;this._detachContent()}globalThis.MutationObserver&&this._pane&&(this._detachContentMutationObserver||=new globalThis.MutationObserver(()=>{this._detachContent()}),this._detachContentMutationObserver.observe(this._pane,{childList:!0}))}_detachContent(){(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),this._completeDetachContent())}_completeDetachContent(){this._detachContentAfterRenderRef?.destroy(),this._detachContentAfterRenderRef=void 0,this._detachContentMutationObserver?.disconnect()}_disposeScrollStrategy(){let t=this._scrollStrategy;t?.disable(),t?.detach?.()}},Jp="cdk-overlay-connected-position-bounding-box",jf=/([A-Za-z%]+)$/;function Yr(o,t){return new Ds(t,o.get(ji),o.get(et),o.get(tt),o.get(Fs))}var Ds=class{_viewportRuler;_document;_platform;_overlayContainer;_overlayRef;_isInitialRender;_lastBoundingBoxSize={width:0,height:0};_isPushed=!1;_canPush=!0;_growAfterOpen=!1;_hasFlexibleDimensions=!0;_positionLocked=!1;_originRect;_overlayRect;_viewportRect;_containerRect;_viewportMargin=0;_scrollables=[];_preferredPositions=[];_origin;_pane;_isDisposed;_boundingBox;_lastPosition;_lastScrollVisibility;_positionChanges=new R;_resizeSubscription=Ai.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount;positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(t,e,i,n,r){this._viewportRuler=e,this._document=i,this._platform=n,this._overlayContainer=r,this.setOrigin(t)}attach(t){this._overlayRef&&this._overlayRef,this._validatePositions(),t.hostElement.classList.add(Jp),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition){this.reapplyLastPosition();return}this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let t=this._originRect,e=this._overlayRect,i=this._viewportRect,n=this._containerRect,r=[],a;for(let c of this._preferredPositions){let h=this._getOriginPoint(t,n,c),g=this._getOverlayPoint(h,e,c),y=this._getOverlayFit(g,e,i,c);if(y.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(c,h);return}if(this._canFitWithFlexibleDimensions(y,g,i)){r.push({position:c,origin:h,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(h,c)});continue}(!a||a.overlayFit.visibleArea<y.visibleArea)&&(a={overlayFit:y,overlayPoint:g,originPoint:h,position:c,overlayRect:e})}if(r.length){let c=null,h=-1;for(let g of r){let y=g.boundingBoxRect.width*g.boundingBoxRect.height*(g.position.weight||1);y>h&&(h=y,c=g)}this._isPushed=!1,this._applyPosition(c.position,c.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(a.position,a.originPoint);return}this._applyPosition(a.position,a.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&co(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Jp),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let t=this._lastPosition;if(t){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let e=this._getOriginPoint(this._originRect,this._containerRect,t);this._applyPosition(t,e)}else this.apply()}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,t.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}_getOriginPoint(t,e,i){let n;if(i.originX=="center")n=t.left+t.width/2;else{let a=this._isRtl()?t.right:t.left,c=this._isRtl()?t.left:t.right;n=i.originX=="start"?a:c}e.left<0&&(n-=e.left);let r;return i.originY=="center"?r=t.top+t.height/2:r=i.originY=="top"?t.top:t.bottom,e.top<0&&(r-=e.top),{x:n,y:r}}_getOverlayPoint(t,e,i){let n;i.overlayX=="center"?n=-e.width/2:i.overlayX==="start"?n=this._isRtl()?-e.width:0:n=this._isRtl()?0:-e.width;let r;return i.overlayY=="center"?r=-e.height/2:r=i.overlayY=="top"?0:-e.height,{x:t.x+n,y:t.y+r}}_getOverlayFit(t,e,i,n){let r=th(e),{x:a,y:c}=t,h=this._getOffset(n,"x"),g=this._getOffset(n,"y");h&&(a+=h),g&&(c+=g);let y=0-a,S=a+r.width-i.width,A=0-c,F=c+r.height-i.height,T=this._subtractOverflows(r.width,y,S),B=this._subtractOverflows(r.height,A,F),_e=T*B;return{visibleArea:_e,isCompletelyWithinViewport:r.width*r.height===_e,fitsInViewportVertically:B===r.height,fitsInViewportHorizontally:T==r.width}}_canFitWithFlexibleDimensions(t,e,i){if(this._hasFlexibleDimensions){let n=i.bottom-e.y,r=i.right-e.x,a=eh(this._overlayRef.getConfig().minHeight),c=eh(this._overlayRef.getConfig().minWidth),h=t.fitsInViewportVertically||a!=null&&a<=n,g=t.fitsInViewportHorizontally||c!=null&&c<=r;return h&&g}return!1}_pushOverlayOnScreen(t,e,i){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};let n=th(e),r=this._viewportRect,a=Math.max(t.x+n.width-r.width,0),c=Math.max(t.y+n.height-r.height,0),h=Math.max(r.top-i.top-t.y,0),g=Math.max(r.left-i.left-t.x,0),y=0,S=0;return n.width<=r.width?y=g||-a:y=t.x<this._viewportMargin?r.left-i.left-t.x:0,n.height<=r.height?S=h||-c:S=t.y<this._viewportMargin?r.top-i.top-t.y:0,this._previousPushAmount={x:y,y:S},{x:t.x+y,y:t.y+S}}_applyPosition(t,e){if(this._setTransformOrigin(t),this._setOverlayElementStyles(e,t),this._setBoundingBoxStyles(e,t),t.panelClass&&this._addPanelClasses(t.panelClass),this._positionChanges.observers.length){let i=this._getScrollVisibility();if(t!==this._lastPosition||!this._lastScrollVisibility||!Bf(this._lastScrollVisibility,i)){let n=new Is(t,i);this._positionChanges.next(n)}this._lastScrollVisibility=i}this._lastPosition=t,this._isInitialRender=!1}_setTransformOrigin(t){if(!this._transformOriginSelector)return;let e=this._boundingBox.querySelectorAll(this._transformOriginSelector),i,n=t.overlayY;t.overlayX==="center"?i="center":this._isRtl()?i=t.overlayX==="start"?"right":"left":i=t.overlayX==="start"?"left":"right";for(let r=0;r<e.length;r++)e[r].style.transformOrigin=`${i} ${n}`}_calculateBoundingBoxRect(t,e){let i=this._viewportRect,n=this._isRtl(),r,a,c;if(e.overlayY==="top")a=t.y,r=i.height-a+this._viewportMargin;else if(e.overlayY==="bottom")c=i.height-t.y+this._viewportMargin*2,r=i.height-c+this._viewportMargin;else{let F=Math.min(i.bottom-t.y+i.top,t.y),T=this._lastBoundingBoxSize.height;r=F*2,a=t.y-F,r>T&&!this._isInitialRender&&!this._growAfterOpen&&(a=t.y-T/2)}let h=e.overlayX==="start"&&!n||e.overlayX==="end"&&n,g=e.overlayX==="end"&&!n||e.overlayX==="start"&&n,y,S,A;if(g)A=i.width-t.x+this._viewportMargin*2,y=t.x-this._viewportMargin;else if(h)S=t.x,y=i.right-t.x;else{let F=Math.min(i.right-t.x+i.left,t.x),T=this._lastBoundingBoxSize.width;y=F*2,S=t.x-F,y>T&&!this._isInitialRender&&!this._growAfterOpen&&(S=t.x-T/2)}return{top:a,left:S,bottom:c,right:A,width:y,height:r}}_setBoundingBoxStyles(t,e){let i=this._calculateBoundingBoxRect(t,e);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));let n={};if(this._hasExactPosition())n.top=n.left="0",n.bottom=n.right=n.maxHeight=n.maxWidth="",n.width=n.height="100%";else{let r=this._overlayRef.getConfig().maxHeight,a=this._overlayRef.getConfig().maxWidth;n.height=lt(i.height),n.top=lt(i.top),n.bottom=lt(i.bottom),n.width=lt(i.width),n.left=lt(i.left),n.right=lt(i.right),e.overlayX==="center"?n.alignItems="center":n.alignItems=e.overlayX==="end"?"flex-end":"flex-start",e.overlayY==="center"?n.justifyContent="center":n.justifyContent=e.overlayY==="bottom"?"flex-end":"flex-start",r&&(n.maxHeight=lt(r)),a&&(n.maxWidth=lt(a))}this._lastBoundingBoxSize=i,co(this._boundingBox.style,n)}_resetBoundingBoxStyles(){co(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){co(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){let i={},n=this._hasExactPosition(),r=this._hasFlexibleDimensions,a=this._overlayRef.getConfig();if(n){let y=this._viewportRuler.getViewportScrollPosition();co(i,this._getExactOverlayY(e,t,y)),co(i,this._getExactOverlayX(e,t,y))}else i.position="static";let c="",h=this._getOffset(e,"x"),g=this._getOffset(e,"y");h&&(c+=`translateX(${h}px) `),g&&(c+=`translateY(${g}px)`),i.transform=c.trim(),a.maxHeight&&(n?i.maxHeight=lt(a.maxHeight):r&&(i.maxHeight="")),a.maxWidth&&(n?i.maxWidth=lt(a.maxWidth):r&&(i.maxWidth="")),co(this._pane.style,i)}_getExactOverlayY(t,e,i){let n={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,t);if(this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i)),t.overlayY==="bottom"){let a=this._document.documentElement.clientHeight;n.bottom=`${a-(r.y+this._overlayRect.height)}px`}else n.top=lt(r.y);return n}_getExactOverlayX(t,e,i){let n={left:"",right:""},r=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i));let a;if(this._isRtl()?a=t.overlayX==="end"?"left":"right":a=t.overlayX==="end"?"right":"left",a==="right"){let c=this._document.documentElement.clientWidth;n.right=`${c-(r.x+this._overlayRect.width)}px`}else n.left=lt(r.x);return n}_getScrollVisibility(){let t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),i=this._scrollables.map(n=>n.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Kp(t,i),isOriginOutsideView:Vc(t,i),isOverlayClipped:Kp(e,i),isOverlayOutsideView:Vc(e,i)}}_subtractOverflows(t,...e){return e.reduce((i,n)=>i-Math.max(n,0),t)}_getNarrowedViewportRect(){let t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+t-this._viewportMargin,bottom:i.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,e){return e==="x"?t.offsetX==null?this._offsetX:t.offsetX:t.offsetY==null?this._offsetY:t.offsetY}_validatePositions(){}_addPanelClasses(t){this._pane&&ic(t).forEach(e=>{e!==""&&this._appliedPanelClasses.indexOf(e)===-1&&(this._appliedPanelClasses.push(e),this._pane.classList.add(e))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(t=>{this._pane.classList.remove(t)}),this._appliedPanelClasses=[])}_getOriginRect(){let t=this._origin;if(t instanceof ne)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();let e=t.width||0,i=t.height||0;return{top:t.y,bottom:t.y+i,left:t.x,right:t.x+e,height:i,width:e}}};function co(o,t){for(let e in t)t.hasOwnProperty(e)&&(o[e]=t[e]);return o}function eh(o){if(typeof o!="number"&&o!=null){let[t,e]=o.split(jf);return!e||e==="px"?parseFloat(t):null}return o||null}function th(o){return{top:Math.floor(o.top),right:Math.floor(o.right),bottom:Math.floor(o.bottom),left:Math.floor(o.left),width:Math.floor(o.width),height:Math.floor(o.height)}}function Bf(o,t){return o===t?!0:o.isOriginClipped===t.isOriginClipped&&o.isOriginOutsideView===t.isOriginOutsideView&&o.isOverlayClipped===t.isOverlayClipped&&o.isOverlayOutsideView===t.isOverlayOutsideView}var ih="cdk-global-overlay-wrapper";function Ln(o){return new Rs}var Rs=class{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(t){let e=t.getConfig();this._overlayRef=t,this._width&&!e.width&&t.updateSize({width:this._width}),this._height&&!e.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(ih),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._xOffset=t,this._xPosition="left",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._xOffset=t,this._xPosition="right",this}start(t=""){return this._xOffset=t,this._xPosition="start",this}end(t=""){return this._xOffset=t,this._xPosition="end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._xPosition="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:n,height:r,maxWidth:a,maxHeight:c}=i,h=(n==="100%"||n==="100vw")&&(!a||a==="100%"||a==="100vw"),g=(r==="100%"||r==="100vh")&&(!c||c==="100%"||c==="100vh"),y=this._xPosition,S=this._xOffset,A=this._overlayRef.getConfig().direction==="rtl",F="",T="",B="";h?B="flex-start":y==="center"?(B="center",A?T=S:F=S):A?y==="left"||y==="end"?(B="flex-end",F=S):(y==="right"||y==="start")&&(B="flex-start",T=S):y==="left"||y==="start"?(B="flex-start",F=S):(y==="right"||y==="end")&&(B="flex-end",T=S),t.position=this._cssPosition,t.marginLeft=h?"0":F,t.marginTop=g?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=h?"0":T,e.justifyContent=B,e.alignItems=g?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,i=e.style;e.classList.remove(ih),i.justifyContent=i.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}},ch=(()=>{class o{_injector=m(ye);constructor(){}global(){return Ln()}flexibleConnectedTo(e){return Yr(this._injector,e)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function hn(o,t){o.get(Nt).load(lh);let e=o.get(Fs),i=o.get(et),n=o.get(Ne),r=o.get(ec),a=o.get(bt),c=i.createElement("div"),h=i.createElement("div");h.id=n.getId("cdk-overlay-"),h.classList.add("cdk-overlay-pane"),c.appendChild(h),e.getContainerElement().appendChild(c);let g=new Es(h,r,o),y=new mn(t),S=o.get(Ct,null,{optional:!0})||o.get(hi).createRenderer(null,null);return y.direction=y.direction||a.value,new Go(g,c,h,y,o.get(pe),o.get(ah),i,o.get(Em),o.get(sh),t?.disableAnimations??o.get(Ir,null,{optional:!0})==="NoopAnimations",o.get(Fa),S)}var dh=(()=>{class o{scrollStrategies=m(oh);_positionBuilder=m(ch);_injector=m(ye);constructor(){}create(e){return hn(this._injector,e)}position(){return this._positionBuilder}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),Hf=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],mh=new oe("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(ye);return()=>Bi(o)}}),Yo=(()=>{class o{elementRef=m(ne);constructor(){}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]})}return o})(),Ns=(()=>{class o{_dir=m(bt,{optional:!0});_injector=m(ye);_overlayRef;_templatePortal;_backdropSubscription=Ai.EMPTY;_attachSubscription=Ai.EMPTY;_detachSubscription=Ai.EMPTY;_positionSubscription=Ai.EMPTY;_offsetX;_offsetY;_position;_scrollStrategyFactory=m(mh);_disposeOnNavigation=!1;_ngZone=m(pe);origin;positions;positionStrategy;get offsetX(){return this._offsetX}set offsetX(e){this._offsetX=e,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(e){this._offsetY=e,this._position&&this._updatePositionStrategy(this._position)}width;height;minWidth;minHeight;backdropClass;panelClass;viewportMargin=0;scrollStrategy;open=!1;disableClose=!1;transformOriginSelector;hasBackdrop=!1;lockPosition=!1;flexibleDimensions=!1;growAfterOpen=!1;push=!1;get disposeOnNavigation(){return this._disposeOnNavigation}set disposeOnNavigation(e){this._disposeOnNavigation=e}backdropClick=new H;positionChange=new H;attach=new H;detach=new H;overlayKeydown=new H;overlayOutsideClick=new H;constructor(){let e=m(Mn),i=m(Zn);this._templatePortal=new sn(e,i),this.scrollStrategy=this._scrollStrategyFactory()}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef?.dispose()}ngOnChanges(e){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef?.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),e.origin&&this.open&&this._position.apply()),e.open&&(this.open?this.attachOverlay():this.detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=Hf);let e=this._overlayRef=hn(this._injector,this._buildConfig());this._attachSubscription=e.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=e.detachments().subscribe(()=>this.detach.emit()),e.keydownEvents().subscribe(i=>{this.overlayKeydown.next(i),i.keyCode===27&&!this.disableClose&&!_t(i)&&(i.preventDefault(),this.detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(i=>{let n=this._getOriginElement(),r=Ua(i);(!n||n!==r&&!n.contains(r))&&this.overlayOutsideClick.next(i)})}_buildConfig(){let e=this._position=this.positionStrategy||this._createPositionStrategy(),i=new mn({direction:this._dir||"ltr",positionStrategy:e,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop,disposeOnNavigation:this.disposeOnNavigation});return(this.width||this.width===0)&&(i.width=this.width),(this.height||this.height===0)&&(i.height=this.height),(this.minWidth||this.minWidth===0)&&(i.minWidth=this.minWidth),(this.minHeight||this.minHeight===0)&&(i.minHeight=this.minHeight),this.backdropClass&&(i.backdropClass=this.backdropClass),this.panelClass&&(i.panelClass=this.panelClass),i}_updatePositionStrategy(e){let i=this.positions.map(n=>({originX:n.originX,originY:n.originY,overlayX:n.overlayX,overlayY:n.overlayY,offsetX:n.offsetX||this.offsetX,offsetY:n.offsetY||this.offsetY,panelClass:n.panelClass||void 0}));return e.setOrigin(this._getOrigin()).withPositions(i).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){let e=Yr(this._injector,this._getOrigin());return this._updatePositionStrategy(e),e}_getOrigin(){return this.origin instanceof Yo?this.origin.elementRef:this.origin}_getOriginElement(){return this.origin instanceof Yo?this.origin.elementRef.nativeElement:this.origin instanceof ne?this.origin.nativeElement:typeof Element<"u"&&this.origin instanceof Element?this.origin:null}attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(e=>{this.backdropClick.emit(e)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(mm(()=>this.positionChange.observers.length>0)).subscribe(e=>{this._ngZone.run(()=>this.positionChange.emit(e)),this.positionChange.observers.length===0&&this._positionSubscription.unsubscribe()})),this.open=!0}detachOverlay(){this._overlayRef?.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.open=!1}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{origin:[0,"cdkConnectedOverlayOrigin","origin"],positions:[0,"cdkConnectedOverlayPositions","positions"],positionStrategy:[0,"cdkConnectedOverlayPositionStrategy","positionStrategy"],offsetX:[0,"cdkConnectedOverlayOffsetX","offsetX"],offsetY:[0,"cdkConnectedOverlayOffsetY","offsetY"],width:[0,"cdkConnectedOverlayWidth","width"],height:[0,"cdkConnectedOverlayHeight","height"],minWidth:[0,"cdkConnectedOverlayMinWidth","minWidth"],minHeight:[0,"cdkConnectedOverlayMinHeight","minHeight"],backdropClass:[0,"cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:[0,"cdkConnectedOverlayPanelClass","panelClass"],viewportMargin:[0,"cdkConnectedOverlayViewportMargin","viewportMargin"],scrollStrategy:[0,"cdkConnectedOverlayScrollStrategy","scrollStrategy"],open:[0,"cdkConnectedOverlayOpen","open"],disableClose:[0,"cdkConnectedOverlayDisableClose","disableClose"],transformOriginSelector:[0,"cdkConnectedOverlayTransformOriginOn","transformOriginSelector"],hasBackdrop:[2,"cdkConnectedOverlayHasBackdrop","hasBackdrop",ee],lockPosition:[2,"cdkConnectedOverlayLockPosition","lockPosition",ee],flexibleDimensions:[2,"cdkConnectedOverlayFlexibleDimensions","flexibleDimensions",ee],growAfterOpen:[2,"cdkConnectedOverlayGrowAfterOpen","growAfterOpen",ee],push:[2,"cdkConnectedOverlayPush","push",ee],disposeOnNavigation:[2,"cdkConnectedOverlayDisposeOnNavigation","disposeOnNavigation",ee]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[nt]})}return o})();function Uf(o){let t=m(ye);return()=>Bi(t)}var Wf={provide:mh,useFactory:Uf},yi=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({providers:[dh,Wf],imports:[Vr,ln,Lc,Lc]})}return o})();function $f(o,t){if(o&1){let e=k();s(0,"div",1)(1,"button",2),f("click",function(){b(e);let n=u();return v(n.action())}),p(2),l()()}if(o&2){let e=u();d(2),ie(" ",e.data.action," ")}}var qf=["label"];function Gf(o,t){}var Yf=Math.pow(2,31)-1,Qr=class{_overlayRef;instance;containerInstance;_afterDismissed=new R;_afterOpened=new R;_onAction=new R;_durationTimeoutId;_dismissedByAction=!1;constructor(t,e){this._overlayRef=e,this.containerInstance=t,t._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(t){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(t,Yf))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},ph=new oe("MatSnackBarData"),Xo=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},Qf=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return o})(),Xf=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return o})(),Kf=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return o})(),hh=(()=>{class o{snackBarRef=m(Qr);data=m(ph);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["matButton","","matSnackBarAction","",3,"click"]],template:function(i,n){i&1&&(s(0,"div",0),p(1),l(),C(2,$f,3,1,"div",1)),i&2&&(d(),ie(" ",n.data.message,`
1
+ import{a as Wm,b as ke}from"./chunk-6ZVZINLP.js";import{a as zo,b as $m,c as je,d as Ka,e as Za,f as Ja,g as Be,i as es,k as He,m as ts,n as jo,o as qm,q as is,r as Gm,s as ns,t as os,u as Ym,v as rs,w as Bo,x as Qm,y as Ue}from"./chunk-TMYMW2LL.js";import{A as rc,B as Bm,C as Hm,D as $e,E as lt,F as Pt,G as An,H as In,I as Ke,J as bt,K as Vr,L as ce,M as Qa,N as Ot,O as Xa,P as ot,Q as he,R as Me,S as Xm,T as Km,a as Ha,b as Ua,c as tt,d as Nm,e as fi,f as Lr,g as Ni,h as Nt,i as Wa,j as ic,k as Lm,l as Vm,m as Fo,n as $a,o as qa,p as No,q as Ne,r as _t,s as zm,t as jm,u as nc,v as Ga,w as Lo,x as Ya,y as Vo,z as oc}from"./chunk-FXQT2NYX.js";import{a as rn,b as rt}from"./chunk-UPXODNKN.js";import{e as Um}from"./chunk-LBCXFVPY.js";import{$ as ye,$a as eo,$b as Ro,A as Xl,Aa as M,Ab as En,B as Da,Ba as le,Bb as Ye,Ca as xe,Cb as Cm,D as dm,Da as _m,Db as Va,E as Io,Ea as Tt,Eb as xm,Fa as bm,Fb as io,G as Ar,Ga as Re,Gb as wm,Ha as H,Hb as Rr,I as Mt,Ia as pe,J as Qn,Ja as Ft,Jb as Do,K as N,Kb as Sm,L as mm,La as Jl,M as yt,Ma as ec,Mb as ui,N as Ce,Na as J,Nb as no,O as Xn,Ob as Pn,P as L,Pa as C,Pb as Fr,Q as se,Qa as x,Qb as km,R as oe,Ra as Jn,Rb as Qe,S as Ra,Sa as vm,Sb as ee,T as m,Ta as we,Tb as gi,Ua as Se,Ub as Mm,V as pm,Va as w,Vb as Tm,W as Fa,Wa as s,X as b,Xa as l,Xb as Em,Y as v,Ya as I,Yb as On,Z as nn,Za as ii,Zb as za,_ as Na,_a as ni,_b as ja,a as Z,aa as et,ab as to,ac as Pm,b as ut,ba as Kl,bb as k,bc as Nr,c as rm,cb as Jt,d as te,da as hm,db as f,dc as Fe,e as Ai,ea as La,f as Ii,fa as Oe,fb as u,fc as Om,g as R,ga as nt,gb as We,gc as Am,h as ae,ha as ti,hb as ue,i as am,ia as ne,ib as xt,ja as um,jb as X,k as Rt,kb as U,kc as Xe,l as Oo,lb as W,lc as Im,m as Yl,ma as Ir,mb as ym,mc as Ri,n as sm,nb as Dr,nc as Ba,o as ve,ob as tc,oc as Dm,p as Yn,pa as Zt,pb as Et,pc as Fi,qa as Kn,qb as oi,qc as Rm,r as Ao,ra as gm,rb as E,rc as Fm,sa as d,sb as on,t as lm,ta as Mn,tb as p,u as Di,ua as hi,ub as O,v as me,va as Ct,vb as ie,w as Ql,wb as Tn,x as kn,xa as Zn,xb as V,y as cm,ya as fm,yb as z,z as qt,za as Zl,zb as j}from"./chunk-DYTHVKS2.js";var de=(function(o){return o[o.State=0]="State",o[o.Transition=1]="Transition",o[o.Sequence=2]="Sequence",o[o.Group=3]="Group",o[o.Animate=4]="Animate",o[o.Keyframes=5]="Keyframes",o[o.Style=6]="Style",o[o.Trigger=7]="Trigger",o[o.Reference=8]="Reference",o[o.AnimateChild=9]="AnimateChild",o[o.AnimateRef=10]="AnimateRef",o[o.Query=11]="Query",o[o.Stagger=12]="Stagger",o})(de||{}),ri="*";function ac(o,t){return{type:de.Trigger,name:o,definitions:t,options:{}}}function as(o,t=null){return{type:de.Animate,styles:t,timings:o}}function Zm(o,t=null){return{type:de.Sequence,steps:o,options:t}}function Dn(o){return{type:de.Style,styles:o,offset:null}}function ss(o,t,e=null){return{type:de.Transition,expr:o,animation:t,options:e}}var Li=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(t=0,e=0){this.totalTime=t+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){let e=t=="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},oo=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(t){this.players=t;let e=0,i=0,n=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++e==r&&this._onFinish()}),a.onDestroy(()=>{++i==r&&this._onDestroy()}),a.onStart(()=>{++n==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(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){let e=t*this.totalTime;this.players.forEach(i=>{let n=i.totalTime?Math.min(1,e/i.totalTime):1;i.setPosition(n)})}getPosition(){let t=this.players.reduce((e,i)=>e===null||i.totalTime>e.totalTime?i:e,null);return t!=null?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){let e=t=="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},Ho="!";function Jm(o){return new Ce(3e3,!1)}function Fg(){return new Ce(3100,!1)}function Ng(){return new Ce(3101,!1)}function Lg(o){return new Ce(3001,!1)}function Vg(o){return new Ce(3003,!1)}function zg(o){return new Ce(3004,!1)}function tp(o,t){return new Ce(3005,!1)}function ip(){return new Ce(3006,!1)}function np(){return new Ce(3007,!1)}function op(o,t){return new Ce(3008,!1)}function rp(o){return new Ce(3002,!1)}function ap(o,t,e,i,n){return new Ce(3010,!1)}function sp(){return new Ce(3011,!1)}function lp(){return new Ce(3012,!1)}function cp(){return new Ce(3200,!1)}function dp(){return new Ce(3202,!1)}function mp(){return new Ce(3013,!1)}function pp(o){return new Ce(3014,!1)}function hp(o){return new Ce(3015,!1)}function up(o){return new Ce(3016,!1)}function gp(o,t){return new Ce(3404,!1)}function jg(o){return new Ce(3502,!1)}function fp(o){return new Ce(3503,!1)}function _p(){return new Ce(3300,!1)}function bp(o){return new Ce(3504,!1)}function vp(o){return new Ce(3301,!1)}function yp(o,t){return new Ce(3302,!1)}function Cp(o){return new Ce(3303,!1)}function xp(o,t){return new Ce(3400,!1)}function wp(o){return new Ce(3401,!1)}function Sp(o){return new Ce(3402,!1)}function kp(o,t){return new Ce(3505,!1)}function an(o){switch(o.length){case 0:return new Li;case 1:return o[0];default:return new oo(o)}}function dc(o,t,e=new Map,i=new Map){let n=[],r=[],a=-1,c=null;if(t.forEach(h=>{let g=h.get("offset"),y=g==a,S=y&&c||new Map;h.forEach((A,F)=>{let T=F,B=A;if(F!=="offset")switch(T=o.normalizePropertyName(T,n),B){case Ho:B=e.get(F);break;case ri:B=i.get(F);break;default:B=o.normalizeStyleValue(F,T,B,n);break}S.set(T,B)}),y||r.push(S),c=S,a=g}),n.length)throw jg(n);return r}function ls(o,t,e,i){switch(t){case"start":o.onStart(()=>i(e&&sc(e,"start",o)));break;case"done":o.onDone(()=>i(e&&sc(e,"done",o)));break;case"destroy":o.onDestroy(()=>i(e&&sc(e,"destroy",o)));break}}function sc(o,t,e){let i=e.totalTime,n=!!e.disabled,r=cs(o.element,o.triggerName,o.fromState,o.toState,t||o.phaseName,i??o.totalTime,n),a=o._data;return a!=null&&(r._data=a),r}function cs(o,t,e,i,n="",r=0,a){return{element:o,triggerName:t,fromState:e,toState:i,phaseName:n,totalTime:r,disabled:!!a}}function Gt(o,t,e){let i=o.get(t);return i||o.set(t,i=e),i}function mc(o){let t=o.indexOf(":"),e=o.substring(1,t),i=o.slice(t+1);return[e,i]}var Bg=typeof document>"u"?null:document.documentElement;function ds(o){let t=o.parentNode||o.host||null;return t===Bg?null:t}function Hg(o){return o.substring(1,6)=="ebkit"}var ro=null,ep=!1;function Mp(o){ro||(ro=Ug()||{},ep=ro.style?"WebkitAppearance"in ro.style:!1);let t=!0;return ro.style&&!Hg(o)&&(t=o in ro.style,!t&&ep&&(t="Webkit"+o.charAt(0).toUpperCase()+o.slice(1)in ro.style)),t}function Ug(){return typeof document<"u"?document.body:null}function pc(o,t){for(;t;){if(t===o)return!0;t=ds(t)}return!1}function hc(o,t,e){if(e)return Array.from(o.querySelectorAll(t));let i=o.querySelector(t);return i?[i]:[]}var Wg=1e3,uc="{{",$g="}}",gc="ng-enter",ms="ng-leave",zr="ng-trigger",jr=".ng-trigger",fc="ng-animating",ps=".ng-animating";function Vi(o){if(typeof o=="number")return o;let t=o.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:lc(parseFloat(t[1]),t[2])}function lc(o,t){switch(t){case"s":return o*Wg;default:return o}}function Br(o,t,e){return o.hasOwnProperty("duration")?o:Gg(o,t,e)}var qg=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function Gg(o,t,e){let i,n=0,r="";if(typeof o=="string"){let a=o.match(qg);if(a===null)return t.push(Jm(o)),{duration:0,delay:0,easing:""};i=lc(parseFloat(a[1]),a[2]);let c=a[3];c!=null&&(n=lc(parseFloat(c),a[4]));let h=a[5];h&&(r=h)}else i=o;if(!e){let a=!1,c=t.length;i<0&&(t.push(Fg()),a=!0),n<0&&(t.push(Ng()),a=!0),a&&t.splice(c,0,Jm(o))}return{duration:i,delay:n,easing:r}}function Tp(o){return o.length?o[0]instanceof Map?o:o.map(t=>new Map(Object.entries(t))):[]}function _i(o,t,e){t.forEach((i,n)=>{let r=hs(n);e&&!e.has(n)&&e.set(n,o.style[r]),o.style[r]=i})}function Rn(o,t){t.forEach((e,i)=>{let n=hs(i);o.style[n]=""})}function Uo(o){return Array.isArray(o)?o.length==1?o[0]:Zm(o):o}function Ep(o,t,e){let i=t.params||{},n=_c(o);n.length&&n.forEach(r=>{i.hasOwnProperty(r)||e.push(Lg(r))})}var cc=new RegExp(`${uc}\\s*(.+?)\\s*${$g}`,"g");function _c(o){let t=[];if(typeof o=="string"){let e;for(;e=cc.exec(o);)t.push(e[1]);cc.lastIndex=0}return t}function Wo(o,t,e){let i=`${o}`,n=i.replace(cc,(r,a)=>{let c=t[a];return c==null&&(e.push(Vg(a)),c=""),c.toString()});return n==i?o:n}var Yg=/-+([a-z0-9])/g;function hs(o){return o.replace(Yg,(...t)=>t[1].toUpperCase())}function Pp(o,t){return o===0||t===0}function Op(o,t,e){if(e.size&&t.length){let i=t[0],n=[];if(e.forEach((r,a)=>{i.has(a)||n.push(a),i.set(a,r)}),n.length)for(let r=1;r<t.length;r++){let a=t[r];n.forEach(c=>a.set(c,us(o,c)))}}return t}function Yt(o,t,e){switch(t.type){case de.Trigger:return o.visitTrigger(t,e);case de.State:return o.visitState(t,e);case de.Transition:return o.visitTransition(t,e);case de.Sequence:return o.visitSequence(t,e);case de.Group:return o.visitGroup(t,e);case de.Animate:return o.visitAnimate(t,e);case de.Keyframes:return o.visitKeyframes(t,e);case de.Style:return o.visitStyle(t,e);case de.Reference:return o.visitReference(t,e);case de.AnimateChild:return o.visitAnimateChild(t,e);case de.AnimateRef:return o.visitAnimateRef(t,e);case de.Query:return o.visitQuery(t,e);case de.Stagger:return o.visitStagger(t,e);default:throw zg(t.type)}}function us(o,t){return window.getComputedStyle(o)[t]}var Rc=(()=>{class o{validateStyleProperty(e){return Mp(e)}containsElement(e,i){return pc(e,i)}getParentElement(e){return ds(e)}query(e,i,n){return hc(e,i,n)}computeStyle(e,i,n){return n||""}animate(e,i,n,r,a,c=[],h){return new Li(n,r)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac})}return o})(),so=class{static NOOP=new Rc},lo=class{};var Qg=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"]),vs=class extends lo{normalizePropertyName(t,e){return hs(t)}normalizeStyleValue(t,e,i,n){let r="",a=i.toString().trim();if(Qg.has(e)&&i!==0&&i!=="0")if(typeof i=="number")r="px";else{let c=i.match(/^[+-]?[\d\.]+([a-z]*)$/);c&&c[1].length==0&&n.push(tp(t,i))}return a+r}};var ys="*";function Xg(o,t){let e=[];return typeof o=="string"?o.split(/\s*,\s*/).forEach(i=>Kg(i,e,t)):e.push(o),e}function Kg(o,t,e){if(o[0]==":"){let h=Zg(o,e);if(typeof h=="function"){t.push(h);return}o=h}let i=o.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(i==null||i.length<4)return e.push(hp(o)),t;let n=i[1],r=i[2],a=i[3];t.push(Ap(n,a));let c=n==ys&&a==ys;r[0]=="<"&&!c&&t.push(Ap(a,n))}function Zg(o,t){switch(o){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,i)=>parseFloat(i)>parseFloat(e);case":decrement":return(e,i)=>parseFloat(i)<parseFloat(e);default:return t.push(up(o)),"* => *"}}var gs=new Set(["true","1"]),fs=new Set(["false","0"]);function Ap(o,t){let e=gs.has(o)||fs.has(o),i=gs.has(t)||fs.has(t);return(n,r)=>{let a=o==ys||o==n,c=t==ys||t==r;return!a&&e&&typeof n=="boolean"&&(a=n?gs.has(o):fs.has(o)),!c&&i&&typeof r=="boolean"&&(c=r?gs.has(t):fs.has(t)),a&&c}}var Bp=":self",Jg=new RegExp(`s*${Bp}s*,?`,"g");function Hp(o,t,e,i){return new wc(o).build(t,e,i)}var Ip="",wc=class{_driver;constructor(t){this._driver=t}build(t,e,i){let n=new Sc(e);return this._resetContextStyleTimingState(n),Yt(this,Uo(t),n)}_resetContextStyleTimingState(t){t.currentQuerySelector=Ip,t.collectedStyles=new Map,t.collectedStyles.set(Ip,new Map),t.currentTime=0}visitTrigger(t,e){let i=e.queryCount=0,n=e.depCount=0,r=[],a=[];return t.name.charAt(0)=="@"&&e.errors.push(ip()),t.definitions.forEach(c=>{if(this._resetContextStyleTimingState(e),c.type==de.State){let h=c,g=h.name;g.toString().split(/\s*,\s*/).forEach(y=>{h.name=y,r.push(this.visitState(h,e))}),h.name=g}else if(c.type==de.Transition){let h=this.visitTransition(c,e);i+=h.queryCount,n+=h.depCount,a.push(h)}else e.errors.push(np())}),{type:de.Trigger,name:t.name,states:r,transitions:a,queryCount:i,depCount:n,options:null}}visitState(t,e){let i=this.visitStyle(t.styles,e),n=t.options&&t.options.params||null;if(i.containsDynamicStyles){let r=new Set,a=n||{};i.styles.forEach(c=>{c instanceof Map&&c.forEach(h=>{_c(h).forEach(g=>{a.hasOwnProperty(g)||r.add(g)})})}),r.size&&e.errors.push(op(t.name,[...r.values()]))}return{type:de.State,name:t.name,style:i,options:n?{params:n}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;let i=Yt(this,Uo(t.animation),e),n=Xg(t.expr,e.errors);return{type:de.Transition,matchers:n,animation:i,queryCount:e.queryCount,depCount:e.depCount,options:ao(t.options)}}visitSequence(t,e){return{type:de.Sequence,steps:t.steps.map(i=>Yt(this,i,e)),options:ao(t.options)}}visitGroup(t,e){let i=e.currentTime,n=0,r=t.steps.map(a=>{e.currentTime=i;let c=Yt(this,a,e);return n=Math.max(n,e.currentTime),c});return e.currentTime=n,{type:de.Group,steps:r,options:ao(t.options)}}visitAnimate(t,e){let i=of(t.timings,e.errors);e.currentAnimateTimings=i;let n,r=t.styles?t.styles:Dn({});if(r.type==de.Keyframes)n=this.visitKeyframes(r,e);else{let a=t.styles,c=!1;if(!a){c=!0;let g={};i.easing&&(g.easing=i.easing),a=Dn(g)}e.currentTime+=i.duration+i.delay;let h=this.visitStyle(a,e);h.isEmptyStep=c,n=h}return e.currentAnimateTimings=null,{type:de.Animate,timings:i,style:n,options:null}}visitStyle(t,e){let i=this._makeStyleAst(t,e);return this._validateStyleAst(i,e),i}_makeStyleAst(t,e){let i=[],n=Array.isArray(t.styles)?t.styles:[t.styles];for(let c of n)typeof c=="string"?c===ri?i.push(c):e.errors.push(rp(c)):i.push(new Map(Object.entries(c)));let r=!1,a=null;return i.forEach(c=>{if(c instanceof Map&&(c.has("easing")&&(a=c.get("easing"),c.delete("easing")),!r)){for(let h of c.values())if(h.toString().indexOf(uc)>=0){r=!0;break}}}),{type:de.Style,styles:i,easing:a,offset:t.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(t,e){let i=e.currentAnimateTimings,n=e.currentTime,r=e.currentTime;i&&r>0&&(r-=i.duration+i.delay),t.styles.forEach(a=>{typeof a!="string"&&a.forEach((c,h)=>{let g=e.collectedStyles.get(e.currentQuerySelector),y=g.get(h),S=!0;y&&(r!=n&&r>=y.startTime&&n<=y.endTime&&(e.errors.push(ap(h,y.startTime,y.endTime,r,n)),S=!1),r=y.startTime),S&&g.set(h,{startTime:r,endTime:n}),e.options&&Ep(c,e.options,e.errors)})})}visitKeyframes(t,e){let i={type:de.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(sp()),i;let n=1,r=0,a=[],c=!1,h=!1,g=0,y=t.steps.map(Le=>{let G=this._makeStyleAst(Le,e),fe=G.offset!=null?G.offset:nf(G.styles),re=0;return fe!=null&&(r++,re=G.offset=fe),h=h||re<0||re>1,c=c||re<g,g=re,a.push(re),G});h&&e.errors.push(lp()),c&&e.errors.push(cp());let S=t.steps.length,A=0;r>0&&r<S?e.errors.push(dp()):r==0&&(A=n/(S-1));let F=S-1,T=e.currentTime,B=e.currentAnimateTimings,_e=B.duration;return y.forEach((Le,G)=>{let fe=A>0?G==F?1:A*G:a[G],re=fe*_e;e.currentTime=T+B.delay+re,B.duration=re,this._validateStyleAst(Le,e),Le.offset=fe,i.styles.push(Le)}),i}visitReference(t,e){return{type:de.Reference,animation:Yt(this,Uo(t.animation),e),options:ao(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:de.AnimateChild,options:ao(t.options)}}visitAnimateRef(t,e){return{type:de.AnimateRef,animation:this.visitReference(t.animation,e),options:ao(t.options)}}visitQuery(t,e){let i=e.currentQuerySelector,n=t.options||{};e.queryCount++,e.currentQuery=t;let[r,a]=ef(t.selector);e.currentQuerySelector=i.length?i+" "+r:r,Gt(e.collectedStyles,e.currentQuerySelector,new Map);let c=Yt(this,Uo(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=i,{type:de.Query,selector:r,limit:n.limit||0,optional:!!n.optional,includeSelf:a,animation:c,originalSelector:t.selector,options:ao(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push(mp());let i=t.timings==="full"?{duration:0,delay:0,easing:"full"}:Br(t.timings,e.errors,!0);return{type:de.Stagger,animation:Yt(this,Uo(t.animation),e),timings:i,options:null}}};function ef(o){let t=!!o.split(/\s*,\s*/).find(e=>e==Bp);return t&&(o=o.replace(Jg,"")),o=o.replace(/@\*/g,jr).replace(/@\w+/g,e=>jr+"-"+e.slice(1)).replace(/:animating/g,ps),[o,t]}function tf(o){return o?Z({},o):null}var Sc=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(t){this.errors=t}};function nf(o){if(typeof o=="string")return null;let t=null;if(Array.isArray(o))o.forEach(e=>{if(e instanceof Map&&e.has("offset")){let i=e;t=parseFloat(i.get("offset")),i.delete("offset")}});else if(o instanceof Map&&o.has("offset")){let e=o;t=parseFloat(e.get("offset")),e.delete("offset")}return t}function of(o,t){if(o.hasOwnProperty("duration"))return o;if(typeof o=="number"){let r=Br(o,t).duration;return bc(r,0,"")}let e=o;if(e.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=bc(0,0,"");return r.dynamic=!0,r.strValue=e,r}let n=Br(e,t);return bc(n.duration,n.delay,n.easing)}function ao(o){return o?(o=Z({},o),o.params&&(o.params=tf(o.params))):o={},o}function bc(o,t,e){return{duration:o,delay:t,easing:e}}function Fc(o,t,e,i,n,r,a=null,c=!1){return{type:1,element:o,keyframes:t,preStyleProps:e,postStyleProps:i,duration:n,delay:r,totalTime:n+r,easing:a,subTimeline:c}}var Ur=class{_map=new Map;get(t){return this._map.get(t)||[]}append(t,e){let i=this._map.get(t);i||this._map.set(t,i=[]),i.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}},rf=1,af=":enter",sf=new RegExp(af,"g"),lf=":leave",cf=new RegExp(lf,"g");function Up(o,t,e,i,n,r=new Map,a=new Map,c,h,g=[]){return new kc().buildKeyframes(o,t,e,i,n,r,a,c,h,g)}var kc=class{buildKeyframes(t,e,i,n,r,a,c,h,g,y=[]){g=g||new Ur;let S=new Mc(t,e,g,n,r,y,[]);S.options=h;let A=h.delay?Vi(h.delay):0;S.currentTimeline.delayNextStep(A),S.currentTimeline.setStyles([a],null,S.errors,h),Yt(this,i,S);let F=S.timelines.filter(T=>T.containsAnimation());if(F.length&&c.size){let T;for(let B=F.length-1;B>=0;B--){let _e=F[B];if(_e.element===e){T=_e;break}}T&&!T.allowOnlyTimelineStyles()&&T.setStyles([c],null,S.errors,h)}return F.length?F.map(T=>T.buildKeyframes()):[Fc(e,[],[],[],0,A,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){let i=e.subInstructions.get(e.element);if(i){let n=e.createSubContext(t.options),r=e.currentTimeline.currentTime,a=this._visitSubInstructions(i,n,n.options);r!=a&&e.transformIntoNewTimeline(a)}e.previousNode=t}visitAnimateRef(t,e){let i=e.createSubContext(t.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([t.options,t.animation.options],e,i),this.visitReference(t.animation,i),e.transformIntoNewTimeline(i.currentTimeline.currentTime),e.previousNode=t}_applyAnimationRefDelays(t,e,i){for(let n of t){let r=n?.delay;if(r){let a=typeof r=="number"?r:Vi(Wo(r,n?.params??{},e.errors));i.delayNextStep(a)}}}_visitSubInstructions(t,e,i){let r=e.currentTimeline.currentTime,a=i.duration!=null?Vi(i.duration):null,c=i.delay!=null?Vi(i.delay):null;return a!==0&&t.forEach(h=>{let g=e.appendInstructionToTimeline(h,a,c);r=Math.max(r,g.duration+g.delay)}),r}visitReference(t,e){e.updateOptions(t.options,!0),Yt(this,t.animation,e),e.previousNode=t}visitSequence(t,e){let i=e.subContextCount,n=e,r=t.options;if(r&&(r.params||r.delay)&&(n=e.createSubContext(r),n.transformIntoNewTimeline(),r.delay!=null)){n.previousNode.type==de.Style&&(n.currentTimeline.snapshotCurrentStyles(),n.previousNode=Cs);let a=Vi(r.delay);n.delayNextStep(a)}t.steps.length&&(t.steps.forEach(a=>Yt(this,a,n)),n.currentTimeline.applyStylesToKeyframe(),n.subContextCount>i&&n.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){let i=[],n=e.currentTimeline.currentTime,r=t.options&&t.options.delay?Vi(t.options.delay):0;t.steps.forEach(a=>{let c=e.createSubContext(t.options);r&&c.delayNextStep(r),Yt(this,a,c),n=Math.max(n,c.currentTimeline.currentTime),i.push(c.currentTimeline)}),i.forEach(a=>e.currentTimeline.mergeTimelineCollectedStyles(a)),e.transformIntoNewTimeline(n),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){let i=t.strValue,n=e.params?Wo(i,e.params,e.errors):i;return Br(n,e.errors)}else return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){let i=e.currentAnimateTimings=this._visitTiming(t.timings,e),n=e.currentTimeline;i.delay&&(e.incrementTime(i.delay),n.snapshotCurrentStyles());let r=t.style;r.type==de.Keyframes?this.visitKeyframes(r,e):(e.incrementTime(i.duration),this.visitStyle(r,e),n.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){let i=e.currentTimeline,n=e.currentAnimateTimings;!n&&i.hasCurrentStyleProperties()&&i.forwardFrame();let r=n&&n.easing||t.easing;t.isEmptyStep?i.applyEmptyStep(r):i.setStyles(t.styles,r,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){let i=e.currentAnimateTimings,n=e.currentTimeline.duration,r=i.duration,c=e.createSubContext().currentTimeline;c.easing=i.easing,t.styles.forEach(h=>{let g=h.offset||0;c.forwardTime(g*r),c.setStyles(h.styles,h.easing,e.errors,e.options),c.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(c),e.transformIntoNewTimeline(n+r),e.previousNode=t}visitQuery(t,e){let i=e.currentTimeline.currentTime,n=t.options||{},r=n.delay?Vi(n.delay):0;r&&(e.previousNode.type===de.Style||i==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=Cs);let a=i,c=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!n.optional,e.errors);e.currentQueryTotal=c.length;let h=null;c.forEach((g,y)=>{e.currentQueryIndex=y;let S=e.createSubContext(t.options,g);r&&S.delayNextStep(r),g===e.element&&(h=S.currentTimeline),Yt(this,t.animation,S),S.currentTimeline.applyStylesToKeyframe();let A=S.currentTimeline.currentTime;a=Math.max(a,A)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(a),h&&(e.currentTimeline.mergeTimelineCollectedStyles(h),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){let i=e.parentContext,n=e.currentTimeline,r=t.timings,a=Math.abs(r.duration),c=a*(e.currentQueryTotal-1),h=a*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":h=c-h;break;case"full":h=i.currentStaggerTime;break}let y=e.currentTimeline;h&&y.delayNextStep(h);let S=y.currentTime;Yt(this,t.animation,e),e.previousNode=t,i.currentStaggerTime=n.currentTime-S+(n.startTime-i.currentTimeline.startTime)}},Cs={},Mc=class o{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Cs;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(t,e,i,n,r,a,c,h){this._driver=t,this.element=e,this.subInstructions=i,this._enterClassName=n,this._leaveClassName=r,this.errors=a,this.timelines=c,this.currentTimeline=h||new xs(this._driver,e,0),c.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;let i=t,n=this.options;i.duration!=null&&(n.duration=Vi(i.duration)),i.delay!=null&&(n.delay=Vi(i.delay));let r=i.params;if(r){let a=n.params;a||(a=this.options.params={}),Object.keys(r).forEach(c=>{(!e||!a.hasOwnProperty(c))&&(a[c]=Wo(r[c],a,this.errors))})}}_copyOptions(){let t={};if(this.options){let e=this.options.params;if(e){let i=t.params={};Object.keys(e).forEach(n=>{i[n]=e[n]})}}return t}createSubContext(t=null,e,i){let n=e||this.element,r=new o(this._driver,n,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(n,i||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(t),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(t){return this.previousNode=Cs,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,i){let n={duration:e??t.duration,delay:this.currentTimeline.currentTime+(i??0)+t.delay,easing:""},r=new Tc(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,n,t.stretchStartingKeyframe);return this.timelines.push(r),n}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,i,n,r,a){let c=[];if(n&&c.push(this.element),t.length>0){t=t.replace(sf,"."+this._enterClassName),t=t.replace(cf,"."+this._leaveClassName);let h=i!=1,g=this._driver.query(this.element,t,h);i!==0&&(g=i<0?g.slice(g.length+i,g.length):g.slice(0,i)),c.push(...g)}return!r&&c.length==0&&a.push(pp(e)),c}},xs=class o{_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(t,e,i,n){this._driver=t,this.element=e,this.startTime=i,this._elementTimelineStylesLookup=n,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(t){let e=this._keyframes.size===1&&this._pendingStyles.size;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new o(this._driver,t,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+=rf,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles.set(t,e),this._globalTimelineStyles.set(t,e),this._styleSummary.set(t,{time:this.currentTime,value:e})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&this._previousKeyframe.set("easing",t);for(let[e,i]of this._globalTimelineStyles)this._backFill.set(e,i||ri),this._currentKeyframe.set(e,ri);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,i,n){e&&this._previousKeyframe.set("easing",e);let r=n&&n.params||{},a=df(t,this._globalTimelineStyles);for(let[c,h]of a){let g=Wo(h,r,i);this._pendingStyles.set(c,g),this._localTimelineStyles.has(c)||this._backFill.set(c,this._globalTimelineStyles.get(c)??ri),this._updateStyle(c,g)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((t,e)=>{this._currentKeyframe.set(e,t)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((t,e)=>{this._currentKeyframe.has(e)||this._currentKeyframe.set(e,t)}))}snapshotCurrentStyles(){for(let[t,e]of this._localTimelineStyles)this._pendingStyles.set(t,e),this._updateStyle(t,e)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){t._styleSummary.forEach((e,i)=>{let n=this._styleSummary.get(i);(!n||e.time>n.time)&&this._updateStyle(i,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let t=new Set,e=new Set,i=this._keyframes.size===1&&this.duration===0,n=[];this._keyframes.forEach((c,h)=>{let g=new Map([...this._backFill,...c]);g.forEach((y,S)=>{y===Ho?t.add(S):y===ri&&e.add(S)}),i||g.set("offset",h/this.duration),n.push(g)});let r=[...t.values()],a=[...e.values()];if(i){let c=n[0],h=new Map(c);c.set("offset",0),h.set("offset",1),n=[c,h]}return Fc(this.element,n,r,a,this.duration,this.startTime,this.easing,!1)}},Tc=class extends xs{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(t,e,i,n,r,a,c=!1){super(t,e,a.delay),this.keyframes=i,this.preStyleProps=n,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 t=this.keyframes,{delay:e,duration:i,easing:n}=this.timings;if(this._stretchStartingKeyframe&&e){let r=[],a=i+e,c=e/a,h=new Map(t[0]);h.set("offset",0),r.push(h);let g=new Map(t[0]);g.set("offset",Dp(c)),r.push(g);let y=t.length-1;for(let S=1;S<=y;S++){let A=new Map(t[S]),F=A.get("offset"),T=e+F*i;A.set("offset",Dp(T/a)),r.push(A)}i=a,e=0,n="",t=r}return Fc(this.element,t,this.preStyleProps,this.postStyleProps,i,e,n,!0)}};function Dp(o,t=3){let e=Math.pow(10,t-1);return Math.round(o*e)/e}function df(o,t){let e=new Map,i;return o.forEach(n=>{if(n==="*"){i??=t.keys();for(let r of i)e.set(r,ri)}else for(let[r,a]of n)e.set(r,a)}),e}function Rp(o,t,e,i,n,r,a,c,h,g,y,S,A){return{type:0,element:o,triggerName:t,isRemovalTransition:n,fromState:e,fromStyles:r,toState:i,toStyles:a,timelines:c,queriedElements:h,preStyleProps:g,postStyleProps:y,totalTime:S,errors:A}}var vc={},ws=class{_triggerName;ast;_stateStyles;constructor(t,e,i){this._triggerName=t,this.ast=e,this._stateStyles=i}match(t,e,i,n){return mf(this.ast.matchers,t,e,i,n)}buildStyles(t,e,i){let n=this._stateStyles.get("*");return t!==void 0&&(n=this._stateStyles.get(t?.toString())||n),n?n.buildStyles(e,i):new Map}build(t,e,i,n,r,a,c,h,g,y){let S=[],A=this.ast.options&&this.ast.options.params||vc,F=c&&c.params||vc,T=this.buildStyles(i,F,S),B=h&&h.params||vc,_e=this.buildStyles(n,B,S),Le=new Set,G=new Map,fe=new Map,re=n==="void",it={params:Wp(B,A),delay:this.ast.options?.delay},De=y?[]:Up(t,e,this.ast.animation,r,a,T,_e,it,g,S),Je=0;return De.forEach(wt=>{Je=Math.max(wt.duration+wt.delay,Je)}),S.length?Rp(e,this._triggerName,i,n,re,T,_e,[],[],G,fe,Je,S):(De.forEach(wt=>{let Zi=wt.element,wn=Gt(G,Zi,new Set);wt.preStyleProps.forEach(pi=>wn.add(pi));let ft=Gt(fe,Zi,new Set);wt.postStyleProps.forEach(pi=>ft.add(pi)),Zi!==e&&Le.add(Zi)}),Rp(e,this._triggerName,i,n,re,T,_e,De,[...Le.values()],G,fe,Je))}};function mf(o,t,e,i,n){return o.some(r=>r(t,e,i,n))}function Wp(o,t){let e=Z({},t);return Object.entries(o).forEach(([i,n])=>{n!=null&&(e[i]=n)}),e}var Ec=class{styles;defaultParams;normalizer;constructor(t,e,i){this.styles=t,this.defaultParams=e,this.normalizer=i}buildStyles(t,e){let i=new Map,n=Wp(t,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((a,c)=>{a&&(a=Wo(a,n,e));let h=this.normalizer.normalizePropertyName(c,e);a=this.normalizer.normalizeStyleValue(c,h,a,e),i.set(c,a)})}),i}};function pf(o,t,e){return new Pc(o,t,e)}var Pc=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(t,e,i){this.name=t,this.ast=e,this._normalizer=i,e.states.forEach(n=>{let r=n.options&&n.options.params||{};this.states.set(n.name,new Ec(n.style,r,i))}),Fp(this.states,"true","1"),Fp(this.states,"false","0"),e.transitions.forEach(n=>{this.transitionFactories.push(new ws(t,n,this.states))}),this.fallbackTransition=hf(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,i,n){return this.transitionFactories.find(a=>a.match(t,e,i,n))||null}matchStyles(t,e,i){return this.fallbackTransition.buildStyles(t,e,i)}};function hf(o,t,e){let i=[(a,c)=>!0],n={type:de.Sequence,steps:[],options:null},r={type:de.Transition,animation:n,matchers:i,options:null,queryCount:0,depCount:0};return new ws(o,r,t)}function Fp(o,t,e){o.has(t)?o.has(e)||o.set(e,o.get(t)):o.has(e)&&o.set(t,o.get(e))}var uf=new Ur,Oc=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(t,e,i){this.bodyNode=t,this._driver=e,this._normalizer=i}register(t,e){let i=[],n=[],r=Hp(this._driver,e,i,n);if(i.length)throw fp(i);this._animations.set(t,r)}_buildPlayer(t,e,i){let n=t.element,r=dc(this._normalizer,t.keyframes,e,i);return this._driver.animate(n,r,t.duration,t.delay,t.easing,[],!0)}create(t,e,i={}){let n=[],r=this._animations.get(t),a,c=new Map;if(r?(a=Up(this._driver,e,r,gc,ms,new Map,new Map,i,uf,n),a.forEach(y=>{let S=Gt(c,y.element,new Map);y.postStyleProps.forEach(A=>S.set(A,null))})):(n.push(_p()),a=[]),n.length)throw bp(n);c.forEach((y,S)=>{y.forEach((A,F)=>{y.set(F,this._driver.computeStyle(S,F,ri))})});let h=a.map(y=>{let S=c.get(y.element);return this._buildPlayer(y,new Map,S)}),g=an(h);return this._playersById.set(t,g),g.onDestroy(()=>this.destroy(t)),this.players.push(g),g}destroy(t){let e=this._getPlayer(t);e.destroy(),this._playersById.delete(t);let i=this.players.indexOf(e);i>=0&&this.players.splice(i,1)}_getPlayer(t){let e=this._playersById.get(t);if(!e)throw vp(t);return e}listen(t,e,i,n){let r=cs(e,"","","");return ls(this._getPlayer(t),i,r,n),()=>{}}command(t,e,i,n){if(i=="register"){this.register(t,n[0]);return}if(i=="create"){let a=n[0]||{};this.create(t,e,a);return}let r=this._getPlayer(t);switch(i){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(n[0]));break;case"destroy":this.destroy(t);break}}},Np="ng-animate-queued",gf=".ng-animate-queued",yc="ng-animate-disabled",ff=".ng-animate-disabled",_f="ng-star-inserted",bf=".ng-star-inserted",vf=[],$p={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},yf={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},bi="__ng_removed",Wr=class{namespaceId;value;options;get params(){return this.options.params}constructor(t,e=""){this.namespaceId=e;let i=t&&t.hasOwnProperty("value"),n=i?t.value:t;if(this.value=xf(n),i){let r=t,{value:a}=r,c=rm(r,["value"]);this.options=c}else this.options={};this.options.params||(this.options.params={})}absorbOptions(t){let e=t.params;if(e){let i=this.options.params;Object.keys(e).forEach(n=>{i[n]==null&&(i[n]=e[n])})}}},Hr="void",Cc=new Wr(Hr),Ac=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(t,e,i){this.id=t,this.hostElement=e,this._engine=i,this._hostClassName="ng-tns-"+t,ai(e,this._hostClassName)}listen(t,e,i,n){if(!this._triggers.has(e))throw yp(i,e);if(i==null||i.length==0)throw Cp(e);if(!wf(i))throw xp(i,e);let r=Gt(this._elementListeners,t,[]),a={name:e,phase:i,callback:n};r.push(a);let c=Gt(this._engine.statesByElement,t,new Map);return c.has(e)||(ai(t,zr),ai(t,zr+"-"+e),c.set(e,Cc)),()=>{this._engine.afterFlush(()=>{let h=r.indexOf(a);h>=0&&r.splice(h,1),this._triggers.has(e)||c.delete(e)})}}register(t,e){return this._triggers.has(t)?!1:(this._triggers.set(t,e),!0)}_getTrigger(t){let e=this._triggers.get(t);if(!e)throw wp(t);return e}trigger(t,e,i,n=!0){let r=this._getTrigger(e),a=new $r(this.id,e,t),c=this._engine.statesByElement.get(t);c||(ai(t,zr),ai(t,zr+"-"+e),this._engine.statesByElement.set(t,c=new Map));let h=c.get(e),g=new Wr(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&h&&g.absorbOptions(h.options),c.set(e,g),h||(h=Cc),!(g.value===Hr)&&h.value===g.value){if(!Mf(h.params,g.params)){let B=[],_e=r.matchStyles(h.value,h.params,B),Le=r.matchStyles(g.value,g.params,B);B.length?this._engine.reportError(B):this._engine.afterFlush(()=>{Rn(t,_e),_i(t,Le)})}return}let A=Gt(this._engine.playersByElement,t,[]);A.forEach(B=>{B.namespaceId==this.id&&B.triggerName==e&&B.queued&&B.destroy()});let F=r.matchTransition(h.value,g.value,t,g.params),T=!1;if(!F){if(!n)return;F=r.fallbackTransition,T=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:F,fromState:h,toState:g,player:a,isFallbackTransition:T}),T||(ai(t,Np),a.onStart(()=>{$o(t,Np)})),a.onDone(()=>{let B=this.players.indexOf(a);B>=0&&this.players.splice(B,1);let _e=this._engine.playersByElement.get(t);if(_e){let Le=_e.indexOf(a);Le>=0&&_e.splice(Le,1)}}),this.players.push(a),A.push(a),a}deregister(t){this._triggers.delete(t),this._engine.statesByElement.forEach(e=>e.delete(t)),this._elementListeners.forEach((e,i)=>{this._elementListeners.set(i,e.filter(n=>n.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);let e=this._engine.playersByElement.get(t);e&&(e.forEach(i=>i.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){let i=this._engine.driver.query(t,jr,!0);i.forEach(n=>{if(n[bi])return;let r=this._engine.fetchNamespacesByElement(n);r.size?r.forEach(a=>a.triggerLeaveAnimation(n,e,!1,!0)):this.clearElementCache(n)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(n=>this.clearElementCache(n)))}triggerLeaveAnimation(t,e,i,n){let r=this._engine.statesByElement.get(t),a=new Map;if(r){let c=[];if(r.forEach((h,g)=>{if(a.set(g,h.value),this._triggers.has(g)){let y=this.trigger(t,g,Hr,n);y&&c.push(y)}}),c.length)return this._engine.markElementAsRemoved(this.id,t,!0,e,a),i&&an(c).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){let e=this._elementListeners.get(t),i=this._engine.statesByElement.get(t);if(e&&i){let n=new Set;e.forEach(r=>{let a=r.name;if(n.has(a))return;n.add(a);let h=this._triggers.get(a).fallbackTransition,g=i.get(a)||Cc,y=new Wr(Hr),S=new $r(this.id,a,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:a,transition:h,fromState:g,toState:y,player:S,isFallbackTransition:!0})})}}removeNode(t,e){let i=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let n=!1;if(i.totalAnimations){let r=i.players.length?i.playersByQueriedElement.get(t):[];if(r&&r.length)n=!0;else{let a=t;for(;a=a.parentNode;)if(i.statesByElement.get(a)){n=!0;break}}}if(this.prepareLeaveAnimationListeners(t),n)i.markElementAsRemoved(this.id,t,!1,e);else{let r=t[bi];(!r||r===$p)&&(i.afterFlush(()=>this.clearElementCache(t)),i.destroyInnerAnimations(t),i._onRemovalComplete(t,e))}}insertNode(t,e){ai(t,this._hostClassName)}drainQueuedTransitions(t){let e=[];return this._queue.forEach(i=>{let n=i.player;if(n.destroyed)return;let r=i.element,a=this._elementListeners.get(r);a&&a.forEach(c=>{if(c.name==i.triggerName){let h=cs(r,i.triggerName,i.fromState.value,i.toState.value);h._data=t,ls(i.player,c.phase,h,c.callback)}}),n.markedForDestroy?this._engine.afterFlush(()=>{n.destroy()}):e.push(i)}),this._queue=[],e.sort((i,n)=>{let r=i.transition.ast.depCount,a=n.transition.ast.depCount;return r==0||a==0?r-a:this._engine.driver.containsElement(i.element,n.element)?1:-1})}destroy(t){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}},Ic=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=(t,e)=>{};_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}constructor(t,e,i){this.bodyNode=t,this.driver=e,this._normalizer=i}get queuedPlayers(){let t=[];return this._namespaceList.forEach(e=>{e.players.forEach(i=>{i.queued&&t.push(i)})}),t}createNamespace(t,e){let i=new Ac(t,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(i,e):(this.newHostElements.set(e,i),this.collectEnterElement(e)),this._namespaceLookup[t]=i}_balanceNamespaceList(t,e){let i=this._namespaceList,n=this.namespacesByHostElement;if(i.length-1>=0){let a=!1,c=this.driver.getParentElement(e);for(;c;){let h=n.get(c);if(h){let g=i.indexOf(h);i.splice(g+1,0,t),a=!0;break}c=this.driver.getParentElement(c)}a||i.unshift(t)}else i.push(t);return n.set(e,t),t}register(t,e){let i=this._namespaceLookup[t];return i||(i=this.createNamespace(t,e)),i}registerTrigger(t,e,i){let n=this._namespaceLookup[t];n&&n.register(e,i)&&this.totalAnimations++}destroy(t,e){t&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let i=this._fetchNamespace(t);this.namespacesByHostElement.delete(i.hostElement);let n=this._namespaceList.indexOf(i);n>=0&&this._namespaceList.splice(n,1),i.destroy(e),delete this._namespaceLookup[t]}))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){let e=new Set,i=this.statesByElement.get(t);if(i){for(let n of i.values())if(n.namespaceId){let r=this._fetchNamespace(n.namespaceId);r&&e.add(r)}}return e}trigger(t,e,i,n){if(_s(e)){let r=this._fetchNamespace(t);if(r)return r.trigger(e,i,n),!0}return!1}insertNode(t,e,i,n){if(!_s(e))return;let r=e[bi];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let a=this.collectedLeaveElements.indexOf(e);a>=0&&this.collectedLeaveElements.splice(a,1)}if(t){let a=this._fetchNamespace(t);a&&a.insertNode(e,i)}n&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),ai(t,yc)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),$o(t,yc))}removeNode(t,e,i){if(_s(e)){let n=t?this._fetchNamespace(t):null;n?n.removeNode(e,i):this.markElementAsRemoved(t,e,!1,i);let r=this.namespacesByHostElement.get(e);r&&r.id!==t&&r.removeNode(e,i)}else this._onRemovalComplete(e,i)}markElementAsRemoved(t,e,i,n,r){this.collectedLeaveElements.push(e),e[bi]={namespaceId:t,setForRemoval:n,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:r}}listen(t,e,i,n,r){return _s(e)?this._fetchNamespace(t).listen(e,i,n,r):()=>{}}_buildInstruction(t,e,i,n,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,i,n,t.fromState.options,t.toState.options,e,r)}destroyInnerAnimations(t){let e=this.driver.query(t,jr,!0);e.forEach(i=>this.destroyActiveAnimationsForElement(i)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(t,ps,!0),e.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(t){let e=this.playersByElement.get(t);e&&e.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(t){let e=this.playersByQueriedElement.get(t);e&&e.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return an(this.players).onDone(()=>t());t()})}processLeaveNode(t){let e=t[bi];if(e&&e.setForRemoval){if(t[bi]=$p,e.namespaceId){this.destroyInnerAnimations(t);let i=this._fetchNamespace(e.namespaceId);i&&i.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}t.classList?.contains(yc)&&this.markElementAsDisabled(t,!1),this.driver.query(t,ff,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,n)=>this._balanceNamespaceList(i,n)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;i<this.collectedEnterElements.length;i++){let n=this.collectedEnterElements[i];ai(n,_f)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let i=[];try{e=this._flushAnimations(i,t)}finally{for(let n=0;n<i.length;n++)i[n]()}}else for(let i=0;i<this.collectedLeaveElements.length;i++){let n=this.collectedLeaveElements[i];this.processLeaveNode(n)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(i=>i()),this._flushFns=[],this._whenQuietFns.length){let i=this._whenQuietFns;this._whenQuietFns=[],e.length?an(e).onDone(()=>{i.forEach(n=>n())}):i.forEach(n=>n())}}reportError(t){throw Sp(t)}_flushAnimations(t,e){let i=new Ur,n=[],r=new Map,a=[],c=new Map,h=new Map,g=new Map,y=new Set;this.disabledNodes.forEach($=>{y.add($);let Y=this.driver.query($,gf,!0);for(let K=0;K<Y.length;K++)y.add(Y[K])});let S=this.bodyNode,A=Array.from(this.statesByElement.keys()),F=zp(A,this.collectedEnterElements),T=new Map,B=0;F.forEach(($,Y)=>{let K=gc+B++;T.set(Y,K),$.forEach(be=>ai(be,K))});let _e=[],Le=new Set,G=new Set;for(let $=0;$<this.collectedLeaveElements.length;$++){let Y=this.collectedLeaveElements[$],K=Y[bi];K&&K.setForRemoval&&(_e.push(Y),Le.add(Y),K.hasAnimation?this.driver.query(Y,bf,!0).forEach(be=>Le.add(be)):G.add(Y))}let fe=new Map,re=zp(A,Array.from(Le));re.forEach(($,Y)=>{let K=ms+B++;fe.set(Y,K),$.forEach(be=>ai(be,K))}),t.push(()=>{F.forEach(($,Y)=>{let K=T.get(Y);$.forEach(be=>$o(be,K))}),re.forEach(($,Y)=>{let K=fe.get(Y);$.forEach(be=>$o(be,K))}),_e.forEach($=>{this.processLeaveNode($)})});let it=[],De=[];for(let $=this._namespaceList.length-1;$>=0;$--)this._namespaceList[$].drainQueuedTransitions(e).forEach(K=>{let be=K.player,st=K.element;if(it.push(be),this.collectedEnterElements.length){let ct=st[bi];if(ct&&ct.setForMove){if(ct.previousTriggersValues&&ct.previousTriggersValues.has(K.triggerName)){let Wt=ct.previousTriggersValues.get(K.triggerName),Dt=this.statesByElement.get(K.element);if(Dt&&Dt.has(K.triggerName)){let Sn=Dt.get(K.triggerName);Sn.value=Wt,Dt.set(K.triggerName,Sn)}}be.destroy();return}}let Ie=!S||!this.driver.containsElement(S,st),St=fe.get(st),Ve=T.get(st),ze=this._buildInstruction(K,i,Ve,St,Ie);if(ze.errors&&ze.errors.length){De.push(ze);return}if(Ie){be.onStart(()=>Rn(st,ze.fromStyles)),be.onDestroy(()=>_i(st,ze.toStyles)),n.push(be);return}if(K.isFallbackTransition){be.onStart(()=>Rn(st,ze.fromStyles)),be.onDestroy(()=>_i(st,ze.toStyles)),n.push(be);return}let qe=[];ze.timelines.forEach(ct=>{ct.stretchStartingKeyframe=!0,this.disabledNodes.has(ct.element)||qe.push(ct)}),ze.timelines=qe,i.append(st,ze.timelines);let $n={instruction:ze,player:be,element:st};a.push($n),ze.queriedElements.forEach(ct=>Gt(c,ct,[]).push(be)),ze.preStyleProps.forEach((ct,Wt)=>{if(ct.size){let Dt=h.get(Wt);Dt||h.set(Wt,Dt=new Set),ct.forEach((Sn,wo)=>Dt.add(wo))}}),ze.postStyleProps.forEach((ct,Wt)=>{let Dt=g.get(Wt);Dt||g.set(Wt,Dt=new Set),ct.forEach((Sn,wo)=>Dt.add(wo))})});if(De.length){let $=[];De.forEach(Y=>{$.push(kp(Y.triggerName,Y.errors))}),it.forEach(Y=>Y.destroy()),this.reportError($)}let Je=new Map,wt=new Map;a.forEach($=>{let Y=$.element;i.has(Y)&&(wt.set(Y,Y),this._beforeAnimationBuild($.player.namespaceId,$.instruction,Je))}),n.forEach($=>{let Y=$.element;this._getPreviousPlayers(Y,!1,$.namespaceId,$.triggerName,null).forEach(be=>{Gt(Je,Y,[]).push(be),be.destroy()})});let Zi=_e.filter($=>jp($,h,g)),wn=new Map;Vp(wn,this.driver,G,g,ri).forEach($=>{jp($,h,g)&&Zi.push($)});let pi=new Map;F.forEach(($,Y)=>{Vp(pi,this.driver,new Set($),h,Ho)}),Zi.forEach($=>{let Y=wn.get($),K=pi.get($);wn.set($,new Map([...Y?.entries()??[],...K?.entries()??[]]))});let Wn=[],xo=[],ka={};a.forEach($=>{let{element:Y,player:K,instruction:be}=$;if(i.has(Y)){if(y.has(Y)){K.onDestroy(()=>_i(Y,be.toStyles)),K.disabled=!0,K.overrideTotalTime(be.totalTime),n.push(K);return}let st=ka;if(wt.size>1){let St=Y,Ve=[];for(;St=St.parentNode;){let ze=wt.get(St);if(ze){st=ze;break}Ve.push(St)}Ve.forEach(ze=>wt.set(ze,st))}let Ie=this._buildAnimation(K.namespaceId,be,Je,r,pi,wn);if(K.setRealPlayer(Ie),st===ka)Wn.push(K);else{let St=this.playersByElement.get(st);St&&St.length&&(K.parentPlayer=an(St)),n.push(K)}}else Rn(Y,be.fromStyles),K.onDestroy(()=>_i(Y,be.toStyles)),xo.push(K),y.has(Y)&&n.push(K)}),xo.forEach($=>{let Y=r.get($.element);if(Y&&Y.length){let K=an(Y);$.setRealPlayer(K)}}),n.forEach($=>{$.parentPlayer?$.syncPlayerEvents($.parentPlayer):$.destroy()});for(let $=0;$<_e.length;$++){let Y=_e[$],K=Y[bi];if($o(Y,ms),K&&K.hasAnimation)continue;let be=[];if(c.size){let Ie=c.get(Y);Ie&&Ie.length&&be.push(...Ie);let St=this.driver.query(Y,ps,!0);for(let Ve=0;Ve<St.length;Ve++){let ze=c.get(St[Ve]);ze&&ze.length&&be.push(...ze)}}let st=be.filter(Ie=>!Ie.destroyed);st.length?Sf(this,Y,st):this.processLeaveNode(Y)}return _e.length=0,Wn.forEach($=>{this.players.push($),$.onDone(()=>{$.destroy();let Y=this.players.indexOf($);this.players.splice(Y,1)}),$.play()}),Wn}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,i,n,r){let a=[];if(e){let c=this.playersByQueriedElement.get(t);c&&(a=c)}else{let c=this.playersByElement.get(t);if(c){let h=!r||r==Hr;c.forEach(g=>{g.queued||!h&&g.triggerName!=n||a.push(g)})}}return(i||n)&&(a=a.filter(c=>!(i&&i!=c.namespaceId||n&&n!=c.triggerName))),a}_beforeAnimationBuild(t,e,i){let n=e.triggerName,r=e.element,a=e.isRemovalTransition?void 0:t,c=e.isRemovalTransition?void 0:n;for(let h of e.timelines){let g=h.element,y=g!==r,S=Gt(i,g,[]);this._getPreviousPlayers(g,y,a,c,e.toState).forEach(F=>{let T=F.getRealPlayer();T.beforeDestroy&&T.beforeDestroy(),F.destroy(),S.push(F)})}Rn(r,e.fromStyles)}_buildAnimation(t,e,i,n,r,a){let c=e.triggerName,h=e.element,g=[],y=new Set,S=new Set,A=e.timelines.map(T=>{let B=T.element;y.add(B);let _e=B[bi];if(_e&&_e.removedBeforeQueried)return new Li(T.duration,T.delay);let Le=B!==h,G=kf((i.get(B)||vf).map(Je=>Je.getRealPlayer())).filter(Je=>{let wt=Je;return wt.element?wt.element===B:!1}),fe=r.get(B),re=a.get(B),it=dc(this._normalizer,T.keyframes,fe,re),De=this._buildPlayer(T,it,G);if(T.subTimeline&&n&&S.add(B),Le){let Je=new $r(t,c,B);Je.setRealPlayer(De),g.push(Je)}return De});g.forEach(T=>{Gt(this.playersByQueriedElement,T.element,[]).push(T),T.onDone(()=>Cf(this.playersByQueriedElement,T.element,T))}),y.forEach(T=>ai(T,fc));let F=an(A);return F.onDestroy(()=>{y.forEach(T=>$o(T,fc)),_i(h,e.toStyles)}),S.forEach(T=>{Gt(n,T,[]).push(F)}),F}_buildPlayer(t,e,i){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,i):new Li(t.duration,t.delay)}},$r=class{namespaceId;triggerName;element;_player=new Li;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(t,e,i){this.namespaceId=t,this.triggerName=e,this.element=i}setRealPlayer(t){this._containsRealPlayer||(this._player=t,this._queuedCallbacks.forEach((e,i)=>{e.forEach(n=>ls(t,i,void 0,n))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){let e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){Gt(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}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(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){let e=this._player;e.triggerCallback&&e.triggerCallback(t)}};function Cf(o,t,e){let i=o.get(t);if(i){if(i.length){let n=i.indexOf(e);i.splice(n,1)}i.length==0&&o.delete(t)}return i}function xf(o){return o??null}function _s(o){return o&&o.nodeType===1}function wf(o){return o=="start"||o=="done"}function Lp(o,t){let e=o.style.display;return o.style.display=t??"none",e}function Vp(o,t,e,i,n){let r=[];e.forEach(h=>r.push(Lp(h)));let a=[];i.forEach((h,g)=>{let y=new Map;h.forEach(S=>{let A=t.computeStyle(g,S,n);y.set(S,A),(!A||A.length==0)&&(g[bi]=yf,a.push(g))}),o.set(g,y)});let c=0;return e.forEach(h=>Lp(h,r[c++])),a}function zp(o,t){let e=new Map;if(o.forEach(c=>e.set(c,[])),t.length==0)return e;let i=1,n=new Set(t),r=new Map;function a(c){if(!c)return i;let h=r.get(c);if(h)return h;let g=c.parentNode;return e.has(g)?h=g:n.has(g)?h=i:h=a(g),r.set(c,h),h}return t.forEach(c=>{let h=a(c);h!==i&&e.get(h).push(c)}),e}function ai(o,t){o.classList?.add(t)}function $o(o,t){o.classList?.remove(t)}function Sf(o,t,e){an(e).onDone(()=>o.processLeaveNode(t))}function kf(o){let t=[];return qp(o,t),t}function qp(o,t){for(let e=0;e<o.length;e++){let i=o[e];i instanceof oo?qp(i.players,t):t.push(i)}}function Mf(o,t){let e=Object.keys(o),i=Object.keys(t);if(e.length!=i.length)return!1;for(let n=0;n<e.length;n++){let r=e[n];if(!t.hasOwnProperty(r)||o[r]!==t[r])return!1}return!0}function jp(o,t,e){let i=e.get(o);if(!i)return!1;let n=t.get(o);return n?i.forEach(r=>n.add(r)):t.set(o,i),e.delete(o),!0}var qo=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(t,e)=>{};constructor(t,e,i){this._driver=e,this._normalizer=i,this._transitionEngine=new Ic(t.body,e,i),this._timelineEngine=new Oc(t.body,e,i),this._transitionEngine.onRemovalComplete=(n,r)=>this.onRemovalComplete(n,r)}registerTrigger(t,e,i,n,r){let a=t+"-"+n,c=this._triggerCache[a];if(!c){let h=[],g=[],y=Hp(this._driver,r,h,g);if(h.length)throw gp(n,h);c=pf(n,y,this._normalizer),this._triggerCache[a]=c}this._transitionEngine.registerTrigger(e,n,c)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,i,n){this._transitionEngine.insertNode(t,e,i,n)}onRemove(t,e,i){this._transitionEngine.removeNode(t,e,i)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,i,n){if(i.charAt(0)=="@"){let[r,a]=mc(i),c=n;this._timelineEngine.command(r,e,a,c)}else this._transitionEngine.trigger(t,e,i,n)}listen(t,e,i,n,r){if(i.charAt(0)=="@"){let[a,c]=mc(i);return this._timelineEngine.listen(a,e,c,r)}return this._transitionEngine.listen(t,e,i,n,r)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(t){this._transitionEngine.afterFlushAnimationsDone(t)}};function Tf(o,t){let e=null,i=null;return Array.isArray(t)&&t.length?(e=xc(t[0]),t.length>1&&(i=xc(t[t.length-1]))):t instanceof Map&&(e=xc(t)),e||i?new Ef(o,e,i):null}var Ef=(()=>{class o{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,i,n){this._element=e,this._startStyles=i,this._endStyles=n;let r=o.initialStylesByElement.get(e);r||o.initialStylesByElement.set(e,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&_i(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(_i(this._element,this._initialStyles),this._endStyles&&(_i(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(o.initialStylesByElement.delete(this._element),this._startStyles&&(Rn(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Rn(this._element,this._endStyles),this._endStyles=null),_i(this._element,this._initialStyles),this._state=3)}}return o})();function xc(o){let t=null;return o.forEach((e,i)=>{Pf(i)&&(t=t||new Map,t.set(i,e))}),t}function Pf(o){return o==="display"||o==="position"}var Ss=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(t,e,i,n){this.element=t,this.keyframes=e,this.options=i,this._specialStyles=n,this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;let t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:new Map;let e=()=>this._onFinish();this.domPlayer.addEventListener("finish",e),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",e)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(t){let e=[];return t.forEach(i=>{e.push(Object.fromEntries(i))}),e}_triggerWebAnimation(t,e,i){return t.animate(this._convertKeyframesToObject(e),i)}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),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&&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(t=>t()),this._onDestroyFns=[])}setPosition(t){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let t=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,n)=>{n!=="offset"&&t.set(n,this._finished?i:us(this.element,n))}),this.currentSnapshot=t}triggerCallback(t){let e=t==="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},ks=class{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}containsElement(t,e){return pc(t,e)}getParentElement(t){return ds(t)}query(t,e,i){return hc(t,e,i)}computeStyle(t,e,i){return us(t,e)}animate(t,e,i,n,r,a=[]){let c=n==0?"both":"forwards",h={duration:i,delay:n,fill:c};r&&(h.easing=r);let g=new Map,y=a.filter(F=>F instanceof Ss);Pp(i,n)&&y.forEach(F=>{F.currentSnapshot.forEach((T,B)=>g.set(B,T))});let S=Tp(e).map(F=>new Map(F));S=Op(t,S,g);let A=Tf(t,S);return new Ss(t,S,h,A)}};var bs="@",Gp="@.disabled",Ms=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(t,e,i,n){this.namespaceId=t,this.delegate=e,this.engine=i,this._onDestroy=n}get data(){return this.delegate.data}destroyNode(t){this.delegate.destroyNode?.(t)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,i,n=!0){this.delegate.insertBefore(t,e,i),this.engine.onInsert(this.namespaceId,e,t,n)}removeChild(t,e,i,n){if(n){this.delegate.removeChild(t,e,i);return}this.parentNode(e)&&this.engine.onRemove(this.namespaceId,e,this.delegate)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,i,n){this.delegate.setAttribute(t,e,i,n)}removeAttribute(t,e,i){this.delegate.removeAttribute(t,e,i)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,i,n){this.delegate.setStyle(t,e,i,n)}removeStyle(t,e,i){this.delegate.removeStyle(t,e,i)}setProperty(t,e,i){e.charAt(0)==bs&&e==Gp?this.disableAnimations(t,!!i):this.delegate.setProperty(t,e,i)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,i,n){return this.delegate.listen(t,e,i,n)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}},Dc=class extends Ms{factory;constructor(t,e,i,n,r){super(e,i,n,r),this.factory=t,this.namespaceId=e}setProperty(t,e,i){e.charAt(0)==bs?e.charAt(1)=="."&&e==Gp?(i=i===void 0?!0:!!i,this.disableAnimations(t,i)):this.engine.process(this.namespaceId,t,e.slice(1),i):this.delegate.setProperty(t,e,i)}listen(t,e,i,n){if(e.charAt(0)==bs){let r=Of(t),a=e.slice(1),c="";return a.charAt(0)!=bs&&([a,c]=Af(a)),this.engine.listen(this.namespaceId,r,a,c,h=>{let g=h._data||-1;this.factory.scheduleListenerCallback(g,i,h)})}return this.delegate.listen(t,e,i,n)}};function Of(o){switch(o){case"body":return document.body;case"document":return document;case"window":return window;default:return o}}function Af(o){let t=o.indexOf("."),e=o.substring(0,t),i=o.slice(t+1);return[e,i]}var Ts=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(t,e,i){this.delegate=t,this.engine=e,this._zone=i,e.onRemovalComplete=(n,r)=>{r?.removeChild(null,n)}}createRenderer(t,e){let n=this.delegate.createRenderer(t,e);if(!t||!e?.data?.animation){let g=this._rendererCache,y=g.get(n);if(!y){let S=()=>g.delete(n);y=new Ms("",n,this.engine,S),g.set(n,y)}return y}let r=e.id,a=e.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);let c=g=>{Array.isArray(g)?g.forEach(c):this.engine.registerTrigger(r,a,t,g.name,g)};return e.data.animation.forEach(c),new Dc(this,a,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,i){if(t>=0&&t<this._microtaskId){this._zone.run(()=>e(i));return}let n=this._animationCallbacksBuffer;n.length==0&&queueMicrotask(()=>{this._zone.run(()=>{n.forEach(r=>{let[a,c]=r;a(c)}),this._animationCallbacksBuffer=[]})}),n.push([e,i])}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(t){this.engine.flush(),this.delegate.componentReplaced?.(t)}};var Df=(()=>{class o extends qo{constructor(e,i,n){super(e,i,n)}ngOnDestroy(){this.flush()}static \u0275fac=function(i){return new(i||o)(Ra(et),Ra(so),Ra(lo))};static \u0275prov=L({token:o,factory:o.\u0275fac})}return o})();function Rf(){return new vs}function Ff(o,t,e){return new Ts(o,t,e)}var Yp=[{provide:lo,useFactory:Rf},{provide:qo,useClass:Df},{provide:hi,useFactory:Ff,deps:[Om,qo,pe]}],nS=[{provide:so,useClass:Rc},{provide:Ir,useValue:"NoopAnimations"},...Yp],Nf=[{provide:so,useFactory:()=>new ks},{provide:Ir,useFactory:()=>"BrowserAnimations"},...Yp];function Qp(){return fm("NgEagerAnimations"),[...Nf]}var qr=class{_attachedHost;attach(t){return this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;t!=null&&(this._attachedHost=null,t.detach())}get isAttached(){return this._attachedHost!=null}setAttachedHost(t){this._attachedHost=t}},vi=class extends qr{component;viewContainerRef;injector;projectableNodes;constructor(t,e,i,n){super(),this.component=t,this.viewContainerRef=e,this.injector=i,this.projectableNodes=n}},sn=class extends qr{templateRef;viewContainerRef;context;injector;constructor(t,e,i,n){super(),this.templateRef=t,this.viewContainerRef=e,this.context=i,this.injector=n}get origin(){return this.templateRef.elementRef}attach(t,e=this.context){return this.context=e,super.attach(t)}detach(){return this.context=void 0,super.detach()}},Nc=class extends qr{element;constructor(t){super(),this.element=t instanceof ne?t.nativeElement:t}},Fn=class{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(t){if(t instanceof vi)return this._attachedPortal=t,this.attachComponentPortal(t);if(t instanceof sn)return this._attachedPortal=t,this.attachTemplatePortal(t);if(this.attachDomPortal&&t instanceof Nc)return this._attachedPortal=t,this.attachDomPortal(t)}attachDomPortal=null;detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}},Es=class extends Fn{outletElement;_appRef;_defaultInjector;constructor(t,e,i){super(),this.outletElement=t,this._appRef=e,this._defaultInjector=i}attachComponentPortal(t){let e;if(t.viewContainerRef){let i=t.injector||t.viewContainerRef.injector,n=i.get(Zl,null,{optional:!0})||void 0;e=t.viewContainerRef.createComponent(t.component,{index:t.viewContainerRef.length,injector:i,ngModuleRef:n,projectableNodes:t.projectableNodes||void 0}),this.setDisposeFn(()=>e.destroy())}else{let i=this._appRef,n=t.injector||this._defaultInjector||ye.NULL,r=n.get(Fa,i.injector);e=Tm(t.component,{elementInjector:n,environmentInjector:r,projectableNodes:t.projectableNodes||void 0}),i.attachView(e.hostView),this.setDisposeFn(()=>{i.viewCount>0&&i.detachView(e.hostView),e.destroy()})}return this.outletElement.appendChild(this._getComponentRootNode(e)),this._attachedPortal=t,e}attachTemplatePortal(t){let e=t.viewContainerRef,i=e.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return i.rootNodes.forEach(n=>this.outletElement.appendChild(n)),i.detectChanges(),this.setDisposeFn(()=>{let n=e.indexOf(i);n!==-1&&e.remove(n)}),this._attachedPortal=t,i}attachDomPortal=t=>{let e=t.element;e.parentNode;let i=this.outletElement.ownerDocument.createComment("dom-portal");e.parentNode.insertBefore(i,e),this.outletElement.appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{i.parentNode&&i.parentNode.replaceChild(e,i)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(t){return t.hostView.rootNodes[0]}};var Nn=(()=>{class o extends Fn{_moduleRef=m(Zl,{optional:!0});_document=m(et);_viewContainerRef=m(Zn);_isInitialized=!1;_attachedRef;constructor(){super()}get portal(){return this._attachedPortal}set portal(e){this.hasAttached()&&!e&&!this._isInitialized||(this.hasAttached()&&super.detach(),e&&super.attach(e),this._attachedPortal=e||null)}attached=new H;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(e){e.setAttachedHost(this);let i=e.viewContainerRef!=null?e.viewContainerRef:this._viewContainerRef,n=i.createComponent(e.component,{index:i.length,injector:e.injector||i.injector,projectableNodes:e.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return i!==this._viewContainerRef&&this._getRootNode().appendChild(n.hostView.rootNodes[0]),super.setDisposeFn(()=>n.destroy()),this._attachedPortal=e,this._attachedRef=n,this.attached.emit(n),n}attachTemplatePortal(e){e.setAttachedHost(this);let i=this._viewContainerRef.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=e,this._attachedRef=i,this.attached.emit(i),i}attachDomPortal=e=>{let i=e.element;i.parentNode;let n=this._document.createComment("dom-portal");e.setAttachedHost(this),i.parentNode.insertBefore(n,i),this._getRootNode().appendChild(i),this._attachedPortal=e,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(i,n)})};_getRootNode(){let e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[Tt]})}return o})();var ln=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({})}return o})();var Lf=20,cn=(()=>{class o{_ngZone=m(pe);_platform=m(tt);_renderer=m(hi).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new R;_scrolledCount=0;scrollContainers=new Map;register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe(()=>this._scrolled.next(e)))}deregister(e){let i=this.scrollContainers.get(e);i&&(i.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=Lf){return this._platform.isBrowser?new Ii(i=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let n=e>0?this._scrolled.pipe(Ql(e)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{n.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):Rt()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(e,i){let n=this.getAncestorScrollContainers(e);return this.scrolled(i).pipe(me(r=>!r||n.indexOf(r)>-1))}getAncestorScrollContainers(e){let i=[];return this.scrollContainers.forEach((n,r)=>{this._scrollableContainsElement(r,e)&&i.push(r)}),i}_scrollableContainsElement(e,i){let n=Lr(i),r=e.getElementRef().nativeElement;do if(n==r)return!0;while(n=n.parentElement);return!1}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),dn=(()=>{class o{elementRef=m(ne);scrollDispatcher=m(cn);ngZone=m(pe);dir=m(bt,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new R;_renderer=m(Ct);_cleanupScroll;_elementScrolled=new R;constructor(){}ngOnInit(){this._cleanupScroll=this.ngZone.runOutsideAngular(()=>this._renderer.listen(this._scrollElement,"scroll",e=>this._elementScrolled.next(e))),this.scrollDispatcher.register(this)}ngOnDestroy(){this._cleanupScroll?.(),this._elementScrolled.complete(),this.scrollDispatcher.deregister(this),this._destroyed.next(),this._destroyed.complete()}elementScrolled(){return this._elementScrolled}getElementRef(){return this.elementRef}scrollTo(e){let i=this.elementRef.nativeElement,n=this.dir&&this.dir.value=="rtl";e.left==null&&(e.left=n?e.end:e.start),e.right==null&&(e.right=n?e.start:e.end),e.bottom!=null&&(e.top=i.scrollHeight-i.clientHeight-e.bottom),n&&Vo()!=Lo.NORMAL?(e.left!=null&&(e.right=i.scrollWidth-i.clientWidth-e.left),Vo()==Lo.INVERTED?e.left=e.right:Vo()==Lo.NEGATED&&(e.left=e.right?-e.right:e.right)):e.right!=null&&(e.left=i.scrollWidth-i.clientWidth-e.right),this._applyScrollToOptions(e)}_applyScrollToOptions(e){let i=this.elementRef.nativeElement;Ya()?i.scrollTo(e):(e.top!=null&&(i.scrollTop=e.top),e.left!=null&&(i.scrollLeft=e.left))}measureScrollOffset(e){let i="left",n="right",r=this.elementRef.nativeElement;if(e=="top")return r.scrollTop;if(e=="bottom")return r.scrollHeight-r.clientHeight-r.scrollTop;let a=this.dir&&this.dir.value=="rtl";return e=="start"?e=a?n:i:e=="end"&&(e=a?i:n),a&&Vo()==Lo.INVERTED?e==i?r.scrollWidth-r.clientWidth-r.scrollLeft:r.scrollLeft:a&&Vo()==Lo.NEGATED?e==i?r.scrollLeft+r.scrollWidth-r.clientWidth:-r.scrollLeft:e==i?r.scrollLeft:r.scrollWidth-r.clientWidth-r.scrollLeft}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return o})(),Vf=20,ji=(()=>{class o{_platform=m(tt);_listeners;_viewportSize;_change=new R;_document=m(et);constructor(){let e=m(pe),i=m(hi).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let n=r=>this._change.next(r);this._listeners=[i.listen("window","resize",n),i.listen("window","orientationchange",n)]}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){this._listeners?.forEach(e=>e()),this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){let e=this.getViewportScrollPosition(),{width:i,height:n}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+n,right:e.left+i,height:n,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,i=this._getWindow(),n=e.documentElement,r=n.getBoundingClientRect(),a=-r.top||e.body.scrollTop||i.scrollY||n.scrollTop||0,c=-r.left||e.body.scrollLeft||i.scrollX||n.scrollLeft||0;return{top:a,left:c}}change(e=Vf){return e>0?this._change.pipe(Ql(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var zi=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({})}return o})(),Lc=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({imports:[Vr,zi,Vr,zi]})}return o})();var Xp=Ya();function Qo(o){return new Ps(o.get(ji),o.get(et))}var Ps=class{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(t,e){this._viewportRuler=t,this._document=e}attach(){}enable(){if(this._canBeEnabled()){let t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=lt(-this._previousScrollPosition.left),t.style.top=lt(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let t=this._document.documentElement,e=this._document.body,i=t.style,n=e.style,r=i.scrollBehavior||"",a=n.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),Xp&&(i.scrollBehavior=n.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Xp&&(i.scrollBehavior=r,n.scrollBehavior=a)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let e=this._document.documentElement,i=this._viewportRuler.getViewportSize();return e.scrollHeight>i.height||e.scrollWidth>i.width}};function nh(o,t){return new Os(o.get(cn),o.get(pe),o.get(ji),t)}var Os=class{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(t,e,i,n){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=i,this._config=n}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(this._scrollSubscription)return;let t=this._scrollDispatcher.scrolled(0).pipe(me(e=>!e||!this._overlayRef.overlayElement.contains(e.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(()=>{let e=this._viewportRuler.getViewportScrollPosition().top;Math.abs(e-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}_detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}};var Gr=class{enable(){}disable(){}attach(){}};function Vc(o,t){return t.some(e=>{let i=o.bottom<e.top,n=o.top>e.bottom,r=o.right<e.left,a=o.left>e.right;return i||n||r||a})}function Kp(o,t){return t.some(e=>{let i=o.top<e.top,n=o.bottom>e.bottom,r=o.left<e.left,a=o.right>e.right;return i||n||r||a})}function Bi(o,t){return new As(o.get(cn),o.get(ji),o.get(pe),t)}var As=class{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(t,e,i,n){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=i,this._config=n}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(!this._scrollSubscription){let t=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(t).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let e=this._overlayRef.overlayElement.getBoundingClientRect(),{width:i,height:n}=this._viewportRuler.getViewportSize();Vc(e,[{width:i,height:n,bottom:n,right:i,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}})}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},oh=(()=>{class o{_injector=m(ye);constructor(){}noop=()=>new Gr;close=e=>nh(this._injector,e);block=()=>Qo(this._injector);reposition=e=>Bi(this._injector,e);static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),mn=class{positionStrategy;scrollStrategy=new Gr;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";disableAnimations;width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;constructor(t){if(t){let e=Object.keys(t);for(let i of e)t[i]!==void 0&&(this[i]=t[i])}}};var Is=class{connectionPair;scrollableViewProperties;constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}};var rh=(()=>{class o{_attachedOverlays=[];_document=m(et);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(e){this.remove(e),this._attachedOverlays.push(e)}remove(e){let i=this._attachedOverlays.indexOf(e);i>-1&&this._attachedOverlays.splice(i,1),this._attachedOverlays.length===0&&this.detach()}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),ah=(()=>{class o extends rh{_ngZone=m(pe);_renderer=m(hi).createRenderer(null,null);_cleanupKeydown;add(e){super.add(e),this._isAttached||(this._ngZone.runOutsideAngular(()=>{this._cleanupKeydown=this._renderer.listen("body","keydown",this._keydownListener)}),this._isAttached=!0)}detach(){this._isAttached&&(this._cleanupKeydown?.(),this._isAttached=!1)}_keydownListener=e=>{let i=this._attachedOverlays;for(let n=i.length-1;n>-1;n--)if(i[n]._keydownEvents.observers.length>0){this._ngZone.run(()=>i[n]._keydownEvents.next(e));break}};static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),sh=(()=>{class o extends rh{_platform=m(tt);_ngZone=m(pe);_renderer=m(hi).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(e){if(super.add(e),!this._isAttached){let i=this._document.body,n={capture:!0},r=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[r.listen(i,"pointerdown",this._pointerDownListener,n),r.listen(i,"click",this._clickListener,n),r.listen(i,"auxclick",this._clickListener,n),r.listen(i,"contextmenu",this._clickListener,n)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){this._isAttached&&(this._cleanups?.forEach(e=>e()),this._cleanups=void 0,this._platform.IOS&&this._cursorStyleIsSet&&(this._document.body.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1)}_pointerDownListener=e=>{this._pointerDownEventTarget=Ua(e)};_clickListener=e=>{let i=Ua(e),n=e.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:i;this._pointerDownEventTarget=null;let r=this._attachedOverlays.slice();for(let a=r.length-1;a>-1;a--){let c=r[a];if(c._outsidePointerEvents.observers.length<1||!c.hasAttached())continue;if(Zp(c.overlayElement,i)||Zp(c.overlayElement,n))break;let h=c._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>h.next(e)):h.next(e)}};static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function Zp(o,t){let e=typeof ShadowRoot<"u"&&ShadowRoot,i=t;for(;i;){if(i===o)return!0;i=e&&i instanceof ShadowRoot?i.host:i.parentNode}return!1}var lh=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(i,n){},styles:[`.cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}
2
+ `],encapsulation:2,changeDetection:0})}return o})(),Fs=(()=>{class o{_platform=m(tt);_containerElement;_document=m(et);_styleLoader=m(Nt);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e="cdk-overlay-container";if(this._platform.isBrowser||oc()){let n=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let r=0;r<n.length;r++)n[r].remove()}let i=this._document.createElement("div");i.classList.add(e),oc()?i.setAttribute("platform","test"):this._platform.isBrowser||i.setAttribute("platform","server"),this._document.body.appendChild(i),this._containerElement=i}_loadStyles(){this._styleLoader.load(lh)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),zc=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(t,e,i,n){this._renderer=e,this._ngZone=i,this.element=t.createElement("div"),this.element.classList.add("cdk-overlay-backdrop"),this._cleanupClick=e.listen(this.element,"click",n)}detach(){this._ngZone.runOutsideAngular(()=>{let t=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(t,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),t.style.pointerEvents="none",t.classList.remove("cdk-overlay-backdrop-showing")})}dispose=()=>{clearTimeout(this._fallbackTimeout),this._cleanupClick?.(),this._cleanupTransitionEnd?.(),this._cleanupClick=this._cleanupTransitionEnd=this._fallbackTimeout=void 0,this.element.remove()}},Go=class{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new R;_attachments=new R;_detachments=new R;_positionStrategy;_scrollStrategy;_locationChanges=Ai.EMPTY;_backdropRef=null;_detachContentMutationObserver;_detachContentAfterRenderRef;_previousHostParent;_keydownEvents=new R;_outsidePointerEvents=new R;_afterNextRenderRef;constructor(t,e,i,n,r,a,c,h,g,y=!1,S,A){this._portalOutlet=t,this._host=e,this._pane=i,this._config=n,this._ngZone=r,this._keyboardDispatcher=a,this._document=c,this._location=h,this._outsideClickDispatcher=g,this._animationsDisabled=y,this._injector=S,this._renderer=A,n.scrollStrategy&&(this._scrollStrategy=n.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=n.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}attach(t){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let e=this._portalOutlet.attach(t);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=Ft(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._completeDetachContent(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof e?.onDestroy=="function"&&e.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let t=this._portalOutlet.detach();return this._detachments.next(),this._completeDetachContent(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){let t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._backdropRef?.dispose(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=this._backdropRef=null,t&&this._detachments.next(),this._detachments.complete(),this._completeDetachContent()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config=Z(Z({},this._config),t),this._updateElementSize()}setDirection(t){this._config=ut(Z({},this._config),{direction:t}),this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){let t=this._config.direction;return t?typeof t=="string"?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let t=this._pane.style;t.width=lt(this._config.width),t.height=lt(this._config.height),t.minWidth=lt(this._config.minWidth),t.minHeight=lt(this._config.minHeight),t.maxWidth=lt(this._config.maxWidth),t.maxHeight=lt(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){let t="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new zc(this._document,this._renderer,this._ngZone,e=>{this._backdropClick.next(e)}),this._animationsDisabled&&this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropRef.element,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropRef.element,this._host),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this._backdropRef?.element.classList.add(t))}):this._backdropRef.element.classList.add(t)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(t,e,i){let n=ic(e||[]).filter(r=>!!r);n.length&&(i?t.classList.add(...n):t.classList.remove(...n))}_detachContentWhenEmpty(){let t=!1;try{this._detachContentAfterRenderRef=Ft(()=>{t=!0,this._detachContent()},{injector:this._injector})}catch(e){if(t)throw e;this._detachContent()}globalThis.MutationObserver&&this._pane&&(this._detachContentMutationObserver||=new globalThis.MutationObserver(()=>{this._detachContent()}),this._detachContentMutationObserver.observe(this._pane,{childList:!0}))}_detachContent(){(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),this._completeDetachContent())}_completeDetachContent(){this._detachContentAfterRenderRef?.destroy(),this._detachContentAfterRenderRef=void 0,this._detachContentMutationObserver?.disconnect()}_disposeScrollStrategy(){let t=this._scrollStrategy;t?.disable(),t?.detach?.()}},Jp="cdk-overlay-connected-position-bounding-box",jf=/([A-Za-z%]+)$/;function Yr(o,t){return new Ds(t,o.get(ji),o.get(et),o.get(tt),o.get(Fs))}var Ds=class{_viewportRuler;_document;_platform;_overlayContainer;_overlayRef;_isInitialRender;_lastBoundingBoxSize={width:0,height:0};_isPushed=!1;_canPush=!0;_growAfterOpen=!1;_hasFlexibleDimensions=!0;_positionLocked=!1;_originRect;_overlayRect;_viewportRect;_containerRect;_viewportMargin=0;_scrollables=[];_preferredPositions=[];_origin;_pane;_isDisposed;_boundingBox;_lastPosition;_lastScrollVisibility;_positionChanges=new R;_resizeSubscription=Ai.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount;positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(t,e,i,n,r){this._viewportRuler=e,this._document=i,this._platform=n,this._overlayContainer=r,this.setOrigin(t)}attach(t){this._overlayRef&&this._overlayRef,this._validatePositions(),t.hostElement.classList.add(Jp),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition){this.reapplyLastPosition();return}this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let t=this._originRect,e=this._overlayRect,i=this._viewportRect,n=this._containerRect,r=[],a;for(let c of this._preferredPositions){let h=this._getOriginPoint(t,n,c),g=this._getOverlayPoint(h,e,c),y=this._getOverlayFit(g,e,i,c);if(y.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(c,h);return}if(this._canFitWithFlexibleDimensions(y,g,i)){r.push({position:c,origin:h,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(h,c)});continue}(!a||a.overlayFit.visibleArea<y.visibleArea)&&(a={overlayFit:y,overlayPoint:g,originPoint:h,position:c,overlayRect:e})}if(r.length){let c=null,h=-1;for(let g of r){let y=g.boundingBoxRect.width*g.boundingBoxRect.height*(g.position.weight||1);y>h&&(h=y,c=g)}this._isPushed=!1,this._applyPosition(c.position,c.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(a.position,a.originPoint);return}this._applyPosition(a.position,a.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&co(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Jp),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let t=this._lastPosition;if(t){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let e=this._getOriginPoint(this._originRect,this._containerRect,t);this._applyPosition(t,e)}else this.apply()}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,t.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}_getOriginPoint(t,e,i){let n;if(i.originX=="center")n=t.left+t.width/2;else{let a=this._isRtl()?t.right:t.left,c=this._isRtl()?t.left:t.right;n=i.originX=="start"?a:c}e.left<0&&(n-=e.left);let r;return i.originY=="center"?r=t.top+t.height/2:r=i.originY=="top"?t.top:t.bottom,e.top<0&&(r-=e.top),{x:n,y:r}}_getOverlayPoint(t,e,i){let n;i.overlayX=="center"?n=-e.width/2:i.overlayX==="start"?n=this._isRtl()?-e.width:0:n=this._isRtl()?0:-e.width;let r;return i.overlayY=="center"?r=-e.height/2:r=i.overlayY=="top"?0:-e.height,{x:t.x+n,y:t.y+r}}_getOverlayFit(t,e,i,n){let r=th(e),{x:a,y:c}=t,h=this._getOffset(n,"x"),g=this._getOffset(n,"y");h&&(a+=h),g&&(c+=g);let y=0-a,S=a+r.width-i.width,A=0-c,F=c+r.height-i.height,T=this._subtractOverflows(r.width,y,S),B=this._subtractOverflows(r.height,A,F),_e=T*B;return{visibleArea:_e,isCompletelyWithinViewport:r.width*r.height===_e,fitsInViewportVertically:B===r.height,fitsInViewportHorizontally:T==r.width}}_canFitWithFlexibleDimensions(t,e,i){if(this._hasFlexibleDimensions){let n=i.bottom-e.y,r=i.right-e.x,a=eh(this._overlayRef.getConfig().minHeight),c=eh(this._overlayRef.getConfig().minWidth),h=t.fitsInViewportVertically||a!=null&&a<=n,g=t.fitsInViewportHorizontally||c!=null&&c<=r;return h&&g}return!1}_pushOverlayOnScreen(t,e,i){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};let n=th(e),r=this._viewportRect,a=Math.max(t.x+n.width-r.width,0),c=Math.max(t.y+n.height-r.height,0),h=Math.max(r.top-i.top-t.y,0),g=Math.max(r.left-i.left-t.x,0),y=0,S=0;return n.width<=r.width?y=g||-a:y=t.x<this._viewportMargin?r.left-i.left-t.x:0,n.height<=r.height?S=h||-c:S=t.y<this._viewportMargin?r.top-i.top-t.y:0,this._previousPushAmount={x:y,y:S},{x:t.x+y,y:t.y+S}}_applyPosition(t,e){if(this._setTransformOrigin(t),this._setOverlayElementStyles(e,t),this._setBoundingBoxStyles(e,t),t.panelClass&&this._addPanelClasses(t.panelClass),this._positionChanges.observers.length){let i=this._getScrollVisibility();if(t!==this._lastPosition||!this._lastScrollVisibility||!Bf(this._lastScrollVisibility,i)){let n=new Is(t,i);this._positionChanges.next(n)}this._lastScrollVisibility=i}this._lastPosition=t,this._isInitialRender=!1}_setTransformOrigin(t){if(!this._transformOriginSelector)return;let e=this._boundingBox.querySelectorAll(this._transformOriginSelector),i,n=t.overlayY;t.overlayX==="center"?i="center":this._isRtl()?i=t.overlayX==="start"?"right":"left":i=t.overlayX==="start"?"left":"right";for(let r=0;r<e.length;r++)e[r].style.transformOrigin=`${i} ${n}`}_calculateBoundingBoxRect(t,e){let i=this._viewportRect,n=this._isRtl(),r,a,c;if(e.overlayY==="top")a=t.y,r=i.height-a+this._viewportMargin;else if(e.overlayY==="bottom")c=i.height-t.y+this._viewportMargin*2,r=i.height-c+this._viewportMargin;else{let F=Math.min(i.bottom-t.y+i.top,t.y),T=this._lastBoundingBoxSize.height;r=F*2,a=t.y-F,r>T&&!this._isInitialRender&&!this._growAfterOpen&&(a=t.y-T/2)}let h=e.overlayX==="start"&&!n||e.overlayX==="end"&&n,g=e.overlayX==="end"&&!n||e.overlayX==="start"&&n,y,S,A;if(g)A=i.width-t.x+this._viewportMargin*2,y=t.x-this._viewportMargin;else if(h)S=t.x,y=i.right-t.x;else{let F=Math.min(i.right-t.x+i.left,t.x),T=this._lastBoundingBoxSize.width;y=F*2,S=t.x-F,y>T&&!this._isInitialRender&&!this._growAfterOpen&&(S=t.x-T/2)}return{top:a,left:S,bottom:c,right:A,width:y,height:r}}_setBoundingBoxStyles(t,e){let i=this._calculateBoundingBoxRect(t,e);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));let n={};if(this._hasExactPosition())n.top=n.left="0",n.bottom=n.right=n.maxHeight=n.maxWidth="",n.width=n.height="100%";else{let r=this._overlayRef.getConfig().maxHeight,a=this._overlayRef.getConfig().maxWidth;n.height=lt(i.height),n.top=lt(i.top),n.bottom=lt(i.bottom),n.width=lt(i.width),n.left=lt(i.left),n.right=lt(i.right),e.overlayX==="center"?n.alignItems="center":n.alignItems=e.overlayX==="end"?"flex-end":"flex-start",e.overlayY==="center"?n.justifyContent="center":n.justifyContent=e.overlayY==="bottom"?"flex-end":"flex-start",r&&(n.maxHeight=lt(r)),a&&(n.maxWidth=lt(a))}this._lastBoundingBoxSize=i,co(this._boundingBox.style,n)}_resetBoundingBoxStyles(){co(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){co(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){let i={},n=this._hasExactPosition(),r=this._hasFlexibleDimensions,a=this._overlayRef.getConfig();if(n){let y=this._viewportRuler.getViewportScrollPosition();co(i,this._getExactOverlayY(e,t,y)),co(i,this._getExactOverlayX(e,t,y))}else i.position="static";let c="",h=this._getOffset(e,"x"),g=this._getOffset(e,"y");h&&(c+=`translateX(${h}px) `),g&&(c+=`translateY(${g}px)`),i.transform=c.trim(),a.maxHeight&&(n?i.maxHeight=lt(a.maxHeight):r&&(i.maxHeight="")),a.maxWidth&&(n?i.maxWidth=lt(a.maxWidth):r&&(i.maxWidth="")),co(this._pane.style,i)}_getExactOverlayY(t,e,i){let n={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,t);if(this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i)),t.overlayY==="bottom"){let a=this._document.documentElement.clientHeight;n.bottom=`${a-(r.y+this._overlayRect.height)}px`}else n.top=lt(r.y);return n}_getExactOverlayX(t,e,i){let n={left:"",right:""},r=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i));let a;if(this._isRtl()?a=t.overlayX==="end"?"left":"right":a=t.overlayX==="end"?"right":"left",a==="right"){let c=this._document.documentElement.clientWidth;n.right=`${c-(r.x+this._overlayRect.width)}px`}else n.left=lt(r.x);return n}_getScrollVisibility(){let t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),i=this._scrollables.map(n=>n.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Kp(t,i),isOriginOutsideView:Vc(t,i),isOverlayClipped:Kp(e,i),isOverlayOutsideView:Vc(e,i)}}_subtractOverflows(t,...e){return e.reduce((i,n)=>i-Math.max(n,0),t)}_getNarrowedViewportRect(){let t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+t-this._viewportMargin,bottom:i.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,e){return e==="x"?t.offsetX==null?this._offsetX:t.offsetX:t.offsetY==null?this._offsetY:t.offsetY}_validatePositions(){}_addPanelClasses(t){this._pane&&ic(t).forEach(e=>{e!==""&&this._appliedPanelClasses.indexOf(e)===-1&&(this._appliedPanelClasses.push(e),this._pane.classList.add(e))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(t=>{this._pane.classList.remove(t)}),this._appliedPanelClasses=[])}_getOriginRect(){let t=this._origin;if(t instanceof ne)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();let e=t.width||0,i=t.height||0;return{top:t.y,bottom:t.y+i,left:t.x,right:t.x+e,height:i,width:e}}};function co(o,t){for(let e in t)t.hasOwnProperty(e)&&(o[e]=t[e]);return o}function eh(o){if(typeof o!="number"&&o!=null){let[t,e]=o.split(jf);return!e||e==="px"?parseFloat(t):null}return o||null}function th(o){return{top:Math.floor(o.top),right:Math.floor(o.right),bottom:Math.floor(o.bottom),left:Math.floor(o.left),width:Math.floor(o.width),height:Math.floor(o.height)}}function Bf(o,t){return o===t?!0:o.isOriginClipped===t.isOriginClipped&&o.isOriginOutsideView===t.isOriginOutsideView&&o.isOverlayClipped===t.isOverlayClipped&&o.isOverlayOutsideView===t.isOverlayOutsideView}var ih="cdk-global-overlay-wrapper";function Ln(o){return new Rs}var Rs=class{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(t){let e=t.getConfig();this._overlayRef=t,this._width&&!e.width&&t.updateSize({width:this._width}),this._height&&!e.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(ih),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._xOffset=t,this._xPosition="left",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._xOffset=t,this._xPosition="right",this}start(t=""){return this._xOffset=t,this._xPosition="start",this}end(t=""){return this._xOffset=t,this._xPosition="end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._xPosition="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:n,height:r,maxWidth:a,maxHeight:c}=i,h=(n==="100%"||n==="100vw")&&(!a||a==="100%"||a==="100vw"),g=(r==="100%"||r==="100vh")&&(!c||c==="100%"||c==="100vh"),y=this._xPosition,S=this._xOffset,A=this._overlayRef.getConfig().direction==="rtl",F="",T="",B="";h?B="flex-start":y==="center"?(B="center",A?T=S:F=S):A?y==="left"||y==="end"?(B="flex-end",F=S):(y==="right"||y==="start")&&(B="flex-start",T=S):y==="left"||y==="start"?(B="flex-start",F=S):(y==="right"||y==="end")&&(B="flex-end",T=S),t.position=this._cssPosition,t.marginLeft=h?"0":F,t.marginTop=g?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=h?"0":T,e.justifyContent=B,e.alignItems=g?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,i=e.style;e.classList.remove(ih),i.justifyContent=i.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}},ch=(()=>{class o{_injector=m(ye);constructor(){}global(){return Ln()}flexibleConnectedTo(e){return Yr(this._injector,e)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function hn(o,t){o.get(Nt).load(lh);let e=o.get(Fs),i=o.get(et),n=o.get(Ne),r=o.get(ec),a=o.get(bt),c=i.createElement("div"),h=i.createElement("div");h.id=n.getId("cdk-overlay-"),h.classList.add("cdk-overlay-pane"),c.appendChild(h),e.getContainerElement().appendChild(c);let g=new Es(h,r,o),y=new mn(t),S=o.get(Ct,null,{optional:!0})||o.get(hi).createRenderer(null,null);return y.direction=y.direction||a.value,new Go(g,c,h,y,o.get(pe),o.get(ah),i,o.get(Em),o.get(sh),t?.disableAnimations??o.get(Ir,null,{optional:!0})==="NoopAnimations",o.get(Fa),S)}var dh=(()=>{class o{scrollStrategies=m(oh);_positionBuilder=m(ch);_injector=m(ye);constructor(){}create(e){return hn(this._injector,e)}position(){return this._positionBuilder}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),Hf=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],mh=new oe("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(ye);return()=>Bi(o)}}),Yo=(()=>{class o{elementRef=m(ne);constructor(){}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]})}return o})(),Ns=(()=>{class o{_dir=m(bt,{optional:!0});_injector=m(ye);_overlayRef;_templatePortal;_backdropSubscription=Ai.EMPTY;_attachSubscription=Ai.EMPTY;_detachSubscription=Ai.EMPTY;_positionSubscription=Ai.EMPTY;_offsetX;_offsetY;_position;_scrollStrategyFactory=m(mh);_disposeOnNavigation=!1;_ngZone=m(pe);origin;positions;positionStrategy;get offsetX(){return this._offsetX}set offsetX(e){this._offsetX=e,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(e){this._offsetY=e,this._position&&this._updatePositionStrategy(this._position)}width;height;minWidth;minHeight;backdropClass;panelClass;viewportMargin=0;scrollStrategy;open=!1;disableClose=!1;transformOriginSelector;hasBackdrop=!1;lockPosition=!1;flexibleDimensions=!1;growAfterOpen=!1;push=!1;get disposeOnNavigation(){return this._disposeOnNavigation}set disposeOnNavigation(e){this._disposeOnNavigation=e}backdropClick=new H;positionChange=new H;attach=new H;detach=new H;overlayKeydown=new H;overlayOutsideClick=new H;constructor(){let e=m(Mn),i=m(Zn);this._templatePortal=new sn(e,i),this.scrollStrategy=this._scrollStrategyFactory()}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef?.dispose()}ngOnChanges(e){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef?.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),e.origin&&this.open&&this._position.apply()),e.open&&(this.open?this.attachOverlay():this.detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=Hf);let e=this._overlayRef=hn(this._injector,this._buildConfig());this._attachSubscription=e.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=e.detachments().subscribe(()=>this.detach.emit()),e.keydownEvents().subscribe(i=>{this.overlayKeydown.next(i),i.keyCode===27&&!this.disableClose&&!_t(i)&&(i.preventDefault(),this.detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(i=>{let n=this._getOriginElement(),r=Ua(i);(!n||n!==r&&!n.contains(r))&&this.overlayOutsideClick.next(i)})}_buildConfig(){let e=this._position=this.positionStrategy||this._createPositionStrategy(),i=new mn({direction:this._dir||"ltr",positionStrategy:e,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop,disposeOnNavigation:this.disposeOnNavigation});return(this.width||this.width===0)&&(i.width=this.width),(this.height||this.height===0)&&(i.height=this.height),(this.minWidth||this.minWidth===0)&&(i.minWidth=this.minWidth),(this.minHeight||this.minHeight===0)&&(i.minHeight=this.minHeight),this.backdropClass&&(i.backdropClass=this.backdropClass),this.panelClass&&(i.panelClass=this.panelClass),i}_updatePositionStrategy(e){let i=this.positions.map(n=>({originX:n.originX,originY:n.originY,overlayX:n.overlayX,overlayY:n.overlayY,offsetX:n.offsetX||this.offsetX,offsetY:n.offsetY||this.offsetY,panelClass:n.panelClass||void 0}));return e.setOrigin(this._getOrigin()).withPositions(i).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){let e=Yr(this._injector,this._getOrigin());return this._updatePositionStrategy(e),e}_getOrigin(){return this.origin instanceof Yo?this.origin.elementRef:this.origin}_getOriginElement(){return this.origin instanceof Yo?this.origin.elementRef.nativeElement:this.origin instanceof ne?this.origin.nativeElement:typeof Element<"u"&&this.origin instanceof Element?this.origin:null}attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(e=>{this.backdropClick.emit(e)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(mm(()=>this.positionChange.observers.length>0)).subscribe(e=>{this._ngZone.run(()=>this.positionChange.emit(e)),this.positionChange.observers.length===0&&this._positionSubscription.unsubscribe()})),this.open=!0}detachOverlay(){this._overlayRef?.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.open=!1}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{origin:[0,"cdkConnectedOverlayOrigin","origin"],positions:[0,"cdkConnectedOverlayPositions","positions"],positionStrategy:[0,"cdkConnectedOverlayPositionStrategy","positionStrategy"],offsetX:[0,"cdkConnectedOverlayOffsetX","offsetX"],offsetY:[0,"cdkConnectedOverlayOffsetY","offsetY"],width:[0,"cdkConnectedOverlayWidth","width"],height:[0,"cdkConnectedOverlayHeight","height"],minWidth:[0,"cdkConnectedOverlayMinWidth","minWidth"],minHeight:[0,"cdkConnectedOverlayMinHeight","minHeight"],backdropClass:[0,"cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:[0,"cdkConnectedOverlayPanelClass","panelClass"],viewportMargin:[0,"cdkConnectedOverlayViewportMargin","viewportMargin"],scrollStrategy:[0,"cdkConnectedOverlayScrollStrategy","scrollStrategy"],open:[0,"cdkConnectedOverlayOpen","open"],disableClose:[0,"cdkConnectedOverlayDisableClose","disableClose"],transformOriginSelector:[0,"cdkConnectedOverlayTransformOriginOn","transformOriginSelector"],hasBackdrop:[2,"cdkConnectedOverlayHasBackdrop","hasBackdrop",ee],lockPosition:[2,"cdkConnectedOverlayLockPosition","lockPosition",ee],flexibleDimensions:[2,"cdkConnectedOverlayFlexibleDimensions","flexibleDimensions",ee],growAfterOpen:[2,"cdkConnectedOverlayGrowAfterOpen","growAfterOpen",ee],push:[2,"cdkConnectedOverlayPush","push",ee],disposeOnNavigation:[2,"cdkConnectedOverlayDisposeOnNavigation","disposeOnNavigation",ee]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[nt]})}return o})();function Uf(o){let t=m(ye);return()=>Bi(t)}var Wf={provide:mh,useFactory:Uf},yi=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({providers:[dh,Wf],imports:[Vr,ln,Lc,Lc]})}return o})();function $f(o,t){if(o&1){let e=k();s(0,"div",1)(1,"button",2),f("click",function(){b(e);let n=u();return v(n.action())}),p(2),l()()}if(o&2){let e=u();d(2),ie(" ",e.data.action," ")}}var qf=["label"];function Gf(o,t){}var Yf=Math.pow(2,31)-1,Qr=class{_overlayRef;instance;containerInstance;_afterDismissed=new R;_afterOpened=new R;_onAction=new R;_durationTimeoutId;_dismissedByAction=!1;constructor(t,e){this._overlayRef=e,this.containerInstance=t,t._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(t){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(t,Yf))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},ph=new oe("MatSnackBarData"),Xo=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},Qf=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return o})(),Xf=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return o})(),Kf=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return o})(),hh=(()=>{class o{snackBarRef=m(Qr);data=m(ph);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["matButton","","matSnackBarAction","",3,"click"]],template:function(i,n){i&1&&(s(0,"div",0),p(1),l(),C(2,$f,3,1,"div",1)),i&2&&(d(),ie(" ",n.data.message,`
3
3
  `),d(),x(n.hasAction?2:-1))},dependencies:[Ot,Qf,Xf,Kf],styles:[`.mat-mdc-simple-snack-bar{display:flex}.mat-mdc-simple-snack-bar .mat-mdc-snack-bar-label{max-height:50vh;overflow:auto}
4
4
  `],encapsulation:2,changeDetection:0})}return o})(),jc="_mat-snack-bar-enter",Bc="_mat-snack-bar-exit",Zf=(()=>{class o extends Fn{_ngZone=m(pe);_elementRef=m(ne);_changeDetectorRef=m(Qe);_platform=m(tt);_animationsDisabled=$e();snackBarConfig=m(Xo);_document=m(et);_trackedModals=new Set;_enterFallback;_exitFallback;_injector=m(ye);_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new R;_onExit=new R;_onEnter=new R;_animationState="void";_live;_label;_role;_liveElementId=m(Ne).getId("mat-snack-bar-container-live-");constructor(){super();let e=this.snackBarConfig;e.politeness==="assertive"&&!e.announcementMessage?this._live="assertive":e.politeness==="off"?this._live="off":this._live="polite",this._platform.FIREFOX&&(this._live==="polite"&&(this._role="status"),this._live==="assertive"&&(this._role="alert"))}attachComponentPortal(e){this._assertNotAttached();let i=this._portalOutlet.attachComponentPortal(e);return this._afterPortalAttached(),i}attachTemplatePortal(e){this._assertNotAttached();let i=this._portalOutlet.attachTemplatePortal(e);return this._afterPortalAttached(),i}attachDomPortal=e=>{this._assertNotAttached();let i=this._portalOutlet.attachDomPortal(e);return this._afterPortalAttached(),i};onAnimationEnd(e){e===Bc?this._completeExit():e===jc&&(clearTimeout(this._enterFallback),this._ngZone.run(()=>{this._onEnter.next(),this._onEnter.complete()}))}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce(),this._animationsDisabled?Ft(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(jc)))},{injector:this._injector}):(clearTimeout(this._enterFallback),this._enterFallback=setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-snack-bar-fallback-visible"),this.onAnimationEnd(jc)},200)))}exit(){return this._destroyed?Rt(void 0):(this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._animationsDisabled?Ft(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(Bc)))},{injector:this._injector}):(clearTimeout(this._exitFallback),this._exitFallback=setTimeout(()=>this.onAnimationEnd(Bc),200))}),this._onExit)}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit()}_completeExit(){clearTimeout(this._exitFallback),queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){let e=this._elementRef.nativeElement,i=this.snackBarConfig.panelClass;i&&(Array.isArray(i)?i.forEach(a=>e.classList.add(a)):e.classList.add(i)),this._exposeToModals();let n=this._label.nativeElement,r="mdc-snackbar__label";n.classList.toggle(r,!n.querySelector(`.${r}`))}_exposeToModals(){let e=this._liveElementId,i=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let n=0;n<i.length;n++){let r=i[n],a=r.getAttribute("aria-owns");this._trackedModals.add(r),a?a.indexOf(e)===-1&&r.setAttribute("aria-owns",a+" "+e):r.setAttribute("aria-owns",e)}}_clearFromModals(){this._trackedModals.forEach(e=>{let i=e.getAttribute("aria-owns");if(i){let n=i.replace(this._liveElementId,"").trim();n.length>0?e.setAttribute("aria-owns",n):e.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{if(this._destroyed)return;let e=this._elementRef.nativeElement,i=e.querySelector("[aria-hidden]"),n=e.querySelector("[aria-live]");if(i&&n){let r=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&i.contains(document.activeElement)&&(r=document.activeElement),i.removeAttribute("aria-hidden"),n.appendChild(i),r?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-snack-bar-container"]],viewQuery:function(i,n){if(i&1&&(X(Nn,7),X(qf,7)),i&2){let r;U(r=W())&&(n._portalOutlet=r.first),U(r=W())&&(n._label=r.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:6,hostBindings:function(i,n){i&1&&f("animationend",function(a){return n.onAnimationEnd(a.animationName)})("animationcancel",function(a){return n.onAnimationEnd(a.animationName)}),i&2&&E("mat-snack-bar-container-enter",n._animationState==="visible")("mat-snack-bar-container-exit",n._animationState==="hidden")("mat-snack-bar-container-animations-enabled",!n._animationsDisabled)},features:[Tt],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(i,n){i&1&&(s(0,"div",1)(1,"div",2,0)(3,"div",3),Re(4,Gf,0,0,"ng-template",4),l(),I(5,"div"),l()()),i&2&&(d(5),J("aria-live",n._live)("role",n._role)("id",n._liveElementId))},dependencies:[Nn],styles:[`@keyframes _mat-snack-bar-enter{from{transform:scale(0.8);opacity:0}to{transform:scale(1);opacity:1}}@keyframes _mat-snack-bar-exit{from{opacity:1}to{opacity:0}}.mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-snack-bar-container-animations-enabled{opacity:0}.mat-snack-bar-container-animations-enabled.mat-snack-bar-fallback-visible{opacity:1}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-enter{animation:_mat-snack-bar-enter 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-exit{animation:_mat-snack-bar-exit 75ms cubic-bezier(0.4, 0, 1, 1) forwards}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mat-snack-bar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-snack-bar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-snack-bar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mat-snack-bar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mat-snack-bar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mat-snack-bar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mat-snack-bar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-button-text-state-layer-color: currentColor;--mat-button-text-ripple-color: currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled).mat-unthemed{color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}
5
- `],encapsulation:2})}return o})();function Jf(){return new Xo}var e_=new oe("mat-snack-bar-default-options",{providedIn:"root",factory:Jf}),Xr=(()=>{class o{_live=m(qa);_injector=m(ye);_breakpointObserver=m(Lm);_parentSnackBar=m(o,{optional:!0,skipSelf:!0});_defaultConfig=m(e_);_animationsDisabled=$e();_snackBarRefAtThisLevel=null;simpleSnackBarComponent=hh;snackBarContainerComponent=Zf;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){let e=this._parentSnackBar;return e?e._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(e){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=e:this._snackBarRefAtThisLevel=e}constructor(){}openFromComponent(e,i){return this._attach(e,i)}openFromTemplate(e,i){return this._attach(e,i)}open(e,i="",n){let r=Z(Z({},this._defaultConfig),n);return r.data={message:e,action:i},r.announcementMessage===e&&(r.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,r)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(e,i){let n=i&&i.viewContainerRef&&i.viewContainerRef.injector,r=ye.create({parent:n||this._injector,providers:[{provide:Xo,useValue:i}]}),a=new vi(this.snackBarContainerComponent,i.viewContainerRef,r),c=e.attach(a);return c.instance.snackBarConfig=i,c.instance}_attach(e,i){let n=Z(Z(Z({},new Xo),this._defaultConfig),i),r=this._createOverlay(n),a=this._attachSnackBarContainer(r,n),c=new Qr(a,r);if(e instanceof Mn){let h=new sn(e,null,{$implicit:n.data,snackBarRef:c});c.instance=a.attachTemplatePortal(h)}else{let h=this._createInjector(n,c),g=new vi(e,void 0,h),y=a.attachComponentPortal(g);c.instance=y.instance}return this._breakpointObserver.observe(Bm.HandsetPortrait).pipe(N(r.detachments())).subscribe(h=>{r.overlayElement.classList.toggle(this.handsetCssClass,h.matches)}),n.announcementMessage&&a._onAnnounce.subscribe(()=>{this._live.announce(n.announcementMessage,n.politeness)}),this._animateSnackBar(c,n),this._openedSnackBarRef=c,this._openedSnackBarRef}_animateSnackBar(e,i){e.afterDismissed().subscribe(()=>{this._openedSnackBarRef==e&&(this._openedSnackBarRef=null),i.announcementMessage&&this._live.clear()}),i.duration&&i.duration>0&&e.afterOpened().subscribe(()=>e._dismissAfter(i.duration)),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{e.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):e.containerInstance.enter()}_createOverlay(e){let i=new mn;i.direction=e.direction;let n=Ln(this._injector),r=e.direction==="rtl",a=e.horizontalPosition==="left"||e.horizontalPosition==="start"&&!r||e.horizontalPosition==="end"&&r,c=!a&&e.horizontalPosition!=="center";return a?n.left("0"):c?n.right("0"):n.centerHorizontally(),e.verticalPosition==="top"?n.top("0"):n.bottom("0"),i.positionStrategy=n,i.disableAnimations=this._animationsDisabled,hn(this._injector,i)}_createInjector(e,i){let n=e&&e.viewContainerRef&&e.viewContainerRef.injector;return ye.create({parent:n||this._injector,providers:[{provide:Qr,useValue:i},{provide:ph,useValue:e.data}]})}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var Ko=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({providers:[Xr],imports:[yi,ln,ot,le,hh,le]})}return o})();function t_(o,t){}var Vn=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;positionStrategy;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;scrollStrategy;closeOnNavigation=!0;closeOnDestroy=!0;closeOnOverlayDetachments=!0;disableAnimations=!1;providers;container;templateContext};var Uc=(()=>{class o extends Fn{_elementRef=m(ne);_focusTrapFactory=m($a);_config;_interactivityChecker=m(Fo);_ngZone=m(pe);_focusMonitor=m(Ni);_renderer=m(Ct);_changeDetectorRef=m(Qe);_injector=m(ye);_platform=m(tt);_document=m(et);_portalOutlet;_focusTrapped=new R;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=m(Vn,{optional:!0})||new Vn,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(e){this._ariaLabelledByQueue.push(e),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(e){let i=this._ariaLabelledByQueue.indexOf(e);i>-1&&(this._ariaLabelledByQueue.splice(i,1),this._changeDetectorRef.markForCheck())}_contentAttached(){this._initializeFocusTrap(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._focusTrapped.complete(),this._isDestroyed=!0,this._restoreFocus()}attachComponentPortal(e){this._portalOutlet.hasAttached();let i=this._portalOutlet.attachComponentPortal(e);return this._contentAttached(),i}attachTemplatePortal(e){this._portalOutlet.hasAttached();let i=this._portalOutlet.attachTemplatePortal(e);return this._contentAttached(),i}attachDomPortal=e=>{this._portalOutlet.hasAttached();let i=this._portalOutlet.attachDomPortal(e);return this._contentAttached(),i};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(e,i){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let n=()=>{r(),a(),e.removeAttribute("tabindex")},r=this._renderer.listen(e,"blur",n),a=this._renderer.listen(e,"mousedown",n)})),e.focus(i)}_focusByCssSelector(e,i){let n=this._elementRef.nativeElement.querySelector(e);n&&this._forceFocus(n,i)}_trapFocus(e){this._isDestroyed||Ft(()=>{let i=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||i.focus(e);break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElement(e)||this._focusDialogContainer(e);break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]',e);break;default:this._focusByCssSelector(this._config.autoFocus,e);break}this._focusTrapped.next()},{injector:this._injector})}_restoreFocus(){let e=this._config.restoreFocus,i=null;if(typeof e=="string"?i=this._document.querySelector(e):typeof e=="boolean"?i=e?this._elementFocusedBeforeDialogWasOpened:null:e&&(i=e),this._config.restoreFocus&&i&&typeof i.focus=="function"){let n=Ha(),r=this._elementRef.nativeElement;(!n||n===this._document.body||n===r||r.contains(n))&&(this._focusMonitor?(this._focusMonitor.focusVia(i,this._closeInteractionType),this._closeInteractionType=null):i.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(e){this._elementRef.nativeElement.focus?.(e)}_containsFocus(){let e=this._elementRef.nativeElement,i=Ha();return e===i||e.contains(i)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=Ha()))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["cdk-dialog-container"]],viewQuery:function(i,n){if(i&1&&X(Nn,7),i&2){let r;U(r=W())&&(n._portalOutlet=r.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(i,n){i&2&&J("id",n._config.id||null)("role",n._config.role)("aria-modal",n._config.ariaModal)("aria-labelledby",n._config.ariaLabel?null:n._ariaLabelledByQueue[0])("aria-label",n._config.ariaLabel)("aria-describedby",n._config.ariaDescribedBy||null)},features:[Tt],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(i,n){i&1&&Re(0,t_,0,0,"ng-template",0)},dependencies:[Nn],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
6
- `],encapsulation:2})}return o})(),Kr=class{overlayRef;config;componentInstance;componentRef;containerInstance;disableClose;closed=new R;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(t,e){this.overlayRef=t,this.config=e,this.disableClose=e.disableClose,this.backdropClick=t.backdropClick(),this.keydownEvents=t.keydownEvents(),this.outsidePointerEvents=t.outsidePointerEvents(),this.id=e.id,this.keydownEvents.subscribe(i=>{i.keyCode===27&&!this.disableClose&&!_t(i)&&(i.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{!this.disableClose&&this._canClose()?this.close(void 0,{focusOrigin:"mouse"}):this.containerInstance._recaptureFocus?.()}),this._detachSubscription=t.detachments().subscribe(()=>{e.closeOnOverlayDetachments!==!1&&this.close()})}close(t,e){if(this._canClose(t)){let i=this.closed;this.containerInstance._closeInteractionType=e?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),i.next(t),i.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(t="",e=""){return this.overlayRef.updateSize({width:t,height:e}),this}addPanelClass(t){return this.overlayRef.addPanelClass(t),this}removePanelClass(t){return this.overlayRef.removePanelClass(t),this}_canClose(t){let e=this.config;return!!this.containerInstance&&(!e.closePredicate||e.closePredicate(t,e,this.componentInstance))}},i_=new oe("DialogScrollStrategy",{providedIn:"root",factory:()=>{let o=m(ye);return()=>Qo(o)}}),n_=new oe("DialogData"),o_=new oe("DefaultDialogConfig");function r_(o){let t=Oe(o),e=new H;return{valueSignal:t,get value(){return t()},change:e,ngOnDestroy(){e.complete()}}}var Wc=(()=>{class o{_injector=m(ye);_defaultOptions=m(o_,{optional:!0});_parentDialog=m(o,{optional:!0,skipSelf:!0});_overlayContainer=m(Fs);_idGenerator=m(Ne);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new R;_afterOpenedAtThisLevel=new R;_ariaHiddenElements=new Map;_scrollStrategy=m(i_);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=Ao(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Mt(void 0)));constructor(){}open(e,i){let n=this._defaultOptions||new Vn;i=Z(Z({},n),i),i.id=i.id||this._idGenerator.getId("cdk-dialog-"),i.id&&this.getDialogById(i.id);let r=this._getOverlayConfig(i),a=hn(this._injector,r),c=new Kr(a,i),h=this._attachContainer(a,c,i);if(c.containerInstance=h,!this.openDialogs.length){let g=this._overlayContainer.getContainerElement();h._focusTrapped?h._focusTrapped.pipe(qt(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(g)}):this._hideNonDialogContentFromAssistiveTechnology(g)}return this._attachDialogContent(e,c,h,i),this.openDialogs.push(c),c.closed.subscribe(()=>this._removeOpenDialog(c,!0)),this.afterOpened.next(c),c}closeAll(){Hc(this.openDialogs,e=>e.close())}getDialogById(e){return this.openDialogs.find(i=>i.id===e)}ngOnDestroy(){Hc(this._openDialogsAtThisLevel,e=>{e.config.closeOnDestroy===!1&&this._removeOpenDialog(e,!1)}),Hc(this._openDialogsAtThisLevel,e=>e.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){let i=new mn({positionStrategy:e.positionStrategy||Ln().centerHorizontally().centerVertically(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,width:e.width,height:e.height,disposeOnNavigation:e.closeOnNavigation,disableAnimations:e.disableAnimations});return e.backdropClass&&(i.backdropClass=e.backdropClass),i}_attachContainer(e,i,n){let r=n.injector||n.viewContainerRef?.injector,a=[{provide:Vn,useValue:n},{provide:Kr,useValue:i},{provide:Go,useValue:e}],c;n.container?typeof n.container=="function"?c=n.container:(c=n.container.type,a.push(...n.container.providers(n))):c=Uc;let h=new vi(c,n.viewContainerRef,ye.create({parent:r||this._injector,providers:a}));return e.attach(h).instance}_attachDialogContent(e,i,n,r){if(e instanceof Mn){let a=this._createInjector(r,i,n,void 0),c={$implicit:r.data,dialogRef:i};r.templateContext&&(c=Z(Z({},c),typeof r.templateContext=="function"?r.templateContext():r.templateContext)),n.attachTemplatePortal(new sn(e,null,c,a))}else{let a=this._createInjector(r,i,n,this._injector),c=n.attachComponentPortal(new vi(e,r.viewContainerRef,a));i.componentRef=c,i.componentInstance=c.instance}}_createInjector(e,i,n,r){let a=e.injector||e.viewContainerRef?.injector,c=[{provide:n_,useValue:e.data},{provide:Kr,useValue:i}];return e.providers&&(typeof e.providers=="function"?c.push(...e.providers(i,e,n)):c.push(...e.providers)),e.direction&&(!a||!a.get(bt,null,{optional:!0}))&&c.push({provide:bt,useValue:r_(e.direction)}),ye.create({parent:a||r,providers:c})}_removeOpenDialog(e,i){let n=this.openDialogs.indexOf(e);n>-1&&(this.openDialogs.splice(n,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,a)=>{r?a.setAttribute("aria-hidden",r):a.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),i&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(e){if(e.parentElement){let i=e.parentElement.children;for(let n=i.length-1;n>-1;n--){let r=i[n];r!==e&&r.nodeName!=="SCRIPT"&&r.nodeName!=="STYLE"&&!r.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(r,r.getAttribute("aria-hidden")),r.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function Hc(o,t){let e=o.length;for(;e--;)t(o[e])}var uh=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({providers:[Wc],imports:[yi,ln,No,ln]})}return o})();function a_(o,t){}var Jr=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;position;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;delayFocusTrap=!0;scrollStrategy;closeOnNavigation=!0;enterAnimationDuration;exitAnimationDuration},$c="mdc-dialog--open",gh="mdc-dialog--opening",fh="mdc-dialog--closing",s_=150,l_=75,vh=(()=>{class o extends Uc{_animationStateChanged=new H;_animationsEnabled=!$e();_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?bh(this._config.enterAnimationDuration)??s_:0;_exitAnimationDuration=this._animationsEnabled?bh(this._config.exitAnimationDuration)??l_:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(_h,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(gh,$c)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add($c),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove($c),this._animationsEnabled?(this._hostElement.style.setProperty(_h,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(fh)),this._waitForAnimationToComplete(this._exitAnimationDuration,this._finishDialogClose)):Promise.resolve().then(()=>this._finishDialogClose())}_updateActionSectionCount(e){this._actionSectionCount+=e,this._changeDetectorRef.markForCheck()}_finishDialogOpen=()=>{this._clearAnimationClasses(),this._openAnimationDone(this._enterAnimationDuration)};_finishDialogClose=()=>{this._clearAnimationClasses(),this._animationStateChanged.emit({state:"closed",totalTime:this._exitAnimationDuration})};_clearAnimationClasses(){this._hostElement.classList.remove(gh,fh)}_waitForAnimationToComplete(e,i){this._animationTimer!==null&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(i,e)}_requestAnimationFrame(e){this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()})}_captureInitialFocus(){this._config.delayFocusTrap||this._trapFocus()}_openAnimationDone(e){this._config.delayFocusTrap&&this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})}ngOnDestroy(){super.ngOnDestroy(),this._animationTimer!==null&&clearTimeout(this._animationTimer)}attachComponentPortal(e){let i=super.attachComponentPortal(e);return i.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),i}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275cmp=M({type:o,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(i,n){i&2&&(Jt("id",n._config.id),J("aria-modal",n._config.ariaModal)("role",n._config.role)("aria-labelledby",n._config.ariaLabel?null:n._ariaLabelledByQueue[0])("aria-label",n._config.ariaLabel)("aria-describedby",n._config.ariaDescribedBy||null),E("_mat-animation-noopable",!n._animationsEnabled)("mat-mdc-dialog-container-with-actions",n._actionSectionCount>0))},features:[Tt],decls:3,vars:0,consts:[[1,"mat-mdc-dialog-inner-container","mdc-dialog__container"],[1,"mat-mdc-dialog-surface","mdc-dialog__surface"],["cdkPortalOutlet",""]],template:function(i,n){i&1&&(s(0,"div",0)(1,"div",1),Re(2,a_,0,0,"ng-template",2),l()())},dependencies:[Nn],styles:[`.mat-mdc-dialog-container{width:100%;height:100%;display:block;box-sizing:border-box;max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;outline:0}.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-max-width, 560px);min-width:var(--mat-dialog-container-min-width, 280px)}@media(max-width: 599px){.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-small-max-width, calc(100vw - 32px))}}.mat-mdc-dialog-inner-container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;opacity:0;transition:opacity linear var(--mat-dialog-transition-duration, 0ms);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit}.mdc-dialog--closing .mat-mdc-dialog-inner-container{transition:opacity 75ms linear;transform:none}.mdc-dialog--open .mat-mdc-dialog-inner-container{opacity:1}._mat-animation-noopable .mat-mdc-dialog-inner-container{transition:none}.mat-mdc-dialog-surface{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;width:100%;height:100%;position:relative;overflow-y:auto;outline:0;transform:scale(0.8);transition:transform var(--mat-dialog-transition-duration, 0ms) cubic-bezier(0, 0, 0.2, 1);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;box-shadow:var(--mat-dialog-container-elevation-shadow, none);border-radius:var(--mat-dialog-container-shape, var(--mat-sys-corner-extra-large, 4px));background-color:var(--mat-dialog-container-color, var(--mat-sys-surface, white))}[dir=rtl] .mat-mdc-dialog-surface{text-align:right}.mdc-dialog--open .mat-mdc-dialog-surface,.mdc-dialog--closing .mat-mdc-dialog-surface{transform:none}._mat-animation-noopable .mat-mdc-dialog-surface{transition:none}.mat-mdc-dialog-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:2px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-dialog-title{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:var(--mat-dialog-headline-padding, 6px 24px 13px)}.mat-mdc-dialog-title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}[dir=rtl] .mat-mdc-dialog-title{text-align:right}.mat-mdc-dialog-container .mat-mdc-dialog-title{color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, 0.03125em))}.mat-mdc-dialog-content{display:block;flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;max-height:65vh}.mat-mdc-dialog-content>:first-child{margin-top:0}.mat-mdc-dialog-content>:last-child{margin-bottom:0}.mat-mdc-dialog-container .mat-mdc-dialog-content{color:var(--mat-dialog-supporting-text-color, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, 0.6)));font-family:var(--mat-dialog-supporting-text-font, var(--mat-sys-body-medium-font, inherit));line-height:var(--mat-dialog-supporting-text-line-height, var(--mat-sys-body-medium-line-height, 1.5rem));font-size:var(--mat-dialog-supporting-text-size, var(--mat-sys-body-medium-size, 1rem));font-weight:var(--mat-dialog-supporting-text-weight, var(--mat-sys-body-medium-weight, 400));letter-spacing:var(--mat-dialog-supporting-text-tracking, var(--mat-sys-body-medium-tracking, 0.03125em))}.mat-mdc-dialog-container .mat-mdc-dialog-content{padding:var(--mat-dialog-content-padding, 20px 24px)}.mat-mdc-dialog-container-with-actions .mat-mdc-dialog-content{padding:var(--mat-dialog-with-actions-content-padding, 20px 24px 0)}.mat-mdc-dialog-container .mat-mdc-dialog-title+.mat-mdc-dialog-content{padding-top:0}.mat-mdc-dialog-actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;box-sizing:border-box;min-height:52px;margin:0;border-top:1px solid rgba(0,0,0,0);padding:var(--mat-dialog-actions-padding, 16px 24px);justify-content:var(--mat-dialog-actions-alignment, flex-end)}@media(forced-colors: active){.mat-mdc-dialog-actions{border-top-color:CanvasText}}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-start,.mat-mdc-dialog-actions[align=start]{justify-content:start}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-center,.mat-mdc-dialog-actions[align=center]{justify-content:center}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-end,.mat-mdc-dialog-actions[align=end]{justify-content:flex-end}.mat-mdc-dialog-actions .mat-button-base+.mat-button-base,.mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-mdc-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}.mat-mdc-dialog-component-host{display:contents}
7
- `],encapsulation:2})}return o})(),_h="--mat-dialog-transition-duration";function bh(o){return o==null?null:typeof o=="number"?o:o.endsWith("ms")?fi(o.substring(0,o.length-2)):o.endsWith("s")?fi(o.substring(0,o.length-1))*1e3:o==="0"?0:null}var Zr=(function(o){return o[o.OPEN=0]="OPEN",o[o.CLOSING=1]="CLOSING",o[o.CLOSED=2]="CLOSED",o})(Zr||{}),ei=class{_ref;_config;_containerInstance;componentInstance;componentRef;disableClose;id;_afterOpened=new R;_beforeClosed=new R;_result;_closeFallbackTimeout;_state=Zr.OPEN;_closeInteractionType;constructor(t,e,i){this._ref=t,this._config=e,this._containerInstance=i,this.disableClose=e.disableClose,this.id=t.id,t.addPanelClass("mat-mdc-dialog-panel"),i._animationStateChanged.pipe(me(n=>n.state==="opened"),qt(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),i._animationStateChanged.pipe(me(n=>n.state==="closed"),qt(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),t.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),Di(this.backdropClick(),this.keydownEvents().pipe(me(n=>n.keyCode===27&&!this.disableClose&&!_t(n)))).subscribe(n=>{this.disableClose||(n.preventDefault(),yh(this,n.type==="keydown"?"keyboard":"mouse"))})}close(t){let e=this._config.closePredicate;e&&!e(t,this._config,this.componentInstance)||(this._result=t,this._containerInstance._animationStateChanged.pipe(me(i=>i.state==="closing"),qt(1)).subscribe(i=>{this._beforeClosed.next(t),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),i.totalTime+100)}),this._state=Zr.CLOSING,this._containerInstance._startExitAnimation())}afterOpened(){return this._afterOpened}afterClosed(){return this._ref.closed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._ref.backdropClick}keydownEvents(){return this._ref.keydownEvents}updatePosition(t){let e=this._ref.config.positionStrategy;return t&&(t.left||t.right)?t.left?e.left(t.left):e.right(t.right):e.centerHorizontally(),t&&(t.top||t.bottom)?t.top?e.top(t.top):e.bottom(t.bottom):e.centerVertically(),this._ref.updatePosition(),this}updateSize(t="",e=""){return this._ref.updateSize(t,e),this}addPanelClass(t){return this._ref.addPanelClass(t),this}removePanelClass(t){return this._ref.removePanelClass(t),this}getState(){return this._state}_finishDialogClose(){this._state=Zr.CLOSED,this._ref.close(this._result,{focusOrigin:this._closeInteractionType}),this.componentInstance=null}};function yh(o,t,e){return o._closeInteractionType=t,o.close(e)}var Hi=new oe("MatMdcDialogData"),Ls=new oe("mat-mdc-dialog-default-options"),Ch=new oe("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(ye);return()=>Qo(o)}}),Ci=(()=>{class o{_defaultOptions=m(Ls,{optional:!0});_scrollStrategy=m(Ch);_parentDialog=m(o,{optional:!0,skipSelf:!0});_idGenerator=m(Ne);_injector=m(ye);_dialog=m(Wc);_animationsDisabled=$e();_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new R;_afterOpenedAtThisLevel=new R;dialogConfigClass=Jr;_dialogRefConstructor;_dialogContainerType;_dialogDataToken;get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}afterAllClosed=Ao(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Mt(void 0)));constructor(){this._dialogRefConstructor=ei,this._dialogContainerType=vh,this._dialogDataToken=Hi}open(e,i){let n;i=Z(Z({},this._defaultOptions||new Jr),i),i.id=i.id||this._idGenerator.getId("mat-mdc-dialog-"),i.scrollStrategy=i.scrollStrategy||this._scrollStrategy();let r=this._dialog.open(e,ut(Z({},i),{positionStrategy:Ln(this._injector).centerHorizontally().centerVertically(),disableClose:!0,closePredicate:void 0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,disableAnimations:this._animationsDisabled||i.enterAnimationDuration?.toLocaleString()==="0"||i.exitAnimationDuration?.toString()==="0",container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:i},{provide:Vn,useValue:i}]},templateContext:()=>({dialogRef:n}),providers:(a,c,h)=>(n=new this._dialogRefConstructor(a,i,h),n.updatePosition(i?.position),[{provide:this._dialogContainerType,useValue:h},{provide:this._dialogDataToken,useValue:c.data},{provide:this._dialogRefConstructor,useValue:n}])}));return n.componentRef=r.componentRef,n.componentInstance=r.componentInstance,this.openDialogs.push(n),this.afterOpened.next(n),n.afterClosed().subscribe(()=>{let a=this.openDialogs.indexOf(n);a>-1&&(this.openDialogs.splice(a,1),this.openDialogs.length||this._getAfterAllClosed().next())}),n}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(e){return this.openDialogs.find(i=>i.id===e)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(e){let i=e.length;for(;i--;)e[i].close()}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var xh=(()=>{class o{_dialogRef=m(ei,{optional:!0});_elementRef=m(ne);_dialog=m(Ci);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=c_(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o})}return o})(),un=(()=>{class o extends xh{id=m(Ne).getId("mat-mdc-dialog-title-");_onAdd(){this._dialogRef._containerInstance?._addAriaLabelledBy?.(this.id)}_onRemove(){this._dialogRef?._containerInstance?._removeAriaLabelledBy?.(this.id)}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275dir=xe({type:o,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(i,n){i&2&&Jt("id",n.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[Tt]})}return o})(),gn=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[bm([dn])]})}return o})(),fn=(()=>{class o extends xh{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275dir=xe({type:o,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(i,n){i&2&&E("mat-mdc-dialog-actions-align-start",n.align==="start")("mat-mdc-dialog-actions-align-center",n.align==="center")("mat-mdc-dialog-actions-align-end",n.align==="end")},inputs:{align:"align"},features:[Tt]})}return o})();function c_(o,t){let e=o.nativeElement.parentElement;for(;e&&!e.classList.contains("mat-mdc-dialog-container");)e=e.parentElement;return e?t.find(i=>i.id===e.id):null}var mo=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({providers:[Ci],imports:[uh,yi,ln,le,le]})}return o})();function Xc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ho=Xc();function Ph(o){ho=o}var na={exec:()=>null};function Te(o,t=""){let e=typeof o=="string"?o:o.source,i={replace:(n,r)=>{let a=typeof r=="string"?r:r.source;return a=a.replace(Lt.caret,"$1"),e=e.replace(n,a),i},getRegex:()=>new RegExp(e,t)};return i}var Lt={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,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ 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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o=>new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}#`),htmlBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}<(?:[a-z].*>|!--)`,"i")},d_=/^(?:[ \t]*(?:\n|$))+/,m_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,p_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,oa=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,h_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Kc=/(?:[*+-]|\d{1,9}[.)])/,Oh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ah=Te(Oh).replace(/bull/g,Kc).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(),u_=Te(Oh).replace(/bull/g,Kc).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(),Zc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,g_=/^[^\n]+/,Jc=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,f_=Te(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Jc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),__=Te(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Kc).getRegex(),Bs="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",ed=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,b_=Te("^ {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",ed).replace("tag",Bs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ih=Te(Zc).replace("hr",oa).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Bs).getRegex(),v_=Te(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ih).getRegex(),td={blockquote:v_,code:m_,def:f_,fences:p_,heading:h_,hr:oa,html:b_,lheading:Ah,list:__,newline:d_,paragraph:Ih,table:na,text:g_},wh=Te("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",oa).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Bs).getRegex(),y_=ut(Z({},td),{lheading:u_,table:wh,paragraph:Te(Zc).replace("hr",oa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",wh).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Bs).getRegex()}),C_=ut(Z({},td),{html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ed).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:na,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Te(Zc).replace("hr",oa).replace("heading",` *#{1,6} *[^
5
+ `],encapsulation:2})}return o})();function Jf(){return new Xo}var e_=new oe("mat-snack-bar-default-options",{providedIn:"root",factory:Jf}),Xr=(()=>{class o{_live=m(qa);_injector=m(ye);_breakpointObserver=m(Lm);_parentSnackBar=m(o,{optional:!0,skipSelf:!0});_defaultConfig=m(e_);_animationsDisabled=$e();_snackBarRefAtThisLevel=null;simpleSnackBarComponent=hh;snackBarContainerComponent=Zf;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){let e=this._parentSnackBar;return e?e._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(e){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=e:this._snackBarRefAtThisLevel=e}constructor(){}openFromComponent(e,i){return this._attach(e,i)}openFromTemplate(e,i){return this._attach(e,i)}open(e,i="",n){let r=Z(Z({},this._defaultConfig),n);return r.data={message:e,action:i},r.announcementMessage===e&&(r.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,r)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(e,i){let n=i&&i.viewContainerRef&&i.viewContainerRef.injector,r=ye.create({parent:n||this._injector,providers:[{provide:Xo,useValue:i}]}),a=new vi(this.snackBarContainerComponent,i.viewContainerRef,r),c=e.attach(a);return c.instance.snackBarConfig=i,c.instance}_attach(e,i){let n=Z(Z(Z({},new Xo),this._defaultConfig),i),r=this._createOverlay(n),a=this._attachSnackBarContainer(r,n),c=new Qr(a,r);if(e instanceof Mn){let h=new sn(e,null,{$implicit:n.data,snackBarRef:c});c.instance=a.attachTemplatePortal(h)}else{let h=this._createInjector(n,c),g=new vi(e,void 0,h),y=a.attachComponentPortal(g);c.instance=y.instance}return this._breakpointObserver.observe(Bm.HandsetPortrait).pipe(N(r.detachments())).subscribe(h=>{r.overlayElement.classList.toggle(this.handsetCssClass,h.matches)}),n.announcementMessage&&a._onAnnounce.subscribe(()=>{this._live.announce(n.announcementMessage,n.politeness)}),this._animateSnackBar(c,n),this._openedSnackBarRef=c,this._openedSnackBarRef}_animateSnackBar(e,i){e.afterDismissed().subscribe(()=>{this._openedSnackBarRef==e&&(this._openedSnackBarRef=null),i.announcementMessage&&this._live.clear()}),i.duration&&i.duration>0&&e.afterOpened().subscribe(()=>e._dismissAfter(i.duration)),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{e.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):e.containerInstance.enter()}_createOverlay(e){let i=new mn;i.direction=e.direction;let n=Ln(this._injector),r=e.direction==="rtl",a=e.horizontalPosition==="left"||e.horizontalPosition==="start"&&!r||e.horizontalPosition==="end"&&r,c=!a&&e.horizontalPosition!=="center";return a?n.left("0"):c?n.right("0"):n.centerHorizontally(),e.verticalPosition==="top"?n.top("0"):n.bottom("0"),i.positionStrategy=n,i.disableAnimations=this._animationsDisabled,hn(this._injector,i)}_createInjector(e,i){let n=e&&e.viewContainerRef&&e.viewContainerRef.injector;return ye.create({parent:n||this._injector,providers:[{provide:Qr,useValue:i},{provide:ph,useValue:e.data}]})}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var Ko=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({providers:[Xr],imports:[yi,ln,ot,ce,hh,ce]})}return o})();function t_(o,t){}var Vn=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;positionStrategy;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;scrollStrategy;closeOnNavigation=!0;closeOnDestroy=!0;closeOnOverlayDetachments=!0;disableAnimations=!1;providers;container;templateContext};var Uc=(()=>{class o extends Fn{_elementRef=m(ne);_focusTrapFactory=m($a);_config;_interactivityChecker=m(Fo);_ngZone=m(pe);_focusMonitor=m(Ni);_renderer=m(Ct);_changeDetectorRef=m(Qe);_injector=m(ye);_platform=m(tt);_document=m(et);_portalOutlet;_focusTrapped=new R;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=m(Vn,{optional:!0})||new Vn,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(e){this._ariaLabelledByQueue.push(e),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(e){let i=this._ariaLabelledByQueue.indexOf(e);i>-1&&(this._ariaLabelledByQueue.splice(i,1),this._changeDetectorRef.markForCheck())}_contentAttached(){this._initializeFocusTrap(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._focusTrapped.complete(),this._isDestroyed=!0,this._restoreFocus()}attachComponentPortal(e){this._portalOutlet.hasAttached();let i=this._portalOutlet.attachComponentPortal(e);return this._contentAttached(),i}attachTemplatePortal(e){this._portalOutlet.hasAttached();let i=this._portalOutlet.attachTemplatePortal(e);return this._contentAttached(),i}attachDomPortal=e=>{this._portalOutlet.hasAttached();let i=this._portalOutlet.attachDomPortal(e);return this._contentAttached(),i};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(e,i){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let n=()=>{r(),a(),e.removeAttribute("tabindex")},r=this._renderer.listen(e,"blur",n),a=this._renderer.listen(e,"mousedown",n)})),e.focus(i)}_focusByCssSelector(e,i){let n=this._elementRef.nativeElement.querySelector(e);n&&this._forceFocus(n,i)}_trapFocus(e){this._isDestroyed||Ft(()=>{let i=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||i.focus(e);break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElement(e)||this._focusDialogContainer(e);break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]',e);break;default:this._focusByCssSelector(this._config.autoFocus,e);break}this._focusTrapped.next()},{injector:this._injector})}_restoreFocus(){let e=this._config.restoreFocus,i=null;if(typeof e=="string"?i=this._document.querySelector(e):typeof e=="boolean"?i=e?this._elementFocusedBeforeDialogWasOpened:null:e&&(i=e),this._config.restoreFocus&&i&&typeof i.focus=="function"){let n=Ha(),r=this._elementRef.nativeElement;(!n||n===this._document.body||n===r||r.contains(n))&&(this._focusMonitor?(this._focusMonitor.focusVia(i,this._closeInteractionType),this._closeInteractionType=null):i.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(e){this._elementRef.nativeElement.focus?.(e)}_containsFocus(){let e=this._elementRef.nativeElement,i=Ha();return e===i||e.contains(i)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=Ha()))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["cdk-dialog-container"]],viewQuery:function(i,n){if(i&1&&X(Nn,7),i&2){let r;U(r=W())&&(n._portalOutlet=r.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(i,n){i&2&&J("id",n._config.id||null)("role",n._config.role)("aria-modal",n._config.ariaModal)("aria-labelledby",n._config.ariaLabel?null:n._ariaLabelledByQueue[0])("aria-label",n._config.ariaLabel)("aria-describedby",n._config.ariaDescribedBy||null)},features:[Tt],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(i,n){i&1&&Re(0,t_,0,0,"ng-template",0)},dependencies:[Nn],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
6
+ `],encapsulation:2})}return o})(),Kr=class{overlayRef;config;componentInstance;componentRef;containerInstance;disableClose;closed=new R;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(t,e){this.overlayRef=t,this.config=e,this.disableClose=e.disableClose,this.backdropClick=t.backdropClick(),this.keydownEvents=t.keydownEvents(),this.outsidePointerEvents=t.outsidePointerEvents(),this.id=e.id,this.keydownEvents.subscribe(i=>{i.keyCode===27&&!this.disableClose&&!_t(i)&&(i.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{!this.disableClose&&this._canClose()?this.close(void 0,{focusOrigin:"mouse"}):this.containerInstance._recaptureFocus?.()}),this._detachSubscription=t.detachments().subscribe(()=>{e.closeOnOverlayDetachments!==!1&&this.close()})}close(t,e){if(this._canClose(t)){let i=this.closed;this.containerInstance._closeInteractionType=e?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),i.next(t),i.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(t="",e=""){return this.overlayRef.updateSize({width:t,height:e}),this}addPanelClass(t){return this.overlayRef.addPanelClass(t),this}removePanelClass(t){return this.overlayRef.removePanelClass(t),this}_canClose(t){let e=this.config;return!!this.containerInstance&&(!e.closePredicate||e.closePredicate(t,e,this.componentInstance))}},i_=new oe("DialogScrollStrategy",{providedIn:"root",factory:()=>{let o=m(ye);return()=>Qo(o)}}),n_=new oe("DialogData"),o_=new oe("DefaultDialogConfig");function r_(o){let t=Oe(o),e=new H;return{valueSignal:t,get value(){return t()},change:e,ngOnDestroy(){e.complete()}}}var Wc=(()=>{class o{_injector=m(ye);_defaultOptions=m(o_,{optional:!0});_parentDialog=m(o,{optional:!0,skipSelf:!0});_overlayContainer=m(Fs);_idGenerator=m(Ne);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new R;_afterOpenedAtThisLevel=new R;_ariaHiddenElements=new Map;_scrollStrategy=m(i_);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=Ao(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Mt(void 0)));constructor(){}open(e,i){let n=this._defaultOptions||new Vn;i=Z(Z({},n),i),i.id=i.id||this._idGenerator.getId("cdk-dialog-"),i.id&&this.getDialogById(i.id);let r=this._getOverlayConfig(i),a=hn(this._injector,r),c=new Kr(a,i),h=this._attachContainer(a,c,i);if(c.containerInstance=h,!this.openDialogs.length){let g=this._overlayContainer.getContainerElement();h._focusTrapped?h._focusTrapped.pipe(qt(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(g)}):this._hideNonDialogContentFromAssistiveTechnology(g)}return this._attachDialogContent(e,c,h,i),this.openDialogs.push(c),c.closed.subscribe(()=>this._removeOpenDialog(c,!0)),this.afterOpened.next(c),c}closeAll(){Hc(this.openDialogs,e=>e.close())}getDialogById(e){return this.openDialogs.find(i=>i.id===e)}ngOnDestroy(){Hc(this._openDialogsAtThisLevel,e=>{e.config.closeOnDestroy===!1&&this._removeOpenDialog(e,!1)}),Hc(this._openDialogsAtThisLevel,e=>e.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){let i=new mn({positionStrategy:e.positionStrategy||Ln().centerHorizontally().centerVertically(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,width:e.width,height:e.height,disposeOnNavigation:e.closeOnNavigation,disableAnimations:e.disableAnimations});return e.backdropClass&&(i.backdropClass=e.backdropClass),i}_attachContainer(e,i,n){let r=n.injector||n.viewContainerRef?.injector,a=[{provide:Vn,useValue:n},{provide:Kr,useValue:i},{provide:Go,useValue:e}],c;n.container?typeof n.container=="function"?c=n.container:(c=n.container.type,a.push(...n.container.providers(n))):c=Uc;let h=new vi(c,n.viewContainerRef,ye.create({parent:r||this._injector,providers:a}));return e.attach(h).instance}_attachDialogContent(e,i,n,r){if(e instanceof Mn){let a=this._createInjector(r,i,n,void 0),c={$implicit:r.data,dialogRef:i};r.templateContext&&(c=Z(Z({},c),typeof r.templateContext=="function"?r.templateContext():r.templateContext)),n.attachTemplatePortal(new sn(e,null,c,a))}else{let a=this._createInjector(r,i,n,this._injector),c=n.attachComponentPortal(new vi(e,r.viewContainerRef,a));i.componentRef=c,i.componentInstance=c.instance}}_createInjector(e,i,n,r){let a=e.injector||e.viewContainerRef?.injector,c=[{provide:n_,useValue:e.data},{provide:Kr,useValue:i}];return e.providers&&(typeof e.providers=="function"?c.push(...e.providers(i,e,n)):c.push(...e.providers)),e.direction&&(!a||!a.get(bt,null,{optional:!0}))&&c.push({provide:bt,useValue:r_(e.direction)}),ye.create({parent:a||r,providers:c})}_removeOpenDialog(e,i){let n=this.openDialogs.indexOf(e);n>-1&&(this.openDialogs.splice(n,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,a)=>{r?a.setAttribute("aria-hidden",r):a.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),i&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(e){if(e.parentElement){let i=e.parentElement.children;for(let n=i.length-1;n>-1;n--){let r=i[n];r!==e&&r.nodeName!=="SCRIPT"&&r.nodeName!=="STYLE"&&!r.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(r,r.getAttribute("aria-hidden")),r.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function Hc(o,t){let e=o.length;for(;e--;)t(o[e])}var uh=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({providers:[Wc],imports:[yi,ln,No,ln]})}return o})();function a_(o,t){}var Jr=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;position;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;delayFocusTrap=!0;scrollStrategy;closeOnNavigation=!0;enterAnimationDuration;exitAnimationDuration},$c="mdc-dialog--open",gh="mdc-dialog--opening",fh="mdc-dialog--closing",s_=150,l_=75,vh=(()=>{class o extends Uc{_animationStateChanged=new H;_animationsEnabled=!$e();_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?bh(this._config.enterAnimationDuration)??s_:0;_exitAnimationDuration=this._animationsEnabled?bh(this._config.exitAnimationDuration)??l_:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(_h,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(gh,$c)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add($c),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove($c),this._animationsEnabled?(this._hostElement.style.setProperty(_h,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(fh)),this._waitForAnimationToComplete(this._exitAnimationDuration,this._finishDialogClose)):Promise.resolve().then(()=>this._finishDialogClose())}_updateActionSectionCount(e){this._actionSectionCount+=e,this._changeDetectorRef.markForCheck()}_finishDialogOpen=()=>{this._clearAnimationClasses(),this._openAnimationDone(this._enterAnimationDuration)};_finishDialogClose=()=>{this._clearAnimationClasses(),this._animationStateChanged.emit({state:"closed",totalTime:this._exitAnimationDuration})};_clearAnimationClasses(){this._hostElement.classList.remove(gh,fh)}_waitForAnimationToComplete(e,i){this._animationTimer!==null&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(i,e)}_requestAnimationFrame(e){this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()})}_captureInitialFocus(){this._config.delayFocusTrap||this._trapFocus()}_openAnimationDone(e){this._config.delayFocusTrap&&this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})}ngOnDestroy(){super.ngOnDestroy(),this._animationTimer!==null&&clearTimeout(this._animationTimer)}attachComponentPortal(e){let i=super.attachComponentPortal(e);return i.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),i}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275cmp=M({type:o,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(i,n){i&2&&(Jt("id",n._config.id),J("aria-modal",n._config.ariaModal)("role",n._config.role)("aria-labelledby",n._config.ariaLabel?null:n._ariaLabelledByQueue[0])("aria-label",n._config.ariaLabel)("aria-describedby",n._config.ariaDescribedBy||null),E("_mat-animation-noopable",!n._animationsEnabled)("mat-mdc-dialog-container-with-actions",n._actionSectionCount>0))},features:[Tt],decls:3,vars:0,consts:[[1,"mat-mdc-dialog-inner-container","mdc-dialog__container"],[1,"mat-mdc-dialog-surface","mdc-dialog__surface"],["cdkPortalOutlet",""]],template:function(i,n){i&1&&(s(0,"div",0)(1,"div",1),Re(2,a_,0,0,"ng-template",2),l()())},dependencies:[Nn],styles:[`.mat-mdc-dialog-container{width:100%;height:100%;display:block;box-sizing:border-box;max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;outline:0}.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-max-width, 560px);min-width:var(--mat-dialog-container-min-width, 280px)}@media(max-width: 599px){.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-small-max-width, calc(100vw - 32px))}}.mat-mdc-dialog-inner-container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;opacity:0;transition:opacity linear var(--mat-dialog-transition-duration, 0ms);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit}.mdc-dialog--closing .mat-mdc-dialog-inner-container{transition:opacity 75ms linear;transform:none}.mdc-dialog--open .mat-mdc-dialog-inner-container{opacity:1}._mat-animation-noopable .mat-mdc-dialog-inner-container{transition:none}.mat-mdc-dialog-surface{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;width:100%;height:100%;position:relative;overflow-y:auto;outline:0;transform:scale(0.8);transition:transform var(--mat-dialog-transition-duration, 0ms) cubic-bezier(0, 0, 0.2, 1);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;box-shadow:var(--mat-dialog-container-elevation-shadow, none);border-radius:var(--mat-dialog-container-shape, var(--mat-sys-corner-extra-large, 4px));background-color:var(--mat-dialog-container-color, var(--mat-sys-surface, white))}[dir=rtl] .mat-mdc-dialog-surface{text-align:right}.mdc-dialog--open .mat-mdc-dialog-surface,.mdc-dialog--closing .mat-mdc-dialog-surface{transform:none}._mat-animation-noopable .mat-mdc-dialog-surface{transition:none}.mat-mdc-dialog-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:2px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-dialog-title{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:var(--mat-dialog-headline-padding, 6px 24px 13px)}.mat-mdc-dialog-title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}[dir=rtl] .mat-mdc-dialog-title{text-align:right}.mat-mdc-dialog-container .mat-mdc-dialog-title{color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, 0.03125em))}.mat-mdc-dialog-content{display:block;flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;max-height:65vh}.mat-mdc-dialog-content>:first-child{margin-top:0}.mat-mdc-dialog-content>:last-child{margin-bottom:0}.mat-mdc-dialog-container .mat-mdc-dialog-content{color:var(--mat-dialog-supporting-text-color, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, 0.6)));font-family:var(--mat-dialog-supporting-text-font, var(--mat-sys-body-medium-font, inherit));line-height:var(--mat-dialog-supporting-text-line-height, var(--mat-sys-body-medium-line-height, 1.5rem));font-size:var(--mat-dialog-supporting-text-size, var(--mat-sys-body-medium-size, 1rem));font-weight:var(--mat-dialog-supporting-text-weight, var(--mat-sys-body-medium-weight, 400));letter-spacing:var(--mat-dialog-supporting-text-tracking, var(--mat-sys-body-medium-tracking, 0.03125em))}.mat-mdc-dialog-container .mat-mdc-dialog-content{padding:var(--mat-dialog-content-padding, 20px 24px)}.mat-mdc-dialog-container-with-actions .mat-mdc-dialog-content{padding:var(--mat-dialog-with-actions-content-padding, 20px 24px 0)}.mat-mdc-dialog-container .mat-mdc-dialog-title+.mat-mdc-dialog-content{padding-top:0}.mat-mdc-dialog-actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;box-sizing:border-box;min-height:52px;margin:0;border-top:1px solid rgba(0,0,0,0);padding:var(--mat-dialog-actions-padding, 16px 24px);justify-content:var(--mat-dialog-actions-alignment, flex-end)}@media(forced-colors: active){.mat-mdc-dialog-actions{border-top-color:CanvasText}}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-start,.mat-mdc-dialog-actions[align=start]{justify-content:start}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-center,.mat-mdc-dialog-actions[align=center]{justify-content:center}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-end,.mat-mdc-dialog-actions[align=end]{justify-content:flex-end}.mat-mdc-dialog-actions .mat-button-base+.mat-button-base,.mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-mdc-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}.mat-mdc-dialog-component-host{display:contents}
7
+ `],encapsulation:2})}return o})(),_h="--mat-dialog-transition-duration";function bh(o){return o==null?null:typeof o=="number"?o:o.endsWith("ms")?fi(o.substring(0,o.length-2)):o.endsWith("s")?fi(o.substring(0,o.length-1))*1e3:o==="0"?0:null}var Zr=(function(o){return o[o.OPEN=0]="OPEN",o[o.CLOSING=1]="CLOSING",o[o.CLOSED=2]="CLOSED",o})(Zr||{}),ei=class{_ref;_config;_containerInstance;componentInstance;componentRef;disableClose;id;_afterOpened=new R;_beforeClosed=new R;_result;_closeFallbackTimeout;_state=Zr.OPEN;_closeInteractionType;constructor(t,e,i){this._ref=t,this._config=e,this._containerInstance=i,this.disableClose=e.disableClose,this.id=t.id,t.addPanelClass("mat-mdc-dialog-panel"),i._animationStateChanged.pipe(me(n=>n.state==="opened"),qt(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),i._animationStateChanged.pipe(me(n=>n.state==="closed"),qt(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),t.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),Di(this.backdropClick(),this.keydownEvents().pipe(me(n=>n.keyCode===27&&!this.disableClose&&!_t(n)))).subscribe(n=>{this.disableClose||(n.preventDefault(),yh(this,n.type==="keydown"?"keyboard":"mouse"))})}close(t){let e=this._config.closePredicate;e&&!e(t,this._config,this.componentInstance)||(this._result=t,this._containerInstance._animationStateChanged.pipe(me(i=>i.state==="closing"),qt(1)).subscribe(i=>{this._beforeClosed.next(t),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),i.totalTime+100)}),this._state=Zr.CLOSING,this._containerInstance._startExitAnimation())}afterOpened(){return this._afterOpened}afterClosed(){return this._ref.closed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._ref.backdropClick}keydownEvents(){return this._ref.keydownEvents}updatePosition(t){let e=this._ref.config.positionStrategy;return t&&(t.left||t.right)?t.left?e.left(t.left):e.right(t.right):e.centerHorizontally(),t&&(t.top||t.bottom)?t.top?e.top(t.top):e.bottom(t.bottom):e.centerVertically(),this._ref.updatePosition(),this}updateSize(t="",e=""){return this._ref.updateSize(t,e),this}addPanelClass(t){return this._ref.addPanelClass(t),this}removePanelClass(t){return this._ref.removePanelClass(t),this}getState(){return this._state}_finishDialogClose(){this._state=Zr.CLOSED,this._ref.close(this._result,{focusOrigin:this._closeInteractionType}),this.componentInstance=null}};function yh(o,t,e){return o._closeInteractionType=t,o.close(e)}var Hi=new oe("MatMdcDialogData"),Ls=new oe("mat-mdc-dialog-default-options"),Ch=new oe("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(ye);return()=>Qo(o)}}),Ci=(()=>{class o{_defaultOptions=m(Ls,{optional:!0});_scrollStrategy=m(Ch);_parentDialog=m(o,{optional:!0,skipSelf:!0});_idGenerator=m(Ne);_injector=m(ye);_dialog=m(Wc);_animationsDisabled=$e();_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new R;_afterOpenedAtThisLevel=new R;dialogConfigClass=Jr;_dialogRefConstructor;_dialogContainerType;_dialogDataToken;get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}afterAllClosed=Ao(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Mt(void 0)));constructor(){this._dialogRefConstructor=ei,this._dialogContainerType=vh,this._dialogDataToken=Hi}open(e,i){let n;i=Z(Z({},this._defaultOptions||new Jr),i),i.id=i.id||this._idGenerator.getId("mat-mdc-dialog-"),i.scrollStrategy=i.scrollStrategy||this._scrollStrategy();let r=this._dialog.open(e,ut(Z({},i),{positionStrategy:Ln(this._injector).centerHorizontally().centerVertically(),disableClose:!0,closePredicate:void 0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,disableAnimations:this._animationsDisabled||i.enterAnimationDuration?.toLocaleString()==="0"||i.exitAnimationDuration?.toString()==="0",container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:i},{provide:Vn,useValue:i}]},templateContext:()=>({dialogRef:n}),providers:(a,c,h)=>(n=new this._dialogRefConstructor(a,i,h),n.updatePosition(i?.position),[{provide:this._dialogContainerType,useValue:h},{provide:this._dialogDataToken,useValue:c.data},{provide:this._dialogRefConstructor,useValue:n}])}));return n.componentRef=r.componentRef,n.componentInstance=r.componentInstance,this.openDialogs.push(n),this.afterOpened.next(n),n.afterClosed().subscribe(()=>{let a=this.openDialogs.indexOf(n);a>-1&&(this.openDialogs.splice(a,1),this.openDialogs.length||this._getAfterAllClosed().next())}),n}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(e){return this.openDialogs.find(i=>i.id===e)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(e){let i=e.length;for(;i--;)e[i].close()}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var xh=(()=>{class o{_dialogRef=m(ei,{optional:!0});_elementRef=m(ne);_dialog=m(Ci);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=c_(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o})}return o})(),un=(()=>{class o extends xh{id=m(Ne).getId("mat-mdc-dialog-title-");_onAdd(){this._dialogRef._containerInstance?._addAriaLabelledBy?.(this.id)}_onRemove(){this._dialogRef?._containerInstance?._removeAriaLabelledBy?.(this.id)}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275dir=xe({type:o,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(i,n){i&2&&Jt("id",n.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[Tt]})}return o})(),gn=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[bm([dn])]})}return o})(),fn=(()=>{class o extends xh{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275dir=xe({type:o,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(i,n){i&2&&E("mat-mdc-dialog-actions-align-start",n.align==="start")("mat-mdc-dialog-actions-align-center",n.align==="center")("mat-mdc-dialog-actions-align-end",n.align==="end")},inputs:{align:"align"},features:[Tt]})}return o})();function c_(o,t){let e=o.nativeElement.parentElement;for(;e&&!e.classList.contains("mat-mdc-dialog-container");)e=e.parentElement;return e?t.find(i=>i.id===e.id):null}var mo=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({providers:[Ci],imports:[uh,yi,ln,ce,ce]})}return o})();function Xc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ho=Xc();function Ph(o){ho=o}var na={exec:()=>null};function Te(o,t=""){let e=typeof o=="string"?o:o.source,i={replace:(n,r)=>{let a=typeof r=="string"?r:r.source;return a=a.replace(Lt.caret,"$1"),e=e.replace(n,a),i},getRegex:()=>new RegExp(e,t)};return i}var Lt={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,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ 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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o=>new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}#`),htmlBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}<(?:[a-z].*>|!--)`,"i")},d_=/^(?:[ \t]*(?:\n|$))+/,m_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,p_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,oa=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,h_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Kc=/(?:[*+-]|\d{1,9}[.)])/,Oh=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ah=Te(Oh).replace(/bull/g,Kc).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(),u_=Te(Oh).replace(/bull/g,Kc).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(),Zc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,g_=/^[^\n]+/,Jc=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,f_=Te(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Jc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),__=Te(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Kc).getRegex(),Bs="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",ed=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,b_=Te("^ {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",ed).replace("tag",Bs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ih=Te(Zc).replace("hr",oa).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Bs).getRegex(),v_=Te(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ih).getRegex(),td={blockquote:v_,code:m_,def:f_,fences:p_,heading:h_,hr:oa,html:b_,lheading:Ah,list:__,newline:d_,paragraph:Ih,table:na,text:g_},wh=Te("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",oa).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[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Bs).getRegex(),y_=ut(Z({},td),{lheading:u_,table:wh,paragraph:Te(Zc).replace("hr",oa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",wh).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Bs).getRegex()}),C_=ut(Z({},td),{html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ed).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:na,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Te(Zc).replace("hr",oa).replace("heading",` *#{1,6} *[^
8
8
  ]`).replace("lheading",Ah).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),x_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,w_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Dh=/^( {2,}|\\)\n(?!\s*$)/,S_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Hs=/[\p{P}\p{S}]/u,id=/[\s\p{P}\p{S}]/u,Rh=/[^\s\p{P}\p{S}]/u,k_=Te(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,id).getRegex(),Fh=/(?!~)[\p{P}\p{S}]/u,M_=/(?!~)[\s\p{P}\p{S}]/u,T_=/(?:[^\s\p{P}\p{S}]|~)/u,E_=/\[(?:[^\[\]`]|`[^`]*?`)*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,Nh=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,P_=Te(Nh,"u").replace(/punct/g,Hs).getRegex(),O_=Te(Nh,"u").replace(/punct/g,Fh).getRegex(),Lh="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",A_=Te(Lh,"gu").replace(/notPunctSpace/g,Rh).replace(/punctSpace/g,id).replace(/punct/g,Hs).getRegex(),I_=Te(Lh,"gu").replace(/notPunctSpace/g,T_).replace(/punctSpace/g,M_).replace(/punct/g,Fh).getRegex(),D_=Te("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Rh).replace(/punctSpace/g,id).replace(/punct/g,Hs).getRegex(),R_=Te(/\\(punct)/,"gu").replace(/punct/g,Hs).getRegex(),F_=Te(/^<(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(),N_=Te(ed).replace("(?:-->|$)","-->").getRegex(),L_=Te("^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",N_).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),zs=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,V_=Te(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",zs).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Vh=Te(/^!?\[(label)\]\[(ref)\]/).replace("label",zs).replace("ref",Jc).getRegex(),zh=Te(/^!?\[(ref)\](?:\[\])?/).replace("ref",Jc).getRegex(),z_=Te("reflink|nolink(?!\\()","g").replace("reflink",Vh).replace("nolink",zh).getRegex(),Sh=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,nd={_backpedal:na,anyPunctuation:R_,autolink:F_,blockSkip:E_,br:Dh,code:w_,del:na,emStrongLDelim:P_,emStrongRDelimAst:A_,emStrongRDelimUnd:D_,escape:x_,link:V_,nolink:zh,punctuation:k_,reflink:Vh,reflinkSearch:z_,tag:L_,text:S_,url:na},j_=ut(Z({},nd),{link:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",zs).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",zs).getRegex()}),Gc=ut(Z({},nd),{emStrongRDelimAst:I_,emStrongLDelim:O_,url:Te(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Sh).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:Te(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Sh).getRegex()}),B_=ut(Z({},Gc),{br:Te(Dh).replace("{2,}","*").getRegex(),text:Te(Gc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),Vs={normal:td,gfm:y_,pedantic:C_},ea={normal:nd,gfm:Gc,breaks:B_,pedantic:j_},H_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},kh=o=>H_[o];function Ui(o,t){if(t){if(Lt.escapeTest.test(o))return o.replace(Lt.escapeReplace,kh)}else if(Lt.escapeTestNoEncode.test(o))return o.replace(Lt.escapeReplaceNoEncode,kh);return o}function Mh(o){try{o=encodeURI(o).replace(Lt.percentDecode,"%")}catch{return null}return o}function Th(o,t){let e=o.replace(Lt.findPipe,(r,a,c)=>{let h=!1,g=a;for(;--g>=0&&c[g]==="\\";)h=!h;return h?"|":" |"}),i=e.split(Lt.splitPipe),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(Lt.slashPipe,"|");return i}function ta(o,t,e){let i=o.length;if(i===0)return"";let n=0;for(;n<i;){let r=o.charAt(i-n-1);if(r===t&&!e)n++;else if(r!==t&&e)n++;else break}return o.slice(0,i-n)}function U_(o,t){if(o.indexOf(t[1])===-1)return-1;let e=0;for(let i=0;i<o.length;i++)if(o[i]==="\\")i++;else if(o[i]===t[0])e++;else if(o[i]===t[1]&&(e--,e<0))return i;return e>0?-2:-1}function Eh(o,t,e,i,n){let r=t.href,a=t.title||null,c=o[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let h={type:o[0].charAt(0)==="!"?"image":"link",raw:e,href:r,title:a,text:c,tokens:i.inlineTokens(c)};return i.state.inLink=!1,h}function W_(o,t,e){let i=o.match(e.other.indentCodeCompensation);if(i===null)return t;let n=i[1];return t.split(`
9
9
  `).map(r=>{let a=r.match(e.other.beginningSpace);if(a===null)return r;let[c]=a;return c.length>=n.length?r.slice(n.length):r}).join(`
10
10
  `)}var js=class{options;rules;lexer;constructor(o){this.options=o||ho}space(o){let t=this.rules.block.newline.exec(o);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(o){let t=this.rules.block.code.exec(o);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ta(e,`
@@ -64,7 +64,7 @@ ${o}</tr>
64
64
  `}strong({tokens:o}){return`<strong>${this.parser.parseInline(o)}</strong>`}em({tokens:o}){return`<em>${this.parser.parseInline(o)}</em>`}codespan({text:o}){return`<code>${Ui(o,!0)}</code>`}br(o){return"<br>"}del({tokens:o}){return`<del>${this.parser.parseInline(o)}</del>`}link({href:o,title:t,tokens:e}){let i=this.parser.parseInline(e),n=Mh(o);if(n===null)return i;o=n;let r='<a href="'+o+'"';return t&&(r+=' title="'+Ui(t)+'"'),r+=">"+i+"</a>",r}image({href:o,title:t,text:e,tokens:i}){i&&(e=this.parser.parseInline(i,this.parser.textRenderer));let n=Mh(o);if(n===null)return Ui(e);o=n;let r=`<img src="${o}" alt="${e}"`;return t&&(r+=` title="${Ui(t)}"`),r+=">",r}text(o){return"tokens"in o&&o.tokens?this.parser.parseInline(o.tokens):"escaped"in o&&o.escaped?o.text:Ui(o.text)}},od=class{strong({text:o}){return o}em({text:o}){return o}codespan({text:o}){return o}del({text:o}){return o}html({text:o}){return o}text({text:o}){return o}link({text:o}){return""+o}image({text:o}){return""+o}br(){return""}},wi=class Qc{options;renderer;textRenderer;constructor(t){this.options=t||ho,this.options.renderer=this.options.renderer||new Zo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new od}static parse(t,e){return new Qc(e).parse(t)}static parseInline(t,e){return new Qc(e).parseInline(t)}parse(t,e=!0){let i="";for(let n=0;n<t.length;n++){let r=t[n];if(this.options.extensions?.renderers?.[r.type]){let c=r,h=this.options.extensions.renderers[c.type].call({parser:this},c);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){i+=h||"";continue}}let a=r;switch(a.type){case"space":{i+=this.renderer.space(a);continue}case"hr":{i+=this.renderer.hr(a);continue}case"heading":{i+=this.renderer.heading(a);continue}case"code":{i+=this.renderer.code(a);continue}case"table":{i+=this.renderer.table(a);continue}case"blockquote":{i+=this.renderer.blockquote(a);continue}case"list":{i+=this.renderer.list(a);continue}case"html":{i+=this.renderer.html(a);continue}case"def":{i+=this.renderer.def(a);continue}case"paragraph":{i+=this.renderer.paragraph(a);continue}case"text":{let c=a,h=this.renderer.text(c);for(;n+1<t.length&&t[n+1].type==="text";)c=t[++n],h+=`
65
65
  `+this.renderer.text(c);e?i+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):i+=h;continue}default:{let c='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return i}parseInline(t,e=this.renderer){let i="";for(let n=0;n<t.length;n++){let r=t[n];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)){i+=c||"";continue}}let a=r;switch(a.type){case"escape":{i+=e.text(a);break}case"html":{i+=e.html(a);break}case"link":{i+=e.link(a);break}case"image":{i+=e.image(a);break}case"strong":{i+=e.strong(a);break}case"em":{i+=e.em(a);break}case"codespan":{i+=e.codespan(a);break}case"br":{i+=e.br(a);break}case"del":{i+=e.del(a);break}case"text":{i+=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 i}},ia=class{options;block;constructor(o){this.options=o||ho}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(o){return o}postprocess(o){return o}processAllTokens(o){return o}emStrongMask(o){return o}provideLexer(){return this.block?xi.lex:xi.lexInline}provideParser(){return this.block?wi.parse:wi.parseInline}},$_=class{defaults=Xc();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=wi;Renderer=Zo;TextRenderer=od;Lexer=xi;Tokenizer=js;Hooks=ia;constructor(...o){this.use(...o)}walkTokens(o,t){let e=[];for(let i of o)switch(e=e.concat(t.call(this,i)),i.type){case"table":{let n=i;for(let r of n.header)e=e.concat(this.walkTokens(r.tokens,t));for(let r of n.rows)for(let a of r)e=e.concat(this.walkTokens(a.tokens,t));break}case"list":{let n=i;e=e.concat(this.walkTokens(n.items,t));break}default:{let n=i;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(r=>{let a=n[r].flat(1/0);e=e.concat(this.walkTokens(a,t))}):n.tokens&&(e=e.concat(this.walkTokens(n.tokens,t)))}}return e}use(...o){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return o.forEach(e=>{let i=Z({},e);if(i.async=this.defaults.async||i.async||!1,e.extensions&&(e.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let r=t.renderers[n.name];r?t.renderers[n.name]=function(...a){let c=n.renderer.apply(this,a);return c===!1&&(c=r.apply(this,a)),c}:t.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=t[n.level];r?r.unshift(n.tokenizer):t[n.level]=[n.tokenizer],n.start&&(n.level==="block"?t.startBlock?t.startBlock.push(n.start):t.startBlock=[n.start]:n.level==="inline"&&(t.startInline?t.startInline.push(n.start):t.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(t.childTokens[n.name]=n.childTokens)}),i.extensions=t),e.renderer){let n=this.defaults.renderer||new Zo(this.defaults);for(let r in e.renderer){if(!(r in n))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let a=r,c=e.renderer[a],h=n[a];n[a]=(...g)=>{let y=c.apply(n,g);return y===!1&&(y=h.apply(n,g)),y||""}}i.renderer=n}if(e.tokenizer){let n=this.defaults.tokenizer||new js(this.defaults);for(let r in e.tokenizer){if(!(r in n))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let a=r,c=e.tokenizer[a],h=n[a];n[a]=(...g)=>{let y=c.apply(n,g);return y===!1&&(y=h.apply(n,g)),y}}i.tokenizer=n}if(e.hooks){let n=this.defaults.hooks||new ia;for(let r in e.hooks){if(!(r in n))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let a=r,c=e.hooks[a],h=n[a];ia.passThroughHooks.has(r)?n[a]=g=>{if(this.defaults.async&&ia.passThroughHooksRespectAsync.has(r))return te(this,null,function*(){let S=yield c.call(n,g);return h.call(n,S)});let y=c.call(n,g);return h.call(n,y)}:n[a]=(...g)=>{if(this.defaults.async)return te(this,null,function*(){let S=yield c.apply(n,g);return S===!1&&(S=yield h.apply(n,g)),S});let y=c.apply(n,g);return y===!1&&(y=h.apply(n,g)),y}}i.hooks=n}if(e.walkTokens){let n=this.defaults.walkTokens,r=e.walkTokens;i.walkTokens=function(a){let c=[];return c.push(r.call(this,a)),n&&(c=c.concat(n.call(this,a))),c}}this.defaults=Z(Z({},this.defaults),i)}),this}setOptions(o){return this.defaults=Z(Z({},this.defaults),o),this}lexer(o,t){return xi.lex(o,t??this.defaults)}parser(o,t){return wi.parse(o,t??this.defaults)}parseMarkdown(o){return(t,e)=>{let i=Z({},e),n=Z(Z({},this.defaults),i),r=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&i.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 t>"u"||t===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=o),n.async)return te(this,null,function*(){let a=n.hooks?yield n.hooks.preprocess(t):t,c=yield(n.hooks?yield n.hooks.provideLexer():o?xi.lex:xi.lexInline)(a,n),h=n.hooks?yield n.hooks.processAllTokens(c):c;n.walkTokens&&(yield Promise.all(this.walkTokens(h,n.walkTokens)));let g=yield(n.hooks?yield n.hooks.provideParser():o?wi.parse:wi.parseInline)(h,n);return n.hooks?yield n.hooks.postprocess(g):g}).catch(r);try{n.hooks&&(t=n.hooks.preprocess(t));let a=(n.hooks?n.hooks.provideLexer():o?xi.lex:xi.lexInline)(t,n);n.hooks&&(a=n.hooks.processAllTokens(a)),n.walkTokens&&this.walkTokens(a,n.walkTokens);let c=(n.hooks?n.hooks.provideParser():o?wi.parse:wi.parseInline)(a,n);return n.hooks&&(c=n.hooks.postprocess(c)),c}catch(a){return r(a)}}}onError(o,t){return e=>{if(e.message+=`
66
66
  Please report this to https://github.com/markedjs/marked.`,o){let i="<p>An error occurred:</p><pre>"+Ui(e.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(e);throw e}}},po=new $_;function Ae(o,t){return po.parse(o,t)}Ae.options=Ae.setOptions=function(o){return po.setOptions(o),Ae.defaults=po.defaults,Ph(Ae.defaults),Ae};Ae.getDefaults=Xc;Ae.defaults=ho;Ae.use=function(...o){return po.use(...o),Ae.defaults=po.defaults,Ph(Ae.defaults),Ae};Ae.walkTokens=function(o,t){return po.walkTokens(o,t)};Ae.parseInline=po.parseInline;Ae.Parser=wi;Ae.parser=wi.parse;Ae.Renderer=Zo;Ae.TextRenderer=od;Ae.Lexer=xi;Ae.lexer=xi.lex;Ae.Tokenizer=js;Ae.Hooks=ia;Ae.parse=Ae;var Ak=Ae.options,Ik=Ae.setOptions,Dk=Ae.use,Rk=Ae.walkTokens,Fk=Ae.parseInline;var Nk=wi.parse,Lk=xi.lex;var{entries:Yh,setPrototypeOf:jh,isFrozen:q_,getPrototypeOf:G_,getOwnPropertyDescriptor:Y_}=Object,{freeze:zt,seal:si,create:md}=Object,{apply:pd,construct:hd}=typeof Reflect<"u"&&Reflect;zt||(zt=function(t){return t});si||(si=function(t){return t});pd||(pd=function(t,e){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return t.apply(e,n)});hd||(hd=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return new t(...i)});var Us=jt(Array.prototype.forEach),Q_=jt(Array.prototype.lastIndexOf),Bh=jt(Array.prototype.pop),ra=jt(Array.prototype.push),X_=jt(Array.prototype.splice),$s=jt(String.prototype.toLowerCase),rd=jt(String.prototype.toString),ad=jt(String.prototype.match),aa=jt(String.prototype.replace),K_=jt(String.prototype.indexOf),Z_=jt(String.prototype.trim),Si=jt(Object.prototype.hasOwnProperty),Vt=jt(RegExp.prototype.test),sa=J_(TypeError);function jt(o){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return pd(o,t,i)}}function J_(o){return function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return hd(o,e)}}function ge(o,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$s;jh&&jh(o,null);let i=t.length;for(;i--;){let n=t[i];if(typeof n=="string"){let r=e(n);r!==n&&(q_(t)||(t[i]=r),n=r)}o[n]=!0}return o}function eb(o){for(let t=0;t<o.length;t++)Si(o,t)||(o[t]=null);return o}function Wi(o){let t=md(null);for(let[e,i]of Yh(o))Si(o,e)&&(Array.isArray(i)?t[e]=eb(i):i&&typeof i=="object"&&i.constructor===Object?t[e]=Wi(i):t[e]=i);return t}function la(o,t){for(;o!==null;){let i=Y_(o,t);if(i){if(i.get)return jt(i.get);if(typeof i.value=="function")return jt(i.value)}o=G_(o)}function e(){return null}return e}var Hh=zt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),sd=zt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ld=zt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),tb=zt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),cd=zt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ib=zt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Uh=zt(["#text"]),Wh=zt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),dd=zt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$h=zt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ws=zt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),nb=si(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ob=si(/<%[\w\W]*|[\w\W]*%>/gm),rb=si(/\$\{[\w\W]*/gm),ab=si(/^data-[\-\w.\u00B7-\uFFFF]+$/),sb=si(/^aria-[\-\w]+$/),Qh=si(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),lb=si(/^(?:\w+script|data):/i),cb=si(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Xh=si(/^html$/i),db=si(/^[a-z][.\w]*(-[.\w]+)+$/i),qh=Object.freeze({__proto__:null,ARIA_ATTR:sb,ATTR_WHITESPACE:cb,CUSTOM_ELEMENT:db,DATA_ATTR:ab,DOCTYPE_NAME:Xh,ERB_EXPR:ob,IS_ALLOWED_URI:Qh,IS_SCRIPT_OR_DATA:lb,MUSTACHE_EXPR:nb,TMPLIT_EXPR:rb}),ca={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},mb=function(){return typeof window>"u"?null:window},pb=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,n="data-tt-policy-suffix";e&&e.hasAttribute(n)&&(i=e.getAttribute(n));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Gh=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Kh(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mb(),t=Q=>Kh(Q);if(t.version="3.3.1",t.removed=[],!o||!o.document||o.document.nodeType!==ca.document||!o.Element)return t.isSupported=!1,t;let{document:e}=o,i=e,n=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:a,Node:c,Element:h,NodeFilter:g,NamedNodeMap:y=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:S,DOMParser:A,trustedTypes:F}=o,T=h.prototype,B=la(T,"cloneNode"),_e=la(T,"remove"),Le=la(T,"nextSibling"),G=la(T,"childNodes"),fe=la(T,"parentNode");if(typeof a=="function"){let Q=e.createElement("template");Q.content&&Q.content.ownerDocument&&(e=Q.content.ownerDocument)}let re,it="",{implementation:De,createNodeIterator:Je,createDocumentFragment:wt,getElementsByTagName:Zi}=e,{importNode:wn}=i,ft=Gh();t.isSupported=typeof Yh=="function"&&typeof fe=="function"&&De&&De.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:pi,ERB_EXPR:Wn,TMPLIT_EXPR:xo,DATA_ATTR:ka,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:Y,ATTR_WHITESPACE:K,CUSTOM_ELEMENT:be}=qh,{IS_ALLOWED_URI:st}=qh,Ie=null,St=ge({},[...Hh,...sd,...ld,...cd,...Uh]),Ve=null,ze=ge({},[...Wh,...dd,...$h,...Ws]),qe=Object.seal(md(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$n=null,ct=null,Wt=Object.seal(md(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Dt=!0,Sn=!0,wo=!1,Bd=!0,So=!1,Ma=!0,qn=!1,Vl=!1,zl=!1,ko=!1,Ta=!1,Ea=!1,Hd=!0,Ud=!1,Tg="user-content-",jl=!0,Pr=!1,Mo={},Pi=null,Bl=ge({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Wd=null,$d=ge({},["audio","video","img","source","image","track"]),Hl=null,qd=ge({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pa="http://www.w3.org/1998/Math/MathML",Oa="http://www.w3.org/2000/svg",Ji="http://www.w3.org/1999/xhtml",To=Ji,Ul=!1,Wl=null,Eg=ge({},[Pa,Oa,Ji],rd),Aa=ge({},["mi","mo","mn","ms","mtext"]),Ia=ge({},["annotation-xml"]),Pg=ge({},["title","style","font","a","script"]),Or=null,Og=["application/xhtml+xml","text/html"],Ag="text/html",ht=null,Eo=null,Ig=e.createElement("form"),Gd=function(_){return _ instanceof RegExp||_ instanceof Function},$l=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Eo&&Eo===_)){if((!_||typeof _!="object")&&(_={}),_=Wi(_),Or=Og.indexOf(_.PARSER_MEDIA_TYPE)===-1?Ag:_.PARSER_MEDIA_TYPE,ht=Or==="application/xhtml+xml"?rd:$s,Ie=Si(_,"ALLOWED_TAGS")?ge({},_.ALLOWED_TAGS,ht):St,Ve=Si(_,"ALLOWED_ATTR")?ge({},_.ALLOWED_ATTR,ht):ze,Wl=Si(_,"ALLOWED_NAMESPACES")?ge({},_.ALLOWED_NAMESPACES,rd):Eg,Hl=Si(_,"ADD_URI_SAFE_ATTR")?ge(Wi(qd),_.ADD_URI_SAFE_ATTR,ht):qd,Wd=Si(_,"ADD_DATA_URI_TAGS")?ge(Wi($d),_.ADD_DATA_URI_TAGS,ht):$d,Pi=Si(_,"FORBID_CONTENTS")?ge({},_.FORBID_CONTENTS,ht):Bl,$n=Si(_,"FORBID_TAGS")?ge({},_.FORBID_TAGS,ht):Wi({}),ct=Si(_,"FORBID_ATTR")?ge({},_.FORBID_ATTR,ht):Wi({}),Mo=Si(_,"USE_PROFILES")?_.USE_PROFILES:!1,Dt=_.ALLOW_ARIA_ATTR!==!1,Sn=_.ALLOW_DATA_ATTR!==!1,wo=_.ALLOW_UNKNOWN_PROTOCOLS||!1,Bd=_.ALLOW_SELF_CLOSE_IN_ATTR!==!1,So=_.SAFE_FOR_TEMPLATES||!1,Ma=_.SAFE_FOR_XML!==!1,qn=_.WHOLE_DOCUMENT||!1,ko=_.RETURN_DOM||!1,Ta=_.RETURN_DOM_FRAGMENT||!1,Ea=_.RETURN_TRUSTED_TYPE||!1,zl=_.FORCE_BODY||!1,Hd=_.SANITIZE_DOM!==!1,Ud=_.SANITIZE_NAMED_PROPS||!1,jl=_.KEEP_CONTENT!==!1,Pr=_.IN_PLACE||!1,st=_.ALLOWED_URI_REGEXP||Qh,To=_.NAMESPACE||Ji,Aa=_.MATHML_TEXT_INTEGRATION_POINTS||Aa,Ia=_.HTML_INTEGRATION_POINTS||Ia,qe=_.CUSTOM_ELEMENT_HANDLING||{},_.CUSTOM_ELEMENT_HANDLING&&Gd(_.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(qe.tagNameCheck=_.CUSTOM_ELEMENT_HANDLING.tagNameCheck),_.CUSTOM_ELEMENT_HANDLING&&Gd(_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(qe.attributeNameCheck=_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),_.CUSTOM_ELEMENT_HANDLING&&typeof _.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(qe.allowCustomizedBuiltInElements=_.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),So&&(Sn=!1),Ta&&(ko=!0),Mo&&(Ie=ge({},Uh),Ve=[],Mo.html===!0&&(ge(Ie,Hh),ge(Ve,Wh)),Mo.svg===!0&&(ge(Ie,sd),ge(Ve,dd),ge(Ve,Ws)),Mo.svgFilters===!0&&(ge(Ie,ld),ge(Ve,dd),ge(Ve,Ws)),Mo.mathMl===!0&&(ge(Ie,cd),ge(Ve,$h),ge(Ve,Ws))),_.ADD_TAGS&&(typeof _.ADD_TAGS=="function"?Wt.tagCheck=_.ADD_TAGS:(Ie===St&&(Ie=Wi(Ie)),ge(Ie,_.ADD_TAGS,ht))),_.ADD_ATTR&&(typeof _.ADD_ATTR=="function"?Wt.attributeCheck=_.ADD_ATTR:(Ve===ze&&(Ve=Wi(Ve)),ge(Ve,_.ADD_ATTR,ht))),_.ADD_URI_SAFE_ATTR&&ge(Hl,_.ADD_URI_SAFE_ATTR,ht),_.FORBID_CONTENTS&&(Pi===Bl&&(Pi=Wi(Pi)),ge(Pi,_.FORBID_CONTENTS,ht)),_.ADD_FORBID_CONTENTS&&(Pi===Bl&&(Pi=Wi(Pi)),ge(Pi,_.ADD_FORBID_CONTENTS,ht)),jl&&(Ie["#text"]=!0),qn&&ge(Ie,["html","head","body"]),Ie.table&&(ge(Ie,["tbody"]),delete $n.tbody),_.TRUSTED_TYPES_POLICY){if(typeof _.TRUSTED_TYPES_POLICY.createHTML!="function")throw sa('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof _.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw sa('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');re=_.TRUSTED_TYPES_POLICY,it=re.createHTML("")}else re===void 0&&(re=pb(F,n)),re!==null&&typeof it=="string"&&(it=re.createHTML(""));zt&&zt(_),Eo=_}},Yd=ge({},[...sd,...ld,...tb]),Qd=ge({},[...cd,...ib]),Dg=function(_){let P=fe(_);(!P||!P.tagName)&&(P={namespaceURI:To,tagName:"template"});let q=$s(_.tagName),Ge=$s(P.tagName);return Wl[_.namespaceURI]?_.namespaceURI===Oa?P.namespaceURI===Ji?q==="svg":P.namespaceURI===Pa?q==="svg"&&(Ge==="annotation-xml"||Aa[Ge]):!!Yd[q]:_.namespaceURI===Pa?P.namespaceURI===Ji?q==="math":P.namespaceURI===Oa?q==="math"&&Ia[Ge]:!!Qd[q]:_.namespaceURI===Ji?P.namespaceURI===Oa&&!Ia[Ge]||P.namespaceURI===Pa&&!Aa[Ge]?!1:!Qd[q]&&(Pg[q]||!Yd[q]):!!(Or==="application/xhtml+xml"&&Wl[_.namespaceURI]):!1},Oi=function(_){ra(t.removed,{element:_});try{fe(_).removeChild(_)}catch{_e(_)}},Gn=function(_,P){try{ra(t.removed,{attribute:P.getAttributeNode(_),from:P})}catch{ra(t.removed,{attribute:null,from:P})}if(P.removeAttribute(_),_==="is")if(ko||Ta)try{Oi(P)}catch{}else try{P.setAttribute(_,"")}catch{}},Xd=function(_){let P=null,q=null;if(zl)_="<remove></remove>"+_;else{let dt=ad(_,/^[\r\n\t ]+/);q=dt&&dt[0]}Or==="application/xhtml+xml"&&To===Ji&&(_='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+_+"</body></html>");let Ge=re?re.createHTML(_):_;if(To===Ji)try{P=new A().parseFromString(Ge,Or)}catch{}if(!P||!P.documentElement){P=De.createDocument(To,"template",null);try{P.documentElement.innerHTML=Ul?it:Ge}catch{}}let kt=P.body||P.documentElement;return _&&q&&kt.insertBefore(e.createTextNode(q),kt.childNodes[0]||null),To===Ji?Zi.call(P,qn?"html":"body")[0]:qn?P.documentElement:kt},Kd=function(_){return Je.call(_.ownerDocument||_,_,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},ql=function(_){return _ instanceof S&&(typeof _.nodeName!="string"||typeof _.textContent!="string"||typeof _.removeChild!="function"||!(_.attributes instanceof y)||typeof _.removeAttribute!="function"||typeof _.setAttribute!="function"||typeof _.namespaceURI!="string"||typeof _.insertBefore!="function"||typeof _.hasChildNodes!="function")},Zd=function(_){return typeof c=="function"&&_ instanceof c};function en(Q,_,P){Us(Q,q=>{q.call(t,_,P,Eo)})}let Jd=function(_){let P=null;if(en(ft.beforeSanitizeElements,_,null),ql(_))return Oi(_),!0;let q=ht(_.nodeName);if(en(ft.uponSanitizeElement,_,{tagName:q,allowedTags:Ie}),Ma&&_.hasChildNodes()&&!Zd(_.firstElementChild)&&Vt(/<[/\w!]/g,_.innerHTML)&&Vt(/<[/\w!]/g,_.textContent)||_.nodeType===ca.progressingInstruction||Ma&&_.nodeType===ca.comment&&Vt(/<[/\w]/g,_.data))return Oi(_),!0;if(!(Wt.tagCheck instanceof Function&&Wt.tagCheck(q))&&(!Ie[q]||$n[q])){if(!$n[q]&&tm(q)&&(qe.tagNameCheck instanceof RegExp&&Vt(qe.tagNameCheck,q)||qe.tagNameCheck instanceof Function&&qe.tagNameCheck(q)))return!1;if(jl&&!Pi[q]){let Ge=fe(_)||_.parentNode,kt=G(_)||_.childNodes;if(kt&&Ge){let dt=kt.length;for(let $t=dt-1;$t>=0;--$t){let tn=B(kt[$t],!0);tn.__removalCount=(_.__removalCount||0)+1,Ge.insertBefore(tn,Le(_))}}}return Oi(_),!0}return _ instanceof h&&!Dg(_)||(q==="noscript"||q==="noembed"||q==="noframes")&&Vt(/<\/no(script|embed|frames)/i,_.innerHTML)?(Oi(_),!0):(So&&_.nodeType===ca.text&&(P=_.textContent,Us([pi,Wn,xo],Ge=>{P=aa(P,Ge," ")}),_.textContent!==P&&(ra(t.removed,{element:_.cloneNode()}),_.textContent=P)),en(ft.afterSanitizeElements,_,null),!1)},em=function(_,P,q){if(Hd&&(P==="id"||P==="name")&&(q in e||q in Ig))return!1;if(!(Sn&&!ct[P]&&Vt(ka,P))){if(!(Dt&&Vt($,P))){if(!(Wt.attributeCheck instanceof Function&&Wt.attributeCheck(P,_))){if(!Ve[P]||ct[P]){if(!(tm(_)&&(qe.tagNameCheck instanceof RegExp&&Vt(qe.tagNameCheck,_)||qe.tagNameCheck instanceof Function&&qe.tagNameCheck(_))&&(qe.attributeNameCheck instanceof RegExp&&Vt(qe.attributeNameCheck,P)||qe.attributeNameCheck instanceof Function&&qe.attributeNameCheck(P,_))||P==="is"&&qe.allowCustomizedBuiltInElements&&(qe.tagNameCheck instanceof RegExp&&Vt(qe.tagNameCheck,q)||qe.tagNameCheck instanceof Function&&qe.tagNameCheck(q))))return!1}else if(!Hl[P]){if(!Vt(st,aa(q,K,""))){if(!((P==="src"||P==="xlink:href"||P==="href")&&_!=="script"&&K_(q,"data:")===0&&Wd[_])){if(!(wo&&!Vt(Y,aa(q,K,"")))){if(q)return!1}}}}}}}return!0},tm=function(_){return _!=="annotation-xml"&&ad(_,be)},im=function(_){en(ft.beforeSanitizeAttributes,_,null);let{attributes:P}=_;if(!P||ql(_))return;let q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ve,forceKeepAttr:void 0},Ge=P.length;for(;Ge--;){let kt=P[Ge],{name:dt,namespaceURI:$t,value:tn}=kt,Po=ht(dt),Gl=tn,vt=dt==="value"?Gl:Z_(Gl);if(q.attrName=Po,q.attrValue=vt,q.keepAttr=!0,q.forceKeepAttr=void 0,en(ft.uponSanitizeAttribute,_,q),vt=q.attrValue,Ud&&(Po==="id"||Po==="name")&&(Gn(dt,_),vt=Tg+vt),Ma&&Vt(/((--!?|])>)|<\/(style|title|textarea)/i,vt)){Gn(dt,_);continue}if(Po==="attributename"&&ad(vt,"href")){Gn(dt,_);continue}if(q.forceKeepAttr)continue;if(!q.keepAttr){Gn(dt,_);continue}if(!Bd&&Vt(/\/>/i,vt)){Gn(dt,_);continue}So&&Us([pi,Wn,xo],om=>{vt=aa(vt,om," ")});let nm=ht(_.nodeName);if(!em(nm,Po,vt)){Gn(dt,_);continue}if(re&&typeof F=="object"&&typeof F.getAttributeType=="function"&&!$t)switch(F.getAttributeType(nm,Po)){case"TrustedHTML":{vt=re.createHTML(vt);break}case"TrustedScriptURL":{vt=re.createScriptURL(vt);break}}if(vt!==Gl)try{$t?_.setAttributeNS($t,dt,vt):_.setAttribute(dt,vt),ql(_)?Oi(_):Bh(t.removed)}catch{Gn(dt,_)}}en(ft.afterSanitizeAttributes,_,null)},Rg=function Q(_){let P=null,q=Kd(_);for(en(ft.beforeSanitizeShadowDOM,_,null);P=q.nextNode();)en(ft.uponSanitizeShadowNode,P,null),Jd(P),im(P),P.content instanceof r&&Q(P.content);en(ft.afterSanitizeShadowDOM,_,null)};return t.sanitize=function(Q){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=null,q=null,Ge=null,kt=null;if(Ul=!Q,Ul&&(Q="<!-->"),typeof Q!="string"&&!Zd(Q))if(typeof Q.toString=="function"){if(Q=Q.toString(),typeof Q!="string")throw sa("dirty is not a string, aborting")}else throw sa("toString is not a function");if(!t.isSupported)return Q;if(Vl||$l(_),t.removed=[],typeof Q=="string"&&(Pr=!1),Pr){if(Q.nodeName){let tn=ht(Q.nodeName);if(!Ie[tn]||$n[tn])throw sa("root node is forbidden and cannot be sanitized in-place")}}else if(Q instanceof c)P=Xd("<!---->"),q=P.ownerDocument.importNode(Q,!0),q.nodeType===ca.element&&q.nodeName==="BODY"||q.nodeName==="HTML"?P=q:P.appendChild(q);else{if(!ko&&!So&&!qn&&Q.indexOf("<")===-1)return re&&Ea?re.createHTML(Q):Q;if(P=Xd(Q),!P)return ko?null:Ea?it:""}P&&zl&&Oi(P.firstChild);let dt=Kd(Pr?Q:P);for(;Ge=dt.nextNode();)Jd(Ge),im(Ge),Ge.content instanceof r&&Rg(Ge.content);if(Pr)return Q;if(ko){if(Ta)for(kt=wt.call(P.ownerDocument);P.firstChild;)kt.appendChild(P.firstChild);else kt=P;return(Ve.shadowroot||Ve.shadowrootmode)&&(kt=wn.call(i,kt,!0)),kt}let $t=qn?P.outerHTML:P.innerHTML;return qn&&Ie["!doctype"]&&P.ownerDocument&&P.ownerDocument.doctype&&P.ownerDocument.doctype.name&&Vt(Xh,P.ownerDocument.doctype.name)&&($t="<!DOCTYPE "+P.ownerDocument.doctype.name+`>
67
- `+$t),So&&Us([pi,Wn,xo],tn=>{$t=aa($t,tn," ")}),re&&Ea?re.createHTML($t):$t},t.setConfig=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$l(Q),Vl=!0},t.clearConfig=function(){Eo=null,Vl=!1},t.isValidAttribute=function(Q,_,P){Eo||$l({});let q=ht(Q),Ge=ht(_);return em(q,Ge,P)},t.addHook=function(Q,_){typeof _=="function"&&ra(ft[Q],_)},t.removeHook=function(Q,_){if(_!==void 0){let P=Q_(ft[Q],_);return P===-1?void 0:X_(ft[Q],P,1)[0]}return Bh(ft[Q])},t.removeHooks=function(Q){ft[Q]=[]},t.removeAllHooks=function(){ft=Gh()},t}var Zh=Kh();var $i=class o{renderer;constructor(){this.renderer=new Zo,this.configureRenderer()}configureRenderer(){let t=this.renderer.link.bind(this.renderer);this.renderer.link=e=>{let i=this.isExternalLink(e.href),n=t(e);if(i){n=n.replace("<a ",'<a target="_blank" rel="noopener noreferrer" ');let r=e.title?`${e.text} - ${e.title} (opens in new tab)`:`${e.text} (opens in new tab)`;n=n.replace("<a ",`<a aria-label="${this.escapeHtml(r)}" `),n=n.replace("</a>",'<span class="external-link-icon" aria-hidden="true">\u2197</span></a>')}return n}}isExternalLink(t){if(!t||t.startsWith("/")||t.startsWith("#")||t.startsWith("?"))return!1;if(t.startsWith("//"))return!0;try{return new URL(t,window.location.href).hostname!==window.location.hostname}catch{return!1}}escapeHtml(t){let e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return t.replace(/[&<>"']/g,i=>e[i]||i)}parse(t){return te(this,null,function*(){let e=yield Ae.parse(t,{renderer:this.renderer,breaks:!0,gfm:!0});return Zh.sanitize(e,{ADD_TAGS:["span"],ADD_ATTR:["aria-hidden","aria-label","target","rel"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i})})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var hb=["buttonContainer"],ub=["freeTextInput"],gb=(o,t)=>t.value;function fb(o,t){o&1&&(s(0,"mat-icon",10),p(1,"keyboard_return"),l())}function _b(o,t){if(o&1){let e=k();s(0,"button",8),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.onOptionClick(n.value))}),s(1,"span",9),p(2),l(),C(3,fb,2,0,"mat-icon",10),l()}if(o&2){let e=t.$implicit,i=t.$index,n=u(2);E("highlighted",i===n.highlightedIndex),w("disabled",e.disabled)("id","choice-option-"+i),J("aria-selected",i===n.highlightedIndex),d(2),O(e.label),d(),x(i===n.highlightedIndex?3:-1)}}function bb(o,t){if(o&1){let e=k();s(0,"div",6)(1,"span",11),p(2,"Or type your own answer:"),l(),s(3,"div",12)(4,"input",13,1),j("ngModelChange",function(n){b(e);let r=u(2);return z(r.freeTextValue,n)||(r.freeTextValue=n),v(n)}),f("keydown",function(n){b(e);let r=u(2);return v(r.onFreeTextKeyDown(n))}),l(),s(6,"button",14),f("click",function(){b(e);let n=u(2);return v(n.onFreeTextSubmit())}),s(7,"mat-icon"),p(8,"send"),l()()()()}if(o&2){let e=u(2);d(4),V("ngModel",e.freeTextValue),d(2),w("disabled",!e.freeTextValue.trim())}}function vb(o,t){if(o&1&&(s(0,"div",7)(1,"mat-icon"),p(2,"search"),l(),s(3,"span"),p(4),l()()),o&2){let e=u(2);d(4),O(e.searchText)}}function yb(o,t){if(o&1){let e=k();s(0,"div",2),I(1,"div",3),io(2,"async"),s(3,"div",4,0),f("keydown",function(n){b(e);let r=u();return v(r.onKeyDown(n))}),we(5,_b,4,7,"button",5,gb),l(),C(7,bb,9,2,"div",6),C(8,vb,5,1,"div",7),l()}if(o&2){let e=u();d(),w("innerHTML",wm(2,4,e.renderedLabel$),Zt),d(2),J("aria-activedescendant","choice-option-"+e.highlightedIndex),d(2),Se(e.options),d(2),x(e.allowFreeText?7:-1),d(),x(e.searchText?8:-1)}}var Jo=class o{options=[];allowFreeText=!1;set labelHtml(t){typeof t=="object"?this.renderedLabelSubject.next(t):this.renderLabelMarkdown(t)}isVisible=!1;choiceSelected=new H;buttonContainer;freeTextInput;highlightedIndex=0;searchText="";freeTextValue="";searchTimeout;destroy$=new R;renderedLabelSubject=new ce("");renderedLabel$=this.renderedLabelSubject.asObservable();sanitizer=m(Ri);markdownService=m($i);ngOnDestroy(){this.renderedLabelSubject.complete(),this.destroy$.next(),this.destroy$.complete(),this.searchTimeout&&clearTimeout(this.searchTimeout)}ngAfterViewInit(){this.isVisible&&this.buttonContainer&&setTimeout(()=>this.focusContainer(),100)}ngOnChanges(t){t.isVisible&&t.isVisible.currentValue&&!t.isVisible.previousValue&&(this.highlightedIndex=0,setTimeout(()=>this.focusContainer(),150)),t.options&&!t.options.firstChange&&(this.highlightedIndex=0,this.searchText="",this.freeTextValue="")}focusContainer(){this.buttonContainer?.nativeElement&&this.buttonContainer.nativeElement.focus()}onKeyDown(t){if(this.options.filter(i=>!i.disabled).length!==0)switch(t.key){case"ArrowDown":t.preventDefault(),this.moveHighlight(1);break;case"ArrowUp":t.preventDefault(),this.moveHighlight(-1);break;case"Enter":case" ":t.preventDefault(),this.selectHighlighted();break;case"Home":t.preventDefault(),this.highlightFirst();break;case"End":t.preventDefault(),this.highlightLast();break;case"Escape":t.preventDefault();break;default:t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&this.handleTypeAhead(t.key);break}}moveHighlight(t){let e=this.options.map((r,a)=>({opt:r,idx:a})).filter(({opt:r})=>!r.disabled).map(({idx:r})=>r);if(e.length===0)return;let n=e.findIndex(r=>r===this.highlightedIndex)+t;if(n>=0&&n<e.length){let r=e[n];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}else if(t===1&&n>=e.length){let r=e[0];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}else if(t===-1&&n<0){let r=e[e.length-1];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}}highlightFirst(){let t=this.options.findIndex(e=>!e.disabled);t>=0&&(this.highlightedIndex=t,this.scrollToHighlighted())}highlightLast(){let t=this.options.map((e,i)=>({opt:e,idx:i})).filter(({opt:e})=>!e.disabled).map(({idx:e})=>e);if(t.length>0){let e=t[t.length-1];e!==void 0&&(this.highlightedIndex=e,this.scrollToHighlighted())}}scrollToHighlighted(){setTimeout(()=>{let t=document.getElementById("choice-option-"+this.highlightedIndex);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})},0)}selectHighlighted(){let t=this.options[this.highlightedIndex];t&&!t.disabled&&this.onOptionClick(t.value)}handleTypeAhead(t){this.searchText+=t.toLowerCase();let e=this.options.findIndex(i=>!i.disabled&&i.label.toLowerCase().startsWith(this.searchText));e>=0&&(this.highlightedIndex=e,this.scrollToHighlighted()),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchText=""},1e3)}onOptionClick(t){this.choiceSelected.emit(t)}onFreeTextSubmit(){let t=this.freeTextValue.trim();t&&(this.freeTextValue="",this.choiceSelected.emit(t))}onFreeTextKeyDown(t){t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),this.onFreeTextSubmit())}renderLabelMarkdown(t){return te(this,null,function*(){if(!t){this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(""));return}try{let e=yield this.markdownService.parse(t);this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(e))}catch(e){console.error("[CHOICE-SELECT] Error parsing label markdown:",e),this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(t))}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-choice-select"]],viewQuery:function(e,i){if(e&1&&(X(hb,5),X(ub,5)),e&2){let n;U(n=W())&&(i.buttonContainer=n.first),U(n=W())&&(i.freeTextInput=n.first)}},inputs:{options:"options",allowFreeText:"allowFreeText",labelHtml:"labelHtml",isVisible:"isVisible"},outputs:{choiceSelected:"choiceSelected"},features:[nt],decls:1,vars:1,consts:[["buttonContainer",""],["freeTextInput",""],[1,"choice-container"],[1,"choice-label",3,"innerHTML"],["role","listbox","tabindex","0",1,"choice-buttons",3,"keydown"],["type","button","role","option",1,"choice-button",3,"highlighted","disabled","id"],[1,"free-text-section"],[1,"search-indicator"],["type","button","role","option",1,"choice-button",3,"click","disabled","id"],[1,"choice-button-label"],[1,"choice-button-icon"],[1,"free-text-hint"],[1,"free-text-input-row"],["type","text","placeholder","Type a custom answer\u2026","aria-label","Custom answer",1,"free-text-input",3,"ngModelChange","keydown","ngModel"],["type","button","aria-label","Send custom answer",1,"free-text-send-btn",3,"click","disabled"]],template:function(e,i){e&1&&C(0,yb,9,6,"div",2),e&2&&x(i.isVisible?0:-1)},dependencies:[Me,he,Ue,je,Be,He,Pm],styles:[".choice-container[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:1rem}.choice-label[_ngcontent-%COMP%]{display:block;font-weight:500;color:var(--color-text);font-size:1rem;line-height:1.5}.choice-label[_ngcontent-%COMP%] p{margin:0 0 .5rem}.choice-label[_ngcontent-%COMP%] p:last-child{margin-bottom:0}.choice-label[_ngcontent-%COMP%] code{background:var(--color-code-bg);padding:.2em .4em;border-radius:4px;font-family:monospace;font-size:.9em}.choice-label[_ngcontent-%COMP%] strong{font-weight:600}.choice-buttons[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;max-height:400px;overflow-y:auto;padding:.5rem;background:var(--color-background);border:2px solid var(--color-border);border-radius:12px;outline:none}.choice-buttons[_ngcontent-%COMP%]:focus-within{border-color:var(--color-primary);box-shadow:0 0 0 3px #007aff1a}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:var(--color-background);border-radius:4px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.choice-button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:100%;padding:.75rem 1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-background);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;font-size:1rem;text-align:left;cursor:pointer;transition:all .2s ease}.choice-button[_ngcontent-%COMP%]:hover:not(:disabled):not(.highlighted){background:var(--color-bg-hover);border-color:var(--color-primary);transform:translate(2px)}.choice-button.highlighted[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff;border-color:var(--color-primary);box-shadow:0 2px 8px #007aff4d}.choice-button.highlighted[_ngcontent-%COMP%] .choice-button-icon[_ngcontent-%COMP%]{color:#fff}.choice-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.choice-button[_ngcontent-%COMP%]:focus{outline:none}.choice-button-label[_ngcontent-%COMP%]{flex:1;line-height:1.5}.choice-button-icon[_ngcontent-%COMP%]{flex-shrink:0;margin-left:.5rem;font-size:1.2rem;width:1.2rem;height:1.2rem}.free-text-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.free-text-hint[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.free-text-input-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.free-text-input[_ngcontent-%COMP%]{flex:1;padding:.625rem .875rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-background);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;font-size:1rem;outline:none;transition:border-color .2s ease,box-shadow .2s ease}.free-text-input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px #007aff1a}.free-text-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.7}.free-text-send-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;flex-shrink:0;border:none;border-radius:8px;background:var(--color-primary);color:#fff;cursor:pointer;transition:background .2s ease,opacity .2s ease}.free-text-send-btn[_ngcontent-%COMP%]:hover:not(:disabled){opacity:.9}.free-text-send-btn[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.free-text-send-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.2rem;width:1.2rem;height:1.2rem}.search-indicator[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;background:var(--color-primary);color:#fff;border-radius:8px;font-size:.9rem;font-weight:500;animation:_ngcontent-%COMP%_fadeIn .2s ease}.search-indicator[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;color:#fff}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 480px){.choice-container[_ngcontent-%COMP%]{gap:.75rem}.choice-label[_ngcontent-%COMP%]{font-size:.95rem}.choice-buttons[_ngcontent-%COMP%]{max-height:300px;gap:.375rem}.choice-button[_ngcontent-%COMP%]{font-size:.95rem;padding:.625rem .875rem}}@media print{.choice-buttons[_ngcontent-%COMP%]{max-height:none;overflow:visible}.search-indicator[_ngcontent-%COMP%]{display:none!important}}"]})};var er=class o{welcomeMessages=["Welcome to Coday","Bienvenue sur Coday","Bienvenido a Coday","Willkommen bei Coday","Benvenuto su Coday","Bem-vindo ao Coday","Welkom bij Coday","\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C \u0432 Coday","Coday \u3078\u3088\u3046\u3053\u305D","\u6B22\u8FCE\u6765\u5230 Coday","Coday \uC5D0 \uC624\uC2E0 \uAC83\uC744 \uD658\uC601\uD569\uB2C8\uB2E4","\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0643 \u0641\u064A Coday"];currentWelcomeIndex=0;currentWelcomeMessage=this.welcomeMessages[0];welcomeRotationInterval;ngOnInit(){this.startWelcomeRotation()}ngOnDestroy(){this.stopWelcomeRotation()}startWelcomeRotation(){this.welcomeRotationInterval=window.setInterval(()=>{this.currentWelcomeIndex=(this.currentWelcomeIndex+1)%this.welcomeMessages.length,this.currentWelcomeMessage=this.welcomeMessages[this.currentWelcomeIndex]},3e3)}stopWelcomeRotation(){this.welcomeRotationInterval&&(clearInterval(this.welcomeRotationInterval),this.welcomeRotationInterval=void 0)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(e,i){e&1&&(ii(0,"h1",0),p(1),ni()),e&2&&(d(),O(i.currentWelcomeMessage))},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,4rem);font-weight:700;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite;margin:0;padding:0;line-height:1.2;transition:opacity .5s ease-in-out;display:block;min-height:1.2em;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"]})};var Cb=["inputElement"];function xb(o,t){if(o&1&&(s(0,"span",3),p(1),l()),o&2){let e=u();d(),O(e.label)}}function wb(o,t){if(o&1&&(s(0,"small",5),p(1),l()),o&2){let e=u();d(),O(e.hint)}}var qs=class o{label="";placeholder="";hint="";isDisabled=!1;value="";autoFocus=!0;valueChange=new H;enterPressed=new H;inputElement;inputValue="";ngAfterViewInit(){this.inputValue=this.value,this.autoFocus&&setTimeout(()=>this.inputElement?.nativeElement.focus(),100)}onValueChange(t){this.valueChange.emit(t)}onEnter(){this.inputValue.trim()&&this.enterPressed.emit(this.inputValue.trim())}focus(){this.inputElement?.nativeElement.focus()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-text-input"]],viewQuery:function(e,i){if(e&1&&X(Cb,5),e&2){let n;U(n=W())&&(i.inputElement=n.first)}},inputs:{label:"label",placeholder:"placeholder",hint:"hint",isDisabled:"isDisabled",value:"value",autoFocus:"autoFocus"},outputs:{valueChange:"valueChange",enterPressed:"enterPressed"},decls:6,vars:5,consts:[["inputElement",""],[1,"text-input-container"],[1,"text-input-wrapper"],[1,"text-input-label"],["type","text",1,"text-input-field",3,"ngModelChange","keydown.enter","ngModel","placeholder","disabled"],[1,"text-input-hint"]],template:function(e,i){if(e&1){let n=k();s(0,"div",1)(1,"label",2),C(2,xb,2,1,"span",3),s(3,"input",4,0),j("ngModelChange",function(a){return b(n),z(i.inputValue,a)||(i.inputValue=a),v(a)}),f("ngModelChange",function(a){return b(n),v(i.onValueChange(a))})("keydown.enter",function(){return b(n),v(i.onEnter())}),l()(),C(5,wb,2,1,"small",5),l()}e&2&&(d(2),x(i.label?2:-1),d(),V("ngModel",i.inputValue),w("placeholder",i.placeholder)("disabled",i.isDisabled),d(2),x(i.hint?5:-1))},dependencies:[Ue,je,Be,He,Fe],styles:[".text-input-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%}.text-input-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;cursor:text}.text-input-label[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text);margin:0}.text-input-field[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;font-size:1rem;color:var(--color-text);background:var(--color-bg);border:1px solid var(--color-border);border-radius:8px;outline:none;transition:all .2s ease}.text-input-field[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.7}.text-input-field[_ngcontent-%COMP%]:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px rgba(var(--color-primary-rgb),.1)}.text-input-field[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed;background:var(--color-surface)}.text-input-hint[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);margin:0;font-style:italic}@media (max-width: 768px){.text-input-field[_ngcontent-%COMP%]{padding:.65rem .85rem;font-size:.95rem}.text-input-label[_ngcontent-%COMP%]{font-size:.9rem}.text-input-hint[_ngcontent-%COMP%]{font-size:.8rem}}"]})};var Sb=["nameInput"],kb=["pathInput"];function Mb(o,t){if(o&1&&(s(0,"div",7),p(1),l()),o&2){let e=u();d(),O(e.errorMessage)}}var Gs=class o{isCreating=!1;create=new H;cancelled=new H;nameInput;pathInput;projectName="";projectPath="";errorMessage="";isValid(){return this.projectName.trim()!==""&&this.projectPath.trim()!==""}onNameEnter(){this.projectName.trim()&&setTimeout(()=>this.pathInput?.focus(),50)}onCreate(){this.isValid()?(this.errorMessage="",this.create.emit({name:this.projectName.trim(),path:this.projectPath.trim()})):this.errorMessage="Both name and path are required"}onCancel(){this.cancelled.emit()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-project-create"]],viewQuery:function(e,i){if(e&1&&(X(Sb,5),X(kb,5)),e&2){let n;U(n=W())&&(i.nameInput=n.first),U(n=W())&&(i.pathInput=n.first)}},inputs:{isCreating:"isCreating"},outputs:{create:"create",cancelled:"cancelled"},decls:14,vars:10,consts:[["nameInput",""],["pathInput",""],[1,"project-create"],[1,"create-title"],[1,"create-form"],["label","Project Name","placeholder","my-project",3,"valueChange","enterPressed","value","isDisabled","autoFocus"],["label","Project Path","placeholder","/path/to/project","hint","Absolute path to the project directory",3,"valueChange","enterPressed","value","isDisabled","autoFocus"],[1,"error-message"],[1,"form-actions"],["matButton","",3,"click","disabled"],["matButton","filled",3,"click","disabled"]],template:function(e,i){if(e&1){let n=k();s(0,"div",2)(1,"h3",3),p(2,"Create New Project"),l(),s(3,"div",4)(4,"app-text-input",5,0),f("valueChange",function(a){return b(n),v(i.projectName=a)})("enterPressed",function(){return b(n),v(i.onNameEnter())}),l(),s(6,"app-text-input",6,1),f("valueChange",function(a){return b(n),v(i.projectPath=a)})("enterPressed",function(){return b(n),v(i.onCreate())}),l(),C(8,Mb,2,1,"div",7),l(),s(9,"div",8)(10,"button",9),f("click",function(){return b(n),v(i.onCancel())}),p(11,"Cancel"),l(),s(12,"button",10),f("click",function(){return b(n),v(i.onCreate())}),p(13),l()()()}e&2&&(d(4),w("value",i.projectName)("isDisabled",i.isCreating)("autoFocus",!0),d(2),w("value",i.projectPath)("isDisabled",i.isCreating)("autoFocus",!1),d(2),x(i.errorMessage?8:-1),d(2),w("disabled",i.isCreating),d(2),w("disabled",!i.isValid()||i.isCreating),d(),ie(" ",i.isCreating?"Creating...":"Create Project"," "))},dependencies:[Fe,qs,Ot],styles:[".project-create[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1rem;animation:_ngcontent-%COMP%_slideIn .3s ease-out}.create-title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text);text-align:center}.create-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.error-message[_ngcontent-%COMP%]{padding:.75rem 1rem;background:#dc26261a;border:1px solid rgba(220,38,38,.3);border-radius:8px;color:var(--color-error);font-size:.9rem;text-align:center}.form-actions[_ngcontent-%COMP%]{display:flex;gap:1rem;justify-content:flex-end;margin-top:.5rem}@keyframes _ngcontent-%COMP%_slideIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 768px){.project-create[_ngcontent-%COMP%]{gap:1.25rem;padding:.75rem}.create-title[_ngcontent-%COMP%]{font-size:1.3rem}.form-actions[_ngcontent-%COMP%]{flex-direction:column-reverse;gap:.75rem}}@media (max-width: 480px){.project-create[_ngcontent-%COMP%]{gap:1rem;padding:.5rem}.create-title[_ngcontent-%COMP%]{font-size:1.2rem}}"]})};function Tb(o,t){if(o&1){let e=k();s(0,"app-project-create",10),f("create",function(n){b(e);let r=u();return v(r.onCreateProject(n))})("cancelled",function(){b(e);let n=u();return v(n.closeCreateForm())}),l()}if(o&2){let e=u();w("isCreating",e.isCreating)}}function Eb(o,t){o&1&&(s(0,"div",6),I(1,"div",11),s(2,"p",12),p(3,"Loading projects..."),l()())}function Pb(o,t){if(o&1&&(s(0,"div",7)(1,"p",13),p(2),l()()),o&2){let e=u();d(2),O(e.error)}}function Ob(o,t){if(o&1){let e=k();s(0,"app-choice-select",14),f("choiceSelected",function(n){b(e);let r=u();return v(r.selectProject(n))}),l()}if(o&2){let e=u();w("options",e.projectOptions())("labelHtml","Select a project to continue")("isVisible",!0)}}function Ab(o,t){if(o&1){let e=k();s(0,"div",9)(1,"p",15),p(2,"No projects available."),l(),s(3,"button",16),f("click",function(){b(e);let n=u();return v(n.openCreateForm())}),p(4,"Create your first project"),l()()}}var Ys=class o{isLoading=!1;error=null;showCreateForm=!1;isCreating=!1;router=m(Fi);projectStateService=m(ke);projects=rt(this.projectStateService.projectList$);forcedProject=rt(this.projectStateService.forcedProject$);projectOptions=ui(()=>{let t=this.projects();if(!t)return[];let e=t.filter(a=>!a.volatile),i=t.filter(a=>a.volatile),r=[...e,...i].map(a=>({value:a.name,label:a.volatile?`${a.name} \u{1F538}temp`:a.name}));return t.length>0&&r.push({value:"__new_project__",label:"New project..."}),r});showCreateButton=ui(()=>!this.forcedProject());constructor(){this.projectStateService.selectedProject$.pipe(rn(),me(t=>!!t),me(()=>this.router.url.split("?")[0]==="/"),qt(1)).subscribe(t=>{console.log(`\u{1F43C} navigate to ${t.name}`),this.router.navigate(["project",t.name])})}selectProject(t){if(t==="__new_project__"){this.openCreateForm();return}this.projectStateService.selectProject(t)}openCreateForm(){this.showCreateForm=!0}closeCreateForm(){this.showCreateForm=!1,this.isCreating=!1}onCreateProject(t){this.isCreating=!0,this.error=null,this.projectStateService.createProject(t.name,t.path).subscribe({next:e=>{console.log("[PROJECT-SELECTION] Project created:",e.message),this.isCreating=!1,this.closeCreateForm(),this.selectProject(t.name)},error:e=>{console.error("[PROJECT-SELECTION] Error creating project:",e),this.error=e.error?.error||"Failed to create project",this.isCreating=!1}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-project-selection"]],decls:11,vars:1,consts:[[1,"project-selection"],[1,"centered-content"],[1,"welcome-section"],[1,"choice-section"],[1,"choice-glass"],[3,"isCreating"],[1,"loading-container"],[1,"error-container"],[3,"options","labelHtml","isVisible"],[1,"no-projects-container"],[3,"create","cancelled","isCreating"],[1,"loading-spinner"],[1,"loading-text"],[1,"error-text"],[3,"choiceSelected","options","labelHtml","isVisible"],[1,"no-projects-text"],["matButton","filled","color","primary",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),I(3,"app-welcome-message"),l(),s(4,"div",3)(5,"div",4),C(6,Tb,1,1,"app-project-create",5)(7,Eb,4,0,"div",6)(8,Pb,3,1,"div",7)(9,Ob,1,3,"app-choice-select",8)(10,Ab,5,0,"div",9),l()()()()),e&2&&(d(6),x(i.showCreateForm?6:i.isLoading?7:i.error?8:i.projects()&&i.projects().length>0?9:10))},dependencies:[Fe,Jo,er,Gs,Ot],styles:[".project-selection[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100vh;width:100%;overflow:hidden;background:var(--color-bg);padding:2rem}.centered-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3rem;width:100%;max-width:800px;animation:_ngcontent-%COMP%_fadeIn .6s ease-out}.welcome-section[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_slideUp .8s ease-out}.choice-section[_ngcontent-%COMP%]{width:100%;animation:_ngcontent-%COMP%_slideUp .8s ease-out .2s both}.choice-glass[_ngcontent-%COMP%]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:12px;padding:1.5rem;box-shadow:0 4px 6px #0000001a;transition:all .3s ease}.choice-glass[_ngcontent-%COMP%]:hover{box-shadow:0 8px 12px #00000026}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding:2rem}.loading-spinner[_ngcontent-%COMP%]{width:40px;height:40px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}.loading-text[_ngcontent-%COMP%]{color:var(--color-text-secondary);margin:0}.error-container[_ngcontent-%COMP%]{padding:2rem;text-align:center}.error-text[_ngcontent-%COMP%]{color:var(--color-error);margin:0}.no-projects-container[_ngcontent-%COMP%]{padding:2rem;text-align:center}.no-projects-text[_ngcontent-%COMP%]{color:var(--color-text);margin:0 0 1rem;font-size:1.1rem}.no-projects-hint[_ngcontent-%COMP%]{color:var(--color-text-secondary);margin:0;font-size:.9rem}.create-action[_ngcontent-%COMP%]{margin-top:1.5rem;padding-top:1.5rem;border-top:1px solid var(--color-border);display:flex;justify-content:center}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0}to{opacity:1}}@keyframes _ngcontent-%COMP%_slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}@media (max-width: 768px){.project-selection[_ngcontent-%COMP%]{padding:1.5rem}.centered-content[_ngcontent-%COMP%]{gap:2rem}.choice-glass[_ngcontent-%COMP%]{padding:1rem}}@media (max-width: 480px){.project-selection[_ngcontent-%COMP%]{padding:1rem}.centered-content[_ngcontent-%COMP%]{gap:1.5rem}.choice-glass[_ngcontent-%COMP%]{padding:.75rem}.create-action[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem}}"]})};var at=class o{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new ce("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();enterToSendSubject=new ce(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new ce(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new ce("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new ce(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new ce(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new ce(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new ce(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new ce(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new ce(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new ce(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new ce(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new ce(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new ce(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.asObservable();constructor(){console.log("[PREFERENCES] Initializing preferences service"),typeof window<"u"&&window.codayDesktop?.storage&&(this.isDesktopApp=!0,this.electronStorage=window.codayDesktop.storage,console.log("[PREFERENCES] Running in desktop app mode with persistent storage")),this.initializePreferences()}initializePreferences(){this.isDesktopApp?this.loadPreferencesAsync():this.loadPreferencesSync()}loadPreferencesSync(){let t=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(t),console.log("[PREFERENCES] Voice language initialized to:",t);let e=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(e),console.log("[PREFERENCES] Enter to send initialized to:",e);let i=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(i);let n=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(n);let r=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(r);let a=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(a);let c=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(c);let h=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(h);let g=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(g);let y=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(y);let S=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(S);let A=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(A);let F=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(F);let T=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(T),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return te(this,null,function*(){let t=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(t),console.log("[PREFERENCES] Voice language initialized to:",t);let e=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(e),console.log("[PREFERENCES] Enter to send initialized to:",e);let i=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(i);let n=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(n);let r=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(r);let a=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(a);let c=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(c);let h=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(h);let g=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(g);let y=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(y);let S=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(S);let A=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(A);let F=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(F);let T=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(T),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(t,e){return this.getPreferenceSync(t,e)}getPreferenceSync(t,e){try{let i=localStorage.getItem(this.STORAGE_KEY);if(!i)return e;let n=JSON.parse(i);return n[t]!==void 0?n[t]:e}catch{return e}}getPreferenceAsync(t,e){return te(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(t,e);try{let i=yield this.electronStorage.get(this.STORAGE_KEY);if(!i)return e;let n=JSON.parse(i);return n[t]!==void 0?n[t]:e}catch{return e}})}setPreference(t,e){this.isDesktopApp?this.setPreferenceAsync(t,e):this.setPreferenceSync(t,e)}setPreferenceSync(t,e){try{let i=localStorage.getItem(this.STORAGE_KEY),n=i?JSON.parse(i):{};n[t]=e,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(n)),this.updateSubject(t,e)}catch(i){console.error("Failed to set preference:",i)}}setPreferenceAsync(t,e){return te(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(t,e);return}try{let i=yield this.electronStorage.get(this.STORAGE_KEY),n=i?JSON.parse(i):{};n[t]=e,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(n)),this.updateSubject(t,e)}catch(i){console.error("Failed to set preference:",i)}})}updateSubject(t,e){t==="voiceLanguage"&&this.voiceLanguageSubject.next(e),t==="useEnterToSend"&&this.enterToSendSubject.next(e),t==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(e),t==="voiceMode"&&this.voiceModeSubject.next(e),t==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(e),t==="voiceVolume"&&this.voiceVolumeSubject.next(e),t==="voiceRate"&&this.voiceRateSubject.next(e),t==="selectedVoice"&&this.selectedVoiceSubject.next(e),t==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(e),t==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(e),t==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(e),t==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(e),t==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(e),t==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(e)}setVoiceLanguage(t){console.log("[PREFERENCES] Setting voice language to:",t),this.setPreference("voiceLanguage",t)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setEnterToSend(t){console.log("[PREFERENCES] Setting Enter to send to:",t),this.setPreference("useEnterToSend",t)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(t){console.log("[PREFERENCES] Setting voice announce enabled to:",t),this.setPreference("voiceAnnounceEnabled",t)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(t){console.log("[PREFERENCES] Setting voice mode to:",t),this.setPreference("voiceMode",t)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(t){console.log("[PREFERENCES] Setting voice read full text to:",t),this.setPreference("voiceReadFullText",t)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(t){let e=Math.max(0,Math.min(1,t));console.log("[PREFERENCES] Setting voice volume to:",e),this.setPreference("voiceVolume",e)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(t){let e=Math.max(.5,Math.min(2,t));console.log("[PREFERENCES] Setting voice rate to:",e),this.setPreference("voiceRate",e)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(t){console.log("[PREFERENCES] Setting selected voice to:",t),this.setPreference("selectedVoice",t)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(t){console.log("[PREFERENCES] Setting print technical messages to:",t),this.setPreference("printTechnicalMessages",t)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(t){console.log("[PREFERENCES] Setting hide technical messages to:",t),this.setPreference("hideTechnicalMessages",t)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(t){console.log("[PREFERENCES] Setting hide warning messages to:",t),this.setPreference("hideWarningMessages",t)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(t){console.log("[PREFERENCES] Setting agent notification enabled to:",t),this.setPreference("agentNotificationEnabled",t)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(t){console.log("[PREFERENCES] Setting notification sound enabled to:",t),this.setPreference("notificationSoundEnabled",t)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(t){console.log("[PREFERENCES] Setting browser notification enabled to:",t),this.setPreference("browserNotificationEnabled",t)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};function ud(o,t=80){if(o.length<=t)return o;try{if(o.trim().startsWith("{")||o.trim().startsWith("[")){let e=JSON.parse(o),i=JSON.stringify(e);return i.length<=t?i:i.substring(0,t)+`...(${i.length} chars)`}}catch{}return o.substring(0,t)+"..."}var gt=class{constructor(t,e){this.type=e;if(t.timestamp)this.timestamp=t.timestamp;else{let i=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${i}`}this.parentKey=t.parentKey,this.threadId=t.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let t=this.timestamp.lastIndexOf("-");if(t>0){let e=this.timestamp.substring(t+1);if(e.length===5&&/^[a-z0-9]+$/.test(e))return new Date(this.timestamp.substring(0,t))}return new Date(this.timestamp)}},Qs=class extends gt{invite;constructor(t,e){super(t,e),this.invite=t.invite}buildAnswer(t){return new Qt({answer:t,parentKey:this.timestamp,invite:this.invite})}},tr=class o extends gt{static type="heartbeat";constructor(t){super(t,o.type)}},_n=class o extends Qs{defaultValue;static type="invite";constructor(t){super(t,o.type),this.defaultValue=t.defaultValue}},gd="InviteEventDefault",Qt=class o extends gt{answer;invite;name;static type="answer";constructor(t){super(t,o.type),this.answer=t.answer??"No answer",this.invite=t.invite,this.name=t.name}},qi=class o extends gt{speaker;text;static type="text";constructor(t){super(t,o.type),this.speaker=t.speaker,this.text=t.text}},zn=class o extends gt{chunk;static type="text_chunk";constructor(t){super(t,o.type),this.chunk=t.chunk,this.length=this.chunk.length}},uo=class o extends gt{warning;static type="warn";constructor(t){super(t,o.type),this.warning=t.warning}},ki=class o extends gt{error;static type="error";constructor(t){super(t,o.type),this.error=t.error}},bn=class o extends Qs{options;optionalQuestion;allowFreeText;static type="choice";constructor(t){super(t,o.type),this.options=t.options,this.optionalQuestion=t.optionalQuestion,this.allowFreeText=t.allowFreeText??!1}},Mi=class o extends gt{toolRequestId;name;args;static type="tool_request";constructor(t){super(t,o.type),this.toolRequestId=t.toolRequestId??this.timestamp,this.name=t.name,this.args=t.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(t){return new ci({output:t,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(t=50){let e=ud(this.args,t);return`\u{1F527} ${this.name}(${e})`}},ci=class o extends gt{toolRequestId;output;static type="tool_response";constructor(t){if(super(t,o.type),this.toolRequestId=t.toolRequestId||this.timestamp||new Date().toISOString(),this.output=t.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let e=(this.output.width??0)*(this.output.height??0)/750;this.length=(e?e*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(t=50){let e=this.getTextOutput(),i=ud(e,t),n=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${i}${n}`}},jn=class o extends gt{static type="thinking";static debounce=5e3;constructor(t){super(t,o.type)}},go=class o extends gt{summary;static type="summary";constructor(t){super(t,o.type),this.summary=t.summary,this.length=this.summary.length}toSingleLineString(t=80){return`\u{1F4CB} Summary: ${ud(this.summary,t)}`}},Ti=class o extends gt{role;name;content;static type="message";constructor(t){super(t,o.type),this.role=t.role,this.name=t.name,this.content=t.content,this.length=this.content.map(e=>{if(e.type==="text")return e.content.length;if(e.type==="image"){let i=(e.width||0)*(e.height||0)/750;return i?i*3.5:e.content.length}return 0}).reduce((e,i)=>e+i,0)}getTextContent(){return this.content.filter(t=>t.type==="text").map(t=>t.content).join(`
67
+ `+$t),So&&Us([pi,Wn,xo],tn=>{$t=aa($t,tn," ")}),re&&Ea?re.createHTML($t):$t},t.setConfig=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$l(Q),Vl=!0},t.clearConfig=function(){Eo=null,Vl=!1},t.isValidAttribute=function(Q,_,P){Eo||$l({});let q=ht(Q),Ge=ht(_);return em(q,Ge,P)},t.addHook=function(Q,_){typeof _=="function"&&ra(ft[Q],_)},t.removeHook=function(Q,_){if(_!==void 0){let P=Q_(ft[Q],_);return P===-1?void 0:X_(ft[Q],P,1)[0]}return Bh(ft[Q])},t.removeHooks=function(Q){ft[Q]=[]},t.removeAllHooks=function(){ft=Gh()},t}var Zh=Kh();var $i=class o{renderer;constructor(){this.renderer=new Zo,this.configureRenderer()}configureRenderer(){let t=this.renderer.link.bind(this.renderer);this.renderer.link=e=>{let i=this.isExternalLink(e.href),n=t(e);if(i){n=n.replace("<a ",'<a target="_blank" rel="noopener noreferrer" ');let r=e.title?`${e.text} - ${e.title} (opens in new tab)`:`${e.text} (opens in new tab)`;n=n.replace("<a ",`<a aria-label="${this.escapeHtml(r)}" `),n=n.replace("</a>",'<span class="external-link-icon" aria-hidden="true">\u2197</span></a>')}return n}}isExternalLink(t){if(!t||t.startsWith("/")||t.startsWith("#")||t.startsWith("?"))return!1;if(t.startsWith("//"))return!0;try{return new URL(t,window.location.href).hostname!==window.location.hostname}catch{return!1}}escapeHtml(t){let e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return t.replace(/[&<>"']/g,i=>e[i]||i)}parse(t){return te(this,null,function*(){let e=yield Ae.parse(t,{renderer:this.renderer,breaks:!0,gfm:!0});return Zh.sanitize(e,{ADD_TAGS:["span"],ADD_ATTR:["aria-hidden","aria-label","target","rel"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i})})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var hb=["buttonContainer"],ub=["freeTextInput"],gb=(o,t)=>t.value;function fb(o,t){o&1&&(s(0,"mat-icon",10),p(1,"keyboard_return"),l())}function _b(o,t){if(o&1){let e=k();s(0,"button",8),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.onOptionClick(n.value))}),s(1,"span",9),p(2),l(),C(3,fb,2,0,"mat-icon",10),l()}if(o&2){let e=t.$implicit,i=t.$index,n=u(2);E("highlighted",i===n.highlightedIndex),w("disabled",e.disabled)("id","choice-option-"+i),J("aria-selected",i===n.highlightedIndex),d(2),O(e.label),d(),x(i===n.highlightedIndex?3:-1)}}function bb(o,t){if(o&1){let e=k();s(0,"div",6)(1,"span",11),p(2,"Or type your own answer:"),l(),s(3,"div",12)(4,"input",13,1),j("ngModelChange",function(n){b(e);let r=u(2);return z(r.freeTextValue,n)||(r.freeTextValue=n),v(n)}),f("keydown",function(n){b(e);let r=u(2);return v(r.onFreeTextKeyDown(n))}),l(),s(6,"button",14),f("click",function(){b(e);let n=u(2);return v(n.onFreeTextSubmit())}),s(7,"mat-icon"),p(8,"send"),l()()()()}if(o&2){let e=u(2);d(4),V("ngModel",e.freeTextValue),d(2),w("disabled",!e.freeTextValue.trim())}}function vb(o,t){if(o&1&&(s(0,"div",7)(1,"mat-icon"),p(2,"search"),l(),s(3,"span"),p(4),l()()),o&2){let e=u(2);d(4),O(e.searchText)}}function yb(o,t){if(o&1){let e=k();s(0,"div",2),I(1,"div",3),io(2,"async"),s(3,"div",4,0),f("keydown",function(n){b(e);let r=u();return v(r.onKeyDown(n))}),we(5,_b,4,7,"button",5,gb),l(),C(7,bb,9,2,"div",6),C(8,vb,5,1,"div",7),l()}if(o&2){let e=u();d(),w("innerHTML",wm(2,4,e.renderedLabel$),Zt),d(2),J("aria-activedescendant","choice-option-"+e.highlightedIndex),d(2),Se(e.options),d(2),x(e.allowFreeText?7:-1),d(),x(e.searchText?8:-1)}}var Jo=class o{options=[];allowFreeText=!1;set labelHtml(t){typeof t=="object"?this.renderedLabelSubject.next(t):this.renderLabelMarkdown(t)}isVisible=!1;choiceSelected=new H;buttonContainer;freeTextInput;highlightedIndex=0;searchText="";freeTextValue="";searchTimeout;destroy$=new R;renderedLabelSubject=new ae("");renderedLabel$=this.renderedLabelSubject.asObservable();sanitizer=m(Ri);markdownService=m($i);ngOnDestroy(){this.renderedLabelSubject.complete(),this.destroy$.next(),this.destroy$.complete(),this.searchTimeout&&clearTimeout(this.searchTimeout)}ngAfterViewInit(){this.isVisible&&this.buttonContainer&&setTimeout(()=>this.focusContainer(),100)}ngOnChanges(t){t.isVisible&&t.isVisible.currentValue&&!t.isVisible.previousValue&&(this.highlightedIndex=0,setTimeout(()=>this.focusContainer(),150)),t.options&&!t.options.firstChange&&(this.highlightedIndex=0,this.searchText="",this.freeTextValue="")}focusContainer(){this.buttonContainer?.nativeElement&&this.buttonContainer.nativeElement.focus()}onKeyDown(t){if(this.options.filter(i=>!i.disabled).length!==0)switch(t.key){case"ArrowDown":t.preventDefault(),this.moveHighlight(1);break;case"ArrowUp":t.preventDefault(),this.moveHighlight(-1);break;case"Enter":case" ":t.preventDefault(),this.selectHighlighted();break;case"Home":t.preventDefault(),this.highlightFirst();break;case"End":t.preventDefault(),this.highlightLast();break;case"Escape":t.preventDefault();break;default:t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&this.handleTypeAhead(t.key);break}}moveHighlight(t){let e=this.options.map((r,a)=>({opt:r,idx:a})).filter(({opt:r})=>!r.disabled).map(({idx:r})=>r);if(e.length===0)return;let n=e.findIndex(r=>r===this.highlightedIndex)+t;if(n>=0&&n<e.length){let r=e[n];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}else if(t===1&&n>=e.length){let r=e[0];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}else if(t===-1&&n<0){let r=e[e.length-1];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}}highlightFirst(){let t=this.options.findIndex(e=>!e.disabled);t>=0&&(this.highlightedIndex=t,this.scrollToHighlighted())}highlightLast(){let t=this.options.map((e,i)=>({opt:e,idx:i})).filter(({opt:e})=>!e.disabled).map(({idx:e})=>e);if(t.length>0){let e=t[t.length-1];e!==void 0&&(this.highlightedIndex=e,this.scrollToHighlighted())}}scrollToHighlighted(){setTimeout(()=>{let t=document.getElementById("choice-option-"+this.highlightedIndex);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})},0)}selectHighlighted(){let t=this.options[this.highlightedIndex];t&&!t.disabled&&this.onOptionClick(t.value)}handleTypeAhead(t){this.searchText+=t.toLowerCase();let e=this.options.findIndex(i=>!i.disabled&&i.label.toLowerCase().startsWith(this.searchText));e>=0&&(this.highlightedIndex=e,this.scrollToHighlighted()),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchText=""},1e3)}onOptionClick(t){this.choiceSelected.emit(t)}onFreeTextSubmit(){let t=this.freeTextValue.trim();t&&(this.freeTextValue="",this.choiceSelected.emit(t))}onFreeTextKeyDown(t){t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),this.onFreeTextSubmit())}renderLabelMarkdown(t){return te(this,null,function*(){if(!t){this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(""));return}try{let e=yield this.markdownService.parse(t);this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(e))}catch(e){console.error("[CHOICE-SELECT] Error parsing label markdown:",e),this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(t))}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-choice-select"]],viewQuery:function(e,i){if(e&1&&(X(hb,5),X(ub,5)),e&2){let n;U(n=W())&&(i.buttonContainer=n.first),U(n=W())&&(i.freeTextInput=n.first)}},inputs:{options:"options",allowFreeText:"allowFreeText",labelHtml:"labelHtml",isVisible:"isVisible"},outputs:{choiceSelected:"choiceSelected"},features:[nt],decls:1,vars:1,consts:[["buttonContainer",""],["freeTextInput",""],[1,"choice-container"],[1,"choice-label",3,"innerHTML"],["role","listbox","tabindex","0",1,"choice-buttons",3,"keydown"],["type","button","role","option",1,"choice-button",3,"highlighted","disabled","id"],[1,"free-text-section"],[1,"search-indicator"],["type","button","role","option",1,"choice-button",3,"click","disabled","id"],[1,"choice-button-label"],[1,"choice-button-icon"],[1,"free-text-hint"],[1,"free-text-input-row"],["type","text","placeholder","Type a custom answer\u2026","aria-label","Custom answer",1,"free-text-input",3,"ngModelChange","keydown","ngModel"],["type","button","aria-label","Send custom answer",1,"free-text-send-btn",3,"click","disabled"]],template:function(e,i){e&1&&C(0,yb,9,6,"div",2),e&2&&x(i.isVisible?0:-1)},dependencies:[Me,he,Ue,je,Be,He,Pm],styles:[".choice-container[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:1rem}.choice-label[_ngcontent-%COMP%]{display:block;font-weight:500;color:var(--color-text);font-size:1rem;line-height:1.5}.choice-label[_ngcontent-%COMP%] p{margin:0 0 .5rem}.choice-label[_ngcontent-%COMP%] p:last-child{margin-bottom:0}.choice-label[_ngcontent-%COMP%] code{background:var(--color-code-bg);padding:.2em .4em;border-radius:4px;font-family:monospace;font-size:.9em}.choice-label[_ngcontent-%COMP%] strong{font-weight:600}.choice-buttons[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;max-height:400px;overflow-y:auto;padding:.5rem;background:var(--color-background);border:2px solid var(--color-border);border-radius:12px;outline:none}.choice-buttons[_ngcontent-%COMP%]:focus-within{border-color:var(--color-primary);box-shadow:0 0 0 3px #007aff1a}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:var(--color-background);border-radius:4px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.choice-button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:100%;padding:.75rem 1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-background);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;font-size:1rem;text-align:left;cursor:pointer;transition:all .2s ease}.choice-button[_ngcontent-%COMP%]:hover:not(:disabled):not(.highlighted){background:var(--color-bg-hover);border-color:var(--color-primary);transform:translate(2px)}.choice-button.highlighted[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff;border-color:var(--color-primary);box-shadow:0 2px 8px #007aff4d}.choice-button.highlighted[_ngcontent-%COMP%] .choice-button-icon[_ngcontent-%COMP%]{color:#fff}.choice-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.choice-button[_ngcontent-%COMP%]:focus{outline:none}.choice-button-label[_ngcontent-%COMP%]{flex:1;line-height:1.5}.choice-button-icon[_ngcontent-%COMP%]{flex-shrink:0;margin-left:.5rem;font-size:1.2rem;width:1.2rem;height:1.2rem}.free-text-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.free-text-hint[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.free-text-input-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.free-text-input[_ngcontent-%COMP%]{flex:1;padding:.625rem .875rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-background);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;font-size:1rem;outline:none;transition:border-color .2s ease,box-shadow .2s ease}.free-text-input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px #007aff1a}.free-text-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.7}.free-text-send-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;flex-shrink:0;border:none;border-radius:8px;background:var(--color-primary);color:#fff;cursor:pointer;transition:background .2s ease,opacity .2s ease}.free-text-send-btn[_ngcontent-%COMP%]:hover:not(:disabled){opacity:.9}.free-text-send-btn[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.free-text-send-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.2rem;width:1.2rem;height:1.2rem}.search-indicator[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;background:var(--color-primary);color:#fff;border-radius:8px;font-size:.9rem;font-weight:500;animation:_ngcontent-%COMP%_fadeIn .2s ease}.search-indicator[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;color:#fff}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 480px){.choice-container[_ngcontent-%COMP%]{gap:.75rem}.choice-label[_ngcontent-%COMP%]{font-size:.95rem}.choice-buttons[_ngcontent-%COMP%]{max-height:300px;gap:.375rem}.choice-button[_ngcontent-%COMP%]{font-size:.95rem;padding:.625rem .875rem}}@media print{.choice-buttons[_ngcontent-%COMP%]{max-height:none;overflow:visible}.search-indicator[_ngcontent-%COMP%]{display:none!important}}"]})};var er=class o{welcomeMessages=["Welcome to Coday","Bienvenue sur Coday","Bienvenido a Coday","Willkommen bei Coday","Benvenuto su Coday","Bem-vindo ao Coday","Welkom bij Coday","\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C \u0432 Coday","Coday \u3078\u3088\u3046\u3053\u305D","\u6B22\u8FCE\u6765\u5230 Coday","Coday \uC5D0 \uC624\uC2E0 \uAC83\uC744 \uD658\uC601\uD569\uB2C8\uB2E4","\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0643 \u0641\u064A Coday"];currentWelcomeIndex=0;currentWelcomeMessage=this.welcomeMessages[0];welcomeRotationInterval;ngOnInit(){this.startWelcomeRotation()}ngOnDestroy(){this.stopWelcomeRotation()}startWelcomeRotation(){this.welcomeRotationInterval=window.setInterval(()=>{this.currentWelcomeIndex=(this.currentWelcomeIndex+1)%this.welcomeMessages.length,this.currentWelcomeMessage=this.welcomeMessages[this.currentWelcomeIndex]},3e3)}stopWelcomeRotation(){this.welcomeRotationInterval&&(clearInterval(this.welcomeRotationInterval),this.welcomeRotationInterval=void 0)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(e,i){e&1&&(ii(0,"h1",0),p(1),ni()),e&2&&(d(),O(i.currentWelcomeMessage))},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,4rem);font-weight:700;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite;margin:0;padding:0;line-height:1.2;transition:opacity .5s ease-in-out;display:block;min-height:1.2em;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"]})};var Cb=["inputElement"];function xb(o,t){if(o&1&&(s(0,"span",3),p(1),l()),o&2){let e=u();d(),O(e.label)}}function wb(o,t){if(o&1&&(s(0,"small",5),p(1),l()),o&2){let e=u();d(),O(e.hint)}}var qs=class o{label="";placeholder="";hint="";isDisabled=!1;value="";autoFocus=!0;valueChange=new H;enterPressed=new H;inputElement;inputValue="";ngAfterViewInit(){this.inputValue=this.value,this.autoFocus&&setTimeout(()=>this.inputElement?.nativeElement.focus(),100)}onValueChange(t){this.valueChange.emit(t)}onEnter(){this.inputValue.trim()&&this.enterPressed.emit(this.inputValue.trim())}focus(){this.inputElement?.nativeElement.focus()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-text-input"]],viewQuery:function(e,i){if(e&1&&X(Cb,5),e&2){let n;U(n=W())&&(i.inputElement=n.first)}},inputs:{label:"label",placeholder:"placeholder",hint:"hint",isDisabled:"isDisabled",value:"value",autoFocus:"autoFocus"},outputs:{valueChange:"valueChange",enterPressed:"enterPressed"},decls:6,vars:5,consts:[["inputElement",""],[1,"text-input-container"],[1,"text-input-wrapper"],[1,"text-input-label"],["type","text",1,"text-input-field",3,"ngModelChange","keydown.enter","ngModel","placeholder","disabled"],[1,"text-input-hint"]],template:function(e,i){if(e&1){let n=k();s(0,"div",1)(1,"label",2),C(2,xb,2,1,"span",3),s(3,"input",4,0),j("ngModelChange",function(a){return b(n),z(i.inputValue,a)||(i.inputValue=a),v(a)}),f("ngModelChange",function(a){return b(n),v(i.onValueChange(a))})("keydown.enter",function(){return b(n),v(i.onEnter())}),l()(),C(5,wb,2,1,"small",5),l()}e&2&&(d(2),x(i.label?2:-1),d(),V("ngModel",i.inputValue),w("placeholder",i.placeholder)("disabled",i.isDisabled),d(2),x(i.hint?5:-1))},dependencies:[Ue,je,Be,He,Fe],styles:[".text-input-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%}.text-input-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;cursor:text}.text-input-label[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text);margin:0}.text-input-field[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;font-size:1rem;color:var(--color-text);background:var(--color-bg);border:1px solid var(--color-border);border-radius:8px;outline:none;transition:all .2s ease}.text-input-field[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.7}.text-input-field[_ngcontent-%COMP%]:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px rgba(var(--color-primary-rgb),.1)}.text-input-field[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed;background:var(--color-surface)}.text-input-hint[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);margin:0;font-style:italic}@media (max-width: 768px){.text-input-field[_ngcontent-%COMP%]{padding:.65rem .85rem;font-size:.95rem}.text-input-label[_ngcontent-%COMP%]{font-size:.9rem}.text-input-hint[_ngcontent-%COMP%]{font-size:.8rem}}"]})};var Sb=["nameInput"],kb=["pathInput"];function Mb(o,t){if(o&1&&(s(0,"div",7),p(1),l()),o&2){let e=u();d(),O(e.errorMessage)}}var Gs=class o{isCreating=!1;create=new H;cancelled=new H;nameInput;pathInput;projectName="";projectPath="";errorMessage="";isValid(){return this.projectName.trim()!==""&&this.projectPath.trim()!==""}onNameEnter(){this.projectName.trim()&&setTimeout(()=>this.pathInput?.focus(),50)}onCreate(){this.isValid()?(this.errorMessage="",this.create.emit({name:this.projectName.trim(),path:this.projectPath.trim()})):this.errorMessage="Both name and path are required"}onCancel(){this.cancelled.emit()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-project-create"]],viewQuery:function(e,i){if(e&1&&(X(Sb,5),X(kb,5)),e&2){let n;U(n=W())&&(i.nameInput=n.first),U(n=W())&&(i.pathInput=n.first)}},inputs:{isCreating:"isCreating"},outputs:{create:"create",cancelled:"cancelled"},decls:14,vars:10,consts:[["nameInput",""],["pathInput",""],[1,"project-create"],[1,"create-title"],[1,"create-form"],["label","Project Name","placeholder","my-project",3,"valueChange","enterPressed","value","isDisabled","autoFocus"],["label","Project Path","placeholder","/path/to/project","hint","Absolute path to the project directory",3,"valueChange","enterPressed","value","isDisabled","autoFocus"],[1,"error-message"],[1,"form-actions"],["matButton","",3,"click","disabled"],["matButton","filled",3,"click","disabled"]],template:function(e,i){if(e&1){let n=k();s(0,"div",2)(1,"h3",3),p(2,"Create New Project"),l(),s(3,"div",4)(4,"app-text-input",5,0),f("valueChange",function(a){return b(n),v(i.projectName=a)})("enterPressed",function(){return b(n),v(i.onNameEnter())}),l(),s(6,"app-text-input",6,1),f("valueChange",function(a){return b(n),v(i.projectPath=a)})("enterPressed",function(){return b(n),v(i.onCreate())}),l(),C(8,Mb,2,1,"div",7),l(),s(9,"div",8)(10,"button",9),f("click",function(){return b(n),v(i.onCancel())}),p(11,"Cancel"),l(),s(12,"button",10),f("click",function(){return b(n),v(i.onCreate())}),p(13),l()()()}e&2&&(d(4),w("value",i.projectName)("isDisabled",i.isCreating)("autoFocus",!0),d(2),w("value",i.projectPath)("isDisabled",i.isCreating)("autoFocus",!1),d(2),x(i.errorMessage?8:-1),d(2),w("disabled",i.isCreating),d(2),w("disabled",!i.isValid()||i.isCreating),d(),ie(" ",i.isCreating?"Creating...":"Create Project"," "))},dependencies:[Fe,qs,Ot],styles:[".project-create[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1rem;animation:_ngcontent-%COMP%_slideIn .3s ease-out}.create-title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text);text-align:center}.create-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.error-message[_ngcontent-%COMP%]{padding:.75rem 1rem;background:#dc26261a;border:1px solid rgba(220,38,38,.3);border-radius:8px;color:var(--color-error);font-size:.9rem;text-align:center}.form-actions[_ngcontent-%COMP%]{display:flex;gap:1rem;justify-content:flex-end;margin-top:.5rem}@keyframes _ngcontent-%COMP%_slideIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 768px){.project-create[_ngcontent-%COMP%]{gap:1.25rem;padding:.75rem}.create-title[_ngcontent-%COMP%]{font-size:1.3rem}.form-actions[_ngcontent-%COMP%]{flex-direction:column-reverse;gap:.75rem}}@media (max-width: 480px){.project-create[_ngcontent-%COMP%]{gap:1rem;padding:.5rem}.create-title[_ngcontent-%COMP%]{font-size:1.2rem}}"]})};function Tb(o,t){if(o&1){let e=k();s(0,"app-project-create",10),f("create",function(n){b(e);let r=u();return v(r.onCreateProject(n))})("cancelled",function(){b(e);let n=u();return v(n.closeCreateForm())}),l()}if(o&2){let e=u();w("isCreating",e.isCreating)}}function Eb(o,t){o&1&&(s(0,"div",6),I(1,"div",11),s(2,"p",12),p(3,"Loading projects..."),l()())}function Pb(o,t){if(o&1&&(s(0,"div",7)(1,"p",13),p(2),l()()),o&2){let e=u();d(2),O(e.error)}}function Ob(o,t){if(o&1){let e=k();s(0,"app-choice-select",14),f("choiceSelected",function(n){b(e);let r=u();return v(r.selectProject(n))}),l()}if(o&2){let e=u();w("options",e.projectOptions())("labelHtml","Select a project to continue")("isVisible",!0)}}function Ab(o,t){if(o&1){let e=k();s(0,"div",9)(1,"p",15),p(2,"No projects available."),l(),s(3,"button",16),f("click",function(){b(e);let n=u();return v(n.openCreateForm())}),p(4,"Create your first project"),l()()}}var Ys=class o{isLoading=!1;error=null;showCreateForm=!1;isCreating=!1;router=m(Fi);projectStateService=m(ke);projects=rt(this.projectStateService.projectList$);forcedProject=rt(this.projectStateService.forcedProject$);projectOptions=ui(()=>{let t=this.projects();if(!t)return[];let e=t.filter(a=>!a.volatile),i=t.filter(a=>a.volatile),r=[...e,...i].map(a=>({value:a.name,label:a.volatile?`${a.name} \u{1F538}temp`:a.name}));return t.length>0&&r.push({value:"__new_project__",label:"New project..."}),r});showCreateButton=ui(()=>!this.forcedProject());constructor(){this.projectStateService.selectedProject$.pipe(rn(),me(t=>!!t),me(()=>this.router.url.split("?")[0]==="/"),qt(1)).subscribe(t=>{console.log(`\u{1F43C} navigate to ${t.name}`),this.router.navigate(["project",t.name])})}selectProject(t){if(t==="__new_project__"){this.openCreateForm();return}this.projectStateService.selectProject(t)}openCreateForm(){this.showCreateForm=!0}closeCreateForm(){this.showCreateForm=!1,this.isCreating=!1}onCreateProject(t){this.isCreating=!0,this.error=null,this.projectStateService.createProject(t.name,t.path).subscribe({next:e=>{console.log("[PROJECT-SELECTION] Project created:",e.message),this.isCreating=!1,this.closeCreateForm(),this.selectProject(t.name)},error:e=>{console.error("[PROJECT-SELECTION] Error creating project:",e),this.error=e.error?.error||"Failed to create project",this.isCreating=!1}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-project-selection"]],decls:11,vars:1,consts:[[1,"project-selection"],[1,"centered-content"],[1,"welcome-section"],[1,"choice-section"],[1,"choice-glass"],[3,"isCreating"],[1,"loading-container"],[1,"error-container"],[3,"options","labelHtml","isVisible"],[1,"no-projects-container"],[3,"create","cancelled","isCreating"],[1,"loading-spinner"],[1,"loading-text"],[1,"error-text"],[3,"choiceSelected","options","labelHtml","isVisible"],[1,"no-projects-text"],["matButton","filled","color","primary",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),I(3,"app-welcome-message"),l(),s(4,"div",3)(5,"div",4),C(6,Tb,1,1,"app-project-create",5)(7,Eb,4,0,"div",6)(8,Pb,3,1,"div",7)(9,Ob,1,3,"app-choice-select",8)(10,Ab,5,0,"div",9),l()()()()),e&2&&(d(6),x(i.showCreateForm?6:i.isLoading?7:i.error?8:i.projects()&&i.projects().length>0?9:10))},dependencies:[Fe,Jo,er,Gs,Ot],styles:[".project-selection[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100vh;width:100%;overflow:hidden;background:var(--color-bg);padding:2rem}.centered-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3rem;width:100%;max-width:800px;animation:_ngcontent-%COMP%_fadeIn .6s ease-out}.welcome-section[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_slideUp .8s ease-out}.choice-section[_ngcontent-%COMP%]{width:100%;animation:_ngcontent-%COMP%_slideUp .8s ease-out .2s both}.choice-glass[_ngcontent-%COMP%]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:12px;padding:1.5rem;box-shadow:0 4px 6px #0000001a;transition:all .3s ease}.choice-glass[_ngcontent-%COMP%]:hover{box-shadow:0 8px 12px #00000026}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding:2rem}.loading-spinner[_ngcontent-%COMP%]{width:40px;height:40px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}.loading-text[_ngcontent-%COMP%]{color:var(--color-text-secondary);margin:0}.error-container[_ngcontent-%COMP%]{padding:2rem;text-align:center}.error-text[_ngcontent-%COMP%]{color:var(--color-error);margin:0}.no-projects-container[_ngcontent-%COMP%]{padding:2rem;text-align:center}.no-projects-text[_ngcontent-%COMP%]{color:var(--color-text);margin:0 0 1rem;font-size:1.1rem}.no-projects-hint[_ngcontent-%COMP%]{color:var(--color-text-secondary);margin:0;font-size:.9rem}.create-action[_ngcontent-%COMP%]{margin-top:1.5rem;padding-top:1.5rem;border-top:1px solid var(--color-border);display:flex;justify-content:center}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0}to{opacity:1}}@keyframes _ngcontent-%COMP%_slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}@media (max-width: 768px){.project-selection[_ngcontent-%COMP%]{padding:1.5rem}.centered-content[_ngcontent-%COMP%]{gap:2rem}.choice-glass[_ngcontent-%COMP%]{padding:1rem}}@media (max-width: 480px){.project-selection[_ngcontent-%COMP%]{padding:1rem}.centered-content[_ngcontent-%COMP%]{gap:1.5rem}.choice-glass[_ngcontent-%COMP%]{padding:.75rem}.create-action[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem}}"]})};var at=class o{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new ae("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();enterToSendSubject=new ae(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new ae(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new ae("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new ae(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new ae(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new ae(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new ae(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new ae(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new ae(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new ae(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new ae(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new ae(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new ae(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.asObservable();constructor(){console.log("[PREFERENCES] Initializing preferences service"),typeof window<"u"&&window.codayDesktop?.storage&&(this.isDesktopApp=!0,this.electronStorage=window.codayDesktop.storage,console.log("[PREFERENCES] Running in desktop app mode with persistent storage")),this.initializePreferences()}initializePreferences(){this.isDesktopApp?this.loadPreferencesAsync():this.loadPreferencesSync()}loadPreferencesSync(){let t=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(t),console.log("[PREFERENCES] Voice language initialized to:",t);let e=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(e),console.log("[PREFERENCES] Enter to send initialized to:",e);let i=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(i);let n=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(n);let r=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(r);let a=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(a);let c=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(c);let h=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(h);let g=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(g);let y=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(y);let S=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(S);let A=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(A);let F=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(F);let T=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(T),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return te(this,null,function*(){let t=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(t),console.log("[PREFERENCES] Voice language initialized to:",t);let e=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(e),console.log("[PREFERENCES] Enter to send initialized to:",e);let i=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(i);let n=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(n);let r=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(r);let a=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(a);let c=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(c);let h=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(h);let g=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(g);let y=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(y);let S=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(S);let A=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(A);let F=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(F);let T=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(T),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(t,e){return this.getPreferenceSync(t,e)}getPreferenceSync(t,e){try{let i=localStorage.getItem(this.STORAGE_KEY);if(!i)return e;let n=JSON.parse(i);return n[t]!==void 0?n[t]:e}catch{return e}}getPreferenceAsync(t,e){return te(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(t,e);try{let i=yield this.electronStorage.get(this.STORAGE_KEY);if(!i)return e;let n=JSON.parse(i);return n[t]!==void 0?n[t]:e}catch{return e}})}setPreference(t,e){this.isDesktopApp?this.setPreferenceAsync(t,e):this.setPreferenceSync(t,e)}setPreferenceSync(t,e){try{let i=localStorage.getItem(this.STORAGE_KEY),n=i?JSON.parse(i):{};n[t]=e,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(n)),this.updateSubject(t,e)}catch(i){console.error("Failed to set preference:",i)}}setPreferenceAsync(t,e){return te(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(t,e);return}try{let i=yield this.electronStorage.get(this.STORAGE_KEY),n=i?JSON.parse(i):{};n[t]=e,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(n)),this.updateSubject(t,e)}catch(i){console.error("Failed to set preference:",i)}})}updateSubject(t,e){t==="voiceLanguage"&&this.voiceLanguageSubject.next(e),t==="useEnterToSend"&&this.enterToSendSubject.next(e),t==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(e),t==="voiceMode"&&this.voiceModeSubject.next(e),t==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(e),t==="voiceVolume"&&this.voiceVolumeSubject.next(e),t==="voiceRate"&&this.voiceRateSubject.next(e),t==="selectedVoice"&&this.selectedVoiceSubject.next(e),t==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(e),t==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(e),t==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(e),t==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(e),t==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(e),t==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(e)}setVoiceLanguage(t){console.log("[PREFERENCES] Setting voice language to:",t),this.setPreference("voiceLanguage",t)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setEnterToSend(t){console.log("[PREFERENCES] Setting Enter to send to:",t),this.setPreference("useEnterToSend",t)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(t){console.log("[PREFERENCES] Setting voice announce enabled to:",t),this.setPreference("voiceAnnounceEnabled",t)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(t){console.log("[PREFERENCES] Setting voice mode to:",t),this.setPreference("voiceMode",t)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(t){console.log("[PREFERENCES] Setting voice read full text to:",t),this.setPreference("voiceReadFullText",t)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(t){let e=Math.max(0,Math.min(1,t));console.log("[PREFERENCES] Setting voice volume to:",e),this.setPreference("voiceVolume",e)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(t){let e=Math.max(.5,Math.min(2,t));console.log("[PREFERENCES] Setting voice rate to:",e),this.setPreference("voiceRate",e)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(t){console.log("[PREFERENCES] Setting selected voice to:",t),this.setPreference("selectedVoice",t)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(t){console.log("[PREFERENCES] Setting print technical messages to:",t),this.setPreference("printTechnicalMessages",t)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(t){console.log("[PREFERENCES] Setting hide technical messages to:",t),this.setPreference("hideTechnicalMessages",t)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(t){console.log("[PREFERENCES] Setting hide warning messages to:",t),this.setPreference("hideWarningMessages",t)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(t){console.log("[PREFERENCES] Setting agent notification enabled to:",t),this.setPreference("agentNotificationEnabled",t)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(t){console.log("[PREFERENCES] Setting notification sound enabled to:",t),this.setPreference("notificationSoundEnabled",t)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(t){console.log("[PREFERENCES] Setting browser notification enabled to:",t),this.setPreference("browserNotificationEnabled",t)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};function ud(o,t=80){if(o.length<=t)return o;try{if(o.trim().startsWith("{")||o.trim().startsWith("[")){let e=JSON.parse(o),i=JSON.stringify(e);return i.length<=t?i:i.substring(0,t)+`...(${i.length} chars)`}}catch{}return o.substring(0,t)+"..."}var gt=class{constructor(t,e){this.type=e;if(t.timestamp)this.timestamp=t.timestamp;else{let i=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${i}`}this.parentKey=t.parentKey,this.threadId=t.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let t=this.timestamp.lastIndexOf("-");if(t>0){let e=this.timestamp.substring(t+1);if(e.length===5&&/^[a-z0-9]+$/.test(e))return new Date(this.timestamp.substring(0,t))}return new Date(this.timestamp)}},Qs=class extends gt{invite;constructor(t,e){super(t,e),this.invite=t.invite}buildAnswer(t){return new Qt({answer:t,parentKey:this.timestamp,invite:this.invite})}},tr=class o extends gt{static type="heartbeat";constructor(t){super(t,o.type)}},_n=class o extends Qs{defaultValue;static type="invite";constructor(t){super(t,o.type),this.defaultValue=t.defaultValue}},gd="InviteEventDefault",Qt=class o extends gt{answer;invite;name;static type="answer";constructor(t){super(t,o.type),this.answer=t.answer??"No answer",this.invite=t.invite,this.name=t.name}},qi=class o extends gt{speaker;text;static type="text";constructor(t){super(t,o.type),this.speaker=t.speaker,this.text=t.text}},zn=class o extends gt{chunk;static type="text_chunk";constructor(t){super(t,o.type),this.chunk=t.chunk,this.length=this.chunk.length}},uo=class o extends gt{warning;static type="warn";constructor(t){super(t,o.type),this.warning=t.warning}},ki=class o extends gt{error;static type="error";constructor(t){super(t,o.type),this.error=t.error}},bn=class o extends Qs{options;optionalQuestion;allowFreeText;static type="choice";constructor(t){super(t,o.type),this.options=t.options,this.optionalQuestion=t.optionalQuestion,this.allowFreeText=t.allowFreeText??!1}},Mi=class o extends gt{toolRequestId;name;args;static type="tool_request";constructor(t){super(t,o.type),this.toolRequestId=t.toolRequestId??this.timestamp,this.name=t.name,this.args=t.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(t){return new ci({output:t,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(t=50){let e=ud(this.args,t);return`\u{1F527} ${this.name}(${e})`}},ci=class o extends gt{toolRequestId;output;static type="tool_response";constructor(t){if(super(t,o.type),this.toolRequestId=t.toolRequestId||this.timestamp||new Date().toISOString(),this.output=t.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let e=(this.output.width??0)*(this.output.height??0)/750;this.length=(e?e*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(t=50){let e=this.getTextOutput(),i=ud(e,t),n=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${i}${n}`}},jn=class o extends gt{static type="thinking";static debounce=5e3;constructor(t){super(t,o.type)}},go=class o extends gt{summary;static type="summary";constructor(t){super(t,o.type),this.summary=t.summary,this.length=this.summary.length}toSingleLineString(t=80){return`\u{1F4CB} Summary: ${ud(this.summary,t)}`}},Ti=class o extends gt{role;name;content;static type="message";constructor(t){super(t,o.type),this.role=t.role,this.name=t.name,this.content=t.content,this.length=this.content.map(e=>{if(e.type==="text")return e.content.length;if(e.type==="image"){let i=(e.width||0)*(e.height||0)/750;return i?i*3.5:e.content.length}return 0}).reduce((e,i)=>e+i,0)}getTextContent(){return this.content.filter(t=>t.type==="text").map(t=>t.content).join(`
68
68
  `)}},ir=class o extends gt{threadId;name;summary;users;static type="thread_update";constructor(t){super(t,o.type),this.threadId=t.threadId,this.name=t.name,this.summary=t.summary,this.users=t.users}},Bn=class o extends gt{filename;operation;size;mimeType;static type="file";constructor(t){super(t,o.type),this.filename=t.filename,this.operation=t.operation,this.size=t.size,this.mimeType=t.mimeType}toSingleLineString(){let t=this.operation==="created"?"\u{1F4C4}":this.operation==="updated"?"\u{1F4DD}":"\u{1F5D1}\uFE0F",e=this.size?` (${(this.size/1024).toFixed(1)} KB)`:"";return`${t} ${this.operation}: ${this.filename}${e}`}},nr=class o extends gt{authUrl;state;integrationName;static type="oauth_request";constructor(t){super(t,o.type),this.authUrl=t.authUrl,this.state=t.state,this.integrationName=t.integrationName}},Gi=class o extends gt{subThreadId;agentName;static type="delegation";constructor(t){super(t,o.type),this.subThreadId=t.subThreadId,this.agentName=t.agentName}},Ei=class o extends gt{code;state;integrationName;error;errorDescription;static type="oauth_callback";constructor(t){super(t,o.type),this.code=t.code,this.state=t.state,this.integrationName=t.integrationName,this.error=t.error,this.errorDescription=t.errorDescription}},Ib={[Ti.type]:Ti,[Qt.type]:Qt,[bn.type]:bn,[Gi.type]:Gi,[ki.type]:ki,[tr.type]:tr,[_n.type]:_n,[Mi.type]:Mi,[ci.type]:ci,[qi.type]:qi,[zn.type]:zn,[jn.type]:jn,[uo.type]:uo,[ir.type]:ir,[go.type]:go,[Bn.type]:Bn,[nr.type]:nr,[Ei.type]:Ei};function da(o){let t=Ib[o.type];return t?new t(o):void 0}var fT=[{id:"builtin-plan",name:"plan",description:"Build a plan to complete the given task",source:"builtin",commands:[`@ We start a 3 phase process to build a comprehensive execution plan for the following task:
69
69
 
70
70
  <task>
@@ -333,7 +333,7 @@ Verify the memory system's overall health:
333
333
  - List any remaining issues or concerns
334
334
  - Provide recommendations for maintaining memory quality
335
335
 
336
- This ensures the memory system stays efficient and valuable.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""}];var OT=[Ti.type,Mi.type,ci.type,go.type,_n.type,bn.type,Qt.type,Gi.type];var Jh={CONFLUENCE:[],GIT:[],GIT_WORKTREE:[],GITLAB:[],JIRA:[],SLACK:[],ZENDESK:[],BASECAMP:[]},YT=Object.keys(Jh).filter(o=>Jh[o]?.length===0);var Yi=class o{eventSource=null;eventsSubject=new R;connectionStatusSubject=new ce({connected:!1,reconnectAttempts:0,maxAttempts:3});reconnectAttempts=0;MAX_RECONNECT_ATTEMPTS=3;RECONNECT_DELAY=2e3;events$=this.eventsSubject.asObservable();connectionStatus$=this.connectionStatusSubject.asObservable();ngZone=m(pe);connectToThread(t,e){console.log("[SSE] Connecting to thread event stream:",t,e),this.eventSource&&(console.log("[SSE] Closing existing EventSource"),this.eventSource.close());let i=`/api/projects/${t}/threads/${e}/event-stream`;console.log("[SSE] EventSource URL:",i),this.eventSource=new EventSource(i),this.setupEventHandlers()}setupEventHandlers(){this.eventSource&&(this.eventSource.onmessage=t=>{this.ngZone.run(()=>{console.log("[SSE] Message received:",t.data.substring(0,100)),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0);try{let e=JSON.parse(t.data),i=da(e);i?(console.log("[SSE] Event:",i.type),this.eventsSubject.next(i)):console.warn("[SSE] Failed to build event:",e.type)}catch(e){console.error("[SSE] Parse error:",e.message)}})},this.eventSource.onopen=()=>{this.ngZone.run(()=>{console.log("[SSE] Connection established"),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0)})},this.eventSource.onerror=t=>{this.ngZone.run(()=>{console.log("[SSE] EventSource error:",t),this.eventSource?.readyState===EventSource.CLOSED&&(console.log("[SSE] Connection closed"),this.updateConnectionStatus(!1,this.reconnectAttempts),this.reconnectAttempts<this.MAX_RECONNECT_ATTEMPTS?(console.log(`[SSE] Attempting reconnect ${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS}`),this.eventsSubject.next(new ki({error:new Error(`Connection lost. Attempting to reconnect (${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS})...`)})),setTimeout(()=>{this.reconnectAttempts++,console.warn("[SSE] Reconnection may not work properly with thread-based connections")},this.RECONNECT_DELAY)):(console.log("[SSE] Max reconnection attempts reached"),this.eventsSubject.next(new ki({error:new Error("Connection lost permanently. Please refresh the page.")}))))})})}disconnect(){this.eventSource&&(console.log("[SSE] Disconnecting EventSource"),this.eventSource.close(),this.eventSource=null,this.updateConnectionStatus(!1,0))}updateConnectionStatus(t,e){this.connectionStatusSubject.next({connected:t,reconnectAttempts:e,maxAttempts:this.MAX_RECONNECT_ATTEMPTS})}ngOnDestroy(){this.disconnect(),this.eventsSubject.complete(),this.connectionStatusSubject.complete()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var Qi=class o{http=m(Xe);projectState=m(ke);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}getThread(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createThread(t){let e=t?{name:t}:{};return this.http.post(this.getBaseUrl(),e)}updateThread(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{name:e})}updateThreadUsers(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{users:e})}starThread(t){return this.http.post(`${this.getBaseUrl()}/${t}/star`,{})}unstarThread(t){return this.http.delete(`${this.getBaseUrl()}/${t}/star`)}deleteThread(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}stopThread(t){return this.http.post(`${this.getBaseUrl()}/${t}/stop`,{})}getThreadMessages(t){return this.http.get(`${this.getBaseUrl()}/${t}/messages`)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var At=class o{selectedThreadIdSubject=new ce(null);isLoadingSubject=new ce(!1);isLoadingThreadListSubject=new ce(!1);refreshThreadListSubject=new R;threadListSubject=new ce([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=m(Qi);projectStateService=m(ke);projectName$=this.projectStateService.selectedProject$.pipe(ve(t=>t?.name),Da());constructor(){Yn([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(Mt(void 0))]).pipe(yt(([t])=>{t!==this.currentProjectName&&(console.log("[THREAD_STATE] Project changed, clearing thread list"),this.threadListSubject.next([]),this.currentProjectName=t),t?this.hasLoadedOncePerProject.get(t)?console.log("[THREAD_STATE] Refreshing thread list for project",t,"(no spinner)"):(console.log("[THREAD_STATE] Initial load for project",t,"- showing spinner"),this.isLoadingThreadListSubject.next(!0)):(console.log("[THREAD_STATE] No project selected, hiding spinner"),this.isLoadingThreadListSubject.next(!1))}),Qn(([t])=>t?(console.log("[THREAD_STATE] Fetching threads for project:",t),this.threadApi.listThreads().pipe(ve(e=>({threads:e,projectName:t})),kn(e=>(console.error("[THREAD_STATE] Error loading thread list:",e),Rt({threads:[],projectName:t}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),Rt({threads:[],projectName:null}))),yt(({threads:t,projectName:e})=>{console.log("[THREAD_STATE] Thread list loaded:",t.length,"threads for project",e),e&&this.hasLoadedOncePerProject.set(e,!0),this.isLoadingThreadListSubject.next(!1),this.threadListSubject.next(t)})).subscribe()}threadList$=this.threadListSubject.asObservable();refreshSelectedThreadSubject=new R;selectedThread$=Yn([this.projectName$,this.selectedThreadIdSubject.pipe(Da()),this.refreshSelectedThreadSubject.pipe(Mt(void 0))]).pipe(Qn(([t,e])=>!t||!e?Rt(null):(this.isLoadingSubject.next(!0),this.threadApi.getThread(e).pipe(Ar({bufferSize:1,refCount:!0})))),yt(()=>{this.isLoadingSubject.next(!1)}));selectThread(t){this.selectedThreadIdSubject.next(t)}getSelectedThreadId(){return this.selectedThreadIdSubject.value}getSelectedThreadIdOrThrow(){let t=this.selectedThreadIdSubject.value;if(!t)throw new Error("[THREAD_STATE] No thread selected");return t}clearSelection(){this.selectedThreadIdSubject.next(null)}stop(){let t=this.selectedThreadIdSubject.value;if(!t){console.error("[THREAD_STATE] Cannot stop: no thread selected");return}console.log("[THREAD_STATE] Stopping thread:",t),this.threadApi.stopThread(t).subscribe({next:e=>console.log("[THREAD_STATE] Stop signal sent:",e.message),error:e=>console.error("[THREAD_STATE] Error stopping thread:",e)})}refreshThreadList(){console.log("[THREAD_STATE] Manually refreshing thread list"),this.refreshThreadListSubject.next()}refreshSelectedThread(){this.refreshSelectedThreadSubject.next()}updateThreadUsers(t,e){return this.threadApi.updateThreadUsers(t,e).pipe(yt(()=>{this.refreshThreadList()}),kn(i=>(console.error("[THREAD_STATE] Error updating thread users:",i),Oo(()=>i))))}renameThread(t,e){let i=e.trim();return!i||i.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),Oo(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",t,"to:",i),this.threadApi.updateThread(t,i).pipe(yt(n=>{console.log("[THREAD_STATE] Thread renamed successfully:",n),this.refreshThreadList()}),kn(n=>(console.error("[THREAD_STATE] Error renaming thread:",n),Oo(()=>n)))))}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var or=class o{http=m(Xe);projectState=m(ke);threadState=m(At);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/messages`}getMessages(){return this.http.get(this.getBaseUrl())}sendMessage(t){return this.http.post(this.getBaseUrl(),t,{responseType:"text"})}sendFreeMessage(t){return this.http.post(this.getBaseUrl(),{message:t})}getMessage(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}deleteMessage(t){return this.http.delete(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}getFormattedMessage(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}/formatted`,{responseType:"text"})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var Xi=class o{http=m(Xe);usernameSubject=new ce(null);username$=this.usernameSubject.asObservable();fetchCurrentUser(){return this.http.get("/api/user/me").pipe(yt(t=>{this.usernameSubject.next(t.username)}))}getUsername(){return this.usernameSubject.value}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var Xt=class o{destroy$=new R;currentProject=null;currentThread=null;messagesSubject=new ce([]);isThinkingSubject=new ce(!1);currentChoiceSubject=new ce(null);projectTitleSubject=new ce("Coday");currentInviteEventSubject=new ce(null);messageToRestoreSubject=new ce("");threadUpdateEventSubject=new ce(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new ce("");subThreadEventsSubject=new R;subThreadEvents$=this.subThreadEventsSubject.asObservable();subThreadEventBuffers=new Map;getBufferedSubThreadEvents(t){return this.subThreadEventBuffers.get(t)??[]}messages$=this.messagesSubject.asObservable();streamingText$=this.streamingTextSubject.asObservable();isThinking$=this.isThinkingSubject.asObservable();currentChoice$=this.currentChoiceSubject.asObservable();currentInviteEvent$=this.currentInviteEventSubject.asObservable();messageToRestore$=this.messageToRestoreSubject.asObservable();threadUpdateEvent$=this.threadUpdateEventSubject.asObservable();connectionStatus$;tabTitleService=null;eventStream=m(Yi);messageApi=m(or);userService=m(Xi);constructor(){this.connectionStatus$=this.eventStream.connectionStatus$,this.initializeEventHandling()}setTabTitleService(t){this.tabTitleService=t}connectToThread(t,e){this.currentProject=t,this.currentThread=e,this.eventStream.connectToThread(t,e)}resetMessages(){this.messagesSubject.next([]),this.currentChoiceSubject.next(null),this.currentInviteEventSubject.next(null),this.currentChoiceEvent=null,this.accumulatedChunks="",this.streamingTextSubject.next(""),this.subThreadEventBuffers.clear(),this.stopThinking()}sendMessage(t){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send message: no project or thread selected");return}let e=this.currentInviteEventSubject.value;if(e){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive(),this.currentInviteEventSubject.next(null);let i=e.buildAnswer(t);this.handleAnswerEvent(i),this.messageApi.sendMessage(i).subscribe({error:n=>{console.error("[CODAY] Send invite answer error:",n),this.currentInviteEventSubject.next(e),this.stopThinking()}})}else this.messageApi.sendFreeMessage(t).subscribe({error:i=>{console.error("[CODAY] Send error:",i)}})}sendChoice(t){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send choice: no project or thread selected");return}if(this.currentChoiceEvent){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive();let e=this.currentChoiceEvent.buildAnswer(t);this.currentChoiceSubject.next(null),this.currentChoiceEvent=null,this.messageApi.sendMessage(e).subscribe({next:()=>{},error:i=>{console.error("[CODAY-CHOICE] Choice error:",i),this.stopThinking()}})}else console.error("[CODAY-CHOICE] No choice event available for choice:",t)}deleteMessage(t){let e=this.messagesSubject.value.find(n=>n.id===t),i=this.extractTextContentFromMessage(e);return this.messageApi.deleteMessage(t).pipe(yt(n=>{n.success&&(this.removeMessagesFromIndex(t),i.trim()&&this.messageToRestoreSubject.next(i))}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive()}initializeEventHandling(){this.eventStream.events$.pipe(N(this.destroy$)).subscribe({next:t=>this.handleEvent(t),error:t=>console.error("[CODAY] Event stream error:",t),complete:()=>console.log("[CODAY] Event stream completed")})}handleEvent(t){if(t.threadId&&t.threadId!==this.currentThread){let e=this.subThreadEventBuffers.get(t.threadId);e?e.push(t):this.subThreadEventBuffers.set(t.threadId,[t]),this.subThreadEventsSubject.next(t);return}t instanceof Ti?this.handleMessageEvent(t):t instanceof zn?this.handleTextChunkEvent(t):t instanceof qi?this.handleTextEvent(t):t instanceof Qt?this.handleAnswerEvent(t):t instanceof ki?this.handleErrorEvent(t):t instanceof uo?this.handleWarnEvent(t):t instanceof jn?this.handleThinkingEvent(t):t instanceof Mi?this.handleToolRequestEvent(t):t instanceof ci?this.handleToolResponseEvent(t):t instanceof bn?this.handleChoiceEvent(t):t instanceof tr?this.handleHeartBeatEvent(t):t instanceof _n?this.handleInviteEvent(t):t instanceof ir?this.handleThreadUpdateEvent(t):t instanceof Gi?this.handleDelegationEvent(t):t instanceof nr||t instanceof Ei||console.warn("[CODAY] Unhandled event type:",t.type)}handleDelegationEvent(t){if(console.log("[CODAY] DelegationEvent received:",t.subThreadId,t.agentName),this.messagesSubject.value.findIndex(n=>n.subThreadId===t.subThreadId)===-1){let n={id:t.timestamp,role:"system",speaker:t.agentName,content:[{type:"text",content:""}],timestamp:new Date,type:"delegation",subThreadId:t.subThreadId,delegationAgentName:t.agentName};this.addMessage(n)}}handleThreadUpdateEvent(t){this.threadUpdateEventSubject.next(t)}handleMessageEvent(t){t.role==="assistant"&&this.accumulatedChunks&&(this.accumulatedChunks="",this.streamingTextSubject.next(""));let e={id:t.timestamp,role:t.role,speaker:t.name,content:t.content,timestamp:t.date,type:"text"};this.addMessage(e)}handleTextChunkEvent(t){this.accumulatedChunks+=t.chunk,this.streamingTextSubject.next(this.accumulatedChunks)}handleTextEvent(t){let e={id:t.timestamp,role:t.speaker?"assistant":"system",speaker:t.speaker??"System",content:[{type:"text",content:t.text}],timestamp:t.date,type:t.speaker?"text":"technical"};this.addMessage(e)}handleAnswerEvent(t){let e={id:t.timestamp,role:"user",speaker:t.name??this.userService.getUsername()??"User",content:[{type:"text",content:t.answer}],timestamp:t.date,type:"text",parentKey:t.parentKey,invite:t.invite};this.addMessage(e)}handleErrorEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Error: ${JSON.stringify(t.error)}`}],timestamp:t.date,type:"error"};this.addMessage(e)}handleWarnEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Warning: ${JSON.stringify(t.warning)}`}],timestamp:t.date,type:"warning"};this.addMessage(e)}handleThinkingEvent(t){this.currentInviteEventSubject.value||this.currentChoiceEvent||(this.clearThinkingTimeout(),this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive(),this.thinkingTimeout=setTimeout(()=>{this.isThinkingSubject.next(!1),this.thinkingTimeout=null,this.tabTitleService?.setSystemInactive()},jn.debounce+1e3))}handleToolRequestEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:t.date,type:"technical",eventId:t.timestamp};this.addMessage(e)}handleToolResponseEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:t.date,type:"technical",eventId:t.timestamp};this.addMessage(e)}handleChoiceEvent(t){this.stopThinking(),this.currentChoiceEvent=t,this.tabTitleService?.setSystemInactive();let e=t.options.map(n=>({value:n,label:n})),i=t.optionalQuestion?`${t.optionalQuestion} ${t.invite}`:t.invite;this.currentChoiceSubject.next({options:e,label:i,allowFreeText:t.allowFreeText})}handleHeartBeatEvent(t){}handleInviteEvent(t){this.stopThinking();let e=this.messagesSubject.value,i=e[e.length-1];if(!(!(t.invite===gd)&&i&&i.role==="assistant"&&i.content.some(a=>a.type==="text"&&a.content.includes(t.invite)))&&t.invite!==gd){let a={id:t.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:t.invite}],timestamp:t.date,type:"text"};this.addMessage(a)}this.currentInviteEventSubject.next(t),this.tabTitleService?.setSystemInactive()}addMessage(t){let e=this.messagesSubject.value;e.some(i=>i.id===t.id)||this.messagesSubject.next([...e,t])}removeMessagesFromIndex(t){let e=this.messagesSubject.value,i=e.findIndex(r=>r.id===t);if(i===-1||i===0)return;let n=e.slice(0,i);this.messagesSubject.next(n),this.stopThinking()}extractTextContentFromMessage(t){return t?t.content.filter(e=>e.type==="text").map(e=>e.content).join(`
336
+ This ensures the memory system stays efficient and valuable.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""}];var OT=[Ti.type,Mi.type,ci.type,go.type,_n.type,bn.type,Qt.type,Gi.type];var Jh={CONFLUENCE:[],GIT:[],GIT_WORKTREE:[],GITLAB:[],JIRA:[],SLACK:[],ZENDESK:[],BASECAMP:[]},YT=Object.keys(Jh).filter(o=>Jh[o]?.length===0);var Yi=class o{eventSource=null;eventsSubject=new R;connectionStatusSubject=new ae({connected:!1,reconnectAttempts:0,maxAttempts:3});reconnectAttempts=0;MAX_RECONNECT_ATTEMPTS=3;RECONNECT_DELAY=2e3;events$=this.eventsSubject.asObservable();connectionStatus$=this.connectionStatusSubject.asObservable();ngZone=m(pe);connectToThread(t,e){console.log("[SSE] Connecting to thread event stream:",t,e),this.eventSource&&(console.log("[SSE] Closing existing EventSource"),this.eventSource.close());let i=`/api/projects/${t}/threads/${e}/event-stream`;console.log("[SSE] EventSource URL:",i),this.eventSource=new EventSource(i),this.setupEventHandlers()}setupEventHandlers(){this.eventSource&&(this.eventSource.onmessage=t=>{this.ngZone.run(()=>{console.log("[SSE] Message received:",t.data.substring(0,100)),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0);try{let e=JSON.parse(t.data),i=da(e);i?(console.log("[SSE] Event:",i.type),this.eventsSubject.next(i)):console.warn("[SSE] Failed to build event:",e.type)}catch(e){console.error("[SSE] Parse error:",e.message)}})},this.eventSource.onopen=()=>{this.ngZone.run(()=>{console.log("[SSE] Connection established"),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0)})},this.eventSource.onerror=t=>{this.ngZone.run(()=>{console.log("[SSE] EventSource error:",t),this.eventSource?.readyState===EventSource.CLOSED&&(console.log("[SSE] Connection closed"),this.updateConnectionStatus(!1,this.reconnectAttempts),this.reconnectAttempts<this.MAX_RECONNECT_ATTEMPTS?(console.log(`[SSE] Attempting reconnect ${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS}`),this.eventsSubject.next(new ki({error:new Error(`Connection lost. Attempting to reconnect (${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS})...`)})),setTimeout(()=>{this.reconnectAttempts++,console.warn("[SSE] Reconnection may not work properly with thread-based connections")},this.RECONNECT_DELAY)):(console.log("[SSE] Max reconnection attempts reached"),this.eventsSubject.next(new ki({error:new Error("Connection lost permanently. Please refresh the page.")}))))})})}disconnect(){this.eventSource&&(console.log("[SSE] Disconnecting EventSource"),this.eventSource.close(),this.eventSource=null,this.updateConnectionStatus(!1,0))}updateConnectionStatus(t,e){this.connectionStatusSubject.next({connected:t,reconnectAttempts:e,maxAttempts:this.MAX_RECONNECT_ATTEMPTS})}ngOnDestroy(){this.disconnect(),this.eventsSubject.complete(),this.connectionStatusSubject.complete()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var Qi=class o{http=m(Xe);projectState=m(ke);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}getThread(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createThread(t){let e=t?{name:t}:{};return this.http.post(this.getBaseUrl(),e)}updateThread(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{name:e})}updateThreadUsers(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{users:e})}starThread(t){return this.http.post(`${this.getBaseUrl()}/${t}/star`,{})}unstarThread(t){return this.http.delete(`${this.getBaseUrl()}/${t}/star`)}deleteThread(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}stopThread(t){return this.http.post(`${this.getBaseUrl()}/${t}/stop`,{})}getThreadMessages(t){return this.http.get(`${this.getBaseUrl()}/${t}/messages`)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var At=class o{selectedThreadIdSubject=new ae(null);isLoadingSubject=new ae(!1);isLoadingThreadListSubject=new ae(!1);refreshThreadListSubject=new R;threadListSubject=new ae([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=m(Qi);projectStateService=m(ke);projectName$=this.projectStateService.selectedProject$.pipe(ve(t=>t?.name),Da());constructor(){Yn([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(Mt(void 0))]).pipe(yt(([t])=>{t!==this.currentProjectName&&(console.log("[THREAD_STATE] Project changed, clearing thread list"),this.threadListSubject.next([]),this.currentProjectName=t),t?this.hasLoadedOncePerProject.get(t)?console.log("[THREAD_STATE] Refreshing thread list for project",t,"(no spinner)"):(console.log("[THREAD_STATE] Initial load for project",t,"- showing spinner"),this.isLoadingThreadListSubject.next(!0)):(console.log("[THREAD_STATE] No project selected, hiding spinner"),this.isLoadingThreadListSubject.next(!1))}),Qn(([t])=>t?(console.log("[THREAD_STATE] Fetching threads for project:",t),this.threadApi.listThreads().pipe(ve(e=>({threads:e,projectName:t})),kn(e=>(console.error("[THREAD_STATE] Error loading thread list:",e),Rt({threads:[],projectName:t}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),Rt({threads:[],projectName:null}))),yt(({threads:t,projectName:e})=>{console.log("[THREAD_STATE] Thread list loaded:",t.length,"threads for project",e),e&&this.hasLoadedOncePerProject.set(e,!0),this.isLoadingThreadListSubject.next(!1),this.threadListSubject.next(t)})).subscribe()}threadList$=this.threadListSubject.asObservable();refreshSelectedThreadSubject=new R;selectedThread$=Yn([this.projectName$,this.selectedThreadIdSubject.pipe(Da()),this.refreshSelectedThreadSubject.pipe(Mt(void 0))]).pipe(Qn(([t,e])=>!t||!e?Rt(null):(this.isLoadingSubject.next(!0),this.threadApi.getThread(e).pipe(Ar({bufferSize:1,refCount:!0})))),yt(()=>{this.isLoadingSubject.next(!1)}));selectThread(t){this.selectedThreadIdSubject.next(t)}getSelectedThreadId(){return this.selectedThreadIdSubject.value}getSelectedThreadIdOrThrow(){let t=this.selectedThreadIdSubject.value;if(!t)throw new Error("[THREAD_STATE] No thread selected");return t}clearSelection(){this.selectedThreadIdSubject.next(null)}stop(){let t=this.selectedThreadIdSubject.value;if(!t){console.error("[THREAD_STATE] Cannot stop: no thread selected");return}console.log("[THREAD_STATE] Stopping thread:",t),this.threadApi.stopThread(t).subscribe({next:e=>console.log("[THREAD_STATE] Stop signal sent:",e.message),error:e=>console.error("[THREAD_STATE] Error stopping thread:",e)})}refreshThreadList(){console.log("[THREAD_STATE] Manually refreshing thread list"),this.refreshThreadListSubject.next()}refreshSelectedThread(){this.refreshSelectedThreadSubject.next()}updateThreadUsers(t,e){return this.threadApi.updateThreadUsers(t,e).pipe(yt(()=>{this.refreshThreadList()}),kn(i=>(console.error("[THREAD_STATE] Error updating thread users:",i),Oo(()=>i))))}renameThread(t,e){let i=e.trim();return!i||i.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),Oo(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",t,"to:",i),this.threadApi.updateThread(t,i).pipe(yt(n=>{console.log("[THREAD_STATE] Thread renamed successfully:",n),this.refreshThreadList()}),kn(n=>(console.error("[THREAD_STATE] Error renaming thread:",n),Oo(()=>n)))))}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var or=class o{http=m(Xe);projectState=m(ke);threadState=m(At);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/messages`}getMessages(){return this.http.get(this.getBaseUrl())}sendMessage(t){return this.http.post(this.getBaseUrl(),t,{responseType:"text"})}sendFreeMessage(t){return this.http.post(this.getBaseUrl(),{message:t})}getMessage(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}deleteMessage(t){return this.http.delete(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}getFormattedMessage(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}/formatted`,{responseType:"text"})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var Xi=class o{http=m(Xe);usernameSubject=new ae(null);authEnabledSubject=new ae(!1);username$=this.usernameSubject.asObservable();authEnabled$=this.authEnabledSubject.asObservable();fetchCurrentUser(){return this.http.get("/api/user/me").pipe(yt(t=>{this.usernameSubject.next(t.username),this.authEnabledSubject.next(t.authEnabled)}))}getUsername(){return this.usernameSubject.value}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var Xt=class o{destroy$=new R;currentProject=null;currentThread=null;messagesSubject=new ae([]);isThinkingSubject=new ae(!1);currentChoiceSubject=new ae(null);projectTitleSubject=new ae("Coday");currentInviteEventSubject=new ae(null);messageToRestoreSubject=new ae("");threadUpdateEventSubject=new ae(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new ae("");subThreadEventsSubject=new R;subThreadEvents$=this.subThreadEventsSubject.asObservable();subThreadEventBuffers=new Map;getBufferedSubThreadEvents(t){return this.subThreadEventBuffers.get(t)??[]}messages$=this.messagesSubject.asObservable();streamingText$=this.streamingTextSubject.asObservable();isThinking$=this.isThinkingSubject.asObservable();currentChoice$=this.currentChoiceSubject.asObservable();currentInviteEvent$=this.currentInviteEventSubject.asObservable();messageToRestore$=this.messageToRestoreSubject.asObservable();threadUpdateEvent$=this.threadUpdateEventSubject.asObservable();connectionStatus$;tabTitleService=null;eventStream=m(Yi);messageApi=m(or);userService=m(Xi);constructor(){this.connectionStatus$=this.eventStream.connectionStatus$,this.initializeEventHandling()}setTabTitleService(t){this.tabTitleService=t}connectToThread(t,e){this.currentProject=t,this.currentThread=e,this.eventStream.connectToThread(t,e)}resetMessages(){this.messagesSubject.next([]),this.currentChoiceSubject.next(null),this.currentInviteEventSubject.next(null),this.currentChoiceEvent=null,this.accumulatedChunks="",this.streamingTextSubject.next(""),this.subThreadEventBuffers.clear(),this.stopThinking()}sendMessage(t){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send message: no project or thread selected");return}let e=this.currentInviteEventSubject.value;if(e){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive(),this.currentInviteEventSubject.next(null);let i=e.buildAnswer(t);this.handleAnswerEvent(i),this.messageApi.sendMessage(i).subscribe({error:n=>{console.error("[CODAY] Send invite answer error:",n),this.currentInviteEventSubject.next(e),this.stopThinking()}})}else this.messageApi.sendFreeMessage(t).subscribe({error:i=>{console.error("[CODAY] Send error:",i)}})}sendChoice(t){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send choice: no project or thread selected");return}if(this.currentChoiceEvent){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive();let e=this.currentChoiceEvent.buildAnswer(t);this.currentChoiceSubject.next(null),this.currentChoiceEvent=null,this.messageApi.sendMessage(e).subscribe({next:()=>{},error:i=>{console.error("[CODAY-CHOICE] Choice error:",i),this.stopThinking()}})}else console.error("[CODAY-CHOICE] No choice event available for choice:",t)}deleteMessage(t){let e=this.messagesSubject.value.find(n=>n.id===t),i=this.extractTextContentFromMessage(e);return this.messageApi.deleteMessage(t).pipe(yt(n=>{n.success&&(this.removeMessagesFromIndex(t),i.trim()&&this.messageToRestoreSubject.next(i))}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive()}initializeEventHandling(){this.eventStream.events$.pipe(N(this.destroy$)).subscribe({next:t=>this.handleEvent(t),error:t=>console.error("[CODAY] Event stream error:",t),complete:()=>console.log("[CODAY] Event stream completed")})}handleEvent(t){if(t.threadId&&t.threadId!==this.currentThread){let e=this.subThreadEventBuffers.get(t.threadId);e?e.push(t):this.subThreadEventBuffers.set(t.threadId,[t]),this.subThreadEventsSubject.next(t);return}t instanceof Ti?this.handleMessageEvent(t):t instanceof zn?this.handleTextChunkEvent(t):t instanceof qi?this.handleTextEvent(t):t instanceof Qt?this.handleAnswerEvent(t):t instanceof ki?this.handleErrorEvent(t):t instanceof uo?this.handleWarnEvent(t):t instanceof jn?this.handleThinkingEvent(t):t instanceof Mi?this.handleToolRequestEvent(t):t instanceof ci?this.handleToolResponseEvent(t):t instanceof bn?this.handleChoiceEvent(t):t instanceof tr?this.handleHeartBeatEvent(t):t instanceof _n?this.handleInviteEvent(t):t instanceof ir?this.handleThreadUpdateEvent(t):t instanceof Gi?this.handleDelegationEvent(t):t instanceof nr||t instanceof Ei||console.warn("[CODAY] Unhandled event type:",t.type)}handleDelegationEvent(t){if(console.log("[CODAY] DelegationEvent received:",t.subThreadId,t.agentName),this.messagesSubject.value.findIndex(n=>n.subThreadId===t.subThreadId)===-1){let n={id:t.timestamp,role:"system",speaker:t.agentName,content:[{type:"text",content:""}],timestamp:new Date,type:"delegation",subThreadId:t.subThreadId,delegationAgentName:t.agentName};this.addMessage(n)}}handleThreadUpdateEvent(t){this.threadUpdateEventSubject.next(t)}handleMessageEvent(t){t.role==="assistant"&&this.accumulatedChunks&&(this.accumulatedChunks="",this.streamingTextSubject.next(""));let e={id:t.timestamp,role:t.role,speaker:t.name,content:t.content,timestamp:t.date,type:"text"};this.addMessage(e)}handleTextChunkEvent(t){this.accumulatedChunks+=t.chunk,this.streamingTextSubject.next(this.accumulatedChunks)}handleTextEvent(t){let e={id:t.timestamp,role:t.speaker?"assistant":"system",speaker:t.speaker??"System",content:[{type:"text",content:t.text}],timestamp:t.date,type:t.speaker?"text":"technical"};this.addMessage(e)}handleAnswerEvent(t){let e={id:t.timestamp,role:"user",speaker:t.name??this.userService.getUsername()??"User",content:[{type:"text",content:t.answer}],timestamp:t.date,type:"text",parentKey:t.parentKey,invite:t.invite};this.addMessage(e)}handleErrorEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Error: ${JSON.stringify(t.error)}`}],timestamp:t.date,type:"error"};this.addMessage(e)}handleWarnEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Warning: ${JSON.stringify(t.warning)}`}],timestamp:t.date,type:"warning"};this.addMessage(e)}handleThinkingEvent(t){this.currentInviteEventSubject.value||this.currentChoiceEvent||(this.clearThinkingTimeout(),this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive(),this.thinkingTimeout=setTimeout(()=>{this.isThinkingSubject.next(!1),this.thinkingTimeout=null,this.tabTitleService?.setSystemInactive()},jn.debounce+1e3))}handleToolRequestEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:t.date,type:"technical",eventId:t.timestamp};this.addMessage(e)}handleToolResponseEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:t.date,type:"technical",eventId:t.timestamp};this.addMessage(e)}handleChoiceEvent(t){this.stopThinking(),this.currentChoiceEvent=t,this.tabTitleService?.setSystemInactive();let e=t.options.map(n=>({value:n,label:n})),i=t.optionalQuestion?`${t.optionalQuestion} ${t.invite}`:t.invite;this.currentChoiceSubject.next({options:e,label:i,allowFreeText:t.allowFreeText})}handleHeartBeatEvent(t){}handleInviteEvent(t){this.stopThinking();let e=this.messagesSubject.value,i=e[e.length-1];if(!(!(t.invite===gd)&&i&&i.role==="assistant"&&i.content.some(a=>a.type==="text"&&a.content.includes(t.invite)))&&t.invite!==gd){let a={id:t.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:t.invite}],timestamp:t.date,type:"text"};this.addMessage(a)}this.currentInviteEventSubject.next(t),this.tabTitleService?.setSystemInactive()}addMessage(t){let e=this.messagesSubject.value;e.some(i=>i.id===t.id)||this.messagesSubject.next([...e,t])}removeMessagesFromIndex(t){let e=this.messagesSubject.value,i=e.findIndex(r=>r.id===t);if(i===-1||i===0)return;let n=e.slice(0,i);this.messagesSubject.next(n),this.stopThinking()}extractTextContentFromMessage(t){return t?t.content.filter(e=>e.type==="text").map(e=>e.content).join(`
337
337
 
338
338
  `):""}clearThinkingTimeout(){this.thinkingTimeout&&(clearTimeout(this.thinkingTimeout),this.thinkingTimeout=null)}stopThinking(){this.clearThinkingTimeout(),this.isThinkingSubject.next(!1),this.tabTitleService&&this.tabTitleService.setSystemInactive()}ngOnDestroy(){this.clearThinkingTimeout(),this.destroy$.next(),this.destroy$.complete(),this.currentInviteEventSubject.complete(),this.messageToRestoreSubject.complete(),this.threadUpdateEventSubject.complete(),this.streamingTextSubject.complete(),this.eventStream.disconnect()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var rr=class o{http=m(Xe);agentsCache=new Map;getAgents(t){let e=this.agentsCache.get(t);return e?Rt(e):this.http.get(`/api/projects/${t}/agents`).pipe(yt(i=>{this.agentsCache.set(t,i)}))}getAgentsAutocomplete(t,e){return this.getAgents(t).pipe(ve(i=>{if(!e)return i;let n=e.toLowerCase();return i.filter(r=>{let a=r.name.toLowerCase(),c=r.description?.toLowerCase()||"";return a.includes(n)||c.includes(n)})}))}clearCache(t){this.agentsCache.delete(t)}clearAllCache(){this.agentsCache.clear()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var di=class o{http=m(Xe);projectState=m(ke);promptsCache=new Map;getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/prompts`}listPrompts(){return this.http.get(this.getBaseUrl())}getPromptsAutocomplete(t,e){let i=this.promptsCache.get(t);return i?Rt(this.filterPromptsForAutocomplete(i,e)):this.http.get(`/api/projects/${t}/prompts`).pipe(ve(n=>(this.promptsCache.set(t,n),this.filterPromptsForAutocomplete(n,e))))}filterPromptsForAutocomplete(t,e){let i=e.toLowerCase();return t.filter(r=>r.name.toLowerCase().includes(i)||r.description.toLowerCase().includes(i)).map(r=>({name:r.name,description:r.description,parameterFormat:r.parameterFormat}))}clearCache(t){t?this.promptsCache.delete(t):this.promptsCache.clear()}getPrompt(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createPrompt(t){return this.http.post(this.getBaseUrl(),t).pipe(ve(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}updatePrompt(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e).pipe(ve(i=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),i)))}deletePrompt(t){return this.http.delete(`${this.getBaseUrl()}/${t}`).pipe(ve(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}enableWebhook(t){return this.http.post(`${this.getBaseUrl()}/${t}/webhook`,{})}disableWebhook(t){return this.http.delete(`${this.getBaseUrl()}/${t}/webhook`)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var Xs=class o{sanitizer=m(Ri);transform(t,e){if(!e||!t)return t;let i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`(${i})`,"gi"),r=t.replace(n,"<strong>$1</strong>");return this.sanitizer.bypassSecurityTrustHtml(r)}static \u0275fac=function(e){return new(e||o)};static \u0275pipe=_m({name:"highlight",type:o,pure:!0})};var Rb=["messageInput"],Fb=["fileInput"],Nb=(o,t)=>t.name;function Lb(o,t){o&1&&(s(0,"div",3),I(1,"span",8),p(2," Recording... Click mic to stop "),l())}function Vb(o,t){if(o&1&&(s(0,"span",13),p(1),l()),o&2){let e=u().$implicit,i=u(2);d(),O(" "+(i.getParameterFormat(e)||""))}}function zb(o,t){if(o&1){let e=k();s(0,"div",10),f("click",function(){let n=b(e).$index,r=u(2);return v(r.selectAutocompleteItemByClick(n))})("keydown.enter",function(){let n=b(e).$index,r=u(2);return v(r.selectAutocompleteItemByClick(n))})("keydown.space",function(){let n=b(e).$index,r=u(2);return v(r.selectAutocompleteItemByClick(n))})("mouseenter",function(){let n=b(e).$index,r=u(2);return v(r.selectedAutocompleteIndex=n)}),s(1,"div",11),I(2,"span",12),io(3,"highlight"),C(4,Vb,2,1,"span",13),l(),I(5,"div",14),io(6,"highlight"),l()}if(o&2){let e=t.$implicit,i=t.$index,n=u(2);E("selected",i===n.selectedAutocompleteIndex),J("aria-selected",i===n.selectedAutocompleteIndex),d(2),w("innerHTML",Rr(3,6,n.autocompleteTrigger+e.name,n.getAutocompleteQuery()),Zt),d(2),x(n.hasParameterFormat(e)?4:-1),d(),w("innerHTML",Rr(6,9,e.description,n.getAutocompleteQuery()),Zt)}}function jb(o,t){if(o&1&&(s(0,"div",4),we(1,zb,7,12,"div",9,Nb),l()),o&2){let e=u();d(),Se(e.autocompleteItems)}}function Bb(o,t){if(o&1){let e=k();s(0,"ds-icon-button",17),f("action",function(){b(e);let n=u(2);return v(n.onStopClick())}),l()}}function Hb(o,t){if(o&1){let e=k();s(0,"ds-icon-button",18),f("action",function(){b(e);let n=u(2);return v(n.sendMessage())}),l()}if(o&2){let e=u(2);E("hidden",e.isDisabled||!e.message.trim())("active",!!e.message.trim()&&!e.isDisabled),w("title",e.getSendButtonTooltip())("disabled",e.isDisabled||!e.message.trim())}}function Ub(o,t){if(o&1){let e=k();s(0,"ds-icon-button",20),f("action",function(){b(e);let n=u(3);return v(n.triggerFileUpload())}),l(),s(1,"input",21,1),f("change",function(n){b(e);let r=u(3);return v(r.onFileInputChange(n))}),l()}if(o&2){let e=u(3);w("disabled",e.isDisabled)}}function Wb(o,t){if(o&1){let e=k();C(0,Ub,3,1),s(1,"ds-icon-button",19),f("action",function(){b(e);let n=u(2);return v(n.toggleRecording())}),l()}if(o&2){let e=u(2);x(e.showWelcome?-1:0),d(),E("recording",e.isRecording)("hidden",e.message.trim()),w("icon",e.isRecording?"fiber_manual_record":"mic")("title",e.isRecording?"Click to stop recording":"Click to start recording")}}function $b(o,t){if(o&1&&(s(0,"div",7),C(1,Bb,1,0,"ds-icon-button",15),C(2,Hb,1,6,"ds-icon-button",16),C(3,Wb,2,7),l()),o&2){let e=u();d(),x(e.isThinking?1:-1),d(),x(!e.isThinking||e.message.trim()?2:-1),d(),x(e.isThinking?-1:3)}}var ar=class o{isDisabled=!1;showWelcome=!1;isThinking=!1;isStarting=!1;isSessionInitializing=!1;isStopping=!1;filesPasted=new H;messageSubmitted=new H;voiceRecordingToggled=new H;heightChanged=new H;stopRequested=new H;textareaFocused=new H;messageInput;fileInput;message="";isRecording=!1;isFocused=!1;recognition=null;sessionHadTranscript=!1;pendingLineBreaksTimeout=null;lastProcessedResultIndex=0;useEnterToSend=!1;currentInvite="";subscriptions=[];thinkingPhrases=["Processing request...","Thinking...","Working on it..."];currentThinkingPhrase="Processing request...";thinkingPhraseIndex=0;thinkingInterval=null;autocompleteVisible=!1;autocompleteTrigger=null;autocompleteItems=[];selectedAutocompleteIndex=0;preferencesService=m(at);codayService=m(Xt);agentApiService=m(rr);promptApiService=m(di);projectStateService=m(ke);ngOnInit(){this.initializeVoiceInput(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.subscriptions.push(this.preferencesService.voiceLanguage$.subscribe(()=>this.updateRecognitionLanguage())),this.subscriptions.push(this.preferencesService.enterToSend$.subscribe(t=>{this.useEnterToSend=t})),this.subscribeToInviteEvents(),this.subscribeToMessageRestore()}ngAfterViewInit(){this.adjustTextareaHeight(),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),200)})}ngOnChanges(t){t.isThinking&&(t.isThinking.currentValue?this.startThinkingAnimation():(this.stopThinkingAnimation(),this.isStopping=!1,t.isThinking.previousValue&&(console.log("[CHAT-TEXTAREA] Thinking ended, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})))),t.isSessionInitializing&&!t.isSessionInitializing.currentValue&&t.isSessionInitializing.previousValue&&(console.log("[CHAT-TEXTAREA] Session initialization completed, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})),t.isStarting&&!t.isStarting.currentValue&&t.isStarting.previousValue&&this.isThinking&&(this.thinkingPhraseIndex===0?(console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index 0 - restarting animation"),this.stopThinkingAnimation(),this.startThinkingAnimation()):console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index",this.thinkingPhraseIndex,"- continuing without restart"))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[],this.clearPendingLineBreaks(),this.stopThinkingAnimation()}onKeyDown(t){if(this.autocompleteVisible)switch(t.key){case"ArrowDown":t.preventDefault(),this.selectedAutocompleteIndex=Math.min(this.selectedAutocompleteIndex+1,this.autocompleteItems.length-1),this.scrollSelectedItemIntoView();return;case"ArrowUp":t.preventDefault(),this.selectedAutocompleteIndex=Math.max(this.selectedAutocompleteIndex-1,0),this.scrollSelectedItemIntoView();return;case"Tab":case"Enter":if(!this.message.includes(" ")){t.preventDefault(),this.selectAutocompleteItem();return}break;case"Escape":t.preventDefault(),this.hideAutocomplete();return}t.key==="Enter"&&(this.useEnterToSend?!t.shiftKey&&!t.metaKey&&!t.ctrlKey&&(t.preventDefault(),this.sendMessage(!0)):(navigator.platform.toLowerCase().includes("mac")?t.metaKey:t.ctrlKey)&&!t.shiftKey&&(t.preventDefault(),this.sendMessage(!0)))}onInput(){this.adjustTextareaHeight(),this.checkForAutocomplete()}onPaste(t){let e=t.clipboardData?.items;if(!e)return;let i=Array.from(e).filter(r=>r.kind==="file");if(!i.length)return;t.preventDefault();let n=i.reduce((r,a)=>{let c=a.getAsFile();return c?[...r,c]:r},[]);n.length&&this.filesPasted.emit(n)}triggerFileUpload(){console.log("[CHAT-TEXTAREA] Triggering file upload"),this.fileInput?.nativeElement?.click()}onFileInputChange(t){let e=t.target,i=e.files;if(!i||i.length===0){console.log("[CHAT-TEXTAREA] No files selected");return}console.log("[CHAT-TEXTAREA] Files selected:",i.length);let n=Array.from(i);this.filesPasted.emit(n),e.value=""}onDocumentClick(t){if(!this.autocompleteVisible)return;let e=t.target,i=document.querySelector(".autocomplete-popup"),n=this.messageInput?.nativeElement;i&&!i.contains(e)&&n&&!n.contains(e)&&this.hideAutocomplete()}sendMessage(t=!1){let e=this.message.trim();!this.isDisabled&&(t||e)&&(this.isRecording&&this.recognition&&(this.clearPendingLineBreaks(),this.recognition.stop()),this.messageSubmitted.emit(e),this.message="",setTimeout(()=>this.adjustTextareaHeight(),0))}onStopClick(){this.isStopping=!0,this.stopRequested.emit()}toggleRecording(){this.isRecording?this.stopRecording():this.startRecording()}initializeVoiceInput(){let t=window.SpeechRecognition??window.webkitSpeechRecognition;if(console.log("[SPEECH] speechRecognition",t),!t){console.warn("[SPEECH] Speech Recognition API not available");return}this.recognition=new t,this.recognition.continuous=!0,this.recognition.interimResults=!0,this.recognition.maxAlternatives=1,this.recognition.lang=this.getSelectedLanguage();try{"grammars"in this.recognition&&(this.recognition.serviceURI=void 0)}catch{console.log("[SPEECH] Advanced speech recognition parameters not supported")}this.recognition.onresult=e=>{let i="",n=Math.max(e.resultIndex,this.lastProcessedResultIndex);for(let r=n;r<e.results.length;r++)e.results[r].isFinal&&(i+=e.results[r][0].transcript,this.lastProcessedResultIndex=r+1);if(i){let r=this.improveTranscriptPunctuation(i.trim());this.sessionHadTranscript=!0,console.log("[SPEECH] onresult ending, appending to textarea",this.isRecording),this.appendToTextarea(r)}},this.recognition.onend=()=>{console.log("[SPEECH] Recognition ended. Was recording:",this.isRecording),this.isRecording=!1,this.lastProcessedResultIndex=0,this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onerror=e=>{console.error("[SPEECH] Speech recognition error:",e.error),console.log("[SPEECH] Error details:",{error:e.error,message:e.message,timeStamp:e.timeStamp}),this.isRecording=!1,this.lastProcessedResultIndex=0,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onstart=()=>{console.log("[SPEECH] Recognition started successfully")},this.recognition.onspeechstart=()=>{console.log("[SPEECH] Speech detected")},this.recognition.onspeechend=()=>{console.log("[SPEECH] Speech ended")}}startRecording(){return te(this,null,function*(){if(!(!this.recognition||this.isRecording))try{this.isRecording=!0,this.sessionHadTranscript=!1,this.lastProcessedResultIndex=0,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording),this.recognition.start(),console.log("[SPEECH] Started recording")}catch(t){console.error("[SPEECH] Failed to start recording:",t),this.isRecording=!1,this.voiceRecordingToggled.emit(this.isRecording)}})}stopRecording(){if(!this.recognition||!this.isRecording){console.log("[SPEECH] stopRecording not recording");return}try{console.log("[SPEECH] stopRecording recognition stop"),this.recognition.stop(),this.schedulePendingLineBreaks()}catch(t){console.error("[SPEECH] Failed to stop recording:",t)}}getSelectedLanguage(){return this.preferencesService.getVoiceLanguage()}updateRecognitionLanguage(){if(this.recognition){let t=this.getSelectedLanguage();this.recognition.lang=t,console.log("[SPEECH] Language changed to:",t)}}improveTranscriptPunctuation(t){let e=t;return/[.!?]$/.test(e.trim())||(e=e.trim()+"."),e=e.charAt(0).toUpperCase()+e.slice(1),e=e.replace(/\s+/g," "),e=e+" ",e}appendToTextarea(t){let e=this.message;if(this.message=e?`${e}${t}`:t,this.messageInput?.nativeElement){this.messageInput.nativeElement.focus();let i=this.message.length;this.messageInput.nativeElement.setSelectionRange(i,i)}setTimeout(()=>this.adjustTextareaHeight(),0)}schedulePendingLineBreaks(){this.clearPendingLineBreaks(),this.pendingLineBreaksTimeout=window.setTimeout(()=>{this.sessionHadTranscript&&(console.log("[SPEECH] Adding line breaks after transcript session"),this.appendToTextarea(`
339
339
 
@@ -349,7 +349,7 @@ This ensures the memory system stays efficient and valuable.`],createdBy:"system
349
349
  `;e.push(a)}return e.join("")})}onCopy(){let t=this.extractTextContent();t.trim()&&navigator.clipboard.writeText(t).then(()=>{console.log("[CHAT-MESSAGE] Message copied to clipboard"),this.notificationService.success("Message copied to clipboard")}).catch(e=>{console.error("[CHAT-MESSAGE] Failed to copy message:",e),this.notificationService.error("Failed to copy message")}),this.copyRequested.emit(this.message)}onDelete(){console.log("[CHAT-MESSAGE] Delete requested for message:",this.message.id),this.deleteRequested.emit(this.message)}extractTextContent(){return this.message.content.filter(t=>t.type==="text").map(t=>t.content).join(`
350
350
 
351
351
  `)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-chat-message"]],inputs:{message:"message",canDelete:"canDelete",isOtherUser:"isOtherUser"},outputs:{copyRequested:"copyRequested",deleteRequested:"deleteRequested"},features:[Ye([Nr])],decls:6,vars:8,consts:[[1,"message-wrapper",3,"ngClass"],[1,"message",3,"ngClass"],[1,"simple-content","markdown-content"],[1,"actions","assistant-top-actions"],[1,"actions","user-top-actions"],[1,"message-header"],[1,"content","markdown-content",3,"innerHTML"],[1,"message-timestamp"],[1,"actions","bottom-actions"],[1,"speaker"],[3,"actions"],[3,"innerHTML"],["target","_blank",1,"event-link",3,"href"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1),C(2,Zb,4,4),C(3,e0,3,2,"div",2),l(),C(4,t0,2,1,"div",3),C(5,i0,2,1,"div",4),l()),e&2&&(w("ngClass",Va(6,Yb,i.message.role==="user")),d(),w("ngClass",i.messageClasses),d(),x(i.isSimplified?-1:2),d(),x(i.isSimplified?3:-1),d(),x(!i.isLongMessage&&i.shouldShowActions&&i.message.role==="assistant"?4:-1),d(),x(i.shouldShowActions&&i.message.role==="user"?5:-1))},dependencies:[Ks,On],styles:[".message-wrapper[_ngcontent-%COMP%]{margin:0;display:flex;align-items:flex-start;gap:.5rem}.message-wrapper.user-message-wrapper[_ngcontent-%COMP%]{margin:.75rem 0;flex-direction:row-reverse;align-items:flex-start}.message-wrapper.user-message-wrapper[_ngcontent-%COMP%]:has(.other-user){flex-direction:row}.message[_ngcontent-%COMP%]{position:relative}.message.user[_ngcontent-%COMP%]{padding:1rem 1.25rem .5rem;background:var(--color-message-user);border-radius:18px 18px 6px;border:1px solid var(--glass-border);box-shadow:none;backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);width:fit-content;max-width:75%;min-width:120px;word-wrap:break-word;transition:transform .2s ease,box-shadow .2s ease}.message.user[_ngcontent-%COMP%] .message-timestamp[_ngcontent-%COMP%]{display:block;text-align:right;font-size:.7rem;color:var(--color-text-secondary, #6272a4);white-space:nowrap;margin-top:.4rem;opacity:.7}.message.user[_ngcontent-%COMP%]:hover{transform:translateY(-1px);box-shadow:0 12px 40px #1f268733}.message.user.other-user[_ngcontent-%COMP%]{border-bottom-right-radius:18px;border-bottom-left-radius:6px}.message.assistant[_ngcontent-%COMP%]{background:transparent;border:none;box-shadow:none;border-radius:0;margin-left:0;margin-right:auto;padding:.5rem 0;width:100%;max-width:none;min-width:0}.message.system[_ngcontent-%COMP%], .message.technical[_ngcontent-%COMP%]{padding:.5rem .75rem;background:transparent;border:none;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;margin:0;font-family:SF Mono,Monaco,Menlo,monospace;font-size:.85rem;color:var(--color-text-secondary);max-width:none;width:auto;min-width:auto}.message.system[_ngcontent-%COMP%]:hover, .message.technical[_ngcontent-%COMP%]:hover{transform:none;box-shadow:none}.message.hidden-technical[_ngcontent-%COMP%], .message.hidden-warning[_ngcontent-%COMP%]{display:none!important}.message.error[_ngcontent-%COMP%]{padding:1rem 1.25rem;background:#ff3b301f;border-left:3px solid var(--color-error);color:var(--color-error)}.message.warning[_ngcontent-%COMP%]{padding:1rem 1.25rem;background:#ff95001f;border-left:3px solid var(--color-warning);color:var(--color-warning)}.message-header[_ngcontent-%COMP%]{margin-bottom:.5rem}.speaker[_ngcontent-%COMP%]{font-weight:600;font-size:.85rem;color:var(--color-text-secondary, #6272a4)}.content[_ngcontent-%COMP%]{line-height:1.5}.context-menu-top[_ngcontent-%COMP%]{top:.5rem;right:.5rem;z-index:10}.context-menu-bottom[_ngcontent-%COMP%]{bottom:.5rem;right:.5rem;z-index:10}.user-top-actions[_ngcontent-%COMP%]{display:flex;align-items:flex-start;padding-top:.5rem;opacity:0;transition:opacity .2s ease}.user-message-wrapper[_ngcontent-%COMP%]:hover .user-top-actions[_ngcontent-%COMP%]{opacity:1}.assistant-top-actions[_ngcontent-%COMP%]{display:flex;align-items:flex-start;padding-top:.5rem;opacity:0;transition:opacity .2s ease}.message-wrapper[_ngcontent-%COMP%]:hover .assistant-top-actions[_ngcontent-%COMP%]{opacity:1}.simple-content[_ngcontent-%COMP%]{display:flex}.simple-content[_ngcontent-%COMP%] .event-link[_ngcontent-%COMP%]{margin-left:5px;font-size:.9em;color:var(--color-link, #3498db);text-decoration:none}.simple-content[_ngcontent-%COMP%] .event-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.text-part[_ngcontent-%COMP%]{margin:4px 0}.image-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;margin:1em 0}.message-image[_ngcontent-%COMP%]{display:block;max-width:100%;height:auto;margin:8px 0;border-radius:12px;cursor:pointer;box-shadow:var(--glass-shadow);transition:transform .3s ease,box-shadow .3s ease;border:1px solid var(--glass-border)}.message-image[_ngcontent-%COMP%]:hover{transform:scale(1.02) translateY(-2px);box-shadow:0 16px 48px #00000026}@media (max-width: 768px){.message-image[_ngcontent-%COMP%]{border-radius:4px;margin:6px 0}}@media (max-width: 480px){.message-image[_ngcontent-%COMP%]{margin:4px 0}}"]})};var n0=["determinateSpinner"];function o0(o,t){if(o&1&&(nn(),s(0,"svg",11),I(1,"circle",12),l()),o&2){let e=u();J("viewBox",e._viewBox()),d(),oi("stroke-dasharray",e._strokeCircumference(),"px")("stroke-dashoffset",e._strokeCircumference()/2,"px")("stroke-width",e._circleStrokeWidth(),"%"),J("r",e._circleRadius())}}var r0=new oe("mat-progress-spinner-default-options",{providedIn:"root",factory:a0});function a0(){return{diameter:eu}}var eu=100,s0=10,lr=(()=>{class o{_elementRef=m(ne);_noopAnimations;get color(){return this._color||this._defaultColor}set color(e){this._color=e}_color;_defaultColor="primary";_determinateCircle;constructor(){let e=m(r0),i=Hm(),n=this._elementRef.nativeElement;this._noopAnimations=i==="di-disabled"&&!!e&&!e._forceAnimations,this.mode=n.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&i==="reduced-motion"&&n.classList.add("mat-progress-spinner-reduced-motion"),e&&(e.color&&(this.color=this._defaultColor=e.color),e.diameter&&(this.diameter=e.diameter),e.strokeWidth&&(this.strokeWidth=e.strokeWidth))}mode;get value(){return this.mode==="determinate"?this._value:0}set value(e){this._value=Math.max(0,Math.min(100,e||0))}_value=0;get diameter(){return this._diameter}set diameter(e){this._diameter=e||0}_diameter=eu;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(e){this._strokeWidth=e||0}_strokeWidth;_circleRadius(){return(this.diameter-s0)/2}_viewBox(){let e=this._circleRadius()*2+this.strokeWidth;return`0 0 ${e} ${e}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(i,n){if(i&1&&X(n0,5),i&2){let r;U(r=W())&&(n._determinateCircle=r.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(i,n){i&2&&(J("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",n.mode==="determinate"?n.value:null)("mode",n.mode),on("mat-"+n.color),oi("width",n.diameter,"px")("height",n.diameter,"px")("--mat-progress-spinner-size",n.diameter+"px")("--mat-progress-spinner-active-indicator-width",n.diameter+"px"),E("_mat-animation-noopable",n._noopAnimations)("mdc-circular-progress--indeterminate",n.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",gi],diameter:[2,"diameter","diameter",gi],strokeWidth:[2,"strokeWidth","strokeWidth",gi]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(i,n){if(i&1&&(Re(0,o0,2,8,"ng-template",null,0,Do),s(2,"div",2,1),nn(),s(4,"svg",3),I(5,"circle",4),l()(),Na(),s(6,"div",5)(7,"div",6)(8,"div",7),to(9,8),l(),s(10,"div",9),to(11,8),l(),s(12,"div",10),to(13,8),l()()()),i&2){let r=Et(1);d(4),J("viewBox",n._viewBox()),d(),oi("stroke-dasharray",n._strokeCircumference(),"px")("stroke-dashoffset",n._strokeDashOffset(),"px")("stroke-width",n._circleStrokeWidth(),"%"),J("r",n._circleRadius()),d(4),w("ngTemplateOutlet",r),d(2),w("ngTemplateOutlet",r),d(2),w("ngTemplateOutlet",r)}},dependencies:[Ro],styles:[`.mat-mdc-progress-spinner{--mat-progress-spinner-animation-multiplier: 1;display:block;overflow:hidden;line-height:0;position:relative;direction:ltr;transition:opacity 250ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-progress-spinner circle{stroke-width:var(--mat-progress-spinner-active-indicator-width, 4px)}.mat-mdc-progress-spinner._mat-animation-noopable,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle{transition:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container{animation:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle{stroke-dasharray:0 !important}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle{stroke:currentColor;stroke:CanvasText}}.mat-progress-spinner-reduced-motion{--mat-progress-spinner-animation-multiplier: 1.25}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1;animation:mdc-circular-progress-container-rotate calc(1568.2352941176ms*var(--mat-progress-spinner-animation-multiplier)) linear infinite}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:rgba(0,0,0,0)}.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:var(--mat-progress-spinner-active-indicator-color, var(--mat-sys-primary))}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:CanvasText}}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate calc(5332ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}
352
- `],encapsulation:2,changeDetection:0})}return o})();var cr=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({imports:[le]})}return o})();var l0=(o,t)=>t.id;function c0(o,t){if(o&1&&(s(0,"span",4),p(1),l()),o&2){let e=u();d(),O(e.taskSummary)}}function d0(o,t){o&1&&(s(0,"div",6),I(1,"mat-spinner",8),s(2,"span"),p(3,"Loading..."),l()()),o&2&&(d(),w("diameter",16))}function m0(o,t){if(o&1&&I(0,"app-delegation-inline",9),o&2){let e=u().$implicit;w("subThreadId",e.subThreadId)("agentName",e.delegationAgentName)}}function p0(o,t){if(o&1&&I(0,"app-chat-message",10),o&2){let e=u().$implicit;w("message",e)("canDelete",!1)}}function h0(o,t){if(o&1&&C(0,m0,1,2,"app-delegation-inline",9)(1,p0,1,2,"app-chat-message",10),o&2){let e=t.$implicit;x(e.type==="delegation"?0:1)}}function u0(o,t){if(o&1&&(s(0,"div",7)(1,"div",11),p(2),l()()),o&2){let e=u(2);d(2),O(e.streamingText)}}function g0(o,t){if(o&1&&(s(0,"div",5),C(1,d0,4,1,"div",6),we(2,h0,2,1,null,null,l0),C(4,u0,3,1,"div",7),l()),o&2){let e=u();d(),x(e.isLoading?1:-1),d(),Se(e.subMessages),d(2),x(e.streamingText?4:-1)}}var Js=class o{subThreadId;agentName;isExpanded=!1;isLoading=!1;subMessages=[];streamingText="";eventSubscription;codayService=m(Xt);threadApi=m(Qi);get taskSummary(){let t=this.subMessages.find(e=>e.role==="user");if(t){let e=t.content.filter(i=>i.type==="text").map(i=>i.content).join(" ");return e.length>120?e.substring(0,120)+"...":e}return""}ngOnInit(){for(let t of this.codayService.getBufferedSubThreadEvents(this.subThreadId))this.handleSubThreadEvent(t);this.eventSubscription=this.codayService.subThreadEvents$.pipe(me(t=>t.threadId===this.subThreadId)).subscribe(t=>this.handleSubThreadEvent(t))}ngOnDestroy(){this.eventSubscription?.unsubscribe()}toggle(){this.isExpanded=!this.isExpanded,this.isExpanded&&this.loadSubThreadMessages()}loadSubThreadMessages(){this.isLoading=!0,this.threadApi.getThreadMessages(this.subThreadId).subscribe({next:t=>{if(t.messages){this.subMessages=[];for(let e of t.messages){let i=da(e);i&&this.handleSubThreadEvent(i)}}this.isLoading=!1},error:t=>{console.error("[DELEGATION-INLINE] Failed to load sub-thread messages:",t),this.isLoading=!1}})}handleSubThreadEvent(t){t instanceof Qt?this.addMessage({id:t.timestamp,role:"user",speaker:"User",content:[{type:"text",content:t.answer}],timestamp:new Date,type:"text"}):t instanceof zn?this.streamingText+=t.chunk:t instanceof Ti?(t.role==="assistant"&&(this.streamingText=""),this.addMessage({id:t.timestamp,role:t.role,speaker:t.name,content:t.content,timestamp:new Date,type:"text"})):t instanceof Mi?this.addMessage({id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:new Date,type:"technical",eventId:t.timestamp}):t instanceof ci?this.addMessage({id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:new Date,type:"technical",eventId:t.timestamp}):t instanceof Gi?this.addMessage({id:t.timestamp,role:"system",speaker:t.agentName,content:[{type:"text",content:""}],timestamp:new Date,type:"delegation",subThreadId:t.subThreadId,delegationAgentName:t.agentName}):t instanceof qi&&this.addMessage({id:t.timestamp,role:"system",speaker:t.speaker??"System",content:[{type:"text",content:t.text}],timestamp:new Date,type:"technical"})}addMessage(t){this.subMessages=[...this.subMessages,t]}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-delegation-inline"]],inputs:{subThreadId:"subThreadId",agentName:"agentName"},decls:8,vars:4,consts:[[1,"delegation-inline"],["role","button","tabindex","0",1,"delegation-header",3,"click","keydown.enter","keydown.space"],[1,"expand-icon"],[1,"agent-name"],[1,"task-summary"],[1,"delegation-body"],[1,"loading"],[1,"streaming-message"],[3,"diameter"],[3,"subThreadId","agentName"],[3,"message","canDelete"],[1,"content"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1),f("click",function(){return i.toggle()})("keydown.enter",function(){return i.toggle()})("keydown.space",function(){return i.toggle()}),s(2,"mat-icon",2),p(3),l(),s(4,"span",3),p(5),l(),C(6,c0,2,1,"span",4),l(),C(7,g0,5,2,"div",5),l()),e&2&&(d(3),O(i.isExpanded?"expand_more":"chevron_right"),d(2),O(i.agentName),d(),x(i.taskSummary?6:-1),d(),x(i.isExpanded?7:-1))},dependencies:[o,Fe,Me,he,cr,lr,sr],styles:[".delegation-inline[_ngcontent-%COMP%]{margin:.5rem 0;border-left:3px solid var(--color-primary, #6366f1);border-radius:4px;background:var(--color-bg-secondary);overflow:hidden}.delegation-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;cursor:pointer;-webkit-user-select:none;user-select:none}.delegation-header[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.delegation-header[_ngcontent-%COMP%] .expand-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-text-secondary, #94a3b8)}.delegation-header[_ngcontent-%COMP%] .agent-name[_ngcontent-%COMP%]{font-weight:600;color:var(--color-primary, #6366f1);white-space:nowrap}.delegation-header[_ngcontent-%COMP%] .task-summary[_ngcontent-%COMP%]{flex:1;color:var(--color-text-secondary, #94a3b8);font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.delegation-body[_ngcontent-%COMP%]{padding:0 .75rem .75rem 1.5rem;border-top:1px solid var(--color-border-light)}.delegation-body[_ngcontent-%COMP%] .loading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 0;color:var(--color-text-secondary, #94a3b8);font-size:.85rem}.delegation-body[_ngcontent-%COMP%] .sub-messages[_ngcontent-%COMP%]{padding:.5rem 0}"]})};var dr=class o{unreadCountSubject=new ce(0);unreadCount$=this.unreadCountSubject.asObservable();constructor(){console.log("[UNREAD] Service initialized")}addUnread(){let e=this.unreadCountSubject.value+1;this.unreadCountSubject.next(e),console.log("[UNREAD] Added unread message, total:",e)}markAllAsRead(){this.unreadCountSubject.value>0&&(this.unreadCountSubject.next(0),console.log("[UNREAD] Marked all messages as read"))}getCurrentCount(){return this.unreadCountSubject.value}reset(){this.unreadCountSubject.next(0),console.log("[UNREAD] Counter reset")}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var mr=class o{destroy$=new R;voices;currentUtterance=null;currentOnEndCallback=null;speakingSubject=new ce(!1);speaking$=this.speakingSubject.asObservable();volume=.8;rate=1.2;language="en-US";selectedVoice;preferencesService=m(at);constructor(){this.initializeSpeechSynthesis(),this.subscribeToPreferences()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.stopSpeech()}initializeSpeechSynthesis(){if(!("speechSynthesis"in window)){console.warn("[VOICE-SERVICE] Speech synthesis not available"),this.voices=new Promise(t=>t([]));return}this.voices=new Promise((t,e)=>{let i=speechSynthesis.getVoices();if(i.length)t(i);else{let n=setTimeout(()=>{e("no voices found")},2e3);speechSynthesis.addEventListener("voiceschanged",()=>{let r=speechSynthesis.getVoices();r.length&&(clearTimeout(n),t(r))})}}),console.log("[VOICE-SERVICE] Speech synthesis initialized")}subscribeToPreferences(){this.preferencesService.voiceVolume$.pipe(N(this.destroy$)).subscribe(t=>{this.volume=t,console.log("[VOICE-SERVICE] Volume updated to:",t)}),this.preferencesService.voiceRate$.pipe(N(this.destroy$)).subscribe(t=>{this.rate=t,console.log("[VOICE-SERVICE] Rate updated to:",t)}),this.preferencesService.voiceLanguage$.pipe(N(this.destroy$)).subscribe(t=>{this.language=t,console.log("[VOICE-SERVICE] Language updated to:",t),this.updateSelectedVoiceForLanguage()}),this.preferencesService.selectedVoice$.pipe(N(this.destroy$)).subscribe(t=>{this.setSelectedVoice(t)}),this.volume=this.preferencesService.getVoiceVolume(),this.rate=this.preferencesService.getVoiceRate(),this.language=this.preferencesService.getVoiceLanguage(),this.setSelectedVoice(this.preferencesService.getSelectedVoice())}isReady(){return"speechSynthesis"in window&&this.selectedVoice!==void 0}isSpeaking(){return speechSynthesis.speaking}speak(t,e){return te(this,null,function*(){if(!this.selectedVoice)return console.warn("[VOICE-SERVICE] No voice selected"),!1;if(!t.trim())return console.warn("[VOICE-SERVICE] No text to speak"),!1;let i=this.extractPlainText(t);if(!i.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),!1;this.stopSpeech();try{let n=new SpeechSynthesisUtterance(i);n.voice=this.selectedVoice,n.lang=this.selectedVoice.lang,n.volume=this.volume,n.rate=this.rate,this.currentOnEndCallback=e||null,e&&(n.onend=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())},n.onerror=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())}),this.currentUtterance=n,this.speakingSubject.next(!0);let r=n.onend,a=n.onerror;return n.onend=c=>{this.speakingSubject.next(!1),r&&r.call(n,c)},n.onerror=c=>{this.speakingSubject.next(!1),a&&a.call(n,c)},speechSynthesis.speak(n),console.log("[VOICE-SERVICE] Started speaking:",t.substring(0,50)+"..."),!0}catch(n){return console.error("[VOICE-SERVICE] Error speaking:",n),!1}})}stopSpeech(){if(this.currentUtterance||speechSynthesis.speaking){if(speechSynthesis.cancel(),this.currentUtterance=null,this.currentOnEndCallback){let t=this.currentOnEndCallback;this.currentOnEndCallback=null,t()}this.speakingSubject.next(!1),console.log("[VOICE-SERVICE] Speech stopped")}}ding(){try{let t=new(window.AudioContext||window.webkitAudioContext),e=t.createOscillator(),i=t.createGain();e.connect(i),i.connect(t.destination),e.frequency.setValueAtTime(800,t.currentTime),i.gain.setValueAtTime(.1,t.currentTime),i.gain.exponentialRampToValueAtTime(.01,t.currentTime+.1),e.start(t.currentTime),e.stop(t.currentTime+.1),console.log("[VOICE-SERVICE] Notification sound played")}catch(t){console.error("[VOICE-SERVICE] Notification sound failed:",t)}}getVoicesForLanguage(){return te(this,null,function*(){try{let t=this.language.slice(0,2),e=yield this.voices;if(!e||e.length===0)return console.warn("[VOICE-SERVICE] No voices available on system"),[];let i=e.filter(n=>n.lang.toLowerCase().startsWith(t)).sort((n,r)=>n.localService&&!r.localService?-1:!n.localService&&r.localService?1:n.name.localeCompare(r.name));return console.log("[VOICE-SERVICE] Found matching voices:",i.length,"for language:",t),i.map(n=>({name:n.name,lang:n.lang,localService:n.localService,default:n.default,displayName:this.formatVoiceDisplayName(n)}))}catch(t){return console.error("[VOICE-SERVICE] Error getting voices for language:",t),[]}})}formatVoiceDisplayName(t){let e=t.localService?"\u{1F3E0}":"\u2601\uFE0F",i=t.default?" \u2B50":"";return`${e} ${t.name} (${t.lang})${i}`}setSelectedVoice(t){return te(this,null,function*(){if(!t){this.selectedVoice=void 0;return}let[e,i]=t.split("|");if(!e||!i){this.selectedVoice=void 0;return}let n=(yield this.voices)?.find(r=>r.name===e&&r.lang===i);n?(this.selectedVoice=n,console.log("[VOICE-SERVICE] Selected voice:",n.name,n.lang)):(this.selectedVoice=void 0,console.warn("[VOICE-SERVICE] Voice not found:",e,i))})}updateSelectedVoiceForLanguage(){return te(this,null,function*(){let t=yield this.getVoicesForLanguage();if(t.length===0){console.warn("[VOICE-SERVICE] No voices available for language:",this.language),this.selectedVoice=void 0,this.preferencesService.setSelectedVoice(null);return}let e=this.preferencesService.getSelectedVoice();if(e){let[n,r]=e.split("|"),a=r?.slice(0,2),c=this.language.slice(0,2);if(a===c&&t.some(g=>g.name===n&&g.lang===r)){console.log("[VOICE-SERVICE] Keeping current voice for language:",e);return}}let i=t[0];if(i){let n=`${i.name}|${i.lang}`;this.preferencesService.setSelectedVoice(n),console.log("[VOICE-SERVICE] Auto-selected voice for language change:",i.displayName)}})}testSelectedVoice(){setTimeout(()=>{if(!this.selectedVoice){console.log("[VOICE-SERVICE] No voice selected for test");return}this.stopSpeech();let t=this.getTestText();t&&this.speak(t)},100)}getTestText(){let t=this.language.slice(0,2),e={fr:"Bonjour, ceci est un test de la voix s\xE9lectionn\xE9e.",en:"Hello, this is a test of the selected voice.",es:"Hola, esta es una prueba de la voz seleccionada.",de:"Hallo, dies ist ein Test der ausgew\xE4hlten Stimme.",it:"Ciao, questo \xE8 un test della voce selezionata.",pt:"Ol\xE1, este \xE9 um teste da voz selecionada.",ja:"\u3053\u3093\u306B\u3061\u306F\u3001\u3053\u308C\u306F\u9078\u629E\u3055\u308C\u305F\u97F3\u58F0\u306E\u30C6\u30B9\u30C8\u3067\u3059\u3002",ko:"\uC548\uB155\uD558\uC138\uC694, \uC774\uAC83\uC740 \uC120\uD0DD\uB41C \uC74C\uC131\uC758 \uD14C\uC2A4\uD2B8\uC785\uB2C8\uB2E4.",zh:"\u4F60\u597D\uFF0C\u8FD9\u662F\u6240\u9009\u8BED\u97F3\u7684\u6D4B\u8BD5\u3002",ru:"\u041F\u0440\u0438\u0432\u0435\u0442, \u044D\u0442\u043E \u0442\u0435\u0441\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0433\u043E\u043B\u043E\u0441\u0430.",ar:"\u0645\u0631\u062D\u0628\u0627\u060C \u0647\u0630\u0627 \u0627\u062E\u062A\u0628\u0627\u0631 \u0644\u0644\u0635\u0648\u062A \u0627\u0644\u0645\u062D\u062F\u062F."};return e[t]||e.en||"Hello, this is a test."}extractPlainText(t){let e=t.replace(/[\u{1F600}-\u{1F64F}]|[\u{1F300}-\u{1F5FF}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|⭐/gu,"").replace(/```[\s\S]*?```/g,"code block").replace(/`([^`]+)`/g,"$1").replace(/\*\*\*(.*?)\*\*\*/g,"$1").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/#{1,6}\s*(.*)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/https?:\/\/[^\s]+/g,"link").replace(/&nbsp;/g," ").replace(/&amp;/g,"and").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');return e=this.addNaturalPunctuation(e),e.replace(/\s+/g," ").trim()}addNaturalPunctuation(t){return t.replace(/\n+/g,`
352
+ `],encapsulation:2,changeDetection:0})}return o})();var cr=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({imports:[ce]})}return o})();var l0=(o,t)=>t.id;function c0(o,t){if(o&1&&(s(0,"span",4),p(1),l()),o&2){let e=u();d(),O(e.taskSummary)}}function d0(o,t){o&1&&(s(0,"div",6),I(1,"mat-spinner",8),s(2,"span"),p(3,"Loading..."),l()()),o&2&&(d(),w("diameter",16))}function m0(o,t){if(o&1&&I(0,"app-delegation-inline",9),o&2){let e=u().$implicit;w("subThreadId",e.subThreadId)("agentName",e.delegationAgentName)}}function p0(o,t){if(o&1&&I(0,"app-chat-message",10),o&2){let e=u().$implicit;w("message",e)("canDelete",!1)}}function h0(o,t){if(o&1&&C(0,m0,1,2,"app-delegation-inline",9)(1,p0,1,2,"app-chat-message",10),o&2){let e=t.$implicit;x(e.type==="delegation"?0:1)}}function u0(o,t){if(o&1&&(s(0,"div",7)(1,"div",11),p(2),l()()),o&2){let e=u(2);d(2),O(e.streamingText)}}function g0(o,t){if(o&1&&(s(0,"div",5),C(1,d0,4,1,"div",6),we(2,h0,2,1,null,null,l0),C(4,u0,3,1,"div",7),l()),o&2){let e=u();d(),x(e.isLoading?1:-1),d(),Se(e.subMessages),d(2),x(e.streamingText?4:-1)}}var Js=class o{subThreadId;agentName;isExpanded=!1;isLoading=!1;subMessages=[];streamingText="";eventSubscription;codayService=m(Xt);threadApi=m(Qi);get taskSummary(){let t=this.subMessages.find(e=>e.role==="user");if(t){let e=t.content.filter(i=>i.type==="text").map(i=>i.content).join(" ");return e.length>120?e.substring(0,120)+"...":e}return""}ngOnInit(){for(let t of this.codayService.getBufferedSubThreadEvents(this.subThreadId))this.handleSubThreadEvent(t);this.eventSubscription=this.codayService.subThreadEvents$.pipe(me(t=>t.threadId===this.subThreadId)).subscribe(t=>this.handleSubThreadEvent(t))}ngOnDestroy(){this.eventSubscription?.unsubscribe()}toggle(){this.isExpanded=!this.isExpanded,this.isExpanded&&this.loadSubThreadMessages()}loadSubThreadMessages(){this.isLoading=!0,this.threadApi.getThreadMessages(this.subThreadId).subscribe({next:t=>{if(t.messages){this.subMessages=[];for(let e of t.messages){let i=da(e);i&&this.handleSubThreadEvent(i)}}this.isLoading=!1},error:t=>{console.error("[DELEGATION-INLINE] Failed to load sub-thread messages:",t),this.isLoading=!1}})}handleSubThreadEvent(t){t instanceof Qt?this.addMessage({id:t.timestamp,role:"user",speaker:"User",content:[{type:"text",content:t.answer}],timestamp:new Date,type:"text"}):t instanceof zn?this.streamingText+=t.chunk:t instanceof Ti?(t.role==="assistant"&&(this.streamingText=""),this.addMessage({id:t.timestamp,role:t.role,speaker:t.name,content:t.content,timestamp:new Date,type:"text"})):t instanceof Mi?this.addMessage({id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:new Date,type:"technical",eventId:t.timestamp}):t instanceof ci?this.addMessage({id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:new Date,type:"technical",eventId:t.timestamp}):t instanceof Gi?this.addMessage({id:t.timestamp,role:"system",speaker:t.agentName,content:[{type:"text",content:""}],timestamp:new Date,type:"delegation",subThreadId:t.subThreadId,delegationAgentName:t.agentName}):t instanceof qi&&this.addMessage({id:t.timestamp,role:"system",speaker:t.speaker??"System",content:[{type:"text",content:t.text}],timestamp:new Date,type:"technical"})}addMessage(t){this.subMessages=[...this.subMessages,t]}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-delegation-inline"]],inputs:{subThreadId:"subThreadId",agentName:"agentName"},decls:8,vars:4,consts:[[1,"delegation-inline"],["role","button","tabindex","0",1,"delegation-header",3,"click","keydown.enter","keydown.space"],[1,"expand-icon"],[1,"agent-name"],[1,"task-summary"],[1,"delegation-body"],[1,"loading"],[1,"streaming-message"],[3,"diameter"],[3,"subThreadId","agentName"],[3,"message","canDelete"],[1,"content"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1),f("click",function(){return i.toggle()})("keydown.enter",function(){return i.toggle()})("keydown.space",function(){return i.toggle()}),s(2,"mat-icon",2),p(3),l(),s(4,"span",3),p(5),l(),C(6,c0,2,1,"span",4),l(),C(7,g0,5,2,"div",5),l()),e&2&&(d(3),O(i.isExpanded?"expand_more":"chevron_right"),d(2),O(i.agentName),d(),x(i.taskSummary?6:-1),d(),x(i.isExpanded?7:-1))},dependencies:[o,Fe,Me,he,cr,lr,sr],styles:[".delegation-inline[_ngcontent-%COMP%]{margin:.5rem 0;border-left:3px solid var(--color-primary, #6366f1);border-radius:4px;background:var(--color-bg-secondary);overflow:hidden}.delegation-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;cursor:pointer;-webkit-user-select:none;user-select:none}.delegation-header[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.delegation-header[_ngcontent-%COMP%] .expand-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-text-secondary, #94a3b8)}.delegation-header[_ngcontent-%COMP%] .agent-name[_ngcontent-%COMP%]{font-weight:600;color:var(--color-primary, #6366f1);white-space:nowrap}.delegation-header[_ngcontent-%COMP%] .task-summary[_ngcontent-%COMP%]{flex:1;color:var(--color-text-secondary, #94a3b8);font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.delegation-body[_ngcontent-%COMP%]{padding:0 .75rem .75rem 1.5rem;border-top:1px solid var(--color-border-light)}.delegation-body[_ngcontent-%COMP%] .loading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 0;color:var(--color-text-secondary, #94a3b8);font-size:.85rem}.delegation-body[_ngcontent-%COMP%] .sub-messages[_ngcontent-%COMP%]{padding:.5rem 0}"]})};var dr=class o{unreadCountSubject=new ae(0);unreadCount$=this.unreadCountSubject.asObservable();constructor(){console.log("[UNREAD] Service initialized")}addUnread(){let e=this.unreadCountSubject.value+1;this.unreadCountSubject.next(e),console.log("[UNREAD] Added unread message, total:",e)}markAllAsRead(){this.unreadCountSubject.value>0&&(this.unreadCountSubject.next(0),console.log("[UNREAD] Marked all messages as read"))}getCurrentCount(){return this.unreadCountSubject.value}reset(){this.unreadCountSubject.next(0),console.log("[UNREAD] Counter reset")}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var mr=class o{destroy$=new R;voices;currentUtterance=null;currentOnEndCallback=null;speakingSubject=new ae(!1);speaking$=this.speakingSubject.asObservable();volume=.8;rate=1.2;language="en-US";selectedVoice;preferencesService=m(at);constructor(){this.initializeSpeechSynthesis(),this.subscribeToPreferences()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.stopSpeech()}initializeSpeechSynthesis(){if(!("speechSynthesis"in window)){console.warn("[VOICE-SERVICE] Speech synthesis not available"),this.voices=new Promise(t=>t([]));return}this.voices=new Promise((t,e)=>{let i=speechSynthesis.getVoices();if(i.length)t(i);else{let n=setTimeout(()=>{e("no voices found")},2e3);speechSynthesis.addEventListener("voiceschanged",()=>{let r=speechSynthesis.getVoices();r.length&&(clearTimeout(n),t(r))})}}),console.log("[VOICE-SERVICE] Speech synthesis initialized")}subscribeToPreferences(){this.preferencesService.voiceVolume$.pipe(N(this.destroy$)).subscribe(t=>{this.volume=t,console.log("[VOICE-SERVICE] Volume updated to:",t)}),this.preferencesService.voiceRate$.pipe(N(this.destroy$)).subscribe(t=>{this.rate=t,console.log("[VOICE-SERVICE] Rate updated to:",t)}),this.preferencesService.voiceLanguage$.pipe(N(this.destroy$)).subscribe(t=>{this.language=t,console.log("[VOICE-SERVICE] Language updated to:",t),this.updateSelectedVoiceForLanguage()}),this.preferencesService.selectedVoice$.pipe(N(this.destroy$)).subscribe(t=>{this.setSelectedVoice(t)}),this.volume=this.preferencesService.getVoiceVolume(),this.rate=this.preferencesService.getVoiceRate(),this.language=this.preferencesService.getVoiceLanguage(),this.setSelectedVoice(this.preferencesService.getSelectedVoice())}isReady(){return"speechSynthesis"in window&&this.selectedVoice!==void 0}isSpeaking(){return speechSynthesis.speaking}speak(t,e){return te(this,null,function*(){if(!this.selectedVoice)return console.warn("[VOICE-SERVICE] No voice selected"),!1;if(!t.trim())return console.warn("[VOICE-SERVICE] No text to speak"),!1;let i=this.extractPlainText(t);if(!i.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),!1;this.stopSpeech();try{let n=new SpeechSynthesisUtterance(i);n.voice=this.selectedVoice,n.lang=this.selectedVoice.lang,n.volume=this.volume,n.rate=this.rate,this.currentOnEndCallback=e||null,e&&(n.onend=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())},n.onerror=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())}),this.currentUtterance=n,this.speakingSubject.next(!0);let r=n.onend,a=n.onerror;return n.onend=c=>{this.speakingSubject.next(!1),r&&r.call(n,c)},n.onerror=c=>{this.speakingSubject.next(!1),a&&a.call(n,c)},speechSynthesis.speak(n),console.log("[VOICE-SERVICE] Started speaking:",t.substring(0,50)+"..."),!0}catch(n){return console.error("[VOICE-SERVICE] Error speaking:",n),!1}})}stopSpeech(){if(this.currentUtterance||speechSynthesis.speaking){if(speechSynthesis.cancel(),this.currentUtterance=null,this.currentOnEndCallback){let t=this.currentOnEndCallback;this.currentOnEndCallback=null,t()}this.speakingSubject.next(!1),console.log("[VOICE-SERVICE] Speech stopped")}}ding(){try{let t=new(window.AudioContext||window.webkitAudioContext),e=t.createOscillator(),i=t.createGain();e.connect(i),i.connect(t.destination),e.frequency.setValueAtTime(800,t.currentTime),i.gain.setValueAtTime(.1,t.currentTime),i.gain.exponentialRampToValueAtTime(.01,t.currentTime+.1),e.start(t.currentTime),e.stop(t.currentTime+.1),console.log("[VOICE-SERVICE] Notification sound played")}catch(t){console.error("[VOICE-SERVICE] Notification sound failed:",t)}}getVoicesForLanguage(){return te(this,null,function*(){try{let t=this.language.slice(0,2),e=yield this.voices;if(!e||e.length===0)return console.warn("[VOICE-SERVICE] No voices available on system"),[];let i=e.filter(n=>n.lang.toLowerCase().startsWith(t)).sort((n,r)=>n.localService&&!r.localService?-1:!n.localService&&r.localService?1:n.name.localeCompare(r.name));return console.log("[VOICE-SERVICE] Found matching voices:",i.length,"for language:",t),i.map(n=>({name:n.name,lang:n.lang,localService:n.localService,default:n.default,displayName:this.formatVoiceDisplayName(n)}))}catch(t){return console.error("[VOICE-SERVICE] Error getting voices for language:",t),[]}})}formatVoiceDisplayName(t){let e=t.localService?"\u{1F3E0}":"\u2601\uFE0F",i=t.default?" \u2B50":"";return`${e} ${t.name} (${t.lang})${i}`}setSelectedVoice(t){return te(this,null,function*(){if(!t){this.selectedVoice=void 0;return}let[e,i]=t.split("|");if(!e||!i){this.selectedVoice=void 0;return}let n=(yield this.voices)?.find(r=>r.name===e&&r.lang===i);n?(this.selectedVoice=n,console.log("[VOICE-SERVICE] Selected voice:",n.name,n.lang)):(this.selectedVoice=void 0,console.warn("[VOICE-SERVICE] Voice not found:",e,i))})}updateSelectedVoiceForLanguage(){return te(this,null,function*(){let t=yield this.getVoicesForLanguage();if(t.length===0){console.warn("[VOICE-SERVICE] No voices available for language:",this.language),this.selectedVoice=void 0,this.preferencesService.setSelectedVoice(null);return}let e=this.preferencesService.getSelectedVoice();if(e){let[n,r]=e.split("|"),a=r?.slice(0,2),c=this.language.slice(0,2);if(a===c&&t.some(g=>g.name===n&&g.lang===r)){console.log("[VOICE-SERVICE] Keeping current voice for language:",e);return}}let i=t[0];if(i){let n=`${i.name}|${i.lang}`;this.preferencesService.setSelectedVoice(n),console.log("[VOICE-SERVICE] Auto-selected voice for language change:",i.displayName)}})}testSelectedVoice(){setTimeout(()=>{if(!this.selectedVoice){console.log("[VOICE-SERVICE] No voice selected for test");return}this.stopSpeech();let t=this.getTestText();t&&this.speak(t)},100)}getTestText(){let t=this.language.slice(0,2),e={fr:"Bonjour, ceci est un test de la voix s\xE9lectionn\xE9e.",en:"Hello, this is a test of the selected voice.",es:"Hola, esta es una prueba de la voz seleccionada.",de:"Hallo, dies ist ein Test der ausgew\xE4hlten Stimme.",it:"Ciao, questo \xE8 un test della voce selezionata.",pt:"Ol\xE1, este \xE9 um teste da voz selecionada.",ja:"\u3053\u3093\u306B\u3061\u306F\u3001\u3053\u308C\u306F\u9078\u629E\u3055\u308C\u305F\u97F3\u58F0\u306E\u30C6\u30B9\u30C8\u3067\u3059\u3002",ko:"\uC548\uB155\uD558\uC138\uC694, \uC774\uAC83\uC740 \uC120\uD0DD\uB41C \uC74C\uC131\uC758 \uD14C\uC2A4\uD2B8\uC785\uB2C8\uB2E4.",zh:"\u4F60\u597D\uFF0C\u8FD9\u662F\u6240\u9009\u8BED\u97F3\u7684\u6D4B\u8BD5\u3002",ru:"\u041F\u0440\u0438\u0432\u0435\u0442, \u044D\u0442\u043E \u0442\u0435\u0441\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0433\u043E\u043B\u043E\u0441\u0430.",ar:"\u0645\u0631\u062D\u0628\u0627\u060C \u0647\u0630\u0627 \u0627\u062E\u062A\u0628\u0627\u0631 \u0644\u0644\u0635\u0648\u062A \u0627\u0644\u0645\u062D\u062F\u062F."};return e[t]||e.en||"Hello, this is a test."}extractPlainText(t){let e=t.replace(/[\u{1F600}-\u{1F64F}]|[\u{1F300}-\u{1F5FF}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|⭐/gu,"").replace(/```[\s\S]*?```/g,"code block").replace(/`([^`]+)`/g,"$1").replace(/\*\*\*(.*?)\*\*\*/g,"$1").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/#{1,6}\s*(.*)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/https?:\/\/[^\s]+/g,"link").replace(/&nbsp;/g," ").replace(/&amp;/g,"and").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');return e=this.addNaturalPunctuation(e),e.replace(/\s+/g," ").trim()}addNaturalPunctuation(t){return t.replace(/\n+/g,`
353
353
  `).split(`
354
354
  `).map(e=>this.addPeriodIfNeeded(e.trim())).filter(e=>e.length>0).join(" ")}addPeriodIfNeeded(t){return t?/[.!?;:]$/.test(t)?t:t+".":""}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var el=class o{thinkingPhrases=["Processing request...","Thinking...","Working on it..."];currentThinkingPhrase="Processing request...";thinkingPhraseIndex=0;thinkingInterval=null;ngOnInit(){this.startThinkingAnimation()}ngOnDestroy(){this.stopThinkingAnimation()}startThinkingAnimation(){this.thinkingPhraseIndex=0,this.currentThinkingPhrase=this.thinkingPhrases[0]||"Thinking...",this.thinkingInterval=window.setInterval(()=>{this.thinkingPhraseIndex<this.thinkingPhrases.length-1&&(this.thinkingPhraseIndex++,this.currentThinkingPhrase=this.thinkingPhrases[this.thinkingPhraseIndex]||"Thinking...")},2e3)}stopThinkingAnimation(){this.thinkingInterval&&(clearInterval(this.thinkingInterval),this.thinkingInterval=null),this.thinkingPhraseIndex=0,this.currentThinkingPhrase="Thinking..."}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-thinking-loader"]],decls:8,vars:1,consts:[[1,"message-wrapper"],[1,"message","assistant","thinking-message"],[1,"content"],[1,"thinking-loader"],[1,"logo-container"],["src","CODAY-Logo.png","alt","Coday Logo",1,"coday-logo"],[1,"thinking-text"]],template:function(e,i){e&1&&(ii(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),eo(5,"img",5),ni(),ii(6,"p",6),p(7),ni()()()()()),e&2&&(d(7),O(i.currentThinkingPhrase))},dependencies:[Fe],styles:[".message-wrapper[_ngcontent-%COMP%]{margin:0;display:flex;align-items:flex-start;gap:.5rem}.message.assistant[_ngcontent-%COMP%]{background:transparent;border:none;box-shadow:none;border-radius:0;margin-left:0;margin-right:auto;padding:.5rem 0;width:100%;max-width:none;min-width:0}.message.thinking-message[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{line-height:1.5}.thinking-loader[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:.75rem 0}.logo-container[_ngcontent-%COMP%]{position:relative;width:32px;height:32px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.coday-logo[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:contain;animation:_ngcontent-%COMP%_pulse 2s ease-in-out infinite;filter:drop-shadow(0 1px 4px rgba(0,0,0,.1))}.thinking-text[_ngcontent-%COMP%]{font-size:.95rem;font-weight:400;color:var(--color-text-secondary);margin:0;animation:_ngcontent-%COMP%_fadeInOut 2s ease-in-out infinite;letter-spacing:.01em;font-style:italic}@keyframes _ngcontent-%COMP%_pulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.7}}@keyframes _ngcontent-%COMP%_fadeInOut{0%,to{opacity:.6}50%{opacity:1}}@media (max-width: 768px){.logo-container[_ngcontent-%COMP%]{width:28px;height:28px}.thinking-text[_ngcontent-%COMP%]{font-size:.875rem}.thinking-loader[_ngcontent-%COMP%]{gap:.75rem}}@media print{.thinking-loader[_ngcontent-%COMP%]{display:none!important}}"]})};var f0=(o,t)=>t.id;function _0(o,t){if(o&1&&I(0,"app-delegation-inline",3),o&2){let e=u().$implicit;w("subThreadId",e.subThreadId)("agentName",e.delegationAgentName)}}function b0(o,t){if(o&1){let e=k();s(0,"app-chat-message",5),f("copyRequested",function(n){b(e);let r=u(2);return v(r.onCopyMessage(n))})("deleteRequested",function(n){b(e);let r=u(2);return v(r.onDeleteMessage(n))}),l()}if(o&2){let e=u(),i=e.$implicit,n=e.$index,r=u();w("message",i)("canDelete",r.canDeleteMessage(n))("isOtherUser",i.role==="user"&&!!r.currentUsername&&i.speaker!==r.currentUsername)}}function v0(o,t){if(o&1&&C(0,_0,1,2,"app-delegation-inline",3)(1,b0,1,3,"app-chat-message",4),o&2){let e=t.$implicit;x(e.type==="delegation"?0:1)}}function y0(o,t){if(o&1&&(s(0,"div",1),I(1,"div",6),l()),o&2){let e=u();d(),w("innerHTML",e.renderedStreamingText,Zt)}}function C0(o,t){o&1&&I(0,"app-thinking-loader")}function x0(o,t){if(o&1){let e=k();s(0,"button",7),f("click",function(){b(e);let n=u();return v(n.goToBottom())}),s(1,"mat-icon",8),p(2,"arrow_downward"),l()()}}var tl=class o{messages=[];streamingText="";isThinking=!1;currentUsername="";copyRequested=new H;stopRequested=new H;lastMessageCount=0;destroy$=new R;renderedStreamingText="";isTracking=!0;showGoToBottom=!1;scrollContainer=null;lastScrollTop=0;NEAR_BOTTOM_THRESHOLD=100;scrollCheckTimeout;isProgrammaticScroll=!1;MESSAGE_FRESHNESS_THRESHOLD=300*1e3;elementRef=m(ne);unreadService=m(dr);voiceSynthesisService=m(mr);preferencesService=m(at);codayService=m(Xt);markdownService=m($i);sanitizer=m(Ri);ngOnInit(){this.findScrollContainer(),this.setupFocusListeners()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.scrollCheckTimeout&&clearTimeout(this.scrollCheckTimeout),window.removeEventListener("focus",this.handleWindowFocus),window.removeEventListener("blur",this.handleWindowBlur)}ngOnChanges(t){t.streamingText&&(this.renderStreamingText(),this.streamingText&&this.isTracking&&setTimeout(()=>this.scrollToBottom(),0))}ngAfterViewChecked(){if(this.messages.length!==this.lastMessageCount){console.log("[CHAT-HISTORY] Message count changed:",this.lastMessageCount,"->",this.messages.length);let t=this.messages.length-this.lastMessageCount;t>0&&(this.handleNewMessages(t),this.handleVoiceAnnouncement(t)),this.lastMessageCount=this.messages.length,this.isTracking&&this.scrollToBottom()}this.scrollContainer||this.findScrollContainer()}scrollToBottom(){try{this.scrollContainer||this.findScrollContainer(),this.scrollContainer&&(this.isProgrammaticScroll=!0,setTimeout(()=>{this.scrollContainer&&this.scrollContainer.scrollTo({top:this.scrollContainer.scrollHeight,behavior:"smooth"}),setTimeout(()=>{this.isProgrammaticScroll=!1},600)},50))}catch(t){console.error("Error scrolling to bottom:",t)}}trackByMessageId(t,e){return e.id}onCopyMessage(t){let e=t.content.filter(i=>i.type==="text").map(i=>i.content).join(`
355
355
 
@@ -359,19 +359,19 @@ This action cannot be undone once you post another message.`)&&(console.log("[CH
359
359
 
360
360
  `)}extractPartialText(t){return t.split(`
361
361
  `).filter(a=>a.trim().length>0).reduce((a,c)=>{if(a.paragraphs>=3)return a;let h=c.length>80?1:0;return{paragraphs:a.paragraphs+h,text:a.text+(a.text?`
362
- `:"")+c}},{paragraphs:0,text:""}).text||t}renderStreamingText(){return te(this,null,function*(){if(!this.streamingText){this.renderedStreamingText="";return}try{let t=yield this.markdownService.parse(this.streamingText);this.renderedStreamingText=this.sanitizer.bypassSecurityTrustHtml(t)}catch(t){console.error("[CHAT-HISTORY] Error rendering streaming text markdown:",t),this.renderedStreamingText=this.sanitizer.bypassSecurityTrustHtml(this.streamingText)}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-chat-history"]],hostBindings:function(e,i){e&1&&f("scroll",function(){return i.onScroll()})},inputs:{messages:"messages",streamingText:"streamingText",isThinking:"isThinking",currentUsername:"currentUsername"},outputs:{copyRequested:"copyRequested",stopRequested:"stopRequested"},features:[nt],decls:6,vars:3,consts:[[1,"chat-history"],[1,"streaming-message","message","assistant"],["mat-fab","","color","primary","title","Go to bottom",1,"go-to-bottom-btn"],[3,"subThreadId","agentName"],[3,"message","canDelete","isOtherUser"],[3,"copyRequested","deleteRequested","message","canDelete","isOtherUser"],[1,"content","markdown-content",3,"innerHTML"],["mat-fab","","color","primary","title","Go to bottom",1,"go-to-bottom-btn",3,"click"],["fontSet","material-icons-outlined"]],template:function(e,i){e&1&&(s(0,"div",0),we(1,v0,2,1,null,null,f0),C(3,y0,2,1,"div",1),C(4,C0,1,0,"app-thinking-loader"),C(5,x0,3,0,"button",2),l()),e&2&&(d(),Se(i.messages),d(2),x(i.streamingText?3:-1),d(),x(i.isThinking?4:-1),d(),x(i.showGoToBottom?5:-1))},dependencies:[sr,he,el,Xa,Js],styles:[".streaming-message.assistant[_ngcontent-%COMP%]{background:transparent;border:none;box-shadow:none;border-radius:0;margin-left:0;margin-right:auto;padding:.5rem 0;width:100%;max-width:none;min-width:0}.streaming-message[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{color:var(--color-text);line-height:1.5}.go-to-bottom-btn[_ngcontent-%COMP%]{position:fixed!important;bottom:30%!important;right:1rem!important;z-index:1000!important}@media (max-width: 768px){.go-to-bottom-btn[_ngcontent-%COMP%]{width:40px!important;height:40px!important;right:.75rem!important}.go-to-bottom-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;max-height:none!important;overflow:visible!important;position:static!important}.chat-history[_ngcontent-%COMP%]{display:block!important;height:auto!important;max-height:none!important;overflow:visible!important;position:static!important}.go-to-bottom-btn[_ngcontent-%COMP%]{display:none!important}}"]})};var Hn=class o{eventStream=m(Yi);messageApi=m(or);pendingStates=new Map;popupCheckInterval=null;pendingRequest$=new ce(null);messageHandler=t=>this.handlePopupMessage(t);constructor(){this.eventStream.events$.pipe(me(t=>t.type==="oauth_request")).subscribe(t=>this.handleOAuthRequest(t)),window.addEventListener("message",this.messageHandler)}ngOnDestroy(){window.removeEventListener("message",this.messageHandler),this.pendingRequest$.complete(),this.popupCheckInterval&&clearInterval(this.popupCheckInterval)}startPopupMonitoring(t,e){this.popupCheckInterval&&clearInterval(this.popupCheckInterval),this.popupCheckInterval=setInterval(()=>{if(t.closed&&(console.log("[OAuth Service] Popup closed by user"),clearInterval(this.popupCheckInterval),this.popupCheckInterval=null,this.pendingStates.has(e))){console.warn("[OAuth Service] OAuth cancelled - popup closed without completing authentication");let i=this.pendingStates.get(e);if(this.pendingStates.delete(e),i){let n=new Ei({state:e,integrationName:i,error:"user_cancelled",errorDescription:"User closed the popup without completing authentication"});this.messageApi.sendMessage(n).subscribe({next:()=>console.log("[OAuth Service] Cancellation sent to backend"),error:r=>console.error("[OAuth Service] Failed to send cancellation:",r)})}}},500)}openPopup(t){console.log("[OAuth Service] Opening popup from user gesture:",t.integrationName);let e=600,i=900,n=window.screenX+(window.outerWidth-e)/2,r=window.screenY+(window.outerHeight-i)/2,a=`width=${e},height=${i},left=${n},top=${r},popup=yes,resizable=yes,scrollbars=yes`,c=window.open(t.authUrl,"oauth_popup",a);console.log("[OAuth Service] Popup opened:",!!c),c?(c.focus(),this.startPopupMonitoring(c,t.state),this.pendingRequest$.next(null)):console.warn("[OAuth Service] Popup was blocked by the browser")}cancelRequest(t){console.log("[OAuth Service] OAuth cancelled by user via inline panel"),this.pendingStates.delete(t.state),this.pendingRequest$.next(null);let e=new Ei({state:t.state,integrationName:t.integrationName,error:"user_cancelled",errorDescription:"User dismissed the authorization panel"});this.messageApi.sendMessage(e).subscribe({next:()=>console.log("[OAuth Service] Cancellation sent to backend"),error:i=>console.error("[OAuth Service] Failed to send cancellation:",i)})}handleOAuthRequest(t){console.log("[OAuth Service] Received OAuthRequestEvent:",t.integrationName,t.state),this.pendingStates.set(t.state,t.integrationName),console.log("[OAuth Service] Pending states:",Array.from(this.pendingStates.keys())),this.pendingRequest$.next(t)}handlePopupMessage(t){if(console.log("[OAuth Service] Received postMessage:",t.origin,t.data),t.origin!==window.location.origin){console.warn("[OAuth Service] Rejected message from different origin:",t.origin);return}let{code:e,state:i,error:n,errorDescription:r}=t.data??{};if(n){console.log("[OAuth Service] OAuth error received:",n,r);let h=this.pendingStates.get(i);if(h){this.pendingStates.delete(i),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let g=new Ei({state:i,integrationName:h,error:n,errorDescription:r});this.messageApi.sendMessage(g).subscribe({next:()=>console.log("[OAuth Service] Error callback sent to backend"),error:y=>console.error("[OAuth Service] Failed to send error callback:",y)})}return}if(!e||!i){console.warn("[OAuth Service] Message missing code or state:",t.data);return}console.log("[OAuth Service] Processing callback - code:",e,"state:",i);let a=this.pendingStates.get(i);if(!a){console.warn("[OAuth Service] Unknown state received:",i,"Pending states:",Array.from(this.pendingStates.keys()));return}console.log("[OAuth Service] Found integration:",a),this.pendingStates.delete(i),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let c=new Ei({code:e,state:i,integrationName:a});console.log("[OAuth Service] Sending callback to backend..."),this.messageApi.sendMessage(c).subscribe({next:()=>console.log("[OAuth Service] Callback sent to backend successfully"),error:h=>console.error("[OAuth Service] Failed to send callback:",h)})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};function w0(o,t){if(o&1){let e=k();s(0,"div",0)(1,"div",1)(2,"mat-icon"),p(3,"lock_open"),l()(),s(4,"div",2)(5,"p",3),p(6,"Authorization required"),l(),s(7,"p",4)(8,"strong"),p(9),l(),p(10," needs your permission to continue. "),l()(),s(11,"div",5)(12,"button",6),f("click",function(){let n=b(e),r=u();return v(r.onCancel(n))}),p(13,"Cancel"),l(),s(14,"button",7),f("click",function(){let n=b(e),r=u();return v(r.onAuthorize(n))}),s(15,"mat-icon"),p(16,"open_in_new"),l(),p(17," Authorize "),l()()()}o&2&&(d(9),O(t.integrationName))}var il=class o{oauthService=m(Hn);pendingRequest=rt(this.oauthService.pendingRequest$,{initialValue:null});onAuthorize(t){this.oauthService.openPopup(t)}onCancel(t){this.oauthService.cancelRequest(t)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-oauth-request-panel"]],decls:1,vars:1,consts:[[1,"oauth-panel"],[1,"oauth-icon"],[1,"oauth-content"],[1,"oauth-title"],[1,"oauth-description"],[1,"oauth-actions"],["type","button",1,"oauth-btn","oauth-btn--cancel",3,"click"],["type","button",1,"oauth-btn","oauth-btn--authorize",3,"click"]],template:function(e,i){if(e&1&&C(0,w0,18,1,"div",0),e&2){let n;x((n=i.pendingRequest())?0:-1,n)}},dependencies:[Me,he],styles:[".oauth-panel[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:1rem;border:1px solid var(--color-border);border-radius:12px;background:var(--color-background);width:100%}@media (max-width: 480px){.oauth-panel[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}}.oauth-icon[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border-radius:50%;background:var(--color-primary);color:#fff}.oauth-icon[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.oauth-content[_ngcontent-%COMP%]{flex:1;min-width:0}.oauth-title[_ngcontent-%COMP%]{margin:0 0 .25rem;font-weight:600;font-size:.95rem;color:var(--color-text)}.oauth-description[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary)}.oauth-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-shrink:0}.oauth-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;padding:.5rem 1rem;border-radius:8px;border:1px solid var(--color-border);font-size:.9rem;font-family:inherit;cursor:pointer;transition:all .2s ease}.oauth-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem}.oauth-btn--cancel[_ngcontent-%COMP%]{background:var(--color-background);color:var(--color-text-secondary)}.oauth-btn--cancel[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);color:var(--color-text)}.oauth-btn--authorize[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff;border-color:var(--color-primary)}.oauth-btn--authorize[_ngcontent-%COMP%]:hover{opacity:.9}"],changeDetection:0})};var nl=class o{http=m(Xe);projectState=m(ke);threadState=m(At);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/files`}uploadFile(t){let e=this.projectState.getSelectedProjectIdOrThrow(),i=this.threadState.getSelectedThreadIdOrThrow();return new Ii(n=>{let r=new FileReader;r.onload=()=>{let c=r.result.split(",")[1];this.http.post(`/api/projects/${e}/threads/${i}/upload`,{content:c,mimeType:t.type||"application/octet-stream",filename:t.name}).subscribe({next:h=>{n.next({success:h.success,filename:h.filename}),n.complete()},error:h=>n.error(h)})},r.onerror=()=>n.error(new Error("Failed to read file")),r.readAsDataURL(t)})}listFiles(){return this.http.get(this.getBaseUrl()).pipe(ve(t=>t.files))}downloadFile(t){let e=encodeURIComponent(t);return this.http.get(`${this.getBaseUrl()}/${e}`,{responseType:"blob"})}deleteFile(t){let e=encodeURIComponent(t);return this.http.delete(`${this.getBaseUrl()}/${e}`)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var pr=class o{fileApi=m(nl);eventStream=m(Yi);filesSignal=Oe([]);isLoadingSignal=Oe(!1);currentProjectSignal=Oe(null);currentThreadSignal=Oe(null);files=ui(()=>this.filesSignal());isLoading=ui(()=>this.isLoadingSignal());fileCount=ui(()=>this.filesSignal().length);constructor(){this.subscribeToFileEvents()}initializeForThread(t,e){this.currentProjectSignal.set(t),this.currentThreadSignal.set(e),this.refreshFileList()}clear(){this.filesSignal.set([]),this.currentProjectSignal.set(null),this.currentThreadSignal.set(null)}refreshFileList(){this.isLoadingSignal.set(!0),this.fileApi.listFiles().subscribe({next:t=>{let e=t.map(i=>ut(Z({},i),{lastModified:new Date(i.lastModified)})).sort((i,n)=>n.lastModified.getTime()-i.lastModified.getTime());this.filesSignal.set(e),this.isLoadingSignal.set(!1)},error:t=>{console.error("[FILE_EXCHANGE_STATE] Error loading files:",t),this.isLoadingSignal.set(!1)}})}uploadFile(t){return te(this,null,function*(){return new Promise(e=>{this.fileApi.uploadFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:i=>{console.error("[FILE_EXCHANGE_STATE] Upload error:",i),e({success:!1,error:i.message||"Upload failed"})}})})})}downloadAllFiles(){let t=this.filesSignal();if(t.length===0){console.warn("[FILE_EXCHANGE_STATE] No files to download");return}t.forEach((e,i)=>{setTimeout(()=>{this.downloadFile(e.filename)},i*300)})}downloadFile(t){this.fileApi.downloadFile(t).subscribe({next:e=>{let i=window.URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download=t,n.click(),window.URL.revokeObjectURL(i)},error:e=>{console.error("[FILE_EXCHANGE_STATE] Download error:",e)}})}deleteFile(t){return te(this,null,function*(){return new Promise(e=>{this.fileApi.deleteFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:i=>{console.error("[FILE_EXCHANGE_STATE] Delete error:",i),e({success:!1,error:i.message||"Delete failed"})}})})})}subscribeToFileEvents(){this.eventStream.events$.pipe(me(t=>t instanceof Bn),rn()).subscribe(t=>{this.handleFileEvent(t)})}handleFileEvent(t){let e=this.filesSignal();switch(t.operation){case"created":{let i=t.timestamp,n=t.timestamp.lastIndexOf("-");if(n>0){let a=t.timestamp.substring(n+1);a.length===5&&/^[a-z0-9]+$/.test(a)&&(i=t.timestamp.substring(0,n))}let r={filename:t.filename,size:t.size||0,lastModified:new Date(i)};this.filesSignal.set([r,...e]);break}case"updated":{let i=e.filter(h=>h.filename!==t.filename),n=e.find(h=>h.filename===t.filename),r=t.timestamp,a=t.timestamp.lastIndexOf("-");if(a>0){let h=t.timestamp.substring(a+1);h.length===5&&/^[a-z0-9]+$/.test(h)&&(r=t.timestamp.substring(0,a))}let c={filename:t.filename,size:t.size||n?.size||0,lastModified:new Date(r)};this.filesSignal.set([c,...i]);break}case"deleted":{let i=e.filter(n=>n.filename!==t.filename);this.filesSignal.set(i);break}}}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};function S0(o,t){if(o&1&&I(0,"div",1),o&2){let e=u();w("innerHTML",e.renderedContent,Zt)}}function k0(o,t){if(o&1&&I(0,"iframe",2),o&2){let e=u();w("srcdoc",e.content,Zt)}}function M0(o,t){if(o&1&&(s(0,"pre",3),p(1),l()),o&2){let e=u();d(),O(e.content)}}var ol=class o{content="";format="text";renderedContent="";sanitizer=m(Ri);markdownService=m($i);ngOnChanges(t){(t.content||t.format)&&this.renderContent()}renderContent(){this.format==="markdown"?this.renderMarkdown():this.format==="json"&&this.formatJson()}renderMarkdown(){return te(this,null,function*(){try{let t=yield this.markdownService.parse(this.content);this.renderedContent=this.sanitizer.bypassSecurityTrustHtml(t)}catch(t){console.error("[CONTENT_RENDERER] Error rendering markdown:",t),this.content=this.content}})}formatJson(){try{let t=JSON.parse(this.content);this.content=JSON.stringify(t,null,2)}catch(t){console.error("[CONTENT_RENDERER] Error formatting JSON:",t)}}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-content-renderer"]],inputs:{content:"content",format:"format"},features:[nt],decls:4,vars:2,consts:[[1,"content-renderer",3,"ngClass"],[1,"markdown-content",3,"innerHTML"],["sandbox","allow-same-origin",1,"html-viewer",3,"srcdoc"],[1,"code-content"]],template:function(e,i){e&1&&(s(0,"div",0),C(1,S0,1,1,"div",1)(2,k0,1,1,"iframe",2)(3,M0,2,1,"pre",3),l()),e&2&&(w("ngClass","format-"+i.format),d(),x(i.format==="markdown"?1:i.format==="html"?2:3))},dependencies:[Fe,On],styles:[".content-renderer[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;padding:1rem}.markdown-content[_ngcontent-%COMP%]{line-height:1.6;color:var(--color-text)}.code-content[_ngcontent-%COMP%]{font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:.9rem;line-height:1.5;margin:0;white-space:pre-wrap;word-wrap:break-word;color:var(--color-text)}.format-json[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%]{color:var(--color-code-text, #d63384)}.format-yaml[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%], .format-text[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%]{color:var(--color-text)}.html-viewer[_ngcontent-%COMP%]{width:100%;height:100%;min-height:400px;border:1px solid var(--color-border);border-radius:8px;background:#fff}"]})};var hr=class o{http=m(Xe);MAX_FILE_SIZE=20*1024*1024;isViewable(t){return t<=this.MAX_FILE_SIZE}isFormatViewable(t){let e=t.split(".").pop()?.toLowerCase();return!(e&&["pdf","png","jpg","jpeg","gif","webp","zip","tar","gz","exe","bin","doc","docx","xls","xlsx","ppt","pptx"].includes(e))}detectFormat(t){switch(t.split(".").pop()?.toLowerCase()){case"md":return"markdown";case"json":return"json";case"yaml":case"yml":return"yaml";case"html":case"htm":return"html";default:return"text"}}loadFileContent(t,e,i){let n=`/api/projects/${t}/threads/${e}/files/${encodeURIComponent(i)}`,r=this.detectFormat(i);return this.http.get(n,{responseType:"text",observe:"response"}).pipe(ve(a=>{let c=a.body||"",h=new Blob([c]).size;return{content:c,format:r,filename:i,size:h}}),kn(a=>(console.error("[CONTENT_VIEWER] Error loading file:",i,a),Oo(()=>new Error(`Failed to load file: ${a.message||"Unknown error"}`)))))}formatSize(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};function T0(o,t){if(o&1){let e=k();s(0,"button",12),f("click",function(){b(e);let n=u();return v(n.download())}),s(1,"mat-icon"),p(2,"download"),l()()}}function E0(o,t){o&1&&(s(0,"div",9),I(1,"mat-spinner",13),s(2,"p"),p(3,"Loading file content..."),l()())}function P0(o,t){if(o&1){let e=k();s(0,"div",10)(1,"mat-icon",14),p(2,"error_outline"),l(),s(3,"p",15),p(4),l(),s(5,"button",16),f("click",function(){b(e);let n=u();return v(n.download())}),s(6,"mat-icon"),p(7,"download"),l(),p(8," Download instead "),l()()}if(o&2){let e=u();d(4),O(e.error)}}function O0(o,t){if(o&1&&I(0,"app-content-renderer",11),o&2){let e=u();w("content",e.fileContent.content)("format",e.fileContent.format)}}var rl=class o{destroy$=new R;file;projectName;threadId;closeViewer=new H;contentService=m(hr);eventStream=m(Yi);fileContent=null;isLoading=!1;error="";ngOnInit(){this.loadContent(),this.subscribeToFileEvents()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}loadContent(){if(!this.contentService.isViewable(this.file.size)){this.error=`File too large to view (${this.contentService.formatSize(this.file.size)}). Maximum size: 20 MB.`;return}this.isLoading=!0,this.error="",this.contentService.loadFileContent(this.projectName,this.threadId,this.file.filename).subscribe({next:t=>{console.log("[CONTENT_VIEWER] Content loaded:",t.filename),this.fileContent=t,this.isLoading=!1},error:t=>{console.error("[CONTENT_VIEWER] Error loading content:",t),this.error=t.message||"Failed to load file content",this.isLoading=!1}})}onClose(){this.closeViewer.emit()}download(){let t=new Blob([this.fileContent?.content||""],{type:"text/plain"}),e=window.URL.createObjectURL(t),i=document.createElement("a");i.href=e,i.download=this.file.filename,i.click(),window.URL.revokeObjectURL(e)}formatSize(t){return this.contentService.formatSize(t)}subscribeToFileEvents(){this.eventStream.events$.pipe(me(t=>t instanceof Bn),me(t=>t.filename===this.file.filename),me(t=>t.operation==="updated"),N(this.destroy$)).subscribe(t=>{console.log("[CONTENT_VIEWER] File updated event received, reloading:",t.filename),t.size&&(this.file.size=t.size),this.loadContent()})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-content-viewer"]],inputs:{file:"file",projectName:"projectName",threadId:"threadId"},outputs:{closeViewer:"closeViewer"},decls:16,vars:6,consts:[[1,"viewer-container"],[1,"viewer-header"],[1,"header-info"],[1,"filename"],[1,"file-size"],[1,"header-actions"],["mat-icon-button","","title","Download","type","button"],["mat-icon-button","","title","Close","type","button",3,"click"],[1,"viewer-content"],[1,"loading-state"],[1,"error-state"],[3,"content","format"],["mat-icon-button","","title","Download","type","button",3,"click"],["diameter","48"],[1,"error-icon"],[1,"error-message"],["mat-raised-button","","color","primary","type","button",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),p(4),l(),s(5,"span",4),p(6),l()(),s(7,"div",5),C(8,T0,3,0,"button",6),s(9,"button",7),f("click",function(){return i.onClose()}),s(10,"mat-icon"),p(11,"chevron_right"),l()()()(),s(12,"div",8),C(13,E0,4,0,"div",9),C(14,P0,9,1,"div",10),C(15,O0,1,2,"app-content-renderer",11),l()()),e&2&&(d(4),O(i.file.filename),d(2),O(i.formatSize(i.file.size)),d(2),x(i.fileContent&&!i.isLoading&&!i.error?8:-1),d(5),x(i.isLoading?13:-1),d(),x(i.error?14:-1),d(),x(i.fileContent&&!i.isLoading&&!i.error?15:-1))},dependencies:[Fe,Me,he,ot,Ot,Ke,cr,lr,ol],styles:[".viewer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--color-bg)}.viewer-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:1rem;border-bottom:1px solid var(--color-border);background:var(--color-bg);flex-shrink:0}.header-info[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}.filename[_ngcontent-%COMP%]{font-weight:500;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-size[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary)}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-shrink:0}.viewer-content[_ngcontent-%COMP%]{flex:1;overflow:auto;background:var(--color-bg)}.loading-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:1rem;color:var(--color-text-secondary)}.error-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:1rem;padding:2rem;text-align:center}.error-icon[_ngcontent-%COMP%]{font-size:3rem;width:3rem;height:3rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{color:var(--color-text);margin:0;max-width:400px}"]})};var A0=Math.pow(10,8)*24*60*60*1e3,RD=-A0,al=6048e5,iu=864e5;var I0=3600;var nu=I0*24,FD=nu*7,D0=nu*365.2425,R0=D0/12,ND=R0*3,_d=Symbol.for("constructDateFrom");function mt(o,t){return typeof o=="function"?o(t):o&&typeof o=="object"&&_d in o?o[_d](t):o instanceof Date?new o.constructor(t):new Date(t)}function Ze(o,t){return mt(t||o,o)}function ou(o,t,e){let i=Ze(o,e?.in);return isNaN(t)?mt(e?.in||o,NaN):(t&&i.setDate(i.getDate()+t),i)}var F0={};function Un(){return F0}function yn(o,t){let e=Un(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,n=Ze(o,t?.in),r=n.getDay(),a=(r<i?7:0)+r-i;return n.setDate(n.getDate()-a),n.setHours(0,0,0,0),n}function fo(o,t){return yn(o,ut(Z({},t),{weekStartsOn:1}))}function sl(o,t){let e=Ze(o,t?.in),i=e.getFullYear(),n=mt(e,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);let r=fo(n),a=mt(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);let c=fo(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=c.getTime()?i:i-1}function bd(o){let t=Ze(o),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+o-+e}function ur(o,...t){let e=mt.bind(null,o||t.find(i=>typeof i=="object"));return t.map(e)}function gr(o,t){let e=Ze(o,t?.in);return e.setHours(0,0,0,0),e}function ll(o,t,e){let[i,n]=ur(e?.in,o,t),r=gr(i),a=gr(n),c=+r-bd(r),h=+a-bd(a);return Math.round((c-h)/iu)}function ru(o,t){let e=sl(o,t),i=mt(t?.in||o,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),fo(i)}function au(o){return mt(o,Date.now())}function su(o,t,e){let[i,n]=ur(e?.in,o,t);return+gr(i)==+gr(n)}function lu(o){return o instanceof Date||typeof o=="object"&&Object.prototype.toString.call(o)==="[object Date]"}function cu(o){return!(!lu(o)&&typeof o!="number"||isNaN(+Ze(o)))}function mu(o,t,e){let[i,n]=ur(e?.in,o,t),r=du(i,n),a=Math.abs(ll(i,n));i.setDate(i.getDate()-r*a);let c=+(du(i,n)===-r),h=r*(a-c);return h===0?0:h}function du(o,t){let e=o.getFullYear()-t.getFullYear()||o.getMonth()-t.getMonth()||o.getDate()-t.getDate()||o.getHours()-t.getHours()||o.getMinutes()-t.getMinutes()||o.getSeconds()-t.getSeconds()||o.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function pu(o,t){let e=Ze(o,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}var N0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},hu=(o,t,e)=>{let i,n=N0[o];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function cl(o){return(t={})=>{let e=t.width?String(t.width):o.defaultWidth;return o.formats[e]||o.formats[o.defaultWidth]}}var L0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},V0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},z0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},uu={date:cl({formats:L0,defaultWidth:"full"}),time:cl({formats:V0,defaultWidth:"full"}),dateTime:cl({formats:z0,defaultWidth:"full"})};var j0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},gu=(o,t,e,i)=>j0[o];function fr(o){return(t,e)=>{let i=e?.context?String(e.context):"standalone",n;if(i==="formatting"&&o.formattingValues){let a=o.defaultFormattingWidth||o.defaultWidth,c=e?.width?String(e.width):a;n=o.formattingValues[c]||o.formattingValues[a]}else{let a=o.defaultWidth,c=e?.width?String(e.width):o.defaultWidth;n=o.values[c]||o.values[a]}let r=o.argumentCallback?o.argumentCallback(t):t;return n[r]}}var B0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},H0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},U0={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},W0={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},$0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},q0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},G0=(o,t)=>{let e=Number(o),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},fu={ordinalNumber:G0,era:fr({values:B0,defaultWidth:"wide"}),quarter:fr({values:H0,defaultWidth:"wide",argumentCallback:o=>o-1}),month:fr({values:U0,defaultWidth:"wide"}),day:fr({values:W0,defaultWidth:"wide"}),dayPeriod:fr({values:$0,defaultWidth:"wide",formattingValues:q0,defaultFormattingWidth:"wide"})};function _r(o){return(t,e={})=>{let i=e.width,n=i&&o.matchPatterns[i]||o.matchPatterns[o.defaultMatchWidth],r=t.match(n);if(!r)return null;let a=r[0],c=i&&o.parsePatterns[i]||o.parsePatterns[o.defaultParseWidth],h=Array.isArray(c)?Q0(c,S=>S.test(a)):Y0(c,S=>S.test(a)),g;g=o.valueCallback?o.valueCallback(h):h,g=e.valueCallback?e.valueCallback(g):g;let y=t.slice(a.length);return{value:g,rest:y}}}function Y0(o,t){for(let e in o)if(Object.prototype.hasOwnProperty.call(o,e)&&t(o[e]))return e}function Q0(o,t){for(let e=0;e<o.length;e++)if(t(o[e]))return e}function _u(o){return(t,e={})=>{let i=t.match(o.matchPattern);if(!i)return null;let n=i[0],r=t.match(o.parsePattern);if(!r)return null;let a=o.valueCallback?o.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;let c=t.slice(n.length);return{value:a,rest:c}}}var X0=/^(\d+)(th|st|nd|rd)?/i,K0=/\d+/i,Z0={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},J0={any:[/^b/i,/^(a|c)/i]},ev={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},tv={any:[/1/i,/2/i,/3/i,/4/i]},iv={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},nv={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ov={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},rv={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},av={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},sv={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},bu={ordinalNumber:_u({matchPattern:X0,parsePattern:K0,valueCallback:o=>parseInt(o,10)}),era:_r({matchPatterns:Z0,defaultMatchWidth:"wide",parsePatterns:J0,defaultParseWidth:"any"}),quarter:_r({matchPatterns:ev,defaultMatchWidth:"wide",parsePatterns:tv,defaultParseWidth:"any",valueCallback:o=>o+1}),month:_r({matchPatterns:iv,defaultMatchWidth:"wide",parsePatterns:nv,defaultParseWidth:"any"}),day:_r({matchPatterns:ov,defaultMatchWidth:"wide",parsePatterns:rv,defaultParseWidth:"any"}),dayPeriod:_r({matchPatterns:av,defaultMatchWidth:"any",parsePatterns:sv,defaultParseWidth:"any"})};var vd={code:"en-US",formatDistance:hu,formatLong:uu,formatRelative:gu,localize:fu,match:bu,options:{weekStartsOn:0,firstWeekContainsDate:1}};function vu(o,t){let e=Ze(o,t?.in);return ll(e,pu(e))+1}function yu(o,t){let e=Ze(o,t?.in),i=+fo(e)-+ru(e);return Math.round(i/al)+1}function dl(o,t){let e=Ze(o,t?.in),i=e.getFullYear(),n=Un(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=mt(t?.in||o,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);let c=yn(a,t),h=mt(t?.in||o,0);h.setFullYear(i,0,r),h.setHours(0,0,0,0);let g=yn(h,t);return+e>=+c?i+1:+e>=+g?i:i-1}function Cu(o,t){let e=Un(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,n=dl(o,t),r=mt(t?.in||o,0);return r.setFullYear(n,0,i),r.setHours(0,0,0,0),yn(r,t)}function xu(o,t){let e=Ze(o,t?.in),i=+yn(e,t)-+Cu(e,t);return Math.round(i/al)+1}function Pe(o,t){let e=o<0?"-":"",i=Math.abs(o).toString().padStart(t,"0");return e+i}var Cn={y(o,t){let e=o.getFullYear(),i=e>0?e:1-e;return Pe(t==="yy"?i%100:i,t.length)},M(o,t){let e=o.getMonth();return t==="M"?String(e+1):Pe(e+1,2)},d(o,t){return Pe(o.getDate(),t.length)},a(o,t){let e=o.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(o,t){return Pe(o.getHours()%12||12,t.length)},H(o,t){return Pe(o.getHours(),t.length)},m(o,t){return Pe(o.getMinutes(),t.length)},s(o,t){return Pe(o.getSeconds(),t.length)},S(o,t){let e=t.length,i=o.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return Pe(n,t.length)}};var br={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},yd={G:function(o,t,e){let i=o.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(o,t,e){if(t==="yo"){let i=o.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return Cn.y(o,t)},Y:function(o,t,e,i){let n=dl(o,i),r=n>0?n:1-n;if(t==="YY"){let a=r%100;return Pe(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Pe(r,t.length)},R:function(o,t){let e=sl(o);return Pe(e,t.length)},u:function(o,t){let e=o.getFullYear();return Pe(e,t.length)},Q:function(o,t,e){let i=Math.ceil((o.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Pe(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(o,t,e){let i=Math.ceil((o.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Pe(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(o,t,e){let i=o.getMonth();switch(t){case"M":case"MM":return Cn.M(o,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(o,t,e){let i=o.getMonth();switch(t){case"L":return String(i+1);case"LL":return Pe(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(o,t,e,i){let n=xu(o,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):Pe(n,t.length)},I:function(o,t,e){let i=yu(o);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Pe(i,t.length)},d:function(o,t,e){return t==="do"?e.ordinalNumber(o.getDate(),{unit:"date"}):Cn.d(o,t)},D:function(o,t,e){let i=vu(o);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Pe(i,t.length)},E:function(o,t,e){let i=o.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(o,t,e,i){let n=o.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Pe(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(n,{width:"short",context:"formatting"});case"eeee":default:return e.day(n,{width:"wide",context:"formatting"})}},c:function(o,t,e,i){let n=o.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Pe(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(o,t,e){let i=o.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return Pe(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(o,t,e){let n=o.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(o,t,e){let i=o.getHours(),n;switch(i===12?n=br.noon:i===0?n=br.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(o,t,e){let i=o.getHours(),n;switch(i>=17?n=br.evening:i>=12?n=br.afternoon:i>=4?n=br.morning:n=br.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(o,t,e){if(t==="ho"){let i=o.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Cn.h(o,t)},H:function(o,t,e){return t==="Ho"?e.ordinalNumber(o.getHours(),{unit:"hour"}):Cn.H(o,t)},K:function(o,t,e){let i=o.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Pe(i,t.length)},k:function(o,t,e){let i=o.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Pe(i,t.length)},m:function(o,t,e){return t==="mo"?e.ordinalNumber(o.getMinutes(),{unit:"minute"}):Cn.m(o,t)},s:function(o,t,e){return t==="so"?e.ordinalNumber(o.getSeconds(),{unit:"second"}):Cn.s(o,t)},S:function(o,t){return Cn.S(o,t)},X:function(o,t,e){let i=o.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Su(i);case"XXXX":case"XX":return _o(i);case"XXXXX":case"XXX":default:return _o(i,":")}},x:function(o,t,e){let i=o.getTimezoneOffset();switch(t){case"x":return Su(i);case"xxxx":case"xx":return _o(i);case"xxxxx":case"xxx":default:return _o(i,":")}},O:function(o,t,e){let i=o.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+wu(i,":");case"OOOO":default:return"GMT"+_o(i,":")}},z:function(o,t,e){let i=o.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+wu(i,":");case"zzzz":default:return"GMT"+_o(i,":")}},t:function(o,t,e){let i=Math.trunc(+o/1e3);return Pe(i,t.length)},T:function(o,t,e){return Pe(+o,t.length)}};function wu(o,t=""){let e=o>0?"-":"+",i=Math.abs(o),n=Math.trunc(i/60),r=i%60;return r===0?e+String(n):e+String(n)+t+Pe(r,2)}function Su(o,t){return o%60===0?(o>0?"-":"+")+Pe(Math.abs(o)/60,2):_o(o,t)}function _o(o,t=""){let e=o>0?"-":"+",i=Math.abs(o),n=Pe(Math.trunc(i/60),2),r=Pe(i%60,2);return e+n+t+r}var ku=(o,t)=>{switch(o){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Mu=(o,t)=>{switch(o){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},lv=(o,t)=>{let e=o.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return ku(o,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",ku(i,t)).replace("{{time}}",Mu(n,t))},Tu={p:Mu,P:lv};var cv=/^D+$/,dv=/^Y+$/,mv=["D","DD","YY","YYYY"];function Eu(o){return cv.test(o)}function Pu(o){return dv.test(o)}function Ou(o,t,e){let i=pv(o,t,e);if(console.warn(i),mv.includes(o))throw new RangeError(i)}function pv(o,t,e){let i=o[0]==="Y"?"years":"days of the month";return`Use \`${o.toLowerCase()}\` instead of \`${o}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var hv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,gv=/^'([^]*?)'?$/,fv=/''/g,_v=/[a-zA-Z]/;function Cd(o,t,e){let i=Un(),n=e?.locale??i.locale??vd,r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,c=Ze(o,e?.in);if(!cu(c))throw new RangeError("Invalid time value");let h=t.match(uv).map(y=>{let S=y[0];if(S==="p"||S==="P"){let A=Tu[S];return A(y,n.formatLong)}return y}).join("").match(hv).map(y=>{if(y==="''")return{isToken:!1,value:"'"};let S=y[0];if(S==="'")return{isToken:!1,value:bv(y)};if(yd[S])return{isToken:!0,value:y};if(S.match(_v))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:y}});n.localize.preprocessor&&(h=n.localize.preprocessor(c,h));let g={firstWeekContainsDate:r,weekStartsOn:a,locale:n};return h.map(y=>{if(!y.isToken)return y.value;let S=y.value;(!e?.useAdditionalWeekYearTokens&&Pu(S)||!e?.useAdditionalDayOfYearTokens&&Eu(S))&&Ou(S,t,String(o));let A=yd[S[0]];return A(c,S,n.localize,g)}).join("")}function bv(o){let t=o.match(gv);return t?t[1].replace(fv,"'"):o}function Au(o,t,e){return ou(o,-t,e)}function Iu(o,t){return su(mt(t?.in||o,o),Au(au(t?.in||o),1))}function Du(o){if(!o||isNaN(o.getTime()))return"unknown";let t=new Date,e=Cd(o,"HH:mm:ss"),i=t.getTime()-o.getTime(),n=Math.floor(i/(1e3*60));if(n<1)return`just now (${e})`;if(n<60)return`${n} min ago (${e})`;let r=Math.floor(i/(1e3*60*60));if(r<24)return`${r}h ago (${e})`;if(Iu(o))return`yesterday ${e}`;let a=mu(t,o);return a<7?`${a}d ago ${e}`:`${Cd(o,"dd/MM/yyyy")} ${e}`}var vv=(o,t)=>t.filename;function yv(o,t){if(o&1){let e=k();s(0,"button",11),f("click",function(){b(e);let n=u(2);return v(n.downloadAll())}),s(1,"mat-icon"),p(2,"download_for_offline"),l()()}}function Cv(o,t){o&1&&(s(0,"div",10),I(1,"span",12),s(2,"span",13),p(3,"Loading files..."),l()())}function xv(o,t){o&1&&(s(0,"div",14)(1,"mat-icon",15),p(2,"folder_open"),l(),s(3,"p",16),p(4,"No files in exchange space"),l(),s(5,"p",17),p(6,"Upload files to share with the agent"),l()())}function wv(o,t){if(o&1){let e=k();s(0,"button",28),f("click",function(){b(e);let n=u().$implicit,r=u(4);return v(r.viewFile(n))}),s(1,"mat-icon"),p(2,"visibility"),l()()}}function Sv(o,t){if(o&1){let e=k();s(0,"div",18)(1,"div",19)(2,"mat-icon",20),p(3),l(),s(4,"div",21)(5,"span",22),p(6),l(),s(7,"span",23),p(8),l()()(),s(9,"div",24),C(10,wv,3,0,"button",25),s(11,"button",26),f("click",function(){let n=b(e).$implicit,r=u(4);return v(r.download(n))}),s(12,"mat-icon"),p(13,"download"),l()(),s(14,"button",27),f("click",function(){let n=b(e).$implicit,r=u(4);return v(r.delete(n))}),s(15,"mat-icon"),p(16,"delete"),l()()()()}if(o&2){let e=t.$implicit,i=u(4);d(3),O(i.getFileIcon(e.filename)),d(2),w("title",e.filename),d(),O(e.filename),d(2),Tn("",i.formatSize(e.size)," \u2022 ",i.formatDate(e.lastModified)),d(2),x(i.canViewFile(e)?10:-1)}}function kv(o,t){if(o&1&&we(0,Sv,17,6,"div",18,vv),o&2){let e=u(3);Se(e.files())}}function Mv(o,t){if(o&1&&C(0,xv,7,0,"div",14)(1,kv,2,0),o&2){let e=u(2);x(e.files().length===0?0:1)}}function Tv(o,t){if(o&1){let e=k();s(0,"div",0)(1,"div",2)(2,"div",3)(3,"h3",4),p(4,"Exchange"),l(),s(5,"span",5),p(6),l()(),s(7,"div",6),C(8,yv,3,0,"button",7),s(9,"button",8),f("click",function(){b(e);let n=u();return v(n.close())}),s(10,"mat-icon"),p(11,"chevron_right"),l()()()(),s(12,"div",9),C(13,Cv,4,0,"div",10)(14,Mv,2,1),l()()}if(o&2){let e=u();d(6),ie("(",e.files().length,")"),d(2),x(e.files().length>0?8:-1),d(5),x(e.isLoading()?13:14)}}function Ev(o,t){if(o&1){let e=k();s(0,"app-content-viewer",29),f("closeViewer",function(){b(e);let n=u();return v(n.backToList())}),l()}if(o&2){let e=u();w("file",e.currentFile)("projectName",e.projectName)("threadId",e.threadId)}}var ml=class o{projectName;threadId;closeDrawer=new H;fileExchangeState=m(pr);contentViewerService=m(hr);files=this.fileExchangeState.files;isLoading=this.fileExchangeState.isLoading;viewerState="list";currentFile=null;close(){this.viewerState==="content"?this.backToList():this.closeDrawer.emit()}viewFile(t){this.currentFile=t,this.viewerState="content"}backToList(){this.viewerState="list",this.currentFile=null}downloadAll(){this.fileExchangeState.downloadAllFiles()}download(t){this.fileExchangeState.downloadFile(t.filename)}delete(t){return te(this,null,function*(){if(!confirm(`Delete file "${t.filename}"?`))return;let i=yield this.fileExchangeState.deleteFile(t.filename);i.success||alert(`Failed to delete file: ${i.error}`)})}getFileIcon(t){switch(t.split(".").pop()?.toLowerCase()){case"pdf":return"picture_as_pdf";case"csv":case"xlsx":case"xls":return"table_chart";case"txt":case"md":return"description";case"jpg":case"jpeg":case"png":case"gif":case"webp":return"image";case"zip":case"tar":case"gz":return"folder_zip";default:return"insert_drive_file"}}formatSize(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}formatDate(t){return Du(t)}canViewFile(t){return this.contentViewerService.isFormatViewable(t.filename)&&this.contentViewerService.isViewable(t.size)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-file-exchange-drawer"]],inputs:{projectName:"projectName",threadId:"threadId"},outputs:{closeDrawer:"closeDrawer"},decls:2,vars:2,consts:[[1,"file-drawer-container"],[3,"file","projectName","threadId"],[1,"drawer-header"],[1,"header-left"],[1,"drawer-title"],[1,"file-count"],[1,"header-actions"],["mat-icon-button","","title","Download all files","type","button",1,"download-all-btn"],["mat-icon-button","","title","Close","type","button",1,"close-btn",3,"click"],[1,"file-list"],[1,"file-loading"],["mat-icon-button","","title","Download all files","type","button",1,"download-all-btn",3,"click"],[1,"loading-spinner"],[1,"loading-text"],[1,"file-empty"],[1,"empty-icon"],[1,"empty-text"],[1,"empty-hint"],[1,"file-item"],[1,"file-info"],[1,"file-icon"],[1,"file-details"],[1,"file-name",3,"title"],[1,"file-meta"],[1,"file-actions"],["mat-icon-button","","title","View","type","button",1,"action-btn","view-btn"],["mat-icon-button","","title","Download","type","button",1,"action-btn","download-btn",3,"click"],["mat-icon-button","","title","Delete","type","button",1,"action-btn","delete-btn",3,"click"],["mat-icon-button","","title","View","type","button",1,"action-btn","view-btn",3,"click"],[3,"closeViewer","file","projectName","threadId"]],template:function(e,i){e&1&&(C(0,Tv,15,3,"div",0),C(1,Ev,1,3,"app-content-viewer",1)),e&2&&(x(i.viewerState==="list"?0:-1),d(),x(i.viewerState==="content"&&i.currentFile?1:-1))},dependencies:[Fe,Me,he,ot,Ke,rl],styles:[".file-drawer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);color:var(--color-text)}.drawer-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--color-border);flex-shrink:0}.header-left[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:.5rem}.header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.drawer-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text)}.file-count[_ngcontent-%COMP%]{font-size:.9rem;color:var(--color-text-secondary)}.download-all-btn[_ngcontent-%COMP%]{color:var(--color-primary)}.download-all-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.close-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.close-btn[_ngcontent-%COMP%]:hover{color:var(--color-text);background:var(--color-bg-hover)}.file-list[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:.5rem}.file-loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;gap:1rem;color:var(--color-text-secondary)}.loading-spinner[_ngcontent-%COMP%]{display:inline-block;width:32px;height:32px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.loading-text[_ngcontent-%COMP%]{font-size:.9rem}.file-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;text-align:center;color:var(--color-text-secondary)}.empty-icon[_ngcontent-%COMP%]{font-size:64px;width:64px;height:64px;margin-bottom:1rem;opacity:.5}.empty-text[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:500}.empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;opacity:.7}.file-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:.75rem;border-radius:8px;transition:background .2s;gap:1rem}.file-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.file-item[_ngcontent-%COMP%]:hover .file-actions[_ngcontent-%COMP%]{opacity:1}.file-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;flex:1;min-width:0}.file-icon[_ngcontent-%COMP%]{flex-shrink:0;color:var(--color-primary);font-size:28px;width:28px;height:28px}.file-details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:0}.file-name[_ngcontent-%COMP%]{font-weight:500;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-meta[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary)}.file-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-shrink:0;opacity:0;transition:opacity .2s}.action-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.action-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.action-btn.view-btn[_ngcontent-%COMP%]:hover, .action-btn.download-btn[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.action-btn.delete-btn[_ngcontent-%COMP%]:hover{color:var(--color-error)}@media (max-width: 768px){.file-actions[_ngcontent-%COMP%]{opacity:1}.file-item[_ngcontent-%COMP%]{padding:1rem .75rem}.drawer-header[_ngcontent-%COMP%]{padding:.75rem;padding-top:calc(.75rem + env(safe-area-inset-top,0px))}}"]})};var Pv=["tooltip"],xd=20;var wd=new oe("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(ye);return()=>Bi(o,{scrollThrottle:xd})}});function Nu(o){let t=m(ye);return()=>Bi(t,{scrollThrottle:xd})}var Sd={provide:wd,deps:[],useFactory:Nu};function Lu(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}var Vu=new oe("mat-tooltip-default-options",{providedIn:"root",factory:Lu});var Ru="tooltip-panel",Fu=Nm({passive:!0}),Ov=8,Av=8,Iv=24,Dv=200,kd=(()=>{class o{_elementRef=m(ne);_ngZone=m(pe);_platform=m(tt);_ariaDescriber=m(Ga);_focusMonitor=m(Ni);_dir=m(bt);_injector=m(ye);_viewContainerRef=m(Zn);_animationsDisabled=$e();_defaultOptions=m(Vu,{optional:!0});_overlayRef;_tooltipInstance;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=!1;_disabled=!1;_tooltipClass;_viewInitialized=!1;_pointerExitEventsInitialized=!1;_tooltipComponent=zu;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending;_dirSubscribed=!1;get position(){return this._position}set position(e){e!==this._position&&(this._position=e,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()))}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(e){this._positionAtOrigin=Pt(e),this._detach(),this._overlayRef=null}get disabled(){return this._disabled}set disabled(e){let i=Pt(e);this._disabled!==i&&(this._disabled=i,i?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message))}get showDelay(){return this._showDelay}set showDelay(e){this._showDelay=fi(e)}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(e){this._hideDelay=fi(e),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay)}_hideDelay;touchGestures="auto";get message(){return this._message}set message(e){let i=this._message;this._message=e!=null?String(e).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(i)}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(e){this._tooltipClass=e,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}_passiveListeners=[];_touchstartTimeout=null;_destroyed=new R;_isDestroyed=!1;constructor(){let e=this._defaultOptions;e&&(this._showDelay=e.showDelay,this._hideDelay=e.hideDelay,e.position&&(this.position=e.position),e.positionAtOrigin&&(this.positionAtOrigin=e.positionAtOrigin),e.touchGestures&&(this.touchGestures=e.touchGestures),e.tooltipClass&&(this.tooltipClass=e.tooltipClass)),this._viewportMargin=Ov}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(N(this._destroyed)).subscribe(e=>{e?e==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){let e=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._passiveListeners.forEach(([i,n])=>{e.removeEventListener(i,n,Fu)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=!0,this._ariaDescriber.removeDescription(e,this.message,"tooltip"),this._focusMonitor.stopMonitoring(e)}show(e=this.showDelay,i){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let n=this._createOverlay(i);this._detach(),this._portal=this._portal||new vi(this._tooltipComponent,this._viewContainerRef);let r=this._tooltipInstance=n.attach(this._portal).instance;r._triggerElement=this._elementRef.nativeElement,r._mouseLeaveHideDelay=this._hideDelay,r.afterHidden().pipe(N(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),r.show(e)}hide(e=this.hideDelay){let i=this._tooltipInstance;i&&(i.isVisible()?i.hide(e):(i._cancelPendingAnimations(),this._detach()))}toggle(e){this._isTooltipVisible()?this.hide():this.show(void 0,e)}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(e){if(this._overlayRef){let a=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!e)&&a._origin instanceof ne)return this._overlayRef;this._detach()}let i=this._injector.get(cn).getAncestorScrollContainers(this._elementRef),n=`${this._cssClassPrefix}-${Ru}`,r=Yr(this._injector,this.positionAtOrigin?e||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(i);return r.positionChanges.pipe(N(this._destroyed)).subscribe(a=>{this._updateCurrentPositionClass(a.connectionPair),this._tooltipInstance&&a.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=hn(this._injector,{direction:this._dir,positionStrategy:r,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,n]:n,scrollStrategy:this._injector.get(wd)(),disableAnimations:this._animationsDisabled}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(N(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(N(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(N(this._destroyed)).subscribe(a=>{this._isTooltipVisible()&&a.keyCode===27&&!_t(a)&&(a.preventDefault(),a.stopPropagation(),this._ngZone.run(()=>this.hide(0)))}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=!0,this._dir.change.pipe(N(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(e){let i=e.getConfig().positionStrategy,n=this._getOrigin(),r=this._getOverlayPosition();i.withPositions([this._addOffset(Z(Z({},n.main),r.main)),this._addOffset(Z(Z({},n.fallback),r.fallback))])}_addOffset(e){let i=Av,n=!this._dir||this._dir.value=="ltr";return e.originY==="top"?e.offsetY=-i:e.originY==="bottom"?e.offsetY=i:e.originX==="start"?e.offsetX=n?-i:i:e.originX==="end"&&(e.offsetX=n?i:-i),e}_getOrigin(){let e=!this._dir||this._dir.value=="ltr",i=this.position,n;i=="above"||i=="below"?n={originX:"center",originY:i=="above"?"top":"bottom"}:i=="before"||i=="left"&&e||i=="right"&&!e?n={originX:"start",originY:"center"}:(i=="after"||i=="right"&&e||i=="left"&&!e)&&(n={originX:"end",originY:"center"});let{x:r,y:a}=this._invertPosition(n.originX,n.originY);return{main:n,fallback:{originX:r,originY:a}}}_getOverlayPosition(){let e=!this._dir||this._dir.value=="ltr",i=this.position,n;i=="above"?n={overlayX:"center",overlayY:"bottom"}:i=="below"?n={overlayX:"center",overlayY:"top"}:i=="before"||i=="left"&&e||i=="right"&&!e?n={overlayX:"end",overlayY:"center"}:(i=="after"||i=="right"&&e||i=="left"&&!e)&&(n={overlayX:"start",overlayY:"center"});let{x:r,y:a}=this._invertPosition(n.overlayX,n.overlayY);return{main:n,fallback:{overlayX:r,overlayY:a}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),Ft(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()},{injector:this._injector}))}_setTooltipClass(e){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=e,this._tooltipInstance._markForCheck())}_invertPosition(e,i){return this.position==="above"||this.position==="below"?i==="top"?i="bottom":i==="bottom"&&(i="top"):e==="end"?e="start":e==="start"&&(e="end"),{x:e,y:i}}_updateCurrentPositionClass(e){let{overlayY:i,originX:n,originY:r}=e,a;if(i==="center"?this._dir&&this._dir.value==="rtl"?a=n==="end"?"left":"right":a=n==="start"?"left":"right":a=i==="bottom"&&r==="top"?"above":"below",a!==this._currentPosition){let c=this._overlayRef;if(c){let h=`${this._cssClassPrefix}-${Ru}-`;c.removePanelClass(h+this._currentPosition),c.addPanelClass(h+a)}this._currentPosition=a}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",e=>{this._setupPointerExitEventsIfNeeded();let i;e.x!==void 0&&e.y!==void 0&&(i=e),this.show(void 0,i)}]):this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",e=>{let i=e.targetTouches?.[0],n=i?{x:i.clientX,y:i.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let r=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,n)},this._defaultOptions?.touchLongPressShowDelay??r)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;let e=[];if(this._platformSupportsMouseEvents())e.push(["mouseleave",i=>{let n=i.relatedTarget;(!n||!this._overlayRef?.overlayElement.contains(n))&&this.hide()}],["wheel",i=>this._wheelListener(i)]);else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let i=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay)};e.push(["touchend",i],["touchcancel",i])}this._addListeners(e),this._passiveListeners.push(...e)}_addListeners(e){e.forEach(([i,n])=>{this._elementRef.nativeElement.addEventListener(i,n,Fu)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(e){if(this._isTooltipVisible()){let i=this._injector.get(et).elementFromPoint(e.clientX,e.clientY),n=this._elementRef.nativeElement;i!==n&&!n.contains(i)&&this.hide()}}_disableNativeGesturesIfNecessary(){let e=this.touchGestures;if(e!=="off"){let i=this._elementRef.nativeElement,n=i.style;(e==="on"||i.nodeName!=="INPUT"&&i.nodeName!=="TEXTAREA")&&(n.userSelect=n.msUserSelect=n.webkitUserSelect=n.MozUserSelect="none"),(e==="on"||!i.draggable)&&(n.webkitUserDrag="none"),n.touchAction="none",n.webkitTapHighlightColor="transparent"}}_syncAriaDescription(e){this._ariaDescriptionPending||(this._ariaDescriptionPending=!0,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,e,"tooltip"),this._isDestroyed||Ft({write:()=>{this._ariaDescriptionPending=!1,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")}},{injector:this._injector}))}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(i,n){i&2&&E("mat-mdc-tooltip-disabled",n.disabled)},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return o})(),zu=(()=>{class o{_changeDetectorRef=m(Qe);_elementRef=m(ne);_isMultiline=!1;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=$e();_tooltip;_closeOnInteraction=!1;_isVisible=!1;_onHide=new R;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";constructor(){}show(e){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(!0),this._showTimeoutId=void 0},e)}hide(e){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(!1),this._hideTimeoutId=void 0},e)}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_handleMouseLeave({relatedTarget:e}){(!e||!this._triggerElement.contains(e))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(!1))}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck()}_isTooltipMultiline(){let e=this._elementRef.nativeElement.getBoundingClientRect();return e.height>Iv&&e.width>=Dv}_handleAnimationEnd({animationName:e}){(e===this._showAnimation||e===this._hideAnimation)&&this._finalizeAnimation(e===this._showAnimation)}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0}_finalizeAnimation(e){e?this._closeOnInteraction=!0:this.isVisible()||this._onHide.next()}_toggleVisibility(e){let i=this._tooltip.nativeElement,n=this._showAnimation,r=this._hideAnimation;if(i.classList.remove(e?r:n),i.classList.add(e?n:r),this._isVisible!==e&&(this._isVisible=e,this._changeDetectorRef.markForCheck()),e&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let a=getComputedStyle(i);(a.getPropertyValue("animation-duration")==="0s"||a.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=!0)}e&&this._onShow(),this._animationsDisabled&&(i.classList.add("_mat-animation-noopable"),this._finalizeAnimation(e))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-tooltip-component"]],viewQuery:function(i,n){if(i&1&&X(Pv,7),i&2){let r;U(r=W())&&(n._tooltip=r.first)}},hostAttrs:["aria-hidden","true"],hostBindings:function(i,n){i&1&&f("mouseleave",function(a){return n._handleMouseLeave(a)})},decls:4,vars:4,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend","ngClass"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(i,n){if(i&1){let r=k();s(0,"div",1,0),f("animationend",function(c){return b(r),v(n._handleAnimationEnd(c))}),s(2,"div",2),p(3),l()()}i&2&&(E("mdc-tooltip--multiline",n._isMultiline),w("ngClass",n.tooltipClass),d(3),O(n.message))},dependencies:[On],styles:[`.mat-mdc-tooltip{position:relative;transform:scale(0);display:inline-flex}.mat-mdc-tooltip::before{content:"";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-surface{word-break:normal;overflow-wrap:anywhere;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center;will-change:transform,opacity;background-color:var(--mat-tooltip-container-color, var(--mat-sys-inverse-surface));color:var(--mat-tooltip-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-tooltip-container-shape, var(--mat-sys-corner-extra-small));font-family:var(--mat-tooltip-supporting-text-font, var(--mat-sys-body-small-font));font-size:var(--mat-tooltip-supporting-text-size, var(--mat-sys-body-small-size));font-weight:var(--mat-tooltip-supporting-text-weight, var(--mat-sys-body-small-weight));line-height:var(--mat-tooltip-supporting-text-line-height, var(--mat-sys-body-small-line-height));letter-spacing:var(--mat-tooltip-supporting-text-tracking, var(--mat-sys-body-small-tracking))}.mat-mdc-tooltip-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:right}.mat-mdc-tooltip-panel{line-height:normal}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}
363
- `],encapsulation:2,changeDetection:0})}return o})();var ma=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({providers:[Sd],imports:[No,yi,le,le,zi]})}return o})();var pl=class o{http=m(Xe);listUsers(){return this.http.get("/api/users")}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var hl=class o{excludedUserIds=[];placeholder="Search username";disabled=!1;userSelected=new H;userApi=m(pl);search(t){let e=t.toLowerCase();return this.userApi.listUsers().pipe(ve(i=>i.filter(n=>!this.excludedUserIds.includes(n.username)).filter(n=>n.username.toLowerCase().includes(e)).map(n=>({id:n.username,name:n.username}))))}onItemSelected(t){this.userSelected.emit(t.id)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-user-autocomplete"]],inputs:{excludedUserIds:"excludedUserIds",placeholder:"placeholder",disabled:"disabled"},outputs:{userSelected:"userSelected"},decls:1,vars:3,consts:[[3,"itemSelected","dataSource","placeholder","disabled"]],template:function(e,i){e&1&&(s(0,"ds-autocomplete-input",0),f("itemSelected",function(r){return i.onItemSelected(r)}),l()),e&2&&w("dataSource",i)("placeholder",i.placeholder)("disabled",i.disabled)},dependencies:[Km],styles:["[_nghost-%COMP%]{display:block}"]})};var Fv=(o,t)=>t.userId;function Nv(o,t){if(o&1&&(s(0,"div",4),p(1),l()),o&2){let e=u();d(),O(e.errorMessage())}}function Lv(o,t){if(o&1){let e=k();s(0,"button",10),f("click",function(){b(e);let n=u().$implicit,r=u();return v(r.removeUser(n.userId))}),s(1,"mat-icon"),p(2,"close"),l()()}}function Vv(o,t){if(o&1&&(s(0,"div",6)(1,"mat-icon",7),p(2,"person"),l(),s(3,"span",8),p(4),l(),C(5,Lv,3,0,"button",9),l()),o&2){let e=t.$implicit,i=u();d(4),O(e.userId),d(),x(i.users.length>1?5:-1)}}var pa=class o{threadId;users=[];currentUsername;userAdded=new H;userRemoved=new H;isAdding=Oe(!1);errorMessage=Oe("");get excludedUserIds(){return[this.currentUsername,...this.users.map(t=>t.userId)]}setAdding(t){this.isAdding.set(t)}setError(t){this.errorMessage.set(t),this.isAdding.set(!1)}onUserSelected(t){this.errorMessage.set(""),this.userAdded.emit(t)}removeUser(t){this.userRemoved.emit(t)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-thread-share"]],inputs:{threadId:"threadId",users:"users",currentUsername:"currentUsername"},outputs:{userAdded:"userAdded",userRemoved:"userRemoved"},decls:12,vars:3,consts:[[1,"thread-share"],[1,"share-header"],[1,"add-user-section"],[3,"userSelected","excludedUserIds","disabled"],[1,"error-message"],[1,"users-list"],[1,"user-item"],[1,"user-icon"],[1,"user-name"],["mat-icon-button","","title","Remove user",1,"remove-button"],["mat-icon-button","","title","Remove user",1,"remove-button",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"mat-icon"),p(3,"group"),l(),s(4,"span"),p(5,"Participants"),l()(),s(6,"div",2)(7,"app-user-autocomplete",3),f("userSelected",function(r){return i.onUserSelected(r)}),l()(),C(8,Nv,2,1,"div",4),s(9,"div",5),we(10,Vv,6,2,"div",6,Fv),l()()),e&2&&(d(7),w("excludedUserIds",i.excludedUserIds)("disabled",i.isAdding()),d(),x(i.errorMessage()?8:-1),d(2),Se(i.users))},dependencies:[Me,he,ot,Ke,ma,hl],styles:[".thread-share[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:.75rem}.share-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-weight:600;font-size:.9rem;color:var(--color-text)}.share-header[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-text-secondary)}.add-user-section[_ngcontent-%COMP%]{display:flex;align-items:center;width:50%}.error-message[_ngcontent-%COMP%]{color:var(--color-error);font-size:.75rem;margin-top:-.5rem}.users-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.user-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;border-radius:6px;transition:background .15s ease}.user-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-text-secondary);flex-shrink:0}.user-name[_ngcontent-%COMP%]{flex:1;font-size:.875rem;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.remove-button[_ngcontent-%COMP%]{flex-shrink:0;width:28px!important;height:28px!important;padding:0!important}.remove-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;color:var(--color-text-secondary)}.remove-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-error, #ef4444)}"]})};var gl=["*"],zv=["content"],jv=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],Bv=["mat-drawer","mat-drawer-content","*"];function Hv(o,t){if(o&1){let e=k();s(0,"div",1),f("click",function(){b(e);let n=u();return v(n._onBackdropClicked())}),l()}if(o&2){let e=u();E("mat-drawer-shown",e._isShowingBackdrop())}}function Uv(o,t){o&1&&(s(0,"mat-drawer-content"),ue(1,2),l())}var Wv=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],$v=["mat-sidenav","mat-sidenav-content","*"];function qv(o,t){if(o&1){let e=k();s(0,"div",1),f("click",function(){b(e);let n=u();return v(n._onBackdropClicked())}),l()}if(o&2){let e=u();E("mat-drawer-shown",e._isShowingBackdrop())}}function Gv(o,t){o&1&&(s(0,"mat-sidenav-content"),ue(1,2),l())}var Yv=`.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-sys-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-sys-background));box-sizing:border-box;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color, color-mix(in srgb, var(--mat-sys-neutral-variant20) 40%, transparent))}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}@media(forced-colors: active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-content.mat-drawer-content-hidden{opacity:0}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-sys-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow, none);background-color:var(--mat-sidenav-container-background-color, var(--mat-sys-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));width:var(--mat-sidenav-container-width, 360px);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}@media(forced-colors: active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media(forced-colors: active){[dir=rtl] .mat-drawer,.mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-transition .mat-drawer{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating){visibility:hidden;box-shadow:none}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating) .mat-drawer-inner-container{display:none}.mat-drawer.mat-drawer-opened.mat-drawer-opened{transform:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto}.mat-sidenav-fixed{position:fixed}
362
+ `:"")+c}},{paragraphs:0,text:""}).text||t}renderStreamingText(){return te(this,null,function*(){if(!this.streamingText){this.renderedStreamingText="";return}try{let t=yield this.markdownService.parse(this.streamingText);this.renderedStreamingText=this.sanitizer.bypassSecurityTrustHtml(t)}catch(t){console.error("[CHAT-HISTORY] Error rendering streaming text markdown:",t),this.renderedStreamingText=this.sanitizer.bypassSecurityTrustHtml(this.streamingText)}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-chat-history"]],hostBindings:function(e,i){e&1&&f("scroll",function(){return i.onScroll()})},inputs:{messages:"messages",streamingText:"streamingText",isThinking:"isThinking",currentUsername:"currentUsername"},outputs:{copyRequested:"copyRequested",stopRequested:"stopRequested"},features:[nt],decls:6,vars:3,consts:[[1,"chat-history"],[1,"streaming-message","message","assistant"],["mat-fab","","color","primary","title","Go to bottom",1,"go-to-bottom-btn"],[3,"subThreadId","agentName"],[3,"message","canDelete","isOtherUser"],[3,"copyRequested","deleteRequested","message","canDelete","isOtherUser"],[1,"content","markdown-content",3,"innerHTML"],["mat-fab","","color","primary","title","Go to bottom",1,"go-to-bottom-btn",3,"click"],["fontSet","material-icons-outlined"]],template:function(e,i){e&1&&(s(0,"div",0),we(1,v0,2,1,null,null,f0),C(3,y0,2,1,"div",1),C(4,C0,1,0,"app-thinking-loader"),C(5,x0,3,0,"button",2),l()),e&2&&(d(),Se(i.messages),d(2),x(i.streamingText?3:-1),d(),x(i.isThinking?4:-1),d(),x(i.showGoToBottom?5:-1))},dependencies:[sr,he,el,Xa,Js],styles:[".streaming-message.assistant[_ngcontent-%COMP%]{background:transparent;border:none;box-shadow:none;border-radius:0;margin-left:0;margin-right:auto;padding:.5rem 0;width:100%;max-width:none;min-width:0}.streaming-message[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{color:var(--color-text);line-height:1.5}.go-to-bottom-btn[_ngcontent-%COMP%]{position:fixed!important;bottom:30%!important;right:1rem!important;z-index:1000!important}@media (max-width: 768px){.go-to-bottom-btn[_ngcontent-%COMP%]{width:40px!important;height:40px!important;right:.75rem!important}.go-to-bottom-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;max-height:none!important;overflow:visible!important;position:static!important}.chat-history[_ngcontent-%COMP%]{display:block!important;height:auto!important;max-height:none!important;overflow:visible!important;position:static!important}.go-to-bottom-btn[_ngcontent-%COMP%]{display:none!important}}"]})};var Hn=class o{eventStream=m(Yi);messageApi=m(or);pendingStates=new Map;popupCheckInterval=null;pendingRequest$=new ae(null);messageHandler=t=>this.handlePopupMessage(t);constructor(){this.eventStream.events$.pipe(me(t=>t.type==="oauth_request")).subscribe(t=>this.handleOAuthRequest(t)),window.addEventListener("message",this.messageHandler)}ngOnDestroy(){window.removeEventListener("message",this.messageHandler),this.pendingRequest$.complete(),this.popupCheckInterval&&clearInterval(this.popupCheckInterval)}startPopupMonitoring(t,e){this.popupCheckInterval&&clearInterval(this.popupCheckInterval),this.popupCheckInterval=setInterval(()=>{if(t.closed&&(console.log("[OAuth Service] Popup closed by user"),clearInterval(this.popupCheckInterval),this.popupCheckInterval=null,this.pendingStates.has(e))){console.warn("[OAuth Service] OAuth cancelled - popup closed without completing authentication");let i=this.pendingStates.get(e);if(this.pendingStates.delete(e),i){let n=new Ei({state:e,integrationName:i,error:"user_cancelled",errorDescription:"User closed the popup without completing authentication"});this.messageApi.sendMessage(n).subscribe({next:()=>console.log("[OAuth Service] Cancellation sent to backend"),error:r=>console.error("[OAuth Service] Failed to send cancellation:",r)})}}},500)}openPopup(t){console.log("[OAuth Service] Opening popup from user gesture:",t.integrationName);let e=600,i=900,n=window.screenX+(window.outerWidth-e)/2,r=window.screenY+(window.outerHeight-i)/2,a=`width=${e},height=${i},left=${n},top=${r},popup=yes,resizable=yes,scrollbars=yes`,c=window.open(t.authUrl,"oauth_popup",a);console.log("[OAuth Service] Popup opened:",!!c),c?(c.focus(),this.startPopupMonitoring(c,t.state),this.pendingRequest$.next(null)):console.warn("[OAuth Service] Popup was blocked by the browser")}cancelRequest(t){console.log("[OAuth Service] OAuth cancelled by user via inline panel"),this.pendingStates.delete(t.state),this.pendingRequest$.next(null);let e=new Ei({state:t.state,integrationName:t.integrationName,error:"user_cancelled",errorDescription:"User dismissed the authorization panel"});this.messageApi.sendMessage(e).subscribe({next:()=>console.log("[OAuth Service] Cancellation sent to backend"),error:i=>console.error("[OAuth Service] Failed to send cancellation:",i)})}handleOAuthRequest(t){console.log("[OAuth Service] Received OAuthRequestEvent:",t.integrationName,t.state),this.pendingStates.set(t.state,t.integrationName),console.log("[OAuth Service] Pending states:",Array.from(this.pendingStates.keys())),this.pendingRequest$.next(t)}handlePopupMessage(t){if(console.log("[OAuth Service] Received postMessage:",t.origin,t.data),t.origin!==window.location.origin){console.warn("[OAuth Service] Rejected message from different origin:",t.origin);return}let{code:e,state:i,error:n,errorDescription:r}=t.data??{};if(n){console.log("[OAuth Service] OAuth error received:",n,r);let h=this.pendingStates.get(i);if(h){this.pendingStates.delete(i),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let g=new Ei({state:i,integrationName:h,error:n,errorDescription:r});this.messageApi.sendMessage(g).subscribe({next:()=>console.log("[OAuth Service] Error callback sent to backend"),error:y=>console.error("[OAuth Service] Failed to send error callback:",y)})}return}if(!e||!i){console.warn("[OAuth Service] Message missing code or state:",t.data);return}console.log("[OAuth Service] Processing callback - code:",e,"state:",i);let a=this.pendingStates.get(i);if(!a){console.warn("[OAuth Service] Unknown state received:",i,"Pending states:",Array.from(this.pendingStates.keys()));return}console.log("[OAuth Service] Found integration:",a),this.pendingStates.delete(i),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let c=new Ei({code:e,state:i,integrationName:a});console.log("[OAuth Service] Sending callback to backend..."),this.messageApi.sendMessage(c).subscribe({next:()=>console.log("[OAuth Service] Callback sent to backend successfully"),error:h=>console.error("[OAuth Service] Failed to send callback:",h)})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};function w0(o,t){if(o&1){let e=k();s(0,"div",0)(1,"div",1)(2,"mat-icon"),p(3,"lock_open"),l()(),s(4,"div",2)(5,"p",3),p(6,"Authorization required"),l(),s(7,"p",4)(8,"strong"),p(9),l(),p(10," needs your permission to continue. "),l()(),s(11,"div",5)(12,"button",6),f("click",function(){let n=b(e),r=u();return v(r.onCancel(n))}),p(13,"Cancel"),l(),s(14,"button",7),f("click",function(){let n=b(e),r=u();return v(r.onAuthorize(n))}),s(15,"mat-icon"),p(16,"open_in_new"),l(),p(17," Authorize "),l()()()}o&2&&(d(9),O(t.integrationName))}var il=class o{oauthService=m(Hn);pendingRequest=rt(this.oauthService.pendingRequest$,{initialValue:null});onAuthorize(t){this.oauthService.openPopup(t)}onCancel(t){this.oauthService.cancelRequest(t)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-oauth-request-panel"]],decls:1,vars:1,consts:[[1,"oauth-panel"],[1,"oauth-icon"],[1,"oauth-content"],[1,"oauth-title"],[1,"oauth-description"],[1,"oauth-actions"],["type","button",1,"oauth-btn","oauth-btn--cancel",3,"click"],["type","button",1,"oauth-btn","oauth-btn--authorize",3,"click"]],template:function(e,i){if(e&1&&C(0,w0,18,1,"div",0),e&2){let n;x((n=i.pendingRequest())?0:-1,n)}},dependencies:[Me,he],styles:[".oauth-panel[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:1rem;border:1px solid var(--color-border);border-radius:12px;background:var(--color-background);width:100%}@media (max-width: 480px){.oauth-panel[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}}.oauth-icon[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border-radius:50%;background:var(--color-primary);color:#fff}.oauth-icon[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.oauth-content[_ngcontent-%COMP%]{flex:1;min-width:0}.oauth-title[_ngcontent-%COMP%]{margin:0 0 .25rem;font-weight:600;font-size:.95rem;color:var(--color-text)}.oauth-description[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary)}.oauth-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-shrink:0}.oauth-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;padding:.5rem 1rem;border-radius:8px;border:1px solid var(--color-border);font-size:.9rem;font-family:inherit;cursor:pointer;transition:all .2s ease}.oauth-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem}.oauth-btn--cancel[_ngcontent-%COMP%]{background:var(--color-background);color:var(--color-text-secondary)}.oauth-btn--cancel[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);color:var(--color-text)}.oauth-btn--authorize[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff;border-color:var(--color-primary)}.oauth-btn--authorize[_ngcontent-%COMP%]:hover{opacity:.9}"],changeDetection:0})};var nl=class o{http=m(Xe);projectState=m(ke);threadState=m(At);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/files`}uploadFile(t){let e=this.projectState.getSelectedProjectIdOrThrow(),i=this.threadState.getSelectedThreadIdOrThrow();return new Ii(n=>{let r=new FileReader;r.onload=()=>{let c=r.result.split(",")[1];this.http.post(`/api/projects/${e}/threads/${i}/upload`,{content:c,mimeType:t.type||"application/octet-stream",filename:t.name}).subscribe({next:h=>{n.next({success:h.success,filename:h.filename}),n.complete()},error:h=>n.error(h)})},r.onerror=()=>n.error(new Error("Failed to read file")),r.readAsDataURL(t)})}listFiles(){return this.http.get(this.getBaseUrl()).pipe(ve(t=>t.files))}downloadFile(t){let e=encodeURIComponent(t);return this.http.get(`${this.getBaseUrl()}/${e}`,{responseType:"blob"})}deleteFile(t){let e=encodeURIComponent(t);return this.http.delete(`${this.getBaseUrl()}/${e}`)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var pr=class o{fileApi=m(nl);eventStream=m(Yi);filesSignal=Oe([]);isLoadingSignal=Oe(!1);currentProjectSignal=Oe(null);currentThreadSignal=Oe(null);files=ui(()=>this.filesSignal());isLoading=ui(()=>this.isLoadingSignal());fileCount=ui(()=>this.filesSignal().length);constructor(){this.subscribeToFileEvents()}initializeForThread(t,e){this.currentProjectSignal.set(t),this.currentThreadSignal.set(e),this.refreshFileList()}clear(){this.filesSignal.set([]),this.currentProjectSignal.set(null),this.currentThreadSignal.set(null)}refreshFileList(){this.isLoadingSignal.set(!0),this.fileApi.listFiles().subscribe({next:t=>{let e=t.map(i=>ut(Z({},i),{lastModified:new Date(i.lastModified)})).sort((i,n)=>n.lastModified.getTime()-i.lastModified.getTime());this.filesSignal.set(e),this.isLoadingSignal.set(!1)},error:t=>{console.error("[FILE_EXCHANGE_STATE] Error loading files:",t),this.isLoadingSignal.set(!1)}})}uploadFile(t){return te(this,null,function*(){return new Promise(e=>{this.fileApi.uploadFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:i=>{console.error("[FILE_EXCHANGE_STATE] Upload error:",i),e({success:!1,error:i.message||"Upload failed"})}})})})}downloadAllFiles(){let t=this.filesSignal();if(t.length===0){console.warn("[FILE_EXCHANGE_STATE] No files to download");return}t.forEach((e,i)=>{setTimeout(()=>{this.downloadFile(e.filename)},i*300)})}downloadFile(t){this.fileApi.downloadFile(t).subscribe({next:e=>{let i=window.URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download=t,n.click(),window.URL.revokeObjectURL(i)},error:e=>{console.error("[FILE_EXCHANGE_STATE] Download error:",e)}})}deleteFile(t){return te(this,null,function*(){return new Promise(e=>{this.fileApi.deleteFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:i=>{console.error("[FILE_EXCHANGE_STATE] Delete error:",i),e({success:!1,error:i.message||"Delete failed"})}})})})}subscribeToFileEvents(){this.eventStream.events$.pipe(me(t=>t instanceof Bn),rn()).subscribe(t=>{this.handleFileEvent(t)})}handleFileEvent(t){let e=this.filesSignal();switch(t.operation){case"created":{let i=t.timestamp,n=t.timestamp.lastIndexOf("-");if(n>0){let a=t.timestamp.substring(n+1);a.length===5&&/^[a-z0-9]+$/.test(a)&&(i=t.timestamp.substring(0,n))}let r={filename:t.filename,size:t.size||0,lastModified:new Date(i)};this.filesSignal.set([r,...e]);break}case"updated":{let i=e.filter(h=>h.filename!==t.filename),n=e.find(h=>h.filename===t.filename),r=t.timestamp,a=t.timestamp.lastIndexOf("-");if(a>0){let h=t.timestamp.substring(a+1);h.length===5&&/^[a-z0-9]+$/.test(h)&&(r=t.timestamp.substring(0,a))}let c={filename:t.filename,size:t.size||n?.size||0,lastModified:new Date(r)};this.filesSignal.set([c,...i]);break}case"deleted":{let i=e.filter(n=>n.filename!==t.filename);this.filesSignal.set(i);break}}}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};function S0(o,t){if(o&1&&I(0,"div",1),o&2){let e=u();w("innerHTML",e.renderedContent,Zt)}}function k0(o,t){if(o&1&&I(0,"iframe",2),o&2){let e=u();w("srcdoc",e.content,Zt)}}function M0(o,t){if(o&1&&(s(0,"pre",3),p(1),l()),o&2){let e=u();d(),O(e.content)}}var ol=class o{content="";format="text";renderedContent="";sanitizer=m(Ri);markdownService=m($i);ngOnChanges(t){(t.content||t.format)&&this.renderContent()}renderContent(){this.format==="markdown"?this.renderMarkdown():this.format==="json"&&this.formatJson()}renderMarkdown(){return te(this,null,function*(){try{let t=yield this.markdownService.parse(this.content);this.renderedContent=this.sanitizer.bypassSecurityTrustHtml(t)}catch(t){console.error("[CONTENT_RENDERER] Error rendering markdown:",t),this.content=this.content}})}formatJson(){try{let t=JSON.parse(this.content);this.content=JSON.stringify(t,null,2)}catch(t){console.error("[CONTENT_RENDERER] Error formatting JSON:",t)}}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-content-renderer"]],inputs:{content:"content",format:"format"},features:[nt],decls:4,vars:2,consts:[[1,"content-renderer",3,"ngClass"],[1,"markdown-content",3,"innerHTML"],["sandbox","allow-same-origin",1,"html-viewer",3,"srcdoc"],[1,"code-content"]],template:function(e,i){e&1&&(s(0,"div",0),C(1,S0,1,1,"div",1)(2,k0,1,1,"iframe",2)(3,M0,2,1,"pre",3),l()),e&2&&(w("ngClass","format-"+i.format),d(),x(i.format==="markdown"?1:i.format==="html"?2:3))},dependencies:[Fe,On],styles:[".content-renderer[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;padding:1rem}.markdown-content[_ngcontent-%COMP%]{line-height:1.6;color:var(--color-text)}.code-content[_ngcontent-%COMP%]{font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:.9rem;line-height:1.5;margin:0;white-space:pre-wrap;word-wrap:break-word;color:var(--color-text)}.format-json[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%]{color:var(--color-code-text, #d63384)}.format-yaml[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%], .format-text[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%]{color:var(--color-text)}.html-viewer[_ngcontent-%COMP%]{width:100%;height:100%;min-height:400px;border:1px solid var(--color-border);border-radius:8px;background:#fff}"]})};var hr=class o{http=m(Xe);MAX_FILE_SIZE=20*1024*1024;isViewable(t){return t<=this.MAX_FILE_SIZE}isFormatViewable(t){let e=t.split(".").pop()?.toLowerCase();return!(e&&["pdf","png","jpg","jpeg","gif","webp","zip","tar","gz","exe","bin","doc","docx","xls","xlsx","ppt","pptx"].includes(e))}detectFormat(t){switch(t.split(".").pop()?.toLowerCase()){case"md":return"markdown";case"json":return"json";case"yaml":case"yml":return"yaml";case"html":case"htm":return"html";default:return"text"}}loadFileContent(t,e,i){let n=`/api/projects/${t}/threads/${e}/files/${encodeURIComponent(i)}`,r=this.detectFormat(i);return this.http.get(n,{responseType:"text",observe:"response"}).pipe(ve(a=>{let c=a.body||"",h=new Blob([c]).size;return{content:c,format:r,filename:i,size:h}}),kn(a=>(console.error("[CONTENT_VIEWER] Error loading file:",i,a),Oo(()=>new Error(`Failed to load file: ${a.message||"Unknown error"}`)))))}formatSize(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};function T0(o,t){if(o&1){let e=k();s(0,"button",12),f("click",function(){b(e);let n=u();return v(n.download())}),s(1,"mat-icon"),p(2,"download"),l()()}}function E0(o,t){o&1&&(s(0,"div",9),I(1,"mat-spinner",13),s(2,"p"),p(3,"Loading file content..."),l()())}function P0(o,t){if(o&1){let e=k();s(0,"div",10)(1,"mat-icon",14),p(2,"error_outline"),l(),s(3,"p",15),p(4),l(),s(5,"button",16),f("click",function(){b(e);let n=u();return v(n.download())}),s(6,"mat-icon"),p(7,"download"),l(),p(8," Download instead "),l()()}if(o&2){let e=u();d(4),O(e.error)}}function O0(o,t){if(o&1&&I(0,"app-content-renderer",11),o&2){let e=u();w("content",e.fileContent.content)("format",e.fileContent.format)}}var rl=class o{destroy$=new R;file;projectName;threadId;closeViewer=new H;contentService=m(hr);eventStream=m(Yi);fileContent=null;isLoading=!1;error="";ngOnInit(){this.loadContent(),this.subscribeToFileEvents()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}loadContent(){if(!this.contentService.isViewable(this.file.size)){this.error=`File too large to view (${this.contentService.formatSize(this.file.size)}). Maximum size: 20 MB.`;return}this.isLoading=!0,this.error="",this.contentService.loadFileContent(this.projectName,this.threadId,this.file.filename).subscribe({next:t=>{console.log("[CONTENT_VIEWER] Content loaded:",t.filename),this.fileContent=t,this.isLoading=!1},error:t=>{console.error("[CONTENT_VIEWER] Error loading content:",t),this.error=t.message||"Failed to load file content",this.isLoading=!1}})}onClose(){this.closeViewer.emit()}download(){let t=new Blob([this.fileContent?.content||""],{type:"text/plain"}),e=window.URL.createObjectURL(t),i=document.createElement("a");i.href=e,i.download=this.file.filename,i.click(),window.URL.revokeObjectURL(e)}formatSize(t){return this.contentService.formatSize(t)}subscribeToFileEvents(){this.eventStream.events$.pipe(me(t=>t instanceof Bn),me(t=>t.filename===this.file.filename),me(t=>t.operation==="updated"),N(this.destroy$)).subscribe(t=>{console.log("[CONTENT_VIEWER] File updated event received, reloading:",t.filename),t.size&&(this.file.size=t.size),this.loadContent()})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-content-viewer"]],inputs:{file:"file",projectName:"projectName",threadId:"threadId"},outputs:{closeViewer:"closeViewer"},decls:16,vars:6,consts:[[1,"viewer-container"],[1,"viewer-header"],[1,"header-info"],[1,"filename"],[1,"file-size"],[1,"header-actions"],["mat-icon-button","","title","Download","type","button"],["mat-icon-button","","title","Close","type","button",3,"click"],[1,"viewer-content"],[1,"loading-state"],[1,"error-state"],[3,"content","format"],["mat-icon-button","","title","Download","type","button",3,"click"],["diameter","48"],[1,"error-icon"],[1,"error-message"],["mat-raised-button","","color","primary","type","button",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),p(4),l(),s(5,"span",4),p(6),l()(),s(7,"div",5),C(8,T0,3,0,"button",6),s(9,"button",7),f("click",function(){return i.onClose()}),s(10,"mat-icon"),p(11,"chevron_right"),l()()()(),s(12,"div",8),C(13,E0,4,0,"div",9),C(14,P0,9,1,"div",10),C(15,O0,1,2,"app-content-renderer",11),l()()),e&2&&(d(4),O(i.file.filename),d(2),O(i.formatSize(i.file.size)),d(2),x(i.fileContent&&!i.isLoading&&!i.error?8:-1),d(5),x(i.isLoading?13:-1),d(),x(i.error?14:-1),d(),x(i.fileContent&&!i.isLoading&&!i.error?15:-1))},dependencies:[Fe,Me,he,ot,Ot,Ke,cr,lr,ol],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;height:100%}.viewer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;height:100%;background:var(--color-bg)}.viewer-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:1rem;border-bottom:1px solid var(--color-border);background:var(--color-bg);flex-shrink:0}.header-info[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}.filename[_ngcontent-%COMP%]{font-weight:500;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-size[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary)}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-shrink:0}.viewer-content[_ngcontent-%COMP%]{flex:1;overflow:auto;background:var(--color-bg)}.loading-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:1rem;color:var(--color-text-secondary)}.error-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:1rem;padding:2rem;text-align:center}.error-icon[_ngcontent-%COMP%]{font-size:3rem;width:3rem;height:3rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{color:var(--color-text);margin:0;max-width:400px}"]})};var A0=Math.pow(10,8)*24*60*60*1e3,RD=-A0,al=6048e5,iu=864e5;var I0=3600;var nu=I0*24,FD=nu*7,D0=nu*365.2425,R0=D0/12,ND=R0*3,_d=Symbol.for("constructDateFrom");function mt(o,t){return typeof o=="function"?o(t):o&&typeof o=="object"&&_d in o?o[_d](t):o instanceof Date?new o.constructor(t):new Date(t)}function Ze(o,t){return mt(t||o,o)}function ou(o,t,e){let i=Ze(o,e?.in);return isNaN(t)?mt(e?.in||o,NaN):(t&&i.setDate(i.getDate()+t),i)}var F0={};function Un(){return F0}function yn(o,t){let e=Un(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,n=Ze(o,t?.in),r=n.getDay(),a=(r<i?7:0)+r-i;return n.setDate(n.getDate()-a),n.setHours(0,0,0,0),n}function fo(o,t){return yn(o,ut(Z({},t),{weekStartsOn:1}))}function sl(o,t){let e=Ze(o,t?.in),i=e.getFullYear(),n=mt(e,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);let r=fo(n),a=mt(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);let c=fo(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=c.getTime()?i:i-1}function bd(o){let t=Ze(o),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+o-+e}function ur(o,...t){let e=mt.bind(null,o||t.find(i=>typeof i=="object"));return t.map(e)}function gr(o,t){let e=Ze(o,t?.in);return e.setHours(0,0,0,0),e}function ll(o,t,e){let[i,n]=ur(e?.in,o,t),r=gr(i),a=gr(n),c=+r-bd(r),h=+a-bd(a);return Math.round((c-h)/iu)}function ru(o,t){let e=sl(o,t),i=mt(t?.in||o,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),fo(i)}function au(o){return mt(o,Date.now())}function su(o,t,e){let[i,n]=ur(e?.in,o,t);return+gr(i)==+gr(n)}function lu(o){return o instanceof Date||typeof o=="object"&&Object.prototype.toString.call(o)==="[object Date]"}function cu(o){return!(!lu(o)&&typeof o!="number"||isNaN(+Ze(o)))}function mu(o,t,e){let[i,n]=ur(e?.in,o,t),r=du(i,n),a=Math.abs(ll(i,n));i.setDate(i.getDate()-r*a);let c=+(du(i,n)===-r),h=r*(a-c);return h===0?0:h}function du(o,t){let e=o.getFullYear()-t.getFullYear()||o.getMonth()-t.getMonth()||o.getDate()-t.getDate()||o.getHours()-t.getHours()||o.getMinutes()-t.getMinutes()||o.getSeconds()-t.getSeconds()||o.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function pu(o,t){let e=Ze(o,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}var N0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},hu=(o,t,e)=>{let i,n=N0[o];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function cl(o){return(t={})=>{let e=t.width?String(t.width):o.defaultWidth;return o.formats[e]||o.formats[o.defaultWidth]}}var L0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},V0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},z0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},uu={date:cl({formats:L0,defaultWidth:"full"}),time:cl({formats:V0,defaultWidth:"full"}),dateTime:cl({formats:z0,defaultWidth:"full"})};var j0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},gu=(o,t,e,i)=>j0[o];function fr(o){return(t,e)=>{let i=e?.context?String(e.context):"standalone",n;if(i==="formatting"&&o.formattingValues){let a=o.defaultFormattingWidth||o.defaultWidth,c=e?.width?String(e.width):a;n=o.formattingValues[c]||o.formattingValues[a]}else{let a=o.defaultWidth,c=e?.width?String(e.width):o.defaultWidth;n=o.values[c]||o.values[a]}let r=o.argumentCallback?o.argumentCallback(t):t;return n[r]}}var B0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},H0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},U0={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},W0={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},$0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},q0={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},G0=(o,t)=>{let e=Number(o),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},fu={ordinalNumber:G0,era:fr({values:B0,defaultWidth:"wide"}),quarter:fr({values:H0,defaultWidth:"wide",argumentCallback:o=>o-1}),month:fr({values:U0,defaultWidth:"wide"}),day:fr({values:W0,defaultWidth:"wide"}),dayPeriod:fr({values:$0,defaultWidth:"wide",formattingValues:q0,defaultFormattingWidth:"wide"})};function _r(o){return(t,e={})=>{let i=e.width,n=i&&o.matchPatterns[i]||o.matchPatterns[o.defaultMatchWidth],r=t.match(n);if(!r)return null;let a=r[0],c=i&&o.parsePatterns[i]||o.parsePatterns[o.defaultParseWidth],h=Array.isArray(c)?Q0(c,S=>S.test(a)):Y0(c,S=>S.test(a)),g;g=o.valueCallback?o.valueCallback(h):h,g=e.valueCallback?e.valueCallback(g):g;let y=t.slice(a.length);return{value:g,rest:y}}}function Y0(o,t){for(let e in o)if(Object.prototype.hasOwnProperty.call(o,e)&&t(o[e]))return e}function Q0(o,t){for(let e=0;e<o.length;e++)if(t(o[e]))return e}function _u(o){return(t,e={})=>{let i=t.match(o.matchPattern);if(!i)return null;let n=i[0],r=t.match(o.parsePattern);if(!r)return null;let a=o.valueCallback?o.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;let c=t.slice(n.length);return{value:a,rest:c}}}var X0=/^(\d+)(th|st|nd|rd)?/i,K0=/\d+/i,Z0={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},J0={any:[/^b/i,/^(a|c)/i]},ev={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},tv={any:[/1/i,/2/i,/3/i,/4/i]},iv={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},nv={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ov={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},rv={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},av={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},sv={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},bu={ordinalNumber:_u({matchPattern:X0,parsePattern:K0,valueCallback:o=>parseInt(o,10)}),era:_r({matchPatterns:Z0,defaultMatchWidth:"wide",parsePatterns:J0,defaultParseWidth:"any"}),quarter:_r({matchPatterns:ev,defaultMatchWidth:"wide",parsePatterns:tv,defaultParseWidth:"any",valueCallback:o=>o+1}),month:_r({matchPatterns:iv,defaultMatchWidth:"wide",parsePatterns:nv,defaultParseWidth:"any"}),day:_r({matchPatterns:ov,defaultMatchWidth:"wide",parsePatterns:rv,defaultParseWidth:"any"}),dayPeriod:_r({matchPatterns:av,defaultMatchWidth:"any",parsePatterns:sv,defaultParseWidth:"any"})};var vd={code:"en-US",formatDistance:hu,formatLong:uu,formatRelative:gu,localize:fu,match:bu,options:{weekStartsOn:0,firstWeekContainsDate:1}};function vu(o,t){let e=Ze(o,t?.in);return ll(e,pu(e))+1}function yu(o,t){let e=Ze(o,t?.in),i=+fo(e)-+ru(e);return Math.round(i/al)+1}function dl(o,t){let e=Ze(o,t?.in),i=e.getFullYear(),n=Un(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=mt(t?.in||o,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);let c=yn(a,t),h=mt(t?.in||o,0);h.setFullYear(i,0,r),h.setHours(0,0,0,0);let g=yn(h,t);return+e>=+c?i+1:+e>=+g?i:i-1}function Cu(o,t){let e=Un(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,n=dl(o,t),r=mt(t?.in||o,0);return r.setFullYear(n,0,i),r.setHours(0,0,0,0),yn(r,t)}function xu(o,t){let e=Ze(o,t?.in),i=+yn(e,t)-+Cu(e,t);return Math.round(i/al)+1}function Pe(o,t){let e=o<0?"-":"",i=Math.abs(o).toString().padStart(t,"0");return e+i}var Cn={y(o,t){let e=o.getFullYear(),i=e>0?e:1-e;return Pe(t==="yy"?i%100:i,t.length)},M(o,t){let e=o.getMonth();return t==="M"?String(e+1):Pe(e+1,2)},d(o,t){return Pe(o.getDate(),t.length)},a(o,t){let e=o.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(o,t){return Pe(o.getHours()%12||12,t.length)},H(o,t){return Pe(o.getHours(),t.length)},m(o,t){return Pe(o.getMinutes(),t.length)},s(o,t){return Pe(o.getSeconds(),t.length)},S(o,t){let e=t.length,i=o.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return Pe(n,t.length)}};var br={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},yd={G:function(o,t,e){let i=o.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(o,t,e){if(t==="yo"){let i=o.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return Cn.y(o,t)},Y:function(o,t,e,i){let n=dl(o,i),r=n>0?n:1-n;if(t==="YY"){let a=r%100;return Pe(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Pe(r,t.length)},R:function(o,t){let e=sl(o);return Pe(e,t.length)},u:function(o,t){let e=o.getFullYear();return Pe(e,t.length)},Q:function(o,t,e){let i=Math.ceil((o.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Pe(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(o,t,e){let i=Math.ceil((o.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Pe(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(o,t,e){let i=o.getMonth();switch(t){case"M":case"MM":return Cn.M(o,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(o,t,e){let i=o.getMonth();switch(t){case"L":return String(i+1);case"LL":return Pe(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(o,t,e,i){let n=xu(o,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):Pe(n,t.length)},I:function(o,t,e){let i=yu(o);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Pe(i,t.length)},d:function(o,t,e){return t==="do"?e.ordinalNumber(o.getDate(),{unit:"date"}):Cn.d(o,t)},D:function(o,t,e){let i=vu(o);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Pe(i,t.length)},E:function(o,t,e){let i=o.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(o,t,e,i){let n=o.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Pe(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(n,{width:"short",context:"formatting"});case"eeee":default:return e.day(n,{width:"wide",context:"formatting"})}},c:function(o,t,e,i){let n=o.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Pe(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(o,t,e){let i=o.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return Pe(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(o,t,e){let n=o.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(o,t,e){let i=o.getHours(),n;switch(i===12?n=br.noon:i===0?n=br.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(o,t,e){let i=o.getHours(),n;switch(i>=17?n=br.evening:i>=12?n=br.afternoon:i>=4?n=br.morning:n=br.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(o,t,e){if(t==="ho"){let i=o.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Cn.h(o,t)},H:function(o,t,e){return t==="Ho"?e.ordinalNumber(o.getHours(),{unit:"hour"}):Cn.H(o,t)},K:function(o,t,e){let i=o.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Pe(i,t.length)},k:function(o,t,e){let i=o.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Pe(i,t.length)},m:function(o,t,e){return t==="mo"?e.ordinalNumber(o.getMinutes(),{unit:"minute"}):Cn.m(o,t)},s:function(o,t,e){return t==="so"?e.ordinalNumber(o.getSeconds(),{unit:"second"}):Cn.s(o,t)},S:function(o,t){return Cn.S(o,t)},X:function(o,t,e){let i=o.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Su(i);case"XXXX":case"XX":return _o(i);case"XXXXX":case"XXX":default:return _o(i,":")}},x:function(o,t,e){let i=o.getTimezoneOffset();switch(t){case"x":return Su(i);case"xxxx":case"xx":return _o(i);case"xxxxx":case"xxx":default:return _o(i,":")}},O:function(o,t,e){let i=o.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+wu(i,":");case"OOOO":default:return"GMT"+_o(i,":")}},z:function(o,t,e){let i=o.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+wu(i,":");case"zzzz":default:return"GMT"+_o(i,":")}},t:function(o,t,e){let i=Math.trunc(+o/1e3);return Pe(i,t.length)},T:function(o,t,e){return Pe(+o,t.length)}};function wu(o,t=""){let e=o>0?"-":"+",i=Math.abs(o),n=Math.trunc(i/60),r=i%60;return r===0?e+String(n):e+String(n)+t+Pe(r,2)}function Su(o,t){return o%60===0?(o>0?"-":"+")+Pe(Math.abs(o)/60,2):_o(o,t)}function _o(o,t=""){let e=o>0?"-":"+",i=Math.abs(o),n=Pe(Math.trunc(i/60),2),r=Pe(i%60,2);return e+n+t+r}var ku=(o,t)=>{switch(o){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Mu=(o,t)=>{switch(o){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},lv=(o,t)=>{let e=o.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return ku(o,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",ku(i,t)).replace("{{time}}",Mu(n,t))},Tu={p:Mu,P:lv};var cv=/^D+$/,dv=/^Y+$/,mv=["D","DD","YY","YYYY"];function Eu(o){return cv.test(o)}function Pu(o){return dv.test(o)}function Ou(o,t,e){let i=pv(o,t,e);if(console.warn(i),mv.includes(o))throw new RangeError(i)}function pv(o,t,e){let i=o[0]==="Y"?"years":"days of the month";return`Use \`${o.toLowerCase()}\` instead of \`${o}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var hv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,gv=/^'([^]*?)'?$/,fv=/''/g,_v=/[a-zA-Z]/;function Cd(o,t,e){let i=Un(),n=e?.locale??i.locale??vd,r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,c=Ze(o,e?.in);if(!cu(c))throw new RangeError("Invalid time value");let h=t.match(uv).map(y=>{let S=y[0];if(S==="p"||S==="P"){let A=Tu[S];return A(y,n.formatLong)}return y}).join("").match(hv).map(y=>{if(y==="''")return{isToken:!1,value:"'"};let S=y[0];if(S==="'")return{isToken:!1,value:bv(y)};if(yd[S])return{isToken:!0,value:y};if(S.match(_v))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:y}});n.localize.preprocessor&&(h=n.localize.preprocessor(c,h));let g={firstWeekContainsDate:r,weekStartsOn:a,locale:n};return h.map(y=>{if(!y.isToken)return y.value;let S=y.value;(!e?.useAdditionalWeekYearTokens&&Pu(S)||!e?.useAdditionalDayOfYearTokens&&Eu(S))&&Ou(S,t,String(o));let A=yd[S[0]];return A(c,S,n.localize,g)}).join("")}function bv(o){let t=o.match(gv);return t?t[1].replace(fv,"'"):o}function Au(o,t,e){return ou(o,-t,e)}function Iu(o,t){return su(mt(t?.in||o,o),Au(au(t?.in||o),1))}function Du(o){if(!o||isNaN(o.getTime()))return"unknown";let t=new Date,e=Cd(o,"HH:mm:ss"),i=t.getTime()-o.getTime(),n=Math.floor(i/(1e3*60));if(n<1)return`just now (${e})`;if(n<60)return`${n} min ago (${e})`;let r=Math.floor(i/(1e3*60*60));if(r<24)return`${r}h ago (${e})`;if(Iu(o))return`yesterday ${e}`;let a=mu(t,o);return a<7?`${a}d ago ${e}`:`${Cd(o,"dd/MM/yyyy")} ${e}`}var vv=(o,t)=>t.filename;function yv(o,t){if(o&1){let e=k();s(0,"button",11),f("click",function(){b(e);let n=u(2);return v(n.downloadAll())}),s(1,"mat-icon"),p(2,"download_for_offline"),l()()}}function Cv(o,t){o&1&&(s(0,"div",10),I(1,"span",12),s(2,"span",13),p(3,"Loading files..."),l()())}function xv(o,t){o&1&&(s(0,"div",14)(1,"mat-icon",15),p(2,"folder_open"),l(),s(3,"p",16),p(4,"No files in exchange space"),l(),s(5,"p",17),p(6,"Upload files to share with the agent"),l()())}function wv(o,t){if(o&1){let e=k();s(0,"button",28),f("click",function(){b(e);let n=u().$implicit,r=u(4);return v(r.viewFile(n))}),s(1,"mat-icon"),p(2,"visibility"),l()()}}function Sv(o,t){if(o&1){let e=k();s(0,"div",18)(1,"div",19)(2,"mat-icon",20),p(3),l(),s(4,"div",21)(5,"span",22),p(6),l(),s(7,"span",23),p(8),l()()(),s(9,"div",24),C(10,wv,3,0,"button",25),s(11,"button",26),f("click",function(){let n=b(e).$implicit,r=u(4);return v(r.download(n))}),s(12,"mat-icon"),p(13,"download"),l()(),s(14,"button",27),f("click",function(){let n=b(e).$implicit,r=u(4);return v(r.delete(n))}),s(15,"mat-icon"),p(16,"delete"),l()()()()}if(o&2){let e=t.$implicit,i=u(4);d(3),O(i.getFileIcon(e.filename)),d(2),w("title",e.filename),d(),O(e.filename),d(2),Tn("",i.formatSize(e.size)," \u2022 ",i.formatDate(e.lastModified)),d(2),x(i.canViewFile(e)?10:-1)}}function kv(o,t){if(o&1&&we(0,Sv,17,6,"div",18,vv),o&2){let e=u(3);Se(e.files())}}function Mv(o,t){if(o&1&&C(0,xv,7,0,"div",14)(1,kv,2,0),o&2){let e=u(2);x(e.files().length===0?0:1)}}function Tv(o,t){if(o&1){let e=k();s(0,"div",0)(1,"div",2)(2,"div",3)(3,"h3",4),p(4,"Exchange"),l(),s(5,"span",5),p(6),l()(),s(7,"div",6),C(8,yv,3,0,"button",7),s(9,"button",8),f("click",function(){b(e);let n=u();return v(n.close())}),s(10,"mat-icon"),p(11,"chevron_right"),l()()()(),s(12,"div",9),C(13,Cv,4,0,"div",10)(14,Mv,2,1),l()()}if(o&2){let e=u();d(6),ie("(",e.files().length,")"),d(2),x(e.files().length>0?8:-1),d(5),x(e.isLoading()?13:14)}}function Ev(o,t){if(o&1){let e=k();s(0,"app-content-viewer",29),f("closeViewer",function(){b(e);let n=u();return v(n.backToList())}),l()}if(o&2){let e=u();w("file",e.currentFile)("projectName",e.projectName)("threadId",e.threadId)}}var ml=class o{projectName;threadId;closeDrawer=new H;fileExchangeState=m(pr);contentViewerService=m(hr);files=this.fileExchangeState.files;isLoading=this.fileExchangeState.isLoading;viewerState="list";currentFile=null;close(){this.viewerState==="content"?this.backToList():this.closeDrawer.emit()}viewFile(t){this.currentFile=t,this.viewerState="content"}backToList(){this.viewerState="list",this.currentFile=null}downloadAll(){this.fileExchangeState.downloadAllFiles()}download(t){this.fileExchangeState.downloadFile(t.filename)}delete(t){return te(this,null,function*(){if(!confirm(`Delete file "${t.filename}"?`))return;let i=yield this.fileExchangeState.deleteFile(t.filename);i.success||alert(`Failed to delete file: ${i.error}`)})}getFileIcon(t){switch(t.split(".").pop()?.toLowerCase()){case"pdf":return"picture_as_pdf";case"csv":case"xlsx":case"xls":return"table_chart";case"txt":case"md":return"description";case"jpg":case"jpeg":case"png":case"gif":case"webp":return"image";case"zip":case"tar":case"gz":return"folder_zip";default:return"insert_drive_file"}}formatSize(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}formatDate(t){return Du(t)}canViewFile(t){return this.contentViewerService.isFormatViewable(t.filename)&&this.contentViewerService.isViewable(t.size)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-file-exchange-drawer"]],inputs:{projectName:"projectName",threadId:"threadId"},outputs:{closeDrawer:"closeDrawer"},decls:2,vars:2,consts:[[1,"file-drawer-container"],[3,"file","projectName","threadId"],[1,"drawer-header"],[1,"header-left"],[1,"drawer-title"],[1,"file-count"],[1,"header-actions"],["mat-icon-button","","title","Download all files","type","button",1,"download-all-btn"],["mat-icon-button","","title","Close","type","button",1,"close-btn",3,"click"],[1,"file-list"],[1,"file-loading"],["mat-icon-button","","title","Download all files","type","button",1,"download-all-btn",3,"click"],[1,"loading-spinner"],[1,"loading-text"],[1,"file-empty"],[1,"empty-icon"],[1,"empty-text"],[1,"empty-hint"],[1,"file-item"],[1,"file-info"],[1,"file-icon"],[1,"file-details"],[1,"file-name",3,"title"],[1,"file-meta"],[1,"file-actions"],["mat-icon-button","","title","View","type","button",1,"action-btn","view-btn"],["mat-icon-button","","title","Download","type","button",1,"action-btn","download-btn",3,"click"],["mat-icon-button","","title","Delete","type","button",1,"action-btn","delete-btn",3,"click"],["mat-icon-button","","title","View","type","button",1,"action-btn","view-btn",3,"click"],[3,"closeViewer","file","projectName","threadId"]],template:function(e,i){e&1&&(C(0,Tv,15,3,"div",0),C(1,Ev,1,3,"app-content-viewer",1)),e&2&&(x(i.viewerState==="list"?0:-1),d(),x(i.viewerState==="content"&&i.currentFile?1:-1))},dependencies:[Fe,Me,he,ot,Ke,rl],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;height:100%}.file-drawer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;height:100%;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);color:var(--color-text)}.drawer-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--color-border);flex-shrink:0}.header-left[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:.5rem}.header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.drawer-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text)}.file-count[_ngcontent-%COMP%]{font-size:.9rem;color:var(--color-text-secondary)}.download-all-btn[_ngcontent-%COMP%]{color:var(--color-primary)}.download-all-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.close-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.close-btn[_ngcontent-%COMP%]:hover{color:var(--color-text);background:var(--color-bg-hover)}.file-list[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:.5rem}.file-loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;gap:1rem;color:var(--color-text-secondary)}.loading-spinner[_ngcontent-%COMP%]{display:inline-block;width:32px;height:32px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.loading-text[_ngcontent-%COMP%]{font-size:.9rem}.file-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;text-align:center;color:var(--color-text-secondary)}.empty-icon[_ngcontent-%COMP%]{font-size:64px;width:64px;height:64px;margin-bottom:1rem;opacity:.5}.empty-text[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:500}.empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;opacity:.7}.file-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:.75rem;border-radius:8px;transition:background .2s;gap:1rem}.file-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.file-item[_ngcontent-%COMP%]:hover .file-actions[_ngcontent-%COMP%]{opacity:1}.file-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;flex:1;min-width:0}.file-icon[_ngcontent-%COMP%]{flex-shrink:0;color:var(--color-primary);font-size:28px;width:28px;height:28px}.file-details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:0}.file-name[_ngcontent-%COMP%]{font-weight:500;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-meta[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary)}.file-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-shrink:0;opacity:0;transition:opacity .2s}.action-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.action-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.action-btn.view-btn[_ngcontent-%COMP%]:hover, .action-btn.download-btn[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.action-btn.delete-btn[_ngcontent-%COMP%]:hover{color:var(--color-error)}@media (max-width: 768px){.file-actions[_ngcontent-%COMP%]{opacity:1}.file-item[_ngcontent-%COMP%]{padding:1rem .75rem}.drawer-header[_ngcontent-%COMP%]{padding:.75rem;padding-top:calc(.75rem + env(safe-area-inset-top,0px))}}"]})};var Pv=["tooltip"],xd=20;var wd=new oe("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(ye);return()=>Bi(o,{scrollThrottle:xd})}});function Nu(o){let t=m(ye);return()=>Bi(t,{scrollThrottle:xd})}var Sd={provide:wd,deps:[],useFactory:Nu};function Lu(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}var Vu=new oe("mat-tooltip-default-options",{providedIn:"root",factory:Lu});var Ru="tooltip-panel",Fu=Nm({passive:!0}),Ov=8,Av=8,Iv=24,Dv=200,kd=(()=>{class o{_elementRef=m(ne);_ngZone=m(pe);_platform=m(tt);_ariaDescriber=m(Ga);_focusMonitor=m(Ni);_dir=m(bt);_injector=m(ye);_viewContainerRef=m(Zn);_animationsDisabled=$e();_defaultOptions=m(Vu,{optional:!0});_overlayRef;_tooltipInstance;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=!1;_disabled=!1;_tooltipClass;_viewInitialized=!1;_pointerExitEventsInitialized=!1;_tooltipComponent=zu;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending;_dirSubscribed=!1;get position(){return this._position}set position(e){e!==this._position&&(this._position=e,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()))}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(e){this._positionAtOrigin=Pt(e),this._detach(),this._overlayRef=null}get disabled(){return this._disabled}set disabled(e){let i=Pt(e);this._disabled!==i&&(this._disabled=i,i?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message))}get showDelay(){return this._showDelay}set showDelay(e){this._showDelay=fi(e)}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(e){this._hideDelay=fi(e),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay)}_hideDelay;touchGestures="auto";get message(){return this._message}set message(e){let i=this._message;this._message=e!=null?String(e).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(i)}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(e){this._tooltipClass=e,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}_passiveListeners=[];_touchstartTimeout=null;_destroyed=new R;_isDestroyed=!1;constructor(){let e=this._defaultOptions;e&&(this._showDelay=e.showDelay,this._hideDelay=e.hideDelay,e.position&&(this.position=e.position),e.positionAtOrigin&&(this.positionAtOrigin=e.positionAtOrigin),e.touchGestures&&(this.touchGestures=e.touchGestures),e.tooltipClass&&(this.tooltipClass=e.tooltipClass)),this._viewportMargin=Ov}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(N(this._destroyed)).subscribe(e=>{e?e==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){let e=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._passiveListeners.forEach(([i,n])=>{e.removeEventListener(i,n,Fu)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=!0,this._ariaDescriber.removeDescription(e,this.message,"tooltip"),this._focusMonitor.stopMonitoring(e)}show(e=this.showDelay,i){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let n=this._createOverlay(i);this._detach(),this._portal=this._portal||new vi(this._tooltipComponent,this._viewContainerRef);let r=this._tooltipInstance=n.attach(this._portal).instance;r._triggerElement=this._elementRef.nativeElement,r._mouseLeaveHideDelay=this._hideDelay,r.afterHidden().pipe(N(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),r.show(e)}hide(e=this.hideDelay){let i=this._tooltipInstance;i&&(i.isVisible()?i.hide(e):(i._cancelPendingAnimations(),this._detach()))}toggle(e){this._isTooltipVisible()?this.hide():this.show(void 0,e)}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(e){if(this._overlayRef){let a=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!e)&&a._origin instanceof ne)return this._overlayRef;this._detach()}let i=this._injector.get(cn).getAncestorScrollContainers(this._elementRef),n=`${this._cssClassPrefix}-${Ru}`,r=Yr(this._injector,this.positionAtOrigin?e||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(i);return r.positionChanges.pipe(N(this._destroyed)).subscribe(a=>{this._updateCurrentPositionClass(a.connectionPair),this._tooltipInstance&&a.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=hn(this._injector,{direction:this._dir,positionStrategy:r,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,n]:n,scrollStrategy:this._injector.get(wd)(),disableAnimations:this._animationsDisabled}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(N(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(N(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(N(this._destroyed)).subscribe(a=>{this._isTooltipVisible()&&a.keyCode===27&&!_t(a)&&(a.preventDefault(),a.stopPropagation(),this._ngZone.run(()=>this.hide(0)))}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=!0,this._dir.change.pipe(N(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(e){let i=e.getConfig().positionStrategy,n=this._getOrigin(),r=this._getOverlayPosition();i.withPositions([this._addOffset(Z(Z({},n.main),r.main)),this._addOffset(Z(Z({},n.fallback),r.fallback))])}_addOffset(e){let i=Av,n=!this._dir||this._dir.value=="ltr";return e.originY==="top"?e.offsetY=-i:e.originY==="bottom"?e.offsetY=i:e.originX==="start"?e.offsetX=n?-i:i:e.originX==="end"&&(e.offsetX=n?i:-i),e}_getOrigin(){let e=!this._dir||this._dir.value=="ltr",i=this.position,n;i=="above"||i=="below"?n={originX:"center",originY:i=="above"?"top":"bottom"}:i=="before"||i=="left"&&e||i=="right"&&!e?n={originX:"start",originY:"center"}:(i=="after"||i=="right"&&e||i=="left"&&!e)&&(n={originX:"end",originY:"center"});let{x:r,y:a}=this._invertPosition(n.originX,n.originY);return{main:n,fallback:{originX:r,originY:a}}}_getOverlayPosition(){let e=!this._dir||this._dir.value=="ltr",i=this.position,n;i=="above"?n={overlayX:"center",overlayY:"bottom"}:i=="below"?n={overlayX:"center",overlayY:"top"}:i=="before"||i=="left"&&e||i=="right"&&!e?n={overlayX:"end",overlayY:"center"}:(i=="after"||i=="right"&&e||i=="left"&&!e)&&(n={overlayX:"start",overlayY:"center"});let{x:r,y:a}=this._invertPosition(n.overlayX,n.overlayY);return{main:n,fallback:{overlayX:r,overlayY:a}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),Ft(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()},{injector:this._injector}))}_setTooltipClass(e){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=e,this._tooltipInstance._markForCheck())}_invertPosition(e,i){return this.position==="above"||this.position==="below"?i==="top"?i="bottom":i==="bottom"&&(i="top"):e==="end"?e="start":e==="start"&&(e="end"),{x:e,y:i}}_updateCurrentPositionClass(e){let{overlayY:i,originX:n,originY:r}=e,a;if(i==="center"?this._dir&&this._dir.value==="rtl"?a=n==="end"?"left":"right":a=n==="start"?"left":"right":a=i==="bottom"&&r==="top"?"above":"below",a!==this._currentPosition){let c=this._overlayRef;if(c){let h=`${this._cssClassPrefix}-${Ru}-`;c.removePanelClass(h+this._currentPosition),c.addPanelClass(h+a)}this._currentPosition=a}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",e=>{this._setupPointerExitEventsIfNeeded();let i;e.x!==void 0&&e.y!==void 0&&(i=e),this.show(void 0,i)}]):this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",e=>{let i=e.targetTouches?.[0],n=i?{x:i.clientX,y:i.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let r=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,n)},this._defaultOptions?.touchLongPressShowDelay??r)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;let e=[];if(this._platformSupportsMouseEvents())e.push(["mouseleave",i=>{let n=i.relatedTarget;(!n||!this._overlayRef?.overlayElement.contains(n))&&this.hide()}],["wheel",i=>this._wheelListener(i)]);else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let i=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay)};e.push(["touchend",i],["touchcancel",i])}this._addListeners(e),this._passiveListeners.push(...e)}_addListeners(e){e.forEach(([i,n])=>{this._elementRef.nativeElement.addEventListener(i,n,Fu)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(e){if(this._isTooltipVisible()){let i=this._injector.get(et).elementFromPoint(e.clientX,e.clientY),n=this._elementRef.nativeElement;i!==n&&!n.contains(i)&&this.hide()}}_disableNativeGesturesIfNecessary(){let e=this.touchGestures;if(e!=="off"){let i=this._elementRef.nativeElement,n=i.style;(e==="on"||i.nodeName!=="INPUT"&&i.nodeName!=="TEXTAREA")&&(n.userSelect=n.msUserSelect=n.webkitUserSelect=n.MozUserSelect="none"),(e==="on"||!i.draggable)&&(n.webkitUserDrag="none"),n.touchAction="none",n.webkitTapHighlightColor="transparent"}}_syncAriaDescription(e){this._ariaDescriptionPending||(this._ariaDescriptionPending=!0,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,e,"tooltip"),this._isDestroyed||Ft({write:()=>{this._ariaDescriptionPending=!1,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")}},{injector:this._injector}))}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(i,n){i&2&&E("mat-mdc-tooltip-disabled",n.disabled)},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return o})(),zu=(()=>{class o{_changeDetectorRef=m(Qe);_elementRef=m(ne);_isMultiline=!1;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=$e();_tooltip;_closeOnInteraction=!1;_isVisible=!1;_onHide=new R;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";constructor(){}show(e){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(!0),this._showTimeoutId=void 0},e)}hide(e){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(!1),this._hideTimeoutId=void 0},e)}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_handleMouseLeave({relatedTarget:e}){(!e||!this._triggerElement.contains(e))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(!1))}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck()}_isTooltipMultiline(){let e=this._elementRef.nativeElement.getBoundingClientRect();return e.height>Iv&&e.width>=Dv}_handleAnimationEnd({animationName:e}){(e===this._showAnimation||e===this._hideAnimation)&&this._finalizeAnimation(e===this._showAnimation)}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0}_finalizeAnimation(e){e?this._closeOnInteraction=!0:this.isVisible()||this._onHide.next()}_toggleVisibility(e){let i=this._tooltip.nativeElement,n=this._showAnimation,r=this._hideAnimation;if(i.classList.remove(e?r:n),i.classList.add(e?n:r),this._isVisible!==e&&(this._isVisible=e,this._changeDetectorRef.markForCheck()),e&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let a=getComputedStyle(i);(a.getPropertyValue("animation-duration")==="0s"||a.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=!0)}e&&this._onShow(),this._animationsDisabled&&(i.classList.add("_mat-animation-noopable"),this._finalizeAnimation(e))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-tooltip-component"]],viewQuery:function(i,n){if(i&1&&X(Pv,7),i&2){let r;U(r=W())&&(n._tooltip=r.first)}},hostAttrs:["aria-hidden","true"],hostBindings:function(i,n){i&1&&f("mouseleave",function(a){return n._handleMouseLeave(a)})},decls:4,vars:4,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend","ngClass"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(i,n){if(i&1){let r=k();s(0,"div",1,0),f("animationend",function(c){return b(r),v(n._handleAnimationEnd(c))}),s(2,"div",2),p(3),l()()}i&2&&(E("mdc-tooltip--multiline",n._isMultiline),w("ngClass",n.tooltipClass),d(3),O(n.message))},dependencies:[On],styles:[`.mat-mdc-tooltip{position:relative;transform:scale(0);display:inline-flex}.mat-mdc-tooltip::before{content:"";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-surface{word-break:normal;overflow-wrap:anywhere;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center;will-change:transform,opacity;background-color:var(--mat-tooltip-container-color, var(--mat-sys-inverse-surface));color:var(--mat-tooltip-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-tooltip-container-shape, var(--mat-sys-corner-extra-small));font-family:var(--mat-tooltip-supporting-text-font, var(--mat-sys-body-small-font));font-size:var(--mat-tooltip-supporting-text-size, var(--mat-sys-body-small-size));font-weight:var(--mat-tooltip-supporting-text-weight, var(--mat-sys-body-small-weight));line-height:var(--mat-tooltip-supporting-text-line-height, var(--mat-sys-body-small-line-height));letter-spacing:var(--mat-tooltip-supporting-text-tracking, var(--mat-sys-body-small-tracking))}.mat-mdc-tooltip-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:right}.mat-mdc-tooltip-panel{line-height:normal}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}
363
+ `],encapsulation:2,changeDetection:0})}return o})();var ma=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({providers:[Sd],imports:[No,yi,ce,ce,zi]})}return o})();var pl=class o{http=m(Xe);listUsers(){return this.http.get("/api/users")}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var hl=class o{excludedUserIds=[];placeholder="Search username";disabled=!1;userSelected=new H;userApi=m(pl);search(t){let e=t.toLowerCase();return this.userApi.listUsers().pipe(ve(i=>i.filter(n=>!this.excludedUserIds.includes(n.username)).filter(n=>n.username.toLowerCase().includes(e)).map(n=>({id:n.username,name:n.username}))))}onItemSelected(t){this.userSelected.emit(t.id)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-user-autocomplete"]],inputs:{excludedUserIds:"excludedUserIds",placeholder:"placeholder",disabled:"disabled"},outputs:{userSelected:"userSelected"},decls:1,vars:3,consts:[[3,"itemSelected","dataSource","placeholder","disabled"]],template:function(e,i){e&1&&(s(0,"ds-autocomplete-input",0),f("itemSelected",function(r){return i.onItemSelected(r)}),l()),e&2&&w("dataSource",i)("placeholder",i.placeholder)("disabled",i.disabled)},dependencies:[Km],styles:["[_nghost-%COMP%]{display:block}"]})};var Fv=(o,t)=>t.userId;function Nv(o,t){if(o&1&&(s(0,"div",4),p(1),l()),o&2){let e=u();d(),O(e.errorMessage())}}function Lv(o,t){if(o&1){let e=k();s(0,"button",10),f("click",function(){b(e);let n=u().$implicit,r=u();return v(r.removeUser(n.userId))}),s(1,"mat-icon"),p(2,"close"),l()()}}function Vv(o,t){if(o&1&&(s(0,"div",6)(1,"mat-icon",7),p(2,"person"),l(),s(3,"span",8),p(4),l(),C(5,Lv,3,0,"button",9),l()),o&2){let e=t.$implicit,i=u();d(4),O(e.userId),d(),x(i.users.length>1?5:-1)}}var pa=class o{threadId;users=[];currentUsername;userAdded=new H;userRemoved=new H;isAdding=Oe(!1);errorMessage=Oe("");get excludedUserIds(){return[this.currentUsername,...this.users.map(t=>t.userId)]}setAdding(t){this.isAdding.set(t)}setError(t){this.errorMessage.set(t),this.isAdding.set(!1)}onUserSelected(t){this.errorMessage.set(""),this.userAdded.emit(t)}removeUser(t){this.userRemoved.emit(t)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-thread-share"]],inputs:{threadId:"threadId",users:"users",currentUsername:"currentUsername"},outputs:{userAdded:"userAdded",userRemoved:"userRemoved"},decls:12,vars:3,consts:[[1,"thread-share"],[1,"share-header"],[1,"add-user-section"],[3,"userSelected","excludedUserIds","disabled"],[1,"error-message"],[1,"users-list"],[1,"user-item"],[1,"user-icon"],[1,"user-name"],["mat-icon-button","","title","Remove user",1,"remove-button"],["mat-icon-button","","title","Remove user",1,"remove-button",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"mat-icon"),p(3,"group"),l(),s(4,"span"),p(5,"Participants"),l()(),s(6,"div",2)(7,"app-user-autocomplete",3),f("userSelected",function(r){return i.onUserSelected(r)}),l()(),C(8,Nv,2,1,"div",4),s(9,"div",5),we(10,Vv,6,2,"div",6,Fv),l()()),e&2&&(d(7),w("excludedUserIds",i.excludedUserIds)("disabled",i.isAdding()),d(),x(i.errorMessage()?8:-1),d(2),Se(i.users))},dependencies:[Me,he,ot,Ke,ma,hl],styles:[".thread-share[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:.75rem}.share-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-weight:600;font-size:.9rem;color:var(--color-text)}.share-header[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-text-secondary)}.add-user-section[_ngcontent-%COMP%]{display:flex;align-items:center;width:50%}.error-message[_ngcontent-%COMP%]{color:var(--color-error);font-size:.75rem;margin-top:-.5rem}.users-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.user-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;border-radius:6px;transition:background .15s ease}.user-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-text-secondary);flex-shrink:0}.user-name[_ngcontent-%COMP%]{flex:1;font-size:.875rem;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.remove-button[_ngcontent-%COMP%]{flex-shrink:0;width:28px!important;height:28px!important;padding:0!important}.remove-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;color:var(--color-text-secondary)}.remove-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-error, #ef4444)}"]})};var gl=["*"],zv=["content"],jv=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],Bv=["mat-drawer","mat-drawer-content","*"];function Hv(o,t){if(o&1){let e=k();s(0,"div",1),f("click",function(){b(e);let n=u();return v(n._onBackdropClicked())}),l()}if(o&2){let e=u();E("mat-drawer-shown",e._isShowingBackdrop())}}function Uv(o,t){o&1&&(s(0,"mat-drawer-content"),ue(1,2),l())}var Wv=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],$v=["mat-sidenav","mat-sidenav-content","*"];function qv(o,t){if(o&1){let e=k();s(0,"div",1),f("click",function(){b(e);let n=u();return v(n._onBackdropClicked())}),l()}if(o&2){let e=u();E("mat-drawer-shown",e._isShowingBackdrop())}}function Gv(o,t){o&1&&(s(0,"mat-sidenav-content"),ue(1,2),l())}var Yv=`.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-sys-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-sys-background));box-sizing:border-box;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color, color-mix(in srgb, var(--mat-sys-neutral-variant20) 40%, transparent))}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}@media(forced-colors: active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-content.mat-drawer-content-hidden{opacity:0}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-sys-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow, none);background-color:var(--mat-sidenav-container-background-color, var(--mat-sys-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));width:var(--mat-sidenav-container-width, 360px);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}@media(forced-colors: active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media(forced-colors: active){[dir=rtl] .mat-drawer,.mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-transition .mat-drawer{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating){visibility:hidden;box-shadow:none}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating) .mat-drawer-inner-container{display:none}.mat-drawer.mat-drawer-opened.mat-drawer-opened{transform:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto}.mat-sidenav-fixed{position:fixed}
364
364
  `;var Qv=new oe("MAT_DRAWER_DEFAULT_AUTOSIZE",{providedIn:"root",factory:Xv}),Md=new oe("MAT_DRAWER_CONTAINER");function Xv(){return!1}var vr=(()=>{class o extends dn{_platform=m(tt);_changeDetectorRef=m(Qe);_container=m(ua);constructor(){let e=m(ne),i=m(cn),n=m(pe);super(e,i,n)}ngAfterContentInit(){this._container._contentMarginChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})}_shouldBeHidden(){if(this._platform.isBrowser)return!1;let{start:e,end:i}=this._container;return e!=null&&e.mode!=="over"&&e.opened||i!=null&&i.mode!=="over"&&i.opened}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-drawer-content"]],hostAttrs:[1,"mat-drawer-content"],hostVars:6,hostBindings:function(i,n){i&2&&(oi("margin-left",n._container._contentMargins.left,"px")("margin-right",n._container._contentMargins.right,"px"),E("mat-drawer-content-hidden",n._shouldBeHidden()))},features:[Ye([{provide:dn,useExisting:o}]),Tt],ngContentSelectors:gl,decls:1,vars:0,template:function(i,n){i&1&&(We(),ue(0))},encapsulation:2,changeDetection:0})}return o})(),ha=(()=>{class o{_elementRef=m(ne);_focusTrapFactory=m($a);_focusMonitor=m(Ni);_platform=m(tt);_ngZone=m(pe);_renderer=m(Ct);_interactivityChecker=m(Fo);_doc=m(et);_container=m(Md,{optional:!0});_focusTrap=null;_elementFocusedBeforeDrawerWasOpened=null;_eventCleanups;_isAttached;_anchor;get position(){return this._position}set position(e){e=e==="end"?"end":"start",e!==this._position&&(this._isAttached&&this._updatePositionInParent(e),this._position=e,this.onPositionChanged.emit())}_position="start";get mode(){return this._mode}set mode(e){this._mode=e,this._updateFocusTrapState(),this._modeChanged.next()}_mode="over";get disableClose(){return this._disableClose}set disableClose(e){this._disableClose=Pt(e)}_disableClose=!1;get autoFocus(){let e=this._autoFocus;return e??(this.mode==="side"?"dialog":"first-tabbable")}set autoFocus(e){(e==="true"||e==="false"||e==null)&&(e=Pt(e)),this._autoFocus=e}_autoFocus;get opened(){return this._opened()}set opened(e){this.toggle(Pt(e))}_opened=Oe(!1);_openedVia;_animationStarted=new R;_animationEnd=new R;openedChange=new H(!0);_openedStream=this.openedChange.pipe(me(e=>e),ve(()=>{}));openedStart=this._animationStarted.pipe(me(()=>this.opened),Xl(void 0));_closedStream=this.openedChange.pipe(me(e=>!e),ve(()=>{}));closedStart=this._animationStarted.pipe(me(()=>!this.opened),Xl(void 0));_destroyed=new R;onPositionChanged=new H;_content;_modeChanged=new R;_injector=m(ye);_changeDetectorRef=m(Qe);constructor(){this.openedChange.pipe(N(this._destroyed)).subscribe(e=>{e?(this._elementFocusedBeforeDrawerWasOpened=this._doc.activeElement,this._takeFocus()):this._isFocusWithinDrawer()&&this._restoreFocus(this._openedVia||"program")}),this._ngZone.runOutsideAngular(()=>{let e=this._elementRef.nativeElement;lm(e,"keydown").pipe(me(i=>i.keyCode===27&&!this.disableClose&&!_t(i)),N(this._destroyed)).subscribe(i=>this._ngZone.run(()=>{this.close(),i.stopPropagation(),i.preventDefault()})),this._eventCleanups=[this._renderer.listen(e,"transitionrun",this._handleTransitionEvent),this._renderer.listen(e,"transitionend",this._handleTransitionEvent),this._renderer.listen(e,"transitioncancel",this._handleTransitionEvent)]}),this._animationEnd.subscribe(()=>{this.openedChange.emit(this.opened)})}_forceFocus(e,i){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let n=()=>{r(),a(),e.removeAttribute("tabindex")},r=this._renderer.listen(e,"blur",n),a=this._renderer.listen(e,"mousedown",n)})),e.focus(i)}_focusByCssSelector(e,i){let n=this._elementRef.nativeElement.querySelector(e);n&&this._forceFocus(n,i)}_takeFocus(){if(!this._focusTrap)return;let e=this._elementRef.nativeElement;switch(this.autoFocus){case!1:case"dialog":return;case!0:case"first-tabbable":Ft(()=>{!this._focusTrap.focusInitialElement()&&typeof e.focus=="function"&&e.focus()},{injector:this._injector});break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');break;default:this._focusByCssSelector(this.autoFocus);break}}_restoreFocus(e){this.autoFocus!=="dialog"&&(this._elementFocusedBeforeDrawerWasOpened?this._focusMonitor.focusVia(this._elementFocusedBeforeDrawerWasOpened,e):this._elementRef.nativeElement.blur(),this._elementFocusedBeforeDrawerWasOpened=null)}_isFocusWithinDrawer(){let e=this._doc.activeElement;return!!e&&this._elementRef.nativeElement.contains(e)}ngAfterViewInit(){this._isAttached=!0,this._position==="end"&&this._updatePositionInParent("end"),this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._updateFocusTrapState())}ngOnDestroy(){this._eventCleanups.forEach(e=>e()),this._focusTrap?.destroy(),this._anchor?.remove(),this._anchor=null,this._animationStarted.complete(),this._animationEnd.complete(),this._modeChanged.complete(),this._destroyed.next(),this._destroyed.complete()}open(e){return this.toggle(!0,e)}close(){return this.toggle(!1)}_closeViaBackdropClick(){return this._setOpen(!1,!0,"mouse")}toggle(e=!this.opened,i){e&&i&&(this._openedVia=i);let n=this._setOpen(e,!e&&this._isFocusWithinDrawer(),this._openedVia||"program");return e||(this._openedVia=null),n}_setOpen(e,i,n){return e===this.opened?Promise.resolve(e?"open":"close"):(this._opened.set(e),this._container?._transitionsEnabled?this._setIsAnimating(!0):setTimeout(()=>{this._animationStarted.next(),this._animationEnd.next()}),this._elementRef.nativeElement.classList.toggle("mat-drawer-opened",e),!e&&i&&this._restoreFocus(n),this._changeDetectorRef.markForCheck(),this._updateFocusTrapState(),new Promise(r=>{this.openedChange.pipe(qt(1)).subscribe(a=>r(a?"open":"close"))}))}_setIsAnimating(e){this._elementRef.nativeElement.classList.toggle("mat-drawer-animating",e)}_getWidth(){return this._elementRef.nativeElement.offsetWidth||0}_updateFocusTrapState(){this._focusTrap&&(this._focusTrap.enabled=!!this._container?.hasBackdrop&&this.opened)}_updatePositionInParent(e){if(!this._platform.isBrowser)return;let i=this._elementRef.nativeElement,n=i.parentNode;e==="end"?(this._anchor||(this._anchor=this._doc.createComment("mat-drawer-anchor"),n.insertBefore(this._anchor,i)),n.appendChild(i)):this._anchor&&this._anchor.parentNode.insertBefore(i,this._anchor)}_handleTransitionEvent=e=>{let i=this._elementRef.nativeElement;e.target===i&&this._ngZone.run(()=>{e.type==="transitionrun"?this._animationStarted.next(e):(e.type==="transitionend"&&this._setIsAnimating(!1),this._animationEnd.next(e))})};static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-drawer"]],viewQuery:function(i,n){if(i&1&&X(zv,5),i&2){let r;U(r=W())&&(n._content=r.first)}},hostAttrs:[1,"mat-drawer"],hostVars:12,hostBindings:function(i,n){i&2&&(J("align",null)("tabIndex",n.mode!=="side"?"-1":null),oi("visibility",!n._container&&!n.opened?"hidden":null),E("mat-drawer-end",n.position==="end")("mat-drawer-over",n.mode==="over")("mat-drawer-push",n.mode==="push")("mat-drawer-side",n.mode==="side"))},inputs:{position:"position",mode:"mode",disableClose:"disableClose",autoFocus:"autoFocus",opened:"opened"},outputs:{openedChange:"openedChange",_openedStream:"opened",openedStart:"openedStart",_closedStream:"closed",closedStart:"closedStart",onPositionChanged:"positionChanged"},exportAs:["matDrawer"],ngContentSelectors:gl,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(i,n){i&1&&(We(),s(0,"div",1,0),ue(2),l())},dependencies:[dn],encapsulation:2,changeDetection:0})}return o})(),ua=(()=>{class o{_dir=m(bt,{optional:!0});_element=m(ne);_ngZone=m(pe);_changeDetectorRef=m(Qe);_animationDisabled=$e();_transitionsEnabled=!1;_allDrawers;_drawers=new um;_content;_userContent;get start(){return this._start}get end(){return this._end}get autosize(){return this._autosize}set autosize(e){this._autosize=Pt(e)}_autosize=m(Qv);get hasBackdrop(){return this._drawerHasBackdrop(this._start)||this._drawerHasBackdrop(this._end)}set hasBackdrop(e){this._backdropOverride=e==null?null:Pt(e)}_backdropOverride;backdropClick=new H;_start;_end;_left;_right;_destroyed=new R;_doCheckSubject=new R;_contentMargins={left:null,right:null};_contentMarginChanges=new R;get scrollable(){return this._userContent||this._content}_injector=m(ye);constructor(){let e=m(tt),i=m(ji);this._dir?.change.pipe(N(this._destroyed)).subscribe(()=>{this._validateDrawers(),this.updateContentMargins()}),i.change().pipe(N(this._destroyed)).subscribe(()=>this.updateContentMargins()),!this._animationDisabled&&e.isBrowser&&this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._element.nativeElement.classList.add("mat-drawer-transition"),this._transitionsEnabled=!0},200)})}ngAfterContentInit(){this._allDrawers.changes.pipe(Mt(this._allDrawers),N(this._destroyed)).subscribe(e=>{this._drawers.reset(e.filter(i=>!i._container||i._container===this)),this._drawers.notifyOnChanges()}),this._drawers.changes.pipe(Mt(null)).subscribe(()=>{this._validateDrawers(),this._drawers.forEach(e=>{this._watchDrawerToggle(e),this._watchDrawerPosition(e),this._watchDrawerMode(e)}),(!this._drawers.length||this._isDrawerOpen(this._start)||this._isDrawerOpen(this._end))&&this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(()=>{this._doCheckSubject.pipe(cm(10),N(this._destroyed)).subscribe(()=>this.updateContentMargins())})}ngOnDestroy(){this._contentMarginChanges.complete(),this._doCheckSubject.complete(),this._drawers.destroy(),this._destroyed.next(),this._destroyed.complete()}open(){this._drawers.forEach(e=>e.open())}close(){this._drawers.forEach(e=>e.close())}updateContentMargins(){let e=0,i=0;if(this._left&&this._left.opened){if(this._left.mode=="side")e+=this._left._getWidth();else if(this._left.mode=="push"){let n=this._left._getWidth();e+=n,i-=n}}if(this._right&&this._right.opened){if(this._right.mode=="side")i+=this._right._getWidth();else if(this._right.mode=="push"){let n=this._right._getWidth();i+=n,e-=n}}e=e||null,i=i||null,(e!==this._contentMargins.left||i!==this._contentMargins.right)&&(this._contentMargins={left:e,right:i},this._ngZone.run(()=>this._contentMarginChanges.next(this._contentMargins)))}ngDoCheck(){this._autosize&&this._isPushed()&&this._ngZone.runOutsideAngular(()=>this._doCheckSubject.next())}_watchDrawerToggle(e){e._animationStarted.pipe(N(this._drawers.changes)).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),e.mode!=="side"&&e.openedChange.pipe(N(this._drawers.changes)).subscribe(()=>this._setContainerClass(e.opened))}_watchDrawerPosition(e){e.onPositionChanged.pipe(N(this._drawers.changes)).subscribe(()=>{Ft({read:()=>this._validateDrawers()},{injector:this._injector})})}_watchDrawerMode(e){e._modeChanged.pipe(N(Di(this._drawers.changes,this._destroyed))).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()})}_setContainerClass(e){let i=this._element.nativeElement.classList,n="mat-drawer-container-has-open";e?i.add(n):i.remove(n)}_validateDrawers(){this._start=this._end=null,this._drawers.forEach(e=>{e.position=="end"?(this._end!=null,this._end=e):(this._start!=null,this._start=e)}),this._right=this._left=null,this._dir&&this._dir.value==="rtl"?(this._left=this._end,this._right=this._start):(this._left=this._start,this._right=this._end)}_isPushed(){return this._isDrawerOpen(this._start)&&this._start.mode!="over"||this._isDrawerOpen(this._end)&&this._end.mode!="over"}_onBackdropClicked(){this.backdropClick.emit(),this._closeModalDrawersViaBackdrop()}_closeModalDrawersViaBackdrop(){[this._start,this._end].filter(e=>e&&!e.disableClose&&this._drawerHasBackdrop(e)).forEach(e=>e._closeViaBackdropClick())}_isShowingBackdrop(){return this._isDrawerOpen(this._start)&&this._drawerHasBackdrop(this._start)||this._isDrawerOpen(this._end)&&this._drawerHasBackdrop(this._end)}_isDrawerOpen(e){return e!=null&&e.opened}_drawerHasBackdrop(e){return this._backdropOverride==null?!!e&&e.mode!=="side":this._backdropOverride}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-drawer-container"]],contentQueries:function(i,n,r){if(i&1&&(xt(r,vr,5),xt(r,ha,5)),i&2){let a;U(a=W())&&(n._content=a.first),U(a=W())&&(n._allDrawers=a)}},viewQuery:function(i,n){if(i&1&&X(vr,5),i&2){let r;U(r=W())&&(n._userContent=r.first)}},hostAttrs:[1,"mat-drawer-container"],hostVars:2,hostBindings:function(i,n){i&2&&E("mat-drawer-container-explicit-backdrop",n._backdropOverride)},inputs:{autosize:"autosize",hasBackdrop:"hasBackdrop"},outputs:{backdropClick:"backdropClick"},exportAs:["matDrawerContainer"],features:[Ye([{provide:Md,useExisting:o}])],ngContentSelectors:Bv,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(i,n){i&1&&(We(jv),C(0,Hv,1,2,"div",0),ue(1),ue(2,1),C(3,Uv,2,0,"mat-drawer-content")),i&2&&(x(n.hasBackdrop?0:-1),d(3),x(n._content?-1:3))},dependencies:[vr],styles:[`.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-sys-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-sys-background));box-sizing:border-box;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color, color-mix(in srgb, var(--mat-sys-neutral-variant20) 40%, transparent))}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}@media(forced-colors: active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-content.mat-drawer-content-hidden{opacity:0}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-sys-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow, none);background-color:var(--mat-sidenav-container-background-color, var(--mat-sys-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));width:var(--mat-sidenav-container-width, 360px);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}@media(forced-colors: active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media(forced-colors: active){[dir=rtl] .mat-drawer,.mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-transition .mat-drawer{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating){visibility:hidden;box-shadow:none}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating) .mat-drawer-inner-container{display:none}.mat-drawer.mat-drawer-opened.mat-drawer-opened{transform:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto}.mat-sidenav-fixed{position:fixed}
365
- `],encapsulation:2,changeDetection:0})}return o})(),ul=(()=>{class o extends vr{static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275cmp=M({type:o,selectors:[["mat-sidenav-content"]],hostAttrs:[1,"mat-drawer-content","mat-sidenav-content"],features:[Ye([{provide:dn,useExisting:o}]),Tt],ngContentSelectors:gl,decls:1,vars:0,template:function(i,n){i&1&&(We(),ue(0))},encapsulation:2,changeDetection:0})}return o})(),Td=(()=>{class o extends ha{get fixedInViewport(){return this._fixedInViewport}set fixedInViewport(e){this._fixedInViewport=Pt(e)}_fixedInViewport=!1;get fixedTopGap(){return this._fixedTopGap}set fixedTopGap(e){this._fixedTopGap=fi(e)}_fixedTopGap=0;get fixedBottomGap(){return this._fixedBottomGap}set fixedBottomGap(e){this._fixedBottomGap=fi(e)}_fixedBottomGap=0;static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275cmp=M({type:o,selectors:[["mat-sidenav"]],hostAttrs:[1,"mat-drawer","mat-sidenav"],hostVars:16,hostBindings:function(i,n){i&2&&(J("tabIndex",n.mode!=="side"?"-1":null)("align",null),oi("top",n.fixedInViewport?n.fixedTopGap:null,"px")("bottom",n.fixedInViewport?n.fixedBottomGap:null,"px"),E("mat-drawer-end",n.position==="end")("mat-drawer-over",n.mode==="over")("mat-drawer-push",n.mode==="push")("mat-drawer-side",n.mode==="side")("mat-sidenav-fixed",n.fixedInViewport))},inputs:{fixedInViewport:"fixedInViewport",fixedTopGap:"fixedTopGap",fixedBottomGap:"fixedBottomGap"},exportAs:["matSidenav"],features:[Ye([{provide:ha,useExisting:o}]),Tt],ngContentSelectors:gl,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(i,n){i&1&&(We(),s(0,"div",1,0),ue(2),l())},dependencies:[dn],encapsulation:2,changeDetection:0})}return o})(),ju=(()=>{class o extends ua{_allDrawers=void 0;_content=void 0;static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275cmp=M({type:o,selectors:[["mat-sidenav-container"]],contentQueries:function(i,n,r){if(i&1&&(xt(r,ul,5),xt(r,Td,5)),i&2){let a;U(a=W())&&(n._content=a.first),U(a=W())&&(n._allDrawers=a)}},hostAttrs:[1,"mat-drawer-container","mat-sidenav-container"],hostVars:2,hostBindings:function(i,n){i&2&&E("mat-drawer-container-explicit-backdrop",n._backdropOverride)},exportAs:["matSidenavContainer"],features:[Ye([{provide:Md,useExisting:o},{provide:ua,useExisting:o}]),Tt],ngContentSelectors:$v,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(i,n){i&1&&(We(Wv),C(0,qv,1,2,"div",0),ue(1),ue(2,1),C(3,Gv,2,0,"mat-sidenav-content")),i&2&&(x(n.hasBackdrop?0:-1),d(3),x(n._content?-1:3))},dependencies:[ul],styles:[Yv],encapsulation:2,changeDetection:0})}return o})(),fl=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({imports:[le,zi,zi,le]})}return o})();var Hu="mat-badge-content",Kv=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["ng-component"]],decls:0,vars:0,template:function(i,n){},styles:[`.mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
366
- `],encapsulation:2,changeDetection:0})}return o})(),Uu=(()=>{class o{_ngZone=m(pe);_elementRef=m(ne);_ariaDescriber=m(Ga);_renderer=m(Ct);_animationsDisabled=$e();_idGenerator=m(Ne);get color(){return this._color}set color(e){this._setColor(e),this._color=e}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(e){this._updateRenderedContent(e)}_content;get description(){return this._description}set description(e){this._updateDescription(e)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=m(Fo);_document=m(et);constructor(){let e=m(Nt);e.load(Kv),e.load(Wa)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let e=this._renderer.createElement("span"),i="mat-badge-active";return e.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),e.setAttribute("aria-hidden","true"),e.classList.add(Hu),this._animationsDisabled&&e.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(e),typeof requestAnimationFrame=="function"&&!this._animationsDisabled?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{e.classList.add(i)})}):e.classList.add(i),e}_updateRenderedContent(e){let i=`${e??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(e){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!e||this._isHostInteractive())&&this._removeInlineDescription(),this._description=e,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,e):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(e){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),e&&i.add(`mat-badge-${e}`)}_clearExistingBadges(){let e=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Hu}`);for(let i of Array.from(e))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&E("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",ee],disabled:[2,"matBadgeDisabled","disabled",ee],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",ee]}})}return o})(),Wu=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({imports:[No,le,le]})}return o})();var yr=class o{ATTENTION_EMOJI="\u{1F534}";isSystemActive=!1;systemActiveTimer=null;SYSTEM_ACTIVE_TIMEOUT=4e3;unreadService=m(dr);project=m(ke);constructor(){this.initializeTitleUpdates()}initializeTitleUpdates(){Yn([this.project.selectedProject$,this.unreadService.unreadCount$]).subscribe(([t,e])=>{this.updateTitle(t?.name??"...",e)})}updateTitle(t,e){let i;this.isSystemActive?i=`\u23F3${e>0?` (${e}) `:" "}${t}`:e>0?i=`${this.ATTENTION_EMOJI} (${e}) ${t}`:i=t,document.title=i,console.log("[TAB-TITLE] Updated to:",i)}setSystemActive(){console.log("[TAB-TITLE] System active - showing hourglass"),this.isSystemActive=!0,this.systemActiveTimer&&clearTimeout(this.systemActiveTimer),this.systemActiveTimer=setTimeout(()=>{console.log("[TAB-TITLE] System active timeout - hiding hourglass"),this.isSystemActive=!1,this.forceUpdateTitle()},this.SYSTEM_ACTIVE_TIMEOUT),this.forceUpdateTitle()}setSystemInactive(){console.log("[TAB-TITLE] System inactive - hiding hourglass"),this.isSystemActive=!1,this.systemActiveTimer&&(clearTimeout(this.systemActiveTimer),this.systemActiveTimer=null),this.forceUpdateTitle()}forceUpdateTitle(){let t=this.project.getSelectedProjectId()??"...",e=this.unreadService.getCurrentCount();this.updateTitle(t,e)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var _l=class o{http=m(Xe);maxFileSize=5*1024*1024;supportedTypes=["image/png","image/jpeg","image/gif","image/webp"];validateFile(t){if(!this.supportedTypes.includes(t.type))throw new Error(`Unsupported file type: ${t.type}`);if(t.size>this.maxFileSize)throw new Error(`File too large: ${(t.size/1024/1024).toFixed(1)}MB exceeds 5MB limit`)}fileToBase64(t){return te(this,null,function*(){return new Promise((e,i)=>{let n=new FileReader;n.onload=()=>{let r=n.result;if(!r){i(new Error("Failed to read file"));return}let a=r.split(",")[1];if(!a){i(new Error("Invalid file format"));return}e(a)},n.onerror=i,n.readAsDataURL(t)})})}getUploadUrl(t,e){return`/api/projects/${t}/threads/${e}/upload`}uploadImage(t,e,i){console.log("[IMAGE-UPLOAD] uploadImage - file:",t.name,t.type,t.size),console.log("[IMAGE-UPLOAD] uploadImage - project:",e,"thread:",i);try{console.log("[IMAGE-UPLOAD] Validating file..."),this.validateFile(t)}catch(n){return console.log("[IMAGE-UPLOAD] Validation failed:",n),Rt({success:!1,error:n instanceof Error?n.message:"Validation failed"})}return new Ii(n=>{console.log("[IMAGE-UPLOAD] Converting to base64..."),this.fileToBase64(t).then(r=>{console.log("[IMAGE-UPLOAD] Base64 length:",r.length),console.log("[IMAGE-UPLOAD] Sending upload request..."),this.http.post(this.getUploadUrl(e,i),{content:r,mimeType:t.type,filename:t.name}).pipe(ve(a=>(console.log("[IMAGE-UPLOAD] Upload success result:",a),{success:!0,processedSize:a.processedSize,dimensions:a.dimensions})),kn(a=>{console.log("[IMAGE-UPLOAD] Upload failed:",a);let c=a.error?.error||a.message||"Upload failed";return Rt({success:!1,error:c})})).subscribe({next:a=>{n.next(a),n.complete()},error:a=>n.error(a)})}).catch(r=>{console.log("[IMAGE-UPLOAD] Base64 conversion failed:",r),n.next({success:!1,error:r instanceof Error?r.message:"Failed to read file"}),n.complete()})})}hasImageFiles(t){if(console.log("[IMAGE-UPLOAD] hasImageFiles - dataTransfer:",t),!t)return console.log("[IMAGE-UPLOAD] hasImageFiles - no dataTransfer"),!1;if(console.log("[IMAGE-UPLOAD] hasImageFiles - types:",Array.from(t.types)),!Array.from(t.types).includes("Files"))return console.log("[IMAGE-UPLOAD] hasImageFiles - no Files type"),!1;let e=Array.from(t.files||[]);console.log("[IMAGE-UPLOAD] hasImageFiles - files:",e.map(n=>({name:n.name,type:n.type})));let i=e.some(n=>this.supportedTypes.includes(n.type));return console.log("[IMAGE-UPLOAD] hasImageFiles - result:",i),i}filterImageFiles(t){return Array.from(t).filter(i=>this.supportedTypes.includes(i.type))}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var Cr=class o{pendingFirstMessage=null;setPendingFirstMessage(t){console.log("[FIRST-MESSAGE-STATE] Storing pending first message:",t.substring(0,50)+"..."),this.pendingFirstMessage=t}consumePendingFirstMessage(){let t=this.pendingFirstMessage;return t?(console.log("[FIRST-MESSAGE-STATE] Consuming pending first message:",t.substring(0,50)+"..."),this.pendingFirstMessage=null):console.log("[FIRST-MESSAGE-STATE] No pending first message to consume"),t}hasPendingFirstMessage(){return this.pendingFirstMessage!==null}clear(){this.pendingFirstMessage&&(console.log("[FIRST-MESSAGE-STATE] Clearing pending first message"),this.pendingFirstMessage=null)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var Jv=["inputSection"],ey=()=>[];function ty(o,t){if(o&1){let e=k();s(0,"button",20),f("click",function(){b(e);let n=u();return v(n.toggleFileDrawer())}),s(1,"mat-icon"),p(2,"folder_open"),l()()}if(o&2){let e=u();E("has-files",e.fileCount>0),w("title",En("Files Exchange",e.fileCount>0?" ("+e.fileCount+" file"+(e.fileCount>1?"s":"")+")":""))("matBadge",e.fileCount>0?e.fileCount:null)}}function iy(o,t){if(o&1){let e=k();s(0,"button",21),f("click",function(){b(e);let n=u();return v(n.toggleSharePanel())}),s(1,"mat-icon"),p(2,"group"),l()()}if(o&2){let e=u();E("has-shared-users",((e.threadDetails==null||e.threadDetails.users==null?null:e.threadDetails.users.length)??0)>1)}}function ny(o,t){if(o&1&&(s(0,"div",6),p(1),l()),o&2){let e=u();d(),Tn(" \u26A0\uFE0F Connection lost. Reconnecting... (",e.connectionStatus.reconnectAttempts,"/",e.connectionStatus.maxAttempts,") ")}}function oy(o,t){if(o&1&&(s(0,"div",22),p(1),l()),o&2){let e=u();E("error",e.uploadStatus.isError),d(),ie(" ",e.uploadStatus.message," ")}}function ry(o,t){if(o&1){let e=k();s(0,"app-chat-textarea",23),f("messageSubmitted",function(n){b(e);let r=u();return v(r.onMessageSubmitted(n))})("voiceRecordingToggled",function(n){b(e);let r=u();return v(r.onVoiceToggled(n))})("heightChanged",function(n){b(e);let r=u();return v(r.onInputHeightChanged(n))})("stopRequested",function(){b(e);let n=u();return v(n.onStopRequested())})("filesPasted",function(n){b(e);let r=u();return v(r.onFilesPasted(n))})("textareaFocused",function(){b(e);let n=u();return v(n.chatFocused.emit())}),l()}if(o&2){let e=u();w("isDisabled",!e.isConnected)("isSessionInitializing",!1)("showWelcome",!1)("isThinking",e.isThinking)("isStarting",!1)}}function ay(o,t){if(o&1){let e=k();s(0,"app-choice-select",24),f("choiceSelected",function(n){b(e);let r=u();return v(r.onChoiceSelected(n))}),l()}if(o&2){let e=u();w("options",e.currentChoice.options)("labelHtml",e.currentChoice.label)("isVisible",!!e.currentChoice)("allowFreeText",e.currentChoice.allowFreeText)}}function sy(o,t){o&1&&I(0,"app-oauth-request-panel")}function ly(o,t){if(o&1){let e=k();s(0,"app-file-exchange-drawer",25),f("closeDrawer",function(){b(e);let n=u();return v(n.closeDrawer())}),l()}if(o&2){let e=u();w("projectName",e.projectName)("threadId",e.threadId)}}function cy(o,t){if(o&1){let e=k();s(0,"div",18)(1,"div",26)(2,"h3",27),p(3,"Share"),l(),s(4,"button",28),f("click",function(){b(e);let n=u();return v(n.closeDrawer())}),s(5,"mat-icon"),p(6,"chevron_right"),l()()(),s(7,"app-thread-share",29),f("userAdded",function(n){b(e);let r=u();return v(r.onUserAdded(n))})("userRemoved",function(n){b(e);let r=u();return v(r.onUserRemoved(n))}),l()()}if(o&2){let e=u();d(7),w("threadId",e.threadId)("users",e.threadDetails.users||Cm(3,ey))("currentUsername",e.currentUsername)}}function dy(o,t){o&1&&(s(0,"div",19)(1,"div",30)(2,"div",31),p(3,"\u{1F4CE}"),l(),s(4,"div",32),p(5,"Drop files here to upload"),l(),s(6,"div",33),p(7,"Images will be added to conversation, other files to exchange space"),l()()())}var bl=class o{projectName;threadId;chatFocused=new H;drawerStateChange=new H;destroy$=new R;connectionDestroy$=new R;inputSection;messages=[];streamingText="";isThinking=!1;currentChoice=null;connectionStatus=null;isConnected=!1;showConnectionStatus=!1;hasEverConnected=!1;inputSectionHeight=80;uploadStatus={message:"",isError:!1};isDragOver=!1;drawerMode="none";get isDrawerOpen(){return this.drawerMode!=="none"}threadDetails=null;threadShareRef;get fileCount(){return this.fileExchangeState.fileCount()}currentUsername="";pendingFirstMessage=null;subscriptions=[];codayService=m(Xt);oauthService=m(Hn);pendingOAuthRequest=rt(this.oauthService.pendingRequest$,{initialValue:null});preferencesService=m(at);titleService=m(yr);elementRef=m(ne);threadState=m(At);userService=m(Xi);router=m(Fi);imageUploadService=m(_l);fileExchangeState=m(pr);firstMessageState=m(Cr);ngOnInit(){if(console.log("[THREAD] Initializing with project:",this.projectName,"thread:",this.threadId),!this.projectName||!this.threadId){console.error("[THREAD] Missing required inputs: projectName or threadId");return}this.setupPrintHandlers(),this.userService.username$.pipe(N(this.destroy$)).subscribe(t=>{this.currentUsername=t??"",this.messages.length>0&&(this.messages=[...this.messages])}),this.initializeThreadConnection()}ngOnChanges(t){console.log("[THREAD] ngOnChanges called",t),t.threadId&&(console.log("[THREAD] threadId changed:",{firstChange:t.threadId.firstChange,previousValue:t.threadId.previousValue,currentValue:t.threadId.currentValue}),t.threadId.firstChange||(console.log("[THREAD] Reconnecting to new thread"),this.initializeThreadConnection()))}initializeThreadConnection(){console.log("[THREAD] Initializing connection for thread:",this.threadId),this.fileExchangeState.initializeForThread(this.projectName,this.threadId),this.connectionDestroy$.next(),this.codayService.messages$.pipe(N(this.connectionDestroy$)).subscribe(e=>{console.log("[THREAD] Messages updated:",e.length),this.messages=e}),this.codayService.streamingText$.pipe(N(this.connectionDestroy$)).subscribe(e=>{this.streamingText=e}),this.codayService.isThinking$.pipe(N(this.connectionDestroy$)).subscribe(e=>{this.isThinking=e}),this.codayService.currentChoice$.pipe(N(this.connectionDestroy$)).subscribe(e=>{this.currentChoice=e}),this.codayService.connectionStatus$.pipe(N(this.connectionDestroy$)).subscribe(e=>{this.connectionStatus=e,this.isConnected=e.connected,e.connected&&!this.hasEverConnected&&(this.hasEverConnected=!0,this.showConnectionStatus=!0),!e.connected&&!this.hasEverConnected?setTimeout(()=>{!this.isConnected&&!this.hasEverConnected&&(this.showConnectionStatus=!0)},2e3):!e.connected&&this.hasEverConnected?this.showConnectionStatus=!0:e.connected&&(this.showConnectionStatus=!0)}),this.codayService.threadUpdateEvent$.pipe(N(this.connectionDestroy$)).subscribe(e=>{e&&(console.log("[THREAD] Thread update event received:",e),this.threadState.refreshThreadList())}),this.threadState.selectedThread$.pipe(N(this.connectionDestroy$)).subscribe(e=>{this.threadDetails=e}),this.codayService.resetMessages(),this.codayService.setTabTitleService(this.titleService),console.log("[THREAD] Connecting to thread event stream"),this.codayService.connectToThread(this.projectName,this.threadId);let t=this.firstMessageState.consumePendingFirstMessage();t?(console.log("[THREAD] First message pending:",t.substring(0,50)+"..."),this.pendingFirstMessage=t,this.codayService.setThinkingForPendingMessage(),this.subscribeToFirstInvite()):console.log("[THREAD] No first message found in state service")}ngAfterViewChecked(){if(this.inputSection?.nativeElement){let t=this.inputSection.nativeElement.offsetHeight;t!==this.inputSectionHeight&&t>0&&(this.inputSectionHeight=t)}}ngOnDestroy(){console.log("[THREAD] Destroying component"),this.connectionDestroy$.next(),this.connectionDestroy$.complete(),this.destroy$.next(),this.destroy$.complete(),this.fileExchangeState.clear(),this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[],window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}onMessageSubmitted(t){console.log("[THREAD] Sending message:",t),this.codayService.sendMessage(t)}onVoiceToggled(t){console.log("[VOICE] Recording:",t)}onChoiceSelected(t){console.log("[THREAD] Choice selected:",t),this.codayService.sendChoice(t)}onCopyMessage(t){console.log("[COPY] Message copied:",t.id)}onStopRequested(){this.threadState.stop()}onInputHeightChanged(t){console.log("[THREAD] Input height changed:",t),this.inputSectionHeight=t}onFilesPasted(t){console.log("[THREAD] File(s) pasted:",t.length);let e=this.imageUploadService.filterImageFiles(t),i=t.filter(n=>!n.type.startsWith("image/"));e.length&&this.uploadFilesSequentially(e,0),i.length&&this.uploadFilesToExchangeSpace(i),!e.length&&!i.length&&this.showUploadError("No supported files found")}emitDrawerState(){this.drawerStateChange.emit(this.isDrawerOpen)}toggleFileDrawer(){this.drawerMode=this.drawerMode==="files"?"none":"files",this.emitDrawerState()}toggleSharePanel(){this.drawerMode=this.drawerMode==="share"?"none":"share",this.emitDrawerState()}closeDrawer(){this.drawerMode="none",this.emitDrawerState()}onUserAdded(t){if(console.log("[THREAD] Adding user to thread:",t),!this.threadDetails)return;let e=this.threadDetails.users||[];if(e.some(n=>n.userId===t)){this.threadShareRef?.setError("User already has access to this thread");return}this.threadShareRef?.setAdding(!0);let i=[...e,{userId:t}];this.threadState.updateThreadUsers(this.threadId,i).pipe(N(this.destroy$)).subscribe({next:()=>{console.log("[THREAD] User added successfully"),this.threadShareRef?.setAdding(!1),this.threadState.refreshSelectedThread()},error:n=>{console.error("[THREAD] Error adding user:",n),this.threadShareRef?.setError(n?.error?.error||"Failed to add user")}})}onUserRemoved(t){if(console.log("[THREAD] Removing user from thread:",t),!this.threadDetails)return;let e=t===this.currentUsername,i=(this.threadDetails.users||[]).filter(n=>n.userId!==t);this.threadState.updateThreadUsers(this.threadId,i).pipe(N(this.destroy$)).subscribe({next:()=>{console.log("[THREAD] User removed successfully"),e?(this.threadState.clearSelection(),this.threadState.refreshThreadList(),this.router.navigate(["project",this.projectName])):this.threadState.refreshSelectedThread()},error:n=>{console.error("[THREAD] Error removing user:",n)}})}onDragEnter(t){t.preventDefault(),t.dataTransfer?.types.includes("Files")&&(console.log("[THREAD] Image files detected - showing drag overlay"),this.isDragOver=!0)}onDragOver(t){t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy")}onDragLeave(t){this.elementRef.nativeElement.contains(t.relatedTarget)||(console.log("[THREAD] Leaving component area - hiding drag overlay"),this.isDragOver=!1)}onDrop(t){t.preventDefault(),this.isDragOver=!1,console.log("[THREAD] Files dropped:",t.dataTransfer?.files?.length||0);let e=t.dataTransfer?.files;if(!e||e.length===0){console.log("[THREAD] No files in drop event");return}let i=this.imageUploadService.filterImageFiles(e),n=Array.from(e).filter(r=>!r.type.startsWith("image/"));console.log("[THREAD] Image files:",i.length,"Other files:",n.length),i.length>0&&this.uploadFilesSequentially(i,0),n.length>0&&this.uploadFilesToExchangeSpace(n),i.length===0&&n.length===0&&this.showUploadError("No supported files found")}uploadFilesSequentially(t,e){if(e>=t.length)return;let i=t[e];if(!i){console.error("[THREAD] File at index",e,"is undefined");return}console.log("[THREAD] Uploading file:",i.name),this.uploadStatus={message:`Uploading ${i.name}...`,isError:!1},this.imageUploadService.uploadImage(i,this.projectName,this.threadId).subscribe({next:n=>{n.success?(console.log("[THREAD] Upload successful:",i.name),this.uploadStatus={message:`\u2713 ${i.name} uploaded (${(n.processedSize/1024).toFixed(1)} KB)`,isError:!1},setTimeout(()=>{this.uploadStatus.isError||(this.uploadStatus={message:"",isError:!1})},3e3),this.uploadFilesSequentially(t,e+1)):(console.error("[THREAD] Upload failed:",i.name,n.error),this.showUploadError(`Failed to upload ${i.name}: ${n.error}`))},error:n=>{console.error("[THREAD] Upload error:",i.name,n),this.showUploadError(`Failed to upload ${i.name}: ${n.message||"Unknown error"}`)}})}showUploadError(t){this.uploadStatus={message:t,isError:!0},setTimeout(()=>{this.uploadStatus={message:"",isError:!1}},5e3)}uploadFilesToExchangeSpace(t){return te(this,null,function*(){for(let e of t){console.log("[THREAD] Uploading to exchange space:",e.name),this.uploadStatus={message:`Uploading ${e.name}...`,isError:!1};let i=yield this.fileExchangeState.uploadFile(e);if(i.success)console.log("[THREAD] Upload to exchange space successful:",e.name),this.uploadStatus={message:`\u2713 ${e.name} uploaded to exchange space`,isError:!1},setTimeout(()=>{this.uploadStatus.isError||(this.uploadStatus={message:"",isError:!1})},3e3);else{console.error("[THREAD] Upload to exchange space failed:",e.name,i.error),this.showUploadError(`Failed to upload ${e.name}: ${i.error}`);break}}})}subscribeToFirstInvite(){console.log("[THREAD] Subscribing to wait for InviteEvent"),this.subscriptions.push(this.codayService.currentInviteEvent$.subscribe(t=>{if(t&&this.pendingFirstMessage){console.log("[THREAD] Received InviteEvent, sending pending message");let e=this.pendingFirstMessage;this.pendingFirstMessage=null,this.codayService.sendMessage(e)}}))}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let t=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",t),t?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical")};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical")};static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-thread"]],viewQuery:function(e,i){if(e&1&&(X(Jv,5),X(pa,5)),e&2){let n;U(n=W())&&(i.inputSection=n.first),U(n=W())&&(i.threadShareRef=n.first)}},inputs:{projectName:"projectName",threadId:"threadId"},outputs:{chatFocused:"chatFocused",drawerStateChange:"drawerStateChange"},features:[nt],decls:22,vars:16,consts:[["inputSection",""],[1,"drag-drop-wrapper",3,"dragenter","dragover","dragleave","drop"],[1,"file-drawer-container",3,"hasBackdrop"],[1,"thread-container"],["matFab","","type","button",1,"file-drawer-toggle-btn",3,"has-files","matBadge","title"],["matFab","","title","Share thread","type","button",1,"share-toggle-btn",3,"has-shared-users"],[1,"connection-status"],[1,"chat-wrapper"],[1,"chat-center"],[3,"copyRequested","stopRequested","messages","streamingText","isThinking","currentUsername"],[1,"upload-status",3,"error"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"],[1,"choice-overlay",3,"options","labelHtml","isVisible","allowFreeText"],["mode","side","position","end",3,"closed","opened"],[3,"projectName","threadId"],[1,"share-drawer-container"],[1,"drag-overlay"],["matFab","","type","button",1,"file-drawer-toggle-btn",3,"click","matBadge","title"],["matFab","","title","Share thread","type","button",1,"share-toggle-btn",3,"click"],[1,"upload-status"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","stopRequested","filesPasted","textareaFocused","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"],[1,"choice-overlay",3,"choiceSelected","options","labelHtml","isVisible","allowFreeText"],[3,"closeDrawer","projectName","threadId"],[1,"drawer-header"],[1,"drawer-title"],["mat-icon-button","","title","Close","type","button",1,"close-btn",3,"click"],[3,"userAdded","userRemoved","threadId","users","currentUsername"],[1,"drag-overlay-content"],[1,"drag-icon"],[1,"drag-text"],[1,"drag-hint"]],template:function(e,i){if(e&1){let n=k();s(0,"div",1),f("dragenter",function(a){return b(n),v(i.onDragEnter(a))})("dragover",function(a){return b(n),v(i.onDragOver(a))})("dragleave",function(a){return b(n),v(i.onDragLeave(a))})("drop",function(a){return b(n),v(i.onDrop(a))}),s(1,"mat-drawer-container",2)(2,"mat-drawer-content")(3,"div",3),C(4,ty,3,5,"button",4),C(5,iy,3,2,"button",5),C(6,ny,2,2,"div",6),s(7,"div",7)(8,"div",8)(9,"app-chat-history",9),f("copyRequested",function(a){return b(n),v(i.onCopyMessage(a))})("stopRequested",function(){return b(n),v(i.onStopRequested())}),l(),C(10,oy,2,3,"div",10),l()(),s(11,"div",11,0)(13,"div",12)(14,"div",13),C(15,ry,1,5,"app-chat-textarea",14),C(16,ay,1,4,"app-choice-select",15),C(17,sy,1,0,"app-oauth-request-panel"),l()()()()(),s(18,"mat-drawer",16),f("closed",function(){return b(n),v(i.closeDrawer())}),C(19,ly,1,2,"app-file-exchange-drawer",17),C(20,cy,8,4,"div",18),l()(),C(21,dy,8,0,"div",19),l()}e&2&&(d(),w("hasBackdrop",!1),d(3),x(i.drawerMode!=="files"?4:-1),d(),x(i.drawerMode!=="share"?5:-1),d(),x(i.showConnectionStatus&&i.connectionStatus&&!i.connectionStatus.connected?6:-1),d(3),w("messages",i.messages)("streamingText",i.streamingText)("isThinking",i.isThinking)("currentUsername",i.currentUsername),d(),x(i.uploadStatus.message?10:-1),d(5),x(!i.currentChoice&&!i.pendingOAuthRequest()?15:-1),d(),x(i.currentChoice?16:-1),d(),x(i.pendingOAuthRequest()?17:-1),d(),w("opened",i.isDrawerOpen),d(),x(i.drawerMode==="files"?19:-1),d(),x(i.drawerMode==="share"&&i.threadDetails?20:-1),d(),x(i.isDragOver?21:-1))},dependencies:[tl,ar,Jo,il,ml,pa,fl,ha,ua,vr,Me,he,ot,Ke,Xa,Wu,Uu],styles:[".drag-drop-wrapper[_ngcontent-%COMP%]{height:100vh;height:100dvh;width:100%;position:relative}.thread-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;width:100%;position:relative;background:transparent}.file-drawer-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:1rem!important;right:1rem!important;z-index:100!important}.file-drawer-toggle-btn.has-files[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_pulse-subtle 3s infinite}@media (max-width: 768px){.file-drawer-toggle-btn[_ngcontent-%COMP%]{width:40px!important;height:40px!important;top:.75rem!important;right:.75rem!important}.file-drawer-toggle-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}}.share-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:5rem!important;right:1rem!important;z-index:100!important}.share-toggle-btn.has-shared-users[_ngcontent-%COMP%]{color:var(--color-primary)!important}@media (max-width: 768px){.share-toggle-btn[_ngcontent-%COMP%]{width:40px!important;height:40px!important;top:calc(1.25rem + 40px)!important;right:.75rem!important}.share-toggle-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}}.share-drawer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);color:var(--color-text)}.share-drawer-container[_ngcontent-%COMP%] .drawer-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;padding-top:calc(1rem + env(safe-area-inset-top,0px));border-bottom:1px solid var(--color-border);flex-shrink:0}.share-drawer-container[_ngcontent-%COMP%] .drawer-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text)}.share-drawer-container[_ngcontent-%COMP%] .close-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.share-drawer-container[_ngcontent-%COMP%] .close-btn[_ngcontent-%COMP%]:hover{color:var(--color-text);background:var(--color-bg-hover)}@keyframes _ngcontent-%COMP%_pulse-subtle{0%,to{box-shadow:0 2px 8px #00000026}50%{box-shadow:0 4px 16px rgba(var(--color-primary-rgb, 25, 118, 210),.3)}}.file-drawer-container[_ngcontent-%COMP%]{height:100vh;height:100dvh;width:100%;background:var(--color-bg)}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer-content{display:flex;flex-direction:column;height:100%;overflow:hidden;background:transparent}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:35vw;max-width:90vw;box-shadow:-2px 0 8px #0000001a}@media (max-width: 768px){.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:100vw;max-width:100vw;padding-bottom:env(safe-area-inset-bottom,0px)}}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer-backdrop{display:none}.connection-status[_ngcontent-%COMP%]{position:fixed;top:0;left:0;right:0;z-index:1000;background:var(--color-warning);color:var(--color-text);padding:.5rem 1rem;text-align:center;font-size:.9rem;box-shadow:0 2px 4px #0000001a}.chat-wrapper[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;width:100%;padding:1rem 0}.chat-center[_ngcontent-%COMP%]{max-width:800px;width:100%;margin:0 auto;padding:0 2rem;display:flex;flex-direction:column;gap:1rem}@media (max-width: 768px){.chat-center[_ngcontent-%COMP%]{padding:0 1rem}}.input-section[_ngcontent-%COMP%]{width:100%;padding:1rem 0;padding-bottom:calc(1rem + env(safe-area-inset-bottom,0px));background:transparent;position:relative}.input-center[_ngcontent-%COMP%]{max-width:800px;width:100%;margin:0 auto;padding:0 2rem}@media (max-width: 768px){.input-center[_ngcontent-%COMP%]{padding:0 1rem}}.choice-overlay[_ngcontent-%COMP%]{display:block;width:100%}.upload-status[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:8px;background:var(--color-success-light);color:var(--color-text);font-size:.9rem;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:var(--color-error-light)}@media print{.file-drawer-toggle-btn[_ngcontent-%COMP%], .share-toggle-btn[_ngcontent-%COMP%], .connection-status[_ngcontent-%COMP%]{display:none}.thread-container[_ngcontent-%COMP%]{background:#fff}.input-section[_ngcontent-%COMP%]{display:none}}"]})};var $u=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({imports:[le,le]})}return o})();var qu=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({imports:[le]})}return o})();var Ki=class o{http=m(Xe);getUserConfig(){return this.http.get("/api/config/user").pipe(yt(t=>console.log("[CONFIG-API] User config retrieved:",t)))}updateUserConfig(t){return this.http.put("/api/config/user",t).pipe(yt(e=>console.log("[CONFIG-API] User config updated:",e)))}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var xr=class o{currentThemeSubject=new ce("light");currentTheme$=this.currentThemeSubject.asObservable();preferences=m(at);constructor(){console.log("[THEME] Initializing theme service"),this.initializeTheme(),this.setupSystemThemeListener()}initializeTheme(){let t=this.preferences.getPreference("theme","light")??"light";console.log("[THEME] Loaded saved theme:",t),this.applyTheme(t),setTimeout(()=>{let e=this.preferences.getPreference("theme","light")??"light";e!==t&&(console.log("[THEME] Theme updated after async load:",e),this.applyTheme(e))},100)}setTheme(t){this.preferences.setPreference("theme",t),this.applyTheme(t)}getCurrentTheme(){return this.currentThemeSubject.value}applyTheme(t){if(console.log("[THEME] Applying theme:",t),this.currentThemeSubject.next(t),t==="system")if(typeof window<"u"&&window.matchMedia){let i=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";console.log("[THEME] System theme resolved to:",i),this.setDocumentTheme(i)}else console.log("[THEME] matchMedia not available, defaulting to light theme"),this.setDocumentTheme("light");else this.setDocumentTheme(t)}setDocumentTheme(t){console.log("[THEME] Setting document theme to:",t),typeof document<"u"&&document.documentElement&&(t==="dark"?document.documentElement.setAttribute("data-theme","dark"):document.documentElement.removeAttribute("data-theme"))}setupSystemThemeListener(){typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{this.getCurrentTheme()==="system"&&this.setDocumentTheme(t.matches?"dark":"light")})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var my=["mat-internal-form-field",""],py=["*"],vl=(()=>{class o{labelPosition;static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["div","mat-internal-form-field",""]],hostAttrs:[1,"mdc-form-field","mat-internal-form-field"],hostVars:2,hostBindings:function(i,n){i&2&&E("mdc-form-field--align-end",n.labelPosition==="before")},inputs:{labelPosition:"labelPosition"},attrs:my,ngContentSelectors:py,decls:1,vars:0,template:function(i,n){i&1&&(We(),ue(0))},styles:[`.mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}
365
+ `],encapsulation:2,changeDetection:0})}return o})(),ul=(()=>{class o extends vr{static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275cmp=M({type:o,selectors:[["mat-sidenav-content"]],hostAttrs:[1,"mat-drawer-content","mat-sidenav-content"],features:[Ye([{provide:dn,useExisting:o}]),Tt],ngContentSelectors:gl,decls:1,vars:0,template:function(i,n){i&1&&(We(),ue(0))},encapsulation:2,changeDetection:0})}return o})(),Td=(()=>{class o extends ha{get fixedInViewport(){return this._fixedInViewport}set fixedInViewport(e){this._fixedInViewport=Pt(e)}_fixedInViewport=!1;get fixedTopGap(){return this._fixedTopGap}set fixedTopGap(e){this._fixedTopGap=fi(e)}_fixedTopGap=0;get fixedBottomGap(){return this._fixedBottomGap}set fixedBottomGap(e){this._fixedBottomGap=fi(e)}_fixedBottomGap=0;static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275cmp=M({type:o,selectors:[["mat-sidenav"]],hostAttrs:[1,"mat-drawer","mat-sidenav"],hostVars:16,hostBindings:function(i,n){i&2&&(J("tabIndex",n.mode!=="side"?"-1":null)("align",null),oi("top",n.fixedInViewport?n.fixedTopGap:null,"px")("bottom",n.fixedInViewport?n.fixedBottomGap:null,"px"),E("mat-drawer-end",n.position==="end")("mat-drawer-over",n.mode==="over")("mat-drawer-push",n.mode==="push")("mat-drawer-side",n.mode==="side")("mat-sidenav-fixed",n.fixedInViewport))},inputs:{fixedInViewport:"fixedInViewport",fixedTopGap:"fixedTopGap",fixedBottomGap:"fixedBottomGap"},exportAs:["matSidenav"],features:[Ye([{provide:ha,useExisting:o}]),Tt],ngContentSelectors:gl,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(i,n){i&1&&(We(),s(0,"div",1,0),ue(2),l())},dependencies:[dn],encapsulation:2,changeDetection:0})}return o})(),ju=(()=>{class o extends ua{_allDrawers=void 0;_content=void 0;static \u0275fac=(()=>{let e;return function(n){return(e||(e=ti(o)))(n||o)}})();static \u0275cmp=M({type:o,selectors:[["mat-sidenav-container"]],contentQueries:function(i,n,r){if(i&1&&(xt(r,ul,5),xt(r,Td,5)),i&2){let a;U(a=W())&&(n._content=a.first),U(a=W())&&(n._allDrawers=a)}},hostAttrs:[1,"mat-drawer-container","mat-sidenav-container"],hostVars:2,hostBindings:function(i,n){i&2&&E("mat-drawer-container-explicit-backdrop",n._backdropOverride)},exportAs:["matSidenavContainer"],features:[Ye([{provide:Md,useExisting:o},{provide:ua,useExisting:o}]),Tt],ngContentSelectors:$v,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(i,n){i&1&&(We(Wv),C(0,qv,1,2,"div",0),ue(1),ue(2,1),C(3,Gv,2,0,"mat-sidenav-content")),i&2&&(x(n.hasBackdrop?0:-1),d(3),x(n._content?-1:3))},dependencies:[ul],styles:[Yv],encapsulation:2,changeDetection:0})}return o})(),fl=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({imports:[ce,zi,zi,ce]})}return o})();var Hu="mat-badge-content",Kv=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["ng-component"]],decls:0,vars:0,template:function(i,n){},styles:[`.mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
366
+ `],encapsulation:2,changeDetection:0})}return o})(),Uu=(()=>{class o{_ngZone=m(pe);_elementRef=m(ne);_ariaDescriber=m(Ga);_renderer=m(Ct);_animationsDisabled=$e();_idGenerator=m(Ne);get color(){return this._color}set color(e){this._setColor(e),this._color=e}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(e){this._updateRenderedContent(e)}_content;get description(){return this._description}set description(e){this._updateDescription(e)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=m(Fo);_document=m(et);constructor(){let e=m(Nt);e.load(Kv),e.load(Wa)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let e=this._renderer.createElement("span"),i="mat-badge-active";return e.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),e.setAttribute("aria-hidden","true"),e.classList.add(Hu),this._animationsDisabled&&e.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(e),typeof requestAnimationFrame=="function"&&!this._animationsDisabled?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{e.classList.add(i)})}):e.classList.add(i),e}_updateRenderedContent(e){let i=`${e??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(e){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!e||this._isHostInteractive())&&this._removeInlineDescription(),this._description=e,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,e):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(e){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),e&&i.add(`mat-badge-${e}`)}_clearExistingBadges(){let e=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Hu}`);for(let i of Array.from(e))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&E("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",ee],disabled:[2,"matBadgeDisabled","disabled",ee],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",ee]}})}return o})(),Wu=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({imports:[No,ce,ce]})}return o})();var yr=class o{ATTENTION_EMOJI="\u{1F534}";isSystemActive=!1;systemActiveTimer=null;SYSTEM_ACTIVE_TIMEOUT=4e3;unreadService=m(dr);project=m(ke);constructor(){this.initializeTitleUpdates()}initializeTitleUpdates(){Yn([this.project.selectedProject$,this.unreadService.unreadCount$]).subscribe(([t,e])=>{this.updateTitle(t?.name??"...",e)})}updateTitle(t,e){let i;this.isSystemActive?i=`\u23F3${e>0?` (${e}) `:" "}${t}`:e>0?i=`${this.ATTENTION_EMOJI} (${e}) ${t}`:i=t,document.title=i,console.log("[TAB-TITLE] Updated to:",i)}setSystemActive(){console.log("[TAB-TITLE] System active - showing hourglass"),this.isSystemActive=!0,this.systemActiveTimer&&clearTimeout(this.systemActiveTimer),this.systemActiveTimer=setTimeout(()=>{console.log("[TAB-TITLE] System active timeout - hiding hourglass"),this.isSystemActive=!1,this.forceUpdateTitle()},this.SYSTEM_ACTIVE_TIMEOUT),this.forceUpdateTitle()}setSystemInactive(){console.log("[TAB-TITLE] System inactive - hiding hourglass"),this.isSystemActive=!1,this.systemActiveTimer&&(clearTimeout(this.systemActiveTimer),this.systemActiveTimer=null),this.forceUpdateTitle()}forceUpdateTitle(){let t=this.project.getSelectedProjectId()??"...",e=this.unreadService.getCurrentCount();this.updateTitle(t,e)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var _l=class o{http=m(Xe);maxFileSize=5*1024*1024;supportedTypes=["image/png","image/jpeg","image/gif","image/webp"];validateFile(t){if(!this.supportedTypes.includes(t.type))throw new Error(`Unsupported file type: ${t.type}`);if(t.size>this.maxFileSize)throw new Error(`File too large: ${(t.size/1024/1024).toFixed(1)}MB exceeds 5MB limit`)}fileToBase64(t){return te(this,null,function*(){return new Promise((e,i)=>{let n=new FileReader;n.onload=()=>{let r=n.result;if(!r){i(new Error("Failed to read file"));return}let a=r.split(",")[1];if(!a){i(new Error("Invalid file format"));return}e(a)},n.onerror=i,n.readAsDataURL(t)})})}getUploadUrl(t,e){return`/api/projects/${t}/threads/${e}/upload`}uploadImage(t,e,i){console.log("[IMAGE-UPLOAD] uploadImage - file:",t.name,t.type,t.size),console.log("[IMAGE-UPLOAD] uploadImage - project:",e,"thread:",i);try{console.log("[IMAGE-UPLOAD] Validating file..."),this.validateFile(t)}catch(n){return console.log("[IMAGE-UPLOAD] Validation failed:",n),Rt({success:!1,error:n instanceof Error?n.message:"Validation failed"})}return new Ii(n=>{console.log("[IMAGE-UPLOAD] Converting to base64..."),this.fileToBase64(t).then(r=>{console.log("[IMAGE-UPLOAD] Base64 length:",r.length),console.log("[IMAGE-UPLOAD] Sending upload request..."),this.http.post(this.getUploadUrl(e,i),{content:r,mimeType:t.type,filename:t.name}).pipe(ve(a=>(console.log("[IMAGE-UPLOAD] Upload success result:",a),{success:!0,processedSize:a.processedSize,dimensions:a.dimensions})),kn(a=>{console.log("[IMAGE-UPLOAD] Upload failed:",a);let c=a.error?.error||a.message||"Upload failed";return Rt({success:!1,error:c})})).subscribe({next:a=>{n.next(a),n.complete()},error:a=>n.error(a)})}).catch(r=>{console.log("[IMAGE-UPLOAD] Base64 conversion failed:",r),n.next({success:!1,error:r instanceof Error?r.message:"Failed to read file"}),n.complete()})})}hasImageFiles(t){if(console.log("[IMAGE-UPLOAD] hasImageFiles - dataTransfer:",t),!t)return console.log("[IMAGE-UPLOAD] hasImageFiles - no dataTransfer"),!1;if(console.log("[IMAGE-UPLOAD] hasImageFiles - types:",Array.from(t.types)),!Array.from(t.types).includes("Files"))return console.log("[IMAGE-UPLOAD] hasImageFiles - no Files type"),!1;let e=Array.from(t.files||[]);console.log("[IMAGE-UPLOAD] hasImageFiles - files:",e.map(n=>({name:n.name,type:n.type})));let i=e.some(n=>this.supportedTypes.includes(n.type));return console.log("[IMAGE-UPLOAD] hasImageFiles - result:",i),i}filterImageFiles(t){return Array.from(t).filter(i=>this.supportedTypes.includes(i.type))}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var Cr=class o{pendingFirstMessage=null;setPendingFirstMessage(t){console.log("[FIRST-MESSAGE-STATE] Storing pending first message:",t.substring(0,50)+"..."),this.pendingFirstMessage=t}consumePendingFirstMessage(){let t=this.pendingFirstMessage;return t?(console.log("[FIRST-MESSAGE-STATE] Consuming pending first message:",t.substring(0,50)+"..."),this.pendingFirstMessage=null):console.log("[FIRST-MESSAGE-STATE] No pending first message to consume"),t}hasPendingFirstMessage(){return this.pendingFirstMessage!==null}clear(){this.pendingFirstMessage&&(console.log("[FIRST-MESSAGE-STATE] Clearing pending first message"),this.pendingFirstMessage=null)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var Jv=["inputSection"],ey=()=>[];function ty(o,t){if(o&1){let e=k();s(0,"button",20),f("click",function(){b(e);let n=u();return v(n.toggleFileDrawer())}),s(1,"mat-icon"),p(2,"folder_open"),l()()}if(o&2){let e=u();E("has-files",e.fileCount>0),w("title",En("Files Exchange",e.fileCount>0?" ("+e.fileCount+" file"+(e.fileCount>1?"s":"")+")":""))("matBadge",e.fileCount>0?e.fileCount:null)}}function iy(o,t){if(o&1){let e=k();s(0,"button",21),f("click",function(){b(e);let n=u();return v(n.toggleSharePanel())}),s(1,"mat-icon"),p(2,"group"),l()()}if(o&2){let e=u();E("has-shared-users",((e.threadDetails==null||e.threadDetails.users==null?null:e.threadDetails.users.length)??0)>1)}}function ny(o,t){if(o&1&&(s(0,"div",6),p(1),l()),o&2){let e=u();d(),Tn(" \u26A0\uFE0F Connection lost. Reconnecting... (",e.connectionStatus.reconnectAttempts,"/",e.connectionStatus.maxAttempts,") ")}}function oy(o,t){if(o&1&&(s(0,"div",22),p(1),l()),o&2){let e=u();E("error",e.uploadStatus.isError),d(),ie(" ",e.uploadStatus.message," ")}}function ry(o,t){if(o&1){let e=k();s(0,"app-chat-textarea",23),f("messageSubmitted",function(n){b(e);let r=u();return v(r.onMessageSubmitted(n))})("voiceRecordingToggled",function(n){b(e);let r=u();return v(r.onVoiceToggled(n))})("heightChanged",function(n){b(e);let r=u();return v(r.onInputHeightChanged(n))})("stopRequested",function(){b(e);let n=u();return v(n.onStopRequested())})("filesPasted",function(n){b(e);let r=u();return v(r.onFilesPasted(n))}),l()}if(o&2){let e=u();w("isDisabled",!e.isConnected)("isSessionInitializing",!1)("showWelcome",!1)("isThinking",e.isThinking)("isStarting",!1)}}function ay(o,t){if(o&1){let e=k();s(0,"app-choice-select",24),f("choiceSelected",function(n){b(e);let r=u();return v(r.onChoiceSelected(n))}),l()}if(o&2){let e=u();w("options",e.currentChoice.options)("labelHtml",e.currentChoice.label)("isVisible",!!e.currentChoice)("allowFreeText",e.currentChoice.allowFreeText)}}function sy(o,t){o&1&&I(0,"app-oauth-request-panel")}function ly(o,t){if(o&1){let e=k();s(0,"app-file-exchange-drawer",25),f("closeDrawer",function(){b(e);let n=u();return v(n.closeDrawer())}),l()}if(o&2){let e=u();w("projectName",e.projectName)("threadId",e.threadId)}}function cy(o,t){if(o&1){let e=k();s(0,"div",18)(1,"div",26)(2,"h3",27),p(3,"Share"),l(),s(4,"button",28),f("click",function(){b(e);let n=u();return v(n.closeDrawer())}),s(5,"mat-icon"),p(6,"chevron_right"),l()()(),s(7,"app-thread-share",29),f("userAdded",function(n){b(e);let r=u();return v(r.onUserAdded(n))})("userRemoved",function(n){b(e);let r=u();return v(r.onUserRemoved(n))}),l()()}if(o&2){let e=u();d(7),w("threadId",e.threadId)("users",e.threadDetails.users||Cm(3,ey))("currentUsername",e.currentUsername)}}function dy(o,t){o&1&&(s(0,"div",19)(1,"div",30)(2,"div",31),p(3,"\u{1F4CE}"),l(),s(4,"div",32),p(5,"Drop files here to upload"),l(),s(6,"div",33),p(7,"Images will be added to conversation, other files to exchange space"),l()()())}var bl=class o{projectName;threadId;chatFocused=new H;drawerStateChange=new H;destroy$=new R;connectionDestroy$=new R;inputSection;messages=[];streamingText="";isThinking=!1;currentChoice=null;connectionStatus=null;isConnected=!1;showConnectionStatus=!1;hasEverConnected=!1;inputSectionHeight=80;uploadStatus={message:"",isError:!1};isDragOver=!1;drawerMode="none";get isDrawerOpen(){return this.drawerMode!=="none"}threadDetails=null;threadShareRef;get fileCount(){return this.fileExchangeState.fileCount()}currentUsername="";authEnabled=!1;pendingFirstMessage=null;subscriptions=[];codayService=m(Xt);oauthService=m(Hn);pendingOAuthRequest=rt(this.oauthService.pendingRequest$,{initialValue:null});preferencesService=m(at);titleService=m(yr);elementRef=m(ne);threadState=m(At);userService=m(Xi);router=m(Fi);imageUploadService=m(_l);fileExchangeState=m(pr);firstMessageState=m(Cr);ngOnInit(){if(console.log("[THREAD] Initializing with project:",this.projectName,"thread:",this.threadId),!this.projectName||!this.threadId){console.error("[THREAD] Missing required inputs: projectName or threadId");return}this.setupPrintHandlers(),this.userService.authEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.authEnabled=t}),this.userService.username$.pipe(N(this.destroy$)).subscribe(t=>{this.currentUsername=t??"",this.messages.length>0&&(this.messages=[...this.messages])}),this.initializeThreadConnection()}ngOnChanges(t){console.log("[THREAD] ngOnChanges called",t),t.threadId&&(console.log("[THREAD] threadId changed:",{firstChange:t.threadId.firstChange,previousValue:t.threadId.previousValue,currentValue:t.threadId.currentValue}),t.threadId.firstChange||(console.log("[THREAD] Reconnecting to new thread"),this.initializeThreadConnection()))}initializeThreadConnection(){console.log("[THREAD] Initializing connection for thread:",this.threadId),this.fileExchangeState.initializeForThread(this.projectName,this.threadId),this.connectionDestroy$.next(),this.codayService.messages$.pipe(N(this.connectionDestroy$)).subscribe(e=>{console.log("[THREAD] Messages updated:",e.length),this.messages=e}),this.codayService.streamingText$.pipe(N(this.connectionDestroy$)).subscribe(e=>{this.streamingText=e}),this.codayService.isThinking$.pipe(N(this.connectionDestroy$)).subscribe(e=>{this.isThinking=e}),this.codayService.currentChoice$.pipe(N(this.connectionDestroy$)).subscribe(e=>{this.currentChoice=e}),this.codayService.connectionStatus$.pipe(N(this.connectionDestroy$)).subscribe(e=>{this.connectionStatus=e,this.isConnected=e.connected,e.connected&&!this.hasEverConnected&&(this.hasEverConnected=!0,this.showConnectionStatus=!0),!e.connected&&!this.hasEverConnected?setTimeout(()=>{!this.isConnected&&!this.hasEverConnected&&(this.showConnectionStatus=!0)},2e3):!e.connected&&this.hasEverConnected?this.showConnectionStatus=!0:e.connected&&(this.showConnectionStatus=!0)}),this.codayService.threadUpdateEvent$.pipe(N(this.connectionDestroy$)).subscribe(e=>{e&&(console.log("[THREAD] Thread update event received:",e),this.threadState.refreshThreadList())}),this.threadState.selectedThread$.pipe(N(this.connectionDestroy$)).subscribe(e=>{this.threadDetails=e}),this.codayService.resetMessages(),this.codayService.setTabTitleService(this.titleService),console.log("[THREAD] Connecting to thread event stream"),this.codayService.connectToThread(this.projectName,this.threadId);let t=this.firstMessageState.consumePendingFirstMessage();t?(console.log("[THREAD] First message pending:",t.substring(0,50)+"..."),this.pendingFirstMessage=t,this.codayService.setThinkingForPendingMessage(),this.subscribeToFirstInvite()):console.log("[THREAD] No first message found in state service")}ngAfterViewChecked(){if(this.inputSection?.nativeElement){let t=this.inputSection.nativeElement.offsetHeight;t!==this.inputSectionHeight&&t>0&&(this.inputSectionHeight=t)}}ngOnDestroy(){console.log("[THREAD] Destroying component"),this.connectionDestroy$.next(),this.connectionDestroy$.complete(),this.destroy$.next(),this.destroy$.complete(),this.fileExchangeState.clear(),this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[],window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}onMessageSubmitted(t){console.log("[THREAD] Sending message:",t),this.codayService.sendMessage(t)}onVoiceToggled(t){console.log("[VOICE] Recording:",t)}onChoiceSelected(t){console.log("[THREAD] Choice selected:",t),this.codayService.sendChoice(t)}onCopyMessage(t){console.log("[COPY] Message copied:",t.id)}onStopRequested(){this.threadState.stop()}onInputHeightChanged(t){console.log("[THREAD] Input height changed:",t),this.inputSectionHeight=t}onFilesPasted(t){console.log("[THREAD] File(s) pasted:",t.length);let e=this.imageUploadService.filterImageFiles(t),i=t.filter(n=>!n.type.startsWith("image/"));e.length&&this.uploadFilesSequentially(e,0),i.length&&this.uploadFilesToExchangeSpace(i),!e.length&&!i.length&&this.showUploadError("No supported files found")}emitDrawerState(){this.drawerStateChange.emit(this.isDrawerOpen)}toggleFileDrawer(){this.drawerMode=this.drawerMode==="files"?"none":"files",this.emitDrawerState()}toggleSharePanel(){this.drawerMode=this.drawerMode==="share"?"none":"share",this.emitDrawerState()}closeDrawer(){this.drawerMode="none",this.emitDrawerState()}onUserAdded(t){if(console.log("[THREAD] Adding user to thread:",t),!this.threadDetails)return;let e=this.threadDetails.users||[];if(e.some(n=>n.userId===t)){this.threadShareRef?.setError("User already has access to this thread");return}this.threadShareRef?.setAdding(!0);let i=[...e,{userId:t}];this.threadState.updateThreadUsers(this.threadId,i).pipe(N(this.destroy$)).subscribe({next:()=>{console.log("[THREAD] User added successfully"),this.threadShareRef?.setAdding(!1),this.threadState.refreshSelectedThread()},error:n=>{console.error("[THREAD] Error adding user:",n),this.threadShareRef?.setError(n?.error?.error||"Failed to add user")}})}onUserRemoved(t){if(console.log("[THREAD] Removing user from thread:",t),!this.threadDetails)return;let e=t===this.currentUsername,i=(this.threadDetails.users||[]).filter(n=>n.userId!==t);this.threadState.updateThreadUsers(this.threadId,i).pipe(N(this.destroy$)).subscribe({next:()=>{console.log("[THREAD] User removed successfully"),e?(this.threadState.clearSelection(),this.threadState.refreshThreadList(),this.router.navigate(["project",this.projectName])):this.threadState.refreshSelectedThread()},error:n=>{console.error("[THREAD] Error removing user:",n)}})}onDragEnter(t){t.preventDefault(),t.dataTransfer?.types.includes("Files")&&(console.log("[THREAD] Image files detected - showing drag overlay"),this.isDragOver=!0)}onDragOver(t){t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy")}onDragLeave(t){this.elementRef.nativeElement.contains(t.relatedTarget)||(console.log("[THREAD] Leaving component area - hiding drag overlay"),this.isDragOver=!1)}onDrop(t){t.preventDefault(),this.isDragOver=!1,console.log("[THREAD] Files dropped:",t.dataTransfer?.files?.length||0);let e=t.dataTransfer?.files;if(!e||e.length===0){console.log("[THREAD] No files in drop event");return}let i=this.imageUploadService.filterImageFiles(e),n=Array.from(e).filter(r=>!r.type.startsWith("image/"));console.log("[THREAD] Image files:",i.length,"Other files:",n.length),i.length>0&&this.uploadFilesSequentially(i,0),n.length>0&&this.uploadFilesToExchangeSpace(n),i.length===0&&n.length===0&&this.showUploadError("No supported files found")}uploadFilesSequentially(t,e){if(e>=t.length)return;let i=t[e];if(!i){console.error("[THREAD] File at index",e,"is undefined");return}console.log("[THREAD] Uploading file:",i.name),this.uploadStatus={message:`Uploading ${i.name}...`,isError:!1},this.imageUploadService.uploadImage(i,this.projectName,this.threadId).subscribe({next:n=>{n.success?(console.log("[THREAD] Upload successful:",i.name),this.uploadStatus={message:`\u2713 ${i.name} uploaded (${(n.processedSize/1024).toFixed(1)} KB)`,isError:!1},setTimeout(()=>{this.uploadStatus.isError||(this.uploadStatus={message:"",isError:!1})},3e3),this.uploadFilesSequentially(t,e+1)):(console.error("[THREAD] Upload failed:",i.name,n.error),this.showUploadError(`Failed to upload ${i.name}: ${n.error}`))},error:n=>{console.error("[THREAD] Upload error:",i.name,n),this.showUploadError(`Failed to upload ${i.name}: ${n.message||"Unknown error"}`)}})}showUploadError(t){this.uploadStatus={message:t,isError:!0},setTimeout(()=>{this.uploadStatus={message:"",isError:!1}},5e3)}uploadFilesToExchangeSpace(t){return te(this,null,function*(){for(let e of t){console.log("[THREAD] Uploading to exchange space:",e.name),this.uploadStatus={message:`Uploading ${e.name}...`,isError:!1};let i=yield this.fileExchangeState.uploadFile(e);if(i.success)console.log("[THREAD] Upload to exchange space successful:",e.name),this.uploadStatus={message:`\u2713 ${e.name} uploaded to exchange space`,isError:!1},setTimeout(()=>{this.uploadStatus.isError||(this.uploadStatus={message:"",isError:!1})},3e3);else{console.error("[THREAD] Upload to exchange space failed:",e.name,i.error),this.showUploadError(`Failed to upload ${e.name}: ${i.error}`);break}}})}subscribeToFirstInvite(){console.log("[THREAD] Subscribing to wait for InviteEvent"),this.subscriptions.push(this.codayService.currentInviteEvent$.subscribe(t=>{if(t&&this.pendingFirstMessage){console.log("[THREAD] Received InviteEvent, sending pending message");let e=this.pendingFirstMessage;this.pendingFirstMessage=null,this.codayService.sendMessage(e)}}))}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let t=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",t),t?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical")};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical")};static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-thread"]],viewQuery:function(e,i){if(e&1&&(X(Jv,5),X(pa,5)),e&2){let n;U(n=W())&&(i.inputSection=n.first),U(n=W())&&(i.threadShareRef=n.first)}},inputs:{projectName:"projectName",threadId:"threadId"},outputs:{chatFocused:"chatFocused",drawerStateChange:"drawerStateChange"},features:[nt],decls:22,vars:16,consts:[["inputSection",""],[1,"drag-drop-wrapper",3,"dragenter","dragover","dragleave","drop"],[1,"file-drawer-container",3,"hasBackdrop"],[1,"thread-container"],["matFab","","type","button",1,"file-drawer-toggle-btn",3,"has-files","matBadge","title"],["matFab","","title","Share thread","type","button",1,"share-toggle-btn",3,"has-shared-users"],[1,"connection-status"],[1,"chat-wrapper",3,"mousedown","touchstart"],[1,"chat-center"],[3,"copyRequested","stopRequested","messages","streamingText","isThinking","currentUsername"],[1,"upload-status",3,"error"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"],[1,"choice-overlay",3,"options","labelHtml","isVisible","allowFreeText"],["mode","side","position","end",3,"closed","opened"],[3,"projectName","threadId"],[1,"share-drawer-container"],[1,"drag-overlay"],["matFab","","type","button",1,"file-drawer-toggle-btn",3,"click","matBadge","title"],["matFab","","title","Share thread","type","button",1,"share-toggle-btn",3,"click"],[1,"upload-status"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","stopRequested","filesPasted","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"],[1,"choice-overlay",3,"choiceSelected","options","labelHtml","isVisible","allowFreeText"],[3,"closeDrawer","projectName","threadId"],[1,"drawer-header"],[1,"drawer-title"],["mat-icon-button","","title","Close","type","button",1,"close-btn",3,"click"],[3,"userAdded","userRemoved","threadId","users","currentUsername"],[1,"drag-overlay-content"],[1,"drag-icon"],[1,"drag-text"],[1,"drag-hint"]],template:function(e,i){if(e&1){let n=k();s(0,"div",1),f("dragenter",function(a){return b(n),v(i.onDragEnter(a))})("dragover",function(a){return b(n),v(i.onDragOver(a))})("dragleave",function(a){return b(n),v(i.onDragLeave(a))})("drop",function(a){return b(n),v(i.onDrop(a))}),s(1,"mat-drawer-container",2)(2,"mat-drawer-content")(3,"div",3),C(4,ty,3,5,"button",4),C(5,iy,3,2,"button",5),C(6,ny,2,2,"div",6),s(7,"div",7),f("mousedown",function(){return b(n),v(i.chatFocused.emit())})("touchstart",function(){return b(n),v(i.chatFocused.emit())}),s(8,"div",8)(9,"app-chat-history",9),f("copyRequested",function(a){return b(n),v(i.onCopyMessage(a))})("stopRequested",function(){return b(n),v(i.onStopRequested())}),l(),C(10,oy,2,3,"div",10),l()(),s(11,"div",11,0)(13,"div",12)(14,"div",13),C(15,ry,1,5,"app-chat-textarea",14),C(16,ay,1,4,"app-choice-select",15),C(17,sy,1,0,"app-oauth-request-panel"),l()()()()(),s(18,"mat-drawer",16),f("closed",function(){return b(n),v(i.closeDrawer())}),C(19,ly,1,2,"app-file-exchange-drawer",17),C(20,cy,8,4,"div",18),l()(),C(21,dy,8,0,"div",19),l()}e&2&&(d(),w("hasBackdrop",!1),d(3),x(i.drawerMode!=="files"?4:-1),d(),x(i.authEnabled&&i.drawerMode!=="share"?5:-1),d(),x(i.showConnectionStatus&&i.connectionStatus&&!i.connectionStatus.connected?6:-1),d(3),w("messages",i.messages)("streamingText",i.streamingText)("isThinking",i.isThinking)("currentUsername",i.currentUsername),d(),x(i.uploadStatus.message?10:-1),d(5),x(!i.currentChoice&&!i.pendingOAuthRequest()?15:-1),d(),x(i.currentChoice?16:-1),d(),x(i.pendingOAuthRequest()?17:-1),d(),w("opened",i.isDrawerOpen),d(),x(i.drawerMode==="files"?19:-1),d(),x(i.drawerMode==="share"&&i.threadDetails?20:-1),d(),x(i.isDragOver?21:-1))},dependencies:[tl,ar,Jo,il,ml,pa,fl,ha,ua,vr,Me,he,ot,Ke,Xa,Wu,Uu],styles:[".drag-drop-wrapper[_ngcontent-%COMP%]{height:100vh;height:100dvh;width:100%;position:relative}.thread-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;width:100%;position:relative;background:transparent}.file-drawer-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:1rem!important;right:1rem!important;z-index:100!important}.file-drawer-toggle-btn.has-files[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_pulse-subtle 3s infinite}@media (max-width: 768px){.file-drawer-toggle-btn[_ngcontent-%COMP%]{width:40px!important;height:40px!important;top:.75rem!important;right:.75rem!important}.file-drawer-toggle-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}}.share-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:5rem!important;right:1rem!important;z-index:100!important}.share-toggle-btn.has-shared-users[_ngcontent-%COMP%]{color:var(--color-primary)!important}@media (max-width: 768px){.share-toggle-btn[_ngcontent-%COMP%]{width:40px!important;height:40px!important;top:calc(1.25rem + 40px)!important;right:.75rem!important}.share-toggle-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}}.share-drawer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;flex:1;min-height:0;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);color:var(--color-text)}.share-drawer-container[_ngcontent-%COMP%] .drawer-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;padding-top:calc(1rem + env(safe-area-inset-top,0px));border-bottom:1px solid var(--color-border);flex-shrink:0}.share-drawer-container[_ngcontent-%COMP%] .drawer-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text)}.share-drawer-container[_ngcontent-%COMP%] .close-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.share-drawer-container[_ngcontent-%COMP%] .close-btn[_ngcontent-%COMP%]:hover{color:var(--color-text);background:var(--color-bg-hover)}@keyframes _ngcontent-%COMP%_pulse-subtle{0%,to{box-shadow:0 2px 8px #00000026}50%{box-shadow:0 4px 16px rgba(var(--color-primary-rgb, 25, 118, 210),.3)}}.file-drawer-container[_ngcontent-%COMP%]{height:100vh;height:100dvh;width:100%;background:var(--color-bg)}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer-content{display:flex;flex-direction:column;height:100%;overflow:hidden;background:transparent}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:35vw;max-width:90vw;box-shadow:-2px 0 8px #0000001a}@media (max-width: 768px){.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:100vw;max-width:100vw;padding-bottom:env(safe-area-inset-bottom,0px)}}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer-backdrop{display:none}.connection-status[_ngcontent-%COMP%]{position:fixed;top:0;left:0;right:0;z-index:1000;background:var(--color-warning);color:var(--color-text);padding:.5rem 1rem;text-align:center;font-size:.9rem;box-shadow:0 2px 4px #0000001a}.chat-wrapper[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;width:100%;padding:1rem 0}.chat-center[_ngcontent-%COMP%]{max-width:800px;width:100%;margin:0 auto;padding:0 2rem;display:flex;flex-direction:column;gap:1rem}@media (max-width: 768px){.chat-center[_ngcontent-%COMP%]{padding:0 1rem}}.input-section[_ngcontent-%COMP%]{width:100%;padding:1rem 0;padding-bottom:calc(1rem + env(safe-area-inset-bottom,0px));background:transparent;position:relative}.input-center[_ngcontent-%COMP%]{max-width:800px;width:100%;margin:0 auto;padding:0 2rem}@media (max-width: 768px){.input-center[_ngcontent-%COMP%]{padding:0 1rem}}.choice-overlay[_ngcontent-%COMP%]{display:block;width:100%}.upload-status[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:8px;background:var(--color-success-light);color:var(--color-text);font-size:.9rem;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:var(--color-error-light)}@media print{.file-drawer-toggle-btn[_ngcontent-%COMP%], .share-toggle-btn[_ngcontent-%COMP%], .connection-status[_ngcontent-%COMP%]{display:none}.thread-container[_ngcontent-%COMP%]{background:#fff}.input-section[_ngcontent-%COMP%]{display:none}}"]})};var $u=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({imports:[ce,ce]})}return o})();var qu=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({imports:[ce]})}return o})();var Ki=class o{http=m(Xe);getUserConfig(){return this.http.get("/api/config/user").pipe(yt(t=>console.log("[CONFIG-API] User config retrieved:",t)))}updateUserConfig(t){return this.http.put("/api/config/user",t).pipe(yt(e=>console.log("[CONFIG-API] User config updated:",e)))}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var xr=class o{currentThemeSubject=new ae("light");currentTheme$=this.currentThemeSubject.asObservable();preferences=m(at);constructor(){console.log("[THEME] Initializing theme service"),this.initializeTheme(),this.setupSystemThemeListener()}initializeTheme(){let t=this.preferences.getPreference("theme","light")??"light";console.log("[THEME] Loaded saved theme:",t),this.applyTheme(t),setTimeout(()=>{let e=this.preferences.getPreference("theme","light")??"light";e!==t&&(console.log("[THEME] Theme updated after async load:",e),this.applyTheme(e))},100)}setTheme(t){this.preferences.setPreference("theme",t),this.applyTheme(t)}getCurrentTheme(){return this.currentThemeSubject.value}applyTheme(t){if(console.log("[THEME] Applying theme:",t),this.currentThemeSubject.next(t),t==="system")if(typeof window<"u"&&window.matchMedia){let i=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";console.log("[THEME] System theme resolved to:",i),this.setDocumentTheme(i)}else console.log("[THEME] matchMedia not available, defaulting to light theme"),this.setDocumentTheme("light");else this.setDocumentTheme(t)}setDocumentTheme(t){console.log("[THEME] Setting document theme to:",t),typeof document<"u"&&document.documentElement&&(t==="dark"?document.documentElement.setAttribute("data-theme","dark"):document.documentElement.removeAttribute("data-theme"))}setupSystemThemeListener(){typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{this.getCurrentTheme()==="system"&&this.setDocumentTheme(t.matches?"dark":"light")})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var my=["mat-internal-form-field",""],py=["*"],vl=(()=>{class o{labelPosition;static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["div","mat-internal-form-field",""]],hostAttrs:[1,"mdc-form-field","mat-internal-form-field"],hostVars:2,hostBindings:function(i,n){i&2&&E("mdc-form-field--align-end",n.labelPosition==="before")},inputs:{labelPosition:"labelPosition"},attrs:my,ngContentSelectors:py,decls:1,vars:0,template:function(i,n){i&1&&(We(),ue(0))},styles:[`.mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}
367
367
  `],encapsulation:2,changeDetection:0})}return o})();var hy=["switch"],uy=["*"];function gy(o,t){o&1&&(s(0,"span",11),nn(),s(1,"svg",13),I(2,"path",14),l(),s(3,"svg",15),I(4,"path",16),l()())}var fy=new oe("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),yl=class{source;checked;constructor(t,e){this.source=t,this.checked=e}},bo=(()=>{class o{_elementRef=m(ne);_focusMonitor=m(Ni);_changeDetectorRef=m(Qe);defaults=m(fy);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(e){return new yl(this,e)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations=$e();_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;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 H;toggleChange=new H;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){m(Nt).load(In);let e=m(new Pn("tabindex"),{optional:!0}),i=this.defaults;this.tabIndex=e==null?0:parseInt(e)||0,this.color=i.color||"accent",this.id=this._uniqueId=m(Ne).getId("mat-mdc-slide-toggle-"),this.hideIcon=i.hideIcon??!1,this.disabledInteractive=i.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 yl(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-slide-toggle"]],viewQuery:function(i,n){if(i&1&&X(hy,5),i&2){let r;U(r=W())&&(n._switchElement=r.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,n){i&2&&(Jt("id",n.id),J("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),on(n.color?"mat-"+n.color:""),E("mat-mdc-slide-toggle-focused",n._focused)("mat-mdc-slide-toggle-checked",n.checked)("_mat-animation-noopable",n._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",ee],color:"color",disabled:[2,"disabled","disabled",ee],disableRipple:[2,"disableRipple","disableRipple",ee],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:gi(e)],checked:[2,"checked","checked",ee],hideIcon:[2,"hideIcon","hideIcon",ee],disabledInteractive:[2,"disabledInteractive","disabledInteractive",ee]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[Ye([{provide:zo,useExisting:Xn(()=>o),multi:!0},{provide:Ka,useExisting:o,multi:!0}]),nt],ngContentSelectors:uy,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(i,n){if(i&1){let r=k();We(),s(0,"div",1)(1,"button",2,0),f("click",function(){return b(r),v(n._handleClick())}),I(3,"div",3)(4,"span",4),s(5,"span",5)(6,"span",6)(7,"span",7),I(8,"span",8),l(),s(9,"span",9),I(10,"span",10),l(),C(11,gy,5,0,"span",11),l()()(),s(12,"label",12),f("click",function(c){return b(r),v(c.stopPropagation())}),ue(13),l()()}if(i&2){let r=Et(2);w("labelPosition",n.labelPosition),d(),E("mdc-switch--selected",n.checked)("mdc-switch--unselected",!n.checked)("mdc-switch--checked",n.checked)("mdc-switch--disabled",n.disabled)("mat-mdc-slide-toggle-disabled-interactive",n.disabledInteractive),w("tabIndex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("disabled",n.disabled&&!n.disabledInteractive),J("id",n.buttonId)("name",n.name)("aria-label",n.ariaLabel)("aria-labelledby",n._getAriaLabelledBy())("aria-describedby",n.ariaDescribedby)("aria-required",n.required||null)("aria-checked",n.checked)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),d(9),w("matRippleTrigger",r)("matRippleDisabled",n.disableRipple||n.disabled)("matRippleCentered",!0),d(),x(n.hideIcon?-1:11),d(),w("for",n.buttonId),J("id",n._labelId)}},dependencies:[An,vl],styles:[`.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mat-slide-toggle-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mat-slide-toggle-track-height, 32px);border-radius:var(--mat-slide-toggle-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mat-slide-toggle-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-slide-toggle-track-outline-width, 2px);border-color:var(--mat-slide-toggle-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-slide-toggle-selected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-slide-toggle-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mat-slide-toggle-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mat-slide-toggle-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mat-slide-toggle-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mat-slide-toggle-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mat-slide-toggle-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mat-slide-toggle-handle-width);height:var(--mat-slide-toggle-handle-height);border-radius:var(--mat-slide-toggle-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-slide-toggle-unselected-handle-size, 16px);height:var(--mat-slide-toggle-unselected-handle-size, 16px);margin:var(--mat-slide-toggle-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-slide-toggle-selected-handle-size, 24px);height:var(--mat-slide-toggle-selected-handle-size, 24px);margin:var(--mat-slide-toggle-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-slide-toggle-with-icon-handle-size, 24px);height:var(--mat-slide-toggle-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-slide-toggle-pressed-handle-size, 28px);height:var(--mat-slide-toggle-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mat-slide-toggle-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mat-slide-toggle-state-layer-size, 40px);height:var(--mat-slide-toggle-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-hover-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-focus-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-hover-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-focus-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1;transform:translateZ(0)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mat-slide-toggle-unselected-icon-size, 16px);height:var(--mat-slide-toggle-unselected-icon-size, 16px);fill:var(--mat-slide-toggle-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mat-slide-toggle-selected-icon-size, 16px);height:var(--mat-slide-toggle-selected-icon-size, 16px);fill:var(--mat-slide-toggle-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-slide-toggle-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-slide-toggle-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-slide-toggle-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-slide-toggle-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-slide-toggle-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-slide-toggle-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mat-slide-toggle-disabled-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-slide-toggle-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%)}
368
- `],encapsulation:2,changeDetection:0})}return o})(),Cl=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({imports:[bo,le,le]})}return o})();var _y=(o,t)=>t.code,by=(o,t)=>t.name+t.lang;function vy(o,t){o&1&&(s(0,"div",15)(1,"mat-icon",32),p(2,"warning"),l(),s(3,"span",33),p(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),l()())}function yy(o,t){if(o&1&&(s(0,"option",18),p(1),l()),o&2){let e=t.$implicit;w("value",e.code),d(),Tn("",e.flag," ",e.label)}}function Cy(o,t){o&1&&(s(0,"option",25),p(1,"Loading voices..."),l())}function xy(o,t){o&1&&(s(0,"option",25),p(1,"No voice available"),l())}function wy(o,t){if(o&1&&(s(0,"option",18),p(1),l()),o&2){let e=t.$implicit;w("value",e.name+"|"+e.lang),d(),ie(" ",e.displayName," ")}}var ga=class o{destroy$=new R;selectedTheme="light";selectedVoiceLanguage="en-US";useEnterToSend=!1;printTechnicalMessages=!1;showTechnicalMessages=!0;showWarningMessages=!0;voiceAnnounceEnabled=!1;voiceMode="speech";voiceReadFullText=!1;voiceVolume=80;voiceRate=120;agentNotificationEnabled=!1;notificationSoundEnabled=!0;browserNotificationEnabled=!1;browserNotificationDenied=!1;availableVoices=[];selectedVoiceId=null;loadingVoices=!1;voiceLanguageOptions=[{code:"fr-FR",label:"Fran\xE7ais",flag:"\u{1F1EB}\u{1F1F7}"},{code:"en-US",label:"English (US)",flag:"\u{1F1FA}\u{1F1F8}"},{code:"en-GB",label:"English (UK)",flag:"\u{1F1EC}\u{1F1E7}"},{code:"es-ES",label:"Espa\xF1ol",flag:"\u{1F1EA}\u{1F1F8}"},{code:"de-DE",label:"Deutsch",flag:"\u{1F1E9}\u{1F1EA}"},{code:"it-IT",label:"Italiano",flag:"\u{1F1EE}\u{1F1F9}"},{code:"pt-BR",label:"Portugu\xEAs",flag:"\u{1F1E7}\u{1F1F7}"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",flag:"\u{1F1EF}\u{1F1F5}"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",flag:"\u{1F1F0}\u{1F1F7}"},{code:"zh-CN",label:"\u4E2D\u6587 (\u7B80\u4F53)",flag:"\u{1F1E8}\u{1F1F3}"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",flag:"\u{1F1F7}\u{1F1FA}"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",flag:"\u{1F1F8}\u{1F1E6}"}];preferencesService=m(at);voiceSynthesisService=m(mr);themeService=m(xr);ngOnInit(){this.selectedTheme=this.themeService.getCurrentTheme(),this.selectedVoiceLanguage=this.preferencesService.getVoiceLanguage(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.printTechnicalMessages=this.preferencesService.getPrintTechnicalMessages(),this.showTechnicalMessages=!this.preferencesService.getHideTechnicalMessages(),this.showWarningMessages=!this.preferencesService.getHideWarningMessages(),this.voiceAnnounceEnabled=this.preferencesService.getVoiceAnnounceEnabled(),this.voiceMode=this.preferencesService.getVoiceMode(),this.voiceReadFullText=this.preferencesService.getVoiceReadFullText(),this.voiceVolume=Math.round(this.preferencesService.getVoiceVolume()*100),this.voiceRate=Math.round(this.preferencesService.getVoiceRate()*100),this.selectedVoiceId=this.preferencesService.getSelectedVoice(),this.agentNotificationEnabled=this.preferencesService.getAgentNotificationEnabled(),this.notificationSoundEnabled=this.preferencesService.getNotificationSoundEnabled(),this.browserNotificationEnabled=this.preferencesService.getBrowserNotificationEnabled(),this.loadAvailableVoices(),this.themeService.currentTheme$.pipe(N(this.destroy$)).subscribe(t=>{this.selectedTheme=t}),this.preferencesService.voiceLanguage$.pipe(N(this.destroy$)).subscribe(t=>{this.selectedVoiceLanguage=t}),this.preferencesService.enterToSend$.pipe(N(this.destroy$)).subscribe(t=>{this.useEnterToSend=t}),this.preferencesService.printTechnicalMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.printTechnicalMessages=t}),this.preferencesService.hideTechnicalMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.showTechnicalMessages=!t}),this.preferencesService.hideWarningMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.showWarningMessages=!t}),this.preferencesService.voiceAnnounceEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceAnnounceEnabled=t}),this.preferencesService.voiceMode$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceMode=t}),this.preferencesService.voiceReadFullText$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceReadFullText=t}),this.preferencesService.voiceVolume$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceVolume=Math.round(t*100)}),this.preferencesService.voiceRate$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceRate=Math.round(t*100)}),this.preferencesService.selectedVoice$.pipe(N(this.destroy$)).subscribe(t=>{this.selectedVoiceId=t}),this.preferencesService.voiceLanguage$.pipe(N(this.destroy$)).subscribe(()=>{this.loadAvailableVoices()}),this.preferencesService.agentNotificationEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.agentNotificationEnabled=t}),this.preferencesService.notificationSoundEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.notificationSoundEnabled=t}),this.preferencesService.browserNotificationEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.browserNotificationEnabled=t,this.checkNotificationPermission()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onThemeChange(){console.log("[OPTIONS] Theme changed to:",this.selectedTheme),this.themeService.setTheme(this.selectedTheme)}onVoiceLanguageChange(){console.log("[OPTIONS] Voice language changed to:",this.selectedVoiceLanguage),this.preferencesService.setVoiceLanguage(this.selectedVoiceLanguage)}onEnterToSendChange(){console.log("[OPTIONS] Enter to send changed to:",this.useEnterToSend),this.preferencesService.setEnterToSend(this.useEnterToSend)}onPrintTechnicalMessagesChange(){console.log("[OPTIONS] Print technical messages changed to:",this.printTechnicalMessages),this.preferencesService.setPrintTechnicalMessages(this.printTechnicalMessages)}onShowTechnicalMessagesChange(){let t=!this.showTechnicalMessages;console.log("[OPTIONS] Show technical messages changed to:",this.showTechnicalMessages,"(hide:",t,")"),this.preferencesService.setHideTechnicalMessages(t)}onShowWarningMessagesChange(){let t=!this.showWarningMessages;console.log("[OPTIONS] Show warning messages changed to:",this.showWarningMessages,"(hide:",t,")"),this.preferencesService.setHideWarningMessages(t)}onVoiceAnnounceEnabledChange(){console.log("[OPTIONS] Voice announce enabled changed to:",this.voiceAnnounceEnabled),this.preferencesService.setVoiceAnnounceEnabled(this.voiceAnnounceEnabled)}onVoiceModeChange(){console.log("[OPTIONS] Voice mode changed to:",this.voiceMode),this.preferencesService.setVoiceMode(this.voiceMode)}onVoiceReadFullTextChange(){console.log("[OPTIONS] Voice read full text changed to:",this.voiceReadFullText),this.preferencesService.setVoiceReadFullText(this.voiceReadFullText)}onVoiceVolumeChange(){let t=this.voiceVolume/100;console.log("[OPTIONS] Voice volume changed to:",t),this.preferencesService.setVoiceVolume(t)}onVoiceRateChange(){let t=this.voiceRate/100;console.log("[OPTIONS] Voice rate changed to:",t),this.preferencesService.setVoiceRate(t)}loadAvailableVoices(){return te(this,null,function*(){this.loadingVoices=!0;try{this.availableVoices=yield this.voiceSynthesisService.getVoicesForLanguage(),console.log("[OPTIONS] Loaded",this.availableVoices.length,"voices for current language")}catch(t){console.error("[OPTIONS] Error loading voices:",t),this.availableVoices=[]}finally{this.loadingVoices=!1}})}onSelectedVoiceChange(){console.log("[OPTIONS] Selected voice changed to:",this.selectedVoiceId),this.preferencesService.setSelectedVoice(this.selectedVoiceId)}testVoice(){console.log("[OPTIONS] Testing voice with current settings"),this.voiceSynthesisService.testSelectedVoice()}onAgentNotificationEnabledChange(){console.log("[OPTIONS] Agent notification enabled changed to:",this.agentNotificationEnabled),this.preferencesService.setAgentNotificationEnabled(this.agentNotificationEnabled)}onNotificationSoundEnabledChange(){console.log("[OPTIONS] Notification sound enabled changed to:",this.notificationSoundEnabled),this.preferencesService.setNotificationSoundEnabled(this.notificationSoundEnabled)}onBrowserNotificationEnabledChange(){console.log("[OPTIONS] Browser notification enabled changed to:",this.browserNotificationEnabled),this.preferencesService.setBrowserNotificationEnabled(this.browserNotificationEnabled)}checkNotificationPermission(){"Notification"in window&&(this.browserNotificationDenied=Notification.permission==="denied",console.log("[OPTIONS] Notification permission status:",Notification.permission))}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-options-panel"]],decls:144,vars:35,consts:[[1,"options-content"],[1,"option-section"],[1,"section-title"],[1,"option-group"],[1,"radio-group"],[1,"option-radio"],["type","radio","name","theme","value","light",3,"ngModelChange","change","ngModel"],[1,"radio-mark"],["type","radio","name","theme","value","dark",3,"ngModelChange","change","ngModel"],["type","radio","name","theme","value","system",3,"ngModelChange","change","ngModel"],[1,"option-label"],["type","radio","name","enterBehavior",3,"ngModelChange","change","value","ngModel"],[1,"toggle-option"],["color","primary",3,"ngModelChange","change","ngModel"],["color","primary",3,"ngModelChange","change","ngModel","disabled"],[1,"notification-error"],["for","voice-language-select",1,"option-label"],["id","voice-language-select",1,"option-select",3,"ngModelChange","change","ngModel"],[3,"value"],["type","radio","name","voiceAnnounce",3,"ngModelChange","change","value","ngModel"],["type","radio","name","voiceMode","value","speech",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceMode","value","notification",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceReadFull",3,"ngModelChange","change","value","ngModel"],["for","voice-select",1,"option-label"],["id","voice-select",1,"option-select",3,"ngModelChange","change","ngModel","disabled"],["value",""],["role","button","tabindex","0","title","Test voice with current settings",1,"test-voice-link",3,"click"],[1,"thread-name"],["for","voice-volume-slider",1,"option-label"],["id","voice-volume-slider","type","range","min","0","max","100","step","5",1,"option-slider",3,"ngModelChange","input","ngModel"],["for","voice-rate-slider",1,"option-label"],["id","voice-rate-slider","type","range","min","50","max","200","step","10",1,"option-slider",3,"ngModelChange","input","ngModel"],[1,"error-icon"],[1,"error-message"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),p(4,"palette"),l(),s(5,"span"),p(6,"Appearance"),l()(),s(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),j("ngModelChange",function(r){return z(i.selectedTheme,r)||(i.selectedTheme=r),r}),f("change",function(){return i.onThemeChange()}),l(),I(11,"span",7),p(12," Light "),l(),s(13,"label",5)(14,"input",8),j("ngModelChange",function(r){return z(i.selectedTheme,r)||(i.selectedTheme=r),r}),f("change",function(){return i.onThemeChange()}),l(),I(15,"span",7),p(16," Dark "),l(),s(17,"label",5)(18,"input",9),j("ngModelChange",function(r){return z(i.selectedTheme,r)||(i.selectedTheme=r),r}),f("change",function(){return i.onThemeChange()}),l(),I(19,"span",7),p(20," System "),l()()()(),s(21,"div",1)(22,"div",2)(23,"mat-icon"),p(24,"chat_bubble_outline"),l(),s(25,"span"),p(26,"Messaging"),l()(),s(27,"div",3)(28,"span",10),p(29,"Send message behavior:"),l(),s(30,"div",4)(31,"label",5)(32,"input",11),j("ngModelChange",function(r){return z(i.useEnterToSend,r)||(i.useEnterToSend=r),r}),f("change",function(){return i.onEnterToSendChange()}),l(),I(33,"span",7),p(34," Enter to send "),l(),s(35,"label",5)(36,"input",11),j("ngModelChange",function(r){return z(i.useEnterToSend,r)||(i.useEnterToSend=r),r}),f("change",function(){return i.onEnterToSendChange()}),l(),I(37,"span",7),p(38," Enter for new line "),l()()(),s(39,"div",3)(40,"div",12)(41,"span",10),p(42,"Show technical messages"),l(),s(43,"mat-slide-toggle",13),j("ngModelChange",function(r){return z(i.showTechnicalMessages,r)||(i.showTechnicalMessages=r),r}),f("change",function(){return i.onShowTechnicalMessagesChange()}),l()()(),s(44,"div",3)(45,"div",12)(46,"span",10),p(47,"Show warning messages"),l(),s(48,"mat-slide-toggle",13),j("ngModelChange",function(r){return z(i.showWarningMessages,r)||(i.showWarningMessages=r),r}),f("change",function(){return i.onShowWarningMessagesChange()}),l()()(),s(49,"div",3)(50,"div",12)(51,"span",10),p(52,"Include technical messages in print"),l(),s(53,"mat-slide-toggle",13),j("ngModelChange",function(r){return z(i.printTechnicalMessages,r)||(i.printTechnicalMessages=r),r}),f("change",function(){return i.onPrintTechnicalMessagesChange()}),l()()()(),s(54,"div",1)(55,"div",2)(56,"mat-icon"),p(57,"notifications"),l(),s(58,"span"),p(59,"Notifications"),l()(),s(60,"div",3)(61,"div",12)(62,"span",10),p(63,"Notify when the agent answers or requests input"),l(),s(64,"mat-slide-toggle",13),j("ngModelChange",function(r){return z(i.agentNotificationEnabled,r)||(i.agentNotificationEnabled=r),r}),f("change",function(){return i.onAgentNotificationEnabledChange()}),l()()(),s(65,"div",3)(66,"div",12)(67,"span",10),p(68,"Notification sound"),l(),s(69,"mat-slide-toggle",14),j("ngModelChange",function(r){return z(i.notificationSoundEnabled,r)||(i.notificationSoundEnabled=r),r}),f("change",function(){return i.onNotificationSoundEnabledChange()}),l()()(),s(70,"div",3)(71,"div",12)(72,"span",10),p(73,"Browser notification"),l(),s(74,"mat-slide-toggle",14),j("ngModelChange",function(r){return z(i.browserNotificationEnabled,r)||(i.browserNotificationEnabled=r),r}),f("change",function(){return i.onBrowserNotificationEnabledChange()}),l()(),C(75,vy,5,0,"div",15),l()(),s(76,"div",1)(77,"div",2)(78,"mat-icon"),p(79,"record_voice_over"),l(),s(80,"span"),p(81,"Voice & Speech"),l()(),s(82,"div",3)(83,"label",16),p(84,"Voice recognition language:"),l(),s(85,"select",17),j("ngModelChange",function(r){return z(i.selectedVoiceLanguage,r)||(i.selectedVoiceLanguage=r),r}),f("change",function(){return i.onVoiceLanguageChange()}),we(86,yy,2,3,"option",18,_y),l()(),s(88,"div",3)(89,"span",10),p(90,"Automatic announcement:"),l(),s(91,"div",4)(92,"label",5)(93,"input",19),j("ngModelChange",function(r){return z(i.voiceAnnounceEnabled,r)||(i.voiceAnnounceEnabled=r),r}),f("change",function(){return i.onVoiceAnnounceEnabledChange()}),l(),I(94,"span",7),p(95," Enabled "),l(),s(96,"label",5)(97,"input",19),j("ngModelChange",function(r){return z(i.voiceAnnounceEnabled,r)||(i.voiceAnnounceEnabled=r),r}),f("change",function(){return i.onVoiceAnnounceEnabledChange()}),l(),I(98,"span",7),p(99," Disabled "),l()()(),s(100,"div",3)(101,"span",10),p(102,"Voice mode:"),l(),s(103,"div",4)(104,"label",5)(105,"input",20),j("ngModelChange",function(r){return z(i.voiceMode,r)||(i.voiceMode=r),r}),f("change",function(){return i.onVoiceModeChange()}),l(),I(106,"span",7),p(107," Voice synthesis "),l(),s(108,"label",5)(109,"input",21),j("ngModelChange",function(r){return z(i.voiceMode,r)||(i.voiceMode=r),r}),f("change",function(){return i.onVoiceModeChange()}),l(),I(110,"span",7),p(111," Sound notification "),l()()(),s(112,"div",3)(113,"span",10),p(114,"Message reading:"),l(),s(115,"div",4)(116,"label",5)(117,"input",22),j("ngModelChange",function(r){return z(i.voiceReadFullText,r)||(i.voiceReadFullText=r),r}),f("change",function(){return i.onVoiceReadFullTextChange()}),l(),I(118,"span",7),p(119," Full message "),l(),s(120,"label",5)(121,"input",22),j("ngModelChange",function(r){return z(i.voiceReadFullText,r)||(i.voiceReadFullText=r),r}),f("change",function(){return i.onVoiceReadFullTextChange()}),l(),I(122,"span",7),p(123," First paragraphs only "),l()()(),s(124,"div",3)(125,"label",23),p(126,"Selected voice:"),l(),s(127,"select",24),j("ngModelChange",function(r){return z(i.selectedVoiceId,r)||(i.selectedVoiceId=r),r}),f("change",function(){return i.onSelectedVoiceChange()}),C(128,Cy,2,0,"option",25),C(129,xy,2,0,"option",25),we(130,wy,2,2,"option",18,by),l(),I(132,"div",10),s(133,"a",26),f("click",function(){return i.testVoice()}),s(134,"span",27),p(135,"Test voice"),l()()(),s(136,"div",3)(137,"label",28),p(138),l(),s(139,"input",29),j("ngModelChange",function(r){return z(i.voiceVolume,r)||(i.voiceVolume=r),r}),f("input",function(){return i.onVoiceVolumeChange()}),l()(),s(140,"div",3)(141,"label",30),p(142),l(),s(143,"input",31),j("ngModelChange",function(r){return z(i.voiceRate,r)||(i.voiceRate=r),r}),f("input",function(){return i.onVoiceRateChange()}),l()()()()),e&2&&(d(10),V("ngModel",i.selectedTheme),d(4),V("ngModel",i.selectedTheme),d(4),V("ngModel",i.selectedTheme),d(14),w("value",!0),V("ngModel",i.useEnterToSend),d(4),w("value",!1),V("ngModel",i.useEnterToSend),d(7),V("ngModel",i.showTechnicalMessages),d(5),V("ngModel",i.showWarningMessages),d(5),V("ngModel",i.printTechnicalMessages),d(11),V("ngModel",i.agentNotificationEnabled),d(5),V("ngModel",i.notificationSoundEnabled),w("disabled",!i.agentNotificationEnabled),d(5),V("ngModel",i.browserNotificationEnabled),w("disabled",!i.agentNotificationEnabled||i.browserNotificationDenied),d(),x(i.browserNotificationDenied?75:-1),d(10),V("ngModel",i.selectedVoiceLanguage),d(),Se(i.voiceLanguageOptions),d(7),w("value",!0),V("ngModel",i.voiceAnnounceEnabled),d(4),w("value",!1),V("ngModel",i.voiceAnnounceEnabled),d(8),V("ngModel",i.voiceMode),d(4),V("ngModel",i.voiceMode),d(8),w("value",!0),V("ngModel",i.voiceReadFullText),d(4),w("value",!1),V("ngModel",i.voiceReadFullText),d(6),V("ngModel",i.selectedVoiceId),w("disabled",i.loadingVoices||i.availableVoices.length===0),d(),x(i.loadingVoices?128:-1),d(),x(!i.loadingVoices&&i.availableVoices.length===0?129:-1),d(),Se(i.availableVoices),d(8),ie("Volume: ",i.voiceVolume,"%"),d(),V("ngModel",i.voiceVolume),d(3),ie("Speed: ",i.voiceRate,"%"),d(),V("ngModel",i.voiceRate))},dependencies:[Ue,ns,os,je,qm,Gm,jo,Be,He,he,bo],styles:['.options-content[_ngcontent-%COMP%]{padding:0;width:100%}.option-group[_ngcontent-%COMP%]{padding:0 1rem 1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border-light)}.option-group[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.option-label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;color:var(--color-text);font-size:.875rem}.toggle-option[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.toggle-option[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0;flex:1}.toggle-option[_ngcontent-%COMP%] mat-slide-toggle[_ngcontent-%COMP%]{flex-shrink:0}.option-select[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-input-bg);color:var(--color-text);font-size:.875rem;cursor:pointer}.option-select[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 3px #7064fb1a}.option-select[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.option-select[_ngcontent-%COMP%] option[_ngcontent-%COMP%]{padding:.5rem}.option-checkbox[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]{width:18px;height:18px;border:2px solid var(--color-border);border-radius:3px;margin-right:.75rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{content:"";width:10px;height:6px;border-left:2px solid transparent;border-bottom:2px solid transparent;transform:rotate(-45deg);transition:all .2s ease;opacity:0}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]{background-color:var(--color-primary);border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]:after{border-left-color:#fff;border-bottom-color:#fff;opacity:1}.option-checkbox[_ngcontent-%COMP%]:hover .checkmark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%]:focus-within .checkmark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-section[_ngcontent-%COMP%]{padding-top:1rem;margin-top:1rem;border-top:2px solid var(--color-border)}.option-section[_ngcontent-%COMP%]:first-child{border-top:none;padding-top:0;margin-top:0}.section-title[_ngcontent-%COMP%]{margin:0 0 1rem;padding:0 1rem;font-size:.9rem;font-weight:600;color:var(--color-text);display:flex;align-items:center;gap:.5rem}.section-title[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.option-radio[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{display:none}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid var(--color-border);border-radius:50%;margin-right:.5rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0;position:relative}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]:after{content:"";width:8px;height:8px;border-radius:50%;background-color:var(--color-primary);transition:all .2s ease;opacity:0;transform:scale(0)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]:after{opacity:1;transform:scale(1)}.option-radio[_ngcontent-%COMP%]:hover .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%]:focus-within .radio-mark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-slider[_ngcontent-%COMP%]{width:100%;height:6px;border-radius:3px;background:var(--color-bg-solid);outline:none;cursor:pointer;-webkit-appearance:none;appearance:none}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-webkit-slider-track{height:6px;border-radius:3px;background:var(--color-bg-secondary)}.option-slider[_ngcontent-%COMP%]::-moz-range-track{height:6px;border-radius:3px;background:var(--color-bg-secondary);border:none}.option-slider[_ngcontent-%COMP%]:focus{outline:none}.option-slider[_ngcontent-%COMP%]:focus::-webkit-slider-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.option-slider[_ngcontent-%COMP%]:focus::-moz-range-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.test-voice-btn[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;background:var(--color-primary);color:#fff;border:none;border-radius:6px;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;gap:.5rem}.test-voice-btn[_ngcontent-%COMP%]:hover{background:var(--color-primary-hover);transform:translateY(-1px);box-shadow:0 2px 8px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:active{transform:translateY(0);box-shadow:0 1px 4px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:focus{outline:none;box-shadow:0 0 0 3px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:disabled{background:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;transform:none;box-shadow:none}.test-voice-link[_ngcontent-%COMP%]{text-decoration-thickness:1.5px;text-underline-offset:3px;background:transparent;border:none;padding:0;font-size:.775rem;font-weight:400;cursor:pointer;transition:all .2s ease;display:inline-flex;align-items:center;justify-content:center;gap:.5rem;text-decoration:underline}.test-voice-link[_ngcontent-%COMP%]:hover{color:var(--color-primary-hover, var(--color-primary));text-decoration-thickness:2px}.test-voice-link[_ngcontent-%COMP%]:active{opacity:.8}.test-voice-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.test-voice-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.notification-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;padding:.75rem;margin-top:.75rem;background-color:#d32f2f1a;border:1px solid rgba(211,47,47,.3);border-radius:6px;font-size:.8125rem;line-height:1.5}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#d32f2f;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{color:var(--color-text);flex:1}.notification-error[_ngcontent-%COMP%]{margin-top:.75rem;padding:.75rem;background-color:#f443361a;border:1px solid rgba(244,67,54,.3);border-radius:6px;display:flex;align-items:flex-start;gap:.5rem}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#f44336;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text);line-height:1.5;flex:1}']})};var Sy=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(i,n){},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}
369
- `],encapsulation:2,changeDetection:0})}return o})(),ky={passive:!0},Yu=(()=>{class o{_platform=m(tt);_ngZone=m(pe);_renderer=m(hi).createRenderer(null,null);_styleLoader=m(Nt);_monitoredElements=new Map;constructor(){}monitor(e){if(!this._platform.isBrowser)return am;this._styleLoader.load(Sy);let i=Lr(e),n=this._monitoredElements.get(i);if(n)return n.subject;let r=new R,a="cdk-text-field-autofilled",c=g=>{g.animationName==="cdk-text-field-autofill-start"&&!i.classList.contains(a)?(i.classList.add(a),this._ngZone.run(()=>r.next({target:g.target,isAutofilled:!0}))):g.animationName==="cdk-text-field-autofill-end"&&i.classList.contains(a)&&(i.classList.remove(a),this._ngZone.run(()=>r.next({target:g.target,isAutofilled:!1})))},h=this._ngZone.runOutsideAngular(()=>(i.classList.add("cdk-text-field-autofill-monitored"),this._renderer.listen(i,"animationstart",c,ky)));return this._monitoredElements.set(i,{subject:r,unlisten:h}),r}stopMonitoring(e){let i=Lr(e),n=this._monitoredElements.get(i);n&&(n.unlisten(),n.subject.complete(),i.classList.remove("cdk-text-field-autofill-monitored"),i.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(i))}ngOnDestroy(){this._monitoredElements.forEach((e,i)=>this.stopMonitoring(i))}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var Qu=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({})}return o})();var Xu=new oe("MAT_INPUT_VALUE_ACCESSOR");var Ed=class{_box;_destroyed=new R;_resizeSubject=new R;_resizeObserver;_elementObservables=new Map;constructor(t){this._box=t,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(e=>this._resizeSubject.next(e)))}observe(t){return this._elementObservables.has(t)||this._elementObservables.set(t,new Ii(e=>{let i=this._resizeSubject.subscribe(e);return this._resizeObserver?.observe(t,{box:this._box}),()=>{this._resizeObserver?.unobserve(t),i.unsubscribe(),this._elementObservables.delete(t)}}).pipe(me(e=>e.some(i=>i.target===t)),Ar({bufferSize:1,refCount:!0}),N(this._destroyed))),this._elementObservables.get(t)}destroy(){this._destroyed.next(),this._destroyed.complete(),this._resizeSubject.complete(),this._elementObservables.clear()}},Ku=(()=>{class o{_cleanupErrorListener;_observers=new Map;_ngZone=m(pe);constructor(){typeof ResizeObserver<"u"}ngOnDestroy(){for(let[,e]of this._observers)e.destroy();this._observers.clear(),this._cleanupErrorListener?.()}observe(e,i){let n=i?.box||"content-box";return this._observers.has(n)||this._observers.set(n,new Ed(n)),this._observers.get(n).observe(e)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var My=["notch"],Ty=["matFormFieldNotchedOutline",""],Ey=["*"],Zu=["iconPrefixContainer"],Ju=["textPrefixContainer"],eg=["iconSuffixContainer"],tg=["textSuffixContainer"],Py=["textField"],Oy=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Ay=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function Iy(o,t){o&1&&I(0,"span",21)}function Dy(o,t){if(o&1&&(s(0,"label",20),ue(1,1),C(2,Iy,1,0,"span",21),l()),o&2){let e=u(2);w("floating",e._shouldLabelFloat())("monitorResize",e._hasOutline())("id",e._labelId),J("for",e._control.disableAutomaticLabeling?null:e._control.id),d(2),x(!e.hideRequiredMarker&&e._control.required?2:-1)}}function Ry(o,t){if(o&1&&C(0,Dy,3,5,"label",20),o&2){let e=u();x(e._hasFloatingLabel()?0:-1)}}function Fy(o,t){o&1&&I(0,"div",7)}function Ny(o,t){}function Ly(o,t){if(o&1&&Re(0,Ny,0,0,"ng-template",13),o&2){u(2);let e=Et(1);w("ngTemplateOutlet",e)}}function Vy(o,t){if(o&1&&(s(0,"div",9),C(1,Ly,1,1,null,13),l()),o&2){let e=u();w("matFormFieldNotchedOutlineOpen",e._shouldLabelFloat()),d(),x(e._forceDisplayInfixLabel()?-1:1)}}function zy(o,t){o&1&&(s(0,"div",10,2),ue(2,2),l())}function jy(o,t){o&1&&(s(0,"div",11,3),ue(2,3),l())}function By(o,t){}function Hy(o,t){if(o&1&&Re(0,By,0,0,"ng-template",13),o&2){u();let e=Et(1);w("ngTemplateOutlet",e)}}function Uy(o,t){o&1&&(s(0,"div",14,4),ue(2,4),l())}function Wy(o,t){o&1&&(s(0,"div",15,5),ue(2,5),l())}function $y(o,t){o&1&&I(0,"div",16)}function qy(o,t){o&1&&(s(0,"div",18),ue(1,6),l())}function Gy(o,t){if(o&1&&(s(0,"mat-hint",22),p(1),l()),o&2){let e=u(2);w("id",e._hintLabelId),d(),O(e.hintLabel)}}function Yy(o,t){if(o&1&&(s(0,"div",19),C(1,Gy,2,2,"mat-hint",22),ue(2,7),I(3,"div",23),ue(4,8),l()),o&2){let e=u();d(),x(e.hintLabel?1:-1)}}var Ht=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["mat-label"]]})}return o})(),Qy=new oe("MatError");var xn=(()=>{class o{align="start";id=m(Ne).getId("mat-mdc-hint-");static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(i,n){i&2&&(Jt("id",n.id),J("align",null),E("mat-mdc-form-field-hint-end",n.align==="end"))},inputs:{align:"align",id:"id"}})}return o})(),lg=new oe("MatPrefix"),vo=(()=>{class o{set _isTextSelector(e){this._isText=!0}_isText=!1;static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","matPrefix",""],["","matIconPrefix",""],["","matTextPrefix",""]],inputs:{_isTextSelector:[0,"matTextPrefix","_isTextSelector"]},features:[Ye([{provide:lg,useExisting:o}])]})}return o})(),Xy=new oe("MatSuffix");var cg=new oe("FloatingLabelParent"),ig=(()=>{class o{_elementRef=m(ne);get floating(){return this._floating}set floating(e){this._floating=e,this.monitorResize&&this._handleResize()}_floating=!1;get monitorResize(){return this._monitorResize}set monitorResize(e){this._monitorResize=e,this._monitorResize?this._subscribeToResize():this._resizeSubscription.unsubscribe()}_monitorResize=!1;_resizeObserver=m(Ku);_ngZone=m(pe);_parent=m(cg);_resizeSubscription=new Ai;constructor(){}ngOnDestroy(){this._resizeSubscription.unsubscribe()}getWidth(){return Ky(this._elementRef.nativeElement)}get element(){return this._elementRef.nativeElement}_handleResize(){setTimeout(()=>this._parent._handleLabelResized())}_subscribeToResize(){this._resizeSubscription.unsubscribe(),this._ngZone.runOutsideAngular(()=>{this._resizeSubscription=this._resizeObserver.observe(this._elementRef.nativeElement,{box:"border-box"}).subscribe(()=>this._handleResize())})}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(i,n){i&2&&E("mdc-floating-label--float-above",n.floating)},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return o})();function Ky(o){let t=o;if(t.offsetParent!==null)return t.scrollWidth;let e=t.cloneNode(!0);e.style.setProperty("position","absolute"),e.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(e);let i=e.scrollWidth;return e.remove(),i}var ng="mdc-line-ripple--active",xl="mdc-line-ripple--deactivating",og=(()=>{class o{_elementRef=m(ne);_cleanupTransitionEnd;constructor(){let e=m(pe),i=m(Ct);e.runOutsideAngular(()=>{this._cleanupTransitionEnd=i.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd)})}activate(){let e=this._elementRef.nativeElement.classList;e.remove(xl),e.add(ng)}deactivate(){this._elementRef.nativeElement.classList.add(xl)}_handleTransitionEnd=e=>{let i=this._elementRef.nativeElement.classList,n=i.contains(xl);e.propertyName==="opacity"&&n&&i.remove(ng,xl)};ngOnDestroy(){this._cleanupTransitionEnd()}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return o})(),rg=(()=>{class o{_elementRef=m(ne);_ngZone=m(pe);open=!1;_notch;ngAfterViewInit(){let e=this._elementRef.nativeElement,i=e.querySelector(".mdc-floating-label");i?(e.classList.add("mdc-notched-outline--upgraded"),typeof requestAnimationFrame=="function"&&(i.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>i.style.transitionDuration="")}))):e.classList.add("mdc-notched-outline--no-label")}_setNotchWidth(e){let i=this._notch.nativeElement;!this.open||!e?i.style.width="":i.style.width=`calc(${e}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + 9px)`}_setMaxWidth(e){this._notch.nativeElement.style.setProperty("--mat-form-field-notch-max-width",`calc(100% - ${e}px)`)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(i,n){if(i&1&&X(My,5),i&2){let r;U(r=W())&&(n._notch=r.first)}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(i,n){i&2&&E("mdc-notched-outline--notched",n.open)},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},attrs:Ty,ngContentSelectors:Ey,decls:5,vars:0,consts:[["notch",""],[1,"mat-mdc-notch-piece","mdc-notched-outline__leading"],[1,"mat-mdc-notch-piece","mdc-notched-outline__notch"],[1,"mat-mdc-notch-piece","mdc-notched-outline__trailing"]],template:function(i,n){i&1&&(We(),eo(0,"div",1),ii(1,"div",2,0),ue(3),ni(),eo(4,"div",3))},encapsulation:2,changeDetection:0})}return o})(),fa=(()=>{class o{value;stateChanges;id;placeholder;ngControl;focused;empty;shouldLabelFloat;required;disabled;errorState;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;describedByIds;static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o})}return o})();var _a=new oe("MatFormField"),Zy=new oe("MAT_FORM_FIELD_DEFAULT_OPTIONS"),ag="fill",Jy="auto",sg="fixed",eC="translateY(-50%)",Ut=(()=>{class o{_elementRef=m(ne);_changeDetectorRef=m(Qe);_platform=m(tt);_idGenerator=m(Ne);_ngZone=m(pe);_defaults=m(Zy,{optional:!0});_currentDirection;_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_iconPrefixContainerSignal=Fr("iconPrefixContainer");_textPrefixContainerSignal=Fr("textPrefixContainer");_iconSuffixContainerSignal=Fr("iconSuffixContainer");_textSuffixContainerSignal=Fr("textSuffixContainer");_prefixSuffixContainers=ui(()=>[this._iconPrefixContainerSignal(),this._textPrefixContainerSignal(),this._iconSuffixContainerSignal(),this._textSuffixContainerSignal()].map(e=>e?.nativeElement).filter(e=>e!==void 0));_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=km(Ht);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(e){this._hideRequiredMarker=Pt(e)}_hideRequiredMarker=!1;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||Jy}set floatLabel(e){e!==this._floatLabel&&(this._floatLabel=e,this._changeDetectorRef.markForCheck())}_floatLabel;get appearance(){return this._appearanceSignal()}set appearance(e){let i=e||this._defaults?.appearance||ag;this._appearanceSignal.set(i)}_appearanceSignal=Oe(ag);get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||sg}set subscriptSizing(e){this._subscriptSizing=e||this._defaults?.subscriptSizing||sg}_subscriptSizing=null;get hintLabel(){return this._hintLabel}set hintLabel(e){this._hintLabel=e,this._processHints()}_hintLabel="";_hasIconPrefix=!1;_hasTextPrefix=!1;_hasIconSuffix=!1;_hasTextSuffix=!1;_labelId=this._idGenerator.getId("mat-mdc-form-field-label-");_hintLabelId=this._idGenerator.getId("mat-mdc-hint-");_describedByIds;get _control(){return this._explicitFormFieldControl||this._formFieldControl}set _control(e){this._explicitFormFieldControl=e}_destroyed=new R;_isFocused=null;_explicitFormFieldControl;_previousControl=null;_previousControlValidatorFn=null;_stateChanges;_valueChanges;_describedByChanges;_outlineLabelOffsetResizeObserver=null;_animationsDisabled=$e();constructor(){let e=this._defaults,i=m(bt);e&&(e.appearance&&(this.appearance=e.appearance),this._hideRequiredMarker=!!e?.hideRequiredMarker,e.color&&(this.color=e.color)),no(()=>this._currentDirection=i.valueSignal()),this._syncOutlineLabelOffset()}ngAfterViewInit(){this._updateFocusState(),this._animationsDisabled||this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-form-field-animations-enabled")},300)}),this._changeDetectorRef.detectChanges()}ngAfterContentInit(){this._assertFormFieldControl(),this._initializeSubscript(),this._initializePrefixAndSuffix()}ngAfterContentChecked(){this._assertFormFieldControl(),this._control!==this._previousControl&&(this._initializeControl(this._previousControl),this._control.ngControl&&this._control.ngControl.control&&(this._previousControlValidatorFn=this._control.ngControl.control.validator),this._previousControl=this._control),this._control.ngControl&&this._control.ngControl.control&&this._control.ngControl.control.validator!==this._previousControlValidatorFn&&this._changeDetectorRef.markForCheck()}ngOnDestroy(){this._outlineLabelOffsetResizeObserver?.disconnect(),this._stateChanges?.unsubscribe(),this._valueChanges?.unsubscribe(),this._describedByChanges?.unsubscribe(),this._destroyed.next(),this._destroyed.complete()}getLabelId=ui(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always")}_initializeControl(e){let i=this._control,n="mat-mdc-form-field-type-";e&&this._elementRef.nativeElement.classList.remove(n+e.controlType),i.controlType&&this._elementRef.nativeElement.classList.add(n+i.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=i.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck()}),this._describedByChanges?.unsubscribe(),this._describedByChanges=i.stateChanges.pipe(Mt([void 0,void 0]),ve(()=>[i.errorState,i.userAriaDescribedBy]),Io(),me(([[r,a],[c,h]])=>r!==c||a!==h)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),i.ngControl&&i.ngControl.valueChanges&&(this._valueChanges=i.ngControl.valueChanges.pipe(N(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()))}_checkPrefixAndSuffixTypes(){this._hasIconPrefix=!!this._prefixChildren.find(e=>!e._isText),this._hasTextPrefix=!!this._prefixChildren.find(e=>e._isText),this._hasIconSuffix=!!this._suffixChildren.find(e=>!e._isText),this._hasTextSuffix=!!this._suffixChildren.find(e=>e._isText)}_initializePrefixAndSuffix(){this._checkPrefixAndSuffixTypes(),Di(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._checkPrefixAndSuffixTypes(),this._changeDetectorRef.markForCheck()})}_initializeSubscript(){this._hintChildren.changes.subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._validateHints(),this._syncDescribedByIds()}_assertFormFieldControl(){this._control}_updateFocusState(){let e=this._control.focused;e&&!this._isFocused?(this._isFocused=!0,this._lineRipple?.activate()):!e&&(this._isFocused||this._isFocused===null)&&(this._isFocused=!1,this._lineRipple?.deactivate()),this._elementRef.nativeElement.classList.toggle("mat-focused",e),this._textField?.nativeElement.classList.toggle("mdc-text-field--focused",e)}_syncOutlineLabelOffset(){Mm({earlyRead:()=>{if(this._appearanceSignal()!=="outline")return this._outlineLabelOffsetResizeObserver?.disconnect(),null;if(globalThis.ResizeObserver){this._outlineLabelOffsetResizeObserver||=new globalThis.ResizeObserver(()=>{this._writeOutlinedLabelStyles(this._getOutlinedLabelOffset())});for(let e of this._prefixSuffixContainers())this._outlineLabelOffsetResizeObserver.observe(e,{box:"border-box"})}return this._getOutlinedLabelOffset()},write:e=>this._writeOutlinedLabelStyles(e())})}_shouldAlwaysFloat(){return this.floatLabel==="always"}_hasOutline(){return this.appearance==="outline"}_forceDisplayInfixLabel(){return!this._platform.isBrowser&&this._prefixChildren.length&&!this._shouldLabelFloat()}_hasFloatingLabel=ui(()=>!!this._labelChild());_shouldLabelFloat(){return this._hasFloatingLabel()?this._control.shouldLabelFloat||this._shouldAlwaysFloat():!1}_shouldForward(e){let i=this._control?this._control.ngControl:null;return i&&i[e]}_getSubscriptMessageType(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_handleLabelResized(){this._refreshOutlineNotchWidth()}_refreshOutlineNotchWidth(){!this._hasOutline()||!this._floatingLabel||!this._shouldLabelFloat()?this._notchedOutline?._setNotchWidth(0):this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth())}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){this._hintChildren}_syncDescribedByIds(){if(this._control){let e=[];if(this._control.userAriaDescribedBy&&typeof this._control.userAriaDescribedBy=="string"&&e.push(...this._control.userAriaDescribedBy.split(" ")),this._getSubscriptMessageType()==="hint"){let r=this._hintChildren?this._hintChildren.find(c=>c.align==="start"):null,a=this._hintChildren?this._hintChildren.find(c=>c.align==="end"):null;r?e.push(r.id):this._hintLabel&&e.push(this._hintLabelId),a&&e.push(a.id)}else this._errorChildren&&e.push(...this._errorChildren.map(r=>r.id));let i=this._control.describedByIds,n;if(i){let r=this._describedByIds||e;n=e.concat(i.filter(a=>a&&!r.includes(a)))}else n=e;this._control.setDescribedByIds(n),this._describedByIds=e}}_getOutlinedLabelOffset(){if(!this._hasOutline()||!this._floatingLabel)return null;if(!this._iconPrefixContainer&&!this._textPrefixContainer)return["",null];if(!this._isAttachedToDom())return null;let e=this._iconPrefixContainer?.nativeElement,i=this._textPrefixContainer?.nativeElement,n=this._iconSuffixContainer?.nativeElement,r=this._textSuffixContainer?.nativeElement,a=e?.getBoundingClientRect().width??0,c=i?.getBoundingClientRect().width??0,h=n?.getBoundingClientRect().width??0,g=r?.getBoundingClientRect().width??0,y=this._currentDirection==="rtl"?"-1":"1",S=`${a+c}px`,F=`calc(${y} * (${S} + var(--mat-mdc-form-field-label-offset-x, 0px)))`,T=`var(--mat-mdc-form-field-label-transform, ${eC} translateX(${F}))`,B=a+c+h+g;return[T,B]}_writeOutlinedLabelStyles(e){if(e!==null){let[i,n]=e;this._floatingLabel&&(this._floatingLabel.element.style.transform=i),n!==null&&this._notchedOutline?._setMaxWidth(n)}}_isAttachedToDom(){let e=this._elementRef.nativeElement;if(e.getRootNode){let i=e.getRootNode();return i&&i!==e}return document.documentElement.contains(e)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-form-field"]],contentQueries:function(i,n,r){if(i&1&&(ym(r,n._labelChild,Ht,5),xt(r,fa,5),xt(r,lg,5),xt(r,Xy,5),xt(r,Qy,5),xt(r,xn,5)),i&2){tc();let a;U(a=W())&&(n._formFieldControl=a.first),U(a=W())&&(n._prefixChildren=a),U(a=W())&&(n._suffixChildren=a),U(a=W())&&(n._errorChildren=a),U(a=W())&&(n._hintChildren=a)}},viewQuery:function(i,n){if(i&1&&(Dr(n._iconPrefixContainerSignal,Zu,5),Dr(n._textPrefixContainerSignal,Ju,5),Dr(n._iconSuffixContainerSignal,eg,5),Dr(n._textSuffixContainerSignal,tg,5),X(Py,5),X(Zu,5),X(Ju,5),X(eg,5),X(tg,5),X(ig,5),X(rg,5),X(og,5)),i&2){tc(4);let r;U(r=W())&&(n._textField=r.first),U(r=W())&&(n._iconPrefixContainer=r.first),U(r=W())&&(n._textPrefixContainer=r.first),U(r=W())&&(n._iconSuffixContainer=r.first),U(r=W())&&(n._textSuffixContainer=r.first),U(r=W())&&(n._floatingLabel=r.first),U(r=W())&&(n._notchedOutline=r.first),U(r=W())&&(n._lineRipple=r.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:38,hostBindings:function(i,n){i&2&&E("mat-mdc-form-field-label-always-float",n._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",n._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",n._hasIconSuffix)("mat-form-field-invalid",n._control.errorState)("mat-form-field-disabled",n._control.disabled)("mat-form-field-autofilled",n._control.autofilled)("mat-form-field-appearance-fill",n.appearance=="fill")("mat-form-field-appearance-outline",n.appearance=="outline")("mat-form-field-hide-placeholder",n._hasFloatingLabel()&&!n._shouldLabelFloat())("mat-primary",n.color!=="accent"&&n.color!=="warn")("mat-accent",n.color==="accent")("mat-warn",n.color==="warn")("ng-untouched",n._shouldForward("untouched"))("ng-touched",n._shouldForward("touched"))("ng-pristine",n._shouldForward("pristine"))("ng-dirty",n._shouldForward("dirty"))("ng-valid",n._shouldForward("valid"))("ng-invalid",n._shouldForward("invalid"))("ng-pending",n._shouldForward("pending"))},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[Ye([{provide:_a,useExisting:o},{provide:cg,useExisting:o}])],ngContentSelectors:Ay,decls:18,vars:21,consts:[["labelTemplate",""],["textField",""],["iconPrefixContainer",""],["textPrefixContainer",""],["textSuffixContainer",""],["iconSuffixContainer",""],[1,"mat-mdc-text-field-wrapper","mdc-text-field",3,"click"],[1,"mat-mdc-form-field-focus-overlay"],[1,"mat-mdc-form-field-flex"],["matFormFieldNotchedOutline","",3,"matFormFieldNotchedOutlineOpen"],[1,"mat-mdc-form-field-icon-prefix"],[1,"mat-mdc-form-field-text-prefix"],[1,"mat-mdc-form-field-infix"],[3,"ngTemplateOutlet"],[1,"mat-mdc-form-field-text-suffix"],[1,"mat-mdc-form-field-icon-suffix"],["matFormFieldLineRipple",""],["aria-atomic","true","aria-live","polite",1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],[1,"mat-mdc-form-field-error-wrapper"],[1,"mat-mdc-form-field-hint-wrapper"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(i,n){if(i&1){let r=k();We(Oy),Re(0,Ry,1,1,"ng-template",null,0,Do),s(2,"div",6,1),f("click",function(c){return b(r),v(n._control.onContainerClick(c))}),C(4,Fy,1,0,"div",7),s(5,"div",8),C(6,Vy,2,2,"div",9),C(7,zy,3,0,"div",10),C(8,jy,3,0,"div",11),s(9,"div",12),C(10,Hy,1,1,null,13),ue(11),l(),C(12,Uy,3,0,"div",14),C(13,Wy,3,0,"div",15),l(),C(14,$y,1,0,"div",16),l(),s(15,"div",17),C(16,qy,2,0,"div",18)(17,Yy,5,1,"div",19),l()}if(i&2){let r;d(2),E("mdc-text-field--filled",!n._hasOutline())("mdc-text-field--outlined",n._hasOutline())("mdc-text-field--no-label",!n._hasFloatingLabel())("mdc-text-field--disabled",n._control.disabled)("mdc-text-field--invalid",n._control.errorState),d(2),x(!n._hasOutline()&&!n._control.disabled?4:-1),d(2),x(n._hasOutline()?6:-1),d(),x(n._hasIconPrefix?7:-1),d(),x(n._hasTextPrefix?8:-1),d(2),x(!n._hasOutline()||n._forceDisplayInfixLabel()?10:-1),d(2),x(n._hasTextSuffix?12:-1),d(),x(n._hasIconSuffix?13:-1),d(),x(n._hasOutline()?-1:14),d(),E("mat-mdc-form-field-subscript-dynamic-size",n.subscriptSizing==="dynamic");let a=n._getSubscriptMessageType();d(),x((r=a)==="error"?16:r==="hint"?17:-1)}},dependencies:[ig,rg,Ro,og,xn],styles:[`.mdc-text-field{display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-text-field__input{width:100%;min-width:0;border:none;border-radius:0;background:none;padding:0;-moz-appearance:none;-webkit-appearance:none;height:28px}.mdc-text-field__input::-webkit-calendar-picker-indicator,.mdc-text-field__input::-webkit-search-cancel-button{display:none}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}.mdc-text-field__input::placeholder{opacity:0}.mdc-text-field__input::-moz-placeholder{opacity:0}.mdc-text-field__input::-webkit-input-placeholder{opacity:0}.mdc-text-field__input:-ms-input-placeholder{opacity:0}.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{opacity:1}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-moz-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-webkit-input-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive:-ms-input-placeholder{opacity:0}.mdc-text-field--outlined .mdc-text-field__input,.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:rgba(0,0,0,0)}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-filled-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-filled-caret-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-outlined-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-outlined-caret-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-filled-error-caret-color, var(--mat-sys-error))}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-outlined-error-caret-color, var(--mat-sys-error))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-filled-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-outlined-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}}.mdc-text-field--filled{height:56px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small));border-top-right-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--mat-form-field-filled-container-color, var(--mat-sys-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled{background-color:var(--mat-form-field-filled-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 4%, transparent))}.mdc-text-field--outlined{height:56px;overflow:visible;padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)));padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px)}[dir=rtl] .mdc-text-field--outlined{padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px);padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}.mdc-floating-label{position:absolute;left:0;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform}[dir=rtl] .mdc-floating-label{right:0;left:auto;transform-origin:right top;text-align:right}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:auto}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label{left:auto;right:4px}.mdc-text-field--filled .mdc-floating-label{left:16px;right:auto}[dir=rtl] .mdc-text-field--filled .mdc-floating-label{left:auto;right:16px}.mdc-text-field--disabled .mdc-floating-label{cursor:default}@media(forced-colors: active){.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-filled-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-filled-hover-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-filled-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-filled-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-filled-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--filled .mdc-floating-label{font-family:var(--mat-form-field-filled-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-filled-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-filled-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-filled-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-outlined-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-outlined-hover-label-text-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-outlined-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-outlined-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-outlined-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined .mdc-floating-label{font-family:var(--mat-form-field-outlined-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-outlined-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-outlined-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-outlined-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-floating-label--float-above{cursor:auto;transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1);font-size:.75rem}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:133.3333333333%}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:1px;margin-right:0;content:"*"}[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:0;margin-right:1px}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline{text-align:right}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mat-mdc-notch-piece{box-sizing:border-box;height:100%;pointer-events:none;border-top:1px solid;border-bottom:1px solid}.mdc-text-field--focused .mat-mdc-notch-piece{border-width:2px}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-outline-color, var(--mat-sys-outline));border-width:var(--mat-form-field-outlined-outline-width, 1px)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-hover-outline-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-focus-outline-color, var(--mat-sys-primary))}.mdc-text-field--outlined.mdc-text-field--disabled .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-notched-outline .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-hover-outline-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-focus-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mat-mdc-notch-piece{border-width:var(--mat-form-field-outlined-focus-outline-width, 2px)}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}[dir=rtl] .mdc-notched-outline__leading{border-left:none;border-right:1px solid;border-bottom-left-radius:0;border-top-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__trailing{flex-grow:1;border-left:none;border-right:1px solid;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}[dir=rtl] .mdc-notched-outline__trailing{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__notch{flex:0 0 auto;width:auto}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:min(var(--mat-form-field-notch-max-width, 100%),calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{max-width:min(100%,calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{z-index:1;border-bottom-width:var(--mat-form-field-filled-active-indicator-height, 1px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-active-indicator-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-hover-active-indicator-color, var(--mat-sys-on-surface))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-disabled-active-indicator-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-active-indicator-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-hover-active-indicator-color, var(--mat-sys-on-error-container))}.mdc-line-ripple::after{transform:scaleX(0);opacity:0;z-index:2}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-width:var(--mat-form-field-filled-focus-active-indicator-height, 2px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-focus-active-indicator-color, var(--mat-sys-primary))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-error-focus-active-indicator-color, var(--mat-sys-error))}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-text-field--disabled{pointer-events:none}.mat-mdc-form-field-textarea-control{vertical-align:middle;resize:vertical;box-sizing:border-box;height:auto;margin:0;padding:0;border:none;overflow:auto}.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font:inherit;letter-spacing:inherit;text-decoration:inherit;text-transform:inherit;border:none}.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;line-height:normal;pointer-events:all;will-change:auto}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{cursor:inherit}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:auto}.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color]{height:23px}.mat-mdc-text-field-wrapper{height:auto;flex:auto;will-change:auto}.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-left:0;--mat-mdc-form-field-label-offset-x: -16px}.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-right:0}[dir=rtl] .mat-mdc-text-field-wrapper{padding-left:16px;padding-right:16px}[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-left:0}[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-right:0}.mat-form-field-disabled .mdc-text-field__input::placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label{left:auto;right:auto}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input{display:inline-block}.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch{padding-top:0}.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:1px solid rgba(0,0,0,0)}[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none;border-right:1px solid rgba(0,0,0,0)}.mat-mdc-form-field-infix{min-height:var(--mat-form-field-container-height, 56px);padding-top:var(--mat-form-field-filled-with-label-container-padding-top, 24px);padding-bottom:var(--mat-form-field-filled-with-label-container-padding-bottom, 8px)}.mdc-text-field--outlined .mat-mdc-form-field-infix,.mdc-text-field--no-label .mat-mdc-form-field-infix{padding-top:var(--mat-form-field-container-vertical-padding, 16px);padding-bottom:var(--mat-form-field-container-vertical-padding, 16px)}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:calc(var(--mat-form-field-container-height, 56px)/2)}.mdc-text-field--filled .mat-mdc-floating-label{display:var(--mat-form-field-filled-label-display, block)}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height, 56px) / 2) * -1)) scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));transform:var(--mat-mdc-form-field-label-transform)}@keyframes _mat-form-field-subscript-animation{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.mat-mdc-form-field-subscript-wrapper{box-sizing:border-box;width:100%;position:relative}.mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-error-wrapper{position:absolute;top:0;left:0;right:0;padding:0 16px;opacity:1;transform:translateY(0);animation:_mat-form-field-subscript-animation 0ms cubic-bezier(0.55, 0, 0.55, 0.2)}.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper{position:static}.mat-mdc-form-field-bottom-align::before{content:"";display:inline-block;height:16px}.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before{content:unset}.mat-mdc-form-field-hint-end{order:1}.mat-mdc-form-field-hint-wrapper{display:flex}.mat-mdc-form-field-hint-spacer{flex:1 0 1em}.mat-mdc-form-field-error{display:block;color:var(--mat-form-field-error-text-color, var(--mat-sys-error))}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align::before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-subscript-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));letter-spacing:var(--mat-form-field-subscript-text-tracking, var(--mat-sys-body-small-tracking));font-weight:var(--mat-form-field-subscript-text-weight, var(--mat-sys-body-small-weight))}.mat-mdc-form-field-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;opacity:0;pointer-events:none;background-color:var(--mat-form-field-state-layer-color, var(--mat-sys-on-surface))}.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-focus-state-layer-opacity, 0)}select.mat-mdc-form-field-input-control{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0);display:inline-flex;box-sizing:border-box}select.mat-mdc-form-field-input-control:not(:disabled){cursor:pointer}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option{color:var(--mat-form-field-select-option-text-color, var(--mat-sys-neutral10))}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled{color:var(--mat-form-field-select-disabled-option-text-color, color-mix(in srgb, var(--mat-sys-neutral10) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:5px solid;position:absolute;right:0;top:50%;margin-top:-2.5px;pointer-events:none;color:var(--mat-form-field-enabled-select-arrow-color, var(--mat-sys-on-surface-variant))}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{right:auto;left:0}.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after{color:var(--mat-form-field-focus-select-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after{color:var(--mat-form-field-disabled-select-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:15px}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:0;padding-left:15px}@media(forced-colors: active){.mat-form-field-appearance-fill .mat-mdc-text-field-wrapper{outline:solid 1px}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper{outline-color:GrayText}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper{outline:dashed 3px}}@media(forced-colors: active){.mat-mdc-form-field.mat-focused .mdc-notched-outline{border:dashed 3px}}.mat-mdc-form-field-input-control[type=date],.mat-mdc-form-field-input-control[type=datetime],.mat-mdc-form-field-input-control[type=datetime-local],.mat-mdc-form-field-input-control[type=month],.mat-mdc-form-field-input-control[type=week],.mat-mdc-form-field-input-control[type=time]{line-height:1}.mat-mdc-form-field-input-control::-webkit-datetime-edit{line-height:1;padding:0;margin-bottom:-2px}.mat-mdc-form-field{--mat-mdc-form-field-floating-label-scale: 0.75;display:inline-flex;flex-direction:column;min-width:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-container-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-form-field-container-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-form-field-container-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-form-field-container-text-tracking, var(--mat-sys-body-large-tracking));font-weight:var(--mat-form-field-container-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(var(--mat-form-field-outlined-label-text-populated-size)*var(--mat-mdc-form-field-floating-label-scale))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mat-form-field-outlined-label-text-populated-size)}[dir=rtl] .mat-mdc-form-field{text-align:right}.mat-mdc-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-mdc-text-field-wrapper{width:100%;z-index:0}.mat-mdc-form-field-icon-prefix,.mat-mdc-form-field-icon-suffix{align-self:center;line-height:0;pointer-events:auto;position:relative;z-index:1}.mat-mdc-form-field-icon-prefix>.mat-icon,.mat-mdc-form-field-icon-suffix>.mat-icon{padding:0 12px;box-sizing:content-box}.mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-leading-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-disabled-leading-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-disabled-trailing-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-invalid .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-trailing-icon-color, var(--mat-sys-error))}.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-hover-trailing-icon-color, var(--mat-sys-on-error-container))}.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-focus-trailing-icon-color, var(--mat-sys-error))}.mat-mdc-form-field-icon-prefix,[dir=rtl] .mat-mdc-form-field-icon-suffix{padding:0 4px 0 0}.mat-mdc-form-field-icon-suffix,[dir=rtl] .mat-mdc-form-field-icon-prefix{padding:0 0 0 4px}.mat-mdc-form-field-subscript-wrapper .mat-icon,.mat-mdc-form-field label .mat-icon{width:1em;height:1em;font-size:inherit}.mat-mdc-form-field-infix{flex:auto;min-width:0;width:180px;position:relative;box-sizing:border-box}.mat-mdc-form-field-infix:has(textarea[cols]){width:auto}.mat-mdc-form-field .mdc-notched-outline__notch{margin-left:-1px;-webkit-clip-path:inset(-9em -999em -9em 1px);clip-path:inset(-9em -999em -9em 1px)}[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch{margin-left:0;margin-right:-1px;-webkit-clip-path:inset(-9em 1px -9em -999em);clip-path:inset(-9em 1px -9em -999em)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-floating-label{transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input{transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-moz-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-webkit-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-error-wrapper{animation-duration:300ms}.mdc-notched-outline .mdc-floating-label{max-width:calc(100% + 1px)}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(133.3333333333% + 1px)}
370
- `],encapsulation:2,changeDetection:0})}return o})();var wl=(()=>{class o{isErrorState(e,i){return!!(e&&e.invalid&&(e.touched||i&&i.submitted))}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var wr=class{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(t,e,i,n,r){this._defaultMatcher=t,this.ngControl=e,this._parentFormGroup=i,this._parentForm=n,this._stateChanges=r}updateErrorState(){let t=this.errorState,e=this._parentFormGroup||this._parentForm,i=this.matcher||this._defaultMatcher,n=this.ngControl?this.ngControl.control:null,r=i?.isErrorState(n,e)??!1;r!==t&&(this.errorState=r,this._stateChanges.next())}};var pt=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({imports:[le,Vm,Ut,le]})}return o})();var tC=["button","checkbox","file","hidden","image","radio","range","reset","submit"],iC=new oe("MAT_INPUT_CONFIG"),mi=(()=>{class o{_elementRef=m(ne);_platform=m(tt);ngControl=m(Ja,{optional:!0,self:!0});_autofillMonitor=m(Yu);_ngZone=m(pe);_formField=m(_a,{optional:!0});_renderer=m(Ct);_uid=m(Ne).getId("mat-input-");_previousNativeValue;_inputValueAccessor;_signalBasedValueAccessor;_previousPlaceholder;_errorStateTracker;_config=m(iC,{optional:!0});_cleanupIosKeyup;_cleanupWebkitWheel;_isServer;_isNativeSelect;_isTextarea;_isInFormField;focused=!1;stateChanges=new R;controlType="mat-input";autofilled=!1;get disabled(){return this._disabled}set disabled(e){this._disabled=Pt(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(Za.required)??!1}set required(e){this._required=Pt(e)}_required;get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&rc().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=Pt(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=>rc().has(e));constructor(){let e=m(es,{optional:!0}),i=m(is,{optional:!0}),n=m(wl),r=m(Xu,{optional:!0,self:!0}),a=this._elementRef.nativeElement,c=a.nodeName.toLowerCase();r?La(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 wr(n,this.ngControl,i,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&&no(()=>{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 i=this._elementRef.nativeElement;i.type==="number"?(i.type="text",i.setSelectionRange(0,0),i.type="number"):i.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 i=this._elementRef.nativeElement;this._previousPlaceholder=e,e?i.setAttribute("placeholder",e):i.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){tC.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,i=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&i&&i.label)}else return this.focused&&!this.disabled||!this.empty}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let i=this._elementRef.nativeElement;e.length?i.setAttribute("aria-describedby",e.join(" ")):i.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 i=e.target;!i.value&&i.selectionStart===0&&i.selectionEnd===0&&(i.setSelectionRange(1,1),i.setSelectionRange(0,0))};_getReadonlyAttribute(){return this._isNativeSelect?null:this.readonly||this.disabled&&this.disabledInteractive?"true":null}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:21,hostBindings:function(i,n){i&1&&f("focus",function(){return n._focusChanged(!0)})("blur",function(){return n._focusChanged(!1)})("input",function(){return n._onInput()}),i&2&&(Jt("id",n.id)("disabled",n.disabled&&!n.disabledInteractive)("required",n.required),J("name",n.name||null)("readonly",n._getReadonlyAttribute())("aria-disabled",n.disabled&&n.disabledInteractive?"true":null)("aria-invalid",n.empty&&n.required?null:n.errorState)("aria-required",n.required)("id",n.id),E("mat-input-server",n._isServer)("mat-mdc-form-field-textarea-control",n._isInFormField&&n._isTextarea)("mat-mdc-form-field-input-control",n._isInFormField)("mat-mdc-input-disabled-interactive",n.disabledInteractive)("mdc-text-field__input",n._isInFormField)("mat-mdc-native-select-inline",n._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",ee]},exportAs:["matInput"],features:[Ye([{provide:fa,useExisting:o}]),nt]})}return o})(),Kt=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({imports:[le,pt,pt,Qu,le]})}return o})();var nC=(o,t)=>({subThreads:o,depth:t}),oC=o=>({subThreads:o,depth:1}),dg=(o,t)=>t.id,rC=(o,t)=>t.label;function aC(o,t){if(o&1){let e=k();s(0,"mat-icon",10),f("click",function(n){b(e);let r=u().$implicit,a=u(3);return v(a.toggleSubThreads(n,r.id))}),p(1),l()}if(o&2){let e=u().$implicit,i=u(3);d(),O(i.isParentExpanded(e.id)?"expand_more":"chevron_right")}}function sC(o,t){o&1&&to(0)}function lC(o,t){if(o&1&&Re(0,sC,1,0,"ng-container",11),o&2){let e=u().$implicit,i=u().depth;u();let n=Et(1);w("ngTemplateOutlet",n)("ngTemplateOutletContext",xm(2,nC,e.subThreads,i+1))}}function cC(o,t){if(o&1){let e=k();s(0,"div",5)(1,"a",6),f("click",function(n){let r=b(e).$implicit;return u(3).selectThread(r.id),v(n.preventDefault())})("keydown.enter",function(n){let r=b(e).$implicit;return u(3).selectThread(r.id),v(n.preventDefault())})("keydown.space",function(n){let r=b(e).$implicit;return u(3).selectThread(r.id),v(n.preventDefault())}),C(2,aC,2,1,"mat-icon",7),s(3,"span",8),p(4),l(),s(5,"span",9),p(6),l()()(),C(7,lC,1,5,"ng-container")}if(o&2){let e,i=t.$implicit,n=u().depth,r=u(2);oi("--sub-depth",n),E("current",i.id===((e=r.currentThread())==null?null:e.id)),d(2),x(i.subThreads!=null&&i.subThreads.length?2:-1),d(2),O(i.delegatedAgentName||"Agent"),d(2),O(i.delegatedTask||i.name),d(),x(r.isParentExpanded(i.id)&&(i.subThreads!=null&&i.subThreads.length)?7:-1)}}function dC(o,t){if(o&1&&we(0,cC,8,8,null,null,dg),o&2){let e=t.subThreads;Se(e)}}function mC(o,t){o&1&&(s(0,"div",4),I(1,"span",12),s(2,"span",13),p(3,"Loading threads..."),l()())}function pC(o,t){if(o&1&&(s(0,"div",25),p(1),l()),o&2){let e=u(6);d(),O(e.renameErrorMessage)}}function hC(o,t){if(o&1){let e=k();s(0,"div",18)(1,"input",24),j("ngModelChange",function(n){b(e);let r=u(5);return z(r.editingThreadName,n)||(r.editingThreadName=n),v(n)}),f("keydown",function(n){b(e);let r=u(5);return v(r.onEditKeydown(n))})("blur",function(){b(e);let n=u(5);return v(n.onEditBlur())})("click",function(n){return b(e),v(n.stopPropagation())}),l(),C(2,pC,2,1,"div",25),l()}if(o&2){let e=u(5);d(),V("ngModel",e.editingThreadName),w("disabled",e.isRenamingThread),d(),x(e.renameErrorMessage?2:-1)}}function uC(o,t){if(o&1){let e=k();s(0,"mat-icon",10),f("click",function(n){b(e);let r=u(2).$implicit,a=u(4);return v(a.toggleSubThreads(n,r.id))}),p(1),l()}if(o&2){let e=u(2).$implicit,i=u(4);d(),O(i.isParentExpanded(e.id)?"expand_more":"chevron_right")}}function gC(o,t){if(o&1&&(s(0,"span",27),p(1),l()),o&2){let e=u(2).$implicit;d(),O(e.name)}}function fC(o,t){o&1&&(I(0,"mat-spinner",29),s(1,"span",30),p(2,"Generating name..."),l()),o&2&&w("diameter",16)}function _C(o,t){o&1&&(s(0,"mat-icon",28),p(1,"group"),l())}function bC(o,t){if(o&1){let e=k();s(0,"a",26),f("click",function(n){b(e);let r=u().$implicit;return u(4).selectThread(r.id),v(n.preventDefault())})("keydown.enter",function(n){b(e);let r=u().$implicit;return u(4).selectThread(r.id),v(n.preventDefault())})("keydown.space",function(n){b(e);let r=u().$implicit;return u(4).selectThread(r.id),v(n.preventDefault())}),C(1,uC,2,1,"mat-icon",7),C(2,gC,2,1,"span",27)(3,fC,3,1),C(4,_C,2,0,"mat-icon",28),l()}if(o&2){let e=u().$implicit,i=u(4);w("matTooltip",e.name?e.name+`
368
+ `],encapsulation:2,changeDetection:0})}return o})(),Cl=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({imports:[bo,ce,ce]})}return o})();var _y=(o,t)=>t.code,by=(o,t)=>t.name+t.lang;function vy(o,t){o&1&&(s(0,"div",15)(1,"mat-icon",32),p(2,"warning"),l(),s(3,"span",33),p(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),l()())}function yy(o,t){if(o&1&&(s(0,"option",18),p(1),l()),o&2){let e=t.$implicit;w("value",e.code),d(),Tn("",e.flag," ",e.label)}}function Cy(o,t){o&1&&(s(0,"option",25),p(1,"Loading voices..."),l())}function xy(o,t){o&1&&(s(0,"option",25),p(1,"No voice available"),l())}function wy(o,t){if(o&1&&(s(0,"option",18),p(1),l()),o&2){let e=t.$implicit;w("value",e.name+"|"+e.lang),d(),ie(" ",e.displayName," ")}}var ga=class o{destroy$=new R;selectedTheme="light";selectedVoiceLanguage="en-US";useEnterToSend=!1;printTechnicalMessages=!1;showTechnicalMessages=!0;showWarningMessages=!0;voiceAnnounceEnabled=!1;voiceMode="speech";voiceReadFullText=!1;voiceVolume=80;voiceRate=120;agentNotificationEnabled=!1;notificationSoundEnabled=!0;browserNotificationEnabled=!1;browserNotificationDenied=!1;availableVoices=[];selectedVoiceId=null;loadingVoices=!1;voiceLanguageOptions=[{code:"fr-FR",label:"Fran\xE7ais",flag:"\u{1F1EB}\u{1F1F7}"},{code:"en-US",label:"English (US)",flag:"\u{1F1FA}\u{1F1F8}"},{code:"en-GB",label:"English (UK)",flag:"\u{1F1EC}\u{1F1E7}"},{code:"es-ES",label:"Espa\xF1ol",flag:"\u{1F1EA}\u{1F1F8}"},{code:"de-DE",label:"Deutsch",flag:"\u{1F1E9}\u{1F1EA}"},{code:"it-IT",label:"Italiano",flag:"\u{1F1EE}\u{1F1F9}"},{code:"pt-BR",label:"Portugu\xEAs",flag:"\u{1F1E7}\u{1F1F7}"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",flag:"\u{1F1EF}\u{1F1F5}"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",flag:"\u{1F1F0}\u{1F1F7}"},{code:"zh-CN",label:"\u4E2D\u6587 (\u7B80\u4F53)",flag:"\u{1F1E8}\u{1F1F3}"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",flag:"\u{1F1F7}\u{1F1FA}"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",flag:"\u{1F1F8}\u{1F1E6}"}];preferencesService=m(at);voiceSynthesisService=m(mr);themeService=m(xr);ngOnInit(){this.selectedTheme=this.themeService.getCurrentTheme(),this.selectedVoiceLanguage=this.preferencesService.getVoiceLanguage(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.printTechnicalMessages=this.preferencesService.getPrintTechnicalMessages(),this.showTechnicalMessages=!this.preferencesService.getHideTechnicalMessages(),this.showWarningMessages=!this.preferencesService.getHideWarningMessages(),this.voiceAnnounceEnabled=this.preferencesService.getVoiceAnnounceEnabled(),this.voiceMode=this.preferencesService.getVoiceMode(),this.voiceReadFullText=this.preferencesService.getVoiceReadFullText(),this.voiceVolume=Math.round(this.preferencesService.getVoiceVolume()*100),this.voiceRate=Math.round(this.preferencesService.getVoiceRate()*100),this.selectedVoiceId=this.preferencesService.getSelectedVoice(),this.agentNotificationEnabled=this.preferencesService.getAgentNotificationEnabled(),this.notificationSoundEnabled=this.preferencesService.getNotificationSoundEnabled(),this.browserNotificationEnabled=this.preferencesService.getBrowserNotificationEnabled(),this.loadAvailableVoices(),this.themeService.currentTheme$.pipe(N(this.destroy$)).subscribe(t=>{this.selectedTheme=t}),this.preferencesService.voiceLanguage$.pipe(N(this.destroy$)).subscribe(t=>{this.selectedVoiceLanguage=t}),this.preferencesService.enterToSend$.pipe(N(this.destroy$)).subscribe(t=>{this.useEnterToSend=t}),this.preferencesService.printTechnicalMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.printTechnicalMessages=t}),this.preferencesService.hideTechnicalMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.showTechnicalMessages=!t}),this.preferencesService.hideWarningMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.showWarningMessages=!t}),this.preferencesService.voiceAnnounceEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceAnnounceEnabled=t}),this.preferencesService.voiceMode$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceMode=t}),this.preferencesService.voiceReadFullText$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceReadFullText=t}),this.preferencesService.voiceVolume$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceVolume=Math.round(t*100)}),this.preferencesService.voiceRate$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceRate=Math.round(t*100)}),this.preferencesService.selectedVoice$.pipe(N(this.destroy$)).subscribe(t=>{this.selectedVoiceId=t}),this.preferencesService.voiceLanguage$.pipe(N(this.destroy$)).subscribe(()=>{this.loadAvailableVoices()}),this.preferencesService.agentNotificationEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.agentNotificationEnabled=t}),this.preferencesService.notificationSoundEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.notificationSoundEnabled=t}),this.preferencesService.browserNotificationEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.browserNotificationEnabled=t,this.checkNotificationPermission()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onThemeChange(){console.log("[OPTIONS] Theme changed to:",this.selectedTheme),this.themeService.setTheme(this.selectedTheme)}onVoiceLanguageChange(){console.log("[OPTIONS] Voice language changed to:",this.selectedVoiceLanguage),this.preferencesService.setVoiceLanguage(this.selectedVoiceLanguage)}onEnterToSendChange(){console.log("[OPTIONS] Enter to send changed to:",this.useEnterToSend),this.preferencesService.setEnterToSend(this.useEnterToSend)}onPrintTechnicalMessagesChange(){console.log("[OPTIONS] Print technical messages changed to:",this.printTechnicalMessages),this.preferencesService.setPrintTechnicalMessages(this.printTechnicalMessages)}onShowTechnicalMessagesChange(){let t=!this.showTechnicalMessages;console.log("[OPTIONS] Show technical messages changed to:",this.showTechnicalMessages,"(hide:",t,")"),this.preferencesService.setHideTechnicalMessages(t)}onShowWarningMessagesChange(){let t=!this.showWarningMessages;console.log("[OPTIONS] Show warning messages changed to:",this.showWarningMessages,"(hide:",t,")"),this.preferencesService.setHideWarningMessages(t)}onVoiceAnnounceEnabledChange(){console.log("[OPTIONS] Voice announce enabled changed to:",this.voiceAnnounceEnabled),this.preferencesService.setVoiceAnnounceEnabled(this.voiceAnnounceEnabled)}onVoiceModeChange(){console.log("[OPTIONS] Voice mode changed to:",this.voiceMode),this.preferencesService.setVoiceMode(this.voiceMode)}onVoiceReadFullTextChange(){console.log("[OPTIONS] Voice read full text changed to:",this.voiceReadFullText),this.preferencesService.setVoiceReadFullText(this.voiceReadFullText)}onVoiceVolumeChange(){let t=this.voiceVolume/100;console.log("[OPTIONS] Voice volume changed to:",t),this.preferencesService.setVoiceVolume(t)}onVoiceRateChange(){let t=this.voiceRate/100;console.log("[OPTIONS] Voice rate changed to:",t),this.preferencesService.setVoiceRate(t)}loadAvailableVoices(){return te(this,null,function*(){this.loadingVoices=!0;try{this.availableVoices=yield this.voiceSynthesisService.getVoicesForLanguage(),console.log("[OPTIONS] Loaded",this.availableVoices.length,"voices for current language")}catch(t){console.error("[OPTIONS] Error loading voices:",t),this.availableVoices=[]}finally{this.loadingVoices=!1}})}onSelectedVoiceChange(){console.log("[OPTIONS] Selected voice changed to:",this.selectedVoiceId),this.preferencesService.setSelectedVoice(this.selectedVoiceId)}testVoice(){console.log("[OPTIONS] Testing voice with current settings"),this.voiceSynthesisService.testSelectedVoice()}onAgentNotificationEnabledChange(){console.log("[OPTIONS] Agent notification enabled changed to:",this.agentNotificationEnabled),this.preferencesService.setAgentNotificationEnabled(this.agentNotificationEnabled)}onNotificationSoundEnabledChange(){console.log("[OPTIONS] Notification sound enabled changed to:",this.notificationSoundEnabled),this.preferencesService.setNotificationSoundEnabled(this.notificationSoundEnabled)}onBrowserNotificationEnabledChange(){console.log("[OPTIONS] Browser notification enabled changed to:",this.browserNotificationEnabled),this.preferencesService.setBrowserNotificationEnabled(this.browserNotificationEnabled)}checkNotificationPermission(){"Notification"in window&&(this.browserNotificationDenied=Notification.permission==="denied",console.log("[OPTIONS] Notification permission status:",Notification.permission))}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-options-panel"]],decls:144,vars:35,consts:[[1,"options-content"],[1,"option-section"],[1,"section-title"],[1,"option-group"],[1,"radio-group"],[1,"option-radio"],["type","radio","name","theme","value","light",3,"ngModelChange","change","ngModel"],[1,"radio-mark"],["type","radio","name","theme","value","dark",3,"ngModelChange","change","ngModel"],["type","radio","name","theme","value","system",3,"ngModelChange","change","ngModel"],[1,"option-label"],["type","radio","name","enterBehavior",3,"ngModelChange","change","value","ngModel"],[1,"toggle-option"],["color","primary",3,"ngModelChange","change","ngModel"],["color","primary",3,"ngModelChange","change","ngModel","disabled"],[1,"notification-error"],["for","voice-language-select",1,"option-label"],["id","voice-language-select",1,"option-select",3,"ngModelChange","change","ngModel"],[3,"value"],["type","radio","name","voiceAnnounce",3,"ngModelChange","change","value","ngModel"],["type","radio","name","voiceMode","value","speech",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceMode","value","notification",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceReadFull",3,"ngModelChange","change","value","ngModel"],["for","voice-select",1,"option-label"],["id","voice-select",1,"option-select",3,"ngModelChange","change","ngModel","disabled"],["value",""],["role","button","tabindex","0","title","Test voice with current settings",1,"test-voice-link",3,"click"],[1,"thread-name"],["for","voice-volume-slider",1,"option-label"],["id","voice-volume-slider","type","range","min","0","max","100","step","5",1,"option-slider",3,"ngModelChange","input","ngModel"],["for","voice-rate-slider",1,"option-label"],["id","voice-rate-slider","type","range","min","50","max","200","step","10",1,"option-slider",3,"ngModelChange","input","ngModel"],[1,"error-icon"],[1,"error-message"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),p(4,"palette"),l(),s(5,"span"),p(6,"Appearance"),l()(),s(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),j("ngModelChange",function(r){return z(i.selectedTheme,r)||(i.selectedTheme=r),r}),f("change",function(){return i.onThemeChange()}),l(),I(11,"span",7),p(12," Light "),l(),s(13,"label",5)(14,"input",8),j("ngModelChange",function(r){return z(i.selectedTheme,r)||(i.selectedTheme=r),r}),f("change",function(){return i.onThemeChange()}),l(),I(15,"span",7),p(16," Dark "),l(),s(17,"label",5)(18,"input",9),j("ngModelChange",function(r){return z(i.selectedTheme,r)||(i.selectedTheme=r),r}),f("change",function(){return i.onThemeChange()}),l(),I(19,"span",7),p(20," System "),l()()()(),s(21,"div",1)(22,"div",2)(23,"mat-icon"),p(24,"chat_bubble_outline"),l(),s(25,"span"),p(26,"Messaging"),l()(),s(27,"div",3)(28,"span",10),p(29,"Send message behavior:"),l(),s(30,"div",4)(31,"label",5)(32,"input",11),j("ngModelChange",function(r){return z(i.useEnterToSend,r)||(i.useEnterToSend=r),r}),f("change",function(){return i.onEnterToSendChange()}),l(),I(33,"span",7),p(34," Enter to send "),l(),s(35,"label",5)(36,"input",11),j("ngModelChange",function(r){return z(i.useEnterToSend,r)||(i.useEnterToSend=r),r}),f("change",function(){return i.onEnterToSendChange()}),l(),I(37,"span",7),p(38," Enter for new line "),l()()(),s(39,"div",3)(40,"div",12)(41,"span",10),p(42,"Show technical messages"),l(),s(43,"mat-slide-toggle",13),j("ngModelChange",function(r){return z(i.showTechnicalMessages,r)||(i.showTechnicalMessages=r),r}),f("change",function(){return i.onShowTechnicalMessagesChange()}),l()()(),s(44,"div",3)(45,"div",12)(46,"span",10),p(47,"Show warning messages"),l(),s(48,"mat-slide-toggle",13),j("ngModelChange",function(r){return z(i.showWarningMessages,r)||(i.showWarningMessages=r),r}),f("change",function(){return i.onShowWarningMessagesChange()}),l()()(),s(49,"div",3)(50,"div",12)(51,"span",10),p(52,"Include technical messages in print"),l(),s(53,"mat-slide-toggle",13),j("ngModelChange",function(r){return z(i.printTechnicalMessages,r)||(i.printTechnicalMessages=r),r}),f("change",function(){return i.onPrintTechnicalMessagesChange()}),l()()()(),s(54,"div",1)(55,"div",2)(56,"mat-icon"),p(57,"notifications"),l(),s(58,"span"),p(59,"Notifications"),l()(),s(60,"div",3)(61,"div",12)(62,"span",10),p(63,"Notify when the agent answers or requests input"),l(),s(64,"mat-slide-toggle",13),j("ngModelChange",function(r){return z(i.agentNotificationEnabled,r)||(i.agentNotificationEnabled=r),r}),f("change",function(){return i.onAgentNotificationEnabledChange()}),l()()(),s(65,"div",3)(66,"div",12)(67,"span",10),p(68,"Notification sound"),l(),s(69,"mat-slide-toggle",14),j("ngModelChange",function(r){return z(i.notificationSoundEnabled,r)||(i.notificationSoundEnabled=r),r}),f("change",function(){return i.onNotificationSoundEnabledChange()}),l()()(),s(70,"div",3)(71,"div",12)(72,"span",10),p(73,"Browser notification"),l(),s(74,"mat-slide-toggle",14),j("ngModelChange",function(r){return z(i.browserNotificationEnabled,r)||(i.browserNotificationEnabled=r),r}),f("change",function(){return i.onBrowserNotificationEnabledChange()}),l()(),C(75,vy,5,0,"div",15),l()(),s(76,"div",1)(77,"div",2)(78,"mat-icon"),p(79,"record_voice_over"),l(),s(80,"span"),p(81,"Voice & Speech"),l()(),s(82,"div",3)(83,"label",16),p(84,"Voice recognition language:"),l(),s(85,"select",17),j("ngModelChange",function(r){return z(i.selectedVoiceLanguage,r)||(i.selectedVoiceLanguage=r),r}),f("change",function(){return i.onVoiceLanguageChange()}),we(86,yy,2,3,"option",18,_y),l()(),s(88,"div",3)(89,"span",10),p(90,"Automatic announcement:"),l(),s(91,"div",4)(92,"label",5)(93,"input",19),j("ngModelChange",function(r){return z(i.voiceAnnounceEnabled,r)||(i.voiceAnnounceEnabled=r),r}),f("change",function(){return i.onVoiceAnnounceEnabledChange()}),l(),I(94,"span",7),p(95," Enabled "),l(),s(96,"label",5)(97,"input",19),j("ngModelChange",function(r){return z(i.voiceAnnounceEnabled,r)||(i.voiceAnnounceEnabled=r),r}),f("change",function(){return i.onVoiceAnnounceEnabledChange()}),l(),I(98,"span",7),p(99," Disabled "),l()()(),s(100,"div",3)(101,"span",10),p(102,"Voice mode:"),l(),s(103,"div",4)(104,"label",5)(105,"input",20),j("ngModelChange",function(r){return z(i.voiceMode,r)||(i.voiceMode=r),r}),f("change",function(){return i.onVoiceModeChange()}),l(),I(106,"span",7),p(107," Voice synthesis "),l(),s(108,"label",5)(109,"input",21),j("ngModelChange",function(r){return z(i.voiceMode,r)||(i.voiceMode=r),r}),f("change",function(){return i.onVoiceModeChange()}),l(),I(110,"span",7),p(111," Sound notification "),l()()(),s(112,"div",3)(113,"span",10),p(114,"Message reading:"),l(),s(115,"div",4)(116,"label",5)(117,"input",22),j("ngModelChange",function(r){return z(i.voiceReadFullText,r)||(i.voiceReadFullText=r),r}),f("change",function(){return i.onVoiceReadFullTextChange()}),l(),I(118,"span",7),p(119," Full message "),l(),s(120,"label",5)(121,"input",22),j("ngModelChange",function(r){return z(i.voiceReadFullText,r)||(i.voiceReadFullText=r),r}),f("change",function(){return i.onVoiceReadFullTextChange()}),l(),I(122,"span",7),p(123," First paragraphs only "),l()()(),s(124,"div",3)(125,"label",23),p(126,"Selected voice:"),l(),s(127,"select",24),j("ngModelChange",function(r){return z(i.selectedVoiceId,r)||(i.selectedVoiceId=r),r}),f("change",function(){return i.onSelectedVoiceChange()}),C(128,Cy,2,0,"option",25),C(129,xy,2,0,"option",25),we(130,wy,2,2,"option",18,by),l(),I(132,"div",10),s(133,"a",26),f("click",function(){return i.testVoice()}),s(134,"span",27),p(135,"Test voice"),l()()(),s(136,"div",3)(137,"label",28),p(138),l(),s(139,"input",29),j("ngModelChange",function(r){return z(i.voiceVolume,r)||(i.voiceVolume=r),r}),f("input",function(){return i.onVoiceVolumeChange()}),l()(),s(140,"div",3)(141,"label",30),p(142),l(),s(143,"input",31),j("ngModelChange",function(r){return z(i.voiceRate,r)||(i.voiceRate=r),r}),f("input",function(){return i.onVoiceRateChange()}),l()()()()),e&2&&(d(10),V("ngModel",i.selectedTheme),d(4),V("ngModel",i.selectedTheme),d(4),V("ngModel",i.selectedTheme),d(14),w("value",!0),V("ngModel",i.useEnterToSend),d(4),w("value",!1),V("ngModel",i.useEnterToSend),d(7),V("ngModel",i.showTechnicalMessages),d(5),V("ngModel",i.showWarningMessages),d(5),V("ngModel",i.printTechnicalMessages),d(11),V("ngModel",i.agentNotificationEnabled),d(5),V("ngModel",i.notificationSoundEnabled),w("disabled",!i.agentNotificationEnabled),d(5),V("ngModel",i.browserNotificationEnabled),w("disabled",!i.agentNotificationEnabled||i.browserNotificationDenied),d(),x(i.browserNotificationDenied?75:-1),d(10),V("ngModel",i.selectedVoiceLanguage),d(),Se(i.voiceLanguageOptions),d(7),w("value",!0),V("ngModel",i.voiceAnnounceEnabled),d(4),w("value",!1),V("ngModel",i.voiceAnnounceEnabled),d(8),V("ngModel",i.voiceMode),d(4),V("ngModel",i.voiceMode),d(8),w("value",!0),V("ngModel",i.voiceReadFullText),d(4),w("value",!1),V("ngModel",i.voiceReadFullText),d(6),V("ngModel",i.selectedVoiceId),w("disabled",i.loadingVoices||i.availableVoices.length===0),d(),x(i.loadingVoices?128:-1),d(),x(!i.loadingVoices&&i.availableVoices.length===0?129:-1),d(),Se(i.availableVoices),d(8),ie("Volume: ",i.voiceVolume,"%"),d(),V("ngModel",i.voiceVolume),d(3),ie("Speed: ",i.voiceRate,"%"),d(),V("ngModel",i.voiceRate))},dependencies:[Ue,ns,os,je,qm,Gm,jo,Be,He,he,bo],styles:['.options-content[_ngcontent-%COMP%]{padding:0;width:100%}.option-group[_ngcontent-%COMP%]{padding:0 1rem 1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border-light)}.option-group[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.option-label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;color:var(--color-text);font-size:.875rem}.toggle-option[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.toggle-option[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0;flex:1}.toggle-option[_ngcontent-%COMP%] mat-slide-toggle[_ngcontent-%COMP%]{flex-shrink:0}.option-select[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-input-bg);color:var(--color-text);font-size:.875rem;cursor:pointer}.option-select[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 3px #7064fb1a}.option-select[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.option-select[_ngcontent-%COMP%] option[_ngcontent-%COMP%]{padding:.5rem}.option-checkbox[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]{width:18px;height:18px;border:2px solid var(--color-border);border-radius:3px;margin-right:.75rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{content:"";width:10px;height:6px;border-left:2px solid transparent;border-bottom:2px solid transparent;transform:rotate(-45deg);transition:all .2s ease;opacity:0}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]{background-color:var(--color-primary);border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]:after{border-left-color:#fff;border-bottom-color:#fff;opacity:1}.option-checkbox[_ngcontent-%COMP%]:hover .checkmark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%]:focus-within .checkmark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-section[_ngcontent-%COMP%]{padding-top:1rem;margin-top:1rem;border-top:2px solid var(--color-border)}.option-section[_ngcontent-%COMP%]:first-child{border-top:none;padding-top:0;margin-top:0}.section-title[_ngcontent-%COMP%]{margin:0 0 1rem;padding:0 1rem;font-size:.9rem;font-weight:600;color:var(--color-text);display:flex;align-items:center;gap:.5rem}.section-title[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.option-radio[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{display:none}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid var(--color-border);border-radius:50%;margin-right:.5rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0;position:relative}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]:after{content:"";width:8px;height:8px;border-radius:50%;background-color:var(--color-primary);transition:all .2s ease;opacity:0;transform:scale(0)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]:after{opacity:1;transform:scale(1)}.option-radio[_ngcontent-%COMP%]:hover .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%]:focus-within .radio-mark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-slider[_ngcontent-%COMP%]{width:100%;height:6px;border-radius:3px;background:var(--color-bg-solid);outline:none;cursor:pointer;-webkit-appearance:none;appearance:none}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-webkit-slider-track{height:6px;border-radius:3px;background:var(--color-bg-secondary)}.option-slider[_ngcontent-%COMP%]::-moz-range-track{height:6px;border-radius:3px;background:var(--color-bg-secondary);border:none}.option-slider[_ngcontent-%COMP%]:focus{outline:none}.option-slider[_ngcontent-%COMP%]:focus::-webkit-slider-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.option-slider[_ngcontent-%COMP%]:focus::-moz-range-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.test-voice-btn[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;background:var(--color-primary);color:#fff;border:none;border-radius:6px;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;gap:.5rem}.test-voice-btn[_ngcontent-%COMP%]:hover{background:var(--color-primary-hover);transform:translateY(-1px);box-shadow:0 2px 8px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:active{transform:translateY(0);box-shadow:0 1px 4px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:focus{outline:none;box-shadow:0 0 0 3px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:disabled{background:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;transform:none;box-shadow:none}.test-voice-link[_ngcontent-%COMP%]{text-decoration-thickness:1.5px;text-underline-offset:3px;background:transparent;border:none;padding:0;font-size:.775rem;font-weight:400;cursor:pointer;transition:all .2s ease;display:inline-flex;align-items:center;justify-content:center;gap:.5rem;text-decoration:underline}.test-voice-link[_ngcontent-%COMP%]:hover{color:var(--color-primary-hover, var(--color-primary));text-decoration-thickness:2px}.test-voice-link[_ngcontent-%COMP%]:active{opacity:.8}.test-voice-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.test-voice-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.notification-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;padding:.75rem;margin-top:.75rem;background-color:#d32f2f1a;border:1px solid rgba(211,47,47,.3);border-radius:6px;font-size:.8125rem;line-height:1.5}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#d32f2f;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{color:var(--color-text);flex:1}.notification-error[_ngcontent-%COMP%]{margin-top:.75rem;padding:.75rem;background-color:#f443361a;border:1px solid rgba(244,67,54,.3);border-radius:6px;display:flex;align-items:flex-start;gap:.5rem}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#f44336;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text);line-height:1.5;flex:1}']})};var Sy=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(i,n){},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}
369
+ `],encapsulation:2,changeDetection:0})}return o})(),ky={passive:!0},Yu=(()=>{class o{_platform=m(tt);_ngZone=m(pe);_renderer=m(hi).createRenderer(null,null);_styleLoader=m(Nt);_monitoredElements=new Map;constructor(){}monitor(e){if(!this._platform.isBrowser)return am;this._styleLoader.load(Sy);let i=Lr(e),n=this._monitoredElements.get(i);if(n)return n.subject;let r=new R,a="cdk-text-field-autofilled",c=g=>{g.animationName==="cdk-text-field-autofill-start"&&!i.classList.contains(a)?(i.classList.add(a),this._ngZone.run(()=>r.next({target:g.target,isAutofilled:!0}))):g.animationName==="cdk-text-field-autofill-end"&&i.classList.contains(a)&&(i.classList.remove(a),this._ngZone.run(()=>r.next({target:g.target,isAutofilled:!1})))},h=this._ngZone.runOutsideAngular(()=>(i.classList.add("cdk-text-field-autofill-monitored"),this._renderer.listen(i,"animationstart",c,ky)));return this._monitoredElements.set(i,{subject:r,unlisten:h}),r}stopMonitoring(e){let i=Lr(e),n=this._monitoredElements.get(i);n&&(n.unlisten(),n.subject.complete(),i.classList.remove("cdk-text-field-autofill-monitored"),i.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(i))}ngOnDestroy(){this._monitoredElements.forEach((e,i)=>this.stopMonitoring(i))}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var Qu=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({})}return o})();var Xu=new oe("MAT_INPUT_VALUE_ACCESSOR");var Ed=class{_box;_destroyed=new R;_resizeSubject=new R;_resizeObserver;_elementObservables=new Map;constructor(t){this._box=t,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(e=>this._resizeSubject.next(e)))}observe(t){return this._elementObservables.has(t)||this._elementObservables.set(t,new Ii(e=>{let i=this._resizeSubject.subscribe(e);return this._resizeObserver?.observe(t,{box:this._box}),()=>{this._resizeObserver?.unobserve(t),i.unsubscribe(),this._elementObservables.delete(t)}}).pipe(me(e=>e.some(i=>i.target===t)),Ar({bufferSize:1,refCount:!0}),N(this._destroyed))),this._elementObservables.get(t)}destroy(){this._destroyed.next(),this._destroyed.complete(),this._resizeSubject.complete(),this._elementObservables.clear()}},Ku=(()=>{class o{_cleanupErrorListener;_observers=new Map;_ngZone=m(pe);constructor(){typeof ResizeObserver<"u"}ngOnDestroy(){for(let[,e]of this._observers)e.destroy();this._observers.clear(),this._cleanupErrorListener?.()}observe(e,i){let n=i?.box||"content-box";return this._observers.has(n)||this._observers.set(n,new Ed(n)),this._observers.get(n).observe(e)}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var My=["notch"],Ty=["matFormFieldNotchedOutline",""],Ey=["*"],Zu=["iconPrefixContainer"],Ju=["textPrefixContainer"],eg=["iconSuffixContainer"],tg=["textSuffixContainer"],Py=["textField"],Oy=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],Ay=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function Iy(o,t){o&1&&I(0,"span",21)}function Dy(o,t){if(o&1&&(s(0,"label",20),ue(1,1),C(2,Iy,1,0,"span",21),l()),o&2){let e=u(2);w("floating",e._shouldLabelFloat())("monitorResize",e._hasOutline())("id",e._labelId),J("for",e._control.disableAutomaticLabeling?null:e._control.id),d(2),x(!e.hideRequiredMarker&&e._control.required?2:-1)}}function Ry(o,t){if(o&1&&C(0,Dy,3,5,"label",20),o&2){let e=u();x(e._hasFloatingLabel()?0:-1)}}function Fy(o,t){o&1&&I(0,"div",7)}function Ny(o,t){}function Ly(o,t){if(o&1&&Re(0,Ny,0,0,"ng-template",13),o&2){u(2);let e=Et(1);w("ngTemplateOutlet",e)}}function Vy(o,t){if(o&1&&(s(0,"div",9),C(1,Ly,1,1,null,13),l()),o&2){let e=u();w("matFormFieldNotchedOutlineOpen",e._shouldLabelFloat()),d(),x(e._forceDisplayInfixLabel()?-1:1)}}function zy(o,t){o&1&&(s(0,"div",10,2),ue(2,2),l())}function jy(o,t){o&1&&(s(0,"div",11,3),ue(2,3),l())}function By(o,t){}function Hy(o,t){if(o&1&&Re(0,By,0,0,"ng-template",13),o&2){u();let e=Et(1);w("ngTemplateOutlet",e)}}function Uy(o,t){o&1&&(s(0,"div",14,4),ue(2,4),l())}function Wy(o,t){o&1&&(s(0,"div",15,5),ue(2,5),l())}function $y(o,t){o&1&&I(0,"div",16)}function qy(o,t){o&1&&(s(0,"div",18),ue(1,6),l())}function Gy(o,t){if(o&1&&(s(0,"mat-hint",22),p(1),l()),o&2){let e=u(2);w("id",e._hintLabelId),d(),O(e.hintLabel)}}function Yy(o,t){if(o&1&&(s(0,"div",19),C(1,Gy,2,2,"mat-hint",22),ue(2,7),I(3,"div",23),ue(4,8),l()),o&2){let e=u();d(),x(e.hintLabel?1:-1)}}var Ht=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["mat-label"]]})}return o})(),Qy=new oe("MatError");var xn=(()=>{class o{align="start";id=m(Ne).getId("mat-mdc-hint-");static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(i,n){i&2&&(Jt("id",n.id),J("align",null),E("mat-mdc-form-field-hint-end",n.align==="end"))},inputs:{align:"align",id:"id"}})}return o})(),lg=new oe("MatPrefix"),vo=(()=>{class o{set _isTextSelector(e){this._isText=!0}_isText=!1;static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["","matPrefix",""],["","matIconPrefix",""],["","matTextPrefix",""]],inputs:{_isTextSelector:[0,"matTextPrefix","_isTextSelector"]},features:[Ye([{provide:lg,useExisting:o}])]})}return o})(),Xy=new oe("MatSuffix");var cg=new oe("FloatingLabelParent"),ig=(()=>{class o{_elementRef=m(ne);get floating(){return this._floating}set floating(e){this._floating=e,this.monitorResize&&this._handleResize()}_floating=!1;get monitorResize(){return this._monitorResize}set monitorResize(e){this._monitorResize=e,this._monitorResize?this._subscribeToResize():this._resizeSubscription.unsubscribe()}_monitorResize=!1;_resizeObserver=m(Ku);_ngZone=m(pe);_parent=m(cg);_resizeSubscription=new Ai;constructor(){}ngOnDestroy(){this._resizeSubscription.unsubscribe()}getWidth(){return Ky(this._elementRef.nativeElement)}get element(){return this._elementRef.nativeElement}_handleResize(){setTimeout(()=>this._parent._handleLabelResized())}_subscribeToResize(){this._resizeSubscription.unsubscribe(),this._ngZone.runOutsideAngular(()=>{this._resizeSubscription=this._resizeObserver.observe(this._elementRef.nativeElement,{box:"border-box"}).subscribe(()=>this._handleResize())})}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(i,n){i&2&&E("mdc-floating-label--float-above",n.floating)},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return o})();function Ky(o){let t=o;if(t.offsetParent!==null)return t.scrollWidth;let e=t.cloneNode(!0);e.style.setProperty("position","absolute"),e.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(e);let i=e.scrollWidth;return e.remove(),i}var ng="mdc-line-ripple--active",xl="mdc-line-ripple--deactivating",og=(()=>{class o{_elementRef=m(ne);_cleanupTransitionEnd;constructor(){let e=m(pe),i=m(Ct);e.runOutsideAngular(()=>{this._cleanupTransitionEnd=i.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd)})}activate(){let e=this._elementRef.nativeElement.classList;e.remove(xl),e.add(ng)}deactivate(){this._elementRef.nativeElement.classList.add(xl)}_handleTransitionEnd=e=>{let i=this._elementRef.nativeElement.classList,n=i.contains(xl);e.propertyName==="opacity"&&n&&i.remove(ng,xl)};ngOnDestroy(){this._cleanupTransitionEnd()}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return o})(),rg=(()=>{class o{_elementRef=m(ne);_ngZone=m(pe);open=!1;_notch;ngAfterViewInit(){let e=this._elementRef.nativeElement,i=e.querySelector(".mdc-floating-label");i?(e.classList.add("mdc-notched-outline--upgraded"),typeof requestAnimationFrame=="function"&&(i.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>i.style.transitionDuration="")}))):e.classList.add("mdc-notched-outline--no-label")}_setNotchWidth(e){let i=this._notch.nativeElement;!this.open||!e?i.style.width="":i.style.width=`calc(${e}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + 9px)`}_setMaxWidth(e){this._notch.nativeElement.style.setProperty("--mat-form-field-notch-max-width",`calc(100% - ${e}px)`)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(i,n){if(i&1&&X(My,5),i&2){let r;U(r=W())&&(n._notch=r.first)}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(i,n){i&2&&E("mdc-notched-outline--notched",n.open)},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},attrs:Ty,ngContentSelectors:Ey,decls:5,vars:0,consts:[["notch",""],[1,"mat-mdc-notch-piece","mdc-notched-outline__leading"],[1,"mat-mdc-notch-piece","mdc-notched-outline__notch"],[1,"mat-mdc-notch-piece","mdc-notched-outline__trailing"]],template:function(i,n){i&1&&(We(),eo(0,"div",1),ii(1,"div",2,0),ue(3),ni(),eo(4,"div",3))},encapsulation:2,changeDetection:0})}return o})(),fa=(()=>{class o{value;stateChanges;id;placeholder;ngControl;focused;empty;shouldLabelFloat;required;disabled;errorState;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;describedByIds;static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o})}return o})();var _a=new oe("MatFormField"),Zy=new oe("MAT_FORM_FIELD_DEFAULT_OPTIONS"),ag="fill",Jy="auto",sg="fixed",eC="translateY(-50%)",Ut=(()=>{class o{_elementRef=m(ne);_changeDetectorRef=m(Qe);_platform=m(tt);_idGenerator=m(Ne);_ngZone=m(pe);_defaults=m(Zy,{optional:!0});_currentDirection;_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_iconPrefixContainerSignal=Fr("iconPrefixContainer");_textPrefixContainerSignal=Fr("textPrefixContainer");_iconSuffixContainerSignal=Fr("iconSuffixContainer");_textSuffixContainerSignal=Fr("textSuffixContainer");_prefixSuffixContainers=ui(()=>[this._iconPrefixContainerSignal(),this._textPrefixContainerSignal(),this._iconSuffixContainerSignal(),this._textSuffixContainerSignal()].map(e=>e?.nativeElement).filter(e=>e!==void 0));_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=km(Ht);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(e){this._hideRequiredMarker=Pt(e)}_hideRequiredMarker=!1;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||Jy}set floatLabel(e){e!==this._floatLabel&&(this._floatLabel=e,this._changeDetectorRef.markForCheck())}_floatLabel;get appearance(){return this._appearanceSignal()}set appearance(e){let i=e||this._defaults?.appearance||ag;this._appearanceSignal.set(i)}_appearanceSignal=Oe(ag);get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||sg}set subscriptSizing(e){this._subscriptSizing=e||this._defaults?.subscriptSizing||sg}_subscriptSizing=null;get hintLabel(){return this._hintLabel}set hintLabel(e){this._hintLabel=e,this._processHints()}_hintLabel="";_hasIconPrefix=!1;_hasTextPrefix=!1;_hasIconSuffix=!1;_hasTextSuffix=!1;_labelId=this._idGenerator.getId("mat-mdc-form-field-label-");_hintLabelId=this._idGenerator.getId("mat-mdc-hint-");_describedByIds;get _control(){return this._explicitFormFieldControl||this._formFieldControl}set _control(e){this._explicitFormFieldControl=e}_destroyed=new R;_isFocused=null;_explicitFormFieldControl;_previousControl=null;_previousControlValidatorFn=null;_stateChanges;_valueChanges;_describedByChanges;_outlineLabelOffsetResizeObserver=null;_animationsDisabled=$e();constructor(){let e=this._defaults,i=m(bt);e&&(e.appearance&&(this.appearance=e.appearance),this._hideRequiredMarker=!!e?.hideRequiredMarker,e.color&&(this.color=e.color)),no(()=>this._currentDirection=i.valueSignal()),this._syncOutlineLabelOffset()}ngAfterViewInit(){this._updateFocusState(),this._animationsDisabled||this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-form-field-animations-enabled")},300)}),this._changeDetectorRef.detectChanges()}ngAfterContentInit(){this._assertFormFieldControl(),this._initializeSubscript(),this._initializePrefixAndSuffix()}ngAfterContentChecked(){this._assertFormFieldControl(),this._control!==this._previousControl&&(this._initializeControl(this._previousControl),this._control.ngControl&&this._control.ngControl.control&&(this._previousControlValidatorFn=this._control.ngControl.control.validator),this._previousControl=this._control),this._control.ngControl&&this._control.ngControl.control&&this._control.ngControl.control.validator!==this._previousControlValidatorFn&&this._changeDetectorRef.markForCheck()}ngOnDestroy(){this._outlineLabelOffsetResizeObserver?.disconnect(),this._stateChanges?.unsubscribe(),this._valueChanges?.unsubscribe(),this._describedByChanges?.unsubscribe(),this._destroyed.next(),this._destroyed.complete()}getLabelId=ui(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always")}_initializeControl(e){let i=this._control,n="mat-mdc-form-field-type-";e&&this._elementRef.nativeElement.classList.remove(n+e.controlType),i.controlType&&this._elementRef.nativeElement.classList.add(n+i.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=i.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck()}),this._describedByChanges?.unsubscribe(),this._describedByChanges=i.stateChanges.pipe(Mt([void 0,void 0]),ve(()=>[i.errorState,i.userAriaDescribedBy]),Io(),me(([[r,a],[c,h]])=>r!==c||a!==h)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),i.ngControl&&i.ngControl.valueChanges&&(this._valueChanges=i.ngControl.valueChanges.pipe(N(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()))}_checkPrefixAndSuffixTypes(){this._hasIconPrefix=!!this._prefixChildren.find(e=>!e._isText),this._hasTextPrefix=!!this._prefixChildren.find(e=>e._isText),this._hasIconSuffix=!!this._suffixChildren.find(e=>!e._isText),this._hasTextSuffix=!!this._suffixChildren.find(e=>e._isText)}_initializePrefixAndSuffix(){this._checkPrefixAndSuffixTypes(),Di(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._checkPrefixAndSuffixTypes(),this._changeDetectorRef.markForCheck()})}_initializeSubscript(){this._hintChildren.changes.subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._validateHints(),this._syncDescribedByIds()}_assertFormFieldControl(){this._control}_updateFocusState(){let e=this._control.focused;e&&!this._isFocused?(this._isFocused=!0,this._lineRipple?.activate()):!e&&(this._isFocused||this._isFocused===null)&&(this._isFocused=!1,this._lineRipple?.deactivate()),this._elementRef.nativeElement.classList.toggle("mat-focused",e),this._textField?.nativeElement.classList.toggle("mdc-text-field--focused",e)}_syncOutlineLabelOffset(){Mm({earlyRead:()=>{if(this._appearanceSignal()!=="outline")return this._outlineLabelOffsetResizeObserver?.disconnect(),null;if(globalThis.ResizeObserver){this._outlineLabelOffsetResizeObserver||=new globalThis.ResizeObserver(()=>{this._writeOutlinedLabelStyles(this._getOutlinedLabelOffset())});for(let e of this._prefixSuffixContainers())this._outlineLabelOffsetResizeObserver.observe(e,{box:"border-box"})}return this._getOutlinedLabelOffset()},write:e=>this._writeOutlinedLabelStyles(e())})}_shouldAlwaysFloat(){return this.floatLabel==="always"}_hasOutline(){return this.appearance==="outline"}_forceDisplayInfixLabel(){return!this._platform.isBrowser&&this._prefixChildren.length&&!this._shouldLabelFloat()}_hasFloatingLabel=ui(()=>!!this._labelChild());_shouldLabelFloat(){return this._hasFloatingLabel()?this._control.shouldLabelFloat||this._shouldAlwaysFloat():!1}_shouldForward(e){let i=this._control?this._control.ngControl:null;return i&&i[e]}_getSubscriptMessageType(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_handleLabelResized(){this._refreshOutlineNotchWidth()}_refreshOutlineNotchWidth(){!this._hasOutline()||!this._floatingLabel||!this._shouldLabelFloat()?this._notchedOutline?._setNotchWidth(0):this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth())}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){this._hintChildren}_syncDescribedByIds(){if(this._control){let e=[];if(this._control.userAriaDescribedBy&&typeof this._control.userAriaDescribedBy=="string"&&e.push(...this._control.userAriaDescribedBy.split(" ")),this._getSubscriptMessageType()==="hint"){let r=this._hintChildren?this._hintChildren.find(c=>c.align==="start"):null,a=this._hintChildren?this._hintChildren.find(c=>c.align==="end"):null;r?e.push(r.id):this._hintLabel&&e.push(this._hintLabelId),a&&e.push(a.id)}else this._errorChildren&&e.push(...this._errorChildren.map(r=>r.id));let i=this._control.describedByIds,n;if(i){let r=this._describedByIds||e;n=e.concat(i.filter(a=>a&&!r.includes(a)))}else n=e;this._control.setDescribedByIds(n),this._describedByIds=e}}_getOutlinedLabelOffset(){if(!this._hasOutline()||!this._floatingLabel)return null;if(!this._iconPrefixContainer&&!this._textPrefixContainer)return["",null];if(!this._isAttachedToDom())return null;let e=this._iconPrefixContainer?.nativeElement,i=this._textPrefixContainer?.nativeElement,n=this._iconSuffixContainer?.nativeElement,r=this._textSuffixContainer?.nativeElement,a=e?.getBoundingClientRect().width??0,c=i?.getBoundingClientRect().width??0,h=n?.getBoundingClientRect().width??0,g=r?.getBoundingClientRect().width??0,y=this._currentDirection==="rtl"?"-1":"1",S=`${a+c}px`,F=`calc(${y} * (${S} + var(--mat-mdc-form-field-label-offset-x, 0px)))`,T=`var(--mat-mdc-form-field-label-transform, ${eC} translateX(${F}))`,B=a+c+h+g;return[T,B]}_writeOutlinedLabelStyles(e){if(e!==null){let[i,n]=e;this._floatingLabel&&(this._floatingLabel.element.style.transform=i),n!==null&&this._notchedOutline?._setMaxWidth(n)}}_isAttachedToDom(){let e=this._elementRef.nativeElement;if(e.getRootNode){let i=e.getRootNode();return i&&i!==e}return document.documentElement.contains(e)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-form-field"]],contentQueries:function(i,n,r){if(i&1&&(ym(r,n._labelChild,Ht,5),xt(r,fa,5),xt(r,lg,5),xt(r,Xy,5),xt(r,Qy,5),xt(r,xn,5)),i&2){tc();let a;U(a=W())&&(n._formFieldControl=a.first),U(a=W())&&(n._prefixChildren=a),U(a=W())&&(n._suffixChildren=a),U(a=W())&&(n._errorChildren=a),U(a=W())&&(n._hintChildren=a)}},viewQuery:function(i,n){if(i&1&&(Dr(n._iconPrefixContainerSignal,Zu,5),Dr(n._textPrefixContainerSignal,Ju,5),Dr(n._iconSuffixContainerSignal,eg,5),Dr(n._textSuffixContainerSignal,tg,5),X(Py,5),X(Zu,5),X(Ju,5),X(eg,5),X(tg,5),X(ig,5),X(rg,5),X(og,5)),i&2){tc(4);let r;U(r=W())&&(n._textField=r.first),U(r=W())&&(n._iconPrefixContainer=r.first),U(r=W())&&(n._textPrefixContainer=r.first),U(r=W())&&(n._iconSuffixContainer=r.first),U(r=W())&&(n._textSuffixContainer=r.first),U(r=W())&&(n._floatingLabel=r.first),U(r=W())&&(n._notchedOutline=r.first),U(r=W())&&(n._lineRipple=r.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:38,hostBindings:function(i,n){i&2&&E("mat-mdc-form-field-label-always-float",n._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",n._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",n._hasIconSuffix)("mat-form-field-invalid",n._control.errorState)("mat-form-field-disabled",n._control.disabled)("mat-form-field-autofilled",n._control.autofilled)("mat-form-field-appearance-fill",n.appearance=="fill")("mat-form-field-appearance-outline",n.appearance=="outline")("mat-form-field-hide-placeholder",n._hasFloatingLabel()&&!n._shouldLabelFloat())("mat-primary",n.color!=="accent"&&n.color!=="warn")("mat-accent",n.color==="accent")("mat-warn",n.color==="warn")("ng-untouched",n._shouldForward("untouched"))("ng-touched",n._shouldForward("touched"))("ng-pristine",n._shouldForward("pristine"))("ng-dirty",n._shouldForward("dirty"))("ng-valid",n._shouldForward("valid"))("ng-invalid",n._shouldForward("invalid"))("ng-pending",n._shouldForward("pending"))},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[Ye([{provide:_a,useExisting:o},{provide:cg,useExisting:o}])],ngContentSelectors:Ay,decls:18,vars:21,consts:[["labelTemplate",""],["textField",""],["iconPrefixContainer",""],["textPrefixContainer",""],["textSuffixContainer",""],["iconSuffixContainer",""],[1,"mat-mdc-text-field-wrapper","mdc-text-field",3,"click"],[1,"mat-mdc-form-field-focus-overlay"],[1,"mat-mdc-form-field-flex"],["matFormFieldNotchedOutline","",3,"matFormFieldNotchedOutlineOpen"],[1,"mat-mdc-form-field-icon-prefix"],[1,"mat-mdc-form-field-text-prefix"],[1,"mat-mdc-form-field-infix"],[3,"ngTemplateOutlet"],[1,"mat-mdc-form-field-text-suffix"],[1,"mat-mdc-form-field-icon-suffix"],["matFormFieldLineRipple",""],["aria-atomic","true","aria-live","polite",1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],[1,"mat-mdc-form-field-error-wrapper"],[1,"mat-mdc-form-field-hint-wrapper"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(i,n){if(i&1){let r=k();We(Oy),Re(0,Ry,1,1,"ng-template",null,0,Do),s(2,"div",6,1),f("click",function(c){return b(r),v(n._control.onContainerClick(c))}),C(4,Fy,1,0,"div",7),s(5,"div",8),C(6,Vy,2,2,"div",9),C(7,zy,3,0,"div",10),C(8,jy,3,0,"div",11),s(9,"div",12),C(10,Hy,1,1,null,13),ue(11),l(),C(12,Uy,3,0,"div",14),C(13,Wy,3,0,"div",15),l(),C(14,$y,1,0,"div",16),l(),s(15,"div",17),C(16,qy,2,0,"div",18)(17,Yy,5,1,"div",19),l()}if(i&2){let r;d(2),E("mdc-text-field--filled",!n._hasOutline())("mdc-text-field--outlined",n._hasOutline())("mdc-text-field--no-label",!n._hasFloatingLabel())("mdc-text-field--disabled",n._control.disabled)("mdc-text-field--invalid",n._control.errorState),d(2),x(!n._hasOutline()&&!n._control.disabled?4:-1),d(2),x(n._hasOutline()?6:-1),d(),x(n._hasIconPrefix?7:-1),d(),x(n._hasTextPrefix?8:-1),d(2),x(!n._hasOutline()||n._forceDisplayInfixLabel()?10:-1),d(2),x(n._hasTextSuffix?12:-1),d(),x(n._hasIconSuffix?13:-1),d(),x(n._hasOutline()?-1:14),d(),E("mat-mdc-form-field-subscript-dynamic-size",n.subscriptSizing==="dynamic");let a=n._getSubscriptMessageType();d(),x((r=a)==="error"?16:r==="hint"?17:-1)}},dependencies:[ig,rg,Ro,og,xn],styles:[`.mdc-text-field{display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-text-field__input{width:100%;min-width:0;border:none;border-radius:0;background:none;padding:0;-moz-appearance:none;-webkit-appearance:none;height:28px}.mdc-text-field__input::-webkit-calendar-picker-indicator,.mdc-text-field__input::-webkit-search-cancel-button{display:none}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}.mdc-text-field__input::placeholder{opacity:0}.mdc-text-field__input::-moz-placeholder{opacity:0}.mdc-text-field__input::-webkit-input-placeholder{opacity:0}.mdc-text-field__input:-ms-input-placeholder{opacity:0}.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{opacity:1}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-moz-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-webkit-input-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive:-ms-input-placeholder{opacity:0}.mdc-text-field--outlined .mdc-text-field__input,.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:rgba(0,0,0,0)}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-filled-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-filled-caret-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-outlined-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-outlined-caret-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-filled-error-caret-color, var(--mat-sys-error))}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-outlined-error-caret-color, var(--mat-sys-error))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-filled-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-outlined-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}}.mdc-text-field--filled{height:56px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small));border-top-right-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--mat-form-field-filled-container-color, var(--mat-sys-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled{background-color:var(--mat-form-field-filled-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 4%, transparent))}.mdc-text-field--outlined{height:56px;overflow:visible;padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)));padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px)}[dir=rtl] .mdc-text-field--outlined{padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px);padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}.mdc-floating-label{position:absolute;left:0;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform}[dir=rtl] .mdc-floating-label{right:0;left:auto;transform-origin:right top;text-align:right}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:auto}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label{left:auto;right:4px}.mdc-text-field--filled .mdc-floating-label{left:16px;right:auto}[dir=rtl] .mdc-text-field--filled .mdc-floating-label{left:auto;right:16px}.mdc-text-field--disabled .mdc-floating-label{cursor:default}@media(forced-colors: active){.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-filled-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-filled-hover-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-filled-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-filled-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-filled-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--filled .mdc-floating-label{font-family:var(--mat-form-field-filled-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-filled-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-filled-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-filled-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-outlined-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-outlined-hover-label-text-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-outlined-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-outlined-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-outlined-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined .mdc-floating-label{font-family:var(--mat-form-field-outlined-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-outlined-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-outlined-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-outlined-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-floating-label--float-above{cursor:auto;transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1);font-size:.75rem}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:133.3333333333%}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:1px;margin-right:0;content:"*"}[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:0;margin-right:1px}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline{text-align:right}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mat-mdc-notch-piece{box-sizing:border-box;height:100%;pointer-events:none;border-top:1px solid;border-bottom:1px solid}.mdc-text-field--focused .mat-mdc-notch-piece{border-width:2px}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-outline-color, var(--mat-sys-outline));border-width:var(--mat-form-field-outlined-outline-width, 1px)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-hover-outline-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-focus-outline-color, var(--mat-sys-primary))}.mdc-text-field--outlined.mdc-text-field--disabled .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-notched-outline .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-hover-outline-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-focus-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mat-mdc-notch-piece{border-width:var(--mat-form-field-outlined-focus-outline-width, 2px)}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}[dir=rtl] .mdc-notched-outline__leading{border-left:none;border-right:1px solid;border-bottom-left-radius:0;border-top-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__trailing{flex-grow:1;border-left:none;border-right:1px solid;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}[dir=rtl] .mdc-notched-outline__trailing{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__notch{flex:0 0 auto;width:auto}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:min(var(--mat-form-field-notch-max-width, 100%),calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{max-width:min(100%,calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{z-index:1;border-bottom-width:var(--mat-form-field-filled-active-indicator-height, 1px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-active-indicator-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-hover-active-indicator-color, var(--mat-sys-on-surface))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-disabled-active-indicator-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-active-indicator-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-hover-active-indicator-color, var(--mat-sys-on-error-container))}.mdc-line-ripple::after{transform:scaleX(0);opacity:0;z-index:2}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-width:var(--mat-form-field-filled-focus-active-indicator-height, 2px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-focus-active-indicator-color, var(--mat-sys-primary))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-error-focus-active-indicator-color, var(--mat-sys-error))}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-text-field--disabled{pointer-events:none}.mat-mdc-form-field-textarea-control{vertical-align:middle;resize:vertical;box-sizing:border-box;height:auto;margin:0;padding:0;border:none;overflow:auto}.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font:inherit;letter-spacing:inherit;text-decoration:inherit;text-transform:inherit;border:none}.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;line-height:normal;pointer-events:all;will-change:auto}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{cursor:inherit}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:auto}.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color]{height:23px}.mat-mdc-text-field-wrapper{height:auto;flex:auto;will-change:auto}.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-left:0;--mat-mdc-form-field-label-offset-x: -16px}.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-right:0}[dir=rtl] .mat-mdc-text-field-wrapper{padding-left:16px;padding-right:16px}[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-left:0}[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-right:0}.mat-form-field-disabled .mdc-text-field__input::placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label{left:auto;right:auto}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input{display:inline-block}.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch{padding-top:0}.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:1px solid rgba(0,0,0,0)}[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none;border-right:1px solid rgba(0,0,0,0)}.mat-mdc-form-field-infix{min-height:var(--mat-form-field-container-height, 56px);padding-top:var(--mat-form-field-filled-with-label-container-padding-top, 24px);padding-bottom:var(--mat-form-field-filled-with-label-container-padding-bottom, 8px)}.mdc-text-field--outlined .mat-mdc-form-field-infix,.mdc-text-field--no-label .mat-mdc-form-field-infix{padding-top:var(--mat-form-field-container-vertical-padding, 16px);padding-bottom:var(--mat-form-field-container-vertical-padding, 16px)}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:calc(var(--mat-form-field-container-height, 56px)/2)}.mdc-text-field--filled .mat-mdc-floating-label{display:var(--mat-form-field-filled-label-display, block)}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height, 56px) / 2) * -1)) scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));transform:var(--mat-mdc-form-field-label-transform)}@keyframes _mat-form-field-subscript-animation{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.mat-mdc-form-field-subscript-wrapper{box-sizing:border-box;width:100%;position:relative}.mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-error-wrapper{position:absolute;top:0;left:0;right:0;padding:0 16px;opacity:1;transform:translateY(0);animation:_mat-form-field-subscript-animation 0ms cubic-bezier(0.55, 0, 0.55, 0.2)}.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper{position:static}.mat-mdc-form-field-bottom-align::before{content:"";display:inline-block;height:16px}.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before{content:unset}.mat-mdc-form-field-hint-end{order:1}.mat-mdc-form-field-hint-wrapper{display:flex}.mat-mdc-form-field-hint-spacer{flex:1 0 1em}.mat-mdc-form-field-error{display:block;color:var(--mat-form-field-error-text-color, var(--mat-sys-error))}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align::before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-subscript-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));letter-spacing:var(--mat-form-field-subscript-text-tracking, var(--mat-sys-body-small-tracking));font-weight:var(--mat-form-field-subscript-text-weight, var(--mat-sys-body-small-weight))}.mat-mdc-form-field-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;opacity:0;pointer-events:none;background-color:var(--mat-form-field-state-layer-color, var(--mat-sys-on-surface))}.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-focus-state-layer-opacity, 0)}select.mat-mdc-form-field-input-control{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0);display:inline-flex;box-sizing:border-box}select.mat-mdc-form-field-input-control:not(:disabled){cursor:pointer}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option{color:var(--mat-form-field-select-option-text-color, var(--mat-sys-neutral10))}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled{color:var(--mat-form-field-select-disabled-option-text-color, color-mix(in srgb, var(--mat-sys-neutral10) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:5px solid;position:absolute;right:0;top:50%;margin-top:-2.5px;pointer-events:none;color:var(--mat-form-field-enabled-select-arrow-color, var(--mat-sys-on-surface-variant))}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{right:auto;left:0}.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after{color:var(--mat-form-field-focus-select-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after{color:var(--mat-form-field-disabled-select-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:15px}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:0;padding-left:15px}@media(forced-colors: active){.mat-form-field-appearance-fill .mat-mdc-text-field-wrapper{outline:solid 1px}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper{outline-color:GrayText}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper{outline:dashed 3px}}@media(forced-colors: active){.mat-mdc-form-field.mat-focused .mdc-notched-outline{border:dashed 3px}}.mat-mdc-form-field-input-control[type=date],.mat-mdc-form-field-input-control[type=datetime],.mat-mdc-form-field-input-control[type=datetime-local],.mat-mdc-form-field-input-control[type=month],.mat-mdc-form-field-input-control[type=week],.mat-mdc-form-field-input-control[type=time]{line-height:1}.mat-mdc-form-field-input-control::-webkit-datetime-edit{line-height:1;padding:0;margin-bottom:-2px}.mat-mdc-form-field{--mat-mdc-form-field-floating-label-scale: 0.75;display:inline-flex;flex-direction:column;min-width:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-container-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-form-field-container-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-form-field-container-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-form-field-container-text-tracking, var(--mat-sys-body-large-tracking));font-weight:var(--mat-form-field-container-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(var(--mat-form-field-outlined-label-text-populated-size)*var(--mat-mdc-form-field-floating-label-scale))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mat-form-field-outlined-label-text-populated-size)}[dir=rtl] .mat-mdc-form-field{text-align:right}.mat-mdc-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-mdc-text-field-wrapper{width:100%;z-index:0}.mat-mdc-form-field-icon-prefix,.mat-mdc-form-field-icon-suffix{align-self:center;line-height:0;pointer-events:auto;position:relative;z-index:1}.mat-mdc-form-field-icon-prefix>.mat-icon,.mat-mdc-form-field-icon-suffix>.mat-icon{padding:0 12px;box-sizing:content-box}.mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-leading-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-disabled-leading-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-disabled-trailing-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-invalid .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-trailing-icon-color, var(--mat-sys-error))}.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-hover-trailing-icon-color, var(--mat-sys-on-error-container))}.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-focus-trailing-icon-color, var(--mat-sys-error))}.mat-mdc-form-field-icon-prefix,[dir=rtl] .mat-mdc-form-field-icon-suffix{padding:0 4px 0 0}.mat-mdc-form-field-icon-suffix,[dir=rtl] .mat-mdc-form-field-icon-prefix{padding:0 0 0 4px}.mat-mdc-form-field-subscript-wrapper .mat-icon,.mat-mdc-form-field label .mat-icon{width:1em;height:1em;font-size:inherit}.mat-mdc-form-field-infix{flex:auto;min-width:0;width:180px;position:relative;box-sizing:border-box}.mat-mdc-form-field-infix:has(textarea[cols]){width:auto}.mat-mdc-form-field .mdc-notched-outline__notch{margin-left:-1px;-webkit-clip-path:inset(-9em -999em -9em 1px);clip-path:inset(-9em -999em -9em 1px)}[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch{margin-left:0;margin-right:-1px;-webkit-clip-path:inset(-9em 1px -9em -999em);clip-path:inset(-9em 1px -9em -999em)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-floating-label{transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input{transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-moz-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-webkit-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-error-wrapper{animation-duration:300ms}.mdc-notched-outline .mdc-floating-label{max-width:calc(100% + 1px)}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(133.3333333333% + 1px)}
370
+ `],encapsulation:2,changeDetection:0})}return o})();var wl=(()=>{class o{isErrorState(e,i){return!!(e&&e.invalid&&(e.touched||i&&i.submitted))}static \u0275fac=function(i){return new(i||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var wr=class{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(t,e,i,n,r){this._defaultMatcher=t,this.ngControl=e,this._parentFormGroup=i,this._parentForm=n,this._stateChanges=r}updateErrorState(){let t=this.errorState,e=this._parentFormGroup||this._parentForm,i=this.matcher||this._defaultMatcher,n=this.ngControl?this.ngControl.control:null,r=i?.isErrorState(n,e)??!1;r!==t&&(this.errorState=r,this._stateChanges.next())}};var pt=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({imports:[ce,Vm,Ut,ce]})}return o})();var tC=["button","checkbox","file","hidden","image","radio","range","reset","submit"],iC=new oe("MAT_INPUT_CONFIG"),mi=(()=>{class o{_elementRef=m(ne);_platform=m(tt);ngControl=m(Ja,{optional:!0,self:!0});_autofillMonitor=m(Yu);_ngZone=m(pe);_formField=m(_a,{optional:!0});_renderer=m(Ct);_uid=m(Ne).getId("mat-input-");_previousNativeValue;_inputValueAccessor;_signalBasedValueAccessor;_previousPlaceholder;_errorStateTracker;_config=m(iC,{optional:!0});_cleanupIosKeyup;_cleanupWebkitWheel;_isServer;_isNativeSelect;_isTextarea;_isInFormField;focused=!1;stateChanges=new R;controlType="mat-input";autofilled=!1;get disabled(){return this._disabled}set disabled(e){this._disabled=Pt(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(Za.required)??!1}set required(e){this._required=Pt(e)}_required;get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&rc().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=Pt(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=>rc().has(e));constructor(){let e=m(es,{optional:!0}),i=m(is,{optional:!0}),n=m(wl),r=m(Xu,{optional:!0,self:!0}),a=this._elementRef.nativeElement,c=a.nodeName.toLowerCase();r?La(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 wr(n,this.ngControl,i,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&&no(()=>{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 i=this._elementRef.nativeElement;i.type==="number"?(i.type="text",i.setSelectionRange(0,0),i.type="number"):i.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 i=this._elementRef.nativeElement;this._previousPlaceholder=e,e?i.setAttribute("placeholder",e):i.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){tC.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,i=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&i&&i.label)}else return this.focused&&!this.disabled||!this.empty}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let i=this._elementRef.nativeElement;e.length?i.setAttribute("aria-describedby",e.join(" ")):i.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 i=e.target;!i.value&&i.selectionStart===0&&i.selectionEnd===0&&(i.setSelectionRange(1,1),i.setSelectionRange(0,0))};_getReadonlyAttribute(){return this._isNativeSelect?null:this.readonly||this.disabled&&this.disabledInteractive?"true":null}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:21,hostBindings:function(i,n){i&1&&f("focus",function(){return n._focusChanged(!0)})("blur",function(){return n._focusChanged(!1)})("input",function(){return n._onInput()}),i&2&&(Jt("id",n.id)("disabled",n.disabled&&!n.disabledInteractive)("required",n.required),J("name",n.name||null)("readonly",n._getReadonlyAttribute())("aria-disabled",n.disabled&&n.disabledInteractive?"true":null)("aria-invalid",n.empty&&n.required?null:n.errorState)("aria-required",n.required)("id",n.id),E("mat-input-server",n._isServer)("mat-mdc-form-field-textarea-control",n._isInFormField&&n._isTextarea)("mat-mdc-form-field-input-control",n._isInFormField)("mat-mdc-input-disabled-interactive",n.disabledInteractive)("mdc-text-field__input",n._isInFormField)("mat-mdc-native-select-inline",n._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",ee]},exportAs:["matInput"],features:[Ye([{provide:fa,useExisting:o}]),nt]})}return o})(),Kt=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({imports:[ce,pt,pt,Qu,ce]})}return o})();var nC=(o,t)=>({subThreads:o,depth:t}),oC=o=>({subThreads:o,depth:1}),dg=(o,t)=>t.id,rC=(o,t)=>t.label;function aC(o,t){if(o&1){let e=k();s(0,"mat-icon",10),f("click",function(n){b(e);let r=u().$implicit,a=u(3);return v(a.toggleSubThreads(n,r.id))}),p(1),l()}if(o&2){let e=u().$implicit,i=u(3);d(),O(i.isParentExpanded(e.id)?"expand_more":"chevron_right")}}function sC(o,t){o&1&&to(0)}function lC(o,t){if(o&1&&Re(0,sC,1,0,"ng-container",11),o&2){let e=u().$implicit,i=u().depth;u();let n=Et(1);w("ngTemplateOutlet",n)("ngTemplateOutletContext",xm(2,nC,e.subThreads,i+1))}}function cC(o,t){if(o&1){let e=k();s(0,"div",5)(1,"a",6),f("click",function(n){let r=b(e).$implicit;return u(3).selectThread(r.id),v(n.preventDefault())})("keydown.enter",function(n){let r=b(e).$implicit;return u(3).selectThread(r.id),v(n.preventDefault())})("keydown.space",function(n){let r=b(e).$implicit;return u(3).selectThread(r.id),v(n.preventDefault())}),C(2,aC,2,1,"mat-icon",7),s(3,"span",8),p(4),l(),s(5,"span",9),p(6),l()()(),C(7,lC,1,5,"ng-container")}if(o&2){let e,i=t.$implicit,n=u().depth,r=u(2);oi("--sub-depth",n),E("current",i.id===((e=r.currentThread())==null?null:e.id)),d(2),x(i.subThreads!=null&&i.subThreads.length?2:-1),d(2),O(i.delegatedAgentName||"Agent"),d(2),O(i.delegatedTask||i.name),d(),x(r.isParentExpanded(i.id)&&(i.subThreads!=null&&i.subThreads.length)?7:-1)}}function dC(o,t){if(o&1&&we(0,cC,8,8,null,null,dg),o&2){let e=t.subThreads;Se(e)}}function mC(o,t){o&1&&(s(0,"div",4),I(1,"span",12),s(2,"span",13),p(3,"Loading threads..."),l()())}function pC(o,t){if(o&1&&(s(0,"div",25),p(1),l()),o&2){let e=u(6);d(),O(e.renameErrorMessage)}}function hC(o,t){if(o&1){let e=k();s(0,"div",18)(1,"input",24),j("ngModelChange",function(n){b(e);let r=u(5);return z(r.editingThreadName,n)||(r.editingThreadName=n),v(n)}),f("keydown",function(n){b(e);let r=u(5);return v(r.onEditKeydown(n))})("blur",function(){b(e);let n=u(5);return v(n.onEditBlur())})("click",function(n){return b(e),v(n.stopPropagation())}),l(),C(2,pC,2,1,"div",25),l()}if(o&2){let e=u(5);d(),V("ngModel",e.editingThreadName),w("disabled",e.isRenamingThread),d(),x(e.renameErrorMessage?2:-1)}}function uC(o,t){if(o&1){let e=k();s(0,"mat-icon",10),f("click",function(n){b(e);let r=u(2).$implicit,a=u(4);return v(a.toggleSubThreads(n,r.id))}),p(1),l()}if(o&2){let e=u(2).$implicit,i=u(4);d(),O(i.isParentExpanded(e.id)?"expand_more":"chevron_right")}}function gC(o,t){if(o&1&&(s(0,"span",27),p(1),l()),o&2){let e=u(2).$implicit;d(),O(e.name)}}function fC(o,t){o&1&&(I(0,"mat-spinner",29),s(1,"span",30),p(2,"Generating name..."),l()),o&2&&w("diameter",16)}function _C(o,t){o&1&&(s(0,"mat-icon",28),p(1,"group"),l())}function bC(o,t){if(o&1){let e=k();s(0,"a",26),f("click",function(n){b(e);let r=u().$implicit;return u(4).selectThread(r.id),v(n.preventDefault())})("keydown.enter",function(n){b(e);let r=u().$implicit;return u(4).selectThread(r.id),v(n.preventDefault())})("keydown.space",function(n){b(e);let r=u().$implicit;return u(4).selectThread(r.id),v(n.preventDefault())}),C(1,uC,2,1,"mat-icon",7),C(2,gC,2,1,"span",27)(3,fC,3,1),C(4,_C,2,0,"mat-icon",28),l()}if(o&2){let e=u().$implicit,i=u(4);w("matTooltip",e.name?e.name+`
371
371
 
372
372
  `+(e.summary||""):e.summary||"")("matTooltipDisabled",!e.summary),d(),x(e.subThreads!=null&&e.subThreads.length?1:-1),d(),x(e.name?2:3),d(2),x(i.isSharedThread(e)?4:-1)}}function vC(o,t){if(o&1){let e=k();s(0,"button",31),f("click",function(n){b(e);let r=u().$implicit,a=u(4);return v(a.startEditingThreadName(n,r))}),s(1,"mat-icon"),p(2,"edit"),l()()}}function yC(o,t){o&1&&to(0)}function CC(o,t){if(o&1&&Re(0,yC,1,0,"ng-container",11),o&2){let e=u().$implicit;u(3);let i=Et(1);w("ngTemplateOutlet",i)("ngTemplateOutletContext",Va(2,oC,e.subThreads))}}function xC(o,t){if(o&1){let e=k();s(0,"div",17),C(1,hC,3,3,"div",18)(2,bC,5,5,"a",19),s(3,"div",20),C(4,vC,3,0,"button",21),s(5,"button",22),f("click",function(n){let r=b(e).$implicit,a=u(4);return v(a.toggleStar(n,r))}),s(6,"mat-icon"),p(7),l()(),s(8,"button",23),f("click",function(n){let r=b(e).$implicit,a=u(4);return v(a.deleteThread(n,r))}),s(9,"mat-icon"),p(10,"delete"),l()()()(),C(11,CC,1,4,"ng-container")}if(o&2){let e,i=t.$implicit,n=u(4);E("current",i.id===((e=n.currentThread())==null?null:e.id)),d(),x(n.editingThreadId===i.id?1:2),d(3),x(n.editingThreadId!==i.id&&i.name?4:-1),d(),E("starred",n.isStarred(i)),w("title",n.isStarred(i)?"Unstar thread":"Star thread"),d(2),O(n.isStarred(i)?"star":"star_outline"),d(4),x(n.isParentExpanded(i.id)&&(i.subThreads!=null&&i.subThreads.length)?11:-1)}}function wC(o,t){if(o&1&&(s(0,"div",14)(1,"div",16),p(2),l(),we(3,xC,12,9,null,null,dg),l()),o&2){let e=t.$implicit;d(2),O(e.label),d(),Se(e.threads)}}function SC(o,t){o&1&&(s(0,"div",15),p(1,"No existing threads"),l())}function kC(o,t){if(o&1&&(s(0,"div",15),p(1),l()),o&2){let e=u(3);d(),ie('No threads matching "',e.searchQuery,'"')}}function MC(o,t){if(o&1&&(we(0,wC,5,1,"div",14,rC),C(2,SC,2,0,"div",15)(3,kC,2,1,"div",15)),o&2){let e,i=u(2);Se(i.getGroupedThreads()),d(2),x(!((e=i.threads())!=null&&e.length)&&!i.searchQuery?2:i.searchQuery&&i.getGroupedThreads().length===0?3:-1)}}function TC(o,t){if(o&1&&(Re(0,dC,2,0,"ng-template",null,0,Do),s(2,"div",3),C(3,mC,4,0,"div",4)(4,MC,4,1),l()),o&2){let e=u();d(3),x(e.isLoadingThreadList()?3:4)}}function EC(o,t){o&1&&(s(0,"span",32),p(1,"No project selected"),l())}function PC(o,t){o&1&&(s(0,"span",32),p(1,"Loading..."),l())}function OC(o,t){if(o&1&&(s(0,"div",2),C(1,EC,2,0,"span",32)(2,PC,2,0,"span",32),l()),o&2){let e,i=u();d(),x((e=i.currentProject())!=null&&e.name?2:1)}}var Sl=class o{projects=null;searchMode=!1;searchQuery="";searchModeChange=new H;threadSelected=new H;projectStateService=m(ke);threadStateService=m(At);threadApiService=m(Qi);userService=m(Xi);router=m(Fi);currentThread=rt(this.threadStateService.selectedThread$);currentProject=rt(this.projectStateService.selectedProject$);threads=rt(this.threadStateService.threadList$);isLoadingThreadList=rt(this.threadStateService.isLoadingThreadList$);username=rt(this.userService.username$);isTouchDevice="ontouchstart"in window||navigator.maxTouchPoints>0;editingThreadId=null;editingThreadName="";isRenamingThread=!1;renameErrorMessage="";expandedParents=new Set;constructor(){no(()=>{let t=this.currentThread()?.id,e=this.threads();if(!t||!e?.length)return;let i=new Map;for(let r of e)r.parentThreadId&&i.set(r.id,r.parentThreadId);let n=t;for(;n;){let r=i.get(n);r&&this.expandedParents.add(r),n=r}})}ngOnInit(){this.userService.fetchCurrentUser().subscribe({error:t=>{console.error("[THREAD-SELECTOR] Failed to load current user:",t)}})}selectThread(t){this.threadStateService.selectThread(t),this.threadSelected.emit(),this.router.navigate(["project",this.currentProject()?.name,"thread",t])}getGroupedThreads(){let t=this.threads();if(!t?.length)return[];let e=new Set(t.map(G=>G.id)),i=t.filter(G=>!G.parentThreadId),n=t.filter(G=>!!G.parentThreadId),r=n.filter(G=>!e.has(G.parentThreadId)),a=n.filter(G=>e.has(G.parentThreadId)),c=new Map;for(let G of a){let fe=G.parentThreadId;c.has(fe)||c.set(fe,[]),c.get(fe).push(G)}let h=G=>(c.get(G)||[]).sort((re,it)=>re.modifiedDate>it.modifiedDate?-1:1).map(re=>ut(Z({},re),{subThreads:h(re.id)})),g=[...i,...r];if(this.searchQuery&&this.searchQuery.trim()){let G=this.searchQuery.toLowerCase().trim();g=g.filter(fe=>fe.name.toLowerCase().includes(G)||fe.summary&&fe.summary.toLowerCase().includes(G))}if(!g.length)return[];let y=this.username();if(!y)return[];let S=g.map(G=>ut(Z({},G),{subThreads:h(G.id)})),A=S.filter(G=>G.starring&&G.starring.includes(y)),F=S.filter(G=>!G.starring||!G.starring.includes(y)),T=new Map,B=new Date;B.setHours(0,0,0,0);for(let G of F){let fe=new Date(G.modifiedDate);fe.setHours(0,0,0,0);let re=B.getTime()-fe.getTime(),it=Math.floor(re/(1e3*60*60*24)),De;it===0?De="Today":it===1?De="Yesterday":it<7?De="This Week":it<30?De="This Month":it<90?De="Last 3 Months":De="Older",T.has(De)||T.set(De,[]),T.get(De).push(G)}let _e=[];if(A.length>0){let G=[...A].sort((fe,re)=>fe.modifiedDate>re.modifiedDate?-1:1);_e.push({label:"Starred",threads:G})}return["Today","Yesterday","This Week","This Month","Last 3 Months","Older"].filter(G=>T.has(G)).forEach(G=>{_e.push({label:G,threads:T.get(G)})}),_e}isParentExpanded(t){return this.expandedParents.has(t)}toggleSubThreads(t,e){t.stopPropagation(),this.expandedParents.has(e)?this.expandedParents.delete(e):this.expandedParents.add(e)}isSubThread(t){return!!t.parentThreadId}isSharedThread(t){return t.users&&t.users.length>1}isStarred(t){let e=this.username();return!!e&&t.starring&&t.starring.includes(e)}toggleStar(t,e){t.stopPropagation();let i=this.username();if(!i)return;(e.starring&&e.starring.includes(i)?this.threadApiService.unstarThread(e.id):this.threadApiService.starThread(e.id)).subscribe({next:()=>{this.threadStateService.refreshThreadList()},error:a=>{console.error("Error toggling star:",a)}})}deleteThread(t,e){t.stopPropagation();let i=this.currentProject()?.name;!i||!confirm(`Are you sure you want to delete the thread "${e.name}"?`)||this.threadApiService.deleteThread(e.id).subscribe({next:()=>{this.currentThread()?.id===e.id&&(this.threadStateService.clearSelection(),this.router.navigate(["project",i])),this.threadStateService.refreshThreadList()},error:r=>{console.error("Error deleting thread:",r),alert("Failed to delete thread. Please try again.")}})}formatDate(t){try{let e=new Date(t),n=new Date().getTime()-e.getTime(),r=Math.floor(n/(1e3*60*60*24));return r===0?"Today":r===1?"Yesterday":r<7?`${r} days ago`:e.toLocaleDateString("en-EN",{day:"numeric",month:"short"})}catch{return"No date"}}startEditingThreadName(t,e){t.stopPropagation(),this.editingThreadId=e.id,this.editingThreadName=e.name||"",this.renameErrorMessage="",setTimeout(()=>{let i=document.querySelector(".thread-name-input");i&&(i.focus(),i.select())},0)}cancelEditingThreadName(){this.editingThreadId=null,this.editingThreadName="",this.renameErrorMessage=""}saveThreadName(t){if(t&&t.stopPropagation(),!this.editingThreadId)return;let e=this.editingThreadName.trim();if(!e){this.renameErrorMessage="Thread name cannot be empty";return}if(e.length>200){this.renameErrorMessage="Thread name is too long (max 200 characters)";return}let i=this.editingThreadId;this.isRenamingThread=!0,this.renameErrorMessage="",this.threadStateService.renameThread(i,e).subscribe({next:()=>{console.log("[THREAD-SELECTOR] Thread renamed successfully"),this.cancelEditingThreadName(),this.isRenamingThread=!1},error:n=>{console.error("[THREAD-SELECTOR] Error renaming thread:",n),this.renameErrorMessage=n.message||"Failed to rename thread",this.isRenamingThread=!1}})}onEditKeydown(t){t.key==="Enter"?(t.preventDefault(),t.stopPropagation(),this.saveThreadName()):t.key==="Escape"&&(t.preventDefault(),t.stopPropagation(),this.cancelEditingThreadName())}onEditBlur(){setTimeout(()=>{this.editingThreadId&&!this.isRenamingThread&&this.saveThreadName()},200)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-thread-selector"]],inputs:{searchMode:"searchMode",searchQuery:"searchQuery"},outputs:{searchModeChange:"searchModeChange",threadSelected:"threadSelected"},decls:3,vars:1,consts:[["subThreadTemplate",""],["tabindex","0","role","application","aria-label","Thread selector",1,"thread-selector",3,"click","keydown"],[1,"thread-disabled"],["role","menu","aria-label","Thread selection",1,"thread-list"],[1,"thread-loading"],[1,"thread-item-wrapper","sub-thread"],["role","menuitem","tabindex","0",1,"thread-item","sub-thread-item",3,"click","keydown.enter","keydown.space"],[1,"sub-thread-toggle"],[1,"sub-thread-agent"],[1,"sub-thread-task"],[1,"sub-thread-toggle",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"loading-spinner"],[1,"loading-text"],[1,"thread-group"],[1,"thread-empty"],[1,"thread-group-header"],[1,"thread-item-wrapper"],[1,"thread-name-edit-wrapper"],["matTooltipShowDelay","1000","role","menuitem","tabindex","0",1,"thread-item",3,"matTooltip","matTooltipDisabled"],[1,"action-buttons"],["mat-icon-button","","title","Rename thread","type","button",1,"action-button","edit-button"],["mat-icon-button","","type","button",1,"action-button","star-button",3,"click","title"],["mat-icon-button","","title","Delete thread","type","button",1,"action-button","delete-button",3,"click"],["type","text","maxlength","200",1,"thread-name-input",3,"ngModelChange","keydown","blur","click","ngModel","disabled"],[1,"rename-error"],["matTooltipShowDelay","1000","role","menuitem","tabindex","0",1,"thread-item",3,"click","keydown.enter","keydown.space","matTooltip","matTooltipDisabled"],[1,"thread-name"],["matTooltip","Shared thread",1,"shared-indicator"],[1,"thread-name-spinner",3,"diameter"],[1,"thread-name","thread-name-generating"],["mat-icon-button","","title","Rename thread","type","button",1,"action-button","edit-button",3,"click"],[1,"disabled-text"]],template:function(e,i){if(e&1&&(s(0,"div",1),f("click",function(r){return r.stopPropagation()})("keydown",function(r){return r.stopPropagation()}),C(1,TC,5,1)(2,OC,3,1,"div",2),l()),e&2){let n;d(),x((n=i.currentProject())!=null&&n.name?1:2)}},dependencies:[Ro,Ue,je,Be,Qm,He,Me,he,ot,Ke,Kt,pt,cr,lr,ma,kd],styles:[".thread-selector[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1;min-height:0;overflow-x:hidden;overflow-y:auto}.thread-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:0;max-height:none;overflow:visible}.thread-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-bottom:.5rem}.thread-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.thread-group-header[_ngcontent-%COMP%]{padding:.5rem 1rem .25rem;font-size:.75rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.5px;position:sticky;top:0;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);z-index:1}.thread-item-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;position:relative;width:100%;border-radius:0;min-width:0;gap:.25rem}.thread-item-wrapper[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.thread-item-wrapper[_ngcontent-%COMP%]:hover .action-buttons[_ngcontent-%COMP%]{display:flex}.thread-item-wrapper.current[_ngcontent-%COMP%]{background:var(--color-primary-light)}.thread-item-wrapper.current[_ngcontent-%COMP%] .thread-item[_ngcontent-%COMP%]{color:var(--color-primary-text);font-weight:600}.thread-item[_ngcontent-%COMP%]{display:flex;align-items:center;flex:1;min-width:0;padding:.75rem 1rem;text-decoration:none;cursor:pointer;transition:all .2s ease;background:transparent;border:none;border-radius:0;color:var(--color-text);text-align:left;justify-content:flex-start}.thread-item.new-thread-item[_ngcontent-%COMP%]{margin-bottom:.25rem}.thread-item[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.thread-item[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:-2px}.action-buttons[_ngcontent-%COMP%]{display:none;align-items:center;gap:.25rem;flex-shrink:0;margin-right:.5rem}.thread-item-wrapper[_ngcontent-%COMP%]:hover .action-buttons[_ngcontent-%COMP%], .thread-item-wrapper.current[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%]{display:flex}.action-button[_ngcontent-%COMP%]{flex-shrink:0;border-radius:4px!important;width:28px!important;height:28px!important;padding:0!important}.action-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple{border-radius:4px!important}.action-button[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)!important}.action-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.action-button.edit-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.action-button.edit-button[_ngcontent-%COMP%]:hover{background-color:var(--color-primary-hover)!important}.action-button.edit-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.action-button.star-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{transition:color .2s ease}.action-button.star-button.starred[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#fbbf24}.action-button.star-button[_ngcontent-%COMP%]:not(.starred):hover mat-icon[_ngcontent-%COMP%]{color:#fbbf24}.action-button.delete-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:#ef4444}.thread-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;background:transparent;border:none;text-decoration:none;cursor:pointer;transition:all .2s ease;gap:.5rem;font-size:.875rem;font-weight:400;padding:0 1rem;min-width:0}.thread-link[_ngcontent-%COMP%]:hover:not(.new-thread-link){color:var(--color-primary-hover, var(--color-primary));text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:3px}.thread-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.thread-link.new-thread-link[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:600;font-size:.95rem}.thread-link.new-thread-link[_ngcontent-%COMP%] .thread-name[_ngcontent-%COMP%]{background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite}.thread-link.new-thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary);animation:_ngcontent-%COMP%_iconPulse 3s ease-in-out infinite}.thread-link.new-thread-link[_ngcontent-%COMP%]:hover{transform:translate(4px)}.thread-link.new-thread-link[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_iconPulse 1.5s ease-in-out infinite}.thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0 center}50%{background-position:100% center}to{background-position:0 center}}@keyframes _ngcontent-%COMP%_iconPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.05)}}.thread-name[_ngcontent-%COMP%]{flex:1;font-size:.875rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}.thread-name.thread-name-generating[_ngcontent-%COMP%]{color:var(--color-text-muted);font-style:italic}.thread-name-edit-wrapper[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;padding:0 .5rem}.thread-name-input[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-bg-secondary);color:var(--color-text-primary);font-size:.9rem;font-family:inherit}.thread-name-input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 2px #3b82f61a}.thread-name-input[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.rename-error[_ngcontent-%COMP%]{color:var(--color-error);font-size:.75rem;margin-top:.25rem;padding-left:.5rem}.thread-name-spinner[_ngcontent-%COMP%]{flex-shrink:0;margin-right:.5rem}.thread-name-spinner[_ngcontent-%COMP%] .mat-mdc-progress-spinner circle{stroke:var(--color-primary)!important}.current-indicator[_ngcontent-%COMP%]{color:var(--color-success);font-weight:700;flex-shrink:0;font-size:1rem}.thread-separator[_ngcontent-%COMP%]{height:1px;background:var(--color-border);margin:.25rem 0}.thread-empty[_ngcontent-%COMP%]{padding:1.5rem 1rem;text-align:center;color:var(--color-text-muted);font-size:.8rem;font-style:italic}.thread-loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2rem 1rem;gap:.75rem}.thread-loading[_ngcontent-%COMP%] .loading-spinner[_ngcontent-%COMP%]{width:24px;height:24px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}.thread-loading[_ngcontent-%COMP%] .loading-text[_ngcontent-%COMP%]{color:var(--color-text-muted);font-size:.8rem}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.thread-disabled[_ngcontent-%COMP%]{padding:1.5rem 1rem}.thread-disabled[_ngcontent-%COMP%] .disabled-text[_ngcontent-%COMP%]{display:block;color:var(--color-text-muted);font-size:.85rem;font-style:italic;text-align:center}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%]{padding-left:calc(.2rem + var(--sub-depth, 1) * 1.5rem);border-left:2px solid var(--color-primary, #3b82f6);margin-left:.75rem}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-item[_ngcontent-%COMP%]{padding:.35rem .5rem .35rem 0;gap:.2rem;font-size:.8rem;color:var(--color-text-secondary)}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-item[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-agent[_ngcontent-%COMP%]{font-weight:600;color:var(--color-primary);white-space:nowrap;flex-shrink:0;font-size:.8rem}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-task[_ngcontent-%COMP%]{color:var(--color-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.75rem}.sub-thread-toggle[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;flex-shrink:0;cursor:pointer;color:var(--color-text-secondary);margin-right:.25rem}.sub-thread-toggle[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.shared-indicator[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;color:var(--color-text-secondary);flex-shrink:0;margin-left:.25rem}@media (max-width: 768px){.thread-item[_ngcontent-%COMP%]{padding:.6rem .8rem}.thread-name[_ngcontent-%COMP%]{font-size:.8rem}}"]})};function AC(o,t){if(o&1){let e=k();s(0,"button",9),f("click",function(){b(e);let n=u();return v(n.start())}),s(1,"mat-icon"),p(2,"play_arrow"),l()()}if(o&2){let e=u();w("disabled",!e.hasPreviewCommand()||e.isLoading())}}function IC(o,t){if(o&1){let e=k();s(0,"button",10),f("click",function(){b(e);let n=u();return v(n.stop())}),s(1,"mat-icon"),p(2,"stop"),l()()}if(o&2){let e=u();w("disabled",e.isLoading())}}function DC(o,t){if(o&1&&(s(0,"a",5)(1,"mat-icon",11),p(2,"open_in_new"),l(),s(3,"span",12),p(4),l()()),o&2){let e=u();w("href",e.previewUrl(),Kn)("title",e.previewUrl()),d(4),O(e.previewUrl())}}function RC(o,t){if(o&1&&(s(0,"div",7),p(1),l()),o&2){let e=u();d(),O(e.errorMessage())}}function FC(o,t){if(o&1){let e=k();s(0,"div",8)(1,"div",13)(2,"span",14),p(3,"Logs"),l(),s(4,"button",15),f("click",function(){b(e);let n=u();return v(n.refreshLogs())}),s(5,"mat-icon"),p(6,"refresh"),l()()(),s(7,"pre",16),p(8),l()()}if(o&2){let e=u();d(8),O(e.logs()||"(empty)")}}var kl=class o{destroyRef=m(Kl);projectState=m(ke);hasPreviewCommand=rt(this.projectState.selectedProject$.pipe(ve(t=>!!t?.config?.preview?.command)),{initialValue:!1});status=Oe("stopped");previewUrl=Oe(null);logs=Oe("");isLoading=Oe(!1);showLogs=Oe(!1);errorMessage=Oe("");ngOnInit(){try{this.projectState.getPreviewStatus().pipe(rn(this.destroyRef)).subscribe({next:t=>this.applyStatus(t),error:()=>{}})}catch{}}start(){this.isLoading.set(!0),this.errorMessage.set(""),this.projectState.startPreview().pipe(rn(this.destroyRef)).subscribe({next:t=>{this.applyStatus(t),this.isLoading.set(!1)},error:t=>{this.errorMessage.set(t?.error?.error??"Failed to start preview"),this.isLoading.set(!1)}})}stop(){this.isLoading.set(!0),this.errorMessage.set(""),this.projectState.stopPreview().pipe(rn(this.destroyRef)).subscribe({next:()=>{this.status.set("stopped"),this.previewUrl.set(null),this.isLoading.set(!1)},error:t=>{this.errorMessage.set(t?.error?.error??"Failed to stop preview"),this.isLoading.set(!1)}})}refreshLogs(){this.projectState.getPreviewLogs().pipe(rn(this.destroyRef)).subscribe({next:t=>this.logs.set(t.logs),error:()=>this.logs.set("(failed to load logs)")})}toggleLogs(){this.showLogs.update(t=>!t),this.showLogs()&&this.refreshLogs()}applyStatus(t){this.status.set(t.status),this.previewUrl.set(t.url??null)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-preview-panel"]],decls:12,vars:10,consts:[[1,"preview-panel"],[1,"preview-controls"],["mat-icon-button","","title","Start preview server","type","button",1,"preview-action-btn","start",3,"disabled"],["mat-icon-button","","title","Stop preview server","type","button",1,"preview-action-btn","stop",3,"disabled"],[1,"status-pill"],["target","_blank","rel","noopener noreferrer",1,"preview-url",3,"href","title"],["mat-icon-button","","type","button",1,"logs-btn",3,"click","title"],[1,"preview-error"],[1,"logs-container"],["mat-icon-button","","title","Start preview server","type","button",1,"preview-action-btn","start",3,"click","disabled"],["mat-icon-button","","title","Stop preview server","type","button",1,"preview-action-btn","stop",3,"click","disabled"],[1,"link-icon"],[1,"url-text"],[1,"logs-header"],[1,"logs-title"],["mat-icon-button","","title","Refresh logs","type","button",1,"refresh-btn",3,"click"],[1,"logs-content"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1),C(2,AC,3,1,"button",2),C(3,IC,3,1,"button",3),s(4,"span",4),p(5),l(),C(6,DC,5,3,"a",5),s(7,"button",6),f("click",function(){return i.toggleLogs()}),s(8,"mat-icon"),p(9),l()()(),C(10,RC,2,1,"div",7),C(11,FC,9,1,"div",8),l()),e&2&&(d(2),x(i.status()==="stopped"?2:-1),d(),x(i.status()==="running"?3:-1),d(),E("running",i.status()==="running"),d(),ie(" ",i.status()==="running"?"Running":"Stopped"," "),d(),x(i.status()==="running"&&i.previewUrl()?6:-1),d(),w("title",i.showLogs()?"Hide logs":"Show logs"),d(2),O(i.showLogs()?"expand_less":"terminal"),d(),x(i.errorMessage()?10:-1),d(),x(i.showLogs()?11:-1))},dependencies:[ot,Ke,Me,he],styles:["[_nghost-%COMP%]{display:block}.preview-panel[_ngcontent-%COMP%]{padding:.5rem 1rem;display:flex;flex-direction:column;gap:.5rem}.preview-controls[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;flex-wrap:nowrap;min-width:0}.preview-action-btn[_ngcontent-%COMP%]{flex-shrink:0}.preview-action-btn.start[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.preview-action-btn.stop[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#e53935}.preview-action-btn[disabled][_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.status-pill[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:2px 8px;border-radius:12px;font-size:.72rem;font-weight:600;letter-spacing:.02em;flex-shrink:0;background:var(--color-bg-hover);color:var(--color-text-secondary);border:1px solid var(--color-border)}.status-pill.running[_ngcontent-%COMP%]{background:#22c55e26;color:#16a34a;border-color:#22c55e66}.preview-url[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:2px;text-decoration:none;color:var(--color-primary);font-size:.8rem;font-weight:500;min-width:0;overflow:hidden;flex-shrink:1}.preview-url[_ngcontent-%COMP%]:hover{text-decoration:underline}.preview-url[_ngcontent-%COMP%] .link-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;flex-shrink:0}.preview-url[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.logs-btn[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0}.logs-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-text-secondary)}.preview-error[_ngcontent-%COMP%]{font-size:.78rem;color:#c00;padding:0 .25rem}.logs-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;background:var(--color-bg-hover);border-radius:8px;overflow:hidden;border:1px solid var(--color-border)}.logs-header[_ngcontent-%COMP%]{display:flex;align-items:center;padding:.25rem .75rem;border-bottom:1px solid var(--color-border)}.logs-header[_ngcontent-%COMP%] .logs-title[_ngcontent-%COMP%]{flex:1;font-size:.75rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.logs-header[_ngcontent-%COMP%] .refresh-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}.logs-content[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;font-family:Courier New,Courier,monospace;font-size:.72rem;line-height:1.5;color:var(--color-text);white-space:pre-wrap;word-break:break-all;max-height:200px;overflow-y:auto}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:3px}"]})};function NC(o,t){if(o&1&&(s(0,"div",3),p(1),l()),o&2){let e=u();d(),ie("\u274C ",e.errorMessage)}}var ba=class o{dialogRef=m(ei);data=m(Hi);jsonContent;errorMessage="";title;constructor(){this.jsonContent=this.data.initialContent,this.title=this.data.title||this.getDefaultTitle(this.data.configType,this.data.projectName)}getDefaultTitle(t,e){return t==="user"?"User Configuration":`Project Configuration: ${e||"Unknown"}`}onSave(){this.errorMessage="";let t;try{t=JSON.parse(this.jsonContent)}catch(e){this.errorMessage=`Invalid JSON syntax: ${e instanceof Error?e.message:"Unknown error"}`;return}this.dialogRef.close(t)}onCancel(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-json-editor"]],decls:13,vars:3,consts:[["mat-dialog-title",""],["mat-icon-button","","title","Close",1,"close-button",3,"click"],["spellcheck","false","placeholder","Enter JSON configuration...",1,"json-textarea",3,"ngModelChange","ngModel"],[1,"error-message"],["align","end"],["matButton","",3,"click"],["matButton","filled","color","primary",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0),p(1),s(2,"button",1),f("click",function(){return i.onCancel()}),s(3,"mat-icon"),p(4,"close"),l()()(),s(5,"mat-dialog-content")(6,"textarea",2),j("ngModelChange",function(r){return z(i.jsonContent,r)||(i.jsonContent=r),r}),l(),C(7,NC,2,1,"div",3),l(),s(8,"mat-dialog-actions",4)(9,"button",5),f("click",function(){return i.onCancel()}),p(10,"Cancel"),l(),s(11,"button",6),f("click",function(){return i.onSave()}),p(12,"Save"),l()()),e&2&&(d(),ie(" ",i.title," "),d(5),V("ngModel",i.jsonContent),d(),x(i.errorMessage?7:-1))},dependencies:[Fe,Ue,je,Be,He,he,Ke,Ot,un,gn,fn],styles:["[mat-dialog-title][_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}[mat-dialog-title][_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{margin-left:auto}mat-dialog-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;min-height:400px}.json-textarea[_ngcontent-%COMP%]{flex:1;min-height:300px;max-height:80vh;padding:1rem;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.875rem;line-height:1.5;background:var(--color-code-bg);color:var(--color-text);border:1px solid var(--color-border);border-radius:4px;resize:vertical;outline:none;transition:border-color .2s}.json-textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.json-textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.6}.error-message[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:4px;font-size:.875rem;line-height:1.4;background:#dc26261a;color:#dc2626;border:1px solid rgba(220,38,38,.3)}"]})};function LC(o,t){if(o&1){let e=k();s(0,"div",9)(1,"mat-form-field",18)(2,"mat-label"),p(3),l(),s(4,"textarea",19),j("ngModelChange",function(n){let r=b(e).$index,a=u();return z(a.commands[r],n)||(a.commands[r]=n),v(n)}),l(),s(5,"mat-hint"),p(6,"Use placeholder for dynamic values"),l()(),s(7,"button",20),f("click",function(){let n=b(e).$index,r=u();return v(r.removeCommand(n))}),s(8,"mat-icon"),p(9,"delete"),l()()()}if(o&2){let e=t.$index,i=u();d(3),ie("Prompt ",e+1),d(),V("ngModel",i.commands[e]),d(3),w("disabled",i.commands.length===1)}}function VC(o,t){if(o&1){let e=k();s(0,"div",10)(1,"h3"),p(2,"Save to"),l(),s(3,"div",21)(4,"label",22)(5,"input",23),j("ngModelChange",function(n){b(e);let r=u();return z(r.source,n)||(r.source=n),v(n)}),l(),s(6,"div",24)(7,"div",25)(8,"span",26),p(9,"\u{1F464}"),l(),s(10,"span",27),p(11,"Local"),l()(),s(12,"p",28),p(13,"Personal prompt in ~/.coday/... (not committed)"),l()()(),s(14,"label",22)(15,"input",29),j("ngModelChange",function(n){b(e);let r=u();return z(r.source,n)||(r.source=n),v(n)}),l(),s(16,"div",24)(17,"div",25)(18,"span",26),p(19,"\u{1F4E6}"),l(),s(20,"span",27),p(21,"Project"),l()(),s(22,"p",28),p(23,"Shared prompt in ./prompts/ (committable)"),l()()()(),s(24,"p",30),p(25,"Storage location is permanent and cannot be changed after creation"),l()()}if(o&2){let e=u();d(4),E("selected",e.source==="local"),d(),V("ngModel",e.source),d(9),E("selected",e.source==="project"),d(),V("ngModel",e.source)}}function zC(o,t){if(o&1&&(s(0,"div",11)(1,"h3"),p(2,"Storage Location"),l(),s(3,"div",31)(4,"span",26),p(5),l(),s(6,"span",27),p(7),l()(),s(8,"p",30),p(9,"Cannot be changed after creation"),l()()),o&2){let e=u();d(3),E("badge-local",e.source==="local")("badge-project",e.source==="project"),d(2),O(e.source==="local"?"\u{1F464}":"\u{1F4E6}"),d(2),O(e.source==="local"?"Local":"Project")}}function jC(o,t){if(o&1){let e=k();s(0,"div",12)(1,"label",32)(2,"input",33),j("ngModelChange",function(n){b(e);let r=u();return z(r.webhookEnabled,n)||(r.webhookEnabled=n),v(n)}),l(),s(3,"span"),p(4,"Enable webhook"),l()(),s(5,"p",30),p(6,"Enable webhook to trigger this prompt via HTTP POST"),l()()}if(o&2){let e=u();d(2),V("ngModel",e.webhookEnabled)}}function BC(o,t){if(o&1){let e=k();s(0,"div",13)(1,"div",34)(2,"mat-icon",35),p(3,"link"),l(),s(4,"h4"),p(5,"Webhook URL"),l()(),s(6,"div",36)(7,"p",37),p(8),l(),s(9,"button",38),f("click",function(){b(e);let n=u();return v(n.copyWebhookUrl())}),s(10,"mat-icon"),p(11,"content_copy"),l(),s(12,"span"),p(13,"Copy URL"),l()()(),s(14,"p",30),p(15,"Use this URL to trigger the prompt via HTTP POST"),l()()}if(o&2){let e=u();d(8),O(e.getWebhookUrl())}}function HC(o,t){if(o&1&&(s(0,"div",14)(1,"mat-icon"),p(2,"error"),l(),s(3,"span"),p(4),l()()),o&2){let e=u();d(4),O(e.errorMessage)}}var va=class o{promptApi=m(di);dialogRef=m(ei);configApi=m(Ki);snackBar=m(Xr);name="";description="";commands=[""];webhookEnabled=!1;threadLifetime="";source="local";isSaving=!1;errorMessage="";isAdmin=!1;isEditMode=!1;promptId="";data=m(Hi);constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.isAdmin=t.groups?.includes("CODAY_ADMIN")??!1},error:t=>{console.error("[PROMPT_FORM] Error loading user config:",t),this.isAdmin=!1}}),this.isEditMode&&this.data.prompt&&(this.promptId=this.data.prompt.id,this.name=this.data.prompt.name,this.description=this.data.prompt.description,this.commands=[...this.data.prompt.commands],this.webhookEnabled=this.data.prompt.webhookEnabled,this.source=this.data.prompt.source)}addCommand(){this.commands.push("")}removeCommand(t){this.commands.length>1&&this.commands.splice(t,1)}trackByIndex(t){return t}normalizeName(){this.name=this.name.replace(/[\s_.,;:!?()[\]{}]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}validateForm(){return this.name.trim()?this.description.trim()?this.commands.filter(e=>e.trim()).length===0?(this.errorMessage="At least one command is required",!1):!0:(this.errorMessage="Description is required",!1):(this.errorMessage="Name is required",!1)}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.commands.filter(e=>e.trim());if(this.isSaving=!0,this.isEditMode&&this.data.prompt){let e={name:this.name.trim(),description:this.description.trim(),commands:t,webhookEnabled:this.webhookEnabled};this.promptApi.updatePrompt(this.data.prompt.id,e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error updating prompt:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to update prompt",this.isSaving=!1}})}else{let e={name:this.name.trim(),description:this.description.trim(),commands:t,webhookEnabled:this.webhookEnabled,source:this.source};this.promptApi.createPrompt(e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error creating prompt:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to create prompt",this.isSaving=!1}})}}cancel(){this.dialogRef.close(!1)}getWebhookUrl(){return`${window.location.origin}/api/webhooks/${this.promptId}/execute`}copyWebhookUrl(){if(!this.webhookEnabled){this.snackBar.open("Webhook is not enabled","Close",{duration:3e3});return}if(!this.promptId){this.snackBar.open("Prompt must be saved before getting webhook URL","Close",{duration:3e3});return}let t=this.getWebhookUrl();navigator.clipboard.writeText(t).then(()=>{this.snackBar.open("Webhook URL copied to clipboard!","Close",{duration:3e3})}).catch(e=>{console.error("Failed to copy webhook URL:",e),this.snackBar.open("Failed to copy URL","Close",{duration:3e3})})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-prompt-form"]],decls:36,vars:11,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-prompt","required","",3,"ngModelChange","blur","ngModel"],["matInput","","placeholder","What does this prompt do?","rows","3","required","",3,"ngModelChange","ngModel"],[1,"commands-section"],[1,"section-header"],["mat-icon-button","","type","button","title","Add command",3,"click"],[1,"commands-list"],[1,"command-item"],[1,"source-section"],[1,"source-display"],[1,"webhook-section"],[1,"webhook-url-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"command-field"],["matInput","","placeholder","Enter command with placeholders like \\{\\{key\\}\\}","rows","2",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove command",1,"remove-btn",3,"click","disabled"],[1,"source-options"],[1,"source-option"],["type","radio","name","source","value","local",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","source","value","project",3,"ngModelChange","ngModel"],[1,"hint"],[1,"source-badge"],[1,"checkbox-label"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"webhook-url-header"],[1,"webhook-icon"],[1,"webhook-url-content"],[1,"url-text"],["mat-raised-button","","color","accent","type","button",3,"click"]],template:function(e,i){e&1&&(s(0,"h2",0),p(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),p(6,"Name"),l(),s(7,"input",3),j("ngModelChange",function(r){return z(i.name,r)||(i.name=r),r}),f("blur",function(){return i.normalizeName()}),l(),s(8,"mat-hint"),p(9,"A descriptive name (spaces and punctuation will be replaced with hyphens), will be used as command name"),l()(),s(10,"mat-form-field",2)(11,"mat-label"),p(12,"Description"),l(),s(13,"textarea",4),j("ngModelChange",function(r){return z(i.description,r)||(i.description=r),r}),l(),s(14,"mat-hint"),p(15,"Explain the purpose of this prompt, helps for searchability"),l()(),s(16,"div",5)(17,"div",6)(18,"h3"),p(19,"Prompts"),l(),s(20,"button",7),f("click",function(){return i.addCommand()}),s(21,"mat-icon"),p(22,"add"),l()()(),s(23,"div",8),we(24,LC,10,3,"div",9,Jn),l()(),C(26,VC,26,6,"div",10),C(27,zC,10,6,"div",11),C(28,jC,7,1,"div",12),C(29,BC,16,1,"div",13),C(30,HC,5,1,"div",14),l()(),s(31,"mat-dialog-actions",15)(32,"button",16),f("click",function(){return i.cancel()}),p(33,"Cancel"),l(),s(34,"button",17),f("click",function(){return i.save()}),p(35),l()()),e&2&&(d(),O(i.isEditMode?"Edit Prompt":"Create Prompt"),d(6),V("ngModel",i.name),d(6),V("ngModel",i.description),d(11),Se(i.commands),d(2),x(i.isEditMode?-1:26),d(),x(i.isEditMode?27:-1),d(),x(i.isAdmin?28:-1),d(),x(i.isEditMode&&i.webhookEnabled&&i.isAdmin?29:-1),d(),x(i.errorMessage?30:-1),d(2),w("disabled",i.isSaving),d(2),w("disabled",i.isSaving),d(),ie(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[Fe,Ue,je,$m,jo,Be,Bo,He,mo,un,fn,gn,ot,Ot,Ke,Kt,mi,Ut,Ht,xn,pt,Me,he,Ko],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:500px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.commands-section[_ngcontent-%COMP%] .commands-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .command-field[_ngcontent-%COMP%]{flex:1}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.webhook-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:18px;height:18px;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.95rem}.webhook-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.webhook-url-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] .webhook-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{flex:1;margin:0;padding:.75rem;background:var(--color-bg);border:1px solid var(--color-border);border-radius:4px;font-family:monospace;font-size:.85rem;word-break:break-all;color:var(--color-text)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap;display:flex;align-items:center;gap:.5rem}.webhook-url-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 1rem;font-size:1rem;font-weight:600}.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.75rem}@media (max-width: 768px){.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-section[_ngcontent-%COMP%] .source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.thread-lifetime-disabled[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:#2196f30d;border:1px solid rgba(33,150,243,.2);border-radius:8px;margin-bottom:1rem}.thread-lifetime-disabled[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#2196f3cc;font-size:1.25rem;width:1.25rem;height:1.25rem;margin-top:2px}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;flex:1}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.95rem;color:var(--color-text)}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-display[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-display[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1rem;font-weight:600}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500;margin-bottom:.5rem}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.1rem}.source-display[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-display[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.source-display[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}"]})};function UC(o,t){o&1&&(s(0,"div",12),p(1,"Loading prompts..."),l())}function WC(o,t){if(o&1&&(s(0,"div",13),p(1),l()),o&2){let e=u();d(),O(e.errorMessage)}}function $C(o,t){o&1&&(s(0,"div",14),p(1," No prompts found. Create your first prompt to get started. "),l())}function qC(o,t){o&1&&(s(0,"div",14),p(1," No prompts match your search. "),l())}function GC(o,t){if(o&1&&(s(0,"span",31),p(1),l()),o&2){let e=u().$implicit;w("title",En("Created by ",e.createdBy)),d(),ie(" \u{1F464} ",e.createdBy," ")}}function YC(o,t){if(o&1){let e=k();s(0,"button",32),f("click",function(){b(e);let n=u().$implicit,r=u(2);return v(r.toggleWebhook(n))}),p(1),l()}if(o&2){let e=u().$implicit;E("btn-webhook-enabled",e.webhookEnabled)("btn-webhook-disabled",!e.webhookEnabled),d(),ie(" ",e.webhookEnabled?"Disable Webhook":"Enable Webhook"," ")}}function QC(o,t){if(o&1){let e=k();s(0,"div",17)(1,"div",18)(2,"div",19)(3,"h3"),p(4),l(),s(5,"div",20)(6,"span",21),p(7),l(),Re(8,GC,2,3,"span",22),l()(),s(9,"p",23),p(10),l(),s(11,"div",24)(12,"span",25),p(13),l(),s(14,"span",26),p(15),l()()(),s(16,"div",27)(17,"button",28),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.editPrompt(n))}),p(18,"Edit"),l(),Re(19,YC,2,5,"button",29),s(20,"button",30),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.deletePrompt(n.id))}),p(21,"Delete"),l()()()}if(o&2){let e=t.$implicit,i=u(2);d(4),O(e.name),d(2),E("badge-local",e.source==="local")("badge-project",e.source==="project"),w("title",e.source==="local"?"Local prompt (~/.coday/)":"Project prompt (./prompts/)"),d(),ie(" ",e.source==="local"?"\u{1F464}":"\u{1F4E6}"," "),d(),w("ngIf",e.createdBy!==i.getCurrentUsername()),d(2),O(e.description),d(3),ie("ID: ",e.id),d(),E("enabled",e.webhookEnabled),d(),ie(" Webhook: ",e.webhookEnabled?"Enabled":"Disabled"," "),d(4),w("ngIf",i.isAdmin)}}function XC(o,t){if(o&1&&(s(0,"div",15),Re(1,QC,22,14,"div",16),l()),o&2){let e=u();d(),w("ngForOf",e.filteredPrompts)}}var Ml=class o{promptApi=m(di);dialog=m(Ci);configApi=m(Ki);prompts=[];filteredPrompts=[];searchQuery="";showOnlyMine=!0;isLoading=!1;errorMessage="";isAdmin=!1;currentUsername="";ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.isAdmin=t.groups?.includes("CODAY_ADMIN")??!1,this.currentUsername=t.username??"",console.log("[PROMPT_MANAGER] Current username:",this.currentUsername)},error:t=>{console.error("[PROMPT_MANAGER] Error loading user config:",t),this.isAdmin=!1}}),this.loadPrompts()}loadPrompts(){this.isLoading=!0,this.promptApi.listPrompts().subscribe({next:t=>{this.prompts=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading prompts:",t),this.errorMessage="Failed to load prompts",this.isLoading=!1}})}deletePrompt(t){confirm("Are you sure you want to delete this prompt?")&&this.promptApi.deletePrompt(t).subscribe({next:()=>{this.loadPrompts()},error:e=>{console.error("Error deleting prompt:",e);let i=e?.error?.error??e?.message??"Failed to delete prompt";alert(`Failed to delete prompt: ${i}`)}})}toggleWebhook(t){(t.webhookEnabled?this.promptApi.disableWebhook(t.id):this.promptApi.enableWebhook(t.id)).subscribe({next:()=>{this.loadPrompts()},error:i=>{console.error("Error toggling webhook:",i);let n=i?.error?.error??i?.message??"Failed to toggle webhook";alert(`Failed to toggle webhook: ${n}`)}})}createPrompt(){this.dialog.open(va,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadPrompts()})}getCurrentUsername(){return this.currentUsername}normalizeUsername(t){return t.replace(/[.\s]+/g,"_")}isMyPrompt(t){if(!this.currentUsername)return!1;let e=this.normalizeUsername(this.currentUsername.toLowerCase());return this.normalizeUsername(t.createdBy.toLowerCase())===e}applyFilter(){let t=this.searchQuery.toLowerCase().trim(),e=this.showOnlyMine&&this.currentUsername?this.prompts.filter(i=>this.isMyPrompt(i)):[...this.prompts];t&&(e=e.filter(i=>i.name.toLowerCase().includes(t)||i.description.toLowerCase().includes(t)?!0:i.createdBy.toLowerCase().includes(t))),this.filteredPrompts=e}onSearchChange(){this.applyFilter()}editPrompt(t){this.promptApi.getPrompt(t.id).subscribe({next:e=>{this.dialog.open(va,{width:"700px",maxHeight:"90vh",data:{mode:"edit",prompt:e}}).afterClosed().subscribe(n=>{n&&this.loadPrompts()})},error:e=>{console.error("Error loading prompt details:",e);let i=e?.error?.error??e?.message??"Failed to load prompt details";alert(`Failed to load prompt details: ${i}`)}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-prompt-manager"]],decls:23,vars:7,consts:[[1,"prompt-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name, description, author...",3,"ngModelChange","input","ngModel"],["matPrefix",""],["color","primary",1,"mine-toggle",3,"ngModelChange","change","ngModel"],[1,"btn-create",3,"click"],["class","loading",4,"ngIf"],["class","error",4,"ngIf"],["class","empty",4,"ngIf"],["class","prompt-list",4,"ngIf"],[1,"loading"],[1,"error"],[1,"empty"],[1,"prompt-list"],["class","prompt-item",4,"ngFor","ngForOf"],[1,"prompt-item"],[1,"prompt-info"],[1,"prompt-header"],[1,"badges"],[1,"source-badge",3,"title"],["class","owner-badge",3,"title",4,"ngIf"],[1,"description"],[1,"meta"],["title","Prompt ID",1,"prompt-id"],[1,"webhook-status"],[1,"prompt-actions"],[1,"btn-primary",3,"click"],[3,"btn-webhook-enabled","btn-webhook-disabled","click",4,"ngIf"],[1,"btn-danger",3,"click"],[1,"owner-badge",3,"title"],[3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),p(3,"Prompts"),l(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),p(7,"Search"),l(),s(8,"input",4),j("ngModelChange",function(r){return z(i.searchQuery,r)||(i.searchQuery=r),r}),f("input",function(){return i.onSearchChange()}),l(),s(9,"mat-icon",5),p(10,"search"),l()(),s(11,"mat-slide-toggle",6),j("ngModelChange",function(r){return z(i.showOnlyMine,r)||(i.showOnlyMine=r),r}),f("change",function(){return i.applyFilter()}),p(12," Mine "),l(),s(13,"button",7),f("click",function(){return i.createPrompt()}),s(14,"mat-icon"),p(15,"add"),l(),s(16,"span"),p(17,"Create Prompt"),l()()()(),Re(18,UC,2,0,"div",8)(19,WC,2,1,"div",9)(20,$C,2,0,"div",10)(21,qC,2,0,"div",10)(22,XC,2,1,"div",11),l()),e&2&&(d(8),V("ngModel",i.searchQuery),d(3),V("ngModel",i.showOnlyMine),d(7),w("ngIf",i.isLoading),d(),w("ngIf",i.errorMessage),d(),w("ngIf",!i.isLoading&&i.prompts.length===0),d(),w("ngIf",!i.isLoading&&i.prompts.length>0&&i.filteredPrompts.length===0),d(),w("ngIf",!i.isLoading&&i.filteredPrompts.length>0))},dependencies:[Fe,za,ja,Ue,je,Be,He,Me,he,Kt,mi,Ut,Ht,vo,pt,Cl,bo],styles:[".prompt-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .mine-toggle[_ngcontent-%COMP%]{margin-bottom:-1.25em}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.prompt-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.prompt-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.prompt-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.prompt-info[_ngcontent-%COMP%]{flex:1}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.5rem}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1.1rem;flex:1}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;font-size:1rem;cursor:help}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;border:1px solid rgba(33,150,243,.3)}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;border:1px solid rgba(76,175,80,.3)}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .owner-badge[_ngcontent-%COMP%]{font-size:.75rem;padding:.25rem .5rem;background:#2196f3;color:#fff;border-radius:4px;font-weight:400;white-space:nowrap}.prompt-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{margin:0 0 .5rem;color:var(--color-text-secondary)}.prompt-info[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%]{display:flex;gap:1rem;font-size:.85rem;color:var(--color-text-secondary)}.prompt-info[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .prompt-id[_ngcontent-%COMP%]{font-family:monospace;opacity:.7}.prompt-info[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .webhook-status.enabled[_ngcontent-%COMP%]{color:var(--color-success);font-weight:600}.prompt-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.prompt-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem}.prompt-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]{background:var(--color-secondary);color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-enabled[_ngcontent-%COMP%]{background:#ff9800;color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-enabled[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-disabled[_ngcontent-%COMP%]{background:#9e9e9e;color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-disabled[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var kr=class o{http=m(Xe);projectState=m(ke);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createScheduler(t){return this.http.post(this.getBaseUrl(),t)}updateScheduler(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e)}deleteScheduler(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}enableScheduler(t){return this.http.post(`${this.getBaseUrl()}/${t}/enable`,{})}disableScheduler(t){return this.http.post(`${this.getBaseUrl()}/${t}/disable`,{})}runSchedulerNow(t){return this.http.post(`${this.getBaseUrl()}/${t}/run-now`,{})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var Tl=(()=>{class o{_animationsDisabled=$e();state="unchecked";disabled=!1;appearance="full";constructor(){}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:12,hostBindings:function(i,n){i&2&&E("mat-pseudo-checkbox-indeterminate",n.state==="indeterminate")("mat-pseudo-checkbox-checked",n.state==="checked")("mat-pseudo-checkbox-disabled",n.disabled)("mat-pseudo-checkbox-minimal",n.appearance==="minimal")("mat-pseudo-checkbox-full",n.appearance==="full")("_mat-animation-noopable",n._animationsDisabled)},inputs:{state:"state",disabled:"disabled",appearance:"appearance"},decls:0,vars:0,template:function(i,n){},styles:[`.mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-minimal-selected-checkmark-color, var(--mat-sys-primary))}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full{border-color:var(--mat-pseudo-checkbox-full-unselected-icon-color, var(--mat-sys-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-pseudo-checkbox-full-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-pseudo-checkbox-full-selected-icon-color, var(--mat-sys-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-full-selected-checkmark-color, var(--mat-sys-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-pseudo-checkbox-full-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-full-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}
373
373
  `],encapsulation:2,changeDetection:0})}return o})();var KC=["text"],ZC=[[["mat-icon"]],"*"],JC=["mat-icon","*"];function ex(o,t){if(o&1&&I(0,"mat-pseudo-checkbox",1),o&2){let e=u();w("disabled",e.disabled)("state",e.selected?"checked":"unchecked")}}function tx(o,t){if(o&1&&I(0,"mat-pseudo-checkbox",3),o&2){let e=u();w("disabled",e.disabled)}}function ix(o,t){if(o&1&&(s(0,"span",4),p(1),l()),o&2){let e=u();d(),ie("(",e.group.label,")")}}var Od=new oe("MAT_OPTION_PARENT_COMPONENT"),Ad=new oe("MatOptgroup");var Pd=class{source;isUserInput;constructor(t,e=!1){this.source=t,this.isUserInput=e}},yo=(()=>{class o{_element=m(ne);_changeDetectorRef=m(Qe);_parent=m(Od,{optional:!0});group=m(Ad,{optional:!0});_signalDisableRipple=!1;_selected=!1;_active=!1;_mostRecentViewValue="";get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}value;id=m(Ne).getId("mat-option-");get disabled(){return this.group&&this.group.disabled||this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=Oe(!1);get disableRipple(){return this._signalDisableRipple?this._parent.disableRipple():!!this._parent?.disableRipple}get hideSingleSelectionIndicator(){return!!(this._parent&&this._parent.hideSingleSelectionIndicator)}onSelectionChange=new H;_text;_stateChanges=new R;constructor(){let e=m(Nt);e.load(In),e.load(Wa),this._signalDisableRipple=!!this._parent&&La(this._parent.disableRipple)}get active(){return this._active}get viewValue(){return(this._text?.nativeElement.textContent||"").trim()}select(e=!0){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}deselect(e=!0){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}focus(e,i){let n=this._getHostElement();typeof n.focus=="function"&&n.focus(i)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(e){(e.keyCode===13||e.keyCode===32)&&!_t(e)&&(this._selectViaInteraction(),e.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=this.multiple?!this._selected:!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){let e=this.viewValue;e!==this._mostRecentViewValue&&(this._mostRecentViewValue&&this._stateChanges.next(),this._mostRecentViewValue=e)}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(e=!1){this.onSelectionChange.emit(new Pd(this,e))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-option"]],viewQuery:function(i,n){if(i&1&&X(KC,7),i&2){let r;U(r=W())&&(n._text=r.first)}},hostAttrs:["role","option",1,"mat-mdc-option","mdc-list-item"],hostVars:11,hostBindings:function(i,n){i&1&&f("click",function(){return n._selectViaInteraction()})("keydown",function(a){return n._handleKeydown(a)}),i&2&&(Jt("id",n.id),J("aria-selected",n.selected)("aria-disabled",n.disabled.toString()),E("mdc-list-item--selected",n.selected)("mat-mdc-option-multiple",n.multiple)("mat-mdc-option-active",n.active)("mdc-list-item--disabled",n.disabled))},inputs:{value:"value",id:"id",disabled:[2,"disabled","disabled",ee]},outputs:{onSelectionChange:"onSelectionChange"},exportAs:["matOption"],ngContentSelectors:JC,decls:8,vars:5,consts:[["text",""],["aria-hidden","true",1,"mat-mdc-option-pseudo-checkbox",3,"disabled","state"],[1,"mdc-list-item__primary-text"],["state","checked","aria-hidden","true","appearance","minimal",1,"mat-mdc-option-pseudo-checkbox",3,"disabled"],[1,"cdk-visually-hidden"],["aria-hidden","true","mat-ripple","",1,"mat-mdc-option-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"]],template:function(i,n){i&1&&(We(ZC),C(0,ex,1,2,"mat-pseudo-checkbox",1),ue(1),s(2,"span",2,0),ue(4,1),l(),C(5,tx,1,1,"mat-pseudo-checkbox",3),C(6,ix,2,1,"span",4),I(7,"div",5)),i&2&&(x(n.multiple?0:-1),d(5),x(!n.multiple&&n.selected&&!n.hideSingleSelectionIndicator?5:-1),d(),x(n.group&&n.group._inert?6:-1),d(),w("matRippleTrigger",n._getHostElement())("matRippleDisabled",n.disabled||n.disableRipple))},dependencies:[Tl,An],styles:[`.mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-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-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mat-list-list-item-selected-container-color: var(--mat-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:""}
374
- `],encapsulation:2,changeDetection:0})}return o})();function mg(o,t,e){if(e.length){let i=t.toArray(),n=e.toArray(),r=0;for(let a=0;a<o+1;a++)i[a].group&&i[a].group===n[r]&&r++;return r}return 0}function pg(o,t,e,i){return o<e?o:o+t>e+i?Math.max(0,o-i+t):e}var Co=class{_multiple;_emitChanges;compareWith;_selection=new Set;_deselectedToEmit=[];_selectedToEmit=[];_selected;get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}changed=new R;constructor(t=!1,e,i=!0,n){this._multiple=t,this._emitChanges=i,this.compareWith=n,e&&e.length&&(t?e.forEach(r=>this._markSelected(r)):this._markSelected(e[0]),this._selectedToEmit.length=0)}select(...t){this._verifyValueAssignment(t),t.forEach(i=>this._markSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}deselect(...t){this._verifyValueAssignment(t),t.forEach(i=>this._unmarkSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}setSelection(...t){this._verifyValueAssignment(t);let e=this.selected,i=new Set(t.map(r=>this._getConcreteValue(r)));t.forEach(r=>this._markSelected(r)),e.filter(r=>!i.has(this._getConcreteValue(r,i))).forEach(r=>this._unmarkSelected(r));let n=this._hasQueuedChanges();return this._emitChangeEvent(),n}toggle(t){return this.isSelected(t)?this.deselect(t):this.select(t)}clear(t=!0){this._unmarkAll();let e=this._hasQueuedChanges();return t&&this._emitChangeEvent(),e}isSelected(t){return this._selection.has(this._getConcreteValue(t))}isEmpty(){return this._selection.size===0}hasValue(){return!this.isEmpty()}sort(t){this._multiple&&this.selected&&this._selected.sort(t)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(t){t=this._getConcreteValue(t),this.isSelected(t)||(this._multiple||this._unmarkAll(),this.isSelected(t)||this._selection.add(t),this._emitChanges&&this._selectedToEmit.push(t))}_unmarkSelected(t){t=this._getConcreteValue(t),this.isSelected(t)&&(this._selection.delete(t),this._emitChanges&&this._deselectedToEmit.push(t))}_unmarkAll(){this.isEmpty()||this._selection.forEach(t=>this._unmarkSelected(t))}_verifyValueAssignment(t){t.length>1&&this._multiple}_hasQueuedChanges(){return!!(this._deselectedToEmit.length||this._selectedToEmit.length)}_getConcreteValue(t,e){if(this.compareWith){e=e??this._selection;for(let i of e)if(this.compareWith(t,i))return i;return t}else return t}};var hg=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({imports:[le]})}return o})();var Id=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({imports:[Qa,le,hg,yo]})}return o})();var ox=["trigger"],rx=["panel"],ax=[[["mat-select-trigger"]],"*"],sx=["mat-select-trigger","*"];function lx(o,t){if(o&1&&(s(0,"span",4),p(1),l()),o&2){let e=u();d(),O(e.placeholder)}}function cx(o,t){o&1&&ue(0)}function dx(o,t){if(o&1&&(s(0,"span",11),p(1),l()),o&2){let e=u(2);d(),O(e.triggerValue)}}function mx(o,t){if(o&1&&(s(0,"span",5),C(1,cx,1,0)(2,dx,2,1,"span",11),l()),o&2){let e=u();d(),x(e.customTrigger?1:2)}}function px(o,t){if(o&1){let e=k();s(0,"div",12,1),f("keydown",function(n){b(e);let r=u();return v(r._handleKeydown(n))}),ue(2,1),l()}if(o&2){let e=u();on(En("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",e._getPanelTheme())),E("mat-select-panel-animations-enabled",!e._animationsDisabled),w("ngClass",e.panelClass),J("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var Fd=new oe("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(ye);return()=>Bi(o)}});function ug(o){let t=m(ye);return()=>Bi(t)}var gg=new oe("MAT_SELECT_CONFIG"),fg={provide:Fd,deps:[],useFactory:ug},_g=new oe("MatSelectTrigger"),Ol=class{source;value;constructor(t,e){this.source=t,this.value=e}},Nd=(()=>{class o{_viewportRuler=m(ji);_changeDetectorRef=m(Qe);_elementRef=m(ne);_dir=m(bt,{optional:!0});_idGenerator=m(Ne);_renderer=m(Ct);_parentFormField=m(_a,{optional:!0});ngControl=m(Ja,{self:!0,optional:!0});_liveAnnouncer=m(qa);_defaultOptions=m(gg,{optional:!0});_animationsDisabled=$e();_initialized=new R;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let i=this.options.toArray()[e];if(i){let n=this.panel.nativeElement,r=mg(e,this.options,this.optionGroups),a=i._getHostElement();e===0&&r===1?n.scrollTop=0:n.scrollTop=pg(a.offsetTop,a.offsetHeight,n.scrollTop,n.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new Ol(this,e)}_scrollStrategyFactory=m(Fd);_panelOpen=!1;_compareWith=(e,i)=>e===i;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new R;_errorStateTracker;stateChanges=new R;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=Oe(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(Za.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=Ao(()=>{let e=this.options;return e?e.changes.pipe(Mt(e),Qn(()=>Di(...e.map(i=>i.onSelectionChange)))):this._initialized.pipe(Qn(()=>this.optionSelectionChanges))});openedChange=new H;_openedStream=this.openedChange.pipe(me(e=>e),ve(()=>{}));_closedStream=this.openedChange.pipe(me(e=>!e),ve(()=>{}));selectionChange=new H;valueChange=new H;constructor(){let e=m(wl),i=m(es,{optional:!0}),n=m(is,{optional:!0}),r=m(new Pn("tabindex"),{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new wr(e,this.ngControl,n,i,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=r==null?0:parseInt(r)||0,this.id=this.id}ngOnInit(){this._selectionModel=new Co(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(N(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(N(this._destroy)).subscribe(e=>{e.added.forEach(i=>i.select()),e.removed.forEach(i=>i.deselect())}),this.options.changes.pipe(Mt(null),N(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),i=this.ngControl;if(e!==this._triggerAriaLabelledBy){let n=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?n.setAttribute("aria-labelledby",e):n.removeAttribute("aria-labelledby")}i&&(this._previousControl!==i.control&&(this._previousControl!==void 0&&i.disabled!==null&&i.disabled!==this.disabled&&(this.disabled=i.disabled),this._previousControl=i.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval)}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(qt(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let i=`${this.id}-panel`;this._trackedModal&&nc(this._trackedModal,"aria-owns",i),jm(e,"aria-owns",i),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;nc(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{i(),clearTimeout(n),this._cleanupDetach=void 0};let e=this.panel.nativeElement,i=this._renderer.listen(e,"animationend",r=>{r.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),n=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);e.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(i=>i.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let i=e.keyCode,n=i===40||i===38||i===37||i===39,r=i===13||i===32,a=this._keyManager;if(!a.isTyping()&&r&&!_t(e)||(this.multiple||e.altKey)&&n)e.preventDefault(),this.open();else if(!this.multiple){let c=this.selected;a.onKeydown(e);let h=this.selected;h&&c!==h&&this._liveAnnouncer.announce(h.viewValue,1e4)}}_handleOpenKeydown(e){let i=this._keyManager,n=e.keyCode,r=n===40||n===38,a=i.isTyping();if(r&&e.altKey)e.preventDefault(),this.close();else if(!a&&(n===13||n===32)&&i.activeItem&&!_t(e))e.preventDefault(),i.activeItem._selectViaInteraction();else if(!a&&this._multiple&&n===65&&e.ctrlKey){e.preventDefault();let c=this.options.some(h=>!h.disabled&&!h.selected);this.options.forEach(h=>{h.disabled||(c?h.select():h.deselect())})}else{let c=i.activeItemIndex;i.onKeydown(e),this._multiple&&r&&e.shiftKey&&i.activeItem&&i.activeItemIndex!==c&&i.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!_t(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(i=>i.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(i=>this._selectOptionByValue(i)),this._sortValues();else{let i=this._selectOptionByValue(e);i?this._keyManager.updateActiveItem(i):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let i=this.options.find(n=>{if(this._selectionModel.isSelected(n))return!1;try{return(n.value!=null||this.canSelectNullableOptions)&&this._compareWith(n.value,e)}catch{return!1}});return i&&this._selectionModel.select(i),i}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof Yo?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new zm(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=Di(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(N(e)).subscribe(i=>{this._onSelect(i.source,i.isUserInput),i.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Di(...this.options.map(i=>i._stateChanges)).pipe(N(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,i){let n=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(n!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),i&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),i&&this.focus())),n!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((i,n)=>this.sortComparator?this.sortComparator(i,n,e):e.indexOf(i)-e.indexOf(n)),this.stateChanges.next()}}_propagateChanges(e){let i;this.multiple?i=this.selected.map(n=>n.value):i=this.selected?this.selected.value:e,this._value=i,this.valueChange.emit(i),this._onChange(i),this.selectionChange.emit(this._getChangeEvent(i)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let i=0;i<this.options.length;i++)if(!this.options.get(i).disabled){e=i;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,i=e?e+" ":"";return this.ariaLabelledby?i+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-select"]],contentQueries:function(i,n,r){if(i&1&&(xt(r,_g,5),xt(r,yo,5),xt(r,Ad,5)),i&2){let a;U(a=W())&&(n.customTrigger=a.first),U(a=W())&&(n.options=a),U(a=W())&&(n.optionGroups=a)}},viewQuery:function(i,n){if(i&1&&(X(ox,5),X(rx,5),X(Ns,5)),i&2){let r;U(r=W())&&(n.trigger=r.first),U(r=W())&&(n.panel=r.first),U(r=W())&&(n._overlayDir=r.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(i,n){i&1&&f("keydown",function(a){return n._handleKeydown(a)})("focus",function(){return n._onFocus()})("blur",function(){return n._onBlur()}),i&2&&(J("id",n.id)("tabindex",n.disabled?-1:n.tabIndex)("aria-controls",n.panelOpen?n.id+"-panel":null)("aria-expanded",n.panelOpen)("aria-label",n.ariaLabel||null)("aria-required",n.required.toString())("aria-disabled",n.disabled.toString())("aria-invalid",n.errorState)("aria-activedescendant",n._getAriaActiveDescendant()),E("mat-mdc-select-disabled",n.disabled)("mat-mdc-select-invalid",n.errorState)("mat-mdc-select-required",n.required)("mat-mdc-select-empty",n.empty)("mat-mdc-select-multiple",n.multiple)("mat-select-open",n.panelOpen))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",ee],disableRipple:[2,"disableRipple","disableRipple",ee],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:gi(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",ee],placeholder:"placeholder",required:[2,"required","required",ee],multiple:[2,"multiple","multiple",ee],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",ee],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",gi],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",ee]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[Ye([{provide:fa,useExisting:o},{provide:Od,useExisting:o}]),nt],ngContentSelectors:sx,decls:11,vars:9,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",3,"keydown","ngClass"]],template:function(i,n){if(i&1){let r=k();We(ax),s(0,"div",2,0),f("click",function(){return b(r),v(n.open())}),s(3,"div",3),C(4,lx,2,1,"span",4)(5,mx,3,1,"span",5),l(),s(6,"div",6)(7,"div",7),nn(),s(8,"svg",8),I(9,"path",9),l()()()(),Re(10,px,3,10,"ng-template",10),f("detach",function(){return b(r),v(n.close())})("backdropClick",function(){return b(r),v(n.close())})("overlayKeydown",function(c){return b(r),v(n._handleOverlayKeydown(c))})}if(i&2){let r=Et(1);d(3),J("id",n._valueId),d(),x(n.empty?4:5),d(6),w("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",n._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",n._scrollStrategy)("cdkConnectedOverlayOrigin",n._preferredOverlayOrigin||r)("cdkConnectedOverlayPositions",n._positions)("cdkConnectedOverlayWidth",n._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)}},dependencies:[Yo,Ns,On],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-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-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-select-open .mat-mdc-select-arrow{transform:rotate(180deg)}.mat-form-field-animations-enabled .mat-mdc-select-arrow{transition:transform 80ms linear}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
375
- `],encapsulation:2,changeDetection:0})}return o})();var ya=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({providers:[fg],imports:[yi,Id,le,zi,pt,Id,le]})}return o})();var ux=["input"],gx=["label"],fx=["*"],_x=new oe("mat-checkbox-default-options",{providedIn:"root",factory:vg});function vg(){return{color:"accent",clickAction:"check-indeterminate",disabledInteractive:!1}}var It=(function(o){return o[o.Init=0]="Init",o[o.Checked=1]="Checked",o[o.Unchecked=2]="Unchecked",o[o.Indeterminate=3]="Indeterminate",o})(It||{}),Ld=class{source;checked},bg=vg(),Vd=(()=>{class o{_elementRef=m(ne);_changeDetectorRef=m(Qe);_ngZone=m(pe);_animationsDisabled=$e();_options=m(_x,{optional:!0});focus(){this._inputElement.nativeElement.focus()}_createChangeEvent(e){let i=new Ld;return i.source=this,i.checked=e,i}_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;labelPosition="after";name=null;change=new H;indeterminateChange=new H;value;disableRipple;_inputElement;_labelElement;tabIndex;color;disabledInteractive;_onTouched=()=>{};_currentAnimationClass="";_currentCheckState=It.Init;_controlValueAccessorChangeFn=()=>{};_validatorChangeFn=()=>{};constructor(){m(Nt).load(In);let e=m(new Pn("tabindex"),{optional:!0});this._options=this._options||bg,this.color=this._options.color||bg.color,this.tabIndex=e==null?0:parseInt(e)||0,this.id=this._uniqueId=m(Ne).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 i=e!=this._indeterminate();this._indeterminate.set(e),i&&(e?this._transitionCheckState(It.Indeterminate):this._transitionCheckState(this.checked?It.Checked:It.Unchecked),this.indeterminateChange.emit(e)),this._syncIndeterminate(e)}_indeterminate=Oe(!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 i=this._currentCheckState,n=this._getAnimationTargetElement();if(!(i===e||!n)&&(this._currentAnimationClass&&n.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(i,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){n.classList.add(this._currentAnimationClass);let r=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{n.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?It.Checked:It.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,i){if(this._animationsDisabled)return"";switch(e){case It.Init:if(i===It.Checked)return this._animationClasses.uncheckedToChecked;if(i==It.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case It.Unchecked:return i===It.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case It.Checked:return i===It.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case It.Indeterminate:return i===It.Checked?this._animationClasses.indeterminateToChecked:this._animationClasses.indeterminateToUnchecked}return""}_syncIndeterminate(e){let i=this._inputElement;i&&(i.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(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-checkbox"]],viewQuery:function(i,n){if(i&1&&(X(ux,5),X(gx,5)),i&2){let r;U(r=W())&&(n._inputElement=r.first),U(r=W())&&(n._labelElement=r.first)}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(i,n){i&2&&(Jt("id",n.id),J("tabindex",null)("aria-label",null)("aria-labelledby",null),on(n.color?"mat-"+n.color:"mat-accent"),E("_mat-animation-noopable",n._animationsDisabled)("mdc-checkbox--disabled",n.disabled)("mat-mdc-checkbox-disabled",n.disabled)("mat-mdc-checkbox-checked",n.checked)("mat-mdc-checkbox-disabled-interactive",n.disabledInteractive))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",ee],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",ee],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",ee],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?void 0:gi(e)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",ee],checked:[2,"checked","checked",ee],disabled:[2,"disabled","disabled",ee],indeterminate:[2,"indeterminate","indeterminate",ee]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[Ye([{provide:zo,useExisting:Xn(()=>o),multi:!0},{provide:Ka,useExisting:o,multi:!0}]),nt],ngContentSelectors:fx,decls:15,vars:23,consts:[["checkbox",""],["input",""],["label",""],["mat-internal-form-field","",3,"click","labelPosition"],[1,"mdc-checkbox"],[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"],[1,"mdc-checkbox__ripple"],[1,"mdc-checkbox__background"],["focusable","false","viewBox","0 0 24 24","aria-hidden","true",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","",1,"mat-mdc-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-label",3,"for"]],template:function(i,n){if(i&1){let r=k();We(),s(0,"div",3),f("click",function(c){return b(r),v(n._preventBubblingFromLabel(c))}),s(1,"div",4,0)(3,"div",5),f("click",function(){return b(r),v(n._onTouchTargetClick())}),l(),s(4,"input",6,1),f("blur",function(){return b(r),v(n._onBlur())})("click",function(){return b(r),v(n._onInputClick())})("change",function(c){return b(r),v(n._onInteractionEvent(c))}),l(),I(6,"div",7),s(7,"div",8),nn(),s(8,"svg",9),I(9,"path",10),l(),Na(),I(10,"div",11),l(),I(11,"div",12),l(),s(12,"label",13,2),ue(14),l()()}if(i&2){let r=Et(2);w("labelPosition",n.labelPosition),d(4),E("mdc-checkbox--selected",n.checked),w("checked",n.checked)("indeterminate",n.indeterminate)("disabled",n.disabled&&!n.disabledInteractive)("id",n.inputId)("required",n.required)("tabIndex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex),J("aria-label",n.ariaLabel||null)("aria-labelledby",n.ariaLabelledby)("aria-describedby",n.ariaDescribedby)("aria-checked",n.indeterminate?"mixed":null)("aria-controls",n.ariaControls)("aria-disabled",n.disabled&&n.disabledInteractive?!0:null)("aria-expanded",n.ariaExpanded)("aria-owns",n.ariaOwns)("name",n.name)("value",n.value),d(7),w("matRippleTrigger",r)("matRippleDisabled",n.disableRipple||n.disabled)("matRippleCentered",!0),d(),w("for",n.inputId)}},dependencies:[An,vl],styles:[`.mdc-checkbox{display:inline-block;position:relative;flex:0 0 18px;box-sizing:content-box;width:18px;height:18px;line-height:0;white-space:nowrap;cursor:pointer;vertical-align:bottom;padding:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);margin:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox:hover>.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:hover>.mat-mdc-checkbox-ripple>.mat-ripple-element{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover .mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover .mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control+.mdc-checkbox__ripple{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1;width:var(--mat-checkbox-state-layer-size, 40px);height:var(--mat-checkbox-state-layer-size, 40px);top:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);right:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox--disabled{cursor:default;pointer-events:none}.mdc-checkbox__background{display:inline-flex;position:absolute;align-items:center;justify-content:center;box-sizing:border-box;width:18px;height:18px;border:2px solid currentColor;border-radius:2px;background-color:rgba(0,0,0,0);pointer-events:none;will-change:background-color,border-color;transition:background-color 90ms cubic-bezier(0.4, 0, 0.6, 1),border-color 90ms cubic-bezier(0.4, 0, 0.6, 1);-webkit-print-color-adjust:exact;color-adjust:exact;border-color:var(--mat-checkbox-unselected-icon-color, var(--mat-sys-on-surface-variant));top:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2)}.mdc-checkbox__native-control:enabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:enabled:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}@media(forced-colors: active){.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:checked)~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-hover-icon-color, var(--mat-sys-on-surface));background-color:rgba(0,0,0,0)}.mdc-checkbox:hover>.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary))}.mdc-checkbox__native-control:focus:focus:not(:checked)~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-focus-icon-color, var(--mat-sys-on-surface))}.mdc-checkbox__native-control:focus:focus:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}.mdc-checkbox__checkmark{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;opacity:0;transition:opacity 180ms cubic-bezier(0.4, 0, 0.6, 1);color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__checkmark{color:CanvasText}}.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:GrayText}}.mdc-checkbox__checkmark-path{transition:stroke-dashoffset 180ms cubic-bezier(0.4, 0, 0.6, 1);stroke:currentColor;stroke-width:3.12px;stroke-dashoffset:29.7833385;stroke-dasharray:29.7833385}.mdc-checkbox__mixedmark{width:100%;height:0;transform:scaleX(0) rotate(0deg);border-width:1px;border-style:solid;opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1);border-color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__mixedmark{margin:0 1px}}.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:GrayText}}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__background,.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__background,.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__background,.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__background{animation-duration:180ms;animation-timing-function:linear}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-unchecked-checked-checkmark-path 180ms linear;transition:none}.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-unchecked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-checked-unchecked-checkmark-path 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__checkmark{animation:mdc-checkbox-checked-indeterminate-checkmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-checked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__checkmark{animation:mdc-checkbox-indeterminate-checked-checkmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-checked-mixedmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-unchecked-mixedmark 300ms linear;transition:none}.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{transition:border-color 90ms cubic-bezier(0, 0, 0.2, 1),background-color 90ms cubic-bezier(0, 0, 0.2, 1)}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path{stroke-dashoffset:0}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark{transition:opacity 180ms cubic-bezier(0, 0, 0.2, 1),transform 180ms cubic-bezier(0, 0, 0.2, 1);opacity:1}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(-45deg)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark{transform:rotate(45deg);opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(0deg);opacity:1}@keyframes mdc-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:29.7833385}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 1)}100%{stroke-dashoffset:0}}@keyframes mdc-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mdc-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);opacity:1;stroke-dashoffset:0}to{opacity:0;stroke-dashoffset:-29.7833385}}@keyframes mdc-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(45deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(45deg);opacity:0}to{transform:rotate(360deg);opacity:1}}@keyframes mdc-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(-45deg);opacity:0}to{transform:rotate(0deg);opacity:1}}@keyframes mdc-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(315deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;transform:scaleX(1);opacity:1}32.8%,100%{transform:scaleX(0);opacity:0}}.mat-mdc-checkbox{display:inline-block;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-touch-target,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__native-control,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__ripple,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-ripple::before,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__mixedmark{transition:none !important;animation:none !important}.mat-mdc-checkbox label{cursor:pointer}.mat-mdc-checkbox .mat-internal-form-field{color:var(--mat-checkbox-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-checkbox-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-checkbox-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-checkbox-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-checkbox-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-checkbox-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive{pointer-events:auto}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive input{cursor:default}.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{cursor:default;color:var(--mat-checkbox-disabled-label-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{color:GrayText}}.mat-mdc-checkbox label:empty{display:none}.mat-mdc-checkbox .mdc-checkbox__ripple{opacity:0}.mat-mdc-checkbox .mat-mdc-checkbox-ripple,.mdc-checkbox__ripple{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-checkbox .mat-mdc-checkbox-ripple:not(:empty),.mdc-checkbox__ripple:not(:empty){transform:translateZ(0)}.mat-mdc-checkbox-ripple .mat-ripple-element{opacity:.1}.mat-mdc-checkbox-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-checkbox-touch-target-size, 48px);width:var(--mat-checkbox-touch-target-size, 48px);transform:translate(-50%, -50%);display:var(--mat-checkbox-touch-target-display, block)}.mat-mdc-checkbox .mat-mdc-checkbox-ripple::before{border-radius:50%}.mdc-checkbox__native-control:focus~.mat-focus-indicator::before{content:""}
376
- `],encapsulation:2,changeDetection:0})}return o})(),yg=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({imports:[Vd,le,le]})}return o})();var vx=["button"],yx=["*"];function Cx(o,t){if(o&1&&(s(0,"div",2),I(1,"mat-pseudo-checkbox",6),l()),o&2){let e=u();d(),w("disabled",e.disabled)}}var Cg=new oe("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:xx});function xx(){return{hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1}}var xg=new oe("MatButtonToggleGroup"),wx={provide:zo,useExisting:Xn(()=>zd),multi:!0},Al=class{source;value;constructor(t,e){this.source=t,this.value=e}},zd=(()=>{class o{_changeDetector=m(Qe);_dir=m(bt,{optional:!0});_multiple=!1;_disabled=!1;_disabledInteractive=!1;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(e){this._name=e,this._markButtonsForCheck()}_name=m(Ne).getId("mat-button-toggle-group-");vertical;get value(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e.map(i=>i.value):e[0]?e[0].value:void 0}set value(e){this._setSelectionByValue(e),this.valueChange.emit(this.value)}valueChange=new H;get selected(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e:e[0]||null}get multiple(){return this._multiple}set multiple(e){this._multiple=e,this._markButtonsForCheck()}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._markButtonsForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e,this._markButtonsForCheck()}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new H;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._markButtonsForCheck()}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(e){this._hideMultipleSelectionIndicator=e,this._markButtonsForCheck()}_hideMultipleSelectionIndicator;constructor(){let e=m(Cg,{optional:!0});this.appearance=e&&e.appearance?e.appearance:"standard",this.hideSingleSelectionIndicator=e?.hideSingleSelectionIndicator??!1,this.hideMultipleSelectionIndicator=e?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new Co(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(e=>e.checked)),this.multiple||this._initializeTabIndex()}writeValue(e){this.value=e,this._changeDetector.markForCheck()}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_keydown(e){if(this.multiple||this.disabled||_t(e))return;let n=e.target.id,r=this._buttonToggles.toArray().findIndex(c=>c.buttonId===n),a=null;switch(e.keyCode){case 32:case 13:a=this._buttonToggles.get(r)||null;break;case 38:a=this._getNextButton(r,-1);break;case 37:a=this._getNextButton(r,this.dir==="ltr"?-1:1);break;case 40:a=this._getNextButton(r,1);break;case 39:a=this._getNextButton(r,this.dir==="ltr"?1:-1);break;default:return}a&&(e.preventDefault(),a._onButtonClick(),a.focus())}_emitChangeEvent(e){let i=new Al(e,this.value);this._rawValue=i.value,this._controlValueAccessorChangeFn(i.value),this.change.emit(i)}_syncButtonToggle(e,i,n=!1,r=!1){!this.multiple&&this.selected&&!e.checked&&(this.selected.checked=!1),this._selectionModel?i?this._selectionModel.select(e):this._selectionModel.deselect(e):r=!0,r?Promise.resolve().then(()=>this._updateModelValue(e,n)):this._updateModelValue(e,n)}_isSelected(e){return this._selectionModel&&this._selectionModel.isSelected(e)}_isPrechecked(e){return typeof this._rawValue>"u"?!1:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(i=>e.value!=null&&i===e.value):e.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(e=>{e.tabIndex=-1}),this.selected)this.selected.tabIndex=0;else for(let e=0;e<this._buttonToggles.length;e++){let i=this._buttonToggles.get(e);if(!i.disabled){i.tabIndex=0;break}}}_getNextButton(e,i){let n=this._buttonToggles;for(let r=1;r<=n.length;r++){let a=(e+i*r+n.length)%n.length,c=n.get(a);if(c&&!c.disabled)return c}return null}_setSelectionByValue(e){if(this._rawValue=e,!this._buttonToggles)return;let i=this._buttonToggles.toArray();if(this.multiple&&e?(Array.isArray(e),this._clearSelection(),e.forEach(n=>this._selectValue(n,i))):(this._clearSelection(),this._selectValue(e,i)),!this.multiple&&i.every(n=>n.tabIndex===-1)){for(let n of i)if(!n.disabled){n.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(e=>{e.checked=!1,this.multiple||(e.tabIndex=-1)})}_selectValue(e,i){for(let n of i)if(n.value===e){n.checked=!0,this._selectionModel.select(n),this.multiple||(n.tabIndex=0);break}}_updateModelValue(e,i){i&&this._emitChangeEvent(e),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(e=>e._markForCheck())}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["mat-button-toggle-group"]],contentQueries:function(i,n,r){if(i&1&&xt(r,Il,5),i&2){let a;U(a=W())&&(n._buttonToggles=a)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(i,n){i&1&&f("keydown",function(a){return n._keydown(a)}),i&2&&(J("role",n.multiple?"group":"radiogroup")("aria-disabled",n.disabled),E("mat-button-toggle-vertical",n.vertical)("mat-button-toggle-group-appearance-standard",n.appearance==="standard"))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",ee],value:"value",multiple:[2,"multiple","multiple",ee],disabled:[2,"disabled","disabled",ee],disabledInteractive:[2,"disabledInteractive","disabledInteractive",ee],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",ee],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",ee]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[Ye([wx,{provide:xg,useExisting:o}])]})}return o})(),Il=(()=>{class o{_changeDetectorRef=m(Qe);_elementRef=m(ne);_focusMonitor=m(Ni);_idGenerator=m(Ne);_animationDisabled=$e();_checked=!1;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return`${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex()}set tabIndex(e){this._tabIndex.set(e)}_tabIndex;disableRipple;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(e){this._appearance=e}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(e){e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(e){this._disabled=e}_disabled=!1;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e}_disabledInteractive;change=new H;constructor(){m(Nt).load(In);let e=m(xg,{optional:!0}),i=m(new Pn("tabindex"),{optional:!0})||"",n=m(Cg,{optional:!0});this._tabIndex=Oe(parseInt(i)||0),this.buttonToggleGroup=e,this.appearance=n&&n.appearance?n.appearance:"standard",this.disabledInteractive=n?.disabledInteractive??!1}ngOnInit(){let e=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),e&&(e._isPrechecked(this)?this.checked=!0:e._isSelected(this)!==this._checked&&e._syncButtonToggle(this,this._checked))}ngAfterViewInit(){this._animationDisabled||this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){let e=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),e&&e._isSelected(this)&&e._syncButtonToggle(this,!1,!1,!0)}focus(e){this._buttonElement.nativeElement.focus(e)}_onButtonClick(){if(this.disabled)return;let e=this.isSingleSelector()?!0:!this._checked;if(e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let i=this.buttonToggleGroup._buttonToggles.find(n=>n.tabIndex===0);i&&(i.tabIndex=-1),this.tabIndex=0}this.change.emit(new Al(this,this.value))}_markForCheck(){this._changeDetectorRef.markForCheck()}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-button-toggle"]],viewQuery:function(i,n){if(i&1&&X(vx,5),i&2){let r;U(r=W())&&(n._buttonElement=r.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(i,n){i&1&&f("focus",function(){return n.focus()}),i&2&&(J("aria-label",null)("aria-labelledby",null)("id",n.id)("name",null),E("mat-button-toggle-standalone",!n.buttonToggleGroup)("mat-button-toggle-checked",n.checked)("mat-button-toggle-disabled",n.disabled)("mat-button-toggle-disabled-interactive",n.disabledInteractive)("mat-button-toggle-appearance-standard",n.appearance==="standard"))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",ee],appearance:"appearance",checked:[2,"checked","checked",ee],disabled:[2,"disabled","disabled",ee],disabledInteractive:[2,"disabledInteractive","disabledInteractive",ee]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:yx,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(i,n){if(i&1){let r=k();We(),s(0,"button",1,0),f("click",function(){return b(r),v(n._onButtonClick())}),C(2,Cx,2,1,"div",2),s(3,"span",3),ue(4),l()(),I(5,"span",4)(6,"span",5)}if(i&2){let r=Et(1);w("id",n.buttonId)("disabled",n.disabled&&!n.disabledInteractive||null),J("role",n.isSingleSelector()?"radio":"button")("tabindex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("aria-pressed",n.isSingleSelector()?null:n.checked)("aria-checked",n.isSingleSelector()?n.checked:null)("name",n._getButtonName())("aria-label",n.ariaLabel)("aria-labelledby",n.ariaLabelledby)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),d(2),x(n.buttonToggleGroup&&(!n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideSingleSelectionIndicator||n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),d(4),w("matRippleTrigger",r)("matRippleDisabled",n.disableRipple||n.disabled)}},dependencies:[An,Tl],styles:[`.mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);border-radius:var(--mat-button-toggle-legacy-shape);transform:translateZ(0)}.mat-button-toggle-standalone:not([class*=mat-elevation-z]),.mat-button-toggle-group:not([class*=mat-elevation-z]){box-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)}@media(forced-colors: active){.mat-button-toggle-standalone,.mat-button-toggle-group{outline:solid 1px}}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard .mat-pseudo-checkbox,.mat-button-toggle-group-appearance-standard .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard:not([class*=mat-elevation-z]),.mat-button-toggle-group-appearance-standard:not([class*=mat-elevation-z]){box-shadow:none}@media(forced-colors: active){.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{outline:0}}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative;color:var(--mat-button-toggle-legacy-text-color);font-family:var(--mat-button-toggle-legacy-label-text-font);font-size:var(--mat-button-toggle-legacy-label-text-size);line-height:var(--mat-button-toggle-legacy-label-text-line-height);font-weight:var(--mat-button-toggle-legacy-label-text-weight);letter-spacing:var(--mat-button-toggle-legacy-label-text-tracking);--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-button-toggle-legacy-selected-state-text-color)}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-legacy-focus-state-layer-opacity)}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle-checkbox-wrapper{display:inline-block;justify-content:flex-start;align-items:center;width:0;height:18px;line-height:18px;overflow:hidden;box-sizing:border-box;position:absolute;top:50%;left:16px;transform:translate3d(0, -50%, 0)}[dir=rtl] .mat-button-toggle-checkbox-wrapper{left:auto;right:16px}.mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:12px}[dir=rtl] .mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:auto;right:12px}.mat-button-toggle-checked .mat-button-toggle-checkbox-wrapper{width:18px}.mat-button-toggle-animations-enabled .mat-button-toggle-checkbox-wrapper{transition:width 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-checkbox-wrapper{transition:none}.mat-button-toggle-checked{color:var(--mat-button-toggle-legacy-selected-state-text-color);background-color:var(--mat-button-toggle-legacy-selected-state-background-color)}.mat-button-toggle-disabled{pointer-events:none;color:var(--mat-button-toggle-legacy-disabled-state-text-color);background-color:var(--mat-button-toggle-legacy-disabled-state-background-color);--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--mat-button-toggle-legacy-disabled-state-text-color)}.mat-button-toggle-disabled.mat-button-toggle-checked{background-color:var(--mat-button-toggle-legacy-disabled-selected-state-background-color)}.mat-button-toggle-disabled-interactive{pointer-events:auto}.mat-button-toggle-appearance-standard{color:var(--mat-button-toggle-text-color, var(--mat-sys-on-surface));background-color:var(--mat-button-toggle-background-color, transparent);font-family:var(--mat-button-toggle-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-toggle-label-text-size, var(--mat-sys-label-large-size));line-height:var(--mat-button-toggle-label-text-line-height, var(--mat-sys-label-large-line-height));font-weight:var(--mat-button-toggle-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-button-toggle-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}[dir=rtl] .mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:none;border-top:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-appearance-standard.mat-button-toggle-checked{color:var(--mat-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container));background-color:var(--mat-button-toggle-selected-state-background-color, var(--mat-sys-secondary-container))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled{color:var(--mat-button-toggle-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-toggle-disabled-state-background-color, transparent)}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--mat-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled.mat-button-toggle-checked{color:var(--mat-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-toggle-disabled-selected-state-background-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{background-color:var(--mat-button-toggle-state-layer-color, var(--mat-sys-on-surface))}.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-button-toggle-appearance-standard.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}@media(hover: none){.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;user-select:none;display:inline-block;padding:0 16px;line-height:var(--mat-button-toggle-legacy-height);position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px;line-height:var(--mat-button-toggle-height, 40px)}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;pointer-events:none;opacity:0;background-color:var(--mat-button-toggle-legacy-state-layer-color)}@media(forced-colors: active){.mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 500px;opacity:.5;height:0}.mat-button-toggle-checked:hover .mat-button-toggle-focus-overlay{opacity:.6}.mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-animations-enabled .mat-button-toggle-button{transition:padding 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-button{transition:none}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}.mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:30px}[dir=rtl] .mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:0;padding-right:30px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard{--mat-focus-indicator-border-radius: var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-bottom-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-top-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}
377
- `],encapsulation:2,changeDetection:0})}return o})(),wg=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=se({type:o});static \u0275inj=ae({imports:[le,Qa,Il,le]})}return o})();var kx=(o,t)=>t.id,Mx=(o,t)=>t.value;function Tx(o,t){if(o&1&&(s(0,"mat-option",5),p(1),l()),o&2){let e=t.$implicit;w("value",e.id),d(),ie(" ",e.name," ")}}function Ex(o,t){if(o&1){let e=k();s(0,"mat-checkbox",35),f("change",function(){let n=b(e).$implicit,r=u();return v(r.toggleDayOfWeek(n.value))}),p(1),l()}if(o&2){let e=t.$implicit,i=u();w("checked",i.isDaySelected(e.value)),d(),ie(" ",e.label," ")}}function Px(o,t){if(o&1){let e=k();s(0,"mat-form-field",2)(1,"mat-label"),p(2,"Number of Occurrences"),l(),s(3,"input",10),j("ngModelChange",function(n){b(e);let r=u();return z(r.endOccurrences,n)||(r.endOccurrences=n),v(n)}),l()()}if(o&2){let e=u();d(3),V("ngModel",e.endOccurrences)}}function Ox(o,t){if(o&1){let e=k();s(0,"mat-form-field",2)(1,"mat-label"),p(2,"End Date"),l(),s(3,"input",36),j("ngModelChange",function(n){b(e);let r=u();return z(r.endTimestamp,n)||(r.endTimestamp=n),v(n)}),l()()}if(o&2){let e=u();d(3),V("ngModel",e.endTimestamp)}}function Ax(o,t){if(o&1){let e=k();s(0,"div")(1,"mat-form-field",2)(2,"mat-label"),p(3,"Parameter Value"),l(),s(4,"input",37),j("ngModelChange",function(n){b(e);let r=u();return z(r.simpleParameter,n)||(r.simpleParameter=n),v(n)}),l(),s(5,"mat-hint"),p(6),l()()()}if(o&2){let e=u();d(4),V("ngModel",e.simpleParameter),d(2),ie("Simple value for ","{{PARAMETERS}}"," placeholder or appended to first command")}}function Ix(o,t){if(o&1){let e=k();s(0,"div",40)(1,"mat-form-field",41)(2,"mat-label"),p(3,"Key"),l(),s(4,"input",42),j("ngModelChange",function(n){let r=b(e).$implicit;return z(r.key,n)||(r.key=n),v(n)}),l()(),s(5,"mat-form-field",43)(6,"mat-label"),p(7,"Value"),l(),s(8,"input",44),j("ngModelChange",function(n){let r=b(e).$implicit;return z(r.value,n)||(r.value=n),v(n)}),l()(),s(9,"button",45),f("click",function(){let n=b(e).$index,r=u(3);return v(r.removeParameter(n))}),s(10,"mat-icon"),p(11,"delete"),l()()()}if(o&2){let e=t.$implicit;d(4),V("ngModel",e.key),d(4),V("ngModel",e.value)}}function Dx(o,t){if(o&1&&(s(0,"div",39),we(1,Ix,12,2,"div",40,Jn),l()),o&2){let e=u(2);d(),Se(e.parameters)}}function Rx(o,t){if(o&1){let e=k();s(0,"div")(1,"div",26)(2,"button",38),f("click",function(){b(e);let n=u();return v(n.addParameter())}),s(3,"mat-icon"),p(4,"add"),l()()(),C(5,Dx,3,0,"div",39),s(6,"p",19),p(7),l()()}if(o&2){let e=u();d(5),x(e.parameters.length>0?5:-1),d(2),ie("Key-value pairs for ","{{key}}"," placeholders in prompt commands")}}function Fx(o,t){if(o&1&&(s(0,"div",31)(1,"mat-icon"),p(2,"error"),l(),s(3,"span"),p(4),l()()),o&2){let e=u();d(4),O(e.errorMessage)}}var Ca=class o{schedulerApi=m(kr);promptApi=m(di);dialogRef=m(ei);availablePrompts=[];isLoadingPrompts=!1;name="";promptId="";enabled=!0;startTimestamp="";intervalValue=1;intervalUnit="h";daysOfWeek=[];endConditionType="none";endOccurrences=10;endTimestamp="";parameterMode="simple";simpleParameter="";parameters=[];isSaving=!1;errorMessage="";isEditMode=!1;schedulerId="";data=m(Hi);daysOfWeekOptions=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}];constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){if(this.loadPrompts(),this.isEditMode||(this.startTimestamp=this.formatDateForInput(new Date)),this.isEditMode&&this.data.scheduler){if(this.schedulerId=this.data.scheduler.id,this.name=this.data.scheduler.name,this.promptId=this.data.scheduler.promptId,this.enabled=this.data.scheduler.enabled,this.data.scheduler.schedule.startTimestamp){let e=new Date(this.data.scheduler.schedule.startTimestamp);this.startTimestamp=this.formatDateForInput(e)}let t=this.data.scheduler.schedule.interval.match(/^(\d+)(min|h|d|M)$/);t&&t[1]&&t[2]&&(this.intervalValue=parseInt(t[1],10),this.intervalUnit=t[2]),this.daysOfWeek=this.data.scheduler.schedule.daysOfWeek||[],this.data.scheduler.schedule.endCondition&&(this.endConditionType=this.data.scheduler.schedule.endCondition.type,this.endConditionType==="occurrences"?this.endOccurrences=this.data.scheduler.schedule.endCondition.value:this.endConditionType==="endTimestamp"&&(this.endTimestamp=this.data.scheduler.schedule.endCondition.value)),this.data.scheduler.parameters&&(typeof this.data.scheduler.parameters=="object"&&Object.keys(this.data.scheduler.parameters).length===1&&"PARAMETERS"in this.data.scheduler.parameters?(this.parameterMode="simple",this.simpleParameter=String(this.data.scheduler.parameters.PARAMETERS)):(this.parameterMode="structured",this.parameters=Object.entries(this.data.scheduler.parameters).map(([e,i])=>({key:e,value:String(i)}))))}}loadPrompts(){this.isLoadingPrompts=!0,this.promptApi.listPrompts().subscribe({next:t=>{this.availablePrompts=t,this.isLoadingPrompts=!1},error:t=>{console.error("Error loading prompts:",t),this.errorMessage="Failed to load prompts",this.isLoadingPrompts=!1}})}toggleDayOfWeek(t){let e=this.daysOfWeek.indexOf(t);e>-1?this.daysOfWeek.splice(e,1):this.daysOfWeek.push(t),this.daysOfWeek.sort()}isDaySelected(t){return this.daysOfWeek.includes(t)}addParameter(){this.parameters.push({key:"",value:""})}removeParameter(t){this.parameters.splice(t,1)}trackByIndex(t){return t}formatDateForInput(t){let e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),r=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0");return`${e}-${i}-${n}T${r}:${a}`}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",!1;if(!this.promptId)return this.errorMessage="Prompt is required",!1;if(this.intervalValue<1)return this.errorMessage="Interval must be at least 1",!1;switch(this.intervalUnit){case"min":if(this.intervalValue>59)return this.errorMessage="Minutes interval must be between 1 and 59 (use hours for longer)",!1;break;case"h":if(this.intervalValue>24)return this.errorMessage="Hours interval must be between 1 and 24 (use days for longer)",!1;break;case"d":if(this.intervalValue>31)return this.errorMessage="Days interval must be between 1 and 31 (use months for longer)",!1;break;case"M":if(this.intervalValue>12)return this.errorMessage="Months interval must be between 1 and 12",!1;break}return this.endConditionType==="occurrences"&&this.endOccurrences<1?(this.errorMessage="Occurrences must be at least 1",!1):this.endConditionType==="endTimestamp"&&!this.endTimestamp?(this.errorMessage="End date is required",!1):!0}buildSchedule(){let e={startTimestamp:(this.startTimestamp?new Date(this.startTimestamp):new Date).toISOString(),interval:`${this.intervalValue}${this.intervalUnit}`};return this.daysOfWeek.length>0&&(e.daysOfWeek=[...this.daysOfWeek]),this.endConditionType==="occurrences"?e.endCondition={type:"occurrences",value:this.endOccurrences}:this.endConditionType==="endTimestamp"&&(e.endCondition={type:"endTimestamp",value:this.endTimestamp}),e}buildParameters(){if(this.parameterMode==="simple")return this.simpleParameter.trim()?{PARAMETERS:this.simpleParameter.trim()}:void 0;let t=this.parameters.filter(i=>i.key.trim());if(t.length===0)return;let e={};return t.forEach(i=>{e[i.key]=i.value}),e}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildSchedule(),e=this.buildParameters();this.isSaving=!0,this.isEditMode&&this.schedulerId?this.schedulerApi.updateScheduler(this.schedulerId,{name:this.name.trim(),enabled:this.enabled,promptId:this.promptId,schedule:t,parameters:e}).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error updating scheduler:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to update scheduler",this.isSaving=!1}}):this.schedulerApi.createScheduler({name:this.name.trim(),promptId:this.promptId,schedule:t,parameters:e,enabled:this.enabled}).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error creating scheduler:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to create scheduler",this.isSaving=!1}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-scheduler-form"]],decls:89,vars:17,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","My Scheduler","required","",3,"ngModelChange","ngModel"],["required","",3,"ngModelChange","ngModel"],[3,"value"],["matInput","","type","datetime-local",3,"ngModelChange","ngModel"],[1,"interval-section"],[1,"interval-fields"],["appearance","outline",1,"interval-value"],["matInput","","type","number","min","1","required","",3,"ngModelChange","ngModel"],["appearance","outline",1,"interval-unit"],["value","min"],["value","h"],["value","d"],["value","M"],[1,"days-section"],[1,"days-checkboxes"],[3,"checked"],[1,"hint"],[1,"end-condition-section"],[3,"ngModelChange","ngModel"],["value","none"],["value","occurrences"],["value","endTimestamp"],[1,"parameters-section"],[1,"section-header"],[1,"mode-toggle",3,"ngModelChange","ngModel"],["value","simple"],["value","structured"],[1,"enabled-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"change","checked"],["matInput","","type","datetime-local","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g., 1234 or staging",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add parameter",3,"click"],[1,"parameters-list"],[1,"parameter-item"],["appearance","outline",1,"param-key"],["matInput","","placeholder","parameterName",3,"ngModelChange","ngModel"],["appearance","outline",1,"param-value"],["matInput","","placeholder","value",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove parameter",1,"remove-btn",3,"click"]],template:function(e,i){e&1&&(s(0,"h2",0),p(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),p(6,"Name"),l(),s(7,"input",3),j("ngModelChange",function(r){return z(i.name,r)||(i.name=r),r}),l(),s(8,"mat-hint"),p(9,"A descriptive name for this scheduler"),l()(),s(10,"mat-form-field",2)(11,"mat-label"),p(12,"Prompt"),l(),s(13,"mat-select",4),j("ngModelChange",function(r){return z(i.promptId,r)||(i.promptId=r),r}),we(14,Tx,2,2,"mat-option",5,kx),l(),s(16,"mat-hint"),p(17,"Select the prompt to execute"),l()(),s(18,"mat-form-field",2)(19,"mat-label"),p(20,"Start Date & Time"),l(),s(21,"input",6),j("ngModelChange",function(r){return z(i.startTimestamp,r)||(i.startTimestamp=r),r}),l(),s(22,"mat-hint"),p(23,"When to start the scheduler (leave empty for now)"),l()(),s(24,"div",7)(25,"h3"),p(26,"Schedule Interval"),l(),s(27,"div",8)(28,"mat-form-field",9)(29,"mat-label"),p(30,"Every"),l(),s(31,"input",10),j("ngModelChange",function(r){return z(i.intervalValue,r)||(i.intervalValue=r),r}),l()(),s(32,"mat-form-field",11)(33,"mat-label"),p(34,"Unit"),l(),s(35,"mat-select",4),j("ngModelChange",function(r){return z(i.intervalUnit,r)||(i.intervalUnit=r),r}),s(36,"mat-option",12),p(37,"Minutes (1-59)"),l(),s(38,"mat-option",13),p(39,"Hours (1-24)"),l(),s(40,"mat-option",14),p(41,"Days (1-31)"),l(),s(42,"mat-option",15),p(43,"Months (1-12)"),l()()()()(),s(44,"div",16)(45,"h3"),p(46,"Days of Week (Optional)"),l(),s(47,"div",17),we(48,Ex,2,2,"mat-checkbox",18,Mx),l(),s(50,"p",19),p(51,"Leave empty to run every day"),l()(),s(52,"div",20)(53,"h3"),p(54,"End Condition (Optional)"),l(),s(55,"mat-form-field",2)(56,"mat-label"),p(57,"End Type"),l(),s(58,"mat-select",21),j("ngModelChange",function(r){return z(i.endConditionType,r)||(i.endConditionType=r),r}),s(59,"mat-option",22),p(60,"Never (run indefinitely)"),l(),s(61,"mat-option",23),p(62,"After X occurrences"),l(),s(63,"mat-option",24),p(64,"Until specific date"),l()()(),C(65,Px,4,1,"mat-form-field",2),C(66,Ox,4,1,"mat-form-field",2),l(),s(67,"div",25)(68,"div",26)(69,"h3"),p(70,"Parameters (Optional)"),l(),s(71,"mat-button-toggle-group",27),j("ngModelChange",function(r){return z(i.parameterMode,r)||(i.parameterMode=r),r}),s(72,"mat-button-toggle",28),p(73,"Simple"),l(),s(74,"mat-button-toggle",29),p(75,"Structured"),l()()(),C(76,Ax,7,2,"div"),C(77,Rx,8,2,"div"),l(),s(78,"div",30)(79,"mat-checkbox",21),j("ngModelChange",function(r){return z(i.enabled,r)||(i.enabled=r),r}),p(80,"Enabled"),l(),s(81,"p",19),p(82,"Scheduler will only run if enabled"),l()(),C(83,Fx,5,1,"div",31),l()(),s(84,"mat-dialog-actions",32)(85,"button",33),f("click",function(){return i.cancel()}),p(86,"Cancel"),l(),s(87,"button",34),f("click",function(){return i.save()}),p(88),l()()),e&2&&(d(),O(i.isEditMode?"Edit Scheduler":"Create Scheduler"),d(6),V("ngModel",i.name),d(6),V("ngModel",i.promptId),d(),Se(i.availablePrompts),d(7),V("ngModel",i.startTimestamp),d(10),V("ngModel",i.intervalValue),d(4),V("ngModel",i.intervalUnit),d(13),Se(i.daysOfWeekOptions),d(10),V("ngModel",i.endConditionType),d(7),x(i.endConditionType==="occurrences"?65:-1),d(),x(i.endConditionType==="endTimestamp"?66:-1),d(5),V("ngModel",i.parameterMode),d(5),x(i.parameterMode==="simple"?76:-1),d(),x(i.parameterMode==="structured"?77:-1),d(2),V("ngModel",i.enabled),d(4),x(i.errorMessage?83:-1),d(2),w("disabled",i.isSaving),d(2),w("disabled",i.isSaving),d(),ie(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[Fe,Ue,je,ts,Be,Bo,rs,He,mo,un,fn,gn,ot,Ot,Ke,Kt,mi,Ut,Ht,xn,pt,Me,he,ya,Nd,yo,yg,Vd,wg,zd,Il],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:600px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.interval-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%]{display:flex;gap:1rem}.interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%] .interval-value[_ngcontent-%COMP%], .interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%] .interval-unit[_ngcontent-%COMP%]{flex:1}.days-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.days-section[_ngcontent-%COMP%] .days-checkboxes[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:.5rem}.days-section[_ngcontent-%COMP%] .days-checkboxes[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{min-width:120px}.days-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.end-condition-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] .mode-toggle[_ngcontent-%COMP%]{height:32px}.parameters-section[_ngcontent-%COMP%] .parameters-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .param-key[_ngcontent-%COMP%]{flex:1}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .param-value[_ngcontent-%COMP%]{flex:2}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.parameters-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.enabled-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.enabled-section[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem}.enabled-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"]})};function Nx(o,t){o&1&&(s(0,"div",12),p(1,"Loading schedulers..."),l())}function Lx(o,t){if(o&1&&(s(0,"div",13),p(1),l()),o&2){let e=u();d(),O(e.errorMessage)}}function Vx(o,t){o&1&&(s(0,"div",14),p(1," No schedulers found. Create your first scheduler to automate prompt execution. "),l())}function zx(o,t){o&1&&(s(0,"div",14),p(1," No schedulers match your search. "),l())}function jx(o,t){if(o&1&&(s(0,"span",31),p(1),l()),o&2){let e=u().$implicit;w("title",En("Created by ",e.createdBy)),d(),ie(" \u{1F464} ",e.createdBy," ")}}function Bx(o,t){if(o&1&&(s(0,"div",22)(1,"span",23),p(2,"Last Run:"),l(),s(3,"span",24),p(4),io(5,"date"),l()()),o&2){let e=u().$implicit;d(4),O(Rr(5,1,e.lastRun,"short"))}}function Hx(o,t){if(o&1){let e=k();s(0,"div",17)(1,"div",18)(2,"h3"),p(3),s(4,"span",19),p(5),l(),Re(6,jx,2,3,"span",20),l(),s(7,"div",21)(8,"div",22)(9,"span",23),p(10,"Prompt:"),l(),s(11,"span",24),p(12),l()(),s(13,"div",22)(14,"span",23),p(15,"Schedule:"),l(),s(16,"span",24),p(17),l()(),s(18,"div",22)(19,"span",23),p(20,"Next Run:"),l(),s(21,"span",24),p(22),l()(),Re(23,Bx,6,4,"div",25),l()(),s(24,"div",26)(25,"button",27),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.editScheduler(n))}),p(26,"Edit"),l(),s(27,"button",28),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.toggleEnabled(n))}),p(28),l(),s(29,"button",29),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.runNow(n.id))}),p(30,"Run Now"),l(),s(31,"button",30),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.deleteScheduler(n.id))}),p(32,"Delete"),l()()()}if(o&2){let e=t.$implicit,i=u(2);d(3),ie(" ",e.name," "),d(),E("enabled",e.enabled),d(),ie(" ",e.enabled?"Enabled":"Disabled"," "),d(),w("ngIf",e.createdBy!==i.getCurrentUsername()),d(6),O(i.getPromptName(e.promptId)),d(5),O(i.formatInterval(e.schedule.interval)),d(5),O(i.formatNextRun(e.nextRun)),d(),w("ngIf",e.lastRun),d(4),E("btn-enabled",e.enabled)("btn-disabled",!e.enabled),d(),ie(" ",e.enabled?"Disable":"Enable"," ")}}function Ux(o,t){if(o&1&&(s(0,"div",15),Re(1,Hx,33,14,"div",16),l()),o&2){let e=u();d(),w("ngForOf",e.filteredSchedulers)}}var Dl=class o{schedulerApi=m(kr);promptApi=m(di);configApi=m(Ki);dialog=m(Ci);schedulers=[];filteredSchedulers=[];prompts=[];searchQuery="";showOnlyMine=!0;isLoading=!1;errorMessage="";currentUsername="";ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.currentUsername=t.username??"",console.log("[SCHEDULER_MANAGER] Current username:",this.currentUsername)},error:t=>{console.error("[SCHEDULER_MANAGER] Error loading user config:",t)}}),this.loadPrompts(),this.loadSchedulers()}loadPrompts(){this.promptApi.listPrompts().subscribe({next:t=>{this.prompts=t},error:t=>{console.error("Error loading prompts:",t)}})}loadSchedulers(){this.isLoading=!0,this.schedulerApi.listSchedulers().subscribe({next:t=>{this.schedulers=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading schedulers:",t),this.errorMessage="Failed to load schedulers",this.isLoading=!1}})}deleteScheduler(t){confirm("Are you sure you want to delete this scheduler?")&&this.schedulerApi.deleteScheduler(t).subscribe({next:()=>{this.loadSchedulers()},error:e=>{console.error("Error deleting scheduler:",e);let i=e?.error?.error??e?.message??"Failed to delete scheduler";alert(`Failed to delete scheduler: ${i}`)}})}toggleEnabled(t){(t.enabled?this.schedulerApi.disableScheduler(t.id):this.schedulerApi.enableScheduler(t.id)).subscribe({next:()=>{this.loadSchedulers()},error:i=>{console.error("Error toggling scheduler:",i);let n=i?.error?.error??i?.message??"Failed to toggle scheduler";alert(`Failed to toggle scheduler: ${n}`)}})}runNow(t){this.schedulerApi.runSchedulerNow(t).subscribe({next:e=>{alert(`Scheduler executed successfully! Thread ID: ${e.threadId}`),this.loadSchedulers()},error:e=>{console.error("Error running scheduler:",e);let i=e?.error?.error??e?.message??"Failed to run scheduler";alert(`Failed to run scheduler: ${i}`)}})}formatNextRun(t){return t?new Date(t).toLocaleString():"Expired or completed"}getCurrentUsername(){return this.currentUsername}getPromptName(t){let e=this.prompts.find(i=>i.id===t);return e?e.name:t}formatInterval(t){let e=RegExp(/^(\d+)(min|h|d|M)$/).exec(t);if(!e)return t;let[,i,n]=e;if(!i||!n)return t;let a={min:"minute",h:"hour",d:"day",M:"month"}[n]??n;return`Every ${i} ${a}${parseInt(i,10)>1?"s":""}`}normalizeUsername(t){return t.replace(/[.\s]+/g,"_")}isMyScheduler(t){if(!this.currentUsername)return!1;let e=this.normalizeUsername(this.currentUsername.toLowerCase());return this.normalizeUsername(t.createdBy.toLowerCase())===e}applyFilter(){let t=this.searchQuery.toLowerCase().trim(),e=this.showOnlyMine&&this.currentUsername?this.schedulers.filter(i=>this.isMyScheduler(i)):[...this.schedulers];t&&(e=e.filter(i=>i.name.toLowerCase().includes(t)||i.promptId.toLowerCase().includes(t)||this.getPromptName(i.promptId).toLowerCase().includes(t)?!0:i.createdBy.toLowerCase().includes(t))),this.filteredSchedulers=e}onSearchChange(){this.applyFilter()}createScheduler(){this.dialog.open(Ca,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadSchedulers()})}editScheduler(t){this.schedulerApi.getScheduler(t.id).subscribe({next:e=>{this.dialog.open(Ca,{width:"700px",maxHeight:"90vh",data:{mode:"edit",scheduler:e}}).afterClosed().subscribe(n=>{n&&this.loadSchedulers()})},error:e=>{console.error("Error loading scheduler details:",e);let i=e?.error?.error??e?.message??"Failed to load scheduler details";alert(`Failed to load scheduler details: ${i}`)}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-scheduler-manager"]],decls:23,vars:7,consts:[[1,"scheduler-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name, prompt, author...",3,"ngModelChange","input","ngModel"],["matPrefix",""],["color","primary",1,"mine-toggle",3,"ngModelChange","change","ngModel"],[1,"btn-create",3,"click"],["class","loading",4,"ngIf"],["class","error",4,"ngIf"],["class","empty",4,"ngIf"],["class","scheduler-list",4,"ngIf"],[1,"loading"],[1,"error"],[1,"empty"],[1,"scheduler-list"],["class","scheduler-item",4,"ngFor","ngForOf"],[1,"scheduler-item"],[1,"scheduler-info"],[1,"status-badge"],["class","owner-badge",3,"title",4,"ngIf"],[1,"details"],[1,"detail-row"],[1,"label"],[1,"value"],["class","detail-row",4,"ngIf"],[1,"scheduler-actions"],[1,"btn-primary",3,"click"],[3,"click"],[1,"btn-accent",3,"click"],[1,"btn-danger",3,"click"],[1,"owner-badge",3,"title"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),p(3,"Schedulers"),l(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),p(7,"Search"),l(),s(8,"input",4),j("ngModelChange",function(r){return z(i.searchQuery,r)||(i.searchQuery=r),r}),f("input",function(){return i.onSearchChange()}),l(),s(9,"mat-icon",5),p(10,"search"),l()(),s(11,"mat-slide-toggle",6),j("ngModelChange",function(r){return z(i.showOnlyMine,r)||(i.showOnlyMine=r),r}),f("change",function(){return i.applyFilter()}),p(12," Mine "),l(),s(13,"button",7),f("click",function(){return i.createScheduler()}),s(14,"mat-icon"),p(15,"add"),l(),s(16,"span"),p(17,"Create Scheduler"),l()()()(),Re(18,Nx,2,0,"div",8)(19,Lx,2,1,"div",9)(20,Vx,2,0,"div",10)(21,zx,2,0,"div",10)(22,Ux,2,1,"div",11),l()),e&2&&(d(8),V("ngModel",i.searchQuery),d(3),V("ngModel",i.showOnlyMine),d(7),w("ngIf",i.isLoading),d(),w("ngIf",i.errorMessage),d(),w("ngIf",!i.isLoading&&i.schedulers.length===0),d(),w("ngIf",!i.isLoading&&i.schedulers.length>0&&i.filteredSchedulers.length===0),d(),w("ngIf",!i.isLoading&&i.filteredSchedulers.length>0))},dependencies:[Fe,za,ja,Ue,je,Be,He,Me,he,Kt,mi,Ut,Ht,vo,pt,Cl,bo,Nr],styles:[".scheduler-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .mine-toggle[_ngcontent-%COMP%]{margin-bottom:-1.25em}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.scheduler-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.scheduler-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.scheduler-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.scheduler-info[_ngcontent-%COMP%]{flex:1}.scheduler-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem;display:flex;align-items:center;gap:.5rem}.scheduler-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] .owner-badge[_ngcontent-%COMP%]{font-size:.75rem;padding:.25rem .5rem;background:#2196f3;color:#fff;border-radius:4px;font-weight:400}.scheduler-info[_ngcontent-%COMP%] .status-badge[_ngcontent-%COMP%]{padding:.25rem .5rem;font-size:.75rem;border-radius:4px;background:var(--color-text-secondary);color:#fff}.scheduler-info[_ngcontent-%COMP%] .status-badge.enabled[_ngcontent-%COMP%]{background:var(--color-success)}.scheduler-info[_ngcontent-%COMP%] .details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;font-size:.9rem}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-weight:600;min-width:100px;color:var(--color-text-secondary)}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{color:var(--color-text)}.scheduler-actions[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduler-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;white-space:nowrap}.scheduler-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]{background:var(--color-secondary);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-enabled[_ngcontent-%COMP%]{background:#4caf50;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-enabled[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-disabled[_ngcontent-%COMP%]{background:#9e9e9e;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-disabled[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-accent[_ngcontent-%COMP%]{background:#ff9800;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-accent[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var Er=class o{http=m(Xe);projectState=m(ke);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/agents`}listEditableAgents(){return this.http.get(`${this.getBaseUrl()}/editable`)}getAgent(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createAgent(t,e){return this.http.post(this.getBaseUrl(),{location:e,definition:t})}updateAgent(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{definition:e})}listDocuments(t){return this.http.get(`${this.getBaseUrl()}/documents`,{params:{location:t}})}uploadDocument(t,e){return new Ii(i=>{let n=new FileReader;n.onload=()=>{let r=n.result.split(",")[1];this.http.post(`${this.getBaseUrl()}/documents`,{filename:e.name,content:r,mimeType:e.type},{params:{location:t}}).subscribe(i)},n.onerror=()=>i.error(n.error),n.readAsDataURL(e)})}deleteAgent(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};function Wx(o,t){o&1&&(s(0,"p",15),p(1,"No integrations defined \u2014 agent will have access to all tools."),l())}function $x(o,t){if(o&1){let e=k();s(0,"div",16)(1,"mat-form-field",22)(2,"mat-label"),p(3,"Integration"),l(),s(4,"input",23),j("ngModelChange",function(n){let r=b(e).$implicit;return z(r.integration,n)||(r.integration=n),v(n)}),l()(),s(5,"mat-form-field",24)(6,"mat-label"),p(7,"Tools (comma-separated)"),l(),s(8,"input",25),j("ngModelChange",function(n){let r=b(e).$implicit;return z(r.tools,n)||(r.tools=n),v(n)}),l()(),s(9,"button",26),f("click",function(){let n=b(e).$index,r=u();return v(r.removeIntegrationRow(n))}),s(10,"mat-icon"),p(11,"delete"),l()()()}if(o&2){let e=t.$implicit;d(4),V("ngModel",e.integration),d(4),V("ngModel",e.tools)}}function qx(o,t){if(o&1&&(s(0,"p",30),p(1),l()),o&2){let e=u(2);d(),O(e.docUploadError)}}function Gx(o,t){o&1&&(s(0,"p",15),p(1,"No mandatory documents defined."),l())}function Yx(o,t){if(o&1&&I(0,"option",35),o&2){let e=t.$implicit;w("value","documents/"+e)}}function Qx(o,t){if(o&1){let e=k();s(0,"div",31)(1,"mat-form-field",32)(2,"mat-label"),p(3,"Document path"),l(),s(4,"input",33),j("ngModelChange",function(n){let r=b(e).$index,a=u(2);return z(a.mandatoryDocs[r],n)||(a.mandatoryDocs[r]=n),v(n)}),l(),s(5,"datalist",34),we(6,Yx,1,1,"option",35,vm),l()(),s(8,"button",26),f("click",function(){let n=b(e).$index,r=u(2);return v(r.removeDocRow(n))}),s(9,"mat-icon"),p(10,"delete"),l()()()}if(o&2){let e=t.$index,i=u(2);d(4),V("ngModel",i.mandatoryDocs[e]),J("list","docs-list-"+e),d(),w("id","docs-list-"+e),d(),Se(i.availableDocuments)}}function Xx(o,t){if(o&1){let e=k();s(0,"div",6)(1,"span"),p(2,"Mandatory Documents"),l(),s(3,"button",27),f("click",function(){b(e);let n=u();return v(n.addDocRow())}),s(4,"mat-icon"),p(5,"add"),l()(),s(6,"label",28)(7,"mat-icon"),p(8,"upload_file"),l(),s(9,"input",29),f("change",function(n){b(e);let r=u();return v(r.onDocFileSelected(n))}),l()()(),C(10,qx,2,1,"p",30),C(11,Gx,2,0,"p",15),we(12,Qx,11,3,"div",31,Jn)}if(o&2){let e=u();d(6),E("uploading",e.isUploadingDoc),d(3),w("disabled",e.isUploadingDoc),d(),x(e.docUploadError?10:-1),d(),x(e.mandatoryDocs.length===0?11:-1),d(),Se(e.mandatoryDocs)}}function Kx(o,t){o&1&&(s(0,"p",15),p(1,"\u{1F4A1} Documents can be added after the agent is created."),l())}function Zx(o,t){if(o&1){let e=k();s(0,"div",6),p(1,"Save to"),l(),s(2,"div",36)(3,"label",37)(4,"input",38),j("ngModelChange",function(n){b(e);let r=u();return z(r.location,n)||(r.location=n),v(n)}),l(),s(5,"div",39)(6,"div",40)(7,"span",41),p(8,"\u{1F464}"),l(),s(9,"span",42),p(10,"Project config"),l()(),s(11,"p",43),p(12),l()()(),s(13,"label",37)(14,"input",44),j("ngModelChange",function(n){b(e);let r=u();return z(r.location,n)||(r.location=n),v(n)}),l(),s(15,"div",39)(16,"div",40)(17,"span",41),p(18,"\u{1F4E6}"),l(),s(19,"span",42),p(20,"Colocated"),l()(),s(21,"p",43),p(22,"Next to coday.yaml in ./agents/ (committable)"),l()()()(),s(23,"p",15),p(24,"Storage location is permanent and cannot be changed after creation."),l()}if(o&2){let e=u();d(3),E("selected",e.location==="project"),d(),V("ngModel",e.location),d(8),Tn("~/.coday/projects/","{","name","}","/agents/ (not committed)"),d(),E("selected",e.location==="colocated"),d(),V("ngModel",e.location)}}function Jx(o,t){if(o&1&&(s(0,"div",17)(1,"span",6),p(2,"Storage Location"),l(),s(3,"span",45),p(4),l(),s(5,"p",15),p(6,"Cannot be changed after creation."),l()()),o&2){let e=u();d(3),E("badge-project",e.location==="project")("badge-colocated",e.location==="colocated"),d(),ie(" ",e.location==="project"?"\u{1F464} Project config":"\u{1F4E6} Colocated"," ")}}function ew(o,t){if(o&1&&(s(0,"div",18)(1,"mat-icon"),p(2,"error"),l(),s(3,"span"),p(4),l()()),o&2){let e=u();d(4),O(e.errorMessage)}}var xa=class o{agentCrudApi=m(Er);agentApi=m(rr);dialogRef=m(ei);data=m(Hi);name="";description="";instructions="";aiProvider="";modelName="";temperature=null;maxOutputTokens=null;openaiAssistantId="";integrationRows=[];mandatoryDocs=[];availableDocuments=[];isUploadingDoc=!1;docUploadError="";location="project";isSaving=!1;errorMessage="";isEditMode=!1;ngOnInit(){if(this.isEditMode=this.data.mode==="edit",this.isEditMode&&this.data.agent){let t=this.data.agent.definition;this.name=t.name,this.description=t.description,this.instructions=t.instructions??"",this.aiProvider=t.aiProvider??"",this.modelName=t.modelName??"",this.temperature=t.temperature??null,this.maxOutputTokens=t.maxOutputTokens??null,this.openaiAssistantId=t.openaiAssistantId??"",this.location=this.data.agent.source,t.integrations&&(this.integrationRows=Object.entries(t.integrations).map(([e,i])=>({integration:e,tools:i?.join(", ")??""}))),this.mandatoryDocs=[...t.mandatoryDocs??[]],this.loadAvailableDocuments()}}loadAvailableDocuments(){this.agentCrudApi.listDocuments(this.location).subscribe({next:t=>this.availableDocuments=t,error:()=>this.availableDocuments=[]})}addDocRow(){this.mandatoryDocs.push("")}removeDocRow(t){this.mandatoryDocs.splice(t,1)}onDocFileSelected(t){let e=t.target,i=e.files?.[0];i&&(this.isUploadingDoc=!0,this.docUploadError="",this.agentCrudApi.uploadDocument(this.location,i).subscribe({next:n=>{this.isUploadingDoc=!1,this.mandatoryDocs.push(n.relativePath),this.loadAvailableDocuments(),e.value=""},error:n=>{this.isUploadingDoc=!1,this.docUploadError=n?.error?.error??n?.message??"Upload failed",e.value=""}}))}addIntegrationRow(){this.integrationRows.push({integration:"",tools:""})}removeIntegrationRow(t){this.integrationRows.splice(t,1)}trackByIndex(t){return t}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",!1;if(!/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(this.name.trim()))return this.errorMessage="Name must start with alphanumeric and contain only letters, digits, hyphens or underscores",!1;if(!this.description.trim())return this.errorMessage="Description is required",!1;for(let t of this.integrationRows)if(!t.integration.trim())return this.errorMessage="Integration name cannot be empty",!1;return!0}buildDefinition(){let t=this.mandatoryDocs.map(i=>i.trim()).filter(Boolean),e=this.integrationRows.length>0?Object.fromEntries(this.integrationRows.filter(i=>i.integration.trim()).map(i=>[i.integration.trim(),i.tools.split(",").map(n=>n.trim()).filter(Boolean)])):void 0;return{name:this.name.trim(),description:this.description.trim(),instructions:this.instructions.trim()||void 0,aiProvider:this.aiProvider.trim()||void 0,modelName:this.modelName.trim()||void 0,temperature:this.temperature??void 0,maxOutputTokens:this.maxOutputTokens??void 0,openaiAssistantId:this.openaiAssistantId.trim()||void 0,integrations:e,mandatoryDocs:t.length>0?t:void 0}}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildDefinition();this.isSaving=!0,(this.isEditMode?this.agentCrudApi.updateAgent(this.name.trim(),t):this.agentCrudApi.createAgent(t,this.location)).subscribe({next:()=>{this.isSaving=!1,this.agentApi.clearAllCache(),this.dialogRef.close(!0)},error:i=>{this.isSaving=!1,this.errorMessage=i?.error?.error||i?.message||"Failed to save agent"}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-agent-form"]],decls:69,vars:18,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-agent","required","",3,"ngModelChange","ngModel","readonly"],["matInput","","placeholder","What does this agent do?","rows","2","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","System instructions for the agent...","rows","6",3,"ngModelChange","ngModel"],[1,"section-title"],[1,"row-2col"],["appearance","outline"],["matInput","","placeholder","e.g. anthropic, openai",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g. claude-sonnet-4-5",3,"ngModelChange","ngModel"],["matInput","","type","number","min","0","max","2","step","0.1","placeholder","0.0 \u2013 2.0",3,"ngModelChange","ngModel"],["matInput","","type","number","min","1","placeholder","e.g. 4096",3,"ngModelChange","ngModel"],["matInput","","placeholder","asst_...",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add integration",3,"click"],[1,"hint"],[1,"integration-row"],[1,"source-display"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"integration-name"],["matInput","","placeholder","e.g. GITHUB",3,"ngModelChange","ngModel"],["appearance","outline",1,"integration-tools"],["matInput","","placeholder","Leave empty for all tools",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove",3,"click"],["mat-icon-button","","type","button","title","Add document path",3,"click"],["title","Upload a document to the pool",1,"upload-btn"],["type","file","hidden","",3,"change","disabled"],[1,"doc-upload-error"],[1,"doc-row"],["appearance","outline",1,"doc-field"],["matInput","","placeholder","documents/guide.md",3,"ngModelChange","ngModel"],[3,"id"],[3,"value"],[1,"source-options"],[1,"source-option"],["type","radio","name","location","value","project",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","location","value","colocated",3,"ngModelChange","ngModel"],[1,"source-badge"]],template:function(e,i){e&1&&(s(0,"h2",0),p(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),p(6,"Name"),l(),s(7,"input",3),j("ngModelChange",function(r){return z(i.name,r)||(i.name=r),r}),l(),s(8,"mat-hint"),p(9,"Alphanumeric, hyphens and underscores only. Cannot be changed after creation."),l()(),s(10,"mat-form-field",2)(11,"mat-label"),p(12,"Description"),l(),s(13,"textarea",4),j("ngModelChange",function(r){return z(i.description,r)||(i.description=r),r}),l()(),s(14,"mat-form-field",2)(15,"mat-label"),p(16,"Instructions"),l(),s(17,"textarea",5),j("ngModelChange",function(r){return z(i.instructions,r)||(i.instructions=r),r}),l(),s(18,"mat-hint"),p(19,"System prompt / instructions sent to the AI model"),l()(),s(20,"div",6),p(21,"AI Configuration"),l(),s(22,"div",7)(23,"mat-form-field",8)(24,"mat-label"),p(25,"AI Provider"),l(),s(26,"input",9),j("ngModelChange",function(r){return z(i.aiProvider,r)||(i.aiProvider=r),r}),l()(),s(27,"mat-form-field",8)(28,"mat-label"),p(29,"Model Name"),l(),s(30,"input",10),j("ngModelChange",function(r){return z(i.modelName,r)||(i.modelName=r),r}),l()()(),s(31,"div",7)(32,"mat-form-field",8)(33,"mat-label"),p(34,"Temperature"),l(),s(35,"input",11),j("ngModelChange",function(r){return z(i.temperature,r)||(i.temperature=r),r}),l(),s(36,"mat-hint"),p(37,"Leave empty for model default"),l()(),s(38,"mat-form-field",8)(39,"mat-label"),p(40,"Max Output Tokens"),l(),s(41,"input",12),j("ngModelChange",function(r){return z(i.maxOutputTokens,r)||(i.maxOutputTokens=r),r}),l(),s(42,"mat-hint"),p(43,"Leave empty for model default"),l()()(),s(44,"mat-form-field",2)(45,"mat-label"),p(46,"OpenAI Assistant ID"),l(),s(47,"input",13),j("ngModelChange",function(r){return z(i.openaiAssistantId,r)||(i.openaiAssistantId=r),r}),l(),s(48,"mat-hint"),p(49,"If set, forces aiProvider to openai"),l()(),s(50,"div",6)(51,"span"),p(52,"Integrations"),l(),s(53,"button",14),f("click",function(){return i.addIntegrationRow()}),s(54,"mat-icon"),p(55,"add"),l()()(),C(56,Wx,2,0,"p",15),we(57,$x,12,2,"div",16,Jn),C(59,Xx,14,5)(60,Kx,2,0,"p",15),C(61,Zx,25,8),C(62,Jx,7,5,"div",17),C(63,ew,5,1,"div",18),l()(),s(64,"mat-dialog-actions",19)(65,"button",20),f("click",function(){return i.cancel()}),p(66,"Cancel"),l(),s(67,"button",21),f("click",function(){return i.save()}),p(68),l()()),e&2&&(d(),O(i.isEditMode?"Edit Agent":"Create Agent"),d(6),V("ngModel",i.name),w("readonly",i.isEditMode),d(6),V("ngModel",i.description),d(4),V("ngModel",i.instructions),d(9),V("ngModel",i.aiProvider),d(4),V("ngModel",i.modelName),d(5),V("ngModel",i.temperature),d(6),V("ngModel",i.maxOutputTokens),d(6),V("ngModel",i.openaiAssistantId),d(9),x(i.integrationRows.length===0?56:-1),d(),Se(i.integrationRows),d(2),x(i.isEditMode?59:60),d(2),x(i.isEditMode?-1:61),d(),x(i.isEditMode?62:-1),d(),x(i.errorMessage?63:-1),d(2),w("disabled",i.isSaving),d(2),w("disabled",i.isSaving),d(),ie(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[Ue,ns,os,je,ts,jo,Be,Bo,rs,Ym,He,mo,un,fn,gn,ot,Ot,Ke,Kt,mi,Ut,Ht,xn,pt,Me,he,ya,Ko],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:560px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.section-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:1rem;font-weight:600;margin-top:.5rem;margin-bottom:-.25rem}.row-2col[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}@media (max-width: 768px){.row-2col[_ngcontent-%COMP%]{grid-template-columns:1fr}}.integration-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.integration-row[_ngcontent-%COMP%] .integration-name[_ngcontent-%COMP%]{flex:0 0 180px}.integration-row[_ngcontent-%COMP%] .integration-tools[_ngcontent-%COMP%]{flex:1}.hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.5rem}@media (max-width: 768px){.source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-family:monospace;line-height:1.4}.source-display[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500}.source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.doc-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.doc-row[_ngcontent-%COMP%] .doc-field[_ngcontent-%COMP%]{flex:1}.upload-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;cursor:pointer;color:var(--color-text-secondary);transition:background .2s}.upload-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);color:var(--color-primary)}.upload-btn.uploading[_ngcontent-%COMP%]{opacity:.5;cursor:wait}.upload-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.doc-upload-error[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"]})};var tw=(o,t)=>t.name;function iw(o,t){o&1&&(s(0,"div",7),p(1,"Loading agents..."),l())}function nw(o,t){if(o&1&&(s(0,"div",8),p(1),l()),o&2){let e=u();d(),O(e.errorMessage)}}function ow(o,t){o&1&&(s(0,"div",9),p(1,"No file-based agents found. Create your first agent to get started."),l())}function rw(o,t){o&1&&(s(0,"div",9),p(1,"No agents match your search."),l())}function aw(o,t){if(o&1){let e=k();s(0,"div",11)(1,"div",12)(2,"div",13)(3,"h3"),p(4),l(),s(5,"span",14),p(6),l()(),s(7,"p",15),p(8),l()(),s(9,"div",16)(10,"button",17),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.editAgent(n))}),p(11,"Edit"),l(),s(12,"button",18),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.deleteAgent(n))}),p(13,"Delete"),l()()()}if(o&2){let e=t.$implicit;d(4),O(e.name),d(),E("badge-project",e.source==="project")("badge-colocated",e.source==="colocated"),w("title",e.source==="project"?"Project config (~/.coday/)":"Colocated (next to coday.yaml)"),d(),ie(" ",e.source==="project"?"\u{1F464}":"\u{1F4E6}"," "),d(2),O(e.description)}}function sw(o,t){if(o&1&&(s(0,"div",10),we(1,aw,14,8,"div",11,tw),l()),o&2){let e=u();d(),Se(e.filteredAgents)}}var Rl=class o{agentCrudApi=m(Er);dialog=m(Ci);agents=[];filteredAgents=[];searchQuery="";isLoading=!1;errorMessage="";ngOnInit(){this.loadAgents()}loadAgents(){this.isLoading=!0,this.errorMessage="",this.agentCrudApi.listEditableAgents().subscribe({next:t=>{this.agents=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading agents:",t),this.errorMessage="Failed to load agents",this.isLoading=!1}})}applyFilter(){let t=this.searchQuery.toLowerCase().trim();this.filteredAgents=t?this.agents.filter(e=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)):[...this.agents]}onSearchChange(){this.applyFilter()}createAgent(){this.dialog.open(xa,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadAgents()})}editAgent(t){this.errorMessage="",this.agentCrudApi.getAgent(t.name).subscribe({next:e=>{this.dialog.open(xa,{width:"700px",maxHeight:"90vh",data:{mode:"edit",agent:e}}).afterClosed().subscribe(n=>{n&&this.loadAgents()})},error:e=>{console.error("Error loading agent:",e),this.errorMessage=e?.error?.error??e?.message??"Failed to load agent"}})}deleteAgent(t){confirm(`Are you sure you want to delete agent "${t.name}"?`)&&(this.errorMessage="",this.agentCrudApi.deleteAgent(t.name).subscribe({next:()=>this.loadAgents(),error:e=>{console.error("Error deleting agent:",e),this.errorMessage=e?.error?.error??e?.message??"Failed to delete agent"}}))}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-agent-manager"]],decls:21,vars:6,consts:[[1,"agent-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name or description...",3,"ngModelChange","input","ngModel"],["matPrefix",""],[1,"btn-create",3,"click"],[1,"loading"],[1,"error"],[1,"empty"],[1,"agent-list"],[1,"agent-item"],[1,"agent-info"],[1,"agent-header"],[1,"source-badge",3,"title"],[1,"description"],[1,"agent-actions"],[1,"btn-primary",3,"click"],[1,"btn-danger",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),p(3,"Agents"),l(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),p(7,"Search"),l(),s(8,"input",4),j("ngModelChange",function(r){return z(i.searchQuery,r)||(i.searchQuery=r),r}),f("input",function(){return i.onSearchChange()}),l(),s(9,"mat-icon",5),p(10,"search"),l()(),s(11,"button",6),f("click",function(){return i.createAgent()}),s(12,"mat-icon"),p(13,"add"),l(),s(14,"span"),p(15,"Create Agent"),l()()()(),C(16,iw,2,0,"div",7),C(17,nw,2,1,"div",8),C(18,ow,2,0,"div",9),C(19,rw,2,0,"div",9),C(20,sw,3,0,"div",10),l()),e&2&&(d(8),V("ngModel",i.searchQuery),d(8),x(i.isLoading?16:-1),d(),x(i.errorMessage?17:-1),d(),x(!i.isLoading&&i.agents.length===0?18:-1),d(),x(!i.isLoading&&i.agents.length>0&&i.filteredAgents.length===0?19:-1),d(),x(!i.isLoading&&i.filteredAgents.length>0?20:-1))},dependencies:[Ue,je,Be,He,Me,he,Kt,mi,Ut,Ht,vo,pt],styles:[".agent-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.agent-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.agent-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.agent-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.agent-info[_ngcontent-%COMP%]{flex:1}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;margin-bottom:.5rem}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;font-size:1rem;cursor:help}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;border:1px solid rgba(33,150,243,.3)}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;border:1px solid rgba(76,175,80,.3)}.agent-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{margin:0;color:var(--color-text-secondary)}.agent-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.agent-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem}.agent-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.agent-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.agent-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.agent-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var lw=["threadSearchInput"],cw=["*"];function dw(o,t){if(o&1){let e=k();s(0,"button",26),f("click",function(){b(e);let n=u();return v(n.toggle())}),s(1,"mat-icon"),p(2,"menu"),l()(),s(3,"button",27),f("click",function(){b(e);let n=u();return v(n.createNewThread())}),s(4,"mat-icon",10),p(5,"play_circle"),l()()}if(o&2){let e=u();d(3),w("disabled",!e.selectedProjectName())}}function mw(o,t){if(o&1){let e=k();s(0,"div",14)(1,"mat-icon",28),p(2,"search"),l(),s(3,"input",29,0),j("ngModelChange",function(n){b(e);let r=u();return z(r.threadSearchQuery,n)||(r.threadSearchQuery=n),v(n)}),f("input",function(){b(e);let n=u();return v(n.onThreadSearchInput())}),l(),s(5,"button",30),f("click",function(){b(e);let n=u();return v(n.closeThreadSearch())}),s(6,"mat-icon"),p(7,"close"),l()()()}if(o&2){let e=u();d(3),V("ngModel",e.threadSearchQuery)}}function pw(o,t){if(o&1){let e=k();s(0,"div",15)(1,"mat-icon",22),p(2,"forum"),l(),s(3,"span",23),p(4,"Threads"),l(),s(5,"button",31),f("click",function(n){b(e);let r=u();return v(r.toggleThreadSearch(n))}),s(6,"mat-icon"),p(7,"search"),l()()()}}function hw(o,t){o&1&&(s(0,"mat-icon",21),p(1,"keyboard_arrow_up"),l())}function uw(o,t){o&1&&(s(0,"mat-icon",22),p(1,"hub"),l())}function gw(o,t){o&1&&(s(0,"mat-icon",21),p(1,"keyboard_arrow_up"),l())}function fw(o,t){o&1&&(s(0,"mat-icon",22),p(1,"tune"),l())}function _w(o,t){o&1&&(s(0,"div",33)(1,"div",37),I(2,"app-options-panel",38),l()())}function bw(o,t){if(o&1){let e=k();s(0,"div",32)(1,"a",20),f("click",function(n){return b(e),u(3).openProjectConfig(),n.preventDefault(),v(n.stopPropagation())}),s(2,"mat-icon",22),p(3,"settings_applications"),l(),s(4,"span",23),p(5,"Project Configuration"),l()()()}}function vw(o,t){o&1&&(s(0,"div",32)(1,"a",39)(2,"mat-icon",22),p(3,"settings_applications"),l(),s(4,"span",23),p(5,"Project config (No project)"),l()()())}function yw(o,t){if(o&1&&C(0,bw,6,0,"div",32)(1,vw,6,0,"div",32),o&2){let e=u(2);x(e.selectedProjectName()?0:1)}}function Cw(o,t){if(o&1){let e=k();s(0,"div",32)(1,"a",20),f("click",function(n){return b(e),u(2).openAgents(),n.preventDefault(),v(n.stopPropagation())}),s(2,"mat-icon",22),p(3,"smart_toy"),l(),s(4,"span",23),p(5,"Agents"),l()()()}}function xw(o,t){o&1&&(s(0,"div",32)(1,"a",39)(2,"mat-icon",22),p(3,"smart_toy"),l(),s(4,"span",23),p(5,"Agents (No project)"),l()()())}function ww(o,t){if(o&1){let e=k();s(0,"div",32)(1,"a",20),f("click",function(n){return b(e),u(2).openPrompts(),n.preventDefault(),v(n.stopPropagation())}),s(2,"mat-icon",22),p(3,"description"),l(),s(4,"span",23),p(5,"Prompts"),l()()()}}function Sw(o,t){o&1&&(s(0,"div",32)(1,"a",39)(2,"mat-icon",22),p(3,"description"),l(),s(4,"span",23),p(5,"Prompts (No project)"),l()()())}function kw(o,t){if(o&1){let e=k();s(0,"div",32)(1,"a",20),f("click",function(n){return b(e),u(2).openSchedulers(),n.preventDefault(),v(n.stopPropagation())}),s(2,"mat-icon",22),p(3,"schedule"),l(),s(4,"span",23),p(5,"Schedulers"),l()()()}}function Mw(o,t){o&1&&(s(0,"div",32)(1,"a",39)(2,"mat-icon",22),p(3,"schedule"),l(),s(4,"span",23),p(5,"Schedulers (No project)"),l()()())}function Tw(o,t){o&1&&(s(0,"mat-icon",21),p(1,"keyboard_arrow_up"),l())}function Ew(o,t){o&1&&(s(0,"mat-icon",22),p(1,"rocket_launch"),l())}function Pw(o,t){o&1&&(s(0,"div",33),I(1,"app-preview-panel"),l())}function Ow(o,t){if(o&1){let e=k();s(0,"div",32)(1,"a",20),f("click",function(n){return b(e),u(2).toggleSection("preview"),n.preventDefault(),v(n.stopPropagation())}),C(2,Tw,2,0,"mat-icon",21)(3,Ew,2,0,"mat-icon",22),s(4,"span",23),p(5,"Preview Server"),l()(),C(6,Pw,2,0,"div",33),l()}if(o&2){let e=u(2);E("expanded",e.expandedSections.preview),d(),E("active",e.expandedSections.preview),d(),x(e.expandedSections.preview?2:3),d(4),x(e.expandedSections.preview?6:-1)}}function Aw(o,t){if(o&1){let e=k();s(0,"div",24)(1,"div",32)(2,"a",20),f("click",function(n){return b(e),u().toggleSection("config"),v(n.preventDefault())}),C(3,gw,2,0,"mat-icon",21)(4,fw,2,0,"mat-icon",22),s(5,"span",23),p(6,"Preferences"),l()(),C(7,_w,3,0,"div",33),l(),s(8,"div",32)(9,"a",20),f("click",function(n){return b(e),u().openTokenUsage(),n.preventDefault(),v(n.stopPropagation())}),s(10,"mat-icon",22),p(11,"data_usage"),l(),s(12,"span",23),p(13,"Token Usage"),l()()(),s(14,"div",32)(15,"a",20),f("click",function(n){return b(e),u().openUserConfig(),n.preventDefault(),v(n.stopPropagation())}),s(16,"mat-icon",22),p(17,"manage_accounts"),l(),s(18,"span",23),p(19,"User Configuration"),l()()(),C(20,yw,2,1),C(21,Cw,6,0,"div",32)(22,xw,6,0,"div",32),C(23,ww,6,0,"div",32)(24,Sw,6,0,"div",32),C(25,kw,6,0,"div",32)(26,Mw,6,0,"div",32),C(27,Ow,7,6,"div",34),s(28,"div",32)(29,"a",35),I(30,"img",36),s(31,"span",23),p(32,"Contribute on GitHub"),l()()()()}if(o&2){let e=u();d(),E("expanded",e.expandedSections.config),d(),E("active",e.expandedSections.config),d(),x(e.expandedSections.config?3:4),d(4),x(e.expandedSections.config?7:-1),d(13),x(e.isAdmin?20:-1),d(),x(e.selectedProjectName()?21:22),d(2),x(e.selectedProjectName()?23:24),d(2),x(e.selectedProjectName()?25:26),d(2),x(e.hasPreviewConfig()?27:-1),d(3),J("src","CODAY-Logo.png",Kn)}}function Iw(o,t){if(o&1){let e=k();s(0,"div",25)(1,"mat-icon",40),p(2,"warning"),l(),s(3,"span",41),p(4),l(),s(5,"button",42),f("click",function(){b(e);let n=u();return v(n.configErrorMessage="")}),s(6,"mat-icon"),p(7,"close"),l()()()}if(o&2){let e=u();d(4),O(e.configErrorMessage)}}var wa=class o{destroy$=new R;isOpen=!0;sidenavStateChange=new H;drawerOpen=!1;get screenWidth(){return window.innerWidth}isAdmin=!1;configErrorMessage="";expandedSections={config:!1,preview:!1,settings:!1};isThreadSearchActive=!1;threadSearchQuery="";threadSearchInput;dialog=m(Ci);configApi=m(Ki);projectStateService=m(ke);projectApi=m(Wm);router=m(Fi);preferences=m(at);threadStateService=m(At);projects=rt(this.projectStateService.projectList$);selectedProject=rt(this.projectStateService.selectedProject$);selectedProjectName=rt(this.projectStateService.selectedProject$.pipe(ve(t=>t?.name)));isProjectVolatile=rt(this.projectStateService.selectedProject$.pipe(ve(t=>t?.config?.volatile||!1)));forcedProject=rt(this.projectStateService.forcedProject$);hasPreviewConfig=rt(this.projectStateService.selectedProject$.pipe(ve(t=>!!t?.config?.preview?.command)),{initialValue:!1});ngOnInit(){let t=this.preferences.getPreference("sidenavOpen",!0);this.isOpen=t??!0,console.log("[SIDENAV] Loaded sidenav state from preferences:",this.isOpen),this.configApi.getUserConfig().pipe(N(this.destroy$)).subscribe({next:e=>{this.isAdmin=e.groups?.includes("CODAY_ADMIN")??!1,console.log("[SIDENAV] User admin status:",this.isAdmin)},error:e=>{console.error("[SIDENAV] Error loading user config for roles:",e),this.isAdmin=!1}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}toggle(){this.isOpen=!this.isOpen,this.saveSidenavState(),this.sidenavStateChange.emit(this.isOpen)}close(){this.isOpen&&(this.isOpen=!1,this.saveSidenavState(),this.sidenavStateChange.emit(!1))}saveSidenavState(){this.preferences.setPreference("sidenavOpen",this.isOpen),console.log("[SIDENAV] Saved sidenav state:",this.isOpen)}openTokenUsage(){this.configErrorMessage="",this.router.navigate(["/token-usage"]),this.close()}openUserConfig(){console.log("[SIDENAV] openUserConfig called"),this.configErrorMessage="",this.configApi.getUserConfig().pipe(N(this.destroy$)).subscribe({next:t=>{console.log("[SIDENAV] User config loaded, opening dialog"),this.dialog.open(ba,{data:{configType:"user",initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(i=>{i&&this.saveUserConfig(i)})},error:t=>{console.error("[SIDENAV] Error loading user config:",t),this.configErrorMessage=t?.error?.error||"Failed to load user configuration"}})}saveUserConfig(t){this.configApi.updateUserConfig(t).pipe(N(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] User config saved successfully")},error:e=>{console.error("[SIDENAV] Error saving user config:",e),this.configErrorMessage=e?.error?.error||"Failed to save user configuration"}})}openProjectConfig(){let t=this.selectedProjectName();if(!t){console.error("[SIDENAV] No project selected"),this.configErrorMessage="No project selected. Please select a project first.";return}this.configErrorMessage="",this.projectApi.getProjectConfig(t).pipe(N(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] Project config loaded, opening dialog"),this.dialog.open(ba,{data:{configType:"project",projectName:t,initialContent:JSON.stringify(e,null,2)}}).afterClosed().subscribe(n=>{n&&this.saveProjectConfig(t,n)})},error:e=>{console.error("[SIDENAV] Error loading project config:",e),this.configErrorMessage=e?.error?.error||"Failed to load project configuration"}})}saveProjectConfig(t,e){this.projectApi.updateProjectConfig(t,e).pipe(N(this.destroy$)).subscribe({next:i=>{console.log("[SIDENAV] Project config saved successfully")},error:i=>{console.error("[SIDENAV] Error saving project config:",i),this.configErrorMessage=i?.error?.error||"Failed to save project configuration"}})}requireProjectSelection(t){return this.selectedProjectName()?!0:(console.error(`[SIDENAV] No project selected, cannot ${t}`),this.configErrorMessage="Please select a project first",!1)}openManagerDialog(t,e){console.log(`[SIDENAV] ${e}`),this.dialog.open(t,{width:"90vw",maxWidth:"1200px",height:"90vh",maxHeight:"900px"})}openAgents(){this.requireProjectSelection("open agents")&&this.openManagerDialog(Rl,"Opening agent manager dialog")}openPrompts(){this.requireProjectSelection("open prompts")&&this.openManagerDialog(Ml,"Opening prompt manager dialog")}openSchedulers(){this.requireProjectSelection("open schedulers")&&this.openManagerDialog(Dl,`Opening scheduler manager dialog for project: ${this.selectedProjectName()}`)}toggleSection(t){let e=this.expandedSections[t];t==="settings"?this.expandedSections[t]=!e:(["config","preview"].forEach(n=>{this.expandedSections[n]=!1}),this.expandedSections[t]=!e)}navigateToHome(){if(this.forcedProject()){console.log("[SIDENAV] Cannot navigate to home - forced project active");return}console.log("[SIDENAV] Navigating to home (project selection)"),this.projectStateService.clearSelection(),this.router.navigate(["/"])}createNewThread(){let t=this.selectedProjectName();if(!t){console.error("[SIDENAV] No project selected, cannot create new thread"),this.configErrorMessage="Please select a project first";return}console.log("[SIDENAV] Navigating to welcome view for new thread"),this.threadStateService.clearSelection(),this.router.navigate(["project",t])}onThreadSelectedOnMobile(){window.innerWidth<1024&&this.close()}toggleThreadSearch(t){t.stopPropagation(),this.isThreadSearchActive=!0,this.threadSearchQuery="",setTimeout(()=>{this.threadSearchInput?.nativeElement.focus()},0)}closeThreadSearch(){this.isThreadSearchActive=!1,this.threadSearchQuery=""}onThreadSearchInput(){}onThreadSearchModeChange(t){t||this.closeThreadSearch()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-sidenav"]],viewQuery:function(e,i){if(e&1&&X(lw,5),e&2){let n;U(n=W())&&(i.threadSearchInput=n.first)}},inputs:{drawerOpen:"drawerOpen"},outputs:{sidenavStateChange:"sidenavStateChange"},ngContentSelectors:cw,decls:34,vars:31,consts:[["threadSearchInput",""],[1,"sidenav-container",3,"hasBackdrop"],["mode","push","position","start",1,"app-sidenav",3,"closed","opened","disableClose"],[1,"sidenav-header"],["mat-icon-button","","title","Close menu",3,"click"],["alt","coday",3,"click","keydown.enter","keydown.space","title"],[1,"header-title-section"],[1,"sidenav-title"],[1,"new-thread-section"],["role","button","tabindex","0",1,"new-thread-link",3,"click"],["fontSet","material-icons-outlined"],[1,"new-thread-text"],[1,"sidenav-sections"],[1,"section-container","expanded"],[1,"search-header"],[1,"section-toggle","active","threads-header"],[1,"section-content","threads"],[1,"sidenav-thread-selector",3,"searchModeChange","threadSelected","searchMode","searchQuery"],[1,"sidenav-nav"],[1,"section-container","settings-group"],["role","button","tabindex","0",1,"section-toggle",3,"click"],[1,"arrow-icon","expanded"],[1,"section-icon"],[1,"section-label"],[1,"section-content","settings-content"],["role","alert",1,"error-notification"],["mat-icon-button","","title","Menu","type","button",1,"sidenav-toggle-btn",3,"click"],["mat-icon-button","","title","Start a new thread","type","button",1,"sidenav-new-thread-btn",3,"click","disabled"],[1,"search-icon"],["type","text","placeholder","Search threads...",1,"search-input",3,"ngModelChange","input","ngModel"],["mat-icon-button","","title","Close search","type","button",1,"close-search-btn",3,"click"],["mat-icon-button","","title","Search threads","type","button",1,"search-button",3,"click"],[1,"section-container"],[1,"section-content"],[1,"section-container",3,"expanded"],["href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer","title","Contribute on GitHub",1,"section-toggle","contribute-btn"],["alt","Coday",1,"contribute-logo"],[1,"preference-item"],[1,"inline-panel"],["role","button","tabindex","-1","aria-disabled","true",1,"section-toggle","disabled"],[1,"error-icon"],[1,"error-text"],["mat-icon-button","","aria-label","Close error message",1,"error-close",3,"click"]],template:function(e,i){e&1&&(We(),C(0,dw,6,1),s(1,"mat-sidenav-container",1)(2,"mat-sidenav",2),f("closed",function(){return i.close()}),s(3,"div",3)(4,"button",4),f("click",function(){return i.close()}),s(5,"mat-icon"),p(6,"chevron_left"),l()(),s(7,"img",5),f("click",function(r){return i.navigateToHome(),r.stopPropagation()})("keydown.enter",function(r){return i.navigateToHome(),r.preventDefault(),r.stopPropagation()})("keydown.space",function(r){return i.navigateToHome(),r.preventDefault(),r.stopPropagation()}),l(),s(8,"div",6)(9,"h2",7),p(10),l()()(),s(11,"div",8)(12,"a",9),f("click",function(r){return i.createNewThread(),r.preventDefault()}),s(13,"mat-icon",10),p(14,"play_circle"),l(),s(15,"span",11),p(16,"Start a new thread"),l()()(),s(17,"div",12)(18,"div",13),C(19,mw,8,1,"div",14)(20,pw,8,0,"div",15),s(21,"div",16)(22,"app-thread-selector",17),f("searchModeChange",function(r){return i.onThreadSearchModeChange(r)})("threadSelected",function(){return i.onThreadSelectedOnMobile()}),l()()()(),s(23,"div",18)(24,"div",19)(25,"a",20),f("click",function(r){return i.toggleSection("settings"),r.preventDefault()}),C(26,hw,2,0,"mat-icon",21)(27,uw,2,0,"mat-icon",22),s(28,"span",23),p(29,"Control Center"),l()(),C(30,Aw,33,12,"div",24),l()()(),s(31,"mat-sidenav-content"),ue(32),l()(),C(33,Iw,8,1,"div",25)),e&2&&(x(!i.isOpen&&(!i.drawerOpen||i.screenWidth>=1024)?0:-1),d(),E("sidenav-open",i.isOpen),w("hasBackdrop",!1),d(),w("opened",i.isOpen)("disableClose",!0),d(5),E("sidenav-logo",!0)("clickable",!i.forcedProject())("disabled",i.forcedProject()),w("title",i.forcedProject()?"Project selection disabled":"Go to project selection"),J("src","CODAY-Logo.png",Kn)("role",i.forcedProject()?null:"button")("tabindex",i.forcedProject()?null:"0"),d(3),O(i.selectedProjectName()),d(9),x(i.isThreadSearchActive?19:20),d(3),w("searchMode",i.isThreadSearchActive)("searchQuery",i.threadSearchQuery),d(),E("is-admin",i.isAdmin),d(),E("expanded",i.expandedSections.settings),d(),E("active",i.expandedSections.settings),d(),x(i.expandedSections.settings?26:27),d(4),x(i.expandedSections.settings?30:-1),d(),E("sidenav-closed-offset",!i.isOpen),d(2),x(i.configErrorMessage?33:-1))},dependencies:[Ue,je,Be,He,fl,Td,ju,ul,Me,he,ot,Ke,$u,qu,ga,Sl,kl],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}.sidenav-container[_ngcontent-%COMP%]{position:fixed;top:0;left:0;right:0;height:100dvh;z-index:1400;transition:width;display:flex}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]{position:relative!important;transition:width;width:310px;height:100dvh!important;flex-shrink:0}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]:not(.mat-drawer-opened){width:0!important;overflow:hidden!important;visibility:hidden!important}.sidenav-container[_ngcontent-%COMP%] mat-sidenav-content[_ngcontent-%COMP%]{width:100%;margin:0!important}[_nghost-%COMP%] .mat-drawer-backdrop{pointer-events:auto}[_nghost-%COMP%] .mat-drawer-content{pointer-events:auto!important;background:transparent!important;overflow:visible!important}[_nghost-%COMP%] .mat-drawer-inner-container{overflow:hidden!important;height:100dvh!important;display:flex!important;flex-direction:column!important}.sidenav-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:1rem!important;left:1rem!important;z-index:1500!important}@media (max-width: 1023px){.sidenav-toggle-btn[_ngcontent-%COMP%]{width:40px!important;height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:0!important;line-height:1!important;background:var(--glass-bg)!important;backdrop-filter:var(--glass-backdrop-blur)!important;-webkit-backdrop-filter:var(--glass-backdrop-blur)!important;border:1px solid var(--glass-border)!important;box-shadow:var(--glass-shadow)!important;border-radius:50%!important}.sidenav-toggle-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{display:flex!important;align-items:center!important;justify-content:center!important;line-height:1!important}}.sidenav-new-thread-btn[_ngcontent-%COMP%]{position:fixed!important;top:calc(1.5rem + 40px)!important;left:1rem!important;z-index:1500!important}.sidenav-new-thread-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]:disabled{opacity:.5!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]:disabled mat-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)!important}@media (max-width: 1023px){.sidenav-new-thread-btn[_ngcontent-%COMP%]{width:40px!important;height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:0!important;line-height:1!important;background:var(--glass-bg)!important;backdrop-filter:var(--glass-backdrop-blur)!important;-webkit-backdrop-filter:var(--glass-backdrop-blur)!important;border:1px solid var(--glass-border)!important;box-shadow:var(--glass-shadow)!important;border-radius:50%!important}.sidenav-new-thread-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{display:flex!important;align-items:center!important;justify-content:center!important;line-height:1!important}}.sidenav-logo-btn[_ngcontent-%COMP%]{position:fixed!important;bottom:1rem!important;left:1rem!important;z-index:1500!important;width:56px!important;height:56px!important;border-radius:50%!important;border:1px solid var(--glass-border)!important;padding:4px!important;background:var(--glass-bg)!important;backdrop-filter:var(--glass-backdrop-blur)!important;-webkit-backdrop-filter:var(--glass-backdrop-blur)!important;box-shadow:var(--glass-shadow)!important;transition:all .3s cubic-bezier(.4,0,.2,1)!important;cursor:pointer!important;pointer-events:auto!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;text-decoration:none!important}.sidenav-logo-btn[_ngcontent-%COMP%]:hover{transform:scale(1.08) translateY(-2px)!important;box-shadow:0 16px 48px #0003!important;border-color:var(--color-primary)!important}.sidenav-logo-btn[_ngcontent-%COMP%]:active{transform:scale(.96)!important}.sidenav-logo-btn[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:2px}.app-sidenav[_ngcontent-%COMP%]{width:310px;height:100dvh!important;min-height:0!important;position:relative;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border-radius:0;overflow:hidden;overflow-x:hidden!important;display:flex;flex-direction:column}.sidenav-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:1.5rem 1rem .5rem;flex-shrink:0}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:4px;flex-shrink:0;transition:all .2s ease}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]{cursor:pointer}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:hover{transform:scale(1.1);filter:drop-shadow(0 4px 12px rgba(0,0,0,.15))}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:active{transform:scale(.95)}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;pointer-events:none}.sidenav-header[_ngcontent-%COMP%] .header-title-section[_ngcontent-%COMP%]{flex:1;display:flex;align-items:center;min-width:0}.sidenav-header[_ngcontent-%COMP%] .header-title-section[_ngcontent-%COMP%] .sidenav-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.loading-section[_ngcontent-%COMP%]{padding:2rem 1rem;display:flex;align-items:center;justify-content:center}.loading-content[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:1rem;align-items:center}.loading-content[_ngcontent-%COMP%] mat-progress-bar[_ngcontent-%COMP%]{width:100%;height:4px;border-radius:2px}.loading-content[_ngcontent-%COMP%] .loading-text[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary);text-align:center}.new-thread-section[_ngcontent-%COMP%]{padding:1rem 1rem .5rem;flex-shrink:0}.new-thread-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;background:transparent;border:none;text-decoration:none;cursor:pointer;transition:all .2s ease;gap:.5rem;font-size:.95rem;font-weight:600;padding:0}.new-thread-link[_ngcontent-%COMP%] .new-thread-text[_ngcontent-%COMP%]{background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-primary);animation:_ngcontent-%COMP%_iconPulse 3s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%]:hover{transform:translate(4px)}.new-thread-link[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_iconPulse 1.5s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%]:focus{transform:scale(1.1)}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}@keyframes _ngcontent-%COMP%_iconPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.05)}}.sidenav-sections[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:100px;overflow:hidden}.sidenav-sections[_ngcontent-%COMP%] > .section-container[_ngcontent-%COMP%], .sidenav-sections[_ngcontent-%COMP%] > .section-container.expanded[_ngcontent-%COMP%], .sidenav-sections[_ngcontent-%COMP%] > .section-container[_ngcontent-%COMP%] > .section-content.threads[_ngcontent-%COMP%], .sidenav-sections[_ngcontent-%COMP%] > .section-container[_ngcontent-%COMP%] > .section-content.threads[_ngcontent-%COMP%] > app-thread-selector[_ngcontent-%COMP%]{display:flex!important;flex-direction:column!important;flex:1!important;min-height:0!important;overflow:hidden!important}.sidenav-nav[_ngcontent-%COMP%]{flex-shrink:0;display:flex;flex-direction:column;overflow:hidden;max-height:70%;border-top:1px solid var(--color-border)}.sidenav-nav[_ngcontent-%COMP%] > .settings-group[_ngcontent-%COMP%] > .section-toggle.active[_ngcontent-%COMP%]{border-top:none}.sidenav-nav[_ngcontent-%COMP%] .settings-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.sidenav-nav[_ngcontent-%COMP%] .settings-group[_ngcontent-%COMP%] > .section-toggle[_ngcontent-%COMP%]{flex-shrink:0}.sidenav-nav[_ngcontent-%COMP%] .settings-group[_ngcontent-%COMP%] > .section-content.settings-content[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}.settings-group[_ngcontent-%COMP%] > .section-content.settings-content[_ngcontent-%COMP%]{padding:0;border-bottom:1px solid var(--color-border);overflow:visible}.settings-group[_ngcontent-%COMP%] > .section-content.settings-content[_ngcontent-%COMP%] .section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{max-height:40vh;overflow-y:auto;overflow-x:hidden}.contribute-btn[_ngcontent-%COMP%] .contribute-logo[_ngcontent-%COMP%]{width:20px;height:20px;border-radius:2px;flex-shrink:0}.section-container[_ngcontent-%COMP%]{flex-shrink:0;display:flex;flex-direction:column}.section-container.expanded[_ngcontent-%COMP%]{display:flex;flex-direction:column}.section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{border-bottom:none}.section-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;width:100%;padding:.5rem 1rem;height:50px;text-decoration:none;cursor:pointer;transition:all .2s ease;background:transparent;border:none;border-radius:0;color:var(--color-text);flex-shrink:0}.section-toggle.active[_ngcontent-%COMP%]{border-top:1px solid var(--color-border)}.section-toggle.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;pointer-events:none}.section-toggle[_ngcontent-%COMP%] .arrow-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);transition:transform .2s ease;transform:rotate(0);flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .section-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .section-label[_ngcontent-%COMP%]{flex:1;font-size:.9rem;color:var(--color-text);text-align:left}.section-toggle[_ngcontent-%COMP%] .search-button[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .search-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.section-toggle[_ngcontent-%COMP%]:hover:not(.disabled){background:var(--color-bg-hover)}.section-toggle[_ngcontent-%COMP%]:active:not(.disabled){transform:scale(.98)}.section-toggle[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:-2px}.search-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;height:50px;background:var(--color-bg-hover);border-top:1px solid var(--color-border);transition:all .2s ease}.search-header[_ngcontent-%COMP%] .search-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);flex-shrink:0}.search-header[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent;color:var(--color-text);font-size:.9rem;padding:0;min-width:0}.search-header[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-muted)}.search-header[_ngcontent-%COMP%] .close-search-btn[_ngcontent-%COMP%]{flex-shrink:0}.search-header[_ngcontent-%COMP%] .close-search-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.section-content[_ngcontent-%COMP%]{padding:.5rem 0 0;animation:_ngcontent-%COMP%_slideDown .2s ease;border-bottom:1px solid var(--color-border);display:flex;flex-direction:column}.section-content.threads[_ngcontent-%COMP%]{padding:0;border-bottom:none;flex:1!important;min-height:0!important;overflow:hidden!important}.section-content.threads[_ngcontent-%COMP%] app-thread-selector[_ngcontent-%COMP%]{flex:1!important;min-height:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}@keyframes _ngcontent-%COMP%_slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.config-links[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:.5rem 1rem;margin-bottom:1rem}.sidenav-item[_ngcontent-%COMP%]{width:100%}.sidenav-item[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary)}.sidenav-item[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{flex:1;font-size:.9rem}.sidenav-item[_ngcontent-%COMP%] .disabled-hint[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary);font-style:italic}.sidenav-link.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;color:var(--color-text-secondary)}.sidenav-link.disabled[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.sidenav-link[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%], .sidenav-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-primary)}.sidenav-link[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{font-size:.875rem}.preference-item[_ngcontent-%COMP%]{padding-bottom:1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border)}.preference-item[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;margin-bottom:.75rem;padding:0 1rem}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.preference-item[_ngcontent-%COMP%] .preference-content[_ngcontent-%COMP%]{padding:0 1rem}.error-notification[_ngcontent-%COMP%]{position:fixed;top:5rem;left:50%;transform:translate(-50%);z-index:2000;display:flex;align-items:center;gap:.75rem;background:#ff3b3026;backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid rgba(255,59,48,.3);border-radius:16px;padding:1rem 1.5rem;box-shadow:var(--glass-shadow);animation:_ngcontent-%COMP%_errorSlideDown .3s cubic-bezier(.4,0,.2,1)}.error-notification[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{font-size:1.2rem;flex-shrink:0;color:#c00}.error-notification[_ngcontent-%COMP%] .error-text[_ngcontent-%COMP%]{flex:1;color:#c00;font-size:.9rem;font-weight:500}@keyframes _ngcontent-%COMP%_errorSlideDown{0%{opacity:0;transform:translate(-50%,-10px)}to{opacity:1;transform:translate(-50%)}}@media (max-width: 480px){.app-sidenav[_ngcontent-%COMP%]{width:280px}.sidenav-toggle-btn[_ngcontent-%COMP%]{left:.75rem!important;top:.75rem!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]{left:.75rem!important;top:calc(1.25rem + 40px)!important}.error-notification[_ngcontent-%COMP%]{left:1rem;right:1rem;transform:none;max-width:calc(100vw - 2rem)}}body.dark[_nghost-%COMP%] .app-sidenav[_ngcontent-%COMP%], body.dark [_nghost-%COMP%] .app-sidenav[_ngcontent-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .app-sidenav[_ngcontent-%COMP%]{background:#242830f2;border-right-color:#b4c8ff17}body.dark[_nghost-%COMP%] .sidenav-header[_ngcontent-%COMP%], body.dark [_nghost-%COMP%] .sidenav-header[_ngcontent-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .sidenav-header[_ngcontent-%COMP%]{background:#242830b3}"]})};var Fl=class o{destroy$=new R;isSetup=!1;codayService=m(Xt);preferencesService=m(at);setup(){if(this.isSetup){console.warn("[AGENT-NOTIFICATION] Service already set up");return}console.log("[AGENT-NOTIFICATION] Setting up agent notification service"),this.codayService.isThinking$.pipe(N(this.destroy$),Io(),me(([t,e])=>t===!0&&e===!1)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled()}),this.preferencesService.browserNotificationEnabled$.pipe(N(this.destroy$),Io(),me(([t,e])=>t===!1&&e===!0)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Browser notifications enabled, checking permission"),this.handleBrowserNotificationEnabled()}),this.isSetup=!0}notifyTaskFinishedIfEnabled(){this.preferencesService.getAgentNotificationEnabled()&&(this.preferencesService.getNotificationSoundEnabled()&&this.playCompletionSound(),this.preferencesService.getBrowserNotificationEnabled()&&this.sendBrowserNotification())}playCompletionSound(){try{let t=new(window.AudioContext||window.webkitAudioContext),e=t.createOscillator(),i=t.createGain();e.connect(i),i.connect(t.destination),e.frequency.setValueAtTime(700,t.currentTime),i.gain.setValueAtTime(.1,t.currentTime),i.gain.exponentialRampToValueAtTime(.01,t.currentTime+.08),e.start(t.currentTime),e.stop(t.currentTime+.08);let n=t.createOscillator(),r=t.createGain();n.connect(r),r.connect(t.destination);let a=t.currentTime+.11;n.frequency.setValueAtTime(950,a),r.gain.setValueAtTime(.1,a),r.gain.exponentialRampToValueAtTime(.01,a+.09),n.start(a),n.stop(a+.09),console.log("[AGENT-NOTIFICATION] Completion sound played")}catch(t){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",t)}}handleBrowserNotificationEnabled(){return te(this,null,function*(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="denied"){console.warn("[AGENT-NOTIFICATION] Permission denied, disabling browser notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="granted"){console.log("[AGENT-NOTIFICATION] Permission already granted, showing confirmation"),this.createConfirmationNotification();return}try{(yield Notification.requestPermission())==="granted"?(console.log("[AGENT-NOTIFICATION] Permission granted, showing confirmation"),this.createConfirmationNotification()):(console.log("[AGENT-NOTIFICATION] Permission denied or dismissed"),this.preferencesService.setBrowserNotificationEnabled(!1))}catch(t){console.error("[AGENT-NOTIFICATION] Error requesting permission:",t),this.preferencesService.setBrowserNotificationEnabled(!1)}})}sendBrowserNotification(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications");return}if(document.hasFocus()){console.warn("[AGENT-NOTIFICATION] Document is focused, skipping browser notification");return}Notification.permission==="granted"?this.createTaskCompleteNotification():console.warn("[AGENT-NOTIFICATION] Permission not granted, cannot send notification")}createConfirmationNotification(){let t=new Notification("Coday - Notifications Enabled",{body:"You will be notified when the agent completes tasks",icon:"/favicon.ico",tag:"coday-notifications-enabled",requireInteraction:!1});setTimeout(()=>t.close(),4e3),t.onclick=()=>{window.focus(),t.close()},console.log("[AGENT-NOTIFICATION] Confirmation notification sent")}createTaskCompleteNotification(){let t=new Notification("Coday - Task Complete",{body:"The agent has finished and is waiting for your input",icon:"/favicon.ico",tag:"coday-task-complete",requireInteraction:!1});setTimeout(()=>t.close(),5e3),t.onclick=()=>{window.focus(),t.close()},console.log("[AGENT-NOTIFICATION] Task complete notification sent")}ngOnDestroy(){console.log("[AGENT-NOTIFICATION] Service destroyed"),this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var Dw=["inputSection"];function Rw(o,t){if(o&1){let e=k();s(0,"app-thread",4),f("chatFocused",function(){b(e);let n=u();return v(n.onChatFocusedOnMobile())})("drawerStateChange",function(n){b(e);let r=u();return v(r.onDrawerStateChange(n))}),l()}if(o&2){let e=u();w("projectName",e.projectName)("threadId",e.threadId)}}function Fw(o,t){if(o&1){let e=k();s(0,"div",5),I(1,"app-welcome-message"),l(),s(2,"div",6,0)(4,"div",7)(5,"div",8)(6,"app-chat-textarea",9),f("messageSubmitted",function(n){b(e);let r=u();return v(r.onMessageSubmitted(n))})("voiceRecordingToggled",function(n){b(e);let r=u();return v(r.onVoiceToggled(n))})("heightChanged",function(n){b(e);let r=u();return v(r.onInputHeightChanged(n))})("textareaFocused",function(){b(e);let n=u();return v(n.onChatFocusedOnMobile())}),l()()()()}if(o&2){let e=u();d(6),w("isDisabled",e.isSessionInitializing)("isSessionInitializing",e.isSessionInitializing)("showWelcome",!0)("isThinking",!1)("isStarting",e.isStartingFirstMessage)}}var Sa=class o{destroy$=new R;inputSection;sidenav;projectName="";threadId=null;isSessionInitializing=!1;isStartingFirstMessage=!1;inputSectionHeight=80;codayService=m(Xt);titleService=m(yr);preferencesService=m(at);route=m(Ba);router=m(Fi);threadApiService=m(Qi);agentNotificationService=m(Fl);firstMessageState=m(Cr);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)")}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(N(this.destroy$)).subscribe(t=>{let e=t.projectName,i=t.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:e,thread:i,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=e,this.threadId=i,this.threadId?console.log("[MAIN-APP] Thread selected - ThreadComponent will display"):(console.log("[MAIN-APP] No thread selected - showing welcome view"),this.initializeWelcomeView())})}initializeWelcomeView(){this.codayService.setTabTitleService(this.titleService)}ngAfterViewInit(){setTimeout(()=>this.updateInputSectionHeight(),100)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}onMessageSubmitted(t){console.log("[MAIN-APP] First message submitted from welcome view:",t),this.isSessionInitializing=!0,this.isStartingFirstMessage=!0,this.threadApiService.createThread().subscribe({next:e=>{console.log("[MAIN-APP] Thread created:",e.thread.id),this.firstMessageState.setPendingFirstMessage(t),this.router.navigate(["project",this.projectName,"thread",e.thread.id])},error:e=>{console.error("[MAIN-APP] Failed to create thread:",e),this.isSessionInitializing=!1,this.isStartingFirstMessage=!1,alert("Failed to create conversation: "+(e.message||"Unknown error"))}})}onVoiceToggled(t){console.log("[VOICE] Recording in welcome view:",t)}isDrawerOpen=!1;onDrawerStateChange(t){this.isDrawerOpen=t}onChatFocusedOnMobile(){window.innerWidth<1024&&this.sidenav?.close()}onInputHeightChanged(t){console.log("[MAIN-APP] Input height changed:",t),this.inputSectionHeight=t}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let t=this.inputSection.nativeElement.offsetHeight;t!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",t),this.inputSectionHeight=t)}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let t=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",t),t?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical")};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical")};static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-main"]],viewQuery:function(e,i){if(e&1&&(X(Dw,5),X(wa,5)),e&2){let n;U(n=W())&&(i.inputSection=n.first),U(n=W())&&(i.sidenav=n.first)}},decls:4,vars:2,consts:[["inputSection",""],[3,"drawerOpen"],[1,"app"],[3,"projectName","threadId"],[3,"chatFocused","drawerStateChange","projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","textareaFocused","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(e,i){e&1&&(s(0,"app-sidenav",1)(1,"div",2),C(2,Rw,1,2,"app-thread",3)(3,Fw,7,5),l()()),e&2&&(w("drawerOpen",i.isDrawerOpen),d(2),x(i.threadId?2:3))},dependencies:[ar,bl,er,wa],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;min-width:0;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center;overflow:hidden}.chat-wrapper[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;background:transparent;width:100%;padding:2.5rem 0 1.5rem;display:flex;justify-content:center}.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem}@media (max-width: 768px){.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{padding:0 1rem}}.welcome-section[_ngcontent-%COMP%]{flex-shrink:0;text-align:center;padding:2rem 1rem;animation:_ngcontent-%COMP%_fadeInUp .8s ease-out;display:flex;justify-content:center;align-items:center;width:100%;min-width:0;overflow:hidden}@keyframes _ngcontent-%COMP%_fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.input-section[_ngcontent-%COMP%]{flex-shrink:0;position:relative;border-top:none;background:transparent;box-shadow:none;padding:2.5rem 0 2rem;overflow-y:visible;max-height:none;width:100%;z-index:10;pointer-events:none;display:flex;justify-content:center}.input-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}@media (max-width: 768px){.input-center[_ngcontent-%COMP%]{padding:0 1rem}}.input-glass[_ngcontent-%COMP%]{background:none;box-shadow:none;width:100%;min-height:64px;display:flex;align-items:stretch;gap:0;pointer-events:auto;position:relative;overflow:visible}.input-glass[_ngcontent-%COMP%] app-chat-textarea[_ngcontent-%COMP%]{width:100%;min-width:0;flex:1 1 auto;align-self:stretch;display:flex}body.dark[_nghost-%COMP%], body.dark [_nghost-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .input-glass[_ngcontent-%COMP%]{background:#24283073;border-color:#b4c8ff17;box-shadow:0 8px 32px #0000002b,0 1.5px 8px #00000012}.choice-overlay[_ngcontent-%COMP%]{z-index:10;width:100%;display:flex;justify-content:center;align-items:center}.upload-status[_ngcontent-%COMP%]{position:fixed;bottom:100px;left:50%;transform:translate(-50%);z-index:1000;display:flex;align-items:center;padding:12px 20px;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);border-radius:16px;font-size:.9em;color:var(--color-text);box-shadow:var(--glass-shadow);max-width:300px;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:#ff3b3026;color:var(--color-error);border-color:#ff3b304d}@media (max-width: 768px){.welcome-section[_ngcontent-%COMP%]{padding:1.5rem 1rem}.input-section[_ngcontent-%COMP%]{padding:1.5rem .75rem 1rem}.input-center[_ngcontent-%COMP%]{padding:0 .5rem}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;overflow:visible!important}.app[_ngcontent-%COMP%]{height:auto!important;overflow:visible!important;display:block!important}.input-section[_ngcontent-%COMP%], .welcome-section[_ngcontent-%COMP%]{display:none!important}}"],data:{animation:[ac("slideIn",[ss(":enter",[Dn({transform:"translateY(100%)",opacity:0}),as("300ms ease-out",Dn({transform:"translateY(0)",opacity:1}))]),ss(":leave",[as("200ms ease-in",Dn({transform:"translateY(100%)",opacity:0}))])])]}})};var Nl=class o{route=m(Ba);ngOnInit(){console.log("[OAuth Callback] Component initialized");let t=this.route.snapshot.queryParamMap.get("code"),e=this.route.snapshot.queryParamMap.get("state"),i=this.route.snapshot.queryParamMap.get("error"),n=this.route.snapshot.queryParamMap.get("error_description");if(console.log("[OAuth Callback] Code:",t,"State:",e,"Error:",i,"Opener:",!!window.opener),i){if(console.log("[OAuth Callback] OAuth error received:",i,n),!window.opener){alert(`OAuth error: ${i}${n?" - "+n:""}. Please close this window.`);return}try{window.opener.postMessage({error:i,state:e,errorDescription:n},window.location.origin),console.log("[OAuth Callback] Error postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup after error"),window.close()},1e3)}catch(r){console.error("[OAuth Callback] Error sending error postMessage:",r),alert("OAuth error: Failed to communicate with parent window")}return}if(!t||!e){console.error("[OAuth Callback] Missing code or state");return}if(!window.opener){console.error("[OAuth Callback] No window.opener - popup may have been opened incorrectly"),alert("OAuth callback error: No parent window found. Please close this window and try again.");return}try{console.log("[OAuth Callback] Sending postMessage to parent"),window.opener.postMessage({code:t,state:e},window.location.origin),console.log("[OAuth Callback] postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup"),window.close()},1e3)}catch(r){console.error("[OAuth Callback] Error sending postMessage:",r),alert("OAuth callback error: Failed to communicate with parent window")}}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-oauth-callback"]],decls:2,vars:0,template:function(e,i){e&1&&(ii(0,"p"),p(1,"Authentication in progress..."),ni())},encapsulation:2})};var jd=o=>te(null,null,function*(){let t=m(ke),e=o.params.projectName;return e?t.getSelectedProjectId()===e?!0:(t.selectProject(e),(yield sm(t.selectedProject$.pipe(dm(n=>n?.name===e))))?.name===e):(console.log("[PROJECT GUARD] no project id in route"),!1)});var Sg=o=>te(null,null,function*(){let t=m(At),e=m(Xi),i=o.params.threadId;if(!e.getUsername())try{yield Yl(e.fetchCurrentUser())}catch(n){console.error("[THREAD GUARD] Failed to load current user:",n)}if(!i)return console.log("[THREAD GUARD] no threadId in route"),!1;if(console.log("[THREAD GUARD] Checking thread:",i),console.log("[THREAD GUARD] Current selected thread:",t.getSelectedThreadId()),t.getSelectedThreadId()===i)return console.log("[THREAD GUARD] Thread already selected, allowing navigation"),!0;console.log("[THREAD GUARD] Selecting thread:",i),t.selectThread(i);try{let n=yield Yl(Yn([t.isLoading$,t.selectedThread$]).pipe(yt(([a,c])=>console.log(`\u{1F43C} [${a?"loading":"loaded"}]`,c?.id)),me(([a,c])=>!a&&!!c),qt(1),ve(([a,c])=>c?.id))),r=n===i;return r?console.log("[THREAD GUARD] Thread validated, allowing navigation"):console.error("[THREAD GUARD] Thread ID mismatch - route:",i,"loaded:",n),r}catch(n){return console.error("[THREAD GUARD] Error loading thread:",n),!1}});var kg=[{path:"",component:Ys},{path:"oauth/callback",component:Nl},{path:"project/:projectName",component:Sa,canActivate:[jd]},{path:"project/:projectName/thread/:threadId",component:Sa,canActivate:[jd,Sg]},{path:"token-usage",loadComponent:()=>import("./chunk-Z7D32IIN.js").then(o=>o.TokenUsageComponent)},{path:"agentos",loadChildren:()=>import("./chunk-NNGQAXLA.js").then(o=>o.AGENTOS_ROUTES)},{path:"**",redirectTo:""}];function Nw(o){return()=>o.initializeDefaultProject()}function Lw(o){return()=>{console.log("[APP_INIT] OAuthService initialized")}}var Mg={providers:[hm(),Sm({eventCoalescing:!0}),Rm(kg),Im(),Qp(),pm(Ko),{provide:Jl,useFactory:Nw,deps:[ke],multi:!0},{provide:Jl,useFactory:Lw,deps:[Hn],multi:!0},Um({basePath:"/api/agentos"}),{provide:Ls,useValue:{width:"80vw",maxWidth:"80vw",maxHeight:"80vh"}}]};var Ll=class o{title="client";themeService=m(xr);ngOnInit(){console.log("[APP] Application initialized with theme:",this.themeService.getCurrentTheme())}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-root"]],decls:1,vars:0,template:function(e,i){e&1&&I(0,"router-outlet")},dependencies:[Fm,Dm],encapsulation:2})};Am(Ll,Mg).catch(o=>console.error(o));
374
+ `],encapsulation:2,changeDetection:0})}return o})();function mg(o,t,e){if(e.length){let i=t.toArray(),n=e.toArray(),r=0;for(let a=0;a<o+1;a++)i[a].group&&i[a].group===n[r]&&r++;return r}return 0}function pg(o,t,e,i){return o<e?o:o+t>e+i?Math.max(0,o-i+t):e}var Co=class{_multiple;_emitChanges;compareWith;_selection=new Set;_deselectedToEmit=[];_selectedToEmit=[];_selected;get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}changed=new R;constructor(t=!1,e,i=!0,n){this._multiple=t,this._emitChanges=i,this.compareWith=n,e&&e.length&&(t?e.forEach(r=>this._markSelected(r)):this._markSelected(e[0]),this._selectedToEmit.length=0)}select(...t){this._verifyValueAssignment(t),t.forEach(i=>this._markSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}deselect(...t){this._verifyValueAssignment(t),t.forEach(i=>this._unmarkSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}setSelection(...t){this._verifyValueAssignment(t);let e=this.selected,i=new Set(t.map(r=>this._getConcreteValue(r)));t.forEach(r=>this._markSelected(r)),e.filter(r=>!i.has(this._getConcreteValue(r,i))).forEach(r=>this._unmarkSelected(r));let n=this._hasQueuedChanges();return this._emitChangeEvent(),n}toggle(t){return this.isSelected(t)?this.deselect(t):this.select(t)}clear(t=!0){this._unmarkAll();let e=this._hasQueuedChanges();return t&&this._emitChangeEvent(),e}isSelected(t){return this._selection.has(this._getConcreteValue(t))}isEmpty(){return this._selection.size===0}hasValue(){return!this.isEmpty()}sort(t){this._multiple&&this.selected&&this._selected.sort(t)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(t){t=this._getConcreteValue(t),this.isSelected(t)||(this._multiple||this._unmarkAll(),this.isSelected(t)||this._selection.add(t),this._emitChanges&&this._selectedToEmit.push(t))}_unmarkSelected(t){t=this._getConcreteValue(t),this.isSelected(t)&&(this._selection.delete(t),this._emitChanges&&this._deselectedToEmit.push(t))}_unmarkAll(){this.isEmpty()||this._selection.forEach(t=>this._unmarkSelected(t))}_verifyValueAssignment(t){t.length>1&&this._multiple}_hasQueuedChanges(){return!!(this._deselectedToEmit.length||this._selectedToEmit.length)}_getConcreteValue(t,e){if(this.compareWith){e=e??this._selection;for(let i of e)if(this.compareWith(t,i))return i;return t}else return t}};var hg=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({imports:[ce]})}return o})();var Id=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({imports:[Qa,ce,hg,yo]})}return o})();var ox=["trigger"],rx=["panel"],ax=[[["mat-select-trigger"]],"*"],sx=["mat-select-trigger","*"];function lx(o,t){if(o&1&&(s(0,"span",4),p(1),l()),o&2){let e=u();d(),O(e.placeholder)}}function cx(o,t){o&1&&ue(0)}function dx(o,t){if(o&1&&(s(0,"span",11),p(1),l()),o&2){let e=u(2);d(),O(e.triggerValue)}}function mx(o,t){if(o&1&&(s(0,"span",5),C(1,cx,1,0)(2,dx,2,1,"span",11),l()),o&2){let e=u();d(),x(e.customTrigger?1:2)}}function px(o,t){if(o&1){let e=k();s(0,"div",12,1),f("keydown",function(n){b(e);let r=u();return v(r._handleKeydown(n))}),ue(2,1),l()}if(o&2){let e=u();on(En("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",e._getPanelTheme())),E("mat-select-panel-animations-enabled",!e._animationsDisabled),w("ngClass",e.panelClass),J("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var Fd=new oe("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let o=m(ye);return()=>Bi(o)}});function ug(o){let t=m(ye);return()=>Bi(t)}var gg=new oe("MAT_SELECT_CONFIG"),fg={provide:Fd,deps:[],useFactory:ug},_g=new oe("MatSelectTrigger"),Ol=class{source;value;constructor(t,e){this.source=t,this.value=e}},Nd=(()=>{class o{_viewportRuler=m(ji);_changeDetectorRef=m(Qe);_elementRef=m(ne);_dir=m(bt,{optional:!0});_idGenerator=m(Ne);_renderer=m(Ct);_parentFormField=m(_a,{optional:!0});ngControl=m(Ja,{self:!0,optional:!0});_liveAnnouncer=m(qa);_defaultOptions=m(gg,{optional:!0});_animationsDisabled=$e();_initialized=new R;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let i=this.options.toArray()[e];if(i){let n=this.panel.nativeElement,r=mg(e,this.options,this.optionGroups),a=i._getHostElement();e===0&&r===1?n.scrollTop=0:n.scrollTop=pg(a.offsetTop,a.offsetHeight,n.scrollTop,n.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new Ol(this,e)}_scrollStrategyFactory=m(Fd);_panelOpen=!1;_compareWith=(e,i)=>e===i;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new R;_errorStateTracker;stateChanges=new R;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=Oe(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(Za.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=Ao(()=>{let e=this.options;return e?e.changes.pipe(Mt(e),Qn(()=>Di(...e.map(i=>i.onSelectionChange)))):this._initialized.pipe(Qn(()=>this.optionSelectionChanges))});openedChange=new H;_openedStream=this.openedChange.pipe(me(e=>e),ve(()=>{}));_closedStream=this.openedChange.pipe(me(e=>!e),ve(()=>{}));selectionChange=new H;valueChange=new H;constructor(){let e=m(wl),i=m(es,{optional:!0}),n=m(is,{optional:!0}),r=m(new Pn("tabindex"),{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new wr(e,this.ngControl,n,i,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=r==null?0:parseInt(r)||0,this.id=this.id}ngOnInit(){this._selectionModel=new Co(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(N(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(N(this._destroy)).subscribe(e=>{e.added.forEach(i=>i.select()),e.removed.forEach(i=>i.deselect())}),this.options.changes.pipe(Mt(null),N(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),i=this.ngControl;if(e!==this._triggerAriaLabelledBy){let n=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?n.setAttribute("aria-labelledby",e):n.removeAttribute("aria-labelledby")}i&&(this._previousControl!==i.control&&(this._previousControl!==void 0&&i.disabled!==null&&i.disabled!==this.disabled&&(this.disabled=i.disabled),this._previousControl=i.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval)}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(qt(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let i=`${this.id}-panel`;this._trackedModal&&nc(this._trackedModal,"aria-owns",i),jm(e,"aria-owns",i),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;nc(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{i(),clearTimeout(n),this._cleanupDetach=void 0};let e=this.panel.nativeElement,i=this._renderer.listen(e,"animationend",r=>{r.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),n=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);e.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(i=>i.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let i=e.keyCode,n=i===40||i===38||i===37||i===39,r=i===13||i===32,a=this._keyManager;if(!a.isTyping()&&r&&!_t(e)||(this.multiple||e.altKey)&&n)e.preventDefault(),this.open();else if(!this.multiple){let c=this.selected;a.onKeydown(e);let h=this.selected;h&&c!==h&&this._liveAnnouncer.announce(h.viewValue,1e4)}}_handleOpenKeydown(e){let i=this._keyManager,n=e.keyCode,r=n===40||n===38,a=i.isTyping();if(r&&e.altKey)e.preventDefault(),this.close();else if(!a&&(n===13||n===32)&&i.activeItem&&!_t(e))e.preventDefault(),i.activeItem._selectViaInteraction();else if(!a&&this._multiple&&n===65&&e.ctrlKey){e.preventDefault();let c=this.options.some(h=>!h.disabled&&!h.selected);this.options.forEach(h=>{h.disabled||(c?h.select():h.deselect())})}else{let c=i.activeItemIndex;i.onKeydown(e),this._multiple&&r&&e.shiftKey&&i.activeItem&&i.activeItemIndex!==c&&i.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!_t(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(i=>i.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(i=>this._selectOptionByValue(i)),this._sortValues();else{let i=this._selectOptionByValue(e);i?this._keyManager.updateActiveItem(i):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let i=this.options.find(n=>{if(this._selectionModel.isSelected(n))return!1;try{return(n.value!=null||this.canSelectNullableOptions)&&this._compareWith(n.value,e)}catch{return!1}});return i&&this._selectionModel.select(i),i}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof Yo?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new zm(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=Di(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(N(e)).subscribe(i=>{this._onSelect(i.source,i.isUserInput),i.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Di(...this.options.map(i=>i._stateChanges)).pipe(N(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,i){let n=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(n!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),i&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),i&&this.focus())),n!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((i,n)=>this.sortComparator?this.sortComparator(i,n,e):e.indexOf(i)-e.indexOf(n)),this.stateChanges.next()}}_propagateChanges(e){let i;this.multiple?i=this.selected.map(n=>n.value):i=this.selected?this.selected.value:e,this._value=i,this.valueChange.emit(i),this._onChange(i),this.selectionChange.emit(this._getChangeEvent(i)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let i=0;i<this.options.length;i++)if(!this.options.get(i).disabled){e=i;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,i=e?e+" ":"";return this.ariaLabelledby?i+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-select"]],contentQueries:function(i,n,r){if(i&1&&(xt(r,_g,5),xt(r,yo,5),xt(r,Ad,5)),i&2){let a;U(a=W())&&(n.customTrigger=a.first),U(a=W())&&(n.options=a),U(a=W())&&(n.optionGroups=a)}},viewQuery:function(i,n){if(i&1&&(X(ox,5),X(rx,5),X(Ns,5)),i&2){let r;U(r=W())&&(n.trigger=r.first),U(r=W())&&(n.panel=r.first),U(r=W())&&(n._overlayDir=r.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(i,n){i&1&&f("keydown",function(a){return n._handleKeydown(a)})("focus",function(){return n._onFocus()})("blur",function(){return n._onBlur()}),i&2&&(J("id",n.id)("tabindex",n.disabled?-1:n.tabIndex)("aria-controls",n.panelOpen?n.id+"-panel":null)("aria-expanded",n.panelOpen)("aria-label",n.ariaLabel||null)("aria-required",n.required.toString())("aria-disabled",n.disabled.toString())("aria-invalid",n.errorState)("aria-activedescendant",n._getAriaActiveDescendant()),E("mat-mdc-select-disabled",n.disabled)("mat-mdc-select-invalid",n.errorState)("mat-mdc-select-required",n.required)("mat-mdc-select-empty",n.empty)("mat-mdc-select-multiple",n.multiple)("mat-select-open",n.panelOpen))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",ee],disableRipple:[2,"disableRipple","disableRipple",ee],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:gi(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",ee],placeholder:"placeholder",required:[2,"required","required",ee],multiple:[2,"multiple","multiple",ee],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",ee],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",gi],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",ee]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[Ye([{provide:fa,useExisting:o},{provide:Od,useExisting:o}]),nt],ngContentSelectors:sx,decls:11,vars:9,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",3,"keydown","ngClass"]],template:function(i,n){if(i&1){let r=k();We(ax),s(0,"div",2,0),f("click",function(){return b(r),v(n.open())}),s(3,"div",3),C(4,lx,2,1,"span",4)(5,mx,3,1,"span",5),l(),s(6,"div",6)(7,"div",7),nn(),s(8,"svg",8),I(9,"path",9),l()()()(),Re(10,px,3,10,"ng-template",10),f("detach",function(){return b(r),v(n.close())})("backdropClick",function(){return b(r),v(n.close())})("overlayKeydown",function(c){return b(r),v(n._handleOverlayKeydown(c))})}if(i&2){let r=Et(1);d(3),J("id",n._valueId),d(),x(n.empty?4:5),d(6),w("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",n._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",n._scrollStrategy)("cdkConnectedOverlayOrigin",n._preferredOverlayOrigin||r)("cdkConnectedOverlayPositions",n._positions)("cdkConnectedOverlayWidth",n._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)}},dependencies:[Yo,Ns,On],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-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-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-select-open .mat-mdc-select-arrow{transform:rotate(180deg)}.mat-form-field-animations-enabled .mat-mdc-select-arrow{transition:transform 80ms linear}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
375
+ `],encapsulation:2,changeDetection:0})}return o})();var ya=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({providers:[fg],imports:[yi,Id,ce,zi,pt,Id,ce]})}return o})();var ux=["input"],gx=["label"],fx=["*"],_x=new oe("mat-checkbox-default-options",{providedIn:"root",factory:vg});function vg(){return{color:"accent",clickAction:"check-indeterminate",disabledInteractive:!1}}var It=(function(o){return o[o.Init=0]="Init",o[o.Checked=1]="Checked",o[o.Unchecked=2]="Unchecked",o[o.Indeterminate=3]="Indeterminate",o})(It||{}),Ld=class{source;checked},bg=vg(),Vd=(()=>{class o{_elementRef=m(ne);_changeDetectorRef=m(Qe);_ngZone=m(pe);_animationsDisabled=$e();_options=m(_x,{optional:!0});focus(){this._inputElement.nativeElement.focus()}_createChangeEvent(e){let i=new Ld;return i.source=this,i.checked=e,i}_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;labelPosition="after";name=null;change=new H;indeterminateChange=new H;value;disableRipple;_inputElement;_labelElement;tabIndex;color;disabledInteractive;_onTouched=()=>{};_currentAnimationClass="";_currentCheckState=It.Init;_controlValueAccessorChangeFn=()=>{};_validatorChangeFn=()=>{};constructor(){m(Nt).load(In);let e=m(new Pn("tabindex"),{optional:!0});this._options=this._options||bg,this.color=this._options.color||bg.color,this.tabIndex=e==null?0:parseInt(e)||0,this.id=this._uniqueId=m(Ne).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 i=e!=this._indeterminate();this._indeterminate.set(e),i&&(e?this._transitionCheckState(It.Indeterminate):this._transitionCheckState(this.checked?It.Checked:It.Unchecked),this.indeterminateChange.emit(e)),this._syncIndeterminate(e)}_indeterminate=Oe(!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 i=this._currentCheckState,n=this._getAnimationTargetElement();if(!(i===e||!n)&&(this._currentAnimationClass&&n.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(i,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){n.classList.add(this._currentAnimationClass);let r=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{n.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?It.Checked:It.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,i){if(this._animationsDisabled)return"";switch(e){case It.Init:if(i===It.Checked)return this._animationClasses.uncheckedToChecked;if(i==It.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case It.Unchecked:return i===It.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case It.Checked:return i===It.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case It.Indeterminate:return i===It.Checked?this._animationClasses.indeterminateToChecked:this._animationClasses.indeterminateToUnchecked}return""}_syncIndeterminate(e){let i=this._inputElement;i&&(i.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(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-checkbox"]],viewQuery:function(i,n){if(i&1&&(X(ux,5),X(gx,5)),i&2){let r;U(r=W())&&(n._inputElement=r.first),U(r=W())&&(n._labelElement=r.first)}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(i,n){i&2&&(Jt("id",n.id),J("tabindex",null)("aria-label",null)("aria-labelledby",null),on(n.color?"mat-"+n.color:"mat-accent"),E("_mat-animation-noopable",n._animationsDisabled)("mdc-checkbox--disabled",n.disabled)("mat-mdc-checkbox-disabled",n.disabled)("mat-mdc-checkbox-checked",n.checked)("mat-mdc-checkbox-disabled-interactive",n.disabledInteractive))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",ee],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",ee],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",ee],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?void 0:gi(e)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",ee],checked:[2,"checked","checked",ee],disabled:[2,"disabled","disabled",ee],indeterminate:[2,"indeterminate","indeterminate",ee]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[Ye([{provide:zo,useExisting:Xn(()=>o),multi:!0},{provide:Ka,useExisting:o,multi:!0}]),nt],ngContentSelectors:fx,decls:15,vars:23,consts:[["checkbox",""],["input",""],["label",""],["mat-internal-form-field","",3,"click","labelPosition"],[1,"mdc-checkbox"],[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"],[1,"mdc-checkbox__ripple"],[1,"mdc-checkbox__background"],["focusable","false","viewBox","0 0 24 24","aria-hidden","true",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","",1,"mat-mdc-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-label",3,"for"]],template:function(i,n){if(i&1){let r=k();We(),s(0,"div",3),f("click",function(c){return b(r),v(n._preventBubblingFromLabel(c))}),s(1,"div",4,0)(3,"div",5),f("click",function(){return b(r),v(n._onTouchTargetClick())}),l(),s(4,"input",6,1),f("blur",function(){return b(r),v(n._onBlur())})("click",function(){return b(r),v(n._onInputClick())})("change",function(c){return b(r),v(n._onInteractionEvent(c))}),l(),I(6,"div",7),s(7,"div",8),nn(),s(8,"svg",9),I(9,"path",10),l(),Na(),I(10,"div",11),l(),I(11,"div",12),l(),s(12,"label",13,2),ue(14),l()()}if(i&2){let r=Et(2);w("labelPosition",n.labelPosition),d(4),E("mdc-checkbox--selected",n.checked),w("checked",n.checked)("indeterminate",n.indeterminate)("disabled",n.disabled&&!n.disabledInteractive)("id",n.inputId)("required",n.required)("tabIndex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex),J("aria-label",n.ariaLabel||null)("aria-labelledby",n.ariaLabelledby)("aria-describedby",n.ariaDescribedby)("aria-checked",n.indeterminate?"mixed":null)("aria-controls",n.ariaControls)("aria-disabled",n.disabled&&n.disabledInteractive?!0:null)("aria-expanded",n.ariaExpanded)("aria-owns",n.ariaOwns)("name",n.name)("value",n.value),d(7),w("matRippleTrigger",r)("matRippleDisabled",n.disableRipple||n.disabled)("matRippleCentered",!0),d(),w("for",n.inputId)}},dependencies:[An,vl],styles:[`.mdc-checkbox{display:inline-block;position:relative;flex:0 0 18px;box-sizing:content-box;width:18px;height:18px;line-height:0;white-space:nowrap;cursor:pointer;vertical-align:bottom;padding:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);margin:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox:hover>.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:hover>.mat-mdc-checkbox-ripple>.mat-ripple-element{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover .mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover .mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control+.mdc-checkbox__ripple{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1;width:var(--mat-checkbox-state-layer-size, 40px);height:var(--mat-checkbox-state-layer-size, 40px);top:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);right:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox--disabled{cursor:default;pointer-events:none}.mdc-checkbox__background{display:inline-flex;position:absolute;align-items:center;justify-content:center;box-sizing:border-box;width:18px;height:18px;border:2px solid currentColor;border-radius:2px;background-color:rgba(0,0,0,0);pointer-events:none;will-change:background-color,border-color;transition:background-color 90ms cubic-bezier(0.4, 0, 0.6, 1),border-color 90ms cubic-bezier(0.4, 0, 0.6, 1);-webkit-print-color-adjust:exact;color-adjust:exact;border-color:var(--mat-checkbox-unselected-icon-color, var(--mat-sys-on-surface-variant));top:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2)}.mdc-checkbox__native-control:enabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:enabled:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}@media(forced-colors: active){.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:checked)~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-hover-icon-color, var(--mat-sys-on-surface));background-color:rgba(0,0,0,0)}.mdc-checkbox:hover>.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary))}.mdc-checkbox__native-control:focus:focus:not(:checked)~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-focus-icon-color, var(--mat-sys-on-surface))}.mdc-checkbox__native-control:focus:focus:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}.mdc-checkbox__checkmark{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;opacity:0;transition:opacity 180ms cubic-bezier(0.4, 0, 0.6, 1);color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__checkmark{color:CanvasText}}.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:GrayText}}.mdc-checkbox__checkmark-path{transition:stroke-dashoffset 180ms cubic-bezier(0.4, 0, 0.6, 1);stroke:currentColor;stroke-width:3.12px;stroke-dashoffset:29.7833385;stroke-dasharray:29.7833385}.mdc-checkbox__mixedmark{width:100%;height:0;transform:scaleX(0) rotate(0deg);border-width:1px;border-style:solid;opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1);border-color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__mixedmark{margin:0 1px}}.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:GrayText}}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__background,.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__background,.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__background,.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__background{animation-duration:180ms;animation-timing-function:linear}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-unchecked-checked-checkmark-path 180ms linear;transition:none}.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-unchecked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-checked-unchecked-checkmark-path 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__checkmark{animation:mdc-checkbox-checked-indeterminate-checkmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-checked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__checkmark{animation:mdc-checkbox-indeterminate-checked-checkmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-checked-mixedmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-unchecked-mixedmark 300ms linear;transition:none}.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{transition:border-color 90ms cubic-bezier(0, 0, 0.2, 1),background-color 90ms cubic-bezier(0, 0, 0.2, 1)}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path{stroke-dashoffset:0}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark{transition:opacity 180ms cubic-bezier(0, 0, 0.2, 1),transform 180ms cubic-bezier(0, 0, 0.2, 1);opacity:1}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(-45deg)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark{transform:rotate(45deg);opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(0deg);opacity:1}@keyframes mdc-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:29.7833385}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 1)}100%{stroke-dashoffset:0}}@keyframes mdc-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mdc-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);opacity:1;stroke-dashoffset:0}to{opacity:0;stroke-dashoffset:-29.7833385}}@keyframes mdc-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(45deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(45deg);opacity:0}to{transform:rotate(360deg);opacity:1}}@keyframes mdc-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(-45deg);opacity:0}to{transform:rotate(0deg);opacity:1}}@keyframes mdc-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(315deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;transform:scaleX(1);opacity:1}32.8%,100%{transform:scaleX(0);opacity:0}}.mat-mdc-checkbox{display:inline-block;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-touch-target,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__native-control,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__ripple,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-ripple::before,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__mixedmark{transition:none !important;animation:none !important}.mat-mdc-checkbox label{cursor:pointer}.mat-mdc-checkbox .mat-internal-form-field{color:var(--mat-checkbox-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-checkbox-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-checkbox-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-checkbox-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-checkbox-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-checkbox-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive{pointer-events:auto}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive input{cursor:default}.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{cursor:default;color:var(--mat-checkbox-disabled-label-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{color:GrayText}}.mat-mdc-checkbox label:empty{display:none}.mat-mdc-checkbox .mdc-checkbox__ripple{opacity:0}.mat-mdc-checkbox .mat-mdc-checkbox-ripple,.mdc-checkbox__ripple{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-checkbox .mat-mdc-checkbox-ripple:not(:empty),.mdc-checkbox__ripple:not(:empty){transform:translateZ(0)}.mat-mdc-checkbox-ripple .mat-ripple-element{opacity:.1}.mat-mdc-checkbox-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-checkbox-touch-target-size, 48px);width:var(--mat-checkbox-touch-target-size, 48px);transform:translate(-50%, -50%);display:var(--mat-checkbox-touch-target-display, block)}.mat-mdc-checkbox .mat-mdc-checkbox-ripple::before{border-radius:50%}.mdc-checkbox__native-control:focus~.mat-focus-indicator::before{content:""}
376
+ `],encapsulation:2,changeDetection:0})}return o})(),yg=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({imports:[Vd,ce,ce]})}return o})();var vx=["button"],yx=["*"];function Cx(o,t){if(o&1&&(s(0,"div",2),I(1,"mat-pseudo-checkbox",6),l()),o&2){let e=u();d(),w("disabled",e.disabled)}}var Cg=new oe("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:xx});function xx(){return{hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1}}var xg=new oe("MatButtonToggleGroup"),wx={provide:zo,useExisting:Xn(()=>zd),multi:!0},Al=class{source;value;constructor(t,e){this.source=t,this.value=e}},zd=(()=>{class o{_changeDetector=m(Qe);_dir=m(bt,{optional:!0});_multiple=!1;_disabled=!1;_disabledInteractive=!1;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(e){this._name=e,this._markButtonsForCheck()}_name=m(Ne).getId("mat-button-toggle-group-");vertical;get value(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e.map(i=>i.value):e[0]?e[0].value:void 0}set value(e){this._setSelectionByValue(e),this.valueChange.emit(this.value)}valueChange=new H;get selected(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e:e[0]||null}get multiple(){return this._multiple}set multiple(e){this._multiple=e,this._markButtonsForCheck()}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._markButtonsForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e,this._markButtonsForCheck()}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new H;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._markButtonsForCheck()}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(e){this._hideMultipleSelectionIndicator=e,this._markButtonsForCheck()}_hideMultipleSelectionIndicator;constructor(){let e=m(Cg,{optional:!0});this.appearance=e&&e.appearance?e.appearance:"standard",this.hideSingleSelectionIndicator=e?.hideSingleSelectionIndicator??!1,this.hideMultipleSelectionIndicator=e?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new Co(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(e=>e.checked)),this.multiple||this._initializeTabIndex()}writeValue(e){this.value=e,this._changeDetector.markForCheck()}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_keydown(e){if(this.multiple||this.disabled||_t(e))return;let n=e.target.id,r=this._buttonToggles.toArray().findIndex(c=>c.buttonId===n),a=null;switch(e.keyCode){case 32:case 13:a=this._buttonToggles.get(r)||null;break;case 38:a=this._getNextButton(r,-1);break;case 37:a=this._getNextButton(r,this.dir==="ltr"?-1:1);break;case 40:a=this._getNextButton(r,1);break;case 39:a=this._getNextButton(r,this.dir==="ltr"?1:-1);break;default:return}a&&(e.preventDefault(),a._onButtonClick(),a.focus())}_emitChangeEvent(e){let i=new Al(e,this.value);this._rawValue=i.value,this._controlValueAccessorChangeFn(i.value),this.change.emit(i)}_syncButtonToggle(e,i,n=!1,r=!1){!this.multiple&&this.selected&&!e.checked&&(this.selected.checked=!1),this._selectionModel?i?this._selectionModel.select(e):this._selectionModel.deselect(e):r=!0,r?Promise.resolve().then(()=>this._updateModelValue(e,n)):this._updateModelValue(e,n)}_isSelected(e){return this._selectionModel&&this._selectionModel.isSelected(e)}_isPrechecked(e){return typeof this._rawValue>"u"?!1:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(i=>e.value!=null&&i===e.value):e.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(e=>{e.tabIndex=-1}),this.selected)this.selected.tabIndex=0;else for(let e=0;e<this._buttonToggles.length;e++){let i=this._buttonToggles.get(e);if(!i.disabled){i.tabIndex=0;break}}}_getNextButton(e,i){let n=this._buttonToggles;for(let r=1;r<=n.length;r++){let a=(e+i*r+n.length)%n.length,c=n.get(a);if(c&&!c.disabled)return c}return null}_setSelectionByValue(e){if(this._rawValue=e,!this._buttonToggles)return;let i=this._buttonToggles.toArray();if(this.multiple&&e?(Array.isArray(e),this._clearSelection(),e.forEach(n=>this._selectValue(n,i))):(this._clearSelection(),this._selectValue(e,i)),!this.multiple&&i.every(n=>n.tabIndex===-1)){for(let n of i)if(!n.disabled){n.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(e=>{e.checked=!1,this.multiple||(e.tabIndex=-1)})}_selectValue(e,i){for(let n of i)if(n.value===e){n.checked=!0,this._selectionModel.select(n),this.multiple||(n.tabIndex=0);break}}_updateModelValue(e,i){i&&this._emitChangeEvent(e),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(e=>e._markForCheck())}static \u0275fac=function(i){return new(i||o)};static \u0275dir=xe({type:o,selectors:[["mat-button-toggle-group"]],contentQueries:function(i,n,r){if(i&1&&xt(r,Il,5),i&2){let a;U(a=W())&&(n._buttonToggles=a)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(i,n){i&1&&f("keydown",function(a){return n._keydown(a)}),i&2&&(J("role",n.multiple?"group":"radiogroup")("aria-disabled",n.disabled),E("mat-button-toggle-vertical",n.vertical)("mat-button-toggle-group-appearance-standard",n.appearance==="standard"))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",ee],value:"value",multiple:[2,"multiple","multiple",ee],disabled:[2,"disabled","disabled",ee],disabledInteractive:[2,"disabledInteractive","disabledInteractive",ee],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",ee],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",ee]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[Ye([wx,{provide:xg,useExisting:o}])]})}return o})(),Il=(()=>{class o{_changeDetectorRef=m(Qe);_elementRef=m(ne);_focusMonitor=m(Ni);_idGenerator=m(Ne);_animationDisabled=$e();_checked=!1;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return`${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex()}set tabIndex(e){this._tabIndex.set(e)}_tabIndex;disableRipple;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(e){this._appearance=e}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(e){e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(e){this._disabled=e}_disabled=!1;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e}_disabledInteractive;change=new H;constructor(){m(Nt).load(In);let e=m(xg,{optional:!0}),i=m(new Pn("tabindex"),{optional:!0})||"",n=m(Cg,{optional:!0});this._tabIndex=Oe(parseInt(i)||0),this.buttonToggleGroup=e,this.appearance=n&&n.appearance?n.appearance:"standard",this.disabledInteractive=n?.disabledInteractive??!1}ngOnInit(){let e=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),e&&(e._isPrechecked(this)?this.checked=!0:e._isSelected(this)!==this._checked&&e._syncButtonToggle(this,this._checked))}ngAfterViewInit(){this._animationDisabled||this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){let e=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),e&&e._isSelected(this)&&e._syncButtonToggle(this,!1,!1,!0)}focus(e){this._buttonElement.nativeElement.focus(e)}_onButtonClick(){if(this.disabled)return;let e=this.isSingleSelector()?!0:!this._checked;if(e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let i=this.buttonToggleGroup._buttonToggles.find(n=>n.tabIndex===0);i&&(i.tabIndex=-1),this.tabIndex=0}this.change.emit(new Al(this,this.value))}_markForCheck(){this._changeDetectorRef.markForCheck()}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=M({type:o,selectors:[["mat-button-toggle"]],viewQuery:function(i,n){if(i&1&&X(vx,5),i&2){let r;U(r=W())&&(n._buttonElement=r.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(i,n){i&1&&f("focus",function(){return n.focus()}),i&2&&(J("aria-label",null)("aria-labelledby",null)("id",n.id)("name",null),E("mat-button-toggle-standalone",!n.buttonToggleGroup)("mat-button-toggle-checked",n.checked)("mat-button-toggle-disabled",n.disabled)("mat-button-toggle-disabled-interactive",n.disabledInteractive)("mat-button-toggle-appearance-standard",n.appearance==="standard"))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",ee],appearance:"appearance",checked:[2,"checked","checked",ee],disabled:[2,"disabled","disabled",ee],disabledInteractive:[2,"disabledInteractive","disabledInteractive",ee]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:yx,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(i,n){if(i&1){let r=k();We(),s(0,"button",1,0),f("click",function(){return b(r),v(n._onButtonClick())}),C(2,Cx,2,1,"div",2),s(3,"span",3),ue(4),l()(),I(5,"span",4)(6,"span",5)}if(i&2){let r=Et(1);w("id",n.buttonId)("disabled",n.disabled&&!n.disabledInteractive||null),J("role",n.isSingleSelector()?"radio":"button")("tabindex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("aria-pressed",n.isSingleSelector()?null:n.checked)("aria-checked",n.isSingleSelector()?n.checked:null)("name",n._getButtonName())("aria-label",n.ariaLabel)("aria-labelledby",n.ariaLabelledby)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),d(2),x(n.buttonToggleGroup&&(!n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideSingleSelectionIndicator||n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),d(4),w("matRippleTrigger",r)("matRippleDisabled",n.disableRipple||n.disabled)}},dependencies:[An,Tl],styles:[`.mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);border-radius:var(--mat-button-toggle-legacy-shape);transform:translateZ(0)}.mat-button-toggle-standalone:not([class*=mat-elevation-z]),.mat-button-toggle-group:not([class*=mat-elevation-z]){box-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)}@media(forced-colors: active){.mat-button-toggle-standalone,.mat-button-toggle-group{outline:solid 1px}}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard .mat-pseudo-checkbox,.mat-button-toggle-group-appearance-standard .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard:not([class*=mat-elevation-z]),.mat-button-toggle-group-appearance-standard:not([class*=mat-elevation-z]){box-shadow:none}@media(forced-colors: active){.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{outline:0}}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative;color:var(--mat-button-toggle-legacy-text-color);font-family:var(--mat-button-toggle-legacy-label-text-font);font-size:var(--mat-button-toggle-legacy-label-text-size);line-height:var(--mat-button-toggle-legacy-label-text-line-height);font-weight:var(--mat-button-toggle-legacy-label-text-weight);letter-spacing:var(--mat-button-toggle-legacy-label-text-tracking);--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-button-toggle-legacy-selected-state-text-color)}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-legacy-focus-state-layer-opacity)}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle-checkbox-wrapper{display:inline-block;justify-content:flex-start;align-items:center;width:0;height:18px;line-height:18px;overflow:hidden;box-sizing:border-box;position:absolute;top:50%;left:16px;transform:translate3d(0, -50%, 0)}[dir=rtl] .mat-button-toggle-checkbox-wrapper{left:auto;right:16px}.mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:12px}[dir=rtl] .mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:auto;right:12px}.mat-button-toggle-checked .mat-button-toggle-checkbox-wrapper{width:18px}.mat-button-toggle-animations-enabled .mat-button-toggle-checkbox-wrapper{transition:width 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-checkbox-wrapper{transition:none}.mat-button-toggle-checked{color:var(--mat-button-toggle-legacy-selected-state-text-color);background-color:var(--mat-button-toggle-legacy-selected-state-background-color)}.mat-button-toggle-disabled{pointer-events:none;color:var(--mat-button-toggle-legacy-disabled-state-text-color);background-color:var(--mat-button-toggle-legacy-disabled-state-background-color);--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--mat-button-toggle-legacy-disabled-state-text-color)}.mat-button-toggle-disabled.mat-button-toggle-checked{background-color:var(--mat-button-toggle-legacy-disabled-selected-state-background-color)}.mat-button-toggle-disabled-interactive{pointer-events:auto}.mat-button-toggle-appearance-standard{color:var(--mat-button-toggle-text-color, var(--mat-sys-on-surface));background-color:var(--mat-button-toggle-background-color, transparent);font-family:var(--mat-button-toggle-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-toggle-label-text-size, var(--mat-sys-label-large-size));line-height:var(--mat-button-toggle-label-text-line-height, var(--mat-sys-label-large-line-height));font-weight:var(--mat-button-toggle-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-button-toggle-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}[dir=rtl] .mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:none;border-top:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-appearance-standard.mat-button-toggle-checked{color:var(--mat-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container));background-color:var(--mat-button-toggle-selected-state-background-color, var(--mat-sys-secondary-container))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled{color:var(--mat-button-toggle-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-toggle-disabled-state-background-color, transparent)}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--mat-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled.mat-button-toggle-checked{color:var(--mat-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-toggle-disabled-selected-state-background-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{background-color:var(--mat-button-toggle-state-layer-color, var(--mat-sys-on-surface))}.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-button-toggle-appearance-standard.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}@media(hover: none){.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;user-select:none;display:inline-block;padding:0 16px;line-height:var(--mat-button-toggle-legacy-height);position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px;line-height:var(--mat-button-toggle-height, 40px)}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;pointer-events:none;opacity:0;background-color:var(--mat-button-toggle-legacy-state-layer-color)}@media(forced-colors: active){.mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 500px;opacity:.5;height:0}.mat-button-toggle-checked:hover .mat-button-toggle-focus-overlay{opacity:.6}.mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-animations-enabled .mat-button-toggle-button{transition:padding 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-button{transition:none}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}.mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:30px}[dir=rtl] .mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:0;padding-right:30px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard{--mat-focus-indicator-border-radius: var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-bottom-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-top-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}
377
+ `],encapsulation:2,changeDetection:0})}return o})(),wg=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=le({type:o});static \u0275inj=se({imports:[ce,Qa,Il,ce]})}return o})();var kx=(o,t)=>t.id,Mx=(o,t)=>t.value;function Tx(o,t){if(o&1&&(s(0,"mat-option",5),p(1),l()),o&2){let e=t.$implicit;w("value",e.id),d(),ie(" ",e.name," ")}}function Ex(o,t){if(o&1){let e=k();s(0,"mat-checkbox",35),f("change",function(){let n=b(e).$implicit,r=u();return v(r.toggleDayOfWeek(n.value))}),p(1),l()}if(o&2){let e=t.$implicit,i=u();w("checked",i.isDaySelected(e.value)),d(),ie(" ",e.label," ")}}function Px(o,t){if(o&1){let e=k();s(0,"mat-form-field",2)(1,"mat-label"),p(2,"Number of Occurrences"),l(),s(3,"input",10),j("ngModelChange",function(n){b(e);let r=u();return z(r.endOccurrences,n)||(r.endOccurrences=n),v(n)}),l()()}if(o&2){let e=u();d(3),V("ngModel",e.endOccurrences)}}function Ox(o,t){if(o&1){let e=k();s(0,"mat-form-field",2)(1,"mat-label"),p(2,"End Date"),l(),s(3,"input",36),j("ngModelChange",function(n){b(e);let r=u();return z(r.endTimestamp,n)||(r.endTimestamp=n),v(n)}),l()()}if(o&2){let e=u();d(3),V("ngModel",e.endTimestamp)}}function Ax(o,t){if(o&1){let e=k();s(0,"div")(1,"mat-form-field",2)(2,"mat-label"),p(3,"Parameter Value"),l(),s(4,"input",37),j("ngModelChange",function(n){b(e);let r=u();return z(r.simpleParameter,n)||(r.simpleParameter=n),v(n)}),l(),s(5,"mat-hint"),p(6),l()()()}if(o&2){let e=u();d(4),V("ngModel",e.simpleParameter),d(2),ie("Simple value for ","{{PARAMETERS}}"," placeholder or appended to first command")}}function Ix(o,t){if(o&1){let e=k();s(0,"div",40)(1,"mat-form-field",41)(2,"mat-label"),p(3,"Key"),l(),s(4,"input",42),j("ngModelChange",function(n){let r=b(e).$implicit;return z(r.key,n)||(r.key=n),v(n)}),l()(),s(5,"mat-form-field",43)(6,"mat-label"),p(7,"Value"),l(),s(8,"input",44),j("ngModelChange",function(n){let r=b(e).$implicit;return z(r.value,n)||(r.value=n),v(n)}),l()(),s(9,"button",45),f("click",function(){let n=b(e).$index,r=u(3);return v(r.removeParameter(n))}),s(10,"mat-icon"),p(11,"delete"),l()()()}if(o&2){let e=t.$implicit;d(4),V("ngModel",e.key),d(4),V("ngModel",e.value)}}function Dx(o,t){if(o&1&&(s(0,"div",39),we(1,Ix,12,2,"div",40,Jn),l()),o&2){let e=u(2);d(),Se(e.parameters)}}function Rx(o,t){if(o&1){let e=k();s(0,"div")(1,"div",26)(2,"button",38),f("click",function(){b(e);let n=u();return v(n.addParameter())}),s(3,"mat-icon"),p(4,"add"),l()()(),C(5,Dx,3,0,"div",39),s(6,"p",19),p(7),l()()}if(o&2){let e=u();d(5),x(e.parameters.length>0?5:-1),d(2),ie("Key-value pairs for ","{{key}}"," placeholders in prompt commands")}}function Fx(o,t){if(o&1&&(s(0,"div",31)(1,"mat-icon"),p(2,"error"),l(),s(3,"span"),p(4),l()()),o&2){let e=u();d(4),O(e.errorMessage)}}var Ca=class o{schedulerApi=m(kr);promptApi=m(di);dialogRef=m(ei);availablePrompts=[];isLoadingPrompts=!1;name="";promptId="";enabled=!0;startTimestamp="";intervalValue=1;intervalUnit="h";daysOfWeek=[];endConditionType="none";endOccurrences=10;endTimestamp="";parameterMode="simple";simpleParameter="";parameters=[];isSaving=!1;errorMessage="";isEditMode=!1;schedulerId="";data=m(Hi);daysOfWeekOptions=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}];constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){if(this.loadPrompts(),this.isEditMode||(this.startTimestamp=this.formatDateForInput(new Date)),this.isEditMode&&this.data.scheduler){if(this.schedulerId=this.data.scheduler.id,this.name=this.data.scheduler.name,this.promptId=this.data.scheduler.promptId,this.enabled=this.data.scheduler.enabled,this.data.scheduler.schedule.startTimestamp){let e=new Date(this.data.scheduler.schedule.startTimestamp);this.startTimestamp=this.formatDateForInput(e)}let t=this.data.scheduler.schedule.interval.match(/^(\d+)(min|h|d|M)$/);t&&t[1]&&t[2]&&(this.intervalValue=parseInt(t[1],10),this.intervalUnit=t[2]),this.daysOfWeek=this.data.scheduler.schedule.daysOfWeek||[],this.data.scheduler.schedule.endCondition&&(this.endConditionType=this.data.scheduler.schedule.endCondition.type,this.endConditionType==="occurrences"?this.endOccurrences=this.data.scheduler.schedule.endCondition.value:this.endConditionType==="endTimestamp"&&(this.endTimestamp=this.data.scheduler.schedule.endCondition.value)),this.data.scheduler.parameters&&(typeof this.data.scheduler.parameters=="object"&&Object.keys(this.data.scheduler.parameters).length===1&&"PARAMETERS"in this.data.scheduler.parameters?(this.parameterMode="simple",this.simpleParameter=String(this.data.scheduler.parameters.PARAMETERS)):(this.parameterMode="structured",this.parameters=Object.entries(this.data.scheduler.parameters).map(([e,i])=>({key:e,value:String(i)}))))}}loadPrompts(){this.isLoadingPrompts=!0,this.promptApi.listPrompts().subscribe({next:t=>{this.availablePrompts=t,this.isLoadingPrompts=!1},error:t=>{console.error("Error loading prompts:",t),this.errorMessage="Failed to load prompts",this.isLoadingPrompts=!1}})}toggleDayOfWeek(t){let e=this.daysOfWeek.indexOf(t);e>-1?this.daysOfWeek.splice(e,1):this.daysOfWeek.push(t),this.daysOfWeek.sort()}isDaySelected(t){return this.daysOfWeek.includes(t)}addParameter(){this.parameters.push({key:"",value:""})}removeParameter(t){this.parameters.splice(t,1)}trackByIndex(t){return t}formatDateForInput(t){let e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),r=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0");return`${e}-${i}-${n}T${r}:${a}`}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",!1;if(!this.promptId)return this.errorMessage="Prompt is required",!1;if(this.intervalValue<1)return this.errorMessage="Interval must be at least 1",!1;switch(this.intervalUnit){case"min":if(this.intervalValue>59)return this.errorMessage="Minutes interval must be between 1 and 59 (use hours for longer)",!1;break;case"h":if(this.intervalValue>24)return this.errorMessage="Hours interval must be between 1 and 24 (use days for longer)",!1;break;case"d":if(this.intervalValue>31)return this.errorMessage="Days interval must be between 1 and 31 (use months for longer)",!1;break;case"M":if(this.intervalValue>12)return this.errorMessage="Months interval must be between 1 and 12",!1;break}return this.endConditionType==="occurrences"&&this.endOccurrences<1?(this.errorMessage="Occurrences must be at least 1",!1):this.endConditionType==="endTimestamp"&&!this.endTimestamp?(this.errorMessage="End date is required",!1):!0}buildSchedule(){let e={startTimestamp:(this.startTimestamp?new Date(this.startTimestamp):new Date).toISOString(),interval:`${this.intervalValue}${this.intervalUnit}`};return this.daysOfWeek.length>0&&(e.daysOfWeek=[...this.daysOfWeek]),this.endConditionType==="occurrences"?e.endCondition={type:"occurrences",value:this.endOccurrences}:this.endConditionType==="endTimestamp"&&(e.endCondition={type:"endTimestamp",value:this.endTimestamp}),e}buildParameters(){if(this.parameterMode==="simple")return this.simpleParameter.trim()?{PARAMETERS:this.simpleParameter.trim()}:void 0;let t=this.parameters.filter(i=>i.key.trim());if(t.length===0)return;let e={};return t.forEach(i=>{e[i.key]=i.value}),e}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildSchedule(),e=this.buildParameters();this.isSaving=!0,this.isEditMode&&this.schedulerId?this.schedulerApi.updateScheduler(this.schedulerId,{name:this.name.trim(),enabled:this.enabled,promptId:this.promptId,schedule:t,parameters:e}).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error updating scheduler:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to update scheduler",this.isSaving=!1}}):this.schedulerApi.createScheduler({name:this.name.trim(),promptId:this.promptId,schedule:t,parameters:e,enabled:this.enabled}).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error creating scheduler:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to create scheduler",this.isSaving=!1}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-scheduler-form"]],decls:89,vars:17,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","My Scheduler","required","",3,"ngModelChange","ngModel"],["required","",3,"ngModelChange","ngModel"],[3,"value"],["matInput","","type","datetime-local",3,"ngModelChange","ngModel"],[1,"interval-section"],[1,"interval-fields"],["appearance","outline",1,"interval-value"],["matInput","","type","number","min","1","required","",3,"ngModelChange","ngModel"],["appearance","outline",1,"interval-unit"],["value","min"],["value","h"],["value","d"],["value","M"],[1,"days-section"],[1,"days-checkboxes"],[3,"checked"],[1,"hint"],[1,"end-condition-section"],[3,"ngModelChange","ngModel"],["value","none"],["value","occurrences"],["value","endTimestamp"],[1,"parameters-section"],[1,"section-header"],[1,"mode-toggle",3,"ngModelChange","ngModel"],["value","simple"],["value","structured"],[1,"enabled-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"change","checked"],["matInput","","type","datetime-local","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g., 1234 or staging",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add parameter",3,"click"],[1,"parameters-list"],[1,"parameter-item"],["appearance","outline",1,"param-key"],["matInput","","placeholder","parameterName",3,"ngModelChange","ngModel"],["appearance","outline",1,"param-value"],["matInput","","placeholder","value",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove parameter",1,"remove-btn",3,"click"]],template:function(e,i){e&1&&(s(0,"h2",0),p(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),p(6,"Name"),l(),s(7,"input",3),j("ngModelChange",function(r){return z(i.name,r)||(i.name=r),r}),l(),s(8,"mat-hint"),p(9,"A descriptive name for this scheduler"),l()(),s(10,"mat-form-field",2)(11,"mat-label"),p(12,"Prompt"),l(),s(13,"mat-select",4),j("ngModelChange",function(r){return z(i.promptId,r)||(i.promptId=r),r}),we(14,Tx,2,2,"mat-option",5,kx),l(),s(16,"mat-hint"),p(17,"Select the prompt to execute"),l()(),s(18,"mat-form-field",2)(19,"mat-label"),p(20,"Start Date & Time"),l(),s(21,"input",6),j("ngModelChange",function(r){return z(i.startTimestamp,r)||(i.startTimestamp=r),r}),l(),s(22,"mat-hint"),p(23,"When to start the scheduler (leave empty for now)"),l()(),s(24,"div",7)(25,"h3"),p(26,"Schedule Interval"),l(),s(27,"div",8)(28,"mat-form-field",9)(29,"mat-label"),p(30,"Every"),l(),s(31,"input",10),j("ngModelChange",function(r){return z(i.intervalValue,r)||(i.intervalValue=r),r}),l()(),s(32,"mat-form-field",11)(33,"mat-label"),p(34,"Unit"),l(),s(35,"mat-select",4),j("ngModelChange",function(r){return z(i.intervalUnit,r)||(i.intervalUnit=r),r}),s(36,"mat-option",12),p(37,"Minutes (1-59)"),l(),s(38,"mat-option",13),p(39,"Hours (1-24)"),l(),s(40,"mat-option",14),p(41,"Days (1-31)"),l(),s(42,"mat-option",15),p(43,"Months (1-12)"),l()()()()(),s(44,"div",16)(45,"h3"),p(46,"Days of Week (Optional)"),l(),s(47,"div",17),we(48,Ex,2,2,"mat-checkbox",18,Mx),l(),s(50,"p",19),p(51,"Leave empty to run every day"),l()(),s(52,"div",20)(53,"h3"),p(54,"End Condition (Optional)"),l(),s(55,"mat-form-field",2)(56,"mat-label"),p(57,"End Type"),l(),s(58,"mat-select",21),j("ngModelChange",function(r){return z(i.endConditionType,r)||(i.endConditionType=r),r}),s(59,"mat-option",22),p(60,"Never (run indefinitely)"),l(),s(61,"mat-option",23),p(62,"After X occurrences"),l(),s(63,"mat-option",24),p(64,"Until specific date"),l()()(),C(65,Px,4,1,"mat-form-field",2),C(66,Ox,4,1,"mat-form-field",2),l(),s(67,"div",25)(68,"div",26)(69,"h3"),p(70,"Parameters (Optional)"),l(),s(71,"mat-button-toggle-group",27),j("ngModelChange",function(r){return z(i.parameterMode,r)||(i.parameterMode=r),r}),s(72,"mat-button-toggle",28),p(73,"Simple"),l(),s(74,"mat-button-toggle",29),p(75,"Structured"),l()()(),C(76,Ax,7,2,"div"),C(77,Rx,8,2,"div"),l(),s(78,"div",30)(79,"mat-checkbox",21),j("ngModelChange",function(r){return z(i.enabled,r)||(i.enabled=r),r}),p(80,"Enabled"),l(),s(81,"p",19),p(82,"Scheduler will only run if enabled"),l()(),C(83,Fx,5,1,"div",31),l()(),s(84,"mat-dialog-actions",32)(85,"button",33),f("click",function(){return i.cancel()}),p(86,"Cancel"),l(),s(87,"button",34),f("click",function(){return i.save()}),p(88),l()()),e&2&&(d(),O(i.isEditMode?"Edit Scheduler":"Create Scheduler"),d(6),V("ngModel",i.name),d(6),V("ngModel",i.promptId),d(),Se(i.availablePrompts),d(7),V("ngModel",i.startTimestamp),d(10),V("ngModel",i.intervalValue),d(4),V("ngModel",i.intervalUnit),d(13),Se(i.daysOfWeekOptions),d(10),V("ngModel",i.endConditionType),d(7),x(i.endConditionType==="occurrences"?65:-1),d(),x(i.endConditionType==="endTimestamp"?66:-1),d(5),V("ngModel",i.parameterMode),d(5),x(i.parameterMode==="simple"?76:-1),d(),x(i.parameterMode==="structured"?77:-1),d(2),V("ngModel",i.enabled),d(4),x(i.errorMessage?83:-1),d(2),w("disabled",i.isSaving),d(2),w("disabled",i.isSaving),d(),ie(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[Fe,Ue,je,ts,Be,Bo,rs,He,mo,un,fn,gn,ot,Ot,Ke,Kt,mi,Ut,Ht,xn,pt,Me,he,ya,Nd,yo,yg,Vd,wg,zd,Il],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:600px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.interval-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%]{display:flex;gap:1rem}.interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%] .interval-value[_ngcontent-%COMP%], .interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%] .interval-unit[_ngcontent-%COMP%]{flex:1}.days-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.days-section[_ngcontent-%COMP%] .days-checkboxes[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:.5rem}.days-section[_ngcontent-%COMP%] .days-checkboxes[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{min-width:120px}.days-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.end-condition-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] .mode-toggle[_ngcontent-%COMP%]{height:32px}.parameters-section[_ngcontent-%COMP%] .parameters-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .param-key[_ngcontent-%COMP%]{flex:1}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .param-value[_ngcontent-%COMP%]{flex:2}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.parameters-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.enabled-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.enabled-section[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem}.enabled-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"]})};function Nx(o,t){o&1&&(s(0,"div",12),p(1,"Loading schedulers..."),l())}function Lx(o,t){if(o&1&&(s(0,"div",13),p(1),l()),o&2){let e=u();d(),O(e.errorMessage)}}function Vx(o,t){o&1&&(s(0,"div",14),p(1," No schedulers found. Create your first scheduler to automate prompt execution. "),l())}function zx(o,t){o&1&&(s(0,"div",14),p(1," No schedulers match your search. "),l())}function jx(o,t){if(o&1&&(s(0,"span",31),p(1),l()),o&2){let e=u().$implicit;w("title",En("Created by ",e.createdBy)),d(),ie(" \u{1F464} ",e.createdBy," ")}}function Bx(o,t){if(o&1&&(s(0,"div",22)(1,"span",23),p(2,"Last Run:"),l(),s(3,"span",24),p(4),io(5,"date"),l()()),o&2){let e=u().$implicit;d(4),O(Rr(5,1,e.lastRun,"short"))}}function Hx(o,t){if(o&1){let e=k();s(0,"div",17)(1,"div",18)(2,"h3"),p(3),s(4,"span",19),p(5),l(),Re(6,jx,2,3,"span",20),l(),s(7,"div",21)(8,"div",22)(9,"span",23),p(10,"Prompt:"),l(),s(11,"span",24),p(12),l()(),s(13,"div",22)(14,"span",23),p(15,"Schedule:"),l(),s(16,"span",24),p(17),l()(),s(18,"div",22)(19,"span",23),p(20,"Next Run:"),l(),s(21,"span",24),p(22),l()(),Re(23,Bx,6,4,"div",25),l()(),s(24,"div",26)(25,"button",27),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.editScheduler(n))}),p(26,"Edit"),l(),s(27,"button",28),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.toggleEnabled(n))}),p(28),l(),s(29,"button",29),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.runNow(n.id))}),p(30,"Run Now"),l(),s(31,"button",30),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.deleteScheduler(n.id))}),p(32,"Delete"),l()()()}if(o&2){let e=t.$implicit,i=u(2);d(3),ie(" ",e.name," "),d(),E("enabled",e.enabled),d(),ie(" ",e.enabled?"Enabled":"Disabled"," "),d(),w("ngIf",e.createdBy!==i.getCurrentUsername()),d(6),O(i.getPromptName(e.promptId)),d(5),O(i.formatInterval(e.schedule.interval)),d(5),O(i.formatNextRun(e.nextRun)),d(),w("ngIf",e.lastRun),d(4),E("btn-enabled",e.enabled)("btn-disabled",!e.enabled),d(),ie(" ",e.enabled?"Disable":"Enable"," ")}}function Ux(o,t){if(o&1&&(s(0,"div",15),Re(1,Hx,33,14,"div",16),l()),o&2){let e=u();d(),w("ngForOf",e.filteredSchedulers)}}var Dl=class o{schedulerApi=m(kr);promptApi=m(di);configApi=m(Ki);dialog=m(Ci);schedulers=[];filteredSchedulers=[];prompts=[];searchQuery="";showOnlyMine=!0;isLoading=!1;errorMessage="";currentUsername="";ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.currentUsername=t.username??"",console.log("[SCHEDULER_MANAGER] Current username:",this.currentUsername)},error:t=>{console.error("[SCHEDULER_MANAGER] Error loading user config:",t)}}),this.loadPrompts(),this.loadSchedulers()}loadPrompts(){this.promptApi.listPrompts().subscribe({next:t=>{this.prompts=t},error:t=>{console.error("Error loading prompts:",t)}})}loadSchedulers(){this.isLoading=!0,this.schedulerApi.listSchedulers().subscribe({next:t=>{this.schedulers=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading schedulers:",t),this.errorMessage="Failed to load schedulers",this.isLoading=!1}})}deleteScheduler(t){confirm("Are you sure you want to delete this scheduler?")&&this.schedulerApi.deleteScheduler(t).subscribe({next:()=>{this.loadSchedulers()},error:e=>{console.error("Error deleting scheduler:",e);let i=e?.error?.error??e?.message??"Failed to delete scheduler";alert(`Failed to delete scheduler: ${i}`)}})}toggleEnabled(t){(t.enabled?this.schedulerApi.disableScheduler(t.id):this.schedulerApi.enableScheduler(t.id)).subscribe({next:()=>{this.loadSchedulers()},error:i=>{console.error("Error toggling scheduler:",i);let n=i?.error?.error??i?.message??"Failed to toggle scheduler";alert(`Failed to toggle scheduler: ${n}`)}})}runNow(t){this.schedulerApi.runSchedulerNow(t).subscribe({next:e=>{alert(`Scheduler executed successfully! Thread ID: ${e.threadId}`),this.loadSchedulers()},error:e=>{console.error("Error running scheduler:",e);let i=e?.error?.error??e?.message??"Failed to run scheduler";alert(`Failed to run scheduler: ${i}`)}})}formatNextRun(t){return t?new Date(t).toLocaleString():"Expired or completed"}getCurrentUsername(){return this.currentUsername}getPromptName(t){let e=this.prompts.find(i=>i.id===t);return e?e.name:t}formatInterval(t){let e=RegExp(/^(\d+)(min|h|d|M)$/).exec(t);if(!e)return t;let[,i,n]=e;if(!i||!n)return t;let a={min:"minute",h:"hour",d:"day",M:"month"}[n]??n;return`Every ${i} ${a}${parseInt(i,10)>1?"s":""}`}normalizeUsername(t){return t.replace(/[.\s]+/g,"_")}isMyScheduler(t){if(!this.currentUsername)return!1;let e=this.normalizeUsername(this.currentUsername.toLowerCase());return this.normalizeUsername(t.createdBy.toLowerCase())===e}applyFilter(){let t=this.searchQuery.toLowerCase().trim(),e=this.showOnlyMine&&this.currentUsername?this.schedulers.filter(i=>this.isMyScheduler(i)):[...this.schedulers];t&&(e=e.filter(i=>i.name.toLowerCase().includes(t)||i.promptId.toLowerCase().includes(t)||this.getPromptName(i.promptId).toLowerCase().includes(t)?!0:i.createdBy.toLowerCase().includes(t))),this.filteredSchedulers=e}onSearchChange(){this.applyFilter()}createScheduler(){this.dialog.open(Ca,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadSchedulers()})}editScheduler(t){this.schedulerApi.getScheduler(t.id).subscribe({next:e=>{this.dialog.open(Ca,{width:"700px",maxHeight:"90vh",data:{mode:"edit",scheduler:e}}).afterClosed().subscribe(n=>{n&&this.loadSchedulers()})},error:e=>{console.error("Error loading scheduler details:",e);let i=e?.error?.error??e?.message??"Failed to load scheduler details";alert(`Failed to load scheduler details: ${i}`)}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-scheduler-manager"]],decls:23,vars:7,consts:[[1,"scheduler-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name, prompt, author...",3,"ngModelChange","input","ngModel"],["matPrefix",""],["color","primary",1,"mine-toggle",3,"ngModelChange","change","ngModel"],[1,"btn-create",3,"click"],["class","loading",4,"ngIf"],["class","error",4,"ngIf"],["class","empty",4,"ngIf"],["class","scheduler-list",4,"ngIf"],[1,"loading"],[1,"error"],[1,"empty"],[1,"scheduler-list"],["class","scheduler-item",4,"ngFor","ngForOf"],[1,"scheduler-item"],[1,"scheduler-info"],[1,"status-badge"],["class","owner-badge",3,"title",4,"ngIf"],[1,"details"],[1,"detail-row"],[1,"label"],[1,"value"],["class","detail-row",4,"ngIf"],[1,"scheduler-actions"],[1,"btn-primary",3,"click"],[3,"click"],[1,"btn-accent",3,"click"],[1,"btn-danger",3,"click"],[1,"owner-badge",3,"title"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),p(3,"Schedulers"),l(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),p(7,"Search"),l(),s(8,"input",4),j("ngModelChange",function(r){return z(i.searchQuery,r)||(i.searchQuery=r),r}),f("input",function(){return i.onSearchChange()}),l(),s(9,"mat-icon",5),p(10,"search"),l()(),s(11,"mat-slide-toggle",6),j("ngModelChange",function(r){return z(i.showOnlyMine,r)||(i.showOnlyMine=r),r}),f("change",function(){return i.applyFilter()}),p(12," Mine "),l(),s(13,"button",7),f("click",function(){return i.createScheduler()}),s(14,"mat-icon"),p(15,"add"),l(),s(16,"span"),p(17,"Create Scheduler"),l()()()(),Re(18,Nx,2,0,"div",8)(19,Lx,2,1,"div",9)(20,Vx,2,0,"div",10)(21,zx,2,0,"div",10)(22,Ux,2,1,"div",11),l()),e&2&&(d(8),V("ngModel",i.searchQuery),d(3),V("ngModel",i.showOnlyMine),d(7),w("ngIf",i.isLoading),d(),w("ngIf",i.errorMessage),d(),w("ngIf",!i.isLoading&&i.schedulers.length===0),d(),w("ngIf",!i.isLoading&&i.schedulers.length>0&&i.filteredSchedulers.length===0),d(),w("ngIf",!i.isLoading&&i.filteredSchedulers.length>0))},dependencies:[Fe,za,ja,Ue,je,Be,He,Me,he,Kt,mi,Ut,Ht,vo,pt,Cl,bo,Nr],styles:[".scheduler-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .mine-toggle[_ngcontent-%COMP%]{margin-bottom:-1.25em}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.scheduler-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.scheduler-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.scheduler-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.scheduler-info[_ngcontent-%COMP%]{flex:1}.scheduler-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem;display:flex;align-items:center;gap:.5rem}.scheduler-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] .owner-badge[_ngcontent-%COMP%]{font-size:.75rem;padding:.25rem .5rem;background:#2196f3;color:#fff;border-radius:4px;font-weight:400}.scheduler-info[_ngcontent-%COMP%] .status-badge[_ngcontent-%COMP%]{padding:.25rem .5rem;font-size:.75rem;border-radius:4px;background:var(--color-text-secondary);color:#fff}.scheduler-info[_ngcontent-%COMP%] .status-badge.enabled[_ngcontent-%COMP%]{background:var(--color-success)}.scheduler-info[_ngcontent-%COMP%] .details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;font-size:.9rem}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-weight:600;min-width:100px;color:var(--color-text-secondary)}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{color:var(--color-text)}.scheduler-actions[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduler-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;white-space:nowrap}.scheduler-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]{background:var(--color-secondary);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-enabled[_ngcontent-%COMP%]{background:#4caf50;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-enabled[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-disabled[_ngcontent-%COMP%]{background:#9e9e9e;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-disabled[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-accent[_ngcontent-%COMP%]{background:#ff9800;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-accent[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var Er=class o{http=m(Xe);projectState=m(ke);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/agents`}listEditableAgents(){return this.http.get(`${this.getBaseUrl()}/editable`)}getAgent(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createAgent(t,e){return this.http.post(this.getBaseUrl(),{location:e,definition:t})}updateAgent(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{definition:e})}listDocuments(t){return this.http.get(`${this.getBaseUrl()}/documents`,{params:{location:t}})}uploadDocument(t,e){return new Ii(i=>{let n=new FileReader;n.onload=()=>{let r=n.result.split(",")[1];this.http.post(`${this.getBaseUrl()}/documents`,{filename:e.name,content:r,mimeType:e.type},{params:{location:t}}).subscribe(i)},n.onerror=()=>i.error(n.error),n.readAsDataURL(e)})}deleteAgent(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};function Wx(o,t){o&1&&(s(0,"p",15),p(1,"No integrations defined \u2014 agent will have access to all tools."),l())}function $x(o,t){if(o&1){let e=k();s(0,"div",16)(1,"mat-form-field",22)(2,"mat-label"),p(3,"Integration"),l(),s(4,"input",23),j("ngModelChange",function(n){let r=b(e).$implicit;return z(r.integration,n)||(r.integration=n),v(n)}),l()(),s(5,"mat-form-field",24)(6,"mat-label"),p(7,"Tools (comma-separated)"),l(),s(8,"input",25),j("ngModelChange",function(n){let r=b(e).$implicit;return z(r.tools,n)||(r.tools=n),v(n)}),l()(),s(9,"button",26),f("click",function(){let n=b(e).$index,r=u();return v(r.removeIntegrationRow(n))}),s(10,"mat-icon"),p(11,"delete"),l()()()}if(o&2){let e=t.$implicit;d(4),V("ngModel",e.integration),d(4),V("ngModel",e.tools)}}function qx(o,t){if(o&1&&(s(0,"p",30),p(1),l()),o&2){let e=u(2);d(),O(e.docUploadError)}}function Gx(o,t){o&1&&(s(0,"p",15),p(1,"No mandatory documents defined."),l())}function Yx(o,t){if(o&1&&I(0,"option",35),o&2){let e=t.$implicit;w("value","documents/"+e)}}function Qx(o,t){if(o&1){let e=k();s(0,"div",31)(1,"mat-form-field",32)(2,"mat-label"),p(3,"Document path"),l(),s(4,"input",33),j("ngModelChange",function(n){let r=b(e).$index,a=u(2);return z(a.mandatoryDocs[r],n)||(a.mandatoryDocs[r]=n),v(n)}),l(),s(5,"datalist",34),we(6,Yx,1,1,"option",35,vm),l()(),s(8,"button",26),f("click",function(){let n=b(e).$index,r=u(2);return v(r.removeDocRow(n))}),s(9,"mat-icon"),p(10,"delete"),l()()()}if(o&2){let e=t.$index,i=u(2);d(4),V("ngModel",i.mandatoryDocs[e]),J("list","docs-list-"+e),d(),w("id","docs-list-"+e),d(),Se(i.availableDocuments)}}function Xx(o,t){if(o&1){let e=k();s(0,"div",6)(1,"span"),p(2,"Mandatory Documents"),l(),s(3,"button",27),f("click",function(){b(e);let n=u();return v(n.addDocRow())}),s(4,"mat-icon"),p(5,"add"),l()(),s(6,"label",28)(7,"mat-icon"),p(8,"upload_file"),l(),s(9,"input",29),f("change",function(n){b(e);let r=u();return v(r.onDocFileSelected(n))}),l()()(),C(10,qx,2,1,"p",30),C(11,Gx,2,0,"p",15),we(12,Qx,11,3,"div",31,Jn)}if(o&2){let e=u();d(6),E("uploading",e.isUploadingDoc),d(3),w("disabled",e.isUploadingDoc),d(),x(e.docUploadError?10:-1),d(),x(e.mandatoryDocs.length===0?11:-1),d(),Se(e.mandatoryDocs)}}function Kx(o,t){o&1&&(s(0,"p",15),p(1,"\u{1F4A1} Documents can be added after the agent is created."),l())}function Zx(o,t){if(o&1){let e=k();s(0,"div",6),p(1,"Save to"),l(),s(2,"div",36)(3,"label",37)(4,"input",38),j("ngModelChange",function(n){b(e);let r=u();return z(r.location,n)||(r.location=n),v(n)}),l(),s(5,"div",39)(6,"div",40)(7,"span",41),p(8,"\u{1F464}"),l(),s(9,"span",42),p(10,"Project config"),l()(),s(11,"p",43),p(12),l()()(),s(13,"label",37)(14,"input",44),j("ngModelChange",function(n){b(e);let r=u();return z(r.location,n)||(r.location=n),v(n)}),l(),s(15,"div",39)(16,"div",40)(17,"span",41),p(18,"\u{1F4E6}"),l(),s(19,"span",42),p(20,"Colocated"),l()(),s(21,"p",43),p(22,"Next to coday.yaml in ./agents/ (committable)"),l()()()(),s(23,"p",15),p(24,"Storage location is permanent and cannot be changed after creation."),l()}if(o&2){let e=u();d(3),E("selected",e.location==="project"),d(),V("ngModel",e.location),d(8),Tn("~/.coday/projects/","{","name","}","/agents/ (not committed)"),d(),E("selected",e.location==="colocated"),d(),V("ngModel",e.location)}}function Jx(o,t){if(o&1&&(s(0,"div",17)(1,"span",6),p(2,"Storage Location"),l(),s(3,"span",45),p(4),l(),s(5,"p",15),p(6,"Cannot be changed after creation."),l()()),o&2){let e=u();d(3),E("badge-project",e.location==="project")("badge-colocated",e.location==="colocated"),d(),ie(" ",e.location==="project"?"\u{1F464} Project config":"\u{1F4E6} Colocated"," ")}}function ew(o,t){if(o&1&&(s(0,"div",18)(1,"mat-icon"),p(2,"error"),l(),s(3,"span"),p(4),l()()),o&2){let e=u();d(4),O(e.errorMessage)}}var xa=class o{agentCrudApi=m(Er);agentApi=m(rr);dialogRef=m(ei);data=m(Hi);name="";description="";instructions="";aiProvider="";modelName="";temperature=null;maxOutputTokens=null;openaiAssistantId="";integrationRows=[];mandatoryDocs=[];availableDocuments=[];isUploadingDoc=!1;docUploadError="";location="project";isSaving=!1;errorMessage="";isEditMode=!1;ngOnInit(){if(this.isEditMode=this.data.mode==="edit",this.isEditMode&&this.data.agent){let t=this.data.agent.definition;this.name=t.name,this.description=t.description,this.instructions=t.instructions??"",this.aiProvider=t.aiProvider??"",this.modelName=t.modelName??"",this.temperature=t.temperature??null,this.maxOutputTokens=t.maxOutputTokens??null,this.openaiAssistantId=t.openaiAssistantId??"",this.location=this.data.agent.source,t.integrations&&(this.integrationRows=Object.entries(t.integrations).map(([e,i])=>({integration:e,tools:i?.join(", ")??""}))),this.mandatoryDocs=[...t.mandatoryDocs??[]],this.loadAvailableDocuments()}}loadAvailableDocuments(){this.agentCrudApi.listDocuments(this.location).subscribe({next:t=>this.availableDocuments=t,error:()=>this.availableDocuments=[]})}addDocRow(){this.mandatoryDocs.push("")}removeDocRow(t){this.mandatoryDocs.splice(t,1)}onDocFileSelected(t){let e=t.target,i=e.files?.[0];i&&(this.isUploadingDoc=!0,this.docUploadError="",this.agentCrudApi.uploadDocument(this.location,i).subscribe({next:n=>{this.isUploadingDoc=!1,this.mandatoryDocs.push(n.relativePath),this.loadAvailableDocuments(),e.value=""},error:n=>{this.isUploadingDoc=!1,this.docUploadError=n?.error?.error??n?.message??"Upload failed",e.value=""}}))}addIntegrationRow(){this.integrationRows.push({integration:"",tools:""})}removeIntegrationRow(t){this.integrationRows.splice(t,1)}trackByIndex(t){return t}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",!1;if(!/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(this.name.trim()))return this.errorMessage="Name must start with alphanumeric and contain only letters, digits, hyphens or underscores",!1;if(!this.description.trim())return this.errorMessage="Description is required",!1;for(let t of this.integrationRows)if(!t.integration.trim())return this.errorMessage="Integration name cannot be empty",!1;return!0}buildDefinition(){let t=this.mandatoryDocs.map(i=>i.trim()).filter(Boolean),e=this.integrationRows.length>0?Object.fromEntries(this.integrationRows.filter(i=>i.integration.trim()).map(i=>[i.integration.trim(),i.tools.split(",").map(n=>n.trim()).filter(Boolean)])):void 0;return{name:this.name.trim(),description:this.description.trim(),instructions:this.instructions.trim()||void 0,aiProvider:this.aiProvider.trim()||void 0,modelName:this.modelName.trim()||void 0,temperature:this.temperature??void 0,maxOutputTokens:this.maxOutputTokens??void 0,openaiAssistantId:this.openaiAssistantId.trim()||void 0,integrations:e,mandatoryDocs:t.length>0?t:void 0}}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildDefinition();this.isSaving=!0,(this.isEditMode?this.agentCrudApi.updateAgent(this.name.trim(),t):this.agentCrudApi.createAgent(t,this.location)).subscribe({next:()=>{this.isSaving=!1,this.agentApi.clearAllCache(),this.dialogRef.close(!0)},error:i=>{this.isSaving=!1,this.errorMessage=i?.error?.error||i?.message||"Failed to save agent"}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-agent-form"]],decls:69,vars:18,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-agent","required","",3,"ngModelChange","ngModel","readonly"],["matInput","","placeholder","What does this agent do?","rows","2","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","System instructions for the agent...","rows","6",3,"ngModelChange","ngModel"],[1,"section-title"],[1,"row-2col"],["appearance","outline"],["matInput","","placeholder","e.g. anthropic, openai",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g. claude-sonnet-4-5",3,"ngModelChange","ngModel"],["matInput","","type","number","min","0","max","2","step","0.1","placeholder","0.0 \u2013 2.0",3,"ngModelChange","ngModel"],["matInput","","type","number","min","1","placeholder","e.g. 4096",3,"ngModelChange","ngModel"],["matInput","","placeholder","asst_...",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add integration",3,"click"],[1,"hint"],[1,"integration-row"],[1,"source-display"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"integration-name"],["matInput","","placeholder","e.g. GITHUB",3,"ngModelChange","ngModel"],["appearance","outline",1,"integration-tools"],["matInput","","placeholder","Leave empty for all tools",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove",3,"click"],["mat-icon-button","","type","button","title","Add document path",3,"click"],["title","Upload a document to the pool",1,"upload-btn"],["type","file","hidden","",3,"change","disabled"],[1,"doc-upload-error"],[1,"doc-row"],["appearance","outline",1,"doc-field"],["matInput","","placeholder","documents/guide.md",3,"ngModelChange","ngModel"],[3,"id"],[3,"value"],[1,"source-options"],[1,"source-option"],["type","radio","name","location","value","project",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","location","value","colocated",3,"ngModelChange","ngModel"],[1,"source-badge"]],template:function(e,i){e&1&&(s(0,"h2",0),p(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),p(6,"Name"),l(),s(7,"input",3),j("ngModelChange",function(r){return z(i.name,r)||(i.name=r),r}),l(),s(8,"mat-hint"),p(9,"Alphanumeric, hyphens and underscores only. Cannot be changed after creation."),l()(),s(10,"mat-form-field",2)(11,"mat-label"),p(12,"Description"),l(),s(13,"textarea",4),j("ngModelChange",function(r){return z(i.description,r)||(i.description=r),r}),l()(),s(14,"mat-form-field",2)(15,"mat-label"),p(16,"Instructions"),l(),s(17,"textarea",5),j("ngModelChange",function(r){return z(i.instructions,r)||(i.instructions=r),r}),l(),s(18,"mat-hint"),p(19,"System prompt / instructions sent to the AI model"),l()(),s(20,"div",6),p(21,"AI Configuration"),l(),s(22,"div",7)(23,"mat-form-field",8)(24,"mat-label"),p(25,"AI Provider"),l(),s(26,"input",9),j("ngModelChange",function(r){return z(i.aiProvider,r)||(i.aiProvider=r),r}),l()(),s(27,"mat-form-field",8)(28,"mat-label"),p(29,"Model Name"),l(),s(30,"input",10),j("ngModelChange",function(r){return z(i.modelName,r)||(i.modelName=r),r}),l()()(),s(31,"div",7)(32,"mat-form-field",8)(33,"mat-label"),p(34,"Temperature"),l(),s(35,"input",11),j("ngModelChange",function(r){return z(i.temperature,r)||(i.temperature=r),r}),l(),s(36,"mat-hint"),p(37,"Leave empty for model default"),l()(),s(38,"mat-form-field",8)(39,"mat-label"),p(40,"Max Output Tokens"),l(),s(41,"input",12),j("ngModelChange",function(r){return z(i.maxOutputTokens,r)||(i.maxOutputTokens=r),r}),l(),s(42,"mat-hint"),p(43,"Leave empty for model default"),l()()(),s(44,"mat-form-field",2)(45,"mat-label"),p(46,"OpenAI Assistant ID"),l(),s(47,"input",13),j("ngModelChange",function(r){return z(i.openaiAssistantId,r)||(i.openaiAssistantId=r),r}),l(),s(48,"mat-hint"),p(49,"If set, forces aiProvider to openai"),l()(),s(50,"div",6)(51,"span"),p(52,"Integrations"),l(),s(53,"button",14),f("click",function(){return i.addIntegrationRow()}),s(54,"mat-icon"),p(55,"add"),l()()(),C(56,Wx,2,0,"p",15),we(57,$x,12,2,"div",16,Jn),C(59,Xx,14,5)(60,Kx,2,0,"p",15),C(61,Zx,25,8),C(62,Jx,7,5,"div",17),C(63,ew,5,1,"div",18),l()(),s(64,"mat-dialog-actions",19)(65,"button",20),f("click",function(){return i.cancel()}),p(66,"Cancel"),l(),s(67,"button",21),f("click",function(){return i.save()}),p(68),l()()),e&2&&(d(),O(i.isEditMode?"Edit Agent":"Create Agent"),d(6),V("ngModel",i.name),w("readonly",i.isEditMode),d(6),V("ngModel",i.description),d(4),V("ngModel",i.instructions),d(9),V("ngModel",i.aiProvider),d(4),V("ngModel",i.modelName),d(5),V("ngModel",i.temperature),d(6),V("ngModel",i.maxOutputTokens),d(6),V("ngModel",i.openaiAssistantId),d(9),x(i.integrationRows.length===0?56:-1),d(),Se(i.integrationRows),d(2),x(i.isEditMode?59:60),d(2),x(i.isEditMode?-1:61),d(),x(i.isEditMode?62:-1),d(),x(i.errorMessage?63:-1),d(2),w("disabled",i.isSaving),d(2),w("disabled",i.isSaving),d(),ie(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[Ue,ns,os,je,ts,jo,Be,Bo,rs,Ym,He,mo,un,fn,gn,ot,Ot,Ke,Kt,mi,Ut,Ht,xn,pt,Me,he,ya,Ko],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:560px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.section-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:1rem;font-weight:600;margin-top:.5rem;margin-bottom:-.25rem}.row-2col[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}@media (max-width: 768px){.row-2col[_ngcontent-%COMP%]{grid-template-columns:1fr}}.integration-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.integration-row[_ngcontent-%COMP%] .integration-name[_ngcontent-%COMP%]{flex:0 0 180px}.integration-row[_ngcontent-%COMP%] .integration-tools[_ngcontent-%COMP%]{flex:1}.hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.5rem}@media (max-width: 768px){.source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-family:monospace;line-height:1.4}.source-display[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500}.source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.doc-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.doc-row[_ngcontent-%COMP%] .doc-field[_ngcontent-%COMP%]{flex:1}.upload-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;cursor:pointer;color:var(--color-text-secondary);transition:background .2s}.upload-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);color:var(--color-primary)}.upload-btn.uploading[_ngcontent-%COMP%]{opacity:.5;cursor:wait}.upload-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.doc-upload-error[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"]})};var tw=(o,t)=>t.name;function iw(o,t){o&1&&(s(0,"div",7),p(1,"Loading agents..."),l())}function nw(o,t){if(o&1&&(s(0,"div",8),p(1),l()),o&2){let e=u();d(),O(e.errorMessage)}}function ow(o,t){o&1&&(s(0,"div",9),p(1,"No file-based agents found. Create your first agent to get started."),l())}function rw(o,t){o&1&&(s(0,"div",9),p(1,"No agents match your search."),l())}function aw(o,t){if(o&1){let e=k();s(0,"div",11)(1,"div",12)(2,"div",13)(3,"h3"),p(4),l(),s(5,"span",14),p(6),l()(),s(7,"p",15),p(8),l()(),s(9,"div",16)(10,"button",17),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.editAgent(n))}),p(11,"Edit"),l(),s(12,"button",18),f("click",function(){let n=b(e).$implicit,r=u(2);return v(r.deleteAgent(n))}),p(13,"Delete"),l()()()}if(o&2){let e=t.$implicit;d(4),O(e.name),d(),E("badge-project",e.source==="project")("badge-colocated",e.source==="colocated"),w("title",e.source==="project"?"Project config (~/.coday/)":"Colocated (next to coday.yaml)"),d(),ie(" ",e.source==="project"?"\u{1F464}":"\u{1F4E6}"," "),d(2),O(e.description)}}function sw(o,t){if(o&1&&(s(0,"div",10),we(1,aw,14,8,"div",11,tw),l()),o&2){let e=u();d(),Se(e.filteredAgents)}}var Rl=class o{agentCrudApi=m(Er);dialog=m(Ci);agents=[];filteredAgents=[];searchQuery="";isLoading=!1;errorMessage="";ngOnInit(){this.loadAgents()}loadAgents(){this.isLoading=!0,this.errorMessage="",this.agentCrudApi.listEditableAgents().subscribe({next:t=>{this.agents=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading agents:",t),this.errorMessage="Failed to load agents",this.isLoading=!1}})}applyFilter(){let t=this.searchQuery.toLowerCase().trim();this.filteredAgents=t?this.agents.filter(e=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)):[...this.agents]}onSearchChange(){this.applyFilter()}createAgent(){this.dialog.open(xa,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadAgents()})}editAgent(t){this.errorMessage="",this.agentCrudApi.getAgent(t.name).subscribe({next:e=>{this.dialog.open(xa,{width:"700px",maxHeight:"90vh",data:{mode:"edit",agent:e}}).afterClosed().subscribe(n=>{n&&this.loadAgents()})},error:e=>{console.error("Error loading agent:",e),this.errorMessage=e?.error?.error??e?.message??"Failed to load agent"}})}deleteAgent(t){confirm(`Are you sure you want to delete agent "${t.name}"?`)&&(this.errorMessage="",this.agentCrudApi.deleteAgent(t.name).subscribe({next:()=>this.loadAgents(),error:e=>{console.error("Error deleting agent:",e),this.errorMessage=e?.error?.error??e?.message??"Failed to delete agent"}}))}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-agent-manager"]],decls:21,vars:6,consts:[[1,"agent-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name or description...",3,"ngModelChange","input","ngModel"],["matPrefix",""],[1,"btn-create",3,"click"],[1,"loading"],[1,"error"],[1,"empty"],[1,"agent-list"],[1,"agent-item"],[1,"agent-info"],[1,"agent-header"],[1,"source-badge",3,"title"],[1,"description"],[1,"agent-actions"],[1,"btn-primary",3,"click"],[1,"btn-danger",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),p(3,"Agents"),l(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),p(7,"Search"),l(),s(8,"input",4),j("ngModelChange",function(r){return z(i.searchQuery,r)||(i.searchQuery=r),r}),f("input",function(){return i.onSearchChange()}),l(),s(9,"mat-icon",5),p(10,"search"),l()(),s(11,"button",6),f("click",function(){return i.createAgent()}),s(12,"mat-icon"),p(13,"add"),l(),s(14,"span"),p(15,"Create Agent"),l()()()(),C(16,iw,2,0,"div",7),C(17,nw,2,1,"div",8),C(18,ow,2,0,"div",9),C(19,rw,2,0,"div",9),C(20,sw,3,0,"div",10),l()),e&2&&(d(8),V("ngModel",i.searchQuery),d(8),x(i.isLoading?16:-1),d(),x(i.errorMessage?17:-1),d(),x(!i.isLoading&&i.agents.length===0?18:-1),d(),x(!i.isLoading&&i.agents.length>0&&i.filteredAgents.length===0?19:-1),d(),x(!i.isLoading&&i.filteredAgents.length>0?20:-1))},dependencies:[Ue,je,Be,He,Me,he,Kt,mi,Ut,Ht,vo,pt],styles:[".agent-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.agent-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.agent-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.agent-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.agent-info[_ngcontent-%COMP%]{flex:1}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;margin-bottom:.5rem}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;font-size:1rem;cursor:help}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;border:1px solid rgba(33,150,243,.3)}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;border:1px solid rgba(76,175,80,.3)}.agent-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{margin:0;color:var(--color-text-secondary)}.agent-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.agent-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem}.agent-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.agent-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.agent-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.agent-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var lw=["threadSearchInput"],cw=["*"];function dw(o,t){if(o&1){let e=k();s(0,"button",26),f("click",function(){b(e);let n=u();return v(n.toggle())}),s(1,"mat-icon"),p(2,"menu"),l()(),s(3,"button",27),f("click",function(){b(e);let n=u();return v(n.createNewThread())}),s(4,"mat-icon",10),p(5,"play_circle"),l()()}if(o&2){let e=u();d(3),w("disabled",!e.selectedProjectName())}}function mw(o,t){if(o&1){let e=k();s(0,"div",14)(1,"mat-icon",28),p(2,"search"),l(),s(3,"input",29,0),j("ngModelChange",function(n){b(e);let r=u();return z(r.threadSearchQuery,n)||(r.threadSearchQuery=n),v(n)}),f("input",function(){b(e);let n=u();return v(n.onThreadSearchInput())}),l(),s(5,"button",30),f("click",function(){b(e);let n=u();return v(n.closeThreadSearch())}),s(6,"mat-icon"),p(7,"close"),l()()()}if(o&2){let e=u();d(3),V("ngModel",e.threadSearchQuery)}}function pw(o,t){if(o&1){let e=k();s(0,"div",15)(1,"mat-icon",22),p(2,"forum"),l(),s(3,"span",23),p(4,"Threads"),l(),s(5,"button",31),f("click",function(n){b(e);let r=u();return v(r.toggleThreadSearch(n))}),s(6,"mat-icon"),p(7,"search"),l()()()}}function hw(o,t){o&1&&(s(0,"mat-icon",21),p(1,"keyboard_arrow_up"),l())}function uw(o,t){o&1&&(s(0,"mat-icon",22),p(1,"hub"),l())}function gw(o,t){o&1&&(s(0,"mat-icon",21),p(1,"keyboard_arrow_up"),l())}function fw(o,t){o&1&&(s(0,"mat-icon",22),p(1,"tune"),l())}function _w(o,t){o&1&&(s(0,"div",33)(1,"div",37),I(2,"app-options-panel",38),l()())}function bw(o,t){if(o&1){let e=k();s(0,"div",32)(1,"a",20),f("click",function(n){return b(e),u(3).openProjectConfig(),n.preventDefault(),v(n.stopPropagation())}),s(2,"mat-icon",22),p(3,"settings_applications"),l(),s(4,"span",23),p(5,"Project Configuration"),l()()()}}function vw(o,t){o&1&&(s(0,"div",32)(1,"a",39)(2,"mat-icon",22),p(3,"settings_applications"),l(),s(4,"span",23),p(5,"Project config (No project)"),l()()())}function yw(o,t){if(o&1&&C(0,bw,6,0,"div",32)(1,vw,6,0,"div",32),o&2){let e=u(2);x(e.selectedProjectName()?0:1)}}function Cw(o,t){if(o&1){let e=k();s(0,"div",32)(1,"a",20),f("click",function(n){return b(e),u(2).openAgents(),n.preventDefault(),v(n.stopPropagation())}),s(2,"mat-icon",22),p(3,"smart_toy"),l(),s(4,"span",23),p(5,"Agents"),l()()()}}function xw(o,t){o&1&&(s(0,"div",32)(1,"a",39)(2,"mat-icon",22),p(3,"smart_toy"),l(),s(4,"span",23),p(5,"Agents (No project)"),l()()())}function ww(o,t){if(o&1){let e=k();s(0,"div",32)(1,"a",20),f("click",function(n){return b(e),u(2).openPrompts(),n.preventDefault(),v(n.stopPropagation())}),s(2,"mat-icon",22),p(3,"description"),l(),s(4,"span",23),p(5,"Prompts"),l()()()}}function Sw(o,t){o&1&&(s(0,"div",32)(1,"a",39)(2,"mat-icon",22),p(3,"description"),l(),s(4,"span",23),p(5,"Prompts (No project)"),l()()())}function kw(o,t){if(o&1){let e=k();s(0,"div",32)(1,"a",20),f("click",function(n){return b(e),u(2).openSchedulers(),n.preventDefault(),v(n.stopPropagation())}),s(2,"mat-icon",22),p(3,"schedule"),l(),s(4,"span",23),p(5,"Schedulers"),l()()()}}function Mw(o,t){o&1&&(s(0,"div",32)(1,"a",39)(2,"mat-icon",22),p(3,"schedule"),l(),s(4,"span",23),p(5,"Schedulers (No project)"),l()()())}function Tw(o,t){o&1&&(s(0,"mat-icon",21),p(1,"keyboard_arrow_up"),l())}function Ew(o,t){o&1&&(s(0,"mat-icon",22),p(1,"rocket_launch"),l())}function Pw(o,t){o&1&&(s(0,"div",33),I(1,"app-preview-panel"),l())}function Ow(o,t){if(o&1){let e=k();s(0,"div",32)(1,"a",20),f("click",function(n){return b(e),u(2).toggleSection("preview"),n.preventDefault(),v(n.stopPropagation())}),C(2,Tw,2,0,"mat-icon",21)(3,Ew,2,0,"mat-icon",22),s(4,"span",23),p(5,"Preview Server"),l()(),C(6,Pw,2,0,"div",33),l()}if(o&2){let e=u(2);E("expanded",e.expandedSections.preview),d(),E("active",e.expandedSections.preview),d(),x(e.expandedSections.preview?2:3),d(4),x(e.expandedSections.preview?6:-1)}}function Aw(o,t){if(o&1){let e=k();s(0,"div",24)(1,"div",32)(2,"a",20),f("click",function(n){return b(e),u().toggleSection("config"),v(n.preventDefault())}),C(3,gw,2,0,"mat-icon",21)(4,fw,2,0,"mat-icon",22),s(5,"span",23),p(6,"Preferences"),l()(),C(7,_w,3,0,"div",33),l(),s(8,"div",32)(9,"a",20),f("click",function(n){return b(e),u().openTokenUsage(),n.preventDefault(),v(n.stopPropagation())}),s(10,"mat-icon",22),p(11,"data_usage"),l(),s(12,"span",23),p(13,"Token Usage"),l()()(),s(14,"div",32)(15,"a",20),f("click",function(n){return b(e),u().openUserConfig(),n.preventDefault(),v(n.stopPropagation())}),s(16,"mat-icon",22),p(17,"manage_accounts"),l(),s(18,"span",23),p(19,"User Configuration"),l()()(),C(20,yw,2,1),C(21,Cw,6,0,"div",32)(22,xw,6,0,"div",32),C(23,ww,6,0,"div",32)(24,Sw,6,0,"div",32),C(25,kw,6,0,"div",32)(26,Mw,6,0,"div",32),C(27,Ow,7,6,"div",34),s(28,"div",32)(29,"a",35),I(30,"img",36),s(31,"span",23),p(32,"Contribute on GitHub"),l()()()()}if(o&2){let e=u();d(),E("expanded",e.expandedSections.config),d(),E("active",e.expandedSections.config),d(),x(e.expandedSections.config?3:4),d(4),x(e.expandedSections.config?7:-1),d(13),x(e.isAdmin?20:-1),d(),x(e.selectedProjectName()?21:22),d(2),x(e.selectedProjectName()?23:24),d(2),x(e.selectedProjectName()?25:26),d(2),x(e.hasPreviewConfig()?27:-1),d(3),J("src","CODAY-Logo.png",Kn)}}function Iw(o,t){if(o&1){let e=k();s(0,"div",25)(1,"mat-icon",40),p(2,"warning"),l(),s(3,"span",41),p(4),l(),s(5,"button",42),f("click",function(){b(e);let n=u();return v(n.configErrorMessage="")}),s(6,"mat-icon"),p(7,"close"),l()()()}if(o&2){let e=u();d(4),O(e.configErrorMessage)}}var wa=class o{destroy$=new R;isOpen=!0;sidenavStateChange=new H;drawerOpen=!1;get screenWidth(){return window.innerWidth}isAdmin=!1;configErrorMessage="";expandedSections={config:!1,preview:!1,settings:!1};isThreadSearchActive=!1;threadSearchQuery="";threadSearchInput;dialog=m(Ci);configApi=m(Ki);projectStateService=m(ke);projectApi=m(Wm);router=m(Fi);preferences=m(at);threadStateService=m(At);projects=rt(this.projectStateService.projectList$);selectedProject=rt(this.projectStateService.selectedProject$);selectedProjectName=rt(this.projectStateService.selectedProject$.pipe(ve(t=>t?.name)));isProjectVolatile=rt(this.projectStateService.selectedProject$.pipe(ve(t=>t?.config?.volatile||!1)));forcedProject=rt(this.projectStateService.forcedProject$);hasPreviewConfig=rt(this.projectStateService.selectedProject$.pipe(ve(t=>!!t?.config?.preview?.command)),{initialValue:!1});ngOnInit(){let t=this.preferences.getPreference("sidenavOpen",!0);this.isOpen=t??!0,console.log("[SIDENAV] Loaded sidenav state from preferences:",this.isOpen),this.configApi.getUserConfig().pipe(N(this.destroy$)).subscribe({next:e=>{this.isAdmin=e.groups?.includes("CODAY_ADMIN")??!1,console.log("[SIDENAV] User admin status:",this.isAdmin)},error:e=>{console.error("[SIDENAV] Error loading user config for roles:",e),this.isAdmin=!1}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}toggle(){this.isOpen=!this.isOpen,this.saveSidenavState(),this.sidenavStateChange.emit(this.isOpen)}close(){this.isOpen&&(this.isOpen=!1,this.saveSidenavState(),this.sidenavStateChange.emit(!1))}saveSidenavState(){this.preferences.setPreference("sidenavOpen",this.isOpen),console.log("[SIDENAV] Saved sidenav state:",this.isOpen)}openTokenUsage(){this.configErrorMessage="",this.router.navigate(["/token-usage"]),this.close()}openUserConfig(){console.log("[SIDENAV] openUserConfig called"),this.configErrorMessage="",this.configApi.getUserConfig().pipe(N(this.destroy$)).subscribe({next:t=>{console.log("[SIDENAV] User config loaded, opening dialog"),this.dialog.open(ba,{data:{configType:"user",initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(i=>{i&&this.saveUserConfig(i)})},error:t=>{console.error("[SIDENAV] Error loading user config:",t),this.configErrorMessage=t?.error?.error||"Failed to load user configuration"}})}saveUserConfig(t){this.configApi.updateUserConfig(t).pipe(N(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] User config saved successfully")},error:e=>{console.error("[SIDENAV] Error saving user config:",e),this.configErrorMessage=e?.error?.error||"Failed to save user configuration"}})}openProjectConfig(){let t=this.selectedProjectName();if(!t){console.error("[SIDENAV] No project selected"),this.configErrorMessage="No project selected. Please select a project first.";return}this.configErrorMessage="",this.projectApi.getProjectConfig(t).pipe(N(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] Project config loaded, opening dialog"),this.dialog.open(ba,{data:{configType:"project",projectName:t,initialContent:JSON.stringify(e,null,2)}}).afterClosed().subscribe(n=>{n&&this.saveProjectConfig(t,n)})},error:e=>{console.error("[SIDENAV] Error loading project config:",e),this.configErrorMessage=e?.error?.error||"Failed to load project configuration"}})}saveProjectConfig(t,e){this.projectApi.updateProjectConfig(t,e).pipe(N(this.destroy$)).subscribe({next:i=>{console.log("[SIDENAV] Project config saved successfully")},error:i=>{console.error("[SIDENAV] Error saving project config:",i),this.configErrorMessage=i?.error?.error||"Failed to save project configuration"}})}requireProjectSelection(t){return this.selectedProjectName()?!0:(console.error(`[SIDENAV] No project selected, cannot ${t}`),this.configErrorMessage="Please select a project first",!1)}openManagerDialog(t,e){console.log(`[SIDENAV] ${e}`),this.dialog.open(t,{width:"90vw",maxWidth:"1200px",height:"90vh",maxHeight:"900px"})}openAgents(){this.requireProjectSelection("open agents")&&this.openManagerDialog(Rl,"Opening agent manager dialog")}openPrompts(){this.requireProjectSelection("open prompts")&&this.openManagerDialog(Ml,"Opening prompt manager dialog")}openSchedulers(){this.requireProjectSelection("open schedulers")&&this.openManagerDialog(Dl,`Opening scheduler manager dialog for project: ${this.selectedProjectName()}`)}toggleSection(t){let e=this.expandedSections[t];t==="settings"?this.expandedSections[t]=!e:(["config","preview"].forEach(n=>{this.expandedSections[n]=!1}),this.expandedSections[t]=!e)}navigateToHome(){if(this.forcedProject()){console.log("[SIDENAV] Cannot navigate to home - forced project active");return}console.log("[SIDENAV] Navigating to home (project selection)"),this.projectStateService.clearSelection(),this.router.navigate(["/"])}createNewThread(){let t=this.selectedProjectName();if(!t){console.error("[SIDENAV] No project selected, cannot create new thread"),this.configErrorMessage="Please select a project first";return}console.log("[SIDENAV] Navigating to welcome view for new thread"),this.threadStateService.clearSelection(),this.router.navigate(["project",t])}onThreadSelectedOnMobile(){window.innerWidth<1024&&this.close()}toggleThreadSearch(t){t.stopPropagation(),this.isThreadSearchActive=!0,this.threadSearchQuery="",setTimeout(()=>{this.threadSearchInput?.nativeElement.focus()},0)}closeThreadSearch(){this.isThreadSearchActive=!1,this.threadSearchQuery=""}onThreadSearchInput(){}onThreadSearchModeChange(t){t||this.closeThreadSearch()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-sidenav"]],viewQuery:function(e,i){if(e&1&&X(lw,5),e&2){let n;U(n=W())&&(i.threadSearchInput=n.first)}},inputs:{drawerOpen:"drawerOpen"},outputs:{sidenavStateChange:"sidenavStateChange"},ngContentSelectors:cw,decls:34,vars:31,consts:[["threadSearchInput",""],[1,"sidenav-container",3,"hasBackdrop"],["mode","push","position","start",1,"app-sidenav",3,"closed","opened","disableClose"],[1,"sidenav-header"],["mat-icon-button","","title","Close menu",3,"click"],["alt","coday",3,"click","keydown.enter","keydown.space","title"],[1,"header-title-section"],[1,"sidenav-title"],[1,"new-thread-section"],["role","button","tabindex","0",1,"new-thread-link",3,"click"],["fontSet","material-icons-outlined"],[1,"new-thread-text"],[1,"sidenav-sections"],[1,"section-container","expanded"],[1,"search-header"],[1,"section-toggle","active","threads-header"],[1,"section-content","threads"],[1,"sidenav-thread-selector",3,"searchModeChange","threadSelected","searchMode","searchQuery"],[1,"sidenav-nav"],[1,"section-container","settings-group"],["role","button","tabindex","0",1,"section-toggle",3,"click"],[1,"arrow-icon","expanded"],[1,"section-icon"],[1,"section-label"],[1,"section-content","settings-content"],["role","alert",1,"error-notification"],["mat-icon-button","","title","Menu","type","button",1,"sidenav-toggle-btn",3,"click"],["mat-icon-button","","title","Start a new thread","type","button",1,"sidenav-new-thread-btn",3,"click","disabled"],[1,"search-icon"],["type","text","placeholder","Search threads...",1,"search-input",3,"ngModelChange","input","ngModel"],["mat-icon-button","","title","Close search","type","button",1,"close-search-btn",3,"click"],["mat-icon-button","","title","Search threads","type","button",1,"search-button",3,"click"],[1,"section-container"],[1,"section-content"],[1,"section-container",3,"expanded"],["href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer","title","Contribute on GitHub",1,"section-toggle","contribute-btn"],["alt","Coday",1,"contribute-logo"],[1,"preference-item"],[1,"inline-panel"],["role","button","tabindex","-1","aria-disabled","true",1,"section-toggle","disabled"],[1,"error-icon"],[1,"error-text"],["mat-icon-button","","aria-label","Close error message",1,"error-close",3,"click"]],template:function(e,i){e&1&&(We(),C(0,dw,6,1),s(1,"mat-sidenav-container",1)(2,"mat-sidenav",2),f("closed",function(){return i.close()}),s(3,"div",3)(4,"button",4),f("click",function(){return i.close()}),s(5,"mat-icon"),p(6,"chevron_left"),l()(),s(7,"img",5),f("click",function(r){return i.navigateToHome(),r.stopPropagation()})("keydown.enter",function(r){return i.navigateToHome(),r.preventDefault(),r.stopPropagation()})("keydown.space",function(r){return i.navigateToHome(),r.preventDefault(),r.stopPropagation()}),l(),s(8,"div",6)(9,"h2",7),p(10),l()()(),s(11,"div",8)(12,"a",9),f("click",function(r){return i.createNewThread(),r.preventDefault()}),s(13,"mat-icon",10),p(14,"play_circle"),l(),s(15,"span",11),p(16,"Start a new thread"),l()()(),s(17,"div",12)(18,"div",13),C(19,mw,8,1,"div",14)(20,pw,8,0,"div",15),s(21,"div",16)(22,"app-thread-selector",17),f("searchModeChange",function(r){return i.onThreadSearchModeChange(r)})("threadSelected",function(){return i.onThreadSelectedOnMobile()}),l()()()(),s(23,"div",18)(24,"div",19)(25,"a",20),f("click",function(r){return i.toggleSection("settings"),r.preventDefault()}),C(26,hw,2,0,"mat-icon",21)(27,uw,2,0,"mat-icon",22),s(28,"span",23),p(29,"Control Center"),l()(),C(30,Aw,33,12,"div",24),l()()(),s(31,"mat-sidenav-content"),ue(32),l()(),C(33,Iw,8,1,"div",25)),e&2&&(x(!i.isOpen&&(!i.drawerOpen||i.screenWidth>=1024)?0:-1),d(),E("sidenav-open",i.isOpen),w("hasBackdrop",!1),d(),w("opened",i.isOpen)("disableClose",!0),d(5),E("sidenav-logo",!0)("clickable",!i.forcedProject())("disabled",i.forcedProject()),w("title",i.forcedProject()?"Project selection disabled":"Go to project selection"),J("src","CODAY-Logo.png",Kn)("role",i.forcedProject()?null:"button")("tabindex",i.forcedProject()?null:"0"),d(3),O(i.selectedProjectName()),d(9),x(i.isThreadSearchActive?19:20),d(3),w("searchMode",i.isThreadSearchActive)("searchQuery",i.threadSearchQuery),d(),E("is-admin",i.isAdmin),d(),E("expanded",i.expandedSections.settings),d(),E("active",i.expandedSections.settings),d(),x(i.expandedSections.settings?26:27),d(4),x(i.expandedSections.settings?30:-1),d(),E("sidenav-closed-offset",!i.isOpen),d(2),x(i.configErrorMessage?33:-1))},dependencies:[Ue,je,Be,He,fl,Td,ju,ul,Me,he,ot,Ke,$u,qu,ga,Sl,kl],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}.sidenav-container[_ngcontent-%COMP%]{position:fixed;top:0;left:0;right:0;height:100dvh;z-index:1400;transition:width;display:flex}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]{position:relative!important;transition:width;width:310px;height:100dvh!important;flex-shrink:0}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]:not(.mat-drawer-opened){width:0!important;overflow:hidden!important;visibility:hidden!important}.sidenav-container[_ngcontent-%COMP%] mat-sidenav-content[_ngcontent-%COMP%]{width:100%;margin:0!important}[_nghost-%COMP%] .mat-drawer-backdrop{pointer-events:auto}[_nghost-%COMP%] .mat-drawer-content{pointer-events:auto!important;background:transparent!important;overflow:visible!important}[_nghost-%COMP%] .mat-drawer-inner-container{overflow:hidden!important;height:100dvh!important;display:flex!important;flex-direction:column!important}.sidenav-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:1rem!important;left:1rem!important;z-index:1500!important}@media (max-width: 1023px){.sidenav-toggle-btn[_ngcontent-%COMP%]{width:40px!important;height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:0!important;line-height:1!important;background:var(--glass-bg)!important;backdrop-filter:var(--glass-backdrop-blur)!important;-webkit-backdrop-filter:var(--glass-backdrop-blur)!important;border:1px solid var(--glass-border)!important;box-shadow:var(--glass-shadow)!important;border-radius:50%!important}.sidenav-toggle-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{display:flex!important;align-items:center!important;justify-content:center!important;line-height:1!important}}.sidenav-new-thread-btn[_ngcontent-%COMP%]{position:fixed!important;top:calc(1.5rem + 40px)!important;left:1rem!important;z-index:1500!important}.sidenav-new-thread-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]:disabled{opacity:.5!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]:disabled mat-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)!important}@media (max-width: 1023px){.sidenav-new-thread-btn[_ngcontent-%COMP%]{width:40px!important;height:40px!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:0!important;line-height:1!important;background:var(--glass-bg)!important;backdrop-filter:var(--glass-backdrop-blur)!important;-webkit-backdrop-filter:var(--glass-backdrop-blur)!important;border:1px solid var(--glass-border)!important;box-shadow:var(--glass-shadow)!important;border-radius:50%!important}.sidenav-new-thread-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{display:flex!important;align-items:center!important;justify-content:center!important;line-height:1!important}}.sidenav-logo-btn[_ngcontent-%COMP%]{position:fixed!important;bottom:1rem!important;left:1rem!important;z-index:1500!important;width:56px!important;height:56px!important;border-radius:50%!important;border:1px solid var(--glass-border)!important;padding:4px!important;background:var(--glass-bg)!important;backdrop-filter:var(--glass-backdrop-blur)!important;-webkit-backdrop-filter:var(--glass-backdrop-blur)!important;box-shadow:var(--glass-shadow)!important;transition:all .3s cubic-bezier(.4,0,.2,1)!important;cursor:pointer!important;pointer-events:auto!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;text-decoration:none!important}.sidenav-logo-btn[_ngcontent-%COMP%]:hover{transform:scale(1.08) translateY(-2px)!important;box-shadow:0 16px 48px #0003!important;border-color:var(--color-primary)!important}.sidenav-logo-btn[_ngcontent-%COMP%]:active{transform:scale(.96)!important}.sidenav-logo-btn[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:2px}.app-sidenav[_ngcontent-%COMP%]{width:310px;height:100dvh!important;min-height:0!important;position:relative;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border-radius:0;overflow:hidden;overflow-x:hidden!important;display:flex;flex-direction:column}.sidenav-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:1.5rem 1rem .5rem;flex-shrink:0}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:4px;flex-shrink:0;transition:all .2s ease}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]{cursor:pointer}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:hover{transform:scale(1.1);filter:drop-shadow(0 4px 12px rgba(0,0,0,.15))}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:active{transform:scale(.95)}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;pointer-events:none}.sidenav-header[_ngcontent-%COMP%] .header-title-section[_ngcontent-%COMP%]{flex:1;display:flex;align-items:center;min-width:0}.sidenav-header[_ngcontent-%COMP%] .header-title-section[_ngcontent-%COMP%] .sidenav-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.loading-section[_ngcontent-%COMP%]{padding:2rem 1rem;display:flex;align-items:center;justify-content:center}.loading-content[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:1rem;align-items:center}.loading-content[_ngcontent-%COMP%] mat-progress-bar[_ngcontent-%COMP%]{width:100%;height:4px;border-radius:2px}.loading-content[_ngcontent-%COMP%] .loading-text[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary);text-align:center}.new-thread-section[_ngcontent-%COMP%]{padding:1rem 1rem .5rem;flex-shrink:0}.new-thread-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;background:transparent;border:none;text-decoration:none;cursor:pointer;transition:all .2s ease;gap:.5rem;font-size:.95rem;font-weight:600;padding:0}.new-thread-link[_ngcontent-%COMP%] .new-thread-text[_ngcontent-%COMP%]{background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-primary);animation:_ngcontent-%COMP%_iconPulse 3s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%]:hover{transform:translate(4px)}.new-thread-link[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_iconPulse 1.5s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%]:focus{transform:scale(1.1)}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}@keyframes _ngcontent-%COMP%_iconPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.05)}}.sidenav-sections[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:100px;overflow:hidden}.sidenav-sections[_ngcontent-%COMP%] > .section-container[_ngcontent-%COMP%], .sidenav-sections[_ngcontent-%COMP%] > .section-container.expanded[_ngcontent-%COMP%], .sidenav-sections[_ngcontent-%COMP%] > .section-container[_ngcontent-%COMP%] > .section-content.threads[_ngcontent-%COMP%], .sidenav-sections[_ngcontent-%COMP%] > .section-container[_ngcontent-%COMP%] > .section-content.threads[_ngcontent-%COMP%] > app-thread-selector[_ngcontent-%COMP%]{display:flex!important;flex-direction:column!important;flex:1!important;min-height:0!important;overflow:hidden!important}.sidenav-nav[_ngcontent-%COMP%]{flex-shrink:0;display:flex;flex-direction:column;overflow:hidden;max-height:70%;border-top:1px solid var(--color-border)}.sidenav-nav[_ngcontent-%COMP%] > .settings-group[_ngcontent-%COMP%] > .section-toggle.active[_ngcontent-%COMP%]{border-top:none}.sidenav-nav[_ngcontent-%COMP%] .settings-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.sidenav-nav[_ngcontent-%COMP%] .settings-group[_ngcontent-%COMP%] > .section-toggle[_ngcontent-%COMP%]{flex-shrink:0}.sidenav-nav[_ngcontent-%COMP%] .settings-group[_ngcontent-%COMP%] > .section-content.settings-content[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}.settings-group[_ngcontent-%COMP%] > .section-content.settings-content[_ngcontent-%COMP%]{padding:0;border-bottom:1px solid var(--color-border);overflow:visible}.settings-group[_ngcontent-%COMP%] > .section-content.settings-content[_ngcontent-%COMP%] .section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{max-height:40vh;overflow-y:auto;overflow-x:hidden}.contribute-btn[_ngcontent-%COMP%] .contribute-logo[_ngcontent-%COMP%]{width:20px;height:20px;border-radius:2px;flex-shrink:0}.section-container[_ngcontent-%COMP%]{flex-shrink:0;display:flex;flex-direction:column}.section-container.expanded[_ngcontent-%COMP%]{display:flex;flex-direction:column}.section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{border-bottom:none}.section-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;width:100%;padding:.5rem 1rem;height:50px;text-decoration:none;cursor:pointer;transition:all .2s ease;background:transparent;border:none;border-radius:0;color:var(--color-text);flex-shrink:0}.section-toggle.active[_ngcontent-%COMP%]{border-top:1px solid var(--color-border)}.section-toggle.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;pointer-events:none}.section-toggle[_ngcontent-%COMP%] .arrow-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);transition:transform .2s ease;transform:rotate(0);flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .section-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .section-label[_ngcontent-%COMP%]{flex:1;font-size:.9rem;color:var(--color-text);text-align:left}.section-toggle[_ngcontent-%COMP%] .search-button[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .search-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.section-toggle[_ngcontent-%COMP%]:hover:not(.disabled){background:var(--color-bg-hover)}.section-toggle[_ngcontent-%COMP%]:active:not(.disabled){transform:scale(.98)}.section-toggle[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:-2px}.search-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;height:50px;background:var(--color-bg-hover);border-top:1px solid var(--color-border);transition:all .2s ease}.search-header[_ngcontent-%COMP%] .search-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);flex-shrink:0}.search-header[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent;color:var(--color-text);font-size:.9rem;padding:0;min-width:0}.search-header[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-muted)}.search-header[_ngcontent-%COMP%] .close-search-btn[_ngcontent-%COMP%]{flex-shrink:0}.search-header[_ngcontent-%COMP%] .close-search-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.section-content[_ngcontent-%COMP%]{padding:.5rem 0 0;animation:_ngcontent-%COMP%_slideDown .2s ease;border-bottom:1px solid var(--color-border);display:flex;flex-direction:column}.section-content.threads[_ngcontent-%COMP%]{padding:0;border-bottom:none;flex:1!important;min-height:0!important;overflow:hidden!important}.section-content.threads[_ngcontent-%COMP%] app-thread-selector[_ngcontent-%COMP%]{flex:1!important;min-height:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}@keyframes _ngcontent-%COMP%_slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.config-links[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:.5rem 1rem;margin-bottom:1rem}.sidenav-item[_ngcontent-%COMP%]{width:100%}.sidenav-item[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary)}.sidenav-item[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{flex:1;font-size:.9rem}.sidenav-item[_ngcontent-%COMP%] .disabled-hint[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary);font-style:italic}.sidenav-link.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;color:var(--color-text-secondary)}.sidenav-link.disabled[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.sidenav-link[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%], .sidenav-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-primary)}.sidenav-link[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{font-size:.875rem}.preference-item[_ngcontent-%COMP%]{padding-bottom:1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border)}.preference-item[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;margin-bottom:.75rem;padding:0 1rem}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.preference-item[_ngcontent-%COMP%] .preference-content[_ngcontent-%COMP%]{padding:0 1rem}.error-notification[_ngcontent-%COMP%]{position:fixed;top:5rem;left:50%;transform:translate(-50%);z-index:2000;display:flex;align-items:center;gap:.75rem;background:#ff3b3026;backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid rgba(255,59,48,.3);border-radius:16px;padding:1rem 1.5rem;box-shadow:var(--glass-shadow);animation:_ngcontent-%COMP%_errorSlideDown .3s cubic-bezier(.4,0,.2,1)}.error-notification[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{font-size:1.2rem;flex-shrink:0;color:#c00}.error-notification[_ngcontent-%COMP%] .error-text[_ngcontent-%COMP%]{flex:1;color:#c00;font-size:.9rem;font-weight:500}@keyframes _ngcontent-%COMP%_errorSlideDown{0%{opacity:0;transform:translate(-50%,-10px)}to{opacity:1;transform:translate(-50%)}}@media (max-width: 480px){.app-sidenav[_ngcontent-%COMP%]{width:280px}.sidenav-toggle-btn[_ngcontent-%COMP%]{left:.75rem!important;top:.75rem!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]{left:.75rem!important;top:calc(1.25rem + 40px)!important}.error-notification[_ngcontent-%COMP%]{left:1rem;right:1rem;transform:none;max-width:calc(100vw - 2rem)}}body.dark[_nghost-%COMP%] .app-sidenav[_ngcontent-%COMP%], body.dark [_nghost-%COMP%] .app-sidenav[_ngcontent-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .app-sidenav[_ngcontent-%COMP%]{background:#242830f2;border-right-color:#b4c8ff17}body.dark[_nghost-%COMP%] .sidenav-header[_ngcontent-%COMP%], body.dark [_nghost-%COMP%] .sidenav-header[_ngcontent-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .sidenav-header[_ngcontent-%COMP%]{background:#242830b3}"]})};var Fl=class o{destroy$=new R;isSetup=!1;codayService=m(Xt);preferencesService=m(at);setup(){if(this.isSetup){console.warn("[AGENT-NOTIFICATION] Service already set up");return}console.log("[AGENT-NOTIFICATION] Setting up agent notification service"),this.codayService.isThinking$.pipe(N(this.destroy$),Io(),me(([t,e])=>t===!0&&e===!1)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled()}),this.preferencesService.browserNotificationEnabled$.pipe(N(this.destroy$),Io(),me(([t,e])=>t===!1&&e===!0)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Browser notifications enabled, checking permission"),this.handleBrowserNotificationEnabled()}),this.isSetup=!0}notifyTaskFinishedIfEnabled(){this.preferencesService.getAgentNotificationEnabled()&&(this.preferencesService.getNotificationSoundEnabled()&&this.playCompletionSound(),this.preferencesService.getBrowserNotificationEnabled()&&this.sendBrowserNotification())}playCompletionSound(){try{let t=new(window.AudioContext||window.webkitAudioContext),e=t.createOscillator(),i=t.createGain();e.connect(i),i.connect(t.destination),e.frequency.setValueAtTime(700,t.currentTime),i.gain.setValueAtTime(.1,t.currentTime),i.gain.exponentialRampToValueAtTime(.01,t.currentTime+.08),e.start(t.currentTime),e.stop(t.currentTime+.08);let n=t.createOscillator(),r=t.createGain();n.connect(r),r.connect(t.destination);let a=t.currentTime+.11;n.frequency.setValueAtTime(950,a),r.gain.setValueAtTime(.1,a),r.gain.exponentialRampToValueAtTime(.01,a+.09),n.start(a),n.stop(a+.09),console.log("[AGENT-NOTIFICATION] Completion sound played")}catch(t){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",t)}}handleBrowserNotificationEnabled(){return te(this,null,function*(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="denied"){console.warn("[AGENT-NOTIFICATION] Permission denied, disabling browser notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="granted"){console.log("[AGENT-NOTIFICATION] Permission already granted, showing confirmation"),this.createConfirmationNotification();return}try{(yield Notification.requestPermission())==="granted"?(console.log("[AGENT-NOTIFICATION] Permission granted, showing confirmation"),this.createConfirmationNotification()):(console.log("[AGENT-NOTIFICATION] Permission denied or dismissed"),this.preferencesService.setBrowserNotificationEnabled(!1))}catch(t){console.error("[AGENT-NOTIFICATION] Error requesting permission:",t),this.preferencesService.setBrowserNotificationEnabled(!1)}})}sendBrowserNotification(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications");return}if(document.hasFocus()){console.warn("[AGENT-NOTIFICATION] Document is focused, skipping browser notification");return}Notification.permission==="granted"?this.createTaskCompleteNotification():console.warn("[AGENT-NOTIFICATION] Permission not granted, cannot send notification")}createConfirmationNotification(){let t=new Notification("Coday - Notifications Enabled",{body:"You will be notified when the agent completes tasks",icon:"/favicon.ico",tag:"coday-notifications-enabled",requireInteraction:!1});setTimeout(()=>t.close(),4e3),t.onclick=()=>{window.focus(),t.close()},console.log("[AGENT-NOTIFICATION] Confirmation notification sent")}createTaskCompleteNotification(){let t=new Notification("Coday - Task Complete",{body:"The agent has finished and is waiting for your input",icon:"/favicon.ico",tag:"coday-task-complete",requireInteraction:!1});setTimeout(()=>t.close(),5e3),t.onclick=()=>{window.focus(),t.close()},console.log("[AGENT-NOTIFICATION] Task complete notification sent")}ngOnDestroy(){console.log("[AGENT-NOTIFICATION] Service destroyed"),this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(e){return new(e||o)};static \u0275prov=L({token:o,factory:o.\u0275fac,providedIn:"root"})};var Dw=["inputSection"];function Rw(o,t){if(o&1){let e=k();s(0,"app-thread",4),f("chatFocused",function(){b(e);let n=u();return v(n.onChatFocusedOnMobile())})("drawerStateChange",function(n){b(e);let r=u();return v(r.onDrawerStateChange(n))}),l()}if(o&2){let e=u();w("projectName",e.projectName)("threadId",e.threadId)}}function Fw(o,t){if(o&1){let e=k();s(0,"div",5),I(1,"app-welcome-message"),l(),s(2,"div",6,0)(4,"div",7)(5,"div",8)(6,"app-chat-textarea",9),f("messageSubmitted",function(n){b(e);let r=u();return v(r.onMessageSubmitted(n))})("voiceRecordingToggled",function(n){b(e);let r=u();return v(r.onVoiceToggled(n))})("heightChanged",function(n){b(e);let r=u();return v(r.onInputHeightChanged(n))})("textareaFocused",function(){b(e);let n=u();return v(n.onChatFocusedOnMobile())}),l()()()()}if(o&2){let e=u();d(6),w("isDisabled",e.isSessionInitializing)("isSessionInitializing",e.isSessionInitializing)("showWelcome",!0)("isThinking",!1)("isStarting",e.isStartingFirstMessage)}}var Sa=class o{destroy$=new R;inputSection;sidenav;projectName="";threadId=null;isSessionInitializing=!1;isStartingFirstMessage=!1;inputSectionHeight=80;codayService=m(Xt);titleService=m(yr);preferencesService=m(at);route=m(Ba);router=m(Fi);threadApiService=m(Qi);agentNotificationService=m(Fl);firstMessageState=m(Cr);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)")}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(N(this.destroy$)).subscribe(t=>{let e=t.projectName,i=t.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:e,thread:i,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=e,this.threadId=i,this.threadId?console.log("[MAIN-APP] Thread selected - ThreadComponent will display"):(console.log("[MAIN-APP] No thread selected - showing welcome view"),this.initializeWelcomeView())})}initializeWelcomeView(){this.codayService.setTabTitleService(this.titleService)}ngAfterViewInit(){setTimeout(()=>this.updateInputSectionHeight(),100)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}onMessageSubmitted(t){console.log("[MAIN-APP] First message submitted from welcome view:",t),this.isSessionInitializing=!0,this.isStartingFirstMessage=!0,this.threadApiService.createThread().subscribe({next:e=>{console.log("[MAIN-APP] Thread created:",e.thread.id),this.firstMessageState.setPendingFirstMessage(t),this.router.navigate(["project",this.projectName,"thread",e.thread.id])},error:e=>{console.error("[MAIN-APP] Failed to create thread:",e),this.isSessionInitializing=!1,this.isStartingFirstMessage=!1,alert("Failed to create conversation: "+(e.message||"Unknown error"))}})}onVoiceToggled(t){console.log("[VOICE] Recording in welcome view:",t)}isDrawerOpen=!1;onDrawerStateChange(t){this.isDrawerOpen=t}onChatFocusedOnMobile(){window.innerWidth<1024&&this.sidenav?.close()}onInputHeightChanged(t){console.log("[MAIN-APP] Input height changed:",t),this.inputSectionHeight=t}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let t=this.inputSection.nativeElement.offsetHeight;t!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",t),this.inputSectionHeight=t)}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let t=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",t),t?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical")};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical")};static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-main"]],viewQuery:function(e,i){if(e&1&&(X(Dw,5),X(wa,5)),e&2){let n;U(n=W())&&(i.inputSection=n.first),U(n=W())&&(i.sidenav=n.first)}},decls:4,vars:2,consts:[["inputSection",""],[3,"drawerOpen"],[1,"app",3,"mousedown","touchstart"],[3,"projectName","threadId"],[3,"chatFocused","drawerStateChange","projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","textareaFocused","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(e,i){e&1&&(s(0,"app-sidenav",1)(1,"div",2),f("mousedown",function(){return i.onChatFocusedOnMobile()})("touchstart",function(){return i.onChatFocusedOnMobile()}),C(2,Rw,1,2,"app-thread",3)(3,Fw,7,5),l()()),e&2&&(w("drawerOpen",i.isDrawerOpen),d(2),x(i.threadId?2:3))},dependencies:[ar,bl,er,wa],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;min-width:0;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center;overflow:hidden}.chat-wrapper[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;background:transparent;width:100%;padding:2.5rem 0 1.5rem;display:flex;justify-content:center}.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem}@media (max-width: 768px){.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{padding:0 1rem}}.welcome-section[_ngcontent-%COMP%]{flex-shrink:0;text-align:center;padding:2rem 1rem;animation:_ngcontent-%COMP%_fadeInUp .8s ease-out;display:flex;justify-content:center;align-items:center;width:100%;min-width:0;overflow:hidden}@keyframes _ngcontent-%COMP%_fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.input-section[_ngcontent-%COMP%]{flex-shrink:0;position:relative;border-top:none;background:transparent;box-shadow:none;padding:2.5rem 0 2rem;overflow-y:visible;max-height:none;width:100%;z-index:10;pointer-events:none;display:flex;justify-content:center}.input-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}@media (max-width: 768px){.input-center[_ngcontent-%COMP%]{padding:0 1rem}}.input-glass[_ngcontent-%COMP%]{background:none;box-shadow:none;width:100%;min-height:64px;display:flex;align-items:stretch;gap:0;pointer-events:auto;position:relative;overflow:visible}.input-glass[_ngcontent-%COMP%] app-chat-textarea[_ngcontent-%COMP%]{width:100%;min-width:0;flex:1 1 auto;align-self:stretch;display:flex}body.dark[_nghost-%COMP%], body.dark [_nghost-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .input-glass[_ngcontent-%COMP%]{background:#24283073;border-color:#b4c8ff17;box-shadow:0 8px 32px #0000002b,0 1.5px 8px #00000012}.choice-overlay[_ngcontent-%COMP%]{z-index:10;width:100%;display:flex;justify-content:center;align-items:center}.upload-status[_ngcontent-%COMP%]{position:fixed;bottom:100px;left:50%;transform:translate(-50%);z-index:1000;display:flex;align-items:center;padding:12px 20px;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);border-radius:16px;font-size:.9em;color:var(--color-text);box-shadow:var(--glass-shadow);max-width:300px;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:#ff3b3026;color:var(--color-error);border-color:#ff3b304d}@media (max-width: 768px){.welcome-section[_ngcontent-%COMP%]{padding:1.5rem 1rem}.input-section[_ngcontent-%COMP%]{padding:1.5rem .75rem 1rem}.input-center[_ngcontent-%COMP%]{padding:0 .5rem}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;overflow:visible!important}.app[_ngcontent-%COMP%]{height:auto!important;overflow:visible!important;display:block!important}.input-section[_ngcontent-%COMP%], .welcome-section[_ngcontent-%COMP%]{display:none!important}}"],data:{animation:[ac("slideIn",[ss(":enter",[Dn({transform:"translateY(100%)",opacity:0}),as("300ms ease-out",Dn({transform:"translateY(0)",opacity:1}))]),ss(":leave",[as("200ms ease-in",Dn({transform:"translateY(100%)",opacity:0}))])])]}})};var Nl=class o{route=m(Ba);ngOnInit(){console.log("[OAuth Callback] Component initialized");let t=this.route.snapshot.queryParamMap.get("code"),e=this.route.snapshot.queryParamMap.get("state"),i=this.route.snapshot.queryParamMap.get("error"),n=this.route.snapshot.queryParamMap.get("error_description");if(console.log("[OAuth Callback] Code:",t,"State:",e,"Error:",i,"Opener:",!!window.opener),i){if(console.log("[OAuth Callback] OAuth error received:",i,n),!window.opener){alert(`OAuth error: ${i}${n?" - "+n:""}. Please close this window.`);return}try{window.opener.postMessage({error:i,state:e,errorDescription:n},window.location.origin),console.log("[OAuth Callback] Error postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup after error"),window.close()},1e3)}catch(r){console.error("[OAuth Callback] Error sending error postMessage:",r),alert("OAuth error: Failed to communicate with parent window")}return}if(!t||!e){console.error("[OAuth Callback] Missing code or state");return}if(!window.opener){console.error("[OAuth Callback] No window.opener - popup may have been opened incorrectly"),alert("OAuth callback error: No parent window found. Please close this window and try again.");return}try{console.log("[OAuth Callback] Sending postMessage to parent"),window.opener.postMessage({code:t,state:e},window.location.origin),console.log("[OAuth Callback] postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup"),window.close()},1e3)}catch(r){console.error("[OAuth Callback] Error sending postMessage:",r),alert("OAuth callback error: Failed to communicate with parent window")}}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-oauth-callback"]],decls:2,vars:0,template:function(e,i){e&1&&(ii(0,"p"),p(1,"Authentication in progress..."),ni())},encapsulation:2})};var jd=o=>te(null,null,function*(){let t=m(ke),e=o.params.projectName;return e?t.getSelectedProjectId()===e?!0:(t.selectProject(e),(yield sm(t.selectedProject$.pipe(dm(n=>n?.name===e))))?.name===e):(console.log("[PROJECT GUARD] no project id in route"),!1)});var Sg=o=>te(null,null,function*(){let t=m(At),e=m(Xi),i=o.params.threadId;if(!e.getUsername())try{yield Yl(e.fetchCurrentUser())}catch(n){console.error("[THREAD GUARD] Failed to load current user:",n)}if(!i)return console.log("[THREAD GUARD] no threadId in route"),!1;if(console.log("[THREAD GUARD] Checking thread:",i),console.log("[THREAD GUARD] Current selected thread:",t.getSelectedThreadId()),t.getSelectedThreadId()===i)return console.log("[THREAD GUARD] Thread already selected, allowing navigation"),!0;console.log("[THREAD GUARD] Selecting thread:",i),t.selectThread(i);try{let n=yield Yl(Yn([t.isLoading$,t.selectedThread$]).pipe(yt(([a,c])=>console.log(`\u{1F43C} [${a?"loading":"loaded"}]`,c?.id)),me(([a,c])=>!a&&!!c),qt(1),ve(([a,c])=>c?.id))),r=n===i;return r?console.log("[THREAD GUARD] Thread validated, allowing navigation"):console.error("[THREAD GUARD] Thread ID mismatch - route:",i,"loaded:",n),r}catch(n){return console.error("[THREAD GUARD] Error loading thread:",n),!1}});var kg=[{path:"",component:Ys},{path:"oauth/callback",component:Nl},{path:"project/:projectName",component:Sa,canActivate:[jd]},{path:"project/:projectName/thread/:threadId",component:Sa,canActivate:[jd,Sg]},{path:"token-usage",loadComponent:()=>import("./chunk-Z7D32IIN.js").then(o=>o.TokenUsageComponent)},{path:"agentos",loadChildren:()=>import("./chunk-JYIACJ2B.js").then(o=>o.AGENTOS_ROUTES)},{path:"**",redirectTo:""}];function Nw(o){return()=>o.initializeDefaultProject()}function Lw(o){return()=>{console.log("[APP_INIT] OAuthService initialized")}}var Mg={providers:[hm(),Sm({eventCoalescing:!0}),Rm(kg),Im(),Qp(),pm(Ko),{provide:Jl,useFactory:Nw,deps:[ke],multi:!0},{provide:Jl,useFactory:Lw,deps:[Hn],multi:!0},Um({basePath:"/api/agentos"}),{provide:Ls,useValue:{width:"80vw",maxWidth:"80vw",maxHeight:"80vh"}}]};var Ll=class o{title="client";themeService=m(xr);ngOnInit(){console.log("[APP] Application initialized with theme:",this.themeService.getCurrentTheme())}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=M({type:o,selectors:[["app-root"]],decls:1,vars:0,template:function(e,i){e&1&&I(0,"router-outlet")},dependencies:[Fm,Dm],encapsulation:2})};Am(Ll,Mg).catch(o=>console.error(o));