@whoz-oss/coday-client 0.79.2 → 0.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdpartylicenses.txt +26 -26
- package/browser/chunk-2HJUHP2O.js +1 -0
- package/browser/chunk-2I7BVCFA.js +1 -0
- package/browser/chunk-5CECNE3W.js +1 -0
- package/browser/chunk-ADPUMZCL.js +1 -0
- package/browser/chunk-ASTXTNCW.js +1 -0
- package/browser/chunk-EN34LXVI.js +5 -0
- package/browser/chunk-FYYZME5V.js +10 -0
- package/browser/chunk-JNUPIL7A.js +1 -0
- package/browser/chunk-LRXH43AD.js +1 -0
- package/browser/chunk-M3IE5IWD.js +1 -0
- package/browser/chunk-NP5QKZ3S.js +1 -0
- package/browser/chunk-OM6QEVE5.js +1 -0
- package/browser/chunk-SSDNZR7U.js +1 -0
- package/browser/chunk-TWBSKSZ6.js +1 -0
- package/browser/index.html +1 -1
- package/browser/main-IFLXFZMY.js +374 -0
- package/package.json +1 -1
- package/browser/chunk-C64HFRBU.js +0 -14
- package/browser/chunk-ND7OBRS6.js +0 -1
- package/browser/chunk-PA7BQGOR.js +0 -1
- package/browser/chunk-XDVJJE6Q.js +0 -1
- package/browser/main-T7FHRFIU.js +0 -374
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import{a as wc}from"./chunk-5CECNE3W.js";import{A as bh,B as vh,C as ot,D as dt,E as tn,F as Mi,G as Ei,H as vt,I as Ot,J as jr,K as ce,L as is,M as At,N as os,O as yt,P as xe,Q as Ye,R as yh,a as Xa,b as Ka,c as ct,d as Si,e as Lr,f as ki,g as Nt,h as Za,i as vc,j as uh,k as ph,l as No,m as Ja,n as es,o as ts,p as Re,q as Pt,r as gh,s as fh,t as yc,u as _h,v as Vo,w as ns,x as Lo,y as Cc,z as xc}from"./chunk-FYYZME5V.js";import{$ as lt,$a as Ua,A as pc,Aa as se,Ab as ge,B as ja,Ba as ee,Bb as Zm,Ca as Gm,Cb as Yi,D as zm,Da as ye,Db as Jm,E as Do,Ea as Ym,Eb as Nr,Fa as qe,Fb as $a,G as bi,Ga as H,Gb as eh,Ha as ue,Hb as _n,I as Ft,Ia as Gt,Ib as ft,J as Dn,Ja as Qm,Jb as Ro,K as z,Ka as fc,Kb as xi,L as Bm,La as Rr,Lb as Vr,M as st,Ma as G,Mb as th,N as de,Nb as He,O as it,Oa as w,Ob as K,P as D,Pa as S,Pb as bn,Q as ae,Qa as qi,Qb as nh,R as te,Ra as Xm,Rb as ih,S as za,Sa as Oe,Sb as bc,T as d,Ta as Ae,Tb as oh,U as Hm,Ua as x,Ub as Fo,V as Ba,Va as s,Vb as qa,W as v,Wa as l,Wb as Ga,X as y,Xa as I,Xb as Ya,Y as Kn,Ya as an,Yb as rh,Z as Ha,Za as sn,Zb as ah,_ as ve,_a as Gi,_b as De,a as Y,aa as $i,ab as E,ac as sh,b as Ie,bb as Jt,bc as lh,c as Dm,ca as Wm,cb as _,d as J,da as Wa,e as On,ea as Te,eb as g,f as rn,fa as Ve,fb as Be,g as F,ga as tt,gb as me,gc as Ge,h as re,ha as ne,hb as kt,hc as ch,i as Im,ia as Um,ib as ie,ic as Rn,j as Rm,jb as U,jc as Qa,k as wt,kb as $,kc as dh,l as Ar,la as Dr,lb as Km,lc as wi,m as Fm,mb as Fr,mc as mh,n as Nm,nb as _c,nc as hh,o as be,oa as Zt,ob as en,p as Xn,pa as Io,pb as In,qa as $m,qb as A,r as Ao,ra as m,rb as Zn,s as Vm,sa as vi,sb as h,t as Lm,ta as fn,tb as B,u as An,ua as nt,ub as oe,v as he,va as Pe,vb as yi,w as uc,wa as Ir,wb as N,x as Ui,xa as qm,xb as V,y as jm,ya as gc,yb as L,z as St,za as M,zb as Ci}from"./chunk-EN34LXVI.js";var le=(function(i){return i[i.State=0]="State",i[i.Transition=1]="Transition",i[i.Sequence=2]="Sequence",i[i.Group=3]="Group",i[i.Animate=4]="Animate",i[i.Keyframes=5]="Keyframes",i[i.Style=6]="Style",i[i.Trigger=7]="Trigger",i[i.Reference=8]="Reference",i[i.AnimateChild=9]="AnimateChild",i[i.AnimateRef=10]="AnimateRef",i[i.Query=11]="Query",i[i.Stagger=12]="Stagger",i})(le||{}),ln="*";function Sc(i,t){return{type:le.Trigger,name:i,definitions:t,options:{}}}function rs(i,t=null){return{type:le.Animate,styles:t,timings:i}}function Ch(i,t=null){return{type:le.Sequence,steps:i,options:t}}function Ti(i){return{type:le.Style,styles:i,offset:null}}function as(i,t,e=null){return{type:le.Transition,expr:i,animation:t,options:e}}var Fn=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(n=>n()),e.length=0}},Qi=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(t){this.players=t;let e=0,n=0,o=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++e==r&&this._onFinish()}),a.onDestroy(()=>{++n==r&&this._onDestroy()}),a.onStart(()=>{++o==r&&this._onStart()})}),this.totalTime=this.players.reduce((a,c)=>Math.max(a,c.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(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(n=>{let o=n.totalTime?Math.min(1,e/n.totalTime):1;n.setPosition(o)})}getPosition(){let t=this.players.reduce((e,n)=>e===null||n.totalTime>e.totalTime?n: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(n=>n()),e.length=0}},jo="!";function xh(i){return new de(3e3,!1)}function Of(){return new de(3100,!1)}function Af(){return new de(3101,!1)}function Df(i){return new de(3001,!1)}function If(i){return new de(3003,!1)}function Rf(i){return new de(3004,!1)}function Sh(i,t){return new de(3005,!1)}function kh(){return new de(3006,!1)}function Mh(){return new de(3007,!1)}function Eh(i,t){return new de(3008,!1)}function Th(i){return new de(3002,!1)}function Ph(i,t,e,n,o){return new de(3010,!1)}function Oh(){return new de(3011,!1)}function Ah(){return new de(3012,!1)}function Dh(){return new de(3200,!1)}function Ih(){return new de(3202,!1)}function Rh(){return new de(3013,!1)}function Fh(i){return new de(3014,!1)}function Nh(i){return new de(3015,!1)}function Vh(i){return new de(3016,!1)}function Lh(i,t){return new de(3404,!1)}function Ff(i){return new de(3502,!1)}function jh(i){return new de(3503,!1)}function zh(){return new de(3300,!1)}function Bh(i){return new de(3504,!1)}function Hh(i){return new de(3301,!1)}function Wh(i,t){return new de(3302,!1)}function Uh(i){return new de(3303,!1)}function $h(i,t){return new de(3400,!1)}function qh(i){return new de(3401,!1)}function Gh(i){return new de(3402,!1)}function Yh(i,t){return new de(3505,!1)}function Jn(i){switch(i.length){case 0:return new Fn;case 1:return i[0];default:return new Qi(i)}}function Tc(i,t,e=new Map,n=new Map){let o=[],r=[],a=-1,c=null;if(t.forEach(u=>{let p=u.get("offset"),b=p==a,C=b&&c||new Map;u.forEach((T,P)=>{let k=P,j=T;if(P!=="offset")switch(k=i.normalizePropertyName(k,o),j){case jo:j=e.get(P);break;case ln:j=n.get(P);break;default:j=i.normalizeStyleValue(P,k,j,o);break}C.set(k,j)}),b||r.push(C),c=C,a=p}),o.length)throw Ff(o);return r}function ss(i,t,e,n){switch(t){case"start":i.onStart(()=>n(e&&kc(e,"start",i)));break;case"done":i.onDone(()=>n(e&&kc(e,"done",i)));break;case"destroy":i.onDestroy(()=>n(e&&kc(e,"destroy",i)));break}}function kc(i,t,e){let n=e.totalTime,o=!!e.disabled,r=ls(i.element,i.triggerName,i.fromState,i.toState,t||i.phaseName,n??i.totalTime,o),a=i._data;return a!=null&&(r._data=a),r}function ls(i,t,e,n,o="",r=0,a){return{element:i,triggerName:t,fromState:e,toState:n,phaseName:o,totalTime:r,disabled:!!a}}function Yt(i,t,e){let n=i.get(t);return n||i.set(t,n=e),n}function Pc(i){let t=i.indexOf(":"),e=i.substring(1,t),n=i.slice(t+1);return[e,n]}var Nf=typeof document>"u"?null:document.documentElement;function cs(i){let t=i.parentNode||i.host||null;return t===Nf?null:t}function Vf(i){return i.substring(1,6)=="ebkit"}var Xi=null,wh=!1;function Qh(i){Xi||(Xi=Lf()||{},wh=Xi.style?"WebkitAppearance"in Xi.style:!1);let t=!0;return Xi.style&&!Vf(i)&&(t=i in Xi.style,!t&&wh&&(t="Webkit"+i.charAt(0).toUpperCase()+i.slice(1)in Xi.style)),t}function Lf(){return typeof document<"u"?document.body:null}function Oc(i,t){for(;t;){if(t===i)return!0;t=cs(t)}return!1}function Ac(i,t,e){if(e)return Array.from(i.querySelectorAll(t));let n=i.querySelector(t);return n?[n]:[]}var jf=1e3,Dc="{{",zf="}}",Ic="ng-enter",ds="ng-leave",zr="ng-trigger",Br=".ng-trigger",Rc="ng-animating",ms=".ng-animating";function Nn(i){if(typeof i=="number")return i;let t=i.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:Mc(parseFloat(t[1]),t[2])}function Mc(i,t){switch(t){case"s":return i*jf;default:return i}}function Hr(i,t,e){return i.hasOwnProperty("duration")?i:Hf(i,t,e)}var Bf=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function Hf(i,t,e){let n,o=0,r="";if(typeof i=="string"){let a=i.match(Bf);if(a===null)return t.push(xh(i)),{duration:0,delay:0,easing:""};n=Mc(parseFloat(a[1]),a[2]);let c=a[3];c!=null&&(o=Mc(parseFloat(c),a[4]));let u=a[5];u&&(r=u)}else n=i;if(!e){let a=!1,c=t.length;n<0&&(t.push(Of()),a=!0),o<0&&(t.push(Af()),a=!0),a&&t.splice(c,0,xh(i))}return{duration:n,delay:o,easing:r}}function Xh(i){return i.length?i[0]instanceof Map?i:i.map(t=>new Map(Object.entries(t))):[]}function vn(i,t,e){t.forEach((n,o)=>{let r=hs(o);e&&!e.has(o)&&e.set(o,i.style[r]),i.style[r]=n})}function Pi(i,t){t.forEach((e,n)=>{let o=hs(n);i.style[o]=""})}function zo(i){return Array.isArray(i)?i.length==1?i[0]:Ch(i):i}function Kh(i,t,e){let n=t.params||{},o=Fc(i);o.length&&o.forEach(r=>{n.hasOwnProperty(r)||e.push(Df(r))})}var Ec=new RegExp(`${Dc}\\s*(.+?)\\s*${zf}`,"g");function Fc(i){let t=[];if(typeof i=="string"){let e;for(;e=Ec.exec(i);)t.push(e[1]);Ec.lastIndex=0}return t}function Bo(i,t,e){let n=`${i}`,o=n.replace(Ec,(r,a)=>{let c=t[a];return c==null&&(e.push(If(a)),c=""),c.toString()});return o==n?i:o}var Wf=/-+([a-z0-9])/g;function hs(i){return i.replace(Wf,(...t)=>t[1].toUpperCase())}function Zh(i,t){return i===0||t===0}function Jh(i,t,e){if(e.size&&t.length){let n=t[0],o=[];if(e.forEach((r,a)=>{n.has(a)||o.push(a),n.set(a,r)}),o.length)for(let r=1;r<t.length;r++){let a=t[r];o.forEach(c=>a.set(c,us(i,c)))}}return t}function Qt(i,t,e){switch(t.type){case le.Trigger:return i.visitTrigger(t,e);case le.State:return i.visitState(t,e);case le.Transition:return i.visitTransition(t,e);case le.Sequence:return i.visitSequence(t,e);case le.Group:return i.visitGroup(t,e);case le.Animate:return i.visitAnimate(t,e);case le.Keyframes:return i.visitKeyframes(t,e);case le.Style:return i.visitStyle(t,e);case le.Reference:return i.visitReference(t,e);case le.AnimateChild:return i.visitAnimateChild(t,e);case le.AnimateRef:return i.visitAnimateRef(t,e);case le.Query:return i.visitQuery(t,e);case le.Stagger:return i.visitStagger(t,e);default:throw Rf(t.type)}}function us(i,t){return window.getComputedStyle(i)[t]}var Zc=(()=>{class i{validateStyleProperty(e){return Qh(e)}containsElement(e,n){return Oc(e,n)}getParentElement(e){return cs(e)}query(e,n,o){return Ac(e,n,o)}computeStyle(e,n,o){return o||""}animate(e,n,o,r,a,c=[],u){return new Fn(o,r)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=D({token:i,factory:i.\u0275fac})}return i})(),Zi=class{static NOOP=new Zc},Ji=class{};var Uf=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"]),bs=class extends Ji{normalizePropertyName(t,e){return hs(t)}normalizeStyleValue(t,e,n,o){let r="",a=n.toString().trim();if(Uf.has(e)&&n!==0&&n!=="0")if(typeof n=="number")r="px";else{let c=n.match(/^[+-]?[\d\.]+([a-z]*)$/);c&&c[1].length==0&&o.push(Sh(t,n))}return a+r}};var vs="*";function $f(i,t){let e=[];return typeof i=="string"?i.split(/\s*,\s*/).forEach(n=>qf(n,e,t)):e.push(i),e}function qf(i,t,e){if(i[0]==":"){let u=Gf(i,e);if(typeof u=="function"){t.push(u);return}i=u}let n=i.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(n==null||n.length<4)return e.push(Nh(i)),t;let o=n[1],r=n[2],a=n[3];t.push(eu(o,a));let c=o==vs&&a==vs;r[0]=="<"&&!c&&t.push(eu(a,o))}function Gf(i,t){switch(i){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,n)=>parseFloat(n)>parseFloat(e);case":decrement":return(e,n)=>parseFloat(n)<parseFloat(e);default:return t.push(Vh(i)),"* => *"}}var ps=new Set(["true","1"]),gs=new Set(["false","0"]);function eu(i,t){let e=ps.has(i)||gs.has(i),n=ps.has(t)||gs.has(t);return(o,r)=>{let a=i==vs||i==o,c=t==vs||t==r;return!a&&e&&typeof o=="boolean"&&(a=o?ps.has(i):gs.has(i)),!c&&n&&typeof r=="boolean"&&(c=r?ps.has(t):gs.has(t)),a&&c}}var du=":self",Yf=new RegExp(`s*${du}s*,?`,"g");function mu(i,t,e,n){return new Bc(i).build(t,e,n)}var tu="",Bc=class{_driver;constructor(t){this._driver=t}build(t,e,n){let o=new Hc(e);return this._resetContextStyleTimingState(o),Qt(this,zo(t),o)}_resetContextStyleTimingState(t){t.currentQuerySelector=tu,t.collectedStyles=new Map,t.collectedStyles.set(tu,new Map),t.currentTime=0}visitTrigger(t,e){let n=e.queryCount=0,o=e.depCount=0,r=[],a=[];return t.name.charAt(0)=="@"&&e.errors.push(kh()),t.definitions.forEach(c=>{if(this._resetContextStyleTimingState(e),c.type==le.State){let u=c,p=u.name;p.toString().split(/\s*,\s*/).forEach(b=>{u.name=b,r.push(this.visitState(u,e))}),u.name=p}else if(c.type==le.Transition){let u=this.visitTransition(c,e);n+=u.queryCount,o+=u.depCount,a.push(u)}else e.errors.push(Mh())}),{type:le.Trigger,name:t.name,states:r,transitions:a,queryCount:n,depCount:o,options:null}}visitState(t,e){let n=this.visitStyle(t.styles,e),o=t.options&&t.options.params||null;if(n.containsDynamicStyles){let r=new Set,a=o||{};n.styles.forEach(c=>{c instanceof Map&&c.forEach(u=>{Fc(u).forEach(p=>{a.hasOwnProperty(p)||r.add(p)})})}),r.size&&e.errors.push(Eh(t.name,[...r.values()]))}return{type:le.State,name:t.name,style:n,options:o?{params:o}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;let n=Qt(this,zo(t.animation),e),o=$f(t.expr,e.errors);return{type:le.Transition,matchers:o,animation:n,queryCount:e.queryCount,depCount:e.depCount,options:Ki(t.options)}}visitSequence(t,e){return{type:le.Sequence,steps:t.steps.map(n=>Qt(this,n,e)),options:Ki(t.options)}}visitGroup(t,e){let n=e.currentTime,o=0,r=t.steps.map(a=>{e.currentTime=n;let c=Qt(this,a,e);return o=Math.max(o,e.currentTime),c});return e.currentTime=o,{type:le.Group,steps:r,options:Ki(t.options)}}visitAnimate(t,e){let n=Zf(t.timings,e.errors);e.currentAnimateTimings=n;let o,r=t.styles?t.styles:Ti({});if(r.type==le.Keyframes)o=this.visitKeyframes(r,e);else{let a=t.styles,c=!1;if(!a){c=!0;let p={};n.easing&&(p.easing=n.easing),a=Ti(p)}e.currentTime+=n.duration+n.delay;let u=this.visitStyle(a,e);u.isEmptyStep=c,o=u}return e.currentAnimateTimings=null,{type:le.Animate,timings:n,style:o,options:null}}visitStyle(t,e){let n=this._makeStyleAst(t,e);return this._validateStyleAst(n,e),n}_makeStyleAst(t,e){let n=[],o=Array.isArray(t.styles)?t.styles:[t.styles];for(let c of o)typeof c=="string"?c===ln?n.push(c):e.errors.push(Th(c)):n.push(new Map(Object.entries(c)));let r=!1,a=null;return n.forEach(c=>{if(c instanceof Map&&(c.has("easing")&&(a=c.get("easing"),c.delete("easing")),!r)){for(let u of c.values())if(u.toString().indexOf(Dc)>=0){r=!0;break}}}),{type:le.Style,styles:n,easing:a,offset:t.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(t,e){let n=e.currentAnimateTimings,o=e.currentTime,r=e.currentTime;n&&r>0&&(r-=n.duration+n.delay),t.styles.forEach(a=>{typeof a!="string"&&a.forEach((c,u)=>{let p=e.collectedStyles.get(e.currentQuerySelector),b=p.get(u),C=!0;b&&(r!=o&&r>=b.startTime&&o<=b.endTime&&(e.errors.push(Ph(u,b.startTime,b.endTime,r,o)),C=!1),r=b.startTime),C&&p.set(u,{startTime:r,endTime:o}),e.options&&Kh(c,e.options,e.errors)})})}visitKeyframes(t,e){let n={type:le.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(Oh()),n;let o=1,r=0,a=[],c=!1,u=!1,p=0,b=t.steps.map(ze=>{let Ze=this._makeStyleAst(ze,e),Je=Ze.offset!=null?Ze.offset:Kf(Ze.styles),fe=0;return Je!=null&&(r++,fe=Ze.offset=Je),u=u||fe<0||fe>1,c=c||fe<p,p=fe,a.push(fe),Ze});u&&e.errors.push(Ah()),c&&e.errors.push(Dh());let C=t.steps.length,T=0;r>0&&r<C?e.errors.push(Ih()):r==0&&(T=o/(C-1));let P=C-1,k=e.currentTime,j=e.currentAnimateTimings,Ce=j.duration;return b.forEach((ze,Ze)=>{let Je=T>0?Ze==P?1:T*Ze:a[Ze],fe=Je*Ce;e.currentTime=k+j.delay+fe,j.duration=fe,this._validateStyleAst(ze,e),ze.offset=Je,n.styles.push(ze)}),n}visitReference(t,e){return{type:le.Reference,animation:Qt(this,zo(t.animation),e),options:Ki(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:le.AnimateChild,options:Ki(t.options)}}visitAnimateRef(t,e){return{type:le.AnimateRef,animation:this.visitReference(t.animation,e),options:Ki(t.options)}}visitQuery(t,e){let n=e.currentQuerySelector,o=t.options||{};e.queryCount++,e.currentQuery=t;let[r,a]=Qf(t.selector);e.currentQuerySelector=n.length?n+" "+r:r,Yt(e.collectedStyles,e.currentQuerySelector,new Map);let c=Qt(this,zo(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=n,{type:le.Query,selector:r,limit:o.limit||0,optional:!!o.optional,includeSelf:a,animation:c,originalSelector:t.selector,options:Ki(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push(Rh());let n=t.timings==="full"?{duration:0,delay:0,easing:"full"}:Hr(t.timings,e.errors,!0);return{type:le.Stagger,animation:Qt(this,zo(t.animation),e),timings:n,options:null}}};function Qf(i){let t=!!i.split(/\s*,\s*/).find(e=>e==du);return t&&(i=i.replace(Yf,"")),i=i.replace(/@\*/g,Br).replace(/@\w+/g,e=>Br+"-"+e.slice(1)).replace(/:animating/g,ms),[i,t]}function Xf(i){return i?Y({},i):null}var Hc=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 Kf(i){if(typeof i=="string")return null;let t=null;if(Array.isArray(i))i.forEach(e=>{if(e instanceof Map&&e.has("offset")){let n=e;t=parseFloat(n.get("offset")),n.delete("offset")}});else if(i instanceof Map&&i.has("offset")){let e=i;t=parseFloat(e.get("offset")),e.delete("offset")}return t}function Zf(i,t){if(i.hasOwnProperty("duration"))return i;if(typeof i=="number"){let r=Hr(i,t).duration;return Nc(r,0,"")}let e=i;if(e.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=Nc(0,0,"");return r.dynamic=!0,r.strValue=e,r}let o=Hr(e,t);return Nc(o.duration,o.delay,o.easing)}function Ki(i){return i?(i=Y({},i),i.params&&(i.params=Xf(i.params))):i={},i}function Nc(i,t,e){return{duration:i,delay:t,easing:e}}function Jc(i,t,e,n,o,r,a=null,c=!1){return{type:1,element:i,keyframes:t,preStyleProps:e,postStyleProps:n,duration:o,delay:r,totalTime:o+r,easing:a,subTimeline:c}}var Ur=class{_map=new Map;get(t){return this._map.get(t)||[]}append(t,e){let n=this._map.get(t);n||this._map.set(t,n=[]),n.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}},Jf=1,e_=":enter",t_=new RegExp(e_,"g"),n_=":leave",i_=new RegExp(n_,"g");function hu(i,t,e,n,o,r=new Map,a=new Map,c,u,p=[]){return new Wc().buildKeyframes(i,t,e,n,o,r,a,c,u,p)}var Wc=class{buildKeyframes(t,e,n,o,r,a,c,u,p,b=[]){p=p||new Ur;let C=new Uc(t,e,p,o,r,b,[]);C.options=u;let T=u.delay?Nn(u.delay):0;C.currentTimeline.delayNextStep(T),C.currentTimeline.setStyles([a],null,C.errors,u),Qt(this,n,C);let P=C.timelines.filter(k=>k.containsAnimation());if(P.length&&c.size){let k;for(let j=P.length-1;j>=0;j--){let Ce=P[j];if(Ce.element===e){k=Ce;break}}k&&!k.allowOnlyTimelineStyles()&&k.setStyles([c],null,C.errors,u)}return P.length?P.map(k=>k.buildKeyframes()):[Jc(e,[],[],[],0,T,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){let n=e.subInstructions.get(e.element);if(n){let o=e.createSubContext(t.options),r=e.currentTimeline.currentTime,a=this._visitSubInstructions(n,o,o.options);r!=a&&e.transformIntoNewTimeline(a)}e.previousNode=t}visitAnimateRef(t,e){let n=e.createSubContext(t.options);n.transformIntoNewTimeline(),this._applyAnimationRefDelays([t.options,t.animation.options],e,n),this.visitReference(t.animation,n),e.transformIntoNewTimeline(n.currentTimeline.currentTime),e.previousNode=t}_applyAnimationRefDelays(t,e,n){for(let o of t){let r=o?.delay;if(r){let a=typeof r=="number"?r:Nn(Bo(r,o?.params??{},e.errors));n.delayNextStep(a)}}}_visitSubInstructions(t,e,n){let r=e.currentTimeline.currentTime,a=n.duration!=null?Nn(n.duration):null,c=n.delay!=null?Nn(n.delay):null;return a!==0&&t.forEach(u=>{let p=e.appendInstructionToTimeline(u,a,c);r=Math.max(r,p.duration+p.delay)}),r}visitReference(t,e){e.updateOptions(t.options,!0),Qt(this,t.animation,e),e.previousNode=t}visitSequence(t,e){let n=e.subContextCount,o=e,r=t.options;if(r&&(r.params||r.delay)&&(o=e.createSubContext(r),o.transformIntoNewTimeline(),r.delay!=null)){o.previousNode.type==le.Style&&(o.currentTimeline.snapshotCurrentStyles(),o.previousNode=ys);let a=Nn(r.delay);o.delayNextStep(a)}t.steps.length&&(t.steps.forEach(a=>Qt(this,a,o)),o.currentTimeline.applyStylesToKeyframe(),o.subContextCount>n&&o.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){let n=[],o=e.currentTimeline.currentTime,r=t.options&&t.options.delay?Nn(t.options.delay):0;t.steps.forEach(a=>{let c=e.createSubContext(t.options);r&&c.delayNextStep(r),Qt(this,a,c),o=Math.max(o,c.currentTimeline.currentTime),n.push(c.currentTimeline)}),n.forEach(a=>e.currentTimeline.mergeTimelineCollectedStyles(a)),e.transformIntoNewTimeline(o),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){let n=t.strValue,o=e.params?Bo(n,e.params,e.errors):n;return Hr(o,e.errors)}else return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){let n=e.currentAnimateTimings=this._visitTiming(t.timings,e),o=e.currentTimeline;n.delay&&(e.incrementTime(n.delay),o.snapshotCurrentStyles());let r=t.style;r.type==le.Keyframes?this.visitKeyframes(r,e):(e.incrementTime(n.duration),this.visitStyle(r,e),o.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){let n=e.currentTimeline,o=e.currentAnimateTimings;!o&&n.hasCurrentStyleProperties()&&n.forwardFrame();let r=o&&o.easing||t.easing;t.isEmptyStep?n.applyEmptyStep(r):n.setStyles(t.styles,r,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){let n=e.currentAnimateTimings,o=e.currentTimeline.duration,r=n.duration,c=e.createSubContext().currentTimeline;c.easing=n.easing,t.styles.forEach(u=>{let p=u.offset||0;c.forwardTime(p*r),c.setStyles(u.styles,u.easing,e.errors,e.options),c.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(c),e.transformIntoNewTimeline(o+r),e.previousNode=t}visitQuery(t,e){let n=e.currentTimeline.currentTime,o=t.options||{},r=o.delay?Nn(o.delay):0;r&&(e.previousNode.type===le.Style||n==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=ys);let a=n,c=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!o.optional,e.errors);e.currentQueryTotal=c.length;let u=null;c.forEach((p,b)=>{e.currentQueryIndex=b;let C=e.createSubContext(t.options,p);r&&C.delayNextStep(r),p===e.element&&(u=C.currentTimeline),Qt(this,t.animation,C),C.currentTimeline.applyStylesToKeyframe();let T=C.currentTimeline.currentTime;a=Math.max(a,T)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(a),u&&(e.currentTimeline.mergeTimelineCollectedStyles(u),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){let n=e.parentContext,o=e.currentTimeline,r=t.timings,a=Math.abs(r.duration),c=a*(e.currentQueryTotal-1),u=a*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":u=c-u;break;case"full":u=n.currentStaggerTime;break}let b=e.currentTimeline;u&&b.delayNextStep(u);let C=b.currentTime;Qt(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=o.currentTime-C+(o.startTime-n.currentTimeline.startTime)}},ys={},Uc=class i{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=ys;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(t,e,n,o,r,a,c,u){this._driver=t,this.element=e,this.subInstructions=n,this._enterClassName=o,this._leaveClassName=r,this.errors=a,this.timelines=c,this.currentTimeline=u||new Cs(this._driver,e,0),c.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;let n=t,o=this.options;n.duration!=null&&(o.duration=Nn(n.duration)),n.delay!=null&&(o.delay=Nn(n.delay));let r=n.params;if(r){let a=o.params;a||(a=this.options.params={}),Object.keys(r).forEach(c=>{(!e||!a.hasOwnProperty(c))&&(a[c]=Bo(r[c],a,this.errors))})}}_copyOptions(){let t={};if(this.options){let e=this.options.params;if(e){let n=t.params={};Object.keys(e).forEach(o=>{n[o]=e[o]})}}return t}createSubContext(t=null,e,n){let o=e||this.element,r=new i(this._driver,o,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(o,n||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=ys,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,n){let o={duration:e??t.duration,delay:this.currentTimeline.currentTime+(n??0)+t.delay,easing:""},r=new $c(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,o,t.stretchStartingKeyframe);return this.timelines.push(r),o}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,n,o,r,a){let c=[];if(o&&c.push(this.element),t.length>0){t=t.replace(t_,"."+this._enterClassName),t=t.replace(i_,"."+this._leaveClassName);let u=n!=1,p=this._driver.query(this.element,t,u);n!==0&&(p=n<0?p.slice(p.length+n,p.length):p.slice(0,n)),c.push(...p)}return!r&&c.length==0&&a.push(Fh(e)),c}},Cs=class i{_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,n,o){this._driver=t,this.element=e,this.startTime=n,this._elementTimelineStylesLookup=o,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(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 i(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+=Jf,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,n]of this._globalTimelineStyles)this._backFill.set(e,n||ln),this._currentKeyframe.set(e,ln);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,n,o){e&&this._previousKeyframe.set("easing",e);let r=o&&o.params||{},a=o_(t,this._globalTimelineStyles);for(let[c,u]of a){let p=Bo(u,r,n);this._pendingStyles.set(c,p),this._localTimelineStyles.has(c)||this._backFill.set(c,this._globalTimelineStyles.get(c)??ln),this._updateStyle(c,p)}}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,n)=>{let o=this._styleSummary.get(n);(!o||e.time>o.time)&&this._updateStyle(n,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let t=new Set,e=new Set,n=this._keyframes.size===1&&this.duration===0,o=[];this._keyframes.forEach((c,u)=>{let p=new Map([...this._backFill,...c]);p.forEach((b,C)=>{b===jo?t.add(C):b===ln&&e.add(C)}),n||p.set("offset",u/this.duration),o.push(p)});let r=[...t.values()],a=[...e.values()];if(n){let c=o[0],u=new Map(c);c.set("offset",0),u.set("offset",1),o=[c,u]}return Jc(this.element,o,r,a,this.duration,this.startTime,this.easing,!1)}},$c=class extends Cs{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(t,e,n,o,r,a,c=!1){super(t,e,a.delay),this.keyframes=n,this.preStyleProps=o,this.postStyleProps=r,this._stretchStartingKeyframe=c,this.timings={duration:a.duration,delay:a.delay,easing:a.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:n,easing:o}=this.timings;if(this._stretchStartingKeyframe&&e){let r=[],a=n+e,c=e/a,u=new Map(t[0]);u.set("offset",0),r.push(u);let p=new Map(t[0]);p.set("offset",nu(c)),r.push(p);let b=t.length-1;for(let C=1;C<=b;C++){let T=new Map(t[C]),P=T.get("offset"),k=e+P*n;T.set("offset",nu(k/a)),r.push(T)}n=a,e=0,o="",t=r}return Jc(this.element,t,this.preStyleProps,this.postStyleProps,n,e,o,!0)}};function nu(i,t=3){let e=Math.pow(10,t-1);return Math.round(i*e)/e}function o_(i,t){let e=new Map,n;return i.forEach(o=>{if(o==="*"){n??=t.keys();for(let r of n)e.set(r,ln)}else for(let[r,a]of o)e.set(r,a)}),e}function iu(i,t,e,n,o,r,a,c,u,p,b,C,T){return{type:0,element:i,triggerName:t,isRemovalTransition:o,fromState:e,fromStyles:r,toState:n,toStyles:a,timelines:c,queriedElements:u,preStyleProps:p,postStyleProps:b,totalTime:C,errors:T}}var Vc={},xs=class{_triggerName;ast;_stateStyles;constructor(t,e,n){this._triggerName=t,this.ast=e,this._stateStyles=n}match(t,e,n,o){return r_(this.ast.matchers,t,e,n,o)}buildStyles(t,e,n){let o=this._stateStyles.get("*");return t!==void 0&&(o=this._stateStyles.get(t?.toString())||o),o?o.buildStyles(e,n):new Map}build(t,e,n,o,r,a,c,u,p,b){let C=[],T=this.ast.options&&this.ast.options.params||Vc,P=c&&c.params||Vc,k=this.buildStyles(n,P,C),j=u&&u.params||Vc,Ce=this.buildStyles(o,j,C),ze=new Set,Ze=new Map,Je=new Map,fe=o==="void",Ut={params:uu(j,T),delay:this.ast.options?.delay},_t=b?[]:hu(t,e,this.ast.animation,r,a,k,Ce,Ut,p,C),et=0;return _t.forEach(Mt=>{et=Math.max(Mt.duration+Mt.delay,et)}),C.length?iu(e,this._triggerName,n,o,fe,k,Ce,[],[],Ze,Je,et,C):(_t.forEach(Mt=>{let qn=Mt.element,fi=Yt(Ze,qn,new Set);Mt.preStyleProps.forEach(gn=>fi.add(gn));let bt=Yt(Je,qn,new Set);Mt.postStyleProps.forEach(gn=>bt.add(gn)),qn!==e&&ze.add(qn)}),iu(e,this._triggerName,n,o,fe,k,Ce,_t,[...ze.values()],Ze,Je,et))}};function r_(i,t,e,n,o){return i.some(r=>r(t,e,n,o))}function uu(i,t){let e=Y({},t);return Object.entries(i).forEach(([n,o])=>{o!=null&&(e[n]=o)}),e}var qc=class{styles;defaultParams;normalizer;constructor(t,e,n){this.styles=t,this.defaultParams=e,this.normalizer=n}buildStyles(t,e){let n=new Map,o=uu(t,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((a,c)=>{a&&(a=Bo(a,o,e));let u=this.normalizer.normalizePropertyName(c,e);a=this.normalizer.normalizeStyleValue(c,u,a,e),n.set(c,a)})}),n}};function a_(i,t,e){return new Gc(i,t,e)}var Gc=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(t,e,n){this.name=t,this.ast=e,this._normalizer=n,e.states.forEach(o=>{let r=o.options&&o.options.params||{};this.states.set(o.name,new qc(o.style,r,n))}),ou(this.states,"true","1"),ou(this.states,"false","0"),e.transitions.forEach(o=>{this.transitionFactories.push(new xs(t,o,this.states))}),this.fallbackTransition=s_(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,n,o){return this.transitionFactories.find(a=>a.match(t,e,n,o))||null}matchStyles(t,e,n){return this.fallbackTransition.buildStyles(t,e,n)}};function s_(i,t,e){let n=[(a,c)=>!0],o={type:le.Sequence,steps:[],options:null},r={type:le.Transition,animation:o,matchers:n,options:null,queryCount:0,depCount:0};return new xs(i,r,t)}function ou(i,t,e){i.has(t)?i.has(e)||i.set(e,i.get(t)):i.has(e)&&i.set(t,i.get(e))}var l_=new Ur,Yc=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n}register(t,e){let n=[],o=[],r=mu(this._driver,e,n,o);if(n.length)throw jh(n);this._animations.set(t,r)}_buildPlayer(t,e,n){let o=t.element,r=Tc(this._normalizer,t.keyframes,e,n);return this._driver.animate(o,r,t.duration,t.delay,t.easing,[],!0)}create(t,e,n={}){let o=[],r=this._animations.get(t),a,c=new Map;if(r?(a=hu(this._driver,e,r,Ic,ds,new Map,new Map,n,l_,o),a.forEach(b=>{let C=Yt(c,b.element,new Map);b.postStyleProps.forEach(T=>C.set(T,null))})):(o.push(zh()),a=[]),o.length)throw Bh(o);c.forEach((b,C)=>{b.forEach((T,P)=>{b.set(P,this._driver.computeStyle(C,P,ln))})});let u=a.map(b=>{let C=c.get(b.element);return this._buildPlayer(b,new Map,C)}),p=Jn(u);return this._playersById.set(t,p),p.onDestroy(()=>this.destroy(t)),this.players.push(p),p}destroy(t){let e=this._getPlayer(t);e.destroy(),this._playersById.delete(t);let n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)}_getPlayer(t){let e=this._playersById.get(t);if(!e)throw Hh(t);return e}listen(t,e,n,o){let r=ls(e,"","","");return ss(this._getPlayer(t),n,r,o),()=>{}}command(t,e,n,o){if(n=="register"){this.register(t,o[0]);return}if(n=="create"){let a=o[0]||{};this.create(t,e,a);return}let r=this._getPlayer(t);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(o[0]));break;case"destroy":this.destroy(t);break}}},ru="ng-animate-queued",c_=".ng-animate-queued",Lc="ng-animate-disabled",d_=".ng-animate-disabled",m_="ng-star-inserted",h_=".ng-star-inserted",u_=[],pu={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},p_={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},yn="__ng_removed",$r=class{namespaceId;value;options;get params(){return this.options.params}constructor(t,e=""){this.namespaceId=e;let n=t&&t.hasOwnProperty("value"),o=n?t.value:t;if(this.value=f_(o),n){let r=t,{value:a}=r,c=Dm(r,["value"]);this.options=c}else this.options={};this.options.params||(this.options.params={})}absorbOptions(t){let e=t.params;if(e){let n=this.options.params;Object.keys(e).forEach(o=>{n[o]==null&&(n[o]=e[o])})}}},Wr="void",jc=new $r(Wr),Qc=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this._hostClassName="ng-tns-"+t,cn(e,this._hostClassName)}listen(t,e,n,o){if(!this._triggers.has(e))throw Wh(n,e);if(n==null||n.length==0)throw Uh(e);if(!__(n))throw $h(n,e);let r=Yt(this._elementListeners,t,[]),a={name:e,phase:n,callback:o};r.push(a);let c=Yt(this._engine.statesByElement,t,new Map);return c.has(e)||(cn(t,zr),cn(t,zr+"-"+e),c.set(e,jc)),()=>{this._engine.afterFlush(()=>{let u=r.indexOf(a);u>=0&&r.splice(u,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 qh(t);return e}trigger(t,e,n,o=!0){let r=this._getTrigger(e),a=new qr(this.id,e,t),c=this._engine.statesByElement.get(t);c||(cn(t,zr),cn(t,zr+"-"+e),this._engine.statesByElement.set(t,c=new Map));let u=c.get(e),p=new $r(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&u&&p.absorbOptions(u.options),c.set(e,p),u||(u=jc),!(p.value===Wr)&&u.value===p.value){if(!y_(u.params,p.params)){let j=[],Ce=r.matchStyles(u.value,u.params,j),ze=r.matchStyles(p.value,p.params,j);j.length?this._engine.reportError(j):this._engine.afterFlush(()=>{Pi(t,Ce),vn(t,ze)})}return}let T=Yt(this._engine.playersByElement,t,[]);T.forEach(j=>{j.namespaceId==this.id&&j.triggerName==e&&j.queued&&j.destroy()});let P=r.matchTransition(u.value,p.value,t,p.params),k=!1;if(!P){if(!o)return;P=r.fallbackTransition,k=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:P,fromState:u,toState:p,player:a,isFallbackTransition:k}),k||(cn(t,ru),a.onStart(()=>{Ho(t,ru)})),a.onDone(()=>{let j=this.players.indexOf(a);j>=0&&this.players.splice(j,1);let Ce=this._engine.playersByElement.get(t);if(Ce){let ze=Ce.indexOf(a);ze>=0&&Ce.splice(ze,1)}}),this.players.push(a),T.push(a),a}deregister(t){this._triggers.delete(t),this._engine.statesByElement.forEach(e=>e.delete(t)),this._elementListeners.forEach((e,n)=>{this._elementListeners.set(n,e.filter(o=>o.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);let e=this._engine.playersByElement.get(t);e&&(e.forEach(n=>n.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){let n=this._engine.driver.query(t,Br,!0);n.forEach(o=>{if(o[yn])return;let r=this._engine.fetchNamespacesByElement(o);r.size?r.forEach(a=>a.triggerLeaveAnimation(o,e,!1,!0)):this.clearElementCache(o)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(o=>this.clearElementCache(o)))}triggerLeaveAnimation(t,e,n,o){let r=this._engine.statesByElement.get(t),a=new Map;if(r){let c=[];if(r.forEach((u,p)=>{if(a.set(p,u.value),this._triggers.has(p)){let b=this.trigger(t,p,Wr,o);b&&c.push(b)}}),c.length)return this._engine.markElementAsRemoved(this.id,t,!0,e,a),n&&Jn(c).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){let e=this._elementListeners.get(t),n=this._engine.statesByElement.get(t);if(e&&n){let o=new Set;e.forEach(r=>{let a=r.name;if(o.has(a))return;o.add(a);let u=this._triggers.get(a).fallbackTransition,p=n.get(a)||jc,b=new $r(Wr),C=new qr(this.id,a,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:a,transition:u,fromState:p,toState:b,player:C,isFallbackTransition:!0})})}}removeNode(t,e){let n=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let o=!1;if(n.totalAnimations){let r=n.players.length?n.playersByQueriedElement.get(t):[];if(r&&r.length)o=!0;else{let a=t;for(;a=a.parentNode;)if(n.statesByElement.get(a)){o=!0;break}}}if(this.prepareLeaveAnimationListeners(t),o)n.markElementAsRemoved(this.id,t,!1,e);else{let r=t[yn];(!r||r===pu)&&(n.afterFlush(()=>this.clearElementCache(t)),n.destroyInnerAnimations(t),n._onRemovalComplete(t,e))}}insertNode(t,e){cn(t,this._hostClassName)}drainQueuedTransitions(t){let e=[];return this._queue.forEach(n=>{let o=n.player;if(o.destroyed)return;let r=n.element,a=this._elementListeners.get(r);a&&a.forEach(c=>{if(c.name==n.triggerName){let u=ls(r,n.triggerName,n.fromState.value,n.toState.value);u._data=t,ss(n.player,c.phase,u,c.callback)}}),o.markedForDestroy?this._engine.afterFlush(()=>{o.destroy()}):e.push(n)}),this._queue=[],e.sort((n,o)=>{let r=n.transition.ast.depCount,a=o.transition.ast.depCount;return r==0||a==0?r-a:this._engine.driver.containsElement(n.element,o.element)?1:-1})}destroy(t){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}},Xc=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,n){this.bodyNode=t,this.driver=e,this._normalizer=n}get queuedPlayers(){let t=[];return this._namespaceList.forEach(e=>{e.players.forEach(n=>{n.queued&&t.push(n)})}),t}createNamespace(t,e){let n=new Qc(t,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n}_balanceNamespaceList(t,e){let n=this._namespaceList,o=this.namespacesByHostElement;if(n.length-1>=0){let a=!1,c=this.driver.getParentElement(e);for(;c;){let u=o.get(c);if(u){let p=n.indexOf(u);n.splice(p+1,0,t),a=!0;break}c=this.driver.getParentElement(c)}a||n.unshift(t)}else n.push(t);return o.set(e,t),t}register(t,e){let n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n}registerTrigger(t,e,n){let o=this._namespaceLookup[t];o&&o.register(e,n)&&this.totalAnimations++}destroy(t,e){t&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let n=this._fetchNamespace(t);this.namespacesByHostElement.delete(n.hostElement);let o=this._namespaceList.indexOf(n);o>=0&&this._namespaceList.splice(o,1),n.destroy(e),delete this._namespaceLookup[t]}))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){let e=new Set,n=this.statesByElement.get(t);if(n){for(let o of n.values())if(o.namespaceId){let r=this._fetchNamespace(o.namespaceId);r&&e.add(r)}}return e}trigger(t,e,n,o){if(fs(e)){let r=this._fetchNamespace(t);if(r)return r.trigger(e,n,o),!0}return!1}insertNode(t,e,n,o){if(!fs(e))return;let r=e[yn];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,n)}o&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),cn(t,Lc)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),Ho(t,Lc))}removeNode(t,e,n){if(fs(e)){let o=t?this._fetchNamespace(t):null;o?o.removeNode(e,n):this.markElementAsRemoved(t,e,!1,n);let r=this.namespacesByHostElement.get(e);r&&r.id!==t&&r.removeNode(e,n)}else this._onRemovalComplete(e,n)}markElementAsRemoved(t,e,n,o,r){this.collectedLeaveElements.push(e),e[yn]={namespaceId:t,setForRemoval:o,hasAnimation:n,removedBeforeQueried:!1,previousTriggersValues:r}}listen(t,e,n,o,r){return fs(e)?this._fetchNamespace(t).listen(e,n,o,r):()=>{}}_buildInstruction(t,e,n,o,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,o,t.fromState.options,t.toState.options,e,r)}destroyInnerAnimations(t){let e=this.driver.query(t,Br,!0);e.forEach(n=>this.destroyActiveAnimationsForElement(n)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(t,ms,!0),e.forEach(n=>this.finishActiveQueriedAnimationOnElement(n)))}destroyActiveAnimationsForElement(t){let e=this.playersByElement.get(t);e&&e.forEach(n=>{n.queued?n.markedForDestroy=!0:n.destroy()})}finishActiveQueriedAnimationOnElement(t){let e=this.playersByQueriedElement.get(t);e&&e.forEach(n=>n.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return Jn(this.players).onDone(()=>t());t()})}processLeaveNode(t){let e=t[yn];if(e&&e.setForRemoval){if(t[yn]=pu,e.namespaceId){this.destroyInnerAnimations(t);let n=this._fetchNamespace(e.namespaceId);n&&n.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}t.classList?.contains(Lc)&&this.markElementAsDisabled(t,!1),this.driver.query(t,d_,!0).forEach(n=>{this.markElementAsDisabled(n,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((n,o)=>this._balanceNamespaceList(n,o)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;n<this.collectedEnterElements.length;n++){let o=this.collectedEnterElements[n];cn(o,m_)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let n=[];try{e=this._flushAnimations(n,t)}finally{for(let o=0;o<n.length;o++)n[o]()}}else for(let n=0;n<this.collectedLeaveElements.length;n++){let o=this.collectedLeaveElements[n];this.processLeaveNode(o)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(n=>n()),this._flushFns=[],this._whenQuietFns.length){let n=this._whenQuietFns;this._whenQuietFns=[],e.length?Jn(e).onDone(()=>{n.forEach(o=>o())}):n.forEach(o=>o())}}reportError(t){throw Gh(t)}_flushAnimations(t,e){let n=new Ur,o=[],r=new Map,a=[],c=new Map,u=new Map,p=new Map,b=new Set;this.disabledNodes.forEach(W=>{b.add(W);let Q=this.driver.query(W,c_,!0);for(let Z=0;Z<Q.length;Z++)b.add(Q[Z])});let C=this.bodyNode,T=Array.from(this.statesByElement.keys()),P=lu(T,this.collectedEnterElements),k=new Map,j=0;P.forEach((W,Q)=>{let Z=Ic+j++;k.set(Q,Z),W.forEach(_e=>cn(_e,Z))});let Ce=[],ze=new Set,Ze=new Set;for(let W=0;W<this.collectedLeaveElements.length;W++){let Q=this.collectedLeaveElements[W],Z=Q[yn];Z&&Z.setForRemoval&&(Ce.push(Q),ze.add(Q),Z.hasAnimation?this.driver.query(Q,h_,!0).forEach(_e=>ze.add(_e)):Ze.add(Q))}let Je=new Map,fe=lu(T,Array.from(ze));fe.forEach((W,Q)=>{let Z=ds+j++;Je.set(Q,Z),W.forEach(_e=>cn(_e,Z))}),t.push(()=>{P.forEach((W,Q)=>{let Z=k.get(Q);W.forEach(_e=>Ho(_e,Z))}),fe.forEach((W,Q)=>{let Z=Je.get(Q);W.forEach(_e=>Ho(_e,Z))}),Ce.forEach(W=>{this.processLeaveNode(W)})});let Ut=[],_t=[];for(let W=this._namespaceList.length-1;W>=0;W--)this._namespaceList[W].drainQueuedTransitions(e).forEach(Z=>{let _e=Z.player,at=Z.element;if(Ut.push(_e),this.collectedEnterElements.length){let mt=at[yn];if(mt&&mt.setForMove){if(mt.previousTriggersValues&&mt.previousTriggersValues.has(Z.triggerName)){let $t=mt.previousTriggersValues.get(Z.triggerName),Rt=this.statesByElement.get(Z.element);if(Rt&&Rt.has(Z.triggerName)){let _i=Rt.get(Z.triggerName);_i.value=$t,Rt.set(Z.triggerName,_i)}}_e.destroy();return}}let Ee=!C||!this.driver.containsElement(C,at),Et=Je.get(at),Fe=k.get(at),Ne=this._buildInstruction(Z,n,Fe,Et,Ee);if(Ne.errors&&Ne.errors.length){_t.push(Ne);return}if(Ee){_e.onStart(()=>Pi(at,Ne.fromStyles)),_e.onDestroy(()=>vn(at,Ne.toStyles)),o.push(_e);return}if(Z.isFallbackTransition){_e.onStart(()=>Pi(at,Ne.fromStyles)),_e.onDestroy(()=>vn(at,Ne.toStyles)),o.push(_e);return}let Ue=[];Ne.timelines.forEach(mt=>{mt.stretchStartingKeyframe=!0,this.disabledNodes.has(mt.element)||Ue.push(mt)}),Ne.timelines=Ue,n.append(at,Ne.timelines);let Bi={instruction:Ne,player:_e,element:at};a.push(Bi),Ne.queriedElements.forEach(mt=>Yt(c,mt,[]).push(_e)),Ne.preStyleProps.forEach((mt,$t)=>{if(mt.size){let Rt=u.get($t);Rt||u.set($t,Rt=new Set),mt.forEach((_i,So)=>Rt.add(So))}}),Ne.postStyleProps.forEach((mt,$t)=>{let Rt=p.get($t);Rt||p.set($t,Rt=new Set),mt.forEach((_i,So)=>Rt.add(So))})});if(_t.length){let W=[];_t.forEach(Q=>{W.push(Yh(Q.triggerName,Q.errors))}),Ut.forEach(Q=>Q.destroy()),this.reportError(W)}let et=new Map,Mt=new Map;a.forEach(W=>{let Q=W.element;n.has(Q)&&(Mt.set(Q,Q),this._beforeAnimationBuild(W.player.namespaceId,W.instruction,et))}),o.forEach(W=>{let Q=W.element;this._getPreviousPlayers(Q,!1,W.namespaceId,W.triggerName,null).forEach(_e=>{Yt(et,Q,[]).push(_e),_e.destroy()})});let qn=Ce.filter(W=>cu(W,u,p)),fi=new Map;su(fi,this.driver,Ze,p,ln).forEach(W=>{cu(W,u,p)&&qn.push(W)});let gn=new Map;P.forEach((W,Q)=>{su(gn,this.driver,new Set(W),u,jo)}),qn.forEach(W=>{let Q=fi.get(W),Z=gn.get(W);fi.set(W,new Map([...Q?.entries()??[],...Z?.entries()??[]]))});let zi=[],wo=[],Aa={};a.forEach(W=>{let{element:Q,player:Z,instruction:_e}=W;if(n.has(Q)){if(b.has(Q)){Z.onDestroy(()=>vn(Q,_e.toStyles)),Z.disabled=!0,Z.overrideTotalTime(_e.totalTime),o.push(Z);return}let at=Aa;if(Mt.size>1){let Et=Q,Fe=[];for(;Et=Et.parentNode;){let Ne=Mt.get(Et);if(Ne){at=Ne;break}Fe.push(Et)}Fe.forEach(Ne=>Mt.set(Ne,at))}let Ee=this._buildAnimation(Z.namespaceId,_e,et,r,gn,fi);if(Z.setRealPlayer(Ee),at===Aa)zi.push(Z);else{let Et=this.playersByElement.get(at);Et&&Et.length&&(Z.parentPlayer=Jn(Et)),o.push(Z)}}else Pi(Q,_e.fromStyles),Z.onDestroy(()=>vn(Q,_e.toStyles)),wo.push(Z),b.has(Q)&&o.push(Z)}),wo.forEach(W=>{let Q=r.get(W.element);if(Q&&Q.length){let Z=Jn(Q);W.setRealPlayer(Z)}}),o.forEach(W=>{W.parentPlayer?W.syncPlayerEvents(W.parentPlayer):W.destroy()});for(let W=0;W<Ce.length;W++){let Q=Ce[W],Z=Q[yn];if(Ho(Q,ds),Z&&Z.hasAnimation)continue;let _e=[];if(c.size){let Ee=c.get(Q);Ee&&Ee.length&&_e.push(...Ee);let Et=this.driver.query(Q,ms,!0);for(let Fe=0;Fe<Et.length;Fe++){let Ne=c.get(Et[Fe]);Ne&&Ne.length&&_e.push(...Ne)}}let at=_e.filter(Ee=>!Ee.destroyed);at.length?b_(this,Q,at):this.processLeaveNode(Q)}return Ce.length=0,zi.forEach(W=>{this.players.push(W),W.onDone(()=>{W.destroy();let Q=this.players.indexOf(W);this.players.splice(Q,1)}),W.play()}),zi}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,n,o,r){let a=[];if(e){let c=this.playersByQueriedElement.get(t);c&&(a=c)}else{let c=this.playersByElement.get(t);if(c){let u=!r||r==Wr;c.forEach(p=>{p.queued||!u&&p.triggerName!=o||a.push(p)})}}return(n||o)&&(a=a.filter(c=>!(n&&n!=c.namespaceId||o&&o!=c.triggerName))),a}_beforeAnimationBuild(t,e,n){let o=e.triggerName,r=e.element,a=e.isRemovalTransition?void 0:t,c=e.isRemovalTransition?void 0:o;for(let u of e.timelines){let p=u.element,b=p!==r,C=Yt(n,p,[]);this._getPreviousPlayers(p,b,a,c,e.toState).forEach(P=>{let k=P.getRealPlayer();k.beforeDestroy&&k.beforeDestroy(),P.destroy(),C.push(P)})}Pi(r,e.fromStyles)}_buildAnimation(t,e,n,o,r,a){let c=e.triggerName,u=e.element,p=[],b=new Set,C=new Set,T=e.timelines.map(k=>{let j=k.element;b.add(j);let Ce=j[yn];if(Ce&&Ce.removedBeforeQueried)return new Fn(k.duration,k.delay);let ze=j!==u,Ze=v_((n.get(j)||u_).map(et=>et.getRealPlayer())).filter(et=>{let Mt=et;return Mt.element?Mt.element===j:!1}),Je=r.get(j),fe=a.get(j),Ut=Tc(this._normalizer,k.keyframes,Je,fe),_t=this._buildPlayer(k,Ut,Ze);if(k.subTimeline&&o&&C.add(j),ze){let et=new qr(t,c,j);et.setRealPlayer(_t),p.push(et)}return _t});p.forEach(k=>{Yt(this.playersByQueriedElement,k.element,[]).push(k),k.onDone(()=>g_(this.playersByQueriedElement,k.element,k))}),b.forEach(k=>cn(k,Rc));let P=Jn(T);return P.onDestroy(()=>{b.forEach(k=>Ho(k,Rc)),vn(u,e.toStyles)}),C.forEach(k=>{Yt(o,k,[]).push(P)}),P}_buildPlayer(t,e,n){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,n):new Fn(t.duration,t.delay)}},qr=class{namespaceId;triggerName;element;_player=new Fn;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(t,e,n){this.namespaceId=t,this.triggerName=e,this.element=n}setRealPlayer(t){this._containsRealPlayer||(this._player=t,this._queuedCallbacks.forEach((e,n)=>{e.forEach(o=>ss(t,n,void 0,o))}),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){Yt(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 g_(i,t,e){let n=i.get(t);if(n){if(n.length){let o=n.indexOf(e);n.splice(o,1)}n.length==0&&i.delete(t)}return n}function f_(i){return i??null}function fs(i){return i&&i.nodeType===1}function __(i){return i=="start"||i=="done"}function au(i,t){let e=i.style.display;return i.style.display=t??"none",e}function su(i,t,e,n,o){let r=[];e.forEach(u=>r.push(au(u)));let a=[];n.forEach((u,p)=>{let b=new Map;u.forEach(C=>{let T=t.computeStyle(p,C,o);b.set(C,T),(!T||T.length==0)&&(p[yn]=p_,a.push(p))}),i.set(p,b)});let c=0;return e.forEach(u=>au(u,r[c++])),a}function lu(i,t){let e=new Map;if(i.forEach(c=>e.set(c,[])),t.length==0)return e;let n=1,o=new Set(t),r=new Map;function a(c){if(!c)return n;let u=r.get(c);if(u)return u;let p=c.parentNode;return e.has(p)?u=p:o.has(p)?u=n:u=a(p),r.set(c,u),u}return t.forEach(c=>{let u=a(c);u!==n&&e.get(u).push(c)}),e}function cn(i,t){i.classList?.add(t)}function Ho(i,t){i.classList?.remove(t)}function b_(i,t,e){Jn(e).onDone(()=>i.processLeaveNode(t))}function v_(i){let t=[];return gu(i,t),t}function gu(i,t){for(let e=0;e<i.length;e++){let n=i[e];n instanceof Qi?gu(n.players,t):t.push(n)}}function y_(i,t){let e=Object.keys(i),n=Object.keys(t);if(e.length!=n.length)return!1;for(let o=0;o<e.length;o++){let r=e[o];if(!t.hasOwnProperty(r)||i[r]!==t[r])return!1}return!0}function cu(i,t,e){let n=e.get(i);if(!n)return!1;let o=t.get(i);return o?n.forEach(r=>o.add(r)):t.set(i,n),e.delete(i),!0}var Wo=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(t,e)=>{};constructor(t,e,n){this._driver=e,this._normalizer=n,this._transitionEngine=new Xc(t.body,e,n),this._timelineEngine=new Yc(t.body,e,n),this._transitionEngine.onRemovalComplete=(o,r)=>this.onRemovalComplete(o,r)}registerTrigger(t,e,n,o,r){let a=t+"-"+o,c=this._triggerCache[a];if(!c){let u=[],p=[],b=mu(this._driver,r,u,p);if(u.length)throw Lh(o,u);c=a_(o,b,this._normalizer),this._triggerCache[a]=c}this._transitionEngine.registerTrigger(e,o,c)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,n,o){this._transitionEngine.insertNode(t,e,n,o)}onRemove(t,e,n){this._transitionEngine.removeNode(t,e,n)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,n,o){if(n.charAt(0)=="@"){let[r,a]=Pc(n),c=o;this._timelineEngine.command(r,e,a,c)}else this._transitionEngine.trigger(t,e,n,o)}listen(t,e,n,o,r){if(n.charAt(0)=="@"){let[a,c]=Pc(n);return this._timelineEngine.listen(a,e,c,r)}return this._transitionEngine.listen(t,e,n,o,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 C_(i,t){let e=null,n=null;return Array.isArray(t)&&t.length?(e=zc(t[0]),t.length>1&&(n=zc(t[t.length-1]))):t instanceof Map&&(e=zc(t)),e||n?new x_(i,e,n):null}var x_=(()=>{class i{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,n,o){this._element=e,this._startStyles=n,this._endStyles=o;let r=i.initialStylesByElement.get(e);r||i.initialStylesByElement.set(e,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&vn(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(vn(this._element,this._initialStyles),this._endStyles&&(vn(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(i.initialStylesByElement.delete(this._element),this._startStyles&&(Pi(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Pi(this._element,this._endStyles),this._endStyles=null),vn(this._element,this._initialStyles),this._state=3)}}return i})();function zc(i){let t=null;return i.forEach((e,n)=>{w_(n)&&(t=t||new Map,t.set(n,e))}),t}function w_(i){return i==="display"||i==="position"}var ws=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,n,o){this.element=t,this.keyframes=e,this.options=n,this._specialStyles=o,this._duration=n.duration,this._delay=n.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(n=>{e.push(Object.fromEntries(n))}),e}_triggerWebAnimation(t,e,n){return t.animate(this._convertKeyframesToObject(e),n)}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((n,o)=>{o!=="offset"&&t.set(o,this._finished?n:us(this.element,o))}),this.currentSnapshot=t}triggerCallback(t){let e=t==="start"?this._onStartFns:this._onDoneFns;e.forEach(n=>n()),e.length=0}},Ss=class{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}containsElement(t,e){return Oc(t,e)}getParentElement(t){return cs(t)}query(t,e,n){return Ac(t,e,n)}computeStyle(t,e,n){return us(t,e)}animate(t,e,n,o,r,a=[]){let c=o==0?"both":"forwards",u={duration:n,delay:o,fill:c};r&&(u.easing=r);let p=new Map,b=a.filter(P=>P instanceof ws);Zh(n,o)&&b.forEach(P=>{P.currentSnapshot.forEach((k,j)=>p.set(j,k))});let C=Xh(e).map(P=>new Map(P));C=Jh(t,C,p);let T=C_(t,C);return new ws(t,C,u,T)}};var _s="@",fu="@.disabled",ks=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(t,e,n,o){this.namespaceId=t,this.delegate=e,this.engine=n,this._onDestroy=o}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,n,o=!0){this.delegate.insertBefore(t,e,n),this.engine.onInsert(this.namespaceId,e,t,o)}removeChild(t,e,n,o){if(o){this.delegate.removeChild(t,e,n);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,n,o){this.delegate.setAttribute(t,e,n,o)}removeAttribute(t,e,n){this.delegate.removeAttribute(t,e,n)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,n,o){this.delegate.setStyle(t,e,n,o)}removeStyle(t,e,n){this.delegate.removeStyle(t,e,n)}setProperty(t,e,n){e.charAt(0)==_s&&e==fu?this.disableAnimations(t,!!n):this.delegate.setProperty(t,e,n)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,n,o){return this.delegate.listen(t,e,n,o)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}},Kc=class extends ks{factory;constructor(t,e,n,o,r){super(e,n,o,r),this.factory=t,this.namespaceId=e}setProperty(t,e,n){e.charAt(0)==_s?e.charAt(1)=="."&&e==fu?(n=n===void 0?!0:!!n,this.disableAnimations(t,n)):this.engine.process(this.namespaceId,t,e.slice(1),n):this.delegate.setProperty(t,e,n)}listen(t,e,n,o){if(e.charAt(0)==_s){let r=S_(t),a=e.slice(1),c="";return a.charAt(0)!=_s&&([a,c]=k_(a)),this.engine.listen(this.namespaceId,r,a,c,u=>{let p=u._data||-1;this.factory.scheduleListenerCallback(p,n,u)})}return this.delegate.listen(t,e,n,o)}};function S_(i){switch(i){case"body":return document.body;case"document":return document;case"window":return window;default:return i}}function k_(i){let t=i.indexOf("."),e=i.substring(0,t),n=i.slice(t+1);return[e,n]}var Ms=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(t,e,n){this.delegate=t,this.engine=e,this._zone=n,e.onRemovalComplete=(o,r)=>{r?.removeChild(null,o)}}createRenderer(t,e){let o=this.delegate.createRenderer(t,e);if(!t||!e?.data?.animation){let p=this._rendererCache,b=p.get(o);if(!b){let C=()=>p.delete(o);b=new ks("",o,this.engine,C),p.set(o,b)}return b}let r=e.id,a=e.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);let c=p=>{Array.isArray(p)?p.forEach(c):this.engine.registerTrigger(r,a,t,p.name,p)};return e.data.animation.forEach(c),new Kc(this,a,o,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,n){if(t>=0&&t<this._microtaskId){this._zone.run(()=>e(n));return}let o=this._animationCallbacksBuffer;o.length==0&&queueMicrotask(()=>{this._zone.run(()=>{o.forEach(r=>{let[a,c]=r;a(c)}),this._animationCallbacksBuffer=[]})}),o.push([e,n])}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 E_=(()=>{class i extends Wo{constructor(e,n,o){super(e,n,o)}ngOnDestroy(){this.flush()}static \u0275fac=function(n){return new(n||i)(za(lt),za(Zi),za(Ji))};static \u0275prov=D({token:i,factory:i.\u0275fac})}return i})();function T_(){return new bs}function P_(i,t,e){return new Ms(i,t,e)}var _u=[{provide:Ji,useFactory:T_},{provide:Wo,useClass:E_},{provide:fn,useFactory:P_,deps:[sh,Wo,ue]}],YS=[{provide:Zi,useClass:Zc},{provide:Dr,useValue:"NoopAnimations"},..._u],O_=[{provide:Zi,useFactory:()=>new Ss},{provide:Dr,useFactory:()=>"BrowserAnimations"},..._u];function bu(){return qm("NgEagerAnimations"),[...O_]}var Gr=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}},ei=class extends Gr{component;viewContainerRef;injector;projectableNodes;constructor(t,e,n,o){super(),this.component=t,this.viewContainerRef=e,this.injector=n,this.projectableNodes=o}},ti=class extends Gr{templateRef;viewContainerRef;context;injector;constructor(t,e,n,o){super(),this.templateRef=t,this.viewContainerRef=e,this.context=n,this.injector=o}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()}},ed=class extends Gr{element;constructor(t){super(),this.element=t instanceof ne?t.nativeElement:t}},Oi=class{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(t){if(t instanceof ei)return this._attachedPortal=t,this.attachComponentPortal(t);if(t instanceof ti)return this._attachedPortal=t,this.attachTemplatePortal(t);if(this.attachDomPortal&&t instanceof ed)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 Oi{outletElement;_appRef;_defaultInjector;constructor(t,e,n){super(),this.outletElement=t,this._appRef=e,this._defaultInjector=n}attachComponentPortal(t){let e;if(t.viewContainerRef){let n=t.injector||t.viewContainerRef.injector,o=n.get(gc,null,{optional:!0})||void 0;e=t.viewContainerRef.createComponent(t.component,{index:t.viewContainerRef.length,injector:n,ngModuleRef:o,projectableNodes:t.projectableNodes||void 0}),this.setDisposeFn(()=>e.destroy())}else{let n=this._appRef,o=t.injector||this._defaultInjector||ve.NULL,r=o.get(Ba,n.injector);e=ih(t.component,{elementInjector:o,environmentInjector:r,projectableNodes:t.projectableNodes||void 0}),n.attachView(e.hostView),this.setDisposeFn(()=>{n.viewCount>0&&n.detachView(e.hostView),e.destroy()})}return this.outletElement.appendChild(this._getComponentRootNode(e)),this._attachedPortal=t,e}attachTemplatePortal(t){let e=t.viewContainerRef,n=e.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return n.rootNodes.forEach(o=>this.outletElement.appendChild(o)),n.detectChanges(),this.setDisposeFn(()=>{let o=e.indexOf(n);o!==-1&&e.remove(o)}),this._attachedPortal=t,n}attachDomPortal=t=>{let e=t.element;e.parentNode;let n=this.outletElement.ownerDocument.createComment("dom-portal");e.parentNode.insertBefore(n,e),this.outletElement.appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(e,n)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(t){return t.hostView.rootNodes[0]}};var Ai=(()=>{class i extends Oi{_moduleRef=d(gc,{optional:!0});_document=d(lt);_viewContainerRef=d(Ir);_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 n=e.viewContainerRef!=null?e.viewContainerRef:this._viewContainerRef,o=n.createComponent(e.component,{index:n.length,injector:e.injector||n.injector,projectableNodes:e.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return n!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=e,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(e){e.setAttachedHost(this);let n=this._viewContainerRef.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=e,this._attachedRef=n,this.attached.emit(n),n}attachDomPortal=e=>{let n=e.element;n.parentNode;let o=this._document.createComment("dom-portal");e.setAttachedHost(this),n.parentNode.insertBefore(o,n),this._getRootNode().appendChild(n),this._attachedPortal=e,super.setDisposeFn(()=>{o.parentNode&&o.parentNode.replaceChild(n,o)})};_getRootNode(){let e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ye]})}return i})();var ni=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({})}return i})();var A_=20,Uo=(()=>{class i{_ngZone=d(ue);_platform=d(ct);_renderer=d(fn).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new F;_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 n=this.scrollContainers.get(e);n&&(n.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=A_){return this._platform.isBrowser?new rn(n=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let o=e>0?this._scrolled.pipe(uc(e)).subscribe(n):this._scrolled.subscribe(n);return this._scrolledCount++,()=>{o.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):wt()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,n)=>this.deregister(n)),this._scrolled.complete()}ancestorScrolled(e,n){let o=this.getAncestorScrollContainers(e);return this.scrolled(n).pipe(he(r=>!r||o.indexOf(r)>-1))}getAncestorScrollContainers(e){let n=[];return this.scrollContainers.forEach((o,r)=>{this._scrollableContainsElement(r,e)&&n.push(r)}),n}_scrollableContainsElement(e,n){let o=Lr(n),r=e.getElementRef().nativeElement;do if(o==r)return!0;while(o=o.parentElement);return!1}static \u0275fac=function(n){return new(n||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Di=(()=>{class i{elementRef=d(ne);scrollDispatcher=d(Uo);ngZone=d(ue);dir=d(Ot,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new F;_renderer=d(nt);_cleanupScroll;_elementScrolled=new F;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 n=this.elementRef.nativeElement,o=this.dir&&this.dir.value=="rtl";e.left==null&&(e.left=o?e.end:e.start),e.right==null&&(e.right=o?e.start:e.end),e.bottom!=null&&(e.top=n.scrollHeight-n.clientHeight-e.bottom),o&&Lo()!=Vo.NORMAL?(e.left!=null&&(e.right=n.scrollWidth-n.clientWidth-e.left),Lo()==Vo.INVERTED?e.left=e.right:Lo()==Vo.NEGATED&&(e.left=e.right?-e.right:e.right)):e.right!=null&&(e.left=n.scrollWidth-n.clientWidth-e.right),this._applyScrollToOptions(e)}_applyScrollToOptions(e){let n=this.elementRef.nativeElement;ns()?n.scrollTo(e):(e.top!=null&&(n.scrollTop=e.top),e.left!=null&&(n.scrollLeft=e.left))}measureScrollOffset(e){let n="left",o="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?o:n:e=="end"&&(e=a?n:o),a&&Lo()==Vo.INVERTED?e==n?r.scrollWidth-r.clientWidth-r.scrollLeft:r.scrollLeft:a&&Lo()==Vo.NEGATED?e==n?r.scrollLeft+r.scrollWidth-r.clientWidth:-r.scrollLeft:e==n?r.scrollLeft:r.scrollWidth-r.clientWidth-r.scrollLeft}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return i})(),D_=20,ii=(()=>{class i{_platform=d(ct);_listeners;_viewportSize;_change=new F;_document=d(lt);constructor(){let e=d(ue),n=d(fn).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let o=r=>this._change.next(r);this._listeners=[n.listen("window","resize",o),n.listen("window","orientationchange",o)]}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:n,height:o}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+o,right:e.left+n,height:o,width:n}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,n=this._getWindow(),o=e.documentElement,r=o.getBoundingClientRect(),a=-r.top||e.body.scrollTop||n.scrollY||o.scrollTop||0,c=-r.left||e.body.scrollLeft||n.scrollX||o.scrollLeft||0;return{top:a,left:c}}change(e=D_){return e>0?this._change.pipe(uc(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(n){return new(n||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var eo=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({})}return i})(),td=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({imports:[jr,eo,jr,eo]})}return i})();var vu=ns();function Go(i){return new Ts(i.get(ii),i.get(lt))}var Ts=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=dt(-this._previousScrollPosition.left),t.style.top=dt(-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,n=t.style,o=e.style,r=n.scrollBehavior||"",a=o.scrollBehavior||"";this._isEnabled=!1,n.left=this._previousHTMLStyles.left,n.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),vu&&(n.scrollBehavior=o.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),vu&&(n.scrollBehavior=r,o.scrollBehavior=a)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let e=this._document.documentElement,n=this._viewportRuler.getViewportSize();return e.scrollHeight>n.height||e.scrollWidth>n.width}};function Mu(i,t){return new Ps(i.get(Uo),i.get(ue),i.get(ii),t)}var Ps=class{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(t,e,n,o){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=n,this._config=o}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(this._scrollSubscription)return;let t=this._scrollDispatcher.scrolled(0).pipe(he(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 Yr=class{enable(){}disable(){}attach(){}};function nd(i,t){return t.some(e=>{let n=i.bottom<e.top,o=i.top>e.bottom,r=i.right<e.left,a=i.left>e.right;return n||o||r||a})}function yu(i,t){return t.some(e=>{let n=i.top<e.top,o=i.bottom>e.bottom,r=i.left<e.left,a=i.right>e.right;return n||o||r||a})}function io(i,t){return new Os(i.get(Uo),i.get(ii),i.get(ue),t)}var Os=class{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(t,e,n,o){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=n,this._config=o}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:n,height:o}=this._viewportRuler.getViewportSize();nd(e,[{width:n,height:o,bottom:o,right:n,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}},Eu=(()=>{class i{_injector=d(ve);constructor(){}noop=()=>new Yr;close=e=>Mu(this._injector,e);block=()=>Go(this._injector);reposition=e=>io(this._injector,e);static \u0275fac=function(n){return new(n||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),oi=class{positionStrategy;scrollStrategy=new Yr;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 n of e)t[n]!==void 0&&(this[n]=t[n])}}};var As=class{connectionPair;scrollableViewProperties;constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}};var Tu=(()=>{class i{_attachedOverlays=[];_document=d(lt);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(e){this.remove(e),this._attachedOverlays.push(e)}remove(e){let n=this._attachedOverlays.indexOf(e);n>-1&&this._attachedOverlays.splice(n,1),this._attachedOverlays.length===0&&this.detach()}static \u0275fac=function(n){return new(n||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Pu=(()=>{class i extends Tu{_ngZone=d(ue);_renderer=d(fn).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 n=this._attachedOverlays;for(let o=n.length-1;o>-1;o--)if(n[o]._keydownEvents.observers.length>0){this._ngZone.run(()=>n[o]._keydownEvents.next(e));break}};static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Ou=(()=>{class i extends Tu{_platform=d(ct);_ngZone=d(ue);_renderer=d(fn).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(e){if(super.add(e),!this._isAttached){let n=this._document.body,o={capture:!0},r=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[r.listen(n,"pointerdown",this._pointerDownListener,o),r.listen(n,"click",this._clickListener,o),r.listen(n,"auxclick",this._clickListener,o),r.listen(n,"contextmenu",this._clickListener,o)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=n.style.cursor,n.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=Ka(e)};_clickListener=e=>{let n=Ka(e),o=e.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:n;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(Cu(c.overlayElement,n)||Cu(c.overlayElement,o))break;let u=c._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>u.next(e)):u.next(e)}};static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function Cu(i,t){let e=typeof ShadowRoot<"u"&&ShadowRoot,n=t;for(;n;){if(n===i)return!0;n=e&&n instanceof ShadowRoot?n.host:n.parentNode}return!1}var Au=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(n,o){},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 i})(),Rs=(()=>{class i{_platform=d(ct);_containerElement;_document=d(lt);_styleLoader=d(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||Cc()){let o=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let r=0;r<o.length;r++)o[r].remove()}let n=this._document.createElement("div");n.classList.add(e),Cc()?n.setAttribute("platform","test"):this._platform.isBrowser||n.setAttribute("platform","server"),this._document.body.appendChild(n),this._containerElement=n}_loadStyles(){this._styleLoader.load(Au)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),id=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(t,e,n,o){this._renderer=e,this._ngZone=n,this.element=t.createElement("div"),this.element.classList.add("cdk-overlay-backdrop"),this._cleanupClick=e.listen(this.element,"click",o)}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()}},$o=class{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new F;_attachments=new F;_detachments=new F;_positionStrategy;_scrollStrategy;_locationChanges=On.EMPTY;_backdropRef=null;_detachContentMutationObserver;_detachContentAfterRenderRef;_previousHostParent;_keydownEvents=new F;_outsidePointerEvents=new F;_afterNextRenderRef;constructor(t,e,n,o,r,a,c,u,p,b=!1,C,T){this._portalOutlet=t,this._host=e,this._pane=n,this._config=o,this._ngZone=r,this._keyboardDispatcher=a,this._document=c,this._location=u,this._outsideClickDispatcher=p,this._animationsDisabled=b,this._injector=C,this._renderer=T,o.scrollStrategy&&(this._scrollStrategy=o.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=o.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=Gt(()=>{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=Y(Y({},this._config),t),this._updateElementSize()}setDirection(t){this._config=Ie(Y({},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=dt(this._config.width),t.height=dt(this._config.height),t.minWidth=dt(this._config.minWidth),t.minHeight=dt(this._config.minHeight),t.maxWidth=dt(this._config.maxWidth),t.maxHeight=dt(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){let t="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new id(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,n){let o=vc(e||[]).filter(r=>!!r);o.length&&(n?t.classList.add(...o):t.classList.remove(...o))}_detachContentWhenEmpty(){let t=!1;try{this._detachContentAfterRenderRef=Gt(()=>{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?.()}},xu="cdk-overlay-connected-position-bounding-box",R_=/([A-Za-z%]+)$/;function od(i,t){return new Ds(t,i.get(ii),i.get(lt),i.get(ct),i.get(Rs))}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 F;_resizeSubscription=On.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount;positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(t,e,n,o,r){this._viewportRuler=e,this._document=n,this._platform=o,this._overlayContainer=r,this.setOrigin(t)}attach(t){this._overlayRef&&this._overlayRef,this._validatePositions(),t.hostElement.classList.add(xu),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,n=this._viewportRect,o=this._containerRect,r=[],a;for(let c of this._preferredPositions){let u=this._getOriginPoint(t,o,c),p=this._getOverlayPoint(u,e,c),b=this._getOverlayFit(p,e,n,c);if(b.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(c,u);return}if(this._canFitWithFlexibleDimensions(b,p,n)){r.push({position:c,origin:u,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(u,c)});continue}(!a||a.overlayFit.visibleArea<b.visibleArea)&&(a={overlayFit:b,overlayPoint:p,originPoint:u,position:c,overlayRect:e})}if(r.length){let c=null,u=-1;for(let p of r){let b=p.boundingBoxRect.width*p.boundingBoxRect.height*(p.position.weight||1);b>u&&(u=b,c=p)}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&&to(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(xu),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,n){let o;if(n.originX=="center")o=t.left+t.width/2;else{let a=this._isRtl()?t.right:t.left,c=this._isRtl()?t.left:t.right;o=n.originX=="start"?a:c}e.left<0&&(o-=e.left);let r;return n.originY=="center"?r=t.top+t.height/2:r=n.originY=="top"?t.top:t.bottom,e.top<0&&(r-=e.top),{x:o,y:r}}_getOverlayPoint(t,e,n){let o;n.overlayX=="center"?o=-e.width/2:n.overlayX==="start"?o=this._isRtl()?-e.width:0:o=this._isRtl()?0:-e.width;let r;return n.overlayY=="center"?r=-e.height/2:r=n.overlayY=="top"?0:-e.height,{x:t.x+o,y:t.y+r}}_getOverlayFit(t,e,n,o){let r=Su(e),{x:a,y:c}=t,u=this._getOffset(o,"x"),p=this._getOffset(o,"y");u&&(a+=u),p&&(c+=p);let b=0-a,C=a+r.width-n.width,T=0-c,P=c+r.height-n.height,k=this._subtractOverflows(r.width,b,C),j=this._subtractOverflows(r.height,T,P),Ce=k*j;return{visibleArea:Ce,isCompletelyWithinViewport:r.width*r.height===Ce,fitsInViewportVertically:j===r.height,fitsInViewportHorizontally:k==r.width}}_canFitWithFlexibleDimensions(t,e,n){if(this._hasFlexibleDimensions){let o=n.bottom-e.y,r=n.right-e.x,a=wu(this._overlayRef.getConfig().minHeight),c=wu(this._overlayRef.getConfig().minWidth),u=t.fitsInViewportVertically||a!=null&&a<=o,p=t.fitsInViewportHorizontally||c!=null&&c<=r;return u&&p}return!1}_pushOverlayOnScreen(t,e,n){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};let o=Su(e),r=this._viewportRect,a=Math.max(t.x+o.width-r.width,0),c=Math.max(t.y+o.height-r.height,0),u=Math.max(r.top-n.top-t.y,0),p=Math.max(r.left-n.left-t.x,0),b=0,C=0;return o.width<=r.width?b=p||-a:b=t.x<this._viewportMargin?r.left-n.left-t.x:0,o.height<=r.height?C=u||-c:C=t.y<this._viewportMargin?r.top-n.top-t.y:0,this._previousPushAmount={x:b,y:C},{x:t.x+b,y:t.y+C}}_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 n=this._getScrollVisibility();if(t!==this._lastPosition||!this._lastScrollVisibility||!F_(this._lastScrollVisibility,n)){let o=new As(t,n);this._positionChanges.next(o)}this._lastScrollVisibility=n}this._lastPosition=t,this._isInitialRender=!1}_setTransformOrigin(t){if(!this._transformOriginSelector)return;let e=this._boundingBox.querySelectorAll(this._transformOriginSelector),n,o=t.overlayY;t.overlayX==="center"?n="center":this._isRtl()?n=t.overlayX==="start"?"right":"left":n=t.overlayX==="start"?"left":"right";for(let r=0;r<e.length;r++)e[r].style.transformOrigin=`${n} ${o}`}_calculateBoundingBoxRect(t,e){let n=this._viewportRect,o=this._isRtl(),r,a,c;if(e.overlayY==="top")a=t.y,r=n.height-a+this._viewportMargin;else if(e.overlayY==="bottom")c=n.height-t.y+this._viewportMargin*2,r=n.height-c+this._viewportMargin;else{let P=Math.min(n.bottom-t.y+n.top,t.y),k=this._lastBoundingBoxSize.height;r=P*2,a=t.y-P,r>k&&!this._isInitialRender&&!this._growAfterOpen&&(a=t.y-k/2)}let u=e.overlayX==="start"&&!o||e.overlayX==="end"&&o,p=e.overlayX==="end"&&!o||e.overlayX==="start"&&o,b,C,T;if(p)T=n.width-t.x+this._viewportMargin*2,b=t.x-this._viewportMargin;else if(u)C=t.x,b=n.right-t.x;else{let P=Math.min(n.right-t.x+n.left,t.x),k=this._lastBoundingBoxSize.width;b=P*2,C=t.x-P,b>k&&!this._isInitialRender&&!this._growAfterOpen&&(C=t.x-k/2)}return{top:a,left:C,bottom:c,right:T,width:b,height:r}}_setBoundingBoxStyles(t,e){let n=this._calculateBoundingBoxRect(t,e);!this._isInitialRender&&!this._growAfterOpen&&(n.height=Math.min(n.height,this._lastBoundingBoxSize.height),n.width=Math.min(n.width,this._lastBoundingBoxSize.width));let o={};if(this._hasExactPosition())o.top=o.left="0",o.bottom=o.right=o.maxHeight=o.maxWidth="",o.width=o.height="100%";else{let r=this._overlayRef.getConfig().maxHeight,a=this._overlayRef.getConfig().maxWidth;o.height=dt(n.height),o.top=dt(n.top),o.bottom=dt(n.bottom),o.width=dt(n.width),o.left=dt(n.left),o.right=dt(n.right),e.overlayX==="center"?o.alignItems="center":o.alignItems=e.overlayX==="end"?"flex-end":"flex-start",e.overlayY==="center"?o.justifyContent="center":o.justifyContent=e.overlayY==="bottom"?"flex-end":"flex-start",r&&(o.maxHeight=dt(r)),a&&(o.maxWidth=dt(a))}this._lastBoundingBoxSize=n,to(this._boundingBox.style,o)}_resetBoundingBoxStyles(){to(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){to(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){let n={},o=this._hasExactPosition(),r=this._hasFlexibleDimensions,a=this._overlayRef.getConfig();if(o){let b=this._viewportRuler.getViewportScrollPosition();to(n,this._getExactOverlayY(e,t,b)),to(n,this._getExactOverlayX(e,t,b))}else n.position="static";let c="",u=this._getOffset(e,"x"),p=this._getOffset(e,"y");u&&(c+=`translateX(${u}px) `),p&&(c+=`translateY(${p}px)`),n.transform=c.trim(),a.maxHeight&&(o?n.maxHeight=dt(a.maxHeight):r&&(n.maxHeight="")),a.maxWidth&&(o?n.maxWidth=dt(a.maxWidth):r&&(n.maxWidth="")),to(this._pane.style,n)}_getExactOverlayY(t,e,n){let o={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,t);if(this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,n)),t.overlayY==="bottom"){let a=this._document.documentElement.clientHeight;o.bottom=`${a-(r.y+this._overlayRect.height)}px`}else o.top=dt(r.y);return o}_getExactOverlayX(t,e,n){let o={left:"",right:""},r=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,n));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;o.right=`${c-(r.x+this._overlayRect.width)}px`}else o.left=dt(r.x);return o}_getScrollVisibility(){let t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),n=this._scrollables.map(o=>o.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:yu(t,n),isOriginOutsideView:nd(t,n),isOverlayClipped:yu(e,n),isOverlayOutsideView:nd(e,n)}}_subtractOverflows(t,...e){return e.reduce((n,o)=>n-Math.max(o,0),t)}_getNarrowedViewportRect(){let t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,n=this._viewportRuler.getViewportScrollPosition();return{top:n.top+this._viewportMargin,left:n.left+this._viewportMargin,right:n.left+t-this._viewportMargin,bottom:n.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&&vc(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,n=t.height||0;return{top:t.y,bottom:t.y+n,left:t.x,right:t.x+e,height:n,width:e}}};function to(i,t){for(let e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);return i}function wu(i){if(typeof i!="number"&&i!=null){let[t,e]=i.split(R_);return!e||e==="px"?parseFloat(t):null}return i||null}function Su(i){return{top:Math.floor(i.top),right:Math.floor(i.right),bottom:Math.floor(i.bottom),left:Math.floor(i.left),width:Math.floor(i.width),height:Math.floor(i.height)}}function F_(i,t){return i===t?!0:i.isOriginClipped===t.isOriginClipped&&i.isOriginOutsideView===t.isOriginOutsideView&&i.isOverlayClipped===t.isOverlayClipped&&i.isOverlayOutsideView===t.isOverlayOutsideView}var ku="cdk-global-overlay-wrapper";function Ii(i){return new Is}var Is=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(ku),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,n=this._overlayRef.getConfig(),{width:o,height:r,maxWidth:a,maxHeight:c}=n,u=(o==="100%"||o==="100vw")&&(!a||a==="100%"||a==="100vw"),p=(r==="100%"||r==="100vh")&&(!c||c==="100%"||c==="100vh"),b=this._xPosition,C=this._xOffset,T=this._overlayRef.getConfig().direction==="rtl",P="",k="",j="";u?j="flex-start":b==="center"?(j="center",T?k=C:P=C):T?b==="left"||b==="end"?(j="flex-end",P=C):(b==="right"||b==="start")&&(j="flex-start",k=C):b==="left"||b==="start"?(j="flex-start",P=C):(b==="right"||b==="end")&&(j="flex-end",k=C),t.position=this._cssPosition,t.marginLeft=u?"0":P,t.marginTop=p?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=u?"0":k,e.justifyContent=j,e.alignItems=p?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,n=e.style;e.classList.remove(ku),n.justifyContent=n.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}},Du=(()=>{class i{_injector=d(ve);constructor(){}global(){return Ii()}flexibleConnectedTo(e){return od(this._injector,e)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function oo(i,t){i.get(Nt).load(Au);let e=i.get(Rs),n=i.get(lt),o=i.get(Re),r=i.get(Rr),a=i.get(Ot),c=n.createElement("div"),u=n.createElement("div");u.id=o.getId("cdk-overlay-"),u.classList.add("cdk-overlay-pane"),c.appendChild(u),e.getContainerElement().appendChild(c);let p=new Es(u,r,i),b=new oi(t),C=i.get(nt,null,{optional:!0})||i.get(fn).createRenderer(null,null);return b.direction=b.direction||a.value,new $o(p,c,u,b,i.get(ue),i.get(Pu),n,i.get(oh),i.get(Ou),t?.disableAnimations??i.get(Dr,null,{optional:!0})==="NoopAnimations",i.get(Ba),C)}var Iu=(()=>{class i{scrollStrategies=d(Eu);_positionBuilder=d(Du);_injector=d(ve);constructor(){}create(e){return oo(this._injector,e)}position(){return this._positionBuilder}static \u0275fac=function(n){return new(n||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),N_=[{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"}],Ru=new te("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let i=d(ve);return()=>io(i)}}),qo=(()=>{class i{elementRef=d(ne);constructor(){}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]})}return i})(),Fs=(()=>{class i{_dir=d(Ot,{optional:!0});_injector=d(ve);_overlayRef;_templatePortal;_backdropSubscription=On.EMPTY;_attachSubscription=On.EMPTY;_detachSubscription=On.EMPTY;_positionSubscription=On.EMPTY;_offsetX;_offsetY;_position;_scrollStrategyFactory=d(Ru);_disposeOnNavigation=!1;_ngZone=d(ue);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=d(vi),n=d(Ir);this._templatePortal=new ti(e,n),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=N_);let e=this._overlayRef=oo(this._injector,this._buildConfig());this._attachSubscription=e.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=e.detachments().subscribe(()=>this.detach.emit()),e.keydownEvents().subscribe(n=>{this.overlayKeydown.next(n),n.keyCode===27&&!this.disableClose&&!Pt(n)&&(n.preventDefault(),this.detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(n=>{let o=this._getOriginElement(),r=Ka(n);(!o||o!==r&&!o.contains(r))&&this.overlayOutsideClick.next(n)})}_buildConfig(){let e=this._position=this.positionStrategy||this._createPositionStrategy(),n=new oi({direction:this._dir||"ltr",positionStrategy:e,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop,disposeOnNavigation:this.disposeOnNavigation});return(this.width||this.width===0)&&(n.width=this.width),(this.height||this.height===0)&&(n.height=this.height),(this.minWidth||this.minWidth===0)&&(n.minWidth=this.minWidth),(this.minHeight||this.minHeight===0)&&(n.minHeight=this.minHeight),this.backdropClass&&(n.backdropClass=this.backdropClass),this.panelClass&&(n.panelClass=this.panelClass),n}_updatePositionStrategy(e){let n=this.positions.map(o=>({originX:o.originX,originY:o.originY,overlayX:o.overlayX,overlayY:o.overlayY,offsetX:o.offsetX||this.offsetX,offsetY:o.offsetY||this.offsetY,panelClass:o.panelClass||void 0}));return e.setOrigin(this._getOrigin()).withPositions(n).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){let e=od(this._injector,this._getOrigin());return this._updatePositionStrategy(e),e}_getOrigin(){return this.origin instanceof qo?this.origin.elementRef:this.origin}_getOriginElement(){return this.origin instanceof qo?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(Bm(()=>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(n){return new(n||i)};static \u0275dir=ee({type:i,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",K],lockPosition:[2,"cdkConnectedOverlayLockPosition","lockPosition",K],flexibleDimensions:[2,"cdkConnectedOverlayFlexibleDimensions","flexibleDimensions",K],growAfterOpen:[2,"cdkConnectedOverlayGrowAfterOpen","growAfterOpen",K],push:[2,"cdkConnectedOverlayPush","push",K],disposeOnNavigation:[2,"cdkConnectedOverlayDisposeOnNavigation","disposeOnNavigation",K]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[Ve]})}return i})();function V_(i){let t=d(ve);return()=>io(t)}var L_={provide:Ru,useFactory:V_},ri=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({providers:[Iu,L_],imports:[jr,ni,td,td]})}return i})();function j_(i,t){if(i&1){let e=E();s(0,"div",1)(1,"button",2),_("click",function(){v(e);let o=g();return y(o.action())}),h(2),l()()}if(i&2){let e=g();m(2),oe(" ",e.data.action," ")}}var z_=["label"];function B_(i,t){}var H_=Math.pow(2,31)-1,Qr=class{_overlayRef;instance;containerInstance;_afterDismissed=new F;_afterOpened=new F;_onAction=new F;_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,H_))}_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}},Fu=new te("MatSnackBarData"),Yo=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},W_=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return i})(),U_=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return i})(),$_=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return i})(),Nu=(()=>{class i{snackBarRef=d(Qr);data=d(Fu);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=M({type:i,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(n,o){n&1&&(s(0,"div",0),h(1),l(),w(2,j_,3,1,"div",1)),n&2&&(m(),oe(" ",o.data.message,`
|
|
3
|
+
`),m(),S(o.hasAction?2:-1))},dependencies:[At,W_,U_,$_],styles:[`.mat-mdc-simple-snack-bar{display:flex}.mat-mdc-simple-snack-bar .mat-mdc-snack-bar-label{max-height:50vh;overflow:auto}
|
|
4
|
+
`],encapsulation:2,changeDetection:0})}return i})(),rd="_mat-snack-bar-enter",ad="_mat-snack-bar-exit",q_=(()=>{class i extends Oi{_ngZone=d(ue);_elementRef=d(ne);_changeDetectorRef=d(He);_platform=d(ct);_animationsDisabled=ot();snackBarConfig=d(Yo);_document=d(lt);_trackedModals=new Set;_enterFallback;_exitFallback;_injector=d(ve);_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new F;_onExit=new F;_onEnter=new F;_animationState="void";_live;_label;_role;_liveElementId=d(Re).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 n=this._portalOutlet.attachComponentPortal(e);return this._afterPortalAttached(),n}attachTemplatePortal(e){this._assertNotAttached();let n=this._portalOutlet.attachTemplatePortal(e);return this._afterPortalAttached(),n}attachDomPortal=e=>{this._assertNotAttached();let n=this._portalOutlet.attachDomPortal(e);return this._afterPortalAttached(),n};onAnimationEnd(e){e===ad?this._completeExit():e===rd&&(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?Gt(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(rd)))},{injector:this._injector}):(clearTimeout(this._enterFallback),this._enterFallback=setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-snack-bar-fallback-visible"),this.onAnimationEnd(rd)},200)))}exit(){return this._destroyed?wt(void 0):(this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._animationsDisabled?Gt(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(ad)))},{injector:this._injector}):(clearTimeout(this._exitFallback),this._exitFallback=setTimeout(()=>this.onAnimationEnd(ad),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,n=this.snackBarConfig.panelClass;n&&(Array.isArray(n)?n.forEach(a=>e.classList.add(a)):e.classList.add(n)),this._exposeToModals();let o=this._label.nativeElement,r="mdc-snackbar__label";o.classList.toggle(r,!o.querySelector(`.${r}`))}_exposeToModals(){let e=this._liveElementId,n=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let o=0;o<n.length;o++){let r=n[o],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 n=e.getAttribute("aria-owns");if(n){let o=n.replace(this._liveElementId,"").trim();o.length>0?e.setAttribute("aria-owns",o):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,n=e.querySelector("[aria-hidden]"),o=e.querySelector("[aria-live]");if(n&&o){let r=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&n.contains(document.activeElement)&&(r=document.activeElement),n.removeAttribute("aria-hidden"),o.appendChild(n),r?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["mat-snack-bar-container"]],viewQuery:function(n,o){if(n&1&&(ie(Ai,7),ie(z_,7)),n&2){let r;U(r=$())&&(o._portalOutlet=r.first),U(r=$())&&(o._label=r.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:6,hostBindings:function(n,o){n&1&&_("animationend",function(a){return o.onAnimationEnd(a.animationName)})("animationcancel",function(a){return o.onAnimationEnd(a.animationName)}),n&2&&A("mat-snack-bar-container-enter",o._animationState==="visible")("mat-snack-bar-container-exit",o._animationState==="hidden")("mat-snack-bar-container-animations-enabled",!o._animationsDisabled)},features:[ye],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(n,o){n&1&&(s(0,"div",1)(1,"div",2,0)(3,"div",3),qe(4,B_,0,0,"ng-template",4),l(),I(5,"div"),l()()),n&2&&(m(5),G("aria-live",o._live)("role",o._role)("id",o._liveElementId))},dependencies:[Ai],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 i})();function G_(){return new Yo}var Y_=new te("mat-snack-bar-default-options",{providedIn:"root",factory:G_}),Xr=(()=>{class i{_live=d(es);_injector=d(ve);_breakpointObserver=d(uh);_parentSnackBar=d(i,{optional:!0,skipSelf:!0});_defaultConfig=d(Y_);_animationsDisabled=ot();_snackBarRefAtThisLevel=null;simpleSnackBarComponent=Nu;snackBarContainerComponent=q_;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,n){return this._attach(e,n)}openFromTemplate(e,n){return this._attach(e,n)}open(e,n="",o){let r=Y(Y({},this._defaultConfig),o);return r.data={message:e,action:n},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,n){let o=n&&n.viewContainerRef&&n.viewContainerRef.injector,r=ve.create({parent:o||this._injector,providers:[{provide:Yo,useValue:n}]}),a=new ei(this.snackBarContainerComponent,n.viewContainerRef,r),c=e.attach(a);return c.instance.snackBarConfig=n,c.instance}_attach(e,n){let o=Y(Y(Y({},new Yo),this._defaultConfig),n),r=this._createOverlay(o),a=this._attachSnackBarContainer(r,o),c=new Qr(a,r);if(e instanceof vi){let u=new ti(e,null,{$implicit:o.data,snackBarRef:c});c.instance=a.attachTemplatePortal(u)}else{let u=this._createInjector(o,c),p=new ei(e,void 0,u),b=a.attachComponentPortal(p);c.instance=b.instance}return this._breakpointObserver.observe(bh.HandsetPortrait).pipe(z(r.detachments())).subscribe(u=>{r.overlayElement.classList.toggle(this.handsetCssClass,u.matches)}),o.announcementMessage&&a._onAnnounce.subscribe(()=>{this._live.announce(o.announcementMessage,o.politeness)}),this._animateSnackBar(c,o),this._openedSnackBarRef=c,this._openedSnackBarRef}_animateSnackBar(e,n){e.afterDismissed().subscribe(()=>{this._openedSnackBarRef==e&&(this._openedSnackBarRef=null),n.announcementMessage&&this._live.clear()}),n.duration&&n.duration>0&&e.afterOpened().subscribe(()=>e._dismissAfter(n.duration)),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{e.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):e.containerInstance.enter()}_createOverlay(e){let n=new oi;n.direction=e.direction;let o=Ii(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?o.left("0"):c?o.right("0"):o.centerHorizontally(),e.verticalPosition==="top"?o.top("0"):o.bottom("0"),n.positionStrategy=o,n.disableAnimations=this._animationsDisabled,oo(this._injector,n)}_createInjector(e,n){let o=e&&e.viewContainerRef&&e.viewContainerRef.injector;return ve.create({parent:o||this._injector,providers:[{provide:Qr,useValue:n},{provide:Fu,useValue:e.data}]})}static \u0275fac=function(n){return new(n||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Qo=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({providers:[Xr],imports:[ri,ni,yt,ce,Nu,ce]})}return i})();function Q_(i,t){}var Ri=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 ld=(()=>{class i extends Oi{_elementRef=d(ne);_focusTrapFactory=d(Ja);_config;_interactivityChecker=d(No);_ngZone=d(ue);_focusMonitor=d(ki);_renderer=d(nt);_changeDetectorRef=d(He);_injector=d(ve);_platform=d(ct);_document=d(lt);_portalOutlet;_focusTrapped=new F;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=d(Ri,{optional:!0})||new Ri,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(e){this._ariaLabelledByQueue.push(e),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(e){let n=this._ariaLabelledByQueue.indexOf(e);n>-1&&(this._ariaLabelledByQueue.splice(n,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 n=this._portalOutlet.attachComponentPortal(e);return this._contentAttached(),n}attachTemplatePortal(e){this._portalOutlet.hasAttached();let n=this._portalOutlet.attachTemplatePortal(e);return this._contentAttached(),n}attachDomPortal=e=>{this._portalOutlet.hasAttached();let n=this._portalOutlet.attachDomPortal(e);return this._contentAttached(),n};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(e,n){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let o=()=>{r(),a(),e.removeAttribute("tabindex")},r=this._renderer.listen(e,"blur",o),a=this._renderer.listen(e,"mousedown",o)})),e.focus(n)}_focusByCssSelector(e,n){let o=this._elementRef.nativeElement.querySelector(e);o&&this._forceFocus(o,n)}_trapFocus(e){this._isDestroyed||Gt(()=>{let n=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||n.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,n=null;if(typeof e=="string"?n=this._document.querySelector(e):typeof e=="boolean"?n=e?this._elementFocusedBeforeDialogWasOpened:null:e&&(n=e),this._config.restoreFocus&&n&&typeof n.focus=="function"){let o=Xa(),r=this._elementRef.nativeElement;(!o||o===this._document.body||o===r||r.contains(o))&&(this._focusMonitor?(this._focusMonitor.focusVia(n,this._closeInteractionType),this._closeInteractionType=null):n.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(e){this._elementRef.nativeElement.focus?.(e)}_containsFocus(){let e=this._elementRef.nativeElement,n=Xa();return e===n||e.contains(n)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=Xa()))}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["cdk-dialog-container"]],viewQuery:function(n,o){if(n&1&&ie(Ai,7),n&2){let r;U(r=$())&&(o._portalOutlet=r.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(n,o){n&2&&G("id",o._config.id||null)("role",o._config.role)("aria-modal",o._config.ariaModal)("aria-labelledby",o._config.ariaLabel?null:o._ariaLabelledByQueue[0])("aria-label",o._config.ariaLabel)("aria-describedby",o._config.ariaDescribedBy||null)},features:[ye],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(n,o){n&1&&qe(0,Q_,0,0,"ng-template",0)},dependencies:[Ai],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
|
|
6
|
+
`],encapsulation:2})}return i})(),Kr=class{overlayRef;config;componentInstance;componentRef;containerInstance;disableClose;closed=new F;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(n=>{n.keyCode===27&&!this.disableClose&&!Pt(n)&&(n.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 n=this.closed;this.containerInstance._closeInteractionType=e?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),n.next(t),n.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))}},X_=new te("DialogScrollStrategy",{providedIn:"root",factory:()=>{let i=d(ve);return()=>Go(i)}}),K_=new te("DialogData"),Z_=new te("DefaultDialogConfig");function J_(i){let t=Te(i),e=new H;return{valueSignal:t,get value(){return t()},change:e,ngOnDestroy(){e.complete()}}}var cd=(()=>{class i{_injector=d(ve);_defaultOptions=d(Z_,{optional:!0});_parentDialog=d(i,{optional:!0,skipSelf:!0});_overlayContainer=d(Rs);_idGenerator=d(Re);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new F;_afterOpenedAtThisLevel=new F;_ariaHiddenElements=new Map;_scrollStrategy=d(X_);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(Ft(void 0)));constructor(){}open(e,n){let o=this._defaultOptions||new Ri;n=Y(Y({},o),n),n.id=n.id||this._idGenerator.getId("cdk-dialog-"),n.id&&this.getDialogById(n.id);let r=this._getOverlayConfig(n),a=oo(this._injector,r),c=new Kr(a,n),u=this._attachContainer(a,c,n);if(c.containerInstance=u,!this.openDialogs.length){let p=this._overlayContainer.getContainerElement();u._focusTrapped?u._focusTrapped.pipe(St(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(p)}):this._hideNonDialogContentFromAssistiveTechnology(p)}return this._attachDialogContent(e,c,u,n),this.openDialogs.push(c),c.closed.subscribe(()=>this._removeOpenDialog(c,!0)),this.afterOpened.next(c),c}closeAll(){sd(this.openDialogs,e=>e.close())}getDialogById(e){return this.openDialogs.find(n=>n.id===e)}ngOnDestroy(){sd(this._openDialogsAtThisLevel,e=>{e.config.closeOnDestroy===!1&&this._removeOpenDialog(e,!1)}),sd(this._openDialogsAtThisLevel,e=>e.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){let n=new oi({positionStrategy:e.positionStrategy||Ii().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&&(n.backdropClass=e.backdropClass),n}_attachContainer(e,n,o){let r=o.injector||o.viewContainerRef?.injector,a=[{provide:Ri,useValue:o},{provide:Kr,useValue:n},{provide:$o,useValue:e}],c;o.container?typeof o.container=="function"?c=o.container:(c=o.container.type,a.push(...o.container.providers(o))):c=ld;let u=new ei(c,o.viewContainerRef,ve.create({parent:r||this._injector,providers:a}));return e.attach(u).instance}_attachDialogContent(e,n,o,r){if(e instanceof vi){let a=this._createInjector(r,n,o,void 0),c={$implicit:r.data,dialogRef:n};r.templateContext&&(c=Y(Y({},c),typeof r.templateContext=="function"?r.templateContext():r.templateContext)),o.attachTemplatePortal(new ti(e,null,c,a))}else{let a=this._createInjector(r,n,o,this._injector),c=o.attachComponentPortal(new ei(e,r.viewContainerRef,a));n.componentRef=c,n.componentInstance=c.instance}}_createInjector(e,n,o,r){let a=e.injector||e.viewContainerRef?.injector,c=[{provide:K_,useValue:e.data},{provide:Kr,useValue:n}];return e.providers&&(typeof e.providers=="function"?c.push(...e.providers(n,e,o)):c.push(...e.providers)),e.direction&&(!a||!a.get(Ot,null,{optional:!0}))&&c.push({provide:Ot,useValue:J_(e.direction)}),ve.create({parent:a||r,providers:c})}_removeOpenDialog(e,n){let o=this.openDialogs.indexOf(e);o>-1&&(this.openDialogs.splice(o,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,a)=>{r?a.setAttribute("aria-hidden",r):a.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),n&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(e){if(e.parentElement){let n=e.parentElement.children;for(let o=n.length-1;o>-1;o--){let r=n[o];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(n){return new(n||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function sd(i,t){let e=i.length;for(;e--;)t(i[e])}var Vu=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({providers:[cd],imports:[ri,ni,ts,ni]})}return i})();function eb(i,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},dd="mdc-dialog--open",Lu="mdc-dialog--opening",ju="mdc-dialog--closing",tb=150,nb=75,Hu=(()=>{class i extends ld{_animationStateChanged=new H;_animationsEnabled=!ot();_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?Bu(this._config.enterAnimationDuration)??tb:0;_exitAnimationDuration=this._animationsEnabled?Bu(this._config.exitAnimationDuration)??nb:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(zu,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(Lu,dd)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add(dd),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove(dd),this._animationsEnabled?(this._hostElement.style.setProperty(zu,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(ju)),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(Lu,ju)}_waitForAnimationToComplete(e,n){this._animationTimer!==null&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(n,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 n=super.attachComponentPortal(e);return n.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),n}static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275cmp=M({type:i,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(n,o){n&2&&(Jt("id",o._config.id),G("aria-modal",o._config.ariaModal)("role",o._config.role)("aria-labelledby",o._config.ariaLabel?null:o._ariaLabelledByQueue[0])("aria-label",o._config.ariaLabel)("aria-describedby",o._config.ariaDescribedBy||null),A("_mat-animation-noopable",!o._animationsEnabled)("mat-mdc-dialog-container-with-actions",o._actionSectionCount>0))},features:[ye],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(n,o){n&1&&(s(0,"div",0)(1,"div",1),qe(2,eb,0,0,"ng-template",2),l()())},dependencies:[Ai],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 i})(),zu="--mat-dialog-transition-duration";function Bu(i){return i==null?null:typeof i=="number"?i:i.endsWith("ms")?Si(i.substring(0,i.length-2)):i.endsWith("s")?Si(i.substring(0,i.length-1))*1e3:i==="0"?0:null}var Zr=(function(i){return i[i.OPEN=0]="OPEN",i[i.CLOSING=1]="CLOSING",i[i.CLOSED=2]="CLOSED",i})(Zr||{}),nn=class{_ref;_config;_containerInstance;componentInstance;componentRef;disableClose;id;_afterOpened=new F;_beforeClosed=new F;_result;_closeFallbackTimeout;_state=Zr.OPEN;_closeInteractionType;constructor(t,e,n){this._ref=t,this._config=e,this._containerInstance=n,this.disableClose=e.disableClose,this.id=t.id,t.addPanelClass("mat-mdc-dialog-panel"),n._animationStateChanged.pipe(he(o=>o.state==="opened"),St(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),n._animationStateChanged.pipe(he(o=>o.state==="closed"),St(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),t.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),An(this.backdropClick(),this.keydownEvents().pipe(he(o=>o.keyCode===27&&!this.disableClose&&!Pt(o)))).subscribe(o=>{this.disableClose||(o.preventDefault(),Wu(this,o.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(he(n=>n.state==="closing"),St(1)).subscribe(n=>{this._beforeClosed.next(t),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),n.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 Wu(i,t,e){return i._closeInteractionType=t,i.close(e)}var Vn=new te("MatMdcDialogData"),Ns=new te("mat-mdc-dialog-default-options"),Uu=new te("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{let i=d(ve);return()=>Go(i)}}),Cn=(()=>{class i{_defaultOptions=d(Ns,{optional:!0});_scrollStrategy=d(Uu);_parentDialog=d(i,{optional:!0,skipSelf:!0});_idGenerator=d(Re);_injector=d(ve);_dialog=d(cd);_animationsDisabled=ot();_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new F;_afterOpenedAtThisLevel=new F;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(Ft(void 0)));constructor(){this._dialogRefConstructor=nn,this._dialogContainerType=Hu,this._dialogDataToken=Vn}open(e,n){let o;n=Y(Y({},this._defaultOptions||new Jr),n),n.id=n.id||this._idGenerator.getId("mat-mdc-dialog-"),n.scrollStrategy=n.scrollStrategy||this._scrollStrategy();let r=this._dialog.open(e,Ie(Y({},n),{positionStrategy:Ii(this._injector).centerHorizontally().centerVertically(),disableClose:!0,closePredicate:void 0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,disableAnimations:this._animationsDisabled||n.enterAnimationDuration?.toLocaleString()==="0"||n.exitAnimationDuration?.toString()==="0",container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:n},{provide:Ri,useValue:n}]},templateContext:()=>({dialogRef:o}),providers:(a,c,u)=>(o=new this._dialogRefConstructor(a,n,u),o.updatePosition(n?.position),[{provide:this._dialogContainerType,useValue:u},{provide:this._dialogDataToken,useValue:c.data},{provide:this._dialogRefConstructor,useValue:o}])}));return o.componentRef=r.componentRef,o.componentInstance=r.componentInstance,this.openDialogs.push(o),this.afterOpened.next(o),o.afterClosed().subscribe(()=>{let a=this.openDialogs.indexOf(o);a>-1&&(this.openDialogs.splice(a,1),this.openDialogs.length||this._getAfterAllClosed().next())}),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(e){return this.openDialogs.find(n=>n.id===e)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(e){let n=e.length;for(;n--;)e[n].close()}static \u0275fac=function(n){return new(n||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var $u=(()=>{class i{_dialogRef=d(nn,{optional:!0});_elementRef=d(ne);_dialog=d(Cn);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=ib(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i})}return i})(),ai=(()=>{class i extends $u{id=d(Re).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(o){return(e||(e=tt(i)))(o||i)}})();static \u0275dir=ee({type:i,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(n,o){n&2&&Jt("id",o.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[ye]})}return i})(),si=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[Ym([Di])]})}return i})(),li=(()=>{class i extends $u{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275dir=ee({type:i,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(n,o){n&2&&A("mat-mdc-dialog-actions-align-start",o.align==="start")("mat-mdc-dialog-actions-align-center",o.align==="center")("mat-mdc-dialog-actions-align-end",o.align==="end")},inputs:{align:"align"},features:[ye]})}return i})();function ib(i,t){let e=i.nativeElement.parentElement;for(;e&&!e.classList.contains("mat-mdc-dialog-container");)e=e.parentElement;return e?t.find(n=>n.id===e.id):null}var ro=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({providers:[Cn],imports:[Vu,ri,ni,ce,ce]})}return i})();var Xo=class i{baseUrl="/api/projects";http=d(Ge);listProjects(){return this.http.get(this.baseUrl)}getProject(t){return this.http.get(`${this.baseUrl}/${t}`)}getProjectConfig(t){return this.http.get(`${this.baseUrl}/${t}/config`)}updateProjectConfig(t,e){return this.http.put(`${this.baseUrl}/${t}/config`,e)}createProject(t,e){return this.http.post(this.baseUrl,{name:t,path:e})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var we=class i{selectedProjectIdSubject=new re(null);isLoadingSubject=new re(!1);refreshTriggerSubject=new re(void 0);hasInitialized=!1;isLoading$=this.isLoadingSubject.asObservable();projectApi=d(Xo);projectListCall=this.refreshTriggerSubject.pipe(Dn(()=>this.projectApi.listProjects()),bi({bufferSize:1,refCount:!0}));projectList$=this.projectListCall.pipe(be(t=>t.projects));forcedProject$=this.projectListCall.pipe(be(t=>t.forcedProject));selectedProject$=Xn([this.selectedProjectIdSubject,this.forcedProject$]).pipe(Dn(([t,e])=>{let n=e??t;return n?this.projectApi.getProject(n):wt(null)}),st(t=>{t&&t.name!==this.selectedProjectIdSubject.value&&(console.log("[PROJECT-STATE] Backend returned different project name:",t.name),this.selectedProjectIdSubject.next(t.name))}),bi({bufferSize:1,refCount:!0}));selectProject(t){console.log("[PROJECT-STATE] Explicit project selection:",t),this.forcedProject$.pipe(St(1)).subscribe(e=>this.selectedProjectIdSubject.next(e??t))}getSelectedProjectId(){return this.selectedProjectIdSubject.value}getSelectedProjectIdOrThrow(){let t=this.selectedProjectIdSubject.value;if(!t)throw new Error("[PROJECT_STATE] No project selected");return t}clearSelection(){console.log("[PROJECT-STATE] Clearing project selection"),this.selectedProjectIdSubject.next(null)}initializeDefaultProject(){return J(this,null,function*(){if(this.hasInitialized){console.log("[PROJECT-STATE] Already initialized, skipping");return}this.hasInitialized=!0;let t=yield this.projectApi.listProjects().pipe(St(1)).toPromise();if(!t){console.log("[PROJECT-STATE] No response from project API");return}let{defaultProject:e,forcedProject:n}=t;e&&!n?(console.log("[PROJECT-STATE] Initializing with default project:",e),this.selectedProjectIdSubject.next(e)):n?(console.log("[PROJECT-STATE] Initializing with forced project:",n),this.selectedProjectIdSubject.next(n)):console.log("[PROJECT-STATE] No default project, staying on selection page")})}createProject(t,e){return this.isLoadingSubject.next(!0),this.projectApi.createProject(t,e).pipe(st(()=>{this.isLoadingSubject.next(!1),this.refreshTriggerSubject.next()}))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};function Vs(i){i||(i=d($i));let t=new rn(e=>{if(i.destroyed){e.next();return}return i.onDestroy(e.next.bind(e))});return e=>e.pipe(z(t))}function Vt(i,t){let n=!t?.manualCleanup?t?.injector?.get($i)??d($i):null,o=ob(t?.equal),r;t?.requireSync?r=Te({kind:0},{equal:o}):r=Te({kind:1,value:t?.initialValue},{equal:o});let a,c=i.subscribe({next:u=>r.set({kind:1,value:u}),error:u=>{r.set({kind:2,error:u}),a?.()},complete:()=>{a?.()}});if(t?.requireSync&&r().kind===0)throw new de(601,!1);return a=n?.onDestroy(c.unsubscribe.bind(c)),ft(()=>{let u=r();switch(u.kind){case 1:return u.value;case 2:throw u.error;case 0:throw new de(601,!1)}},{equal:t?.equal})}function ob(i=Object.is){return(t,e)=>t.kind===1&&e.kind===1&&i(t.value,e.value)}function gd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var so=gd();function Zu(i){so=i}var ia={exec:()=>null};function Se(i,t=""){let e=typeof i=="string"?i:i.source,n={replace:(o,r)=>{let a=typeof r=="string"?r:r.source;return a=a.replace(Lt.caret,"$1"),e=e.replace(o,a),n},getRegex:()=>new RegExp(e,t)};return n}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:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i")},rb=/^(?:[ \t]*(?:\n|$))+/,ab=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,sb=/^ {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+|$)/,lb=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fd=/(?:[*+-]|\d{1,9}[.)])/,Ju=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ep=Se(Ju).replace(/bull/g,fd).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(),cb=Se(Ju).replace(/bull/g,fd).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(),_d=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,db=/^[^\n]+/,bd=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,mb=Se(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",bd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),hb=Se(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fd).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",vd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ub=Se("^ {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",vd).replace("tag",Bs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),tp=Se(_d).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(),pb=Se(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",tp).getRegex(),yd={blockquote:pb,code:ab,def:mb,fences:sb,heading:lb,hr:oa,html:ub,lheading:ep,list:hb,newline:rb,paragraph:tp,table:ia,text:db},qu=Se("^ *([^\\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(),gb=Ie(Y({},yd),{lheading:cb,table:qu,paragraph:Se(_d).replace("hr",oa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",qu).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()}),fb=Ie(Y({},yd),{html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",vd).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:ia,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Se(_d).replace("hr",oa).replace("heading",` *#{1,6} *[^
|
|
8
|
+
]`).replace("lheading",ep).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),_b=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,bb=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,np=/^( {2,}|\\)\n(?!\s*$)/,vb=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Hs=/[\p{P}\p{S}]/u,Cd=/[\s\p{P}\p{S}]/u,ip=/[^\s\p{P}\p{S}]/u,yb=Se(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Cd).getRegex(),op=/(?!~)[\p{P}\p{S}]/u,Cb=/(?!~)[\s\p{P}\p{S}]/u,xb=/(?:[^\s\p{P}\p{S}]|~)/u,wb=/\[(?:[^\[\]`]|`[^`]*?`)*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,rp=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Sb=Se(rp,"u").replace(/punct/g,Hs).getRegex(),kb=Se(rp,"u").replace(/punct/g,op).getRegex(),ap="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Mb=Se(ap,"gu").replace(/notPunctSpace/g,ip).replace(/punctSpace/g,Cd).replace(/punct/g,Hs).getRegex(),Eb=Se(ap,"gu").replace(/notPunctSpace/g,xb).replace(/punctSpace/g,Cb).replace(/punct/g,op).getRegex(),Tb=Se("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ip).replace(/punctSpace/g,Cd).replace(/punct/g,Hs).getRegex(),Pb=Se(/\\(punct)/,"gu").replace(/punct/g,Hs).getRegex(),Ob=Se(/^<(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(),Ab=Se(vd).replace("(?:-->|$)","-->").getRegex(),Db=Se("^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",Ab).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),js=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Ib=Se(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",js).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),sp=Se(/^!?\[(label)\]\[(ref)\]/).replace("label",js).replace("ref",bd).getRegex(),lp=Se(/^!?\[(ref)\](?:\[\])?/).replace("ref",bd).getRegex(),Rb=Se("reflink|nolink(?!\\()","g").replace("reflink",sp).replace("nolink",lp).getRegex(),Gu=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,xd={_backpedal:ia,anyPunctuation:Pb,autolink:Ob,blockSkip:wb,br:np,code:bb,del:ia,emStrongLDelim:Sb,emStrongRDelimAst:Mb,emStrongRDelimUnd:Tb,escape:_b,link:Ib,nolink:lp,punctuation:yb,reflink:sp,reflinkSearch:Rb,tag:Db,text:vb,url:ia},Fb=Ie(Y({},xd),{link:Se(/^!?\[(label)\]\((.*?)\)/).replace("label",js).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",js).getRegex()}),hd=Ie(Y({},xd),{emStrongRDelimAst:Eb,emStrongLDelim:kb,url:Se(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Gu).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:Se(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Gu).getRegex()}),Nb=Ie(Y({},hd),{br:Se(np).replace("{2,}","*").getRegex(),text:Se(hd.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),Ls={normal:yd,gfm:gb,pedantic:fb},ea={normal:xd,gfm:hd,breaks:Nb,pedantic:Fb},Vb={"&":"&","<":"<",">":">",'"':""","'":"'"},Yu=i=>Vb[i];function Ln(i,t){if(t){if(Lt.escapeTest.test(i))return i.replace(Lt.escapeReplace,Yu)}else if(Lt.escapeTestNoEncode.test(i))return i.replace(Lt.escapeReplaceNoEncode,Yu);return i}function Qu(i){try{i=encodeURI(i).replace(Lt.percentDecode,"%")}catch{return null}return i}function Xu(i,t){let e=i.replace(Lt.findPipe,(r,a,c)=>{let u=!1,p=a;for(;--p>=0&&c[p]==="\\";)u=!u;return u?"|":" |"}),n=e.split(Lt.splitPipe),o=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(Lt.slashPipe,"|");return n}function ta(i,t,e){let n=i.length;if(n===0)return"";let o=0;for(;o<n;){let r=i.charAt(n-o-1);if(r===t&&!e)o++;else if(r!==t&&e)o++;else break}return i.slice(0,n-o)}function Lb(i,t){if(i.indexOf(t[1])===-1)return-1;let e=0;for(let n=0;n<i.length;n++)if(i[n]==="\\")n++;else if(i[n]===t[0])e++;else if(i[n]===t[1]&&(e--,e<0))return n;return e>0?-2:-1}function Ku(i,t,e,n,o){let r=t.href,a=t.title||null,c=i[1].replace(o.other.outputLinkReplace,"$1");n.state.inLink=!0;let u={type:i[0].charAt(0)==="!"?"image":"link",raw:e,href:r,title:a,text:c,tokens:n.inlineTokens(c)};return n.state.inLink=!1,u}function jb(i,t,e){let n=i.match(e.other.indentCodeCompensation);if(n===null)return t;let o=n[1];return t.split(`
|
|
9
|
+
`).map(r=>{let a=r.match(e.other.beginningSpace);if(a===null)return r;let[c]=a;return c.length>=o.length?r.slice(o.length):r}).join(`
|
|
10
|
+
`)}var zs=class{options;rules;lexer;constructor(i){this.options=i||so}space(i){let t=this.rules.block.newline.exec(i);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(i){let t=this.rules.block.code.exec(i);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,`
|
|
11
|
+
`)}}}fences(i){let t=this.rules.block.fences.exec(i);if(t){let e=t[0],n=jb(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(i){let t=this.rules.block.heading.exec(i);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let n=ta(e,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(e=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(i){let t=this.rules.block.hr.exec(i);if(t)return{type:"hr",raw:ta(t[0],`
|
|
12
|
+
`)}}blockquote(i){let t=this.rules.block.blockquote.exec(i);if(t){let e=ta(t[0],`
|
|
13
|
+
`).split(`
|
|
14
|
+
`),n="",o="",r=[];for(;e.length>0;){let a=!1,c=[],u;for(u=0;u<e.length;u++)if(this.rules.other.blockquoteStart.test(e[u]))c.push(e[u]),a=!0;else if(!a)c.push(e[u]);else break;e=e.slice(u);let p=c.join(`
|
|
15
|
+
`),b=p.replace(this.rules.other.blockquoteSetextReplace,`
|
|
16
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
17
|
+
${p}`:p,o=o?`${o}
|
|
18
|
+
${b}`:b;let C=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,r,!0),this.lexer.state.top=C,e.length===0)break;let T=r.at(-1);if(T?.type==="code")break;if(T?.type==="blockquote"){let P=T,k=P.raw+`
|
|
19
|
+
`+e.join(`
|
|
20
|
+
`),j=this.blockquote(k);r[r.length-1]=j,n=n.substring(0,n.length-P.raw.length)+j.raw,o=o.substring(0,o.length-P.text.length)+j.text;break}else if(T?.type==="list"){let P=T,k=P.raw+`
|
|
21
|
+
`+e.join(`
|
|
22
|
+
`),j=this.list(k);r[r.length-1]=j,n=n.substring(0,n.length-T.raw.length)+j.raw,o=o.substring(0,o.length-P.raw.length)+j.raw,e=k.substring(r.at(-1).raw.length).split(`
|
|
23
|
+
`);continue}}return{type:"blockquote",raw:n,tokens:r,text:o}}}list(i){let t=this.rules.block.list.exec(i);if(t){let e=t[1].trim(),n=e.length>1,o={type:"list",raw:"",ordered:n,start:n?+e.slice(0,-1):"",loose:!1,items:[]};e=n?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=n?e:"[*+-]");let r=this.rules.other.listItemRegex(e),a=!1;for(;i;){let u=!1,p="",b="";if(!(t=r.exec(i))||this.rules.block.hr.test(i))break;p=t[0],i=i.substring(p.length);let C=t[2].split(`
|
|
24
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,ze=>" ".repeat(3*ze.length)),T=i.split(`
|
|
25
|
+
`,1)[0],P=!C.trim(),k=0;if(this.options.pedantic?(k=2,b=C.trimStart()):P?k=t[1].length+1:(k=t[2].search(this.rules.other.nonSpaceChar),k=k>4?1:k,b=C.slice(k),k+=t[1].length),P&&this.rules.other.blankLine.test(T)&&(p+=T+`
|
|
26
|
+
`,i=i.substring(T.length+1),u=!0),!u){let ze=this.rules.other.nextBulletRegex(k),Ze=this.rules.other.hrRegex(k),Je=this.rules.other.fencesBeginRegex(k),fe=this.rules.other.headingBeginRegex(k),Ut=this.rules.other.htmlBeginRegex(k);for(;i;){let _t=i.split(`
|
|
27
|
+
`,1)[0],et;if(T=_t,this.options.pedantic?(T=T.replace(this.rules.other.listReplaceNesting," "),et=T):et=T.replace(this.rules.other.tabCharGlobal," "),Je.test(T)||fe.test(T)||Ut.test(T)||ze.test(T)||Ze.test(T))break;if(et.search(this.rules.other.nonSpaceChar)>=k||!T.trim())b+=`
|
|
28
|
+
`+et.slice(k);else{if(P||C.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||Je.test(C)||fe.test(C)||Ze.test(C))break;b+=`
|
|
29
|
+
`+T}!P&&!T.trim()&&(P=!0),p+=_t+`
|
|
30
|
+
`,i=i.substring(_t.length+1),C=et.slice(k)}}o.loose||(a?o.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(a=!0));let j=null,Ce;this.options.gfm&&(j=this.rules.other.listIsTask.exec(b),j&&(Ce=j[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:p,task:!!j,checked:Ce,loose:!1,text:b,tokens:[]}),o.raw+=p}let c=o.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let u=0;u<o.items.length;u++)if(this.lexer.state.top=!1,o.items[u].tokens=this.lexer.blockTokens(o.items[u].text,[]),!o.loose){let p=o.items[u].tokens.filter(C=>C.type==="space"),b=p.length>0&&p.some(C=>this.rules.other.anyLine.test(C.raw));o.loose=b}if(o.loose)for(let u=0;u<o.items.length;u++)o.items[u].loose=!0;return o}}html(i){let t=this.rules.block.html.exec(i);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(i){let t=this.rules.block.def.exec(i);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:o}}}table(i){let t=this.rules.block.table.exec(i);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let e=Xu(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
31
|
+
`):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<e.length;a++)r.header.push({text:e[a],tokens:this.lexer.inline(e[a]),header:!0,align:r.align[a]});for(let a of o)r.rows.push(Xu(a,r.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:r.align[u]})));return r}}lheading(i){let t=this.rules.block.lheading.exec(i);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(i){let t=this.rules.block.paragraph.exec(i);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
32
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(i){let t=this.rules.block.text.exec(i);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(i){let t=this.rules.inline.escape.exec(i);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(i){let t=this.rules.inline.tag.exec(i);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(i){let t=this.rules.inline.link.exec(i);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let r=ta(e.slice(0,-1),"\\");if((e.length-r.length)%2===0)return}else{let r=Lb(t[2],"()");if(r===-2)return;if(r>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let n=t[2],o="";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(n);r&&(n=r[1],o=r[3])}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n=n.slice(1):n=n.slice(1,-1)),Ku(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(i,t){let e;if((e=this.rules.inline.reflink.exec(i))||(e=this.rules.inline.nolink.exec(i))){let n=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[n.toLowerCase()];if(!o){let r=e[0].charAt(0);return{type:"text",raw:r,text:r}}return Ku(e,o,e[0],this.lexer,this.rules)}}emStrong(i,t,e=""){let n=this.rules.inline.emStrongLDelim.exec(i);if(!(!n||n[3]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!e||this.rules.inline.punctuation.exec(e))){let o=[...n[0]].length-1,r,a,c=o,u=0,p=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*i.length+o);(n=p.exec(t))!=null;){if(r=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!r)continue;if(a=[...r].length,n[3]||n[4]){c+=a;continue}else if((n[5]||n[6])&&o%3&&!((o+a)%3)){u+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+u);let b=[...n[0]][0].length,C=i.slice(0,o+n.index+b+a);if(Math.min(o,a)%2){let P=C.slice(1,-1);return{type:"em",raw:C,text:P,tokens:this.lexer.inlineTokens(P)}}let T=C.slice(2,-2);return{type:"strong",raw:C,text:T,tokens:this.lexer.inlineTokens(T)}}}}codespan(i){let t=this.rules.inline.code.exec(i);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),o=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&o&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(i){let t=this.rules.inline.br.exec(i);if(t)return{type:"br",raw:t[0]}}del(i){let t=this.rules.inline.del.exec(i);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(i){let t=this.rules.inline.autolink.exec(i);if(t){let e,n;return t[2]==="@"?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(i){let t;if(t=this.rules.inline.url.exec(i)){let e,n;if(t[2]==="@")e=t[0],n="mailto:"+e;else{let o;do o=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(o!==t[0]);e=t[0],t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(i){let t=this.rules.inline.text.exec(i);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},xn=class ud{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||so,this.options.tokenizer=this.options.tokenizer||new zs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={other:Lt,block:Ls.normal,inline:ea.normal};this.options.pedantic?(e.block=Ls.pedantic,e.inline=ea.pedantic):this.options.gfm&&(e.block=Ls.gfm,this.options.breaks?e.inline=ea.breaks:e.inline=ea.gfm),this.tokenizer.rules=e}static get rules(){return{block:Ls,inline:ea}}static lex(t,e){return new ud(e).lex(t)}static lexInline(t,e){return new ud(e).inlineTokens(t)}lex(t){t=t.replace(Lt.carriageReturn,`
|
|
33
|
+
`),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let n=this.inlineQueue[e];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],n=!1){for(this.options.pedantic&&(t=t.replace(Lt.tabCharGlobal," ").replace(Lt.spaceLine,""));t;){let o;if(this.options.extensions?.block?.some(a=>(o=a.call({lexer:this},t,e))?(t=t.substring(o.raw.length),e.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let a=e.at(-1);o.raw.length===1&&a!==void 0?a.raw+=`
|
|
34
|
+
`:e.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let a=e.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
35
|
+
`)?"":`
|
|
36
|
+
`)+o.raw,a.text+=`
|
|
37
|
+
`+o.text,this.inlineQueue.at(-1).src=a.text):e.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let a=e.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
38
|
+
`)?"":`
|
|
39
|
+
`)+o.raw,a.text+=`
|
|
40
|
+
`+o.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},e.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),e.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),e.push(o);continue}let r=t;if(this.options.extensions?.startBlock){let a=1/0,c=t.slice(1),u;this.options.extensions.startBlock.forEach(p=>{u=p.call({lexer:this},c),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(r=t.substring(0,a+1))}if(this.state.top&&(o=this.tokenizer.paragraph(r))){let a=e.at(-1);n&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
|
41
|
+
`)?"":`
|
|
42
|
+
`)+o.raw,a.text+=`
|
|
43
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):e.push(o),n=r.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let a=e.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
44
|
+
`)?"":`
|
|
45
|
+
`)+o.raw,a.text+=`
|
|
46
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):e.push(o);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let n=t,o=null;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)c.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,o.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(o=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,a="";for(;t;){r||(a=""),r=!1;let c;if(this.options.extensions?.inline?.some(p=>(c=p.call({lexer:this},t,e))?(t=t.substring(c.raw.length),e.push(c),!0):!1))continue;if(c=this.tokenizer.escape(t)){t=t.substring(c.raw.length),e.push(c);continue}if(c=this.tokenizer.tag(t)){t=t.substring(c.raw.length),e.push(c);continue}if(c=this.tokenizer.link(t)){t=t.substring(c.raw.length),e.push(c);continue}if(c=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(c.raw.length);let p=e.at(-1);c.type==="text"&&p?.type==="text"?(p.raw+=c.raw,p.text+=c.text):e.push(c);continue}if(c=this.tokenizer.emStrong(t,n,a)){t=t.substring(c.raw.length),e.push(c);continue}if(c=this.tokenizer.codespan(t)){t=t.substring(c.raw.length),e.push(c);continue}if(c=this.tokenizer.br(t)){t=t.substring(c.raw.length),e.push(c);continue}if(c=this.tokenizer.del(t)){t=t.substring(c.raw.length),e.push(c);continue}if(c=this.tokenizer.autolink(t)){t=t.substring(c.raw.length),e.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(t))){t=t.substring(c.raw.length),e.push(c);continue}let u=t;if(this.options.extensions?.startInline){let p=1/0,b=t.slice(1),C;this.options.extensions.startInline.forEach(T=>{C=T.call({lexer:this},b),typeof C=="number"&&C>=0&&(p=Math.min(p,C))}),p<1/0&&p>=0&&(u=t.substring(0,p+1))}if(c=this.tokenizer.inlineText(u)){t=t.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(a=c.raw.slice(-1)),r=!0;let p=e.at(-1);p?.type==="text"?(p.raw+=c.raw,p.text+=c.text):e.push(c);continue}if(t){let p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return e}},Ko=class{options;parser;constructor(i){this.options=i||so}space(i){return""}code({text:i,lang:t,escaped:e}){let n=(t||"").match(Lt.notSpaceStart)?.[0],o=i.replace(Lt.endingNewline,"")+`
|
|
47
|
+
`;return n?'<pre><code class="language-'+Ln(n)+'">'+(e?o:Ln(o,!0))+`</code></pre>
|
|
48
|
+
`:"<pre><code>"+(e?o:Ln(o,!0))+`</code></pre>
|
|
49
|
+
`}blockquote({tokens:i}){return`<blockquote>
|
|
50
|
+
${this.parser.parse(i)}</blockquote>
|
|
51
|
+
`}html({text:i}){return i}def(i){return""}heading({tokens:i,depth:t}){return`<h${t}>${this.parser.parseInline(i)}</h${t}>
|
|
52
|
+
`}hr(i){return`<hr>
|
|
53
|
+
`}list(i){let t=i.ordered,e=i.start,n="";for(let a=0;a<i.items.length;a++){let c=i.items[a];n+=this.listitem(c)}let o=t?"ol":"ul",r=t&&e!==1?' start="'+e+'"':"";return"<"+o+r+`>
|
|
54
|
+
`+n+"</"+o+`>
|
|
55
|
+
`}listitem(i){let t="";if(i.task){let e=this.checkbox({checked:!!i.checked});i.loose?i.tokens[0]?.type==="paragraph"?(i.tokens[0].text=e+" "+i.tokens[0].text,i.tokens[0].tokens&&i.tokens[0].tokens.length>0&&i.tokens[0].tokens[0].type==="text"&&(i.tokens[0].tokens[0].text=e+" "+Ln(i.tokens[0].tokens[0].text),i.tokens[0].tokens[0].escaped=!0)):i.tokens.unshift({type:"text",raw:e+" ",text:e+" ",escaped:!0}):t+=e+" "}return t+=this.parser.parse(i.tokens,!!i.loose),`<li>${t}</li>
|
|
56
|
+
`}checkbox({checked:i}){return"<input "+(i?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:i}){return`<p>${this.parser.parseInline(i)}</p>
|
|
57
|
+
`}table(i){let t="",e="";for(let o=0;o<i.header.length;o++)e+=this.tablecell(i.header[o]);t+=this.tablerow({text:e});let n="";for(let o=0;o<i.rows.length;o++){let r=i.rows[o];e="";for(let a=0;a<r.length;a++)e+=this.tablecell(r[a]);n+=this.tablerow({text:e})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
58
|
+
<thead>
|
|
59
|
+
`+t+`</thead>
|
|
60
|
+
`+n+`</table>
|
|
61
|
+
`}tablerow({text:i}){return`<tr>
|
|
62
|
+
${i}</tr>
|
|
63
|
+
`}tablecell(i){let t=this.parser.parseInline(i.tokens),e=i.header?"th":"td";return(i.align?`<${e} align="${i.align}">`:`<${e}>`)+t+`</${e}>
|
|
64
|
+
`}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${Ln(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:t,tokens:e}){let n=this.parser.parseInline(e),o=Qu(i);if(o===null)return n;i=o;let r='<a href="'+i+'"';return t&&(r+=' title="'+Ln(t)+'"'),r+=">"+n+"</a>",r}image({href:i,title:t,text:e,tokens:n}){n&&(e=this.parser.parseInline(n,this.parser.textRenderer));let o=Qu(i);if(o===null)return Ln(e);i=o;let r=`<img src="${i}" alt="${e}"`;return t&&(r+=` title="${Ln(t)}"`),r+=">",r}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:Ln(i.text)}},wd=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}},wn=class pd{options;renderer;textRenderer;constructor(t){this.options=t||so,this.options.renderer=this.options.renderer||new Ko,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new wd}static parse(t,e){return new pd(e).parse(t)}static parseInline(t,e){return new pd(e).parseInline(t)}parse(t,e=!0){let n="";for(let o=0;o<t.length;o++){let r=t[o];if(this.options.extensions?.renderers?.[r.type]){let c=r,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){n+=u||"";continue}}let a=r;switch(a.type){case"space":{n+=this.renderer.space(a);continue}case"hr":{n+=this.renderer.hr(a);continue}case"heading":{n+=this.renderer.heading(a);continue}case"code":{n+=this.renderer.code(a);continue}case"table":{n+=this.renderer.table(a);continue}case"blockquote":{n+=this.renderer.blockquote(a);continue}case"list":{n+=this.renderer.list(a);continue}case"html":{n+=this.renderer.html(a);continue}case"def":{n+=this.renderer.def(a);continue}case"paragraph":{n+=this.renderer.paragraph(a);continue}case"text":{let c=a,u=this.renderer.text(c);for(;o+1<t.length&&t[o+1].type==="text";)c=t[++o],u+=`
|
|
65
|
+
`+this.renderer.text(c);e?n+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):n+=u;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 n}parseInline(t,e=this.renderer){let n="";for(let o=0;o<t.length;o++){let r=t[o];if(this.options.extensions?.renderers?.[r.type]){let c=this.options.extensions.renderers[r.type].call({parser:this},r);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){n+=c||"";continue}}let a=r;switch(a.type){case"escape":{n+=e.text(a);break}case"html":{n+=e.html(a);break}case"link":{n+=e.link(a);break}case"image":{n+=e.image(a);break}case"strong":{n+=e.strong(a);break}case"em":{n+=e.em(a);break}case"codespan":{n+=e.codespan(a);break}case"br":{n+=e.br(a);break}case"del":{n+=e.del(a);break}case"text":{n+=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 n}},na=class{options;block;constructor(i){this.options=i||so}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}emStrongMask(i){return i}provideLexer(){return this.block?xn.lex:xn.lexInline}provideParser(){return this.block?wn.parse:wn.parseInline}},zb=class{defaults=gd();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=wn;Renderer=Ko;TextRenderer=wd;Lexer=xn;Tokenizer=zs;Hooks=na;constructor(...i){this.use(...i)}walkTokens(i,t){let e=[];for(let n of i)switch(e=e.concat(t.call(this,n)),n.type){case"table":{let o=n;for(let r of o.header)e=e.concat(this.walkTokens(r.tokens,t));for(let r of o.rows)for(let a of r)e=e.concat(this.walkTokens(a.tokens,t));break}case"list":{let o=n;e=e.concat(this.walkTokens(o.items,t));break}default:{let o=n;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(r=>{let a=o[r].flat(1/0);e=e.concat(this.walkTokens(a,t))}):o.tokens&&(e=e.concat(this.walkTokens(o.tokens,t)))}}return e}use(...i){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(e=>{let n=Y({},e);if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let r=t.renderers[o.name];r?t.renderers[o.name]=function(...a){let c=o.renderer.apply(this,a);return c===!1&&(c=r.apply(this,a)),c}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=t[o.level];r?r.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),n.extensions=t),e.renderer){let o=this.defaults.renderer||new Ko(this.defaults);for(let r in e.renderer){if(!(r in o))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let a=r,c=e.renderer[a],u=o[a];o[a]=(...p)=>{let b=c.apply(o,p);return b===!1&&(b=u.apply(o,p)),b||""}}n.renderer=o}if(e.tokenizer){let o=this.defaults.tokenizer||new zs(this.defaults);for(let r in e.tokenizer){if(!(r in o))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let a=r,c=e.tokenizer[a],u=o[a];o[a]=(...p)=>{let b=c.apply(o,p);return b===!1&&(b=u.apply(o,p)),b}}n.tokenizer=o}if(e.hooks){let o=this.defaults.hooks||new na;for(let r in e.hooks){if(!(r in o))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let a=r,c=e.hooks[a],u=o[a];na.passThroughHooks.has(r)?o[a]=p=>{if(this.defaults.async&&na.passThroughHooksRespectAsync.has(r))return J(this,null,function*(){let C=yield c.call(o,p);return u.call(o,C)});let b=c.call(o,p);return u.call(o,b)}:o[a]=(...p)=>{if(this.defaults.async)return J(this,null,function*(){let C=yield c.apply(o,p);return C===!1&&(C=yield u.apply(o,p)),C});let b=c.apply(o,p);return b===!1&&(b=u.apply(o,p)),b}}n.hooks=o}if(e.walkTokens){let o=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(a){let c=[];return c.push(r.call(this,a)),o&&(c=c.concat(o.call(this,a))),c}}this.defaults=Y(Y({},this.defaults),n)}),this}setOptions(i){return this.defaults=Y(Y({},this.defaults),i),this}lexer(i,t){return xn.lex(i,t??this.defaults)}parser(i,t){return wn.parse(i,t??this.defaults)}parseMarkdown(i){return(t,e)=>{let n=Y({},e),o=Y(Y({},this.defaults),n),r=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&n.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(o.hooks&&(o.hooks.options=o,o.hooks.block=i),o.async)return J(this,null,function*(){let a=o.hooks?yield o.hooks.preprocess(t):t,c=yield(o.hooks?yield o.hooks.provideLexer():i?xn.lex:xn.lexInline)(a,o),u=o.hooks?yield o.hooks.processAllTokens(c):c;o.walkTokens&&(yield Promise.all(this.walkTokens(u,o.walkTokens)));let p=yield(o.hooks?yield o.hooks.provideParser():i?wn.parse:wn.parseInline)(u,o);return o.hooks?yield o.hooks.postprocess(p):p}).catch(r);try{o.hooks&&(t=o.hooks.preprocess(t));let a=(o.hooks?o.hooks.provideLexer():i?xn.lex:xn.lexInline)(t,o);o.hooks&&(a=o.hooks.processAllTokens(a)),o.walkTokens&&this.walkTokens(a,o.walkTokens);let c=(o.hooks?o.hooks.provideParser():i?wn.parse:wn.parseInline)(a,o);return o.hooks&&(c=o.hooks.postprocess(c)),c}catch(a){return r(a)}}}onError(i,t){return e=>{if(e.message+=`
|
|
66
|
+
Please report this to https://github.com/markedjs/marked.`,i){let n="<p>An error occurred:</p><pre>"+Ln(e.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(e);throw e}}},ao=new zb;function Me(i,t){return ao.parse(i,t)}Me.options=Me.setOptions=function(i){return ao.setOptions(i),Me.defaults=ao.defaults,Zu(Me.defaults),Me};Me.getDefaults=gd;Me.defaults=so;Me.use=function(...i){return ao.use(...i),Me.defaults=ao.defaults,Zu(Me.defaults),Me};Me.walkTokens=function(i,t){return ao.walkTokens(i,t)};Me.parseInline=ao.parseInline;Me.Parser=wn;Me.parser=wn.parse;Me.Renderer=Ko;Me.TextRenderer=wd;Me.Lexer=xn;Me.lexer=xn.lex;Me.Tokenizer=zs;Me.Hooks=na;Me.parse=Me;var j1=Me.options,z1=Me.setOptions,B1=Me.use,H1=Me.walkTokens,W1=Me.parseInline;var U1=wn.parse,$1=xn.lex;var{entries:_p,setPrototypeOf:cp,isFrozen:Bb,getPrototypeOf:Hb,getOwnPropertyDescriptor:Wb}=Object,{freeze:zt,seal:dn,create:Od}=Object,{apply:Ad,construct:Dd}=typeof Reflect<"u"&&Reflect;zt||(zt=function(t){return t});dn||(dn=function(t){return t});Ad||(Ad=function(t,e){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return t.apply(e,o)});Dd||(Dd=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return new t(...n)});var Ws=Bt(Array.prototype.forEach),Ub=Bt(Array.prototype.lastIndexOf),dp=Bt(Array.prototype.pop),ra=Bt(Array.prototype.push),$b=Bt(Array.prototype.splice),$s=Bt(String.prototype.toLowerCase),Sd=Bt(String.prototype.toString),kd=Bt(String.prototype.match),aa=Bt(String.prototype.replace),qb=Bt(String.prototype.indexOf),Gb=Bt(String.prototype.trim),Sn=Bt(Object.prototype.hasOwnProperty),jt=Bt(RegExp.prototype.test),sa=Yb(TypeError);function Bt(i){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return Ad(i,t,n)}}function Yb(i){return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Dd(i,e)}}function pe(i,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$s;cp&&cp(i,null);let n=t.length;for(;n--;){let o=t[n];if(typeof o=="string"){let r=e(o);r!==o&&(Bb(t)||(t[n]=r),o=r)}i[o]=!0}return i}function Qb(i){for(let t=0;t<i.length;t++)Sn(i,t)||(i[t]=null);return i}function jn(i){let t=Od(null);for(let[e,n]of _p(i))Sn(i,e)&&(Array.isArray(n)?t[e]=Qb(n):n&&typeof n=="object"&&n.constructor===Object?t[e]=jn(n):t[e]=n);return t}function la(i,t){for(;i!==null;){let n=Wb(i,t);if(n){if(n.get)return Bt(n.get);if(typeof n.value=="function")return Bt(n.value)}i=Hb(i)}function e(){return null}return e}var mp=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"]),Md=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"]),Ed=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"]),Xb=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"]),Td=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"]),Kb=zt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hp=zt(["#text"]),up=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"]),Pd=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"]),pp=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"]),Us=zt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Zb=dn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Jb=dn(/<%[\w\W]*|[\w\W]*%>/gm),ev=dn(/\$\{[\w\W]*/gm),tv=dn(/^data-[\-\w.\u00B7-\uFFFF]+$/),nv=dn(/^aria-[\-\w]+$/),bp=dn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),iv=dn(/^(?:\w+script|data):/i),ov=dn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),vp=dn(/^html$/i),rv=dn(/^[a-z][.\w]*(-[.\w]+)+$/i),gp=Object.freeze({__proto__:null,ARIA_ATTR:nv,ATTR_WHITESPACE:ov,CUSTOM_ELEMENT:rv,DATA_ATTR:tv,DOCTYPE_NAME:vp,ERB_EXPR:Jb,IS_ALLOWED_URI:bp,IS_SCRIPT_OR_DATA:iv,MUSTACHE_EXPR:Zb,TMPLIT_EXPR:ev}),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},av=function(){return typeof window>"u"?null:window},sv=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null,o="data-tt-policy-suffix";e&&e.hasAttribute(o)&&(n=e.getAttribute(o));let r="dompurify"+(n?"#"+n:"");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}},fp=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function yp(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:av(),t=X=>yp(X);if(t.version="3.3.1",t.removed=[],!i||!i.document||i.document.nodeType!==ca.document||!i.Element)return t.isSupported=!1,t;let{document:e}=i,n=e,o=n.currentScript,{DocumentFragment:r,HTMLTemplateElement:a,Node:c,Element:u,NodeFilter:p,NamedNodeMap:b=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:C,DOMParser:T,trustedTypes:P}=i,k=u.prototype,j=la(k,"cloneNode"),Ce=la(k,"remove"),ze=la(k,"nextSibling"),Ze=la(k,"childNodes"),Je=la(k,"parentNode");if(typeof a=="function"){let X=e.createElement("template");X.content&&X.content.ownerDocument&&(e=X.content.ownerDocument)}let fe,Ut="",{implementation:_t,createNodeIterator:et,createDocumentFragment:Mt,getElementsByTagName:qn}=e,{importNode:fi}=n,bt=fp();t.isSupported=typeof _p=="function"&&typeof Je=="function"&&_t&&_t.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:gn,ERB_EXPR:zi,TMPLIT_EXPR:wo,DATA_ATTR:Aa,ARIA_ATTR:W,IS_SCRIPT_OR_DATA:Q,ATTR_WHITESPACE:Z,CUSTOM_ELEMENT:_e}=gp,{IS_ALLOWED_URI:at}=gp,Ee=null,Et=pe({},[...mp,...Md,...Ed,...Td,...hp]),Fe=null,Ne=pe({},[...up,...Pd,...pp,...Us]),Ue=Object.seal(Od(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}})),Bi=null,mt=null,$t=Object.seal(Od(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Rt=!0,_i=!0,So=!1,pm=!0,ko=!1,Da=!0,Hi=!1,ic=!1,oc=!1,Mo=!1,Ia=!1,Ra=!1,gm=!0,fm=!1,xf="user-content-",rc=!0,Pr=!1,Eo={},Tn=null,ac=pe({},["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"]),_m=null,bm=pe({},["audio","video","img","source","image","track"]),sc=null,vm=pe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fa="http://www.w3.org/1998/Math/MathML",Na="http://www.w3.org/2000/svg",Gn="http://www.w3.org/1999/xhtml",To=Gn,lc=!1,cc=null,wf=pe({},[Fa,Na,Gn],Sd),Va=pe({},["mi","mo","mn","ms","mtext"]),La=pe({},["annotation-xml"]),Sf=pe({},["title","style","font","a","script"]),Or=null,kf=["application/xhtml+xml","text/html"],Mf="text/html",gt=null,Po=null,Ef=e.createElement("form"),ym=function(f){return f instanceof RegExp||f instanceof Function},dc=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Po&&Po===f)){if((!f||typeof f!="object")&&(f={}),f=jn(f),Or=kf.indexOf(f.PARSER_MEDIA_TYPE)===-1?Mf:f.PARSER_MEDIA_TYPE,gt=Or==="application/xhtml+xml"?Sd:$s,Ee=Sn(f,"ALLOWED_TAGS")?pe({},f.ALLOWED_TAGS,gt):Et,Fe=Sn(f,"ALLOWED_ATTR")?pe({},f.ALLOWED_ATTR,gt):Ne,cc=Sn(f,"ALLOWED_NAMESPACES")?pe({},f.ALLOWED_NAMESPACES,Sd):wf,sc=Sn(f,"ADD_URI_SAFE_ATTR")?pe(jn(vm),f.ADD_URI_SAFE_ATTR,gt):vm,_m=Sn(f,"ADD_DATA_URI_TAGS")?pe(jn(bm),f.ADD_DATA_URI_TAGS,gt):bm,Tn=Sn(f,"FORBID_CONTENTS")?pe({},f.FORBID_CONTENTS,gt):ac,Bi=Sn(f,"FORBID_TAGS")?pe({},f.FORBID_TAGS,gt):jn({}),mt=Sn(f,"FORBID_ATTR")?pe({},f.FORBID_ATTR,gt):jn({}),Eo=Sn(f,"USE_PROFILES")?f.USE_PROFILES:!1,Rt=f.ALLOW_ARIA_ATTR!==!1,_i=f.ALLOW_DATA_ATTR!==!1,So=f.ALLOW_UNKNOWN_PROTOCOLS||!1,pm=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ko=f.SAFE_FOR_TEMPLATES||!1,Da=f.SAFE_FOR_XML!==!1,Hi=f.WHOLE_DOCUMENT||!1,Mo=f.RETURN_DOM||!1,Ia=f.RETURN_DOM_FRAGMENT||!1,Ra=f.RETURN_TRUSTED_TYPE||!1,oc=f.FORCE_BODY||!1,gm=f.SANITIZE_DOM!==!1,fm=f.SANITIZE_NAMED_PROPS||!1,rc=f.KEEP_CONTENT!==!1,Pr=f.IN_PLACE||!1,at=f.ALLOWED_URI_REGEXP||bp,To=f.NAMESPACE||Gn,Va=f.MATHML_TEXT_INTEGRATION_POINTS||Va,La=f.HTML_INTEGRATION_POINTS||La,Ue=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&ym(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ue.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&ym(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ue.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Ue.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ko&&(_i=!1),Ia&&(Mo=!0),Eo&&(Ee=pe({},hp),Fe=[],Eo.html===!0&&(pe(Ee,mp),pe(Fe,up)),Eo.svg===!0&&(pe(Ee,Md),pe(Fe,Pd),pe(Fe,Us)),Eo.svgFilters===!0&&(pe(Ee,Ed),pe(Fe,Pd),pe(Fe,Us)),Eo.mathMl===!0&&(pe(Ee,Td),pe(Fe,pp),pe(Fe,Us))),f.ADD_TAGS&&(typeof f.ADD_TAGS=="function"?$t.tagCheck=f.ADD_TAGS:(Ee===Et&&(Ee=jn(Ee)),pe(Ee,f.ADD_TAGS,gt))),f.ADD_ATTR&&(typeof f.ADD_ATTR=="function"?$t.attributeCheck=f.ADD_ATTR:(Fe===Ne&&(Fe=jn(Fe)),pe(Fe,f.ADD_ATTR,gt))),f.ADD_URI_SAFE_ATTR&&pe(sc,f.ADD_URI_SAFE_ATTR,gt),f.FORBID_CONTENTS&&(Tn===ac&&(Tn=jn(Tn)),pe(Tn,f.FORBID_CONTENTS,gt)),f.ADD_FORBID_CONTENTS&&(Tn===ac&&(Tn=jn(Tn)),pe(Tn,f.ADD_FORBID_CONTENTS,gt)),rc&&(Ee["#text"]=!0),Hi&&pe(Ee,["html","head","body"]),Ee.table&&(pe(Ee,["tbody"]),delete Bi.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw sa('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw sa('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');fe=f.TRUSTED_TYPES_POLICY,Ut=fe.createHTML("")}else fe===void 0&&(fe=sv(P,o)),fe!==null&&typeof Ut=="string"&&(Ut=fe.createHTML(""));zt&&zt(f),Po=f}},Cm=pe({},[...Md,...Ed,...Xb]),xm=pe({},[...Td,...Kb]),Tf=function(f){let O=Je(f);(!O||!O.tagName)&&(O={namespaceURI:To,tagName:"template"});let q=$s(f.tagName),$e=$s(O.tagName);return cc[f.namespaceURI]?f.namespaceURI===Na?O.namespaceURI===Gn?q==="svg":O.namespaceURI===Fa?q==="svg"&&($e==="annotation-xml"||Va[$e]):!!Cm[q]:f.namespaceURI===Fa?O.namespaceURI===Gn?q==="math":O.namespaceURI===Na?q==="math"&&La[$e]:!!xm[q]:f.namespaceURI===Gn?O.namespaceURI===Na&&!La[$e]||O.namespaceURI===Fa&&!Va[$e]?!1:!xm[q]&&(Sf[q]||!Cm[q]):!!(Or==="application/xhtml+xml"&&cc[f.namespaceURI]):!1},Pn=function(f){ra(t.removed,{element:f});try{Je(f).removeChild(f)}catch{Ce(f)}},Wi=function(f,O){try{ra(t.removed,{attribute:O.getAttributeNode(f),from:O})}catch{ra(t.removed,{attribute:null,from:O})}if(O.removeAttribute(f),f==="is")if(Mo||Ia)try{Pn(O)}catch{}else try{O.setAttribute(f,"")}catch{}},wm=function(f){let O=null,q=null;if(oc)f="<remove></remove>"+f;else{let ht=kd(f,/^[\r\n\t ]+/);q=ht&&ht[0]}Or==="application/xhtml+xml"&&To===Gn&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");let $e=fe?fe.createHTML(f):f;if(To===Gn)try{O=new T().parseFromString($e,Or)}catch{}if(!O||!O.documentElement){O=_t.createDocument(To,"template",null);try{O.documentElement.innerHTML=lc?Ut:$e}catch{}}let Tt=O.body||O.documentElement;return f&&q&&Tt.insertBefore(e.createTextNode(q),Tt.childNodes[0]||null),To===Gn?qn.call(O,Hi?"html":"body")[0]:Hi?O.documentElement:Tt},Sm=function(f){return et.call(f.ownerDocument||f,f,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},mc=function(f){return f instanceof C&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof b)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},km=function(f){return typeof c=="function"&&f instanceof c};function Yn(X,f,O){Ws(X,q=>{q.call(t,f,O,Po)})}let Mm=function(f){let O=null;if(Yn(bt.beforeSanitizeElements,f,null),mc(f))return Pn(f),!0;let q=gt(f.nodeName);if(Yn(bt.uponSanitizeElement,f,{tagName:q,allowedTags:Ee}),Da&&f.hasChildNodes()&&!km(f.firstElementChild)&&jt(/<[/\w!]/g,f.innerHTML)&&jt(/<[/\w!]/g,f.textContent)||f.nodeType===ca.progressingInstruction||Da&&f.nodeType===ca.comment&&jt(/<[/\w]/g,f.data))return Pn(f),!0;if(!($t.tagCheck instanceof Function&&$t.tagCheck(q))&&(!Ee[q]||Bi[q])){if(!Bi[q]&&Tm(q)&&(Ue.tagNameCheck instanceof RegExp&&jt(Ue.tagNameCheck,q)||Ue.tagNameCheck instanceof Function&&Ue.tagNameCheck(q)))return!1;if(rc&&!Tn[q]){let $e=Je(f)||f.parentNode,Tt=Ze(f)||f.childNodes;if(Tt&&$e){let ht=Tt.length;for(let qt=ht-1;qt>=0;--qt){let Qn=j(Tt[qt],!0);Qn.__removalCount=(f.__removalCount||0)+1,$e.insertBefore(Qn,ze(f))}}}return Pn(f),!0}return f instanceof u&&!Tf(f)||(q==="noscript"||q==="noembed"||q==="noframes")&&jt(/<\/no(script|embed|frames)/i,f.innerHTML)?(Pn(f),!0):(ko&&f.nodeType===ca.text&&(O=f.textContent,Ws([gn,zi,wo],$e=>{O=aa(O,$e," ")}),f.textContent!==O&&(ra(t.removed,{element:f.cloneNode()}),f.textContent=O)),Yn(bt.afterSanitizeElements,f,null),!1)},Em=function(f,O,q){if(gm&&(O==="id"||O==="name")&&(q in e||q in Ef))return!1;if(!(_i&&!mt[O]&&jt(Aa,O))){if(!(Rt&&jt(W,O))){if(!($t.attributeCheck instanceof Function&&$t.attributeCheck(O,f))){if(!Fe[O]||mt[O]){if(!(Tm(f)&&(Ue.tagNameCheck instanceof RegExp&&jt(Ue.tagNameCheck,f)||Ue.tagNameCheck instanceof Function&&Ue.tagNameCheck(f))&&(Ue.attributeNameCheck instanceof RegExp&&jt(Ue.attributeNameCheck,O)||Ue.attributeNameCheck instanceof Function&&Ue.attributeNameCheck(O,f))||O==="is"&&Ue.allowCustomizedBuiltInElements&&(Ue.tagNameCheck instanceof RegExp&&jt(Ue.tagNameCheck,q)||Ue.tagNameCheck instanceof Function&&Ue.tagNameCheck(q))))return!1}else if(!sc[O]){if(!jt(at,aa(q,Z,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&f!=="script"&&qb(q,"data:")===0&&_m[f])){if(!(So&&!jt(Q,aa(q,Z,"")))){if(q)return!1}}}}}}}return!0},Tm=function(f){return f!=="annotation-xml"&&kd(f,_e)},Pm=function(f){Yn(bt.beforeSanitizeAttributes,f,null);let{attributes:O}=f;if(!O||mc(f))return;let q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Fe,forceKeepAttr:void 0},$e=O.length;for(;$e--;){let Tt=O[$e],{name:ht,namespaceURI:qt,value:Qn}=Tt,Oo=gt(ht),hc=Qn,xt=ht==="value"?hc:Gb(hc);if(q.attrName=Oo,q.attrValue=xt,q.keepAttr=!0,q.forceKeepAttr=void 0,Yn(bt.uponSanitizeAttribute,f,q),xt=q.attrValue,fm&&(Oo==="id"||Oo==="name")&&(Wi(ht,f),xt=xf+xt),Da&&jt(/((--!?|])>)|<\/(style|title|textarea)/i,xt)){Wi(ht,f);continue}if(Oo==="attributename"&&kd(xt,"href")){Wi(ht,f);continue}if(q.forceKeepAttr)continue;if(!q.keepAttr){Wi(ht,f);continue}if(!pm&&jt(/\/>/i,xt)){Wi(ht,f);continue}ko&&Ws([gn,zi,wo],Am=>{xt=aa(xt,Am," ")});let Om=gt(f.nodeName);if(!Em(Om,Oo,xt)){Wi(ht,f);continue}if(fe&&typeof P=="object"&&typeof P.getAttributeType=="function"&&!qt)switch(P.getAttributeType(Om,Oo)){case"TrustedHTML":{xt=fe.createHTML(xt);break}case"TrustedScriptURL":{xt=fe.createScriptURL(xt);break}}if(xt!==hc)try{qt?f.setAttributeNS(qt,ht,xt):f.setAttribute(ht,xt),mc(f)?Pn(f):dp(t.removed)}catch{Wi(ht,f)}}Yn(bt.afterSanitizeAttributes,f,null)},Pf=function X(f){let O=null,q=Sm(f);for(Yn(bt.beforeSanitizeShadowDOM,f,null);O=q.nextNode();)Yn(bt.uponSanitizeShadowNode,O,null),Mm(O),Pm(O),O.content instanceof r&&X(O.content);Yn(bt.afterSanitizeShadowDOM,f,null)};return t.sanitize=function(X){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,q=null,$e=null,Tt=null;if(lc=!X,lc&&(X="<!-->"),typeof X!="string"&&!km(X))if(typeof X.toString=="function"){if(X=X.toString(),typeof X!="string")throw sa("dirty is not a string, aborting")}else throw sa("toString is not a function");if(!t.isSupported)return X;if(ic||dc(f),t.removed=[],typeof X=="string"&&(Pr=!1),Pr){if(X.nodeName){let Qn=gt(X.nodeName);if(!Ee[Qn]||Bi[Qn])throw sa("root node is forbidden and cannot be sanitized in-place")}}else if(X instanceof c)O=wm("<!---->"),q=O.ownerDocument.importNode(X,!0),q.nodeType===ca.element&&q.nodeName==="BODY"||q.nodeName==="HTML"?O=q:O.appendChild(q);else{if(!Mo&&!ko&&!Hi&&X.indexOf("<")===-1)return fe&&Ra?fe.createHTML(X):X;if(O=wm(X),!O)return Mo?null:Ra?Ut:""}O&&oc&&Pn(O.firstChild);let ht=Sm(Pr?X:O);for(;$e=ht.nextNode();)Mm($e),Pm($e),$e.content instanceof r&&Pf($e.content);if(Pr)return X;if(Mo){if(Ia)for(Tt=Mt.call(O.ownerDocument);O.firstChild;)Tt.appendChild(O.firstChild);else Tt=O;return(Fe.shadowroot||Fe.shadowrootmode)&&(Tt=fi.call(n,Tt,!0)),Tt}let qt=Hi?O.outerHTML:O.innerHTML;return Hi&&Ee["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&jt(vp,O.ownerDocument.doctype.name)&&(qt="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
|
|
67
|
+
`+qt),ko&&Ws([gn,zi,wo],Qn=>{qt=aa(qt,Qn," ")}),fe&&Ra?fe.createHTML(qt):qt},t.setConfig=function(){let X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dc(X),ic=!0},t.clearConfig=function(){Po=null,ic=!1},t.isValidAttribute=function(X,f,O){Po||dc({});let q=gt(X),$e=gt(f);return Em(q,$e,O)},t.addHook=function(X,f){typeof f=="function"&&ra(bt[X],f)},t.removeHook=function(X,f){if(f!==void 0){let O=Ub(bt[X],f);return O===-1?void 0:$b(bt[X],O,1)[0]}return dp(bt[X])},t.removeHooks=function(X){bt[X]=[]},t.removeAllHooks=function(){bt=fp()},t}var Cp=yp();var zn=class i{renderer;constructor(){this.renderer=new Ko,this.configureRenderer()}configureRenderer(){let t=this.renderer.link.bind(this.renderer);this.renderer.link=e=>{let n=this.isExternalLink(e.href),o=t(e);if(n){o=o.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)`;o=o.replace("<a ",`<a aria-label="${this.escapeHtml(r)}" `),o=o.replace("</a>",'<span class="external-link-icon" aria-hidden="true">\u2197</span></a>')}return o}}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={"&":"&","<":"<",">":">",'"':""","'":"'"};return t.replace(/[&<>"']/g,n=>e[n]||n)}parse(t){return J(this,null,function*(){let e=yield Me.parse(t,{renderer:this.renderer,breaks:!0,gfm:!0});return Cp.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||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var lv=["buttonContainer"],cv=(i,t)=>t.value;function dv(i,t){i&1&&(s(0,"mat-icon",8),h(1,"keyboard_return"),l())}function mv(i,t){if(i&1){let e=E();s(0,"button",6),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.onOptionClick(o.value))}),s(1,"span",7),h(2),l(),w(3,dv,2,0,"mat-icon",8),l()}if(i&2){let e=t.$implicit,n=t.$index,o=g(2);A("highlighted",n===o.highlightedIndex),x("disabled",e.disabled)("id","choice-option-"+n),G("aria-selected",n===o.highlightedIndex),m(2),B(e.label),m(),S(n===o.highlightedIndex?3:-1)}}function hv(i,t){if(i&1&&(s(0,"div",5)(1,"mat-icon"),h(2,"search"),l(),s(3,"span"),h(4),l()()),i&2){let e=g(2);m(4),B(e.searchText)}}function uv(i,t){if(i&1){let e=E();s(0,"div",1),I(1,"div",2),Yi(2,"async"),s(3,"div",3,0),_("keydown",function(o){v(e);let r=g();return y(r.onKeyDown(o))}),Oe(5,mv,4,7,"button",4,cv),l(),w(7,hv,5,1,"div",5),l()}if(i&2){let e=g();m(),x("innerHTML",Jm(2,3,e.renderedLabel$),Zt),m(2),G("aria-activedescendant","choice-option-"+e.highlightedIndex),m(2),Ae(e.options),m(2),S(e.searchText?7:-1)}}var Zo=class i{options=[];set labelHtml(t){typeof t=="object"?this.renderedLabelSubject.next(t):this.renderLabelMarkdown(t)}isVisible=!1;choiceSelected=new H;buttonContainer;highlightedIndex=0;searchText="";searchTimeout;destroy$=new F;renderedLabelSubject=new re("");renderedLabel$=this.renderedLabelSubject.asObservable();sanitizer=d(Rn);markdownService=d(zn);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&&(console.log("[CHOICE-SELECT] isVisible changed:",t.isVisible.previousValue,"->",t.isVisible.currentValue),t.isVisible.currentValue&&!t.isVisible.previousValue&&(console.log("[CHOICE-SELECT] Component becoming visible, setting focus..."),this.highlightedIndex=0,setTimeout(()=>this.focusContainer(),150))),t.options&&!t.options.firstChange&&(this.highlightedIndex=0)}focusContainer(){this.buttonContainer?.nativeElement&&(this.buttonContainer.nativeElement.focus(),console.log("[CHOICE-SELECT] Focus set on button container"))}onKeyDown(t){if(this.options.filter(n=>!n.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 o=e.findIndex(r=>r===this.highlightedIndex)+t;if(o>=0&&o<e.length){let r=e[o];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}else if(t===1&&o>=e.length){let r=e[0];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}else if(t===-1&&o<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,n)=>({opt:e,idx:n})).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(n=>!n.disabled&&n.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){console.log("[CHOICE-SELECT] Choice selected:",t),this.choiceSelected.emit(t)}renderLabelMarkdown(t){return J(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||i)};static \u0275cmp=M({type:i,selectors:[["app-choice-select"]],viewQuery:function(e,n){if(e&1&&ie(lv,5),e&2){let o;U(o=$())&&(n.buttonContainer=o.first)}},inputs:{options:"options",labelHtml:"labelHtml",isVisible:"isVisible"},outputs:{choiceSelected:"choiceSelected"},features:[Ve],decls:1,vars:1,consts:[["buttonContainer",""],[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,"search-indicator"],["type","button","role","option",1,"choice-button",3,"click","disabled","id"],[1,"choice-button-label"],[1,"choice-button-icon"]],template:function(e,n){e&1&&w(0,uv,8,5,"div",1),e&2&&S(n.isVisible?0:-1)},dependencies:[Ye,xe,rh],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}.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 Jo=class i{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||i)};static \u0275cmp=M({type:i,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(e,n){e&1&&(an(0,"h1",0),h(1),sn()),e&2&&(m(),B(n.currentWelcomeMessage))},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(2.5rem,6vw,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:inline-block;min-height:1.2em}@media (max-width: 768px){.welcome-title[_ngcontent-%COMP%]{font-size:clamp(2rem,5vw,3rem)}}@media (max-width: 480px){.welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,2rem)}}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"]})};var Op=(()=>{class i{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,n){this._renderer=e,this._elementRef=n}setProperty(e,n){this._renderer.setProperty(this._elementRef.nativeElement,e,n)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}static \u0275fac=function(n){return new(n||i)(Pe(nt),Pe(ne))};static \u0275dir=ee({type:i})}return i})(),co=(()=>{class i extends Op{static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275dir=ee({type:i,features:[ye]})}return i})(),Xt=new te(""),pv={provide:Xt,useExisting:it(()=>Fd),multi:!0},Fd=(()=>{class i extends co{writeValue(e){this.setProperty("checked",e)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275dir=ee({type:i,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(n,o){n&1&&_("change",function(a){return o.onChange(a.target.checked)})("blur",function(){return o.onTouched()})},standalone:!1,features:[ge([pv]),ye]})}return i})(),gv={provide:Xt,useExisting:it(()=>je),multi:!0};function fv(){let i=bc()?bc().getUserAgent():"";return/android (\d+)/.test(i.toLowerCase())}var _v=new te(""),je=(()=>{class i extends Op{_compositionMode;_composing=!1;constructor(e,n,o){super(e,n),this._compositionMode=o,this._compositionMode==null&&(this._compositionMode=!fv())}writeValue(e){let n=e??"";this.setProperty("value",n)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}static \u0275fac=function(n){return new(n||i)(Pe(nt),Pe(ne),Pe(_v,8))};static \u0275dir=ee({type:i,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(n,o){n&1&&_("input",function(a){return o._handleInput(a.target.value)})("blur",function(){return o.onTouched()})("compositionstart",function(){return o._compositionStart()})("compositionend",function(a){return o._compositionEnd(a.target.value)})},standalone:!1,features:[ge([gv]),ye]})}return i})();function Nd(i){return i==null||Vd(i)===0}function Vd(i){return i==null?null:Array.isArray(i)||typeof i=="string"?i.length:i instanceof Set?i.size:null}var Mn=new te(""),Ld=new te(""),bv=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,nr=class{static min(t){return Ap(t)}static max(t){return Dp(t)}static required(t){return Ip(t)}static requiredTrue(t){return vv(t)}static email(t){return yv(t)}static minLength(t){return Cv(t)}static maxLength(t){return Rp(t)}static pattern(t){return xv(t)}static nullValidator(t){return Gs()}static compose(t){return zp(t)}static composeAsync(t){return Bp(t)}};function Ap(i){return t=>{if(t.value==null||i==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e<i?{min:{min:i,actual:t.value}}:null}}function Dp(i){return t=>{if(t.value==null||i==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e>i?{max:{max:i,actual:t.value}}:null}}function Ip(i){return Nd(i.value)?{required:!0}:null}function vv(i){return i.value===!0?null:{required:!0}}function yv(i){return Nd(i.value)||bv.test(i.value)?null:{email:!0}}function Cv(i){return t=>{let e=t.value?.length??Vd(t.value);return e===null||e===0?null:e<i?{minlength:{requiredLength:i,actualLength:e}}:null}}function Rp(i){return t=>{let e=t.value?.length??Vd(t.value);return e!==null&&e>i?{maxlength:{requiredLength:i,actualLength:e}}:null}}function xv(i){if(!i)return Gs;let t,e;return typeof i=="string"?(e="",i.charAt(0)!=="^"&&(e+="^"),e+=i,i.charAt(i.length-1)!=="$"&&(e+="$"),t=new RegExp(e)):(e=i.toString(),t=i),n=>{if(Nd(n.value))return null;let o=n.value;return t.test(o)?null:{pattern:{requiredPattern:e,actualValue:o}}}}function Gs(i){return null}function Fp(i){return i!=null}function Np(i){return Qm(i)?Rm(i):i}function Vp(i){let t={};return i.forEach(e=>{t=e!=null?Y(Y({},t),e):t}),Object.keys(t).length===0?null:t}function Lp(i,t){return t.map(e=>e(i))}function wv(i){return!i.validate}function jp(i){return i.map(t=>wv(t)?t:e=>t.validate(e))}function zp(i){if(!i)return null;let t=i.filter(Fp);return t.length==0?null:function(e){return Vp(Lp(e,t))}}function jd(i){return i!=null?zp(jp(i)):null}function Bp(i){if(!i)return null;let t=i.filter(Fp);return t.length==0?null:function(e){let n=Lp(e,t).map(Np);return Vm(n).pipe(be(Vp))}}function zd(i){return i!=null?Bp(jp(i)):null}function xp(i,t){return i===null?[t]:Array.isArray(i)?[...i,t]:[i,t]}function Hp(i){return i._rawValidators}function Wp(i){return i._rawAsyncValidators}function Id(i){return i?Array.isArray(i)?i:[i]:[]}function Ys(i,t){return Array.isArray(i)?i.includes(t):i===t}function wp(i,t){let e=Id(t);return Id(i).forEach(o=>{Ys(e,o)||e.push(o)}),e}function Sp(i,t){return Id(t).filter(e=>!Ys(i,e))}var Qs=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=jd(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=zd(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t=void 0){this.control&&this.control.reset(t)}hasError(t,e){return this.control?this.control.hasError(t,e):!1}getError(t,e){return this.control?this.control.getError(t,e):null}},lo=class extends Qs{name;get formDirective(){return null}get path(){return null}},Bn=class extends Qs{_parent=null;name=null;valueAccessor=null},Rd=class{_cd;constructor(t){this._cd=t}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},Sv={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},HE=Ie(Y({},Sv),{"[class.ng-submitted]":"isSubmitted"}),Qe=(()=>{class i extends Rd{constructor(e){super(e)}static \u0275fac=function(n){return new(n||i)(Pe(Bn,2))};static \u0275dir=ee({type:i,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(n,o){n&2&&A("ng-untouched",o.isUntouched)("ng-touched",o.isTouched)("ng-pristine",o.isPristine)("ng-dirty",o.isDirty)("ng-valid",o.isValid)("ng-invalid",o.isInvalid)("ng-pending",o.isPending)},standalone:!1,features:[ye]})}return i})();var da="VALID",qs="INVALID",er="PENDING",ma="DISABLED",Fi=class{},Xs=class extends Fi{value;source;constructor(t,e){super(),this.value=t,this.source=e}},ua=class extends Fi{pristine;source;constructor(t,e){super(),this.pristine=t,this.source=e}},pa=class extends Fi{touched;source;constructor(t,e){super(),this.touched=t,this.source=e}},tr=class extends Fi{status;source;constructor(t,e){super(),this.status=t,this.source=e}},Ks=class extends Fi{source;constructor(t){super(),this.source=t}},Zs=class extends Fi{source;constructor(t){super(),this.source=t}};function Up(i){return(ol(i)?i.validators:i)||null}function kv(i){return Array.isArray(i)?jd(i):i||null}function $p(i,t){return(ol(t)?t.asyncValidators:i)||null}function Mv(i){return Array.isArray(i)?zd(i):i||null}function ol(i){return i!=null&&!Array.isArray(i)&&typeof i=="object"}function Ev(i,t,e){let n=i.controls;if(!(t?Object.keys(n):n).length)throw new de(1e3,"");if(!n[e])throw new de(1001,"")}function Tv(i,t,e){i._forEachChild((n,o)=>{if(e[o]===void 0)throw new de(1002,"")})}var Js=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(t,e){this._assignValidators(t),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get status(){return _n(this.statusReactive)}set status(t){_n(()=>this.statusReactive.set(t))}_status=ft(()=>this.statusReactive());statusReactive=Te(void 0);get valid(){return this.status===da}get invalid(){return this.status===qs}get pending(){return this.status==er}get disabled(){return this.status===ma}get enabled(){return this.status!==ma}errors;get pristine(){return _n(this.pristineReactive)}set pristine(t){_n(()=>this.pristineReactive.set(t))}_pristine=ft(()=>this.pristineReactive());pristineReactive=Te(!0);get dirty(){return!this.pristine}get touched(){return _n(this.touchedReactive)}set touched(t){_n(()=>this.touchedReactive.set(t))}_touched=ft(()=>this.touchedReactive());touchedReactive=Te(!1);get untouched(){return!this.touched}_events=new F;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._assignValidators(t)}setAsyncValidators(t){this._assignAsyncValidators(t)}addValidators(t){this.setValidators(wp(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(wp(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(Sp(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(Sp(t,this._rawAsyncValidators))}hasValidator(t){return Ys(this._rawValidators,t)}hasAsyncValidator(t){return Ys(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){let e=this.touched===!1;this.touched=!0;let n=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsTouched(Ie(Y({},t),{sourceControl:n})),e&&t.emitEvent!==!1&&this._events.next(new pa(!0,n))}markAllAsDirty(t={}){this.markAsDirty({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsDirty(t))}markAllAsTouched(t={}){this.markAsTouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(t))}markAsUntouched(t={}){let e=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let n=t.sourceControl??this;this._forEachChild(o=>{o.markAsUntouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:n})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,n),e&&t.emitEvent!==!1&&this._events.next(new pa(!1,n))}markAsDirty(t={}){let e=this.pristine===!0;this.pristine=!1;let n=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsDirty(Ie(Y({},t),{sourceControl:n})),e&&t.emitEvent!==!1&&this._events.next(new ua(!1,n))}markAsPristine(t={}){let e=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let n=t.sourceControl??this;this._forEachChild(o=>{o.markAsPristine({onlySelf:!0,emitEvent:t.emitEvent})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t,n),e&&t.emitEvent!==!1&&this._events.next(new ua(!0,n))}markAsPending(t={}){this.status=er;let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new tr(this.status,e)),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.markAsPending(Ie(Y({},t),{sourceControl:e}))}disable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=ma,this.errors=null,this._forEachChild(o=>{o.disable(Ie(Y({},t),{onlySelf:!0}))}),this._updateValue();let n=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new Xs(this.value,n)),this._events.next(new tr(this.status,n)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Ie(Y({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(o=>o(!0))}enable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=da,this._forEachChild(n=>{n.enable(Ie(Y({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(Ie(Y({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(n=>n(!1))}_updateAncestors(t,e){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine({},e),this._parent._updateTouched({},e))}setParent(t){this._parent=t}getRawValue(){return this.value}updateValueAndValidity(t={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let n=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===da||this.status===er)&&this._runAsyncValidator(n,t.emitEvent)}let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new Xs(this.value,e)),this._events.next(new tr(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(Ie(Y({},t),{sourceControl:e}))}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?ma:da}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,e){if(this.asyncValidator){this.status=er,this._hasOwnPendingAsyncValidator={emitEvent:e!==!1,shouldHaveEmitted:t!==!1};let n=Np(this.asyncValidator(this));this._asyncValidationSubscription=n.subscribe(o=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(o,{emitEvent:e,shouldHaveEmitted:t})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let t=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,t}return!1}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(e.emitEvent!==!1,this,e.shouldHaveEmitted)}get(t){let e=t;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((n,o)=>n&&n._find(o),this)}getError(t,e){let n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t,e,n){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),(t||n)&&this._events.next(new tr(this.status,e)),this._parent&&this._parent._updateControlsErrors(t,e,n)}_initObservables(){this.valueChanges=new H,this.statusChanges=new H}_calculateStatus(){return this._allControlsDisabled()?ma:this.errors?qs:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(er)?er:this._anyControlsHaveStatus(qs)?qs:da}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t,e){let n=!this._anyControlsDirty(),o=this.pristine!==n;this.pristine=n,this._parent&&!t.onlySelf&&this._parent._updatePristine(t,e),o&&this._events.next(new ua(this.pristine,e))}_updateTouched(t={},e){this.touched=this._anyControlsTouched(),this._events.next(new pa(this.touched,e)),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,e)}_onDisabledChange=[];_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){ol(t)&&t.updateOn!=null&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){let e=this._parent&&this._parent.dirty;return!t&&!!e&&!this._parent._anyControlsDirty()}_find(t){return null}_assignValidators(t){this._rawValidators=Array.isArray(t)?t.slice():t,this._composedValidatorFn=kv(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=Mv(this._rawAsyncValidators)}},el=class extends Js{constructor(t,e,n){super(Up(e),$p(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,n={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,n={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){Tv(this,!0,t),Object.keys(t).forEach(n=>{Ev(this,!0,n),this.controls[n].setValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t!=null&&(Object.keys(t).forEach(n=>{let o=this.controls[n];o&&o.patchValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((n,o)=>{n.reset(t?t[o]:null,{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e),e?.emitEvent!==!1&&this._events.next(new Zs(this))}getRawValue(){return this._reduceChildren({},(t,e,n)=>(t[n]=e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(e,n)=>n._syncPendingControls()?!0:e);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){Object.keys(this.controls).forEach(e=>{let n=this.controls[e];n&&t(n,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(let[e,n]of Object.entries(this.controls))if(this.contains(e)&&t(n))return!0;return!1}_reduceValue(){let t={};return this._reduceChildren(t,(e,n,o)=>((n.enabled||this.disabled)&&(e[o]=n.value),e))}_reduceChildren(t,e){let n=t;return this._forEachChild((o,r)=>{n=e(n,o,r)}),n}_allControlsDisabled(){for(let t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(t){return this.controls.hasOwnProperty(t)?this.controls[t]:null}};var ga=new te("",{providedIn:"root",factory:()=>rl}),rl="always";function Pv(i,t){return[...t.path,i]}function tl(i,t,e=rl){Bd(i,t),t.valueAccessor.writeValue(i.value),(i.disabled||e==="always")&&t.valueAccessor.setDisabledState?.(i.disabled),Av(i,t),Iv(i,t),Dv(i,t),Ov(i,t)}function kp(i,t,e=!0){let n=()=>{};t.valueAccessor&&(t.valueAccessor.registerOnChange(n),t.valueAccessor.registerOnTouched(n)),il(i,t),i&&(t._invokeOnDestroyCallbacks(),i._registerOnCollectionChange(()=>{}))}function nl(i,t){i.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function Ov(i,t){if(t.valueAccessor.setDisabledState){let e=n=>{t.valueAccessor.setDisabledState(n)};i.registerOnDisabledChange(e),t._registerOnDestroy(()=>{i._unregisterOnDisabledChange(e)})}}function Bd(i,t){let e=Hp(i);t.validator!==null?i.setValidators(xp(e,t.validator)):typeof e=="function"&&i.setValidators([e]);let n=Wp(i);t.asyncValidator!==null?i.setAsyncValidators(xp(n,t.asyncValidator)):typeof n=="function"&&i.setAsyncValidators([n]);let o=()=>i.updateValueAndValidity();nl(t._rawValidators,o),nl(t._rawAsyncValidators,o)}function il(i,t){let e=!1;if(i!==null){if(t.validator!==null){let o=Hp(i);if(Array.isArray(o)&&o.length>0){let r=o.filter(a=>a!==t.validator);r.length!==o.length&&(e=!0,i.setValidators(r))}}if(t.asyncValidator!==null){let o=Wp(i);if(Array.isArray(o)&&o.length>0){let r=o.filter(a=>a!==t.asyncValidator);r.length!==o.length&&(e=!0,i.setAsyncValidators(r))}}}let n=()=>{};return nl(t._rawValidators,n),nl(t._rawAsyncValidators,n),e}function Av(i,t){t.valueAccessor.registerOnChange(e=>{i._pendingValue=e,i._pendingChange=!0,i._pendingDirty=!0,i.updateOn==="change"&&qp(i,t)})}function Dv(i,t){t.valueAccessor.registerOnTouched(()=>{i._pendingTouched=!0,i.updateOn==="blur"&&i._pendingChange&&qp(i,t),i.updateOn!=="submit"&&i.markAsTouched()})}function qp(i,t){i._pendingDirty&&i.markAsDirty(),i.setValue(i._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1}function Iv(i,t){let e=(n,o)=>{t.valueAccessor.writeValue(n),o&&t.viewToModelUpdate(n)};i.registerOnChange(e),t._registerOnDestroy(()=>{i._unregisterOnChange(e)})}function Gp(i,t){i==null,Bd(i,t)}function Rv(i,t){return il(i,t)}function Fv(i,t){if(!i.hasOwnProperty("model"))return!1;let e=i.model;return e.isFirstChange()?!0:!Object.is(t,e.currentValue)}function Nv(i){return Object.getPrototypeOf(i.constructor)===co}function Yp(i,t){i._syncPendingControls(),t.forEach(e=>{let n=e.control;n.updateOn==="submit"&&n._pendingChange&&(e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1)})}function Vv(i,t){if(!t)return null;Array.isArray(t);let e,n,o;return t.forEach(r=>{r.constructor===je?e=r:Nv(r)?n=r:o=r}),o||n||e||null}function Lv(i,t){let e=i.indexOf(t);e>-1&&i.splice(e,1)}var jv={provide:lo,useExisting:it(()=>fa)},ha=Promise.resolve(),fa=(()=>{class i extends lo{callSetDisabledState;get submitted(){return _n(this.submittedReactive)}_submitted=ft(()=>this.submittedReactive());submittedReactive=Te(!1);_directives=new Set;form;ngSubmit=new H;options;constructor(e,n,o){super(),this.callSetDisabledState=o,this.form=new el({},jd(e),zd(n))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){ha.then(()=>{let n=this._findContainer(e.path);e.control=n.registerControl(e.name,e.control),tl(e.control,e,this.callSetDisabledState),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){ha.then(()=>{let n=this._findContainer(e.path);n&&n.removeControl(e.name),this._directives.delete(e)})}addFormGroup(e){ha.then(()=>{let n=this._findContainer(e.path),o=new el({});Gp(o,e),n.registerControl(e.name,o),o.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){ha.then(()=>{let n=this._findContainer(e.path);n&&n.removeControl(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,n){ha.then(()=>{this.form.get(e.path).setValue(n)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submittedReactive.set(!0),Yp(this.form,this._directives),this.ngSubmit.emit(e),this.form._events.next(new Ks(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}static \u0275fac=function(n){return new(n||i)(Pe(Mn,10),Pe(Ld,10),Pe(ga,8))};static \u0275dir=ee({type:i,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(n,o){n&1&&_("submit",function(a){return o.onSubmit(a)})("reset",function(){return o.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[ge([jv]),ye]})}return i})();function Mp(i,t){let e=i.indexOf(t);e>-1&&i.splice(e,1)}function Ep(i){return typeof i=="object"&&i!==null&&Object.keys(i).length===2&&"value"in i&&"disabled"in i}var Qp=class extends Js{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(t=null,e,n){super(Up(e),$p(n,e)),this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),ol(e)&&(e.nonNullable||e.initialValueIsDefault)&&(Ep(t)?this.defaultValue=t.value:this.defaultValue=t)}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&e.emitModelToViewChange!==!1&&this._onChange.forEach(n=>n(this.value,e.emitViewToModelChange!==!1)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=this.defaultValue,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1,e?.emitEvent!==!1&&this._events.next(new Zs(this))}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){Mp(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){Mp(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(t){Ep(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}};var zv=i=>i instanceof Qp;var Bv={provide:Bn,useExisting:it(()=>We)},Tp=Promise.resolve(),We=(()=>{class i extends Bn{_changeDetectorRef;callSetDisabledState;control=new Qp;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new H;constructor(e,n,o,r,a,c){super(),this._changeDetectorRef=a,this.callSetDisabledState=c,this._parent=e,this._setValidators(n),this._setAsyncValidators(o),this.valueAccessor=Vv(this,r)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){let n=e.name.previousValue;this.formDirective.removeControl({name:n,path:this._getPath(n)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),Fv(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){tl(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(e){Tp.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){let n=e.isDisabled.currentValue,o=n!==0&&K(n);Tp.then(()=>{o&&!this.control.disabled?this.control.disable():!o&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?Pv(e,this._parent):[e]}static \u0275fac=function(n){return new(n||i)(Pe(lo,9),Pe(Mn,10),Pe(Ld,10),Pe(Xt,10),Pe(He,8),Pe(ga,8))};static \u0275dir=ee({type:i,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[ge([Bv]),ye,Ve]})}return i})();var Hv={provide:Xt,useExisting:it(()=>_a),multi:!0},_a=(()=>{class i extends co{writeValue(e){let n=e??"";this.setProperty("value",n)}registerOnChange(e){this.onChange=n=>{e(n==""?null:parseFloat(n))}}static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275dir=ee({type:i,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(n,o){n&1&&_("input",function(a){return o.onChange(a.target.value)})("blur",function(){return o.onTouched()})},standalone:!1,features:[ge([Hv]),ye]})}return i})(),Wv={provide:Xt,useExisting:it(()=>mo),multi:!0};var Uv=(()=>{class i{_accessors=[];add(e,n){this._accessors.push([e,n])}remove(e){for(let n=this._accessors.length-1;n>=0;--n)if(this._accessors[n][1]===e){this._accessors.splice(n,1);return}}select(e){this._accessors.forEach(n=>{this._isSameGroup(n,e)&&n[1]!==e&&n[1].fireUncheck(e.value)})}_isSameGroup(e,n){return e[0].control?e[0]._parent===n._control._parent&&e[1].name===n.name:!1}static \u0275fac=function(n){return new(n||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),mo=(()=>{class i extends co{_registry;_injector;_state;_control;_fn;setDisabledStateFired=!1;onChange=()=>{};name;formControlName;value;callSetDisabledState=d(ga,{optional:!0})??rl;constructor(e,n,o,r){super(e,n),this._registry=o,this._injector=r}ngOnInit(){this._control=this._injector.get(Bn),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(e){this._state=e===this.value,this.setProperty("checked",this._state)}registerOnChange(e){this._fn=e,this.onChange=()=>{e(this.value),this._registry.select(this)}}setDisabledState(e){(this.setDisabledStateFired||e||this.callSetDisabledState==="whenDisabledForLegacyCode")&&this.setProperty("disabled",e),this.setDisabledStateFired=!0}fireUncheck(e){this.writeValue(e)}_checkName(){this.name&&this.formControlName&&(this.name,this.formControlName),!this.name&&this.formControlName&&(this.name=this.formControlName)}static \u0275fac=function(n){return new(n||i)(Pe(nt),Pe(ne),Pe(Uv),Pe(ve))};static \u0275dir=ee({type:i,selectors:[["input","type","radio","formControlName",""],["input","type","radio","formControl",""],["input","type","radio","ngModel",""]],hostBindings:function(n,o){n&1&&_("change",function(){return o.onChange()})("blur",function(){return o.onTouched()})},inputs:{name:"name",formControlName:"formControlName",value:"value"},standalone:!1,features:[ge([Wv]),ye]})}return i})(),$v={provide:Xt,useExisting:it(()=>Hd),multi:!0},Hd=(()=>{class i extends co{writeValue(e){this.setProperty("value",parseFloat(e))}registerOnChange(e){this.onChange=n=>{e(n==""?null:parseFloat(n))}}static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275dir=ee({type:i,selectors:[["input","type","range","formControlName",""],["input","type","range","formControl",""],["input","type","range","ngModel",""]],hostBindings:function(n,o){n&1&&_("change",function(a){return o.onChange(a.target.value)})("input",function(a){return o.onChange(a.target.value)})("blur",function(){return o.onTouched()})},standalone:!1,features:[ge([$v]),ye]})}return i})();var qv={provide:lo,useExisting:it(()=>ba)},ba=(()=>{class i extends lo{callSetDisabledState;get submitted(){return _n(this._submittedReactive)}set submitted(e){this._submittedReactive.set(e)}_submitted=ft(()=>this._submittedReactive());_submittedReactive=Te(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new H;constructor(e,n,o){super(),this.callSetDisabledState=o,this._setValidators(e),this._setAsyncValidators(n)}ngOnChanges(e){e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(il(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){let n=this.form.get(e.path);return tl(n,e,this.callSetDisabledState),n.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),n}getControl(e){return this.form.get(e.path)}removeControl(e){kp(e.control||null,e,!1),Lv(this.directives,e)}addFormGroup(e){this._setUpFormContainer(e)}removeFormGroup(e){this._cleanUpFormContainer(e)}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e)}removeFormArray(e){this._cleanUpFormContainer(e)}getFormArray(e){return this.form.get(e.path)}updateModel(e,n){this.form.get(e.path).setValue(n)}onSubmit(e){return this._submittedReactive.set(!0),Yp(this.form,this.directives),this.ngSubmit.emit(e),this.form._events.next(new Ks(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0,n={}){this.form.reset(e,n),this._submittedReactive.set(!1)}_updateDomValue(){this.directives.forEach(e=>{let n=e.control,o=this.form.get(e.path);n!==o&&(kp(n||null,e),zv(o)&&(tl(o,e,this.callSetDisabledState),e.control=o))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(e){let n=this.form.get(e.path);Gp(n,e),n.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(e){if(this.form){let n=this.form.get(e.path);n&&Rv(n,e)&&n.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){Bd(this.form,this),this._oldForm&&il(this._oldForm,this)}static \u0275fac=function(n){return new(n||i)(Pe(Mn,10),Pe(Ld,10),Pe(ga,8))};static \u0275dir=ee({type:i,selectors:[["","formGroup",""]],hostBindings:function(n,o){n&1&&_("submit",function(a){return o.onSubmit(a)})("reset",function(){return o.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[ge([qv]),ye,Ve]})}return i})();var Gv={provide:Xt,useExisting:it(()=>al),multi:!0};function Xp(i,t){return i==null?`${t}`:(t&&typeof t=="object"&&(t="Object"),`${i}: ${t}`.slice(0,50))}function Yv(i){return i.split(":")[0]}var al=(()=>{class i extends co{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;appRefInjector=d(Rr).injector;destroyRef=d($i);cdr=d(He);_queuedWrite=!1;_writeValueAfterRender(){this._queuedWrite||this.appRefInjector.destroyed||(this._queuedWrite=!0,Gt({write:()=>{this.destroyRef.destroyed||(this._queuedWrite=!1,this.writeValue(this.value))}},{injector:this.appRefInjector}))}writeValue(e){this.cdr.markForCheck(),this.value=e;let n=this._getOptionId(e),o=Xp(n,e);this.setProperty("value",o)}registerOnChange(e){this.onChange=n=>{this.value=this._getOptionValue(n),e(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(e){for(let n of this._optionMap.keys())if(this._compareWith(this._optionMap.get(n),e))return n;return null}_getOptionValue(e){let n=Yv(e);return this._optionMap.has(n)?this._optionMap.get(n):e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275dir=ee({type:i,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(n,o){n&1&&_("change",function(a){return o.onChange(a.target.value)})("blur",function(){return o.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[ge([Gv]),ye]})}return i})(),sl=(()=>{class i{_element;_renderer;_select;id;constructor(e,n,o){this._element=e,this._renderer=n,this._select=o,this._select&&(this.id=this._select._registerOption())}set ngValue(e){this._select!=null&&(this._select._optionMap.set(this.id,e),this._setElementValue(Xp(this.id,e)),this._select._writeValueAfterRender())}set value(e){this._setElementValue(e),this._select&&this._select._writeValueAfterRender()}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select._writeValueAfterRender())}static \u0275fac=function(n){return new(n||i)(Pe(ne),Pe(nt),Pe(al,9))};static \u0275dir=ee({type:i,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return i})(),Qv={provide:Xt,useExisting:it(()=>Kp),multi:!0};function Pp(i,t){return i==null?`${t}`:(typeof t=="string"&&(t=`'${t}'`),t&&typeof t=="object"&&(t="Object"),`${i}: ${t}`.slice(0,50))}function Xv(i){return i.split(":")[0]}var Kp=(()=>{class i extends co{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;writeValue(e){this.value=e;let n;if(Array.isArray(e)){let o=e.map(r=>this._getOptionId(r));n=(r,a)=>{r._setSelected(o.indexOf(a.toString())>-1)}}else n=(o,r)=>{o._setSelected(!1)};this._optionMap.forEach(n)}registerOnChange(e){this.onChange=n=>{let o=[],r=n.selectedOptions;if(r!==void 0){let a=r;for(let c=0;c<a.length;c++){let u=a[c],p=this._getOptionValue(u.value);o.push(p)}}else{let a=n.options;for(let c=0;c<a.length;c++){let u=a[c];if(u.selected){let p=this._getOptionValue(u.value);o.push(p)}}}this.value=o,e(o)}}_registerOption(e){let n=(this._idCounter++).toString();return this._optionMap.set(n,e),n}_getOptionId(e){for(let n of this._optionMap.keys())if(this._compareWith(this._optionMap.get(n)._value,e))return n;return null}_getOptionValue(e){let n=Xv(e);return this._optionMap.has(n)?this._optionMap.get(n)._value:e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275dir=ee({type:i,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(n,o){n&1&&_("change",function(a){return o.onChange(a.target)})("blur",function(){return o.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[ge([Qv]),ye]})}return i})(),ll=(()=>{class i{_element;_renderer;_select;id;_value;constructor(e,n,o){this._element=e,this._renderer=n,this._select=o,this._select&&(this.id=this._select._registerOption(this))}set ngValue(e){this._select!=null&&(this._value=e,this._setElementValue(Pp(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._select?(this._value=e,this._setElementValue(Pp(this.id,e)),this._select.writeValue(this._select.value)):this._setElementValue(e)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}_setSelected(e){this._renderer.setProperty(this._element.nativeElement,"selected",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(n){return new(n||i)(Pe(ne),Pe(nt),Pe(Kp,9))};static \u0275dir=ee({type:i,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return i})();function Kv(i){return typeof i=="number"?i:parseInt(i,10)}function Zp(i){return typeof i=="number"?i:parseFloat(i)}var cl=(()=>{class i{_validator=Gs;_onChange;_enabled;ngOnChanges(e){if(this.inputName in e){let n=this.normalizeInput(e[this.inputName].currentValue);this._enabled=this.enabled(n),this._validator=this._enabled?this.createValidator(n):Gs,this._onChange&&this._onChange()}}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e}enabled(e){return e!=null}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i,features:[Ve]})}return i})(),Zv={provide:Mn,useExisting:it(()=>Wd),multi:!0},Wd=(()=>{class i extends cl{max;inputName="max";normalizeInput=e=>Zp(e);createValidator=e=>Dp(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275dir=ee({type:i,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(n,o){n&2&&G("max",o._enabled?o.max:null)},inputs:{max:"max"},standalone:!1,features:[ge([Zv]),ye]})}return i})(),Jv={provide:Mn,useExisting:it(()=>va),multi:!0},va=(()=>{class i extends cl{min;inputName="min";normalizeInput=e=>Zp(e);createValidator=e=>Ap(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275dir=ee({type:i,selectors:[["input","type","number","min","","formControlName",""],["input","type","number","min","","formControl",""],["input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(n,o){n&2&&G("min",o._enabled?o.min:null)},inputs:{min:"min"},standalone:!1,features:[ge([Jv]),ye]})}return i})(),e0={provide:Mn,useExisting:it(()=>ho),multi:!0};var ho=(()=>{class i extends cl{required;inputName="required";normalizeInput=K;createValidator=e=>Ip;enabled(e){return e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275dir=ee({type:i,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(n,o){n&2&&G("required",o._enabled?"":null)},inputs:{required:"required"},standalone:!1,features:[ge([e0]),ye]})}return i})();var t0={provide:Mn,useExisting:it(()=>Ud),multi:!0},Ud=(()=>{class i extends cl{maxlength;inputName="maxlength";normalizeInput=e=>Kv(e);createValidator=e=>Rp(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275dir=ee({type:i,selectors:[["","maxlength","","formControlName",""],["","maxlength","","formControl",""],["","maxlength","","ngModel",""]],hostVars:1,hostBindings:function(n,o){n&2&&G("maxlength",o._enabled?o.maxlength:null)},inputs:{maxlength:"maxlength"},standalone:!1,features:[ge([t0]),ye]})}return i})();var n0=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({})}return i})();var Xe=(()=>{class i{static withConfig(e){return{ngModule:i,providers:[{provide:ga,useValue:e.callSetDisabledState??rl}]}}static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({imports:[n0]})}return i})();var i0=["inputElement"];function o0(i,t){if(i&1&&(s(0,"span",3),h(1),l()),i&2){let e=g();m(),B(e.label)}}function r0(i,t){if(i&1&&(s(0,"small",5),h(1),l()),i&2){let e=g();m(),B(e.hint)}}var dl=class i{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||i)};static \u0275cmp=M({type:i,selectors:[["app-text-input"]],viewQuery:function(e,n){if(e&1&&ie(i0,5),e&2){let o;U(o=$())&&(n.inputElement=o.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,n){if(e&1){let o=E();s(0,"div",1)(1,"label",2),w(2,o0,2,1,"span",3),s(3,"input",4,0),L("ngModelChange",function(a){return v(o),V(n.inputValue,a)||(n.inputValue=a),y(a)}),_("ngModelChange",function(a){return v(o),y(n.onValueChange(a))})("keydown.enter",function(){return v(o),y(n.onEnter())}),l()(),w(5,r0,2,1,"small",5),l()}e&2&&(m(2),S(n.label?2:-1),m(),N("ngModel",n.inputValue),x("placeholder",n.placeholder)("disabled",n.isDisabled),m(2),S(n.hint?5:-1))},dependencies:[Xe,je,Qe,We,De],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 a0=["nameInput"],s0=["pathInput"];function l0(i,t){if(i&1&&(s(0,"div",7),h(1),l()),i&2){let e=g();m(),B(e.errorMessage)}}var ml=class i{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||i)};static \u0275cmp=M({type:i,selectors:[["app-project-create"]],viewQuery:function(e,n){if(e&1&&(ie(a0,5),ie(s0,5)),e&2){let o;U(o=$())&&(n.nameInput=o.first),U(o=$())&&(n.pathInput=o.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,n){if(e&1){let o=E();s(0,"div",2)(1,"h3",3),h(2,"Create New Project"),l(),s(3,"div",4)(4,"app-text-input",5,0),_("valueChange",function(a){return v(o),y(n.projectName=a)})("enterPressed",function(){return v(o),y(n.onNameEnter())}),l(),s(6,"app-text-input",6,1),_("valueChange",function(a){return v(o),y(n.projectPath=a)})("enterPressed",function(){return v(o),y(n.onCreate())}),l(),w(8,l0,2,1,"div",7),l(),s(9,"div",8)(10,"button",9),_("click",function(){return v(o),y(n.onCancel())}),h(11,"Cancel"),l(),s(12,"button",10),_("click",function(){return v(o),y(n.onCreate())}),h(13),l()()()}e&2&&(m(4),x("value",n.projectName)("isDisabled",n.isCreating)("autoFocus",!0),m(2),x("value",n.projectPath)("isDisabled",n.isCreating)("autoFocus",!1),m(2),S(n.errorMessage?8:-1),m(2),x("disabled",n.isCreating),m(2),x("disabled",!n.isValid()||n.isCreating),m(),oe(" ",n.isCreating?"Creating...":"Create Project"," "))},dependencies:[De,dl,At],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 c0(i,t){if(i&1){let e=E();s(0,"app-project-create",10),_("create",function(o){v(e);let r=g();return y(r.onCreateProject(o))})("cancelled",function(){v(e);let o=g();return y(o.closeCreateForm())}),l()}if(i&2){let e=g();x("isCreating",e.isCreating)}}function d0(i,t){i&1&&(s(0,"div",6),I(1,"div",11),s(2,"p",12),h(3,"Loading projects..."),l()())}function m0(i,t){if(i&1&&(s(0,"div",7)(1,"p",13),h(2),l()()),i&2){let e=g();m(2),B(e.error)}}function h0(i,t){if(i&1){let e=E();s(0,"app-choice-select",14),_("choiceSelected",function(o){v(e);let r=g();return y(r.selectProject(o))}),l()}if(i&2){let e=g();x("options",e.projectOptions())("labelHtml","Select a project to continue")("isVisible",!0)}}function u0(i,t){if(i&1){let e=E();s(0,"div",9)(1,"p",15),h(2,"No projects available."),l(),s(3,"button",16),_("click",function(){v(e);let o=g();return y(o.openCreateForm())}),h(4,"Create your first project"),l()()}}var hl=class i{isLoading=!1;error=null;showCreateForm=!1;isCreating=!1;router=d(wi);projectStateService=d(we);projects=Vt(this.projectStateService.projectList$);forcedProject=Vt(this.projectStateService.forcedProject$);projectOptions=ft(()=>{let t=this.projects();if(!t)return[];let e=t.filter(a=>!a.volatile),n=t.filter(a=>a.volatile),r=[...e,...n].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=ft(()=>!this.forcedProject());constructor(){this.projectStateService.selectedProject$.pipe(Vs(),he(t=>!!t),he(()=>this.router.url.split("?")[0]==="/"),St(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||i)};static \u0275cmp=M({type:i,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,n){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),w(6,c0,1,1,"app-project-create",5)(7,d0,4,0,"div",6)(8,m0,3,1,"div",7)(9,h0,1,3,"app-choice-select",8)(10,u0,5,0,"div",9),l()()()()),e&2&&(m(6),S(n.showCreateForm?6:n.isLoading?7:n.error?8:n.projects()&&n.projects().length>0?9:10))},dependencies:[De,Zo,Jo,ml,At],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 rt=class i{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new re("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();enterToSendSubject=new re(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new re(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new re("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new re(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new re(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new re(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new re(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new re(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new re(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new re(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new re(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new re(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new re(!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 n=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(n);let o=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(o);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 u=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(u);let p=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(p);let b=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(b);let C=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(C);let T=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(T);let P=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(P);let k=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(k),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return J(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 n=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(n);let o=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(o);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 u=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(u);let p=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(p);let b=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(b);let C=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(C);let T=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(T);let P=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(P);let k=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(k),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(t,e){return this.getPreferenceSync(t,e)}getPreferenceSync(t,e){try{let n=localStorage.getItem(this.STORAGE_KEY);if(!n)return e;let o=JSON.parse(n);return o[t]!==void 0?o[t]:e}catch{return e}}getPreferenceAsync(t,e){return J(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(t,e);try{let n=yield this.electronStorage.get(this.STORAGE_KEY);if(!n)return e;let o=JSON.parse(n);return o[t]!==void 0?o[t]:e}catch{return e}})}setPreference(t,e){this.isDesktopApp?this.setPreferenceAsync(t,e):this.setPreferenceSync(t,e)}setPreferenceSync(t,e){try{let n=localStorage.getItem(this.STORAGE_KEY),o=n?JSON.parse(n):{};o[t]=e,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(o)),this.updateSubject(t,e)}catch(n){console.error("Failed to set preference:",n)}}setPreferenceAsync(t,e){return J(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(t,e);return}try{let n=yield this.electronStorage.get(this.STORAGE_KEY),o=n?JSON.parse(n):{};o[t]=e,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(o)),this.updateSubject(t,e)}catch(n){console.error("Failed to set preference:",n)}})}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||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};function $d(i,t=80){if(i.length<=t)return i;try{if(i.trim().startsWith("{")||i.trim().startsWith("[")){let e=JSON.parse(i),n=JSON.stringify(e);return n.length<=t?n:n.substring(0,t)+`...(${n.length} chars)`}}catch{}return i.substring(0,t)+"..."}var Ct=class{constructor(t,e){this.type=e;if(t.timestamp)this.timestamp=t.timestamp;else{let n=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${n}`}this.parentKey=t.parentKey,this.length=0}timestamp;parentKey;static type;length},ul=class extends Ct{invite;constructor(t,e){super(t,e),this.invite=t.invite}buildAnswer(t){return new on({answer:t,parentKey:this.timestamp,invite:this.invite})}},ir=class i extends Ct{static type="heartbeat";constructor(t){super(t,i.type)}},ci=class i extends ul{defaultValue;static type="invite";constructor(t){super(t,i.type),this.defaultValue=t.defaultValue}},qd="InviteEventDefault",on=class i extends Ct{answer;invite;static type="answer";constructor(t){super(t,i.type),this.answer=t.answer??"No answer",this.invite=t.invite}},uo=class i extends Ct{speaker;text;static type="text";constructor(t){super(t,i.type),this.speaker=t.speaker,this.text=t.text}},or=class i extends Ct{chunk;static type="text_chunk";constructor(t){super(t,i.type),this.chunk=t.chunk,this.length=this.chunk.length}},po=class i extends Ct{warning;static type="warn";constructor(t){super(t,i.type),this.warning=t.warning}},En=class i extends Ct{error;static type="error";constructor(t){super(t,i.type),this.error=t.error}},di=class i extends ul{options;optionalQuestion;static type="choice";constructor(t){super(t,i.type),this.options=t.options,this.optionalQuestion=t.optionalQuestion}},mi=class i extends Ct{toolRequestId;name;args;static type="tool_request";constructor(t){super(t,i.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 Hn({output:t,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(t=50){let e=$d(this.args,t);return`\u{1F527} ${this.name}(${e})`}},Hn=class i extends Ct{toolRequestId;output;static type="tool_response";constructor(t){if(super(t,i.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(),n=$d(e,t),o=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${n}${o}`}},Ni=class i extends Ct{static type="thinking";static debounce=5e3;constructor(t){super(t,i.type)}},go=class i extends Ct{summary;static type="summary";constructor(t){super(t,i.type),this.summary=t.summary,this.length=this.summary.length}toSingleLineString(t=80){return`\u{1F4CB} Summary: ${$d(this.summary,t)}`}},hi=class i extends Ct{role;name;content;static type="message";constructor(t){super(t,i.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 n=(e.width||0)*(e.height||0)/750;return n?n*3.5:e.content.length}return 0}).reduce((e,n)=>e+n,0)}getTextContent(){return this.content.filter(t=>t.type==="text").map(t=>t.content).join(`
|
|
68
|
+
`)}},rr=class i extends Ct{threadId;name;static type="thread_update";constructor(t){super(t,i.type),this.threadId=t.threadId,this.name=t.name}},Vi=class i extends Ct{filename;operation;size;mimeType;static type="file";constructor(t){super(t,i.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}`}},ar=class i extends Ct{authUrl;state;integrationName;static type="oauth_request";constructor(t){super(t,i.type),this.authUrl=t.authUrl,this.state=t.state,this.integrationName=t.integrationName}},Wn=class i extends Ct{code;state;integrationName;error;errorDescription;static type="oauth_callback";constructor(t){super(t,i.type),this.code=t.code,this.state=t.state,this.integrationName=t.integrationName,this.error=t.error,this.errorDescription=t.errorDescription}},p0={[hi.type]:hi,[on.type]:on,[di.type]:di,[En.type]:En,[ir.type]:ir,[ci.type]:ci,[mi.type]:mi,[Hn.type]:Hn,[uo.type]:uo,[or.type]:or,[Ni.type]:Ni,[po.type]:po,[rr.type]:rr,[go.type]:go,[Vi.type]:Vi,[ar.type]:ar,[Wn.type]:Wn};function Gd(i){let t=p0[i.type];return t?new t(i):void 0}var HT=[{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
|
+
|
|
70
|
+
<task>
|
|
71
|
+
{{PARAMETERS}}
|
|
72
|
+
</task>
|
|
73
|
+
|
|
74
|
+
There will be 3 phases:
|
|
75
|
+
1. Research and understanding
|
|
76
|
+
2. Clarifying questions
|
|
77
|
+
3. Plan creation
|
|
78
|
+
|
|
79
|
+
Do not try to do all at once, wait for my request at each time.
|
|
80
|
+
|
|
81
|
+
Now we start with phase 1:
|
|
82
|
+
|
|
83
|
+
1. **Analyze the request** to identify:
|
|
84
|
+
- Core requirements and objectives
|
|
85
|
+
- Implicit assumptions or expectations
|
|
86
|
+
- Technical scope and constraints
|
|
87
|
+
|
|
88
|
+
2. **Research relevant context** using available tools:
|
|
89
|
+
- Use whatever tools you have available (file reading, API calls, search, etc.)
|
|
90
|
+
- Gather information about existing patterns, structures, and conventions
|
|
91
|
+
- Identify relevant files, modules, or resources
|
|
92
|
+
- Document key findings briefly
|
|
93
|
+
|
|
94
|
+
3. **Assess feasibility**:
|
|
95
|
+
- Identify potential challenges or blockers
|
|
96
|
+
- Note any dependencies or prerequisites
|
|
97
|
+
- Consider alternative approaches if applicable
|
|
98
|
+
|
|
99
|
+
Do not assume you have specific tools - use what's available to you.
|
|
100
|
+
|
|
101
|
+
Do not produce any document at this stage as you will have access to the accumulated research results later.
|
|
102
|
+
`,`@ let's continue with Phase 2: Clarifying Questions regarding the initial task.
|
|
103
|
+
|
|
104
|
+
<task>
|
|
105
|
+
{{PARAMETERS}}
|
|
106
|
+
</task>
|
|
107
|
+
|
|
108
|
+
Based on your research and understanding:
|
|
109
|
+
|
|
110
|
+
1. **Identify ambiguities** or missing information that could impact the completion of the task
|
|
111
|
+
- no boundaries
|
|
112
|
+
- insufficient definition of done
|
|
113
|
+
- lack of pre-requisites
|
|
114
|
+
|
|
115
|
+
2. **Ask focused questions** if clarification is needed:
|
|
116
|
+
- Use the 'invite' or 'choice' tools for user input
|
|
117
|
+
- Keep questions concise and specific
|
|
118
|
+
- Prioritize questions that significantly impact the approach
|
|
119
|
+
|
|
120
|
+
3. **Skip this phase** if the requirements are clear enough to proceed
|
|
121
|
+
|
|
122
|
+
Remember: Only ask questions that are truly necessary to create a solid plan.`,`@ finish with Phase 3: Plan Creation
|
|
123
|
+
|
|
124
|
+
Break down the task into 3-10 clear, actionable steps. Each step should be substantial enough to represent meaningful progress, but focused enough to be completed in one session.
|
|
125
|
+
|
|
126
|
+
Create a detailed execution plan:
|
|
127
|
+
- if you have access to the exchange area, save the plan there as 'plan.md'.
|
|
128
|
+
- otherwise, output the plan in the conversation.
|
|
129
|
+
- do not write any other document
|
|
130
|
+
|
|
131
|
+
The plan must follow this Markdown structure:
|
|
132
|
+
|
|
133
|
+
# Execution Plan: [Task Title]
|
|
134
|
+
|
|
135
|
+
## Overview
|
|
136
|
+
1-2 sentence summary of what will be accomplished.
|
|
137
|
+
|
|
138
|
+
## Context
|
|
139
|
+
Key information and constraints identified during research:
|
|
140
|
+
- Relevant patterns/conventions found
|
|
141
|
+
- Constraints or limitations
|
|
142
|
+
- Dependencies or prerequisites
|
|
143
|
+
- Key resources or materials involved
|
|
144
|
+
|
|
145
|
+
## Steps
|
|
146
|
+
|
|
147
|
+
### Step 1: [Step Title]
|
|
148
|
+
- **What to do**: Clear description of the action to take
|
|
149
|
+
- **Resources needed**: List files, tools, information, or materials required
|
|
150
|
+
- **Expected outcome**: What should be produced or achieved
|
|
151
|
+
- **Validation**: How to verify this step is complete
|
|
152
|
+
- **Dependencies**: Which previous steps must complete first (or "None")
|
|
153
|
+
|
|
154
|
+
### Step 2: [Step Title]
|
|
155
|
+
[Same structure as Step 1]
|
|
156
|
+
|
|
157
|
+
[Continue for all steps...]
|
|
158
|
+
|
|
159
|
+
## Success Criteria
|
|
160
|
+
How to verify the task is fully complete:
|
|
161
|
+
1. Objective measures of completion
|
|
162
|
+
2. Quality checks or review points
|
|
163
|
+
3. Final validation steps
|
|
164
|
+
|
|
165
|
+
## Risks & Considerations
|
|
166
|
+
- Potential challenges or obstacles
|
|
167
|
+
- Alternative approaches considered
|
|
168
|
+
- Areas requiring special attention
|
|
169
|
+
- Future improvements or follow-up items
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
After outputting the plan in the right place (in exchange or in conversation or according to user directives):
|
|
174
|
+
- do not produce other outputs nor documents
|
|
175
|
+
- do not start executing the plan`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-execute-plan",name:"execute-plan",description:"Execute a previously created plan step by step, with validation and progress tracking.",source:"builtin",commands:[`@ Execute the plan from the exchange area or outlined previously in the conversation:
|
|
176
|
+
|
|
177
|
+
## Preparation
|
|
178
|
+
1. **Load the plan**: Read from exchange area (plan.md) or use previously discussed plan
|
|
179
|
+
2. **Review**: Understand the overall objective, context, and step sequence
|
|
180
|
+
3. **Pre-check**: Verify prerequisites are met; report any obvious issues
|
|
181
|
+
|
|
182
|
+
## Step-by-Step Execution
|
|
183
|
+
|
|
184
|
+
For each step in order:
|
|
185
|
+
|
|
186
|
+
1. **Announce**: State which step you're starting and what you'll do
|
|
187
|
+
2. **Check dependencies**: Verify required previous steps are complete
|
|
188
|
+
3. **Execute**: Perform the actions specified in the step
|
|
189
|
+
4. **Validate**: Apply the validation criteria from the plan
|
|
190
|
+
5. **Report**: Confirm completion and note any deviations
|
|
191
|
+
|
|
192
|
+
**For significant or risky steps**: Ask user confirmation before proceeding (use 'choice' tool)
|
|
193
|
+
|
|
194
|
+
## Issue Handling
|
|
195
|
+
|
|
196
|
+
If a step fails:
|
|
197
|
+
- Report the issue clearly
|
|
198
|
+
- Suggest solutions (retry, skip if non-critical, or stop)
|
|
199
|
+
- Use 'choice' tool to ask how to proceed if needed
|
|
200
|
+
|
|
201
|
+
## Completion
|
|
202
|
+
|
|
203
|
+
1. **Final verification**: Apply success criteria from the plan
|
|
204
|
+
2. **Summary**: Report what was accomplished, any deviations, validation results, and next steps
|
|
205
|
+
|
|
206
|
+
## Guidelines
|
|
207
|
+
- Follow the plan's order unless circumstances require adaptation
|
|
208
|
+
- Communicate progress clearly at each step, without excessive details
|
|
209
|
+
- Ask for guidance when the plan is unclear or issues arise`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-re-prompt",name:"re-prompt",description:"Transform a vague request into a detailed, actionable prompt",source:"builtin",commands:[`@ I need you to analyze and reformulate the following request to make it more precise and actionable.
|
|
210
|
+
|
|
211
|
+
## User's initial request
|
|
212
|
+
|
|
213
|
+
{{PARAMETERS}}
|
|
214
|
+
|
|
215
|
+
## Your task
|
|
216
|
+
|
|
217
|
+
1. **Analyze the request** to identify:
|
|
218
|
+
- What is explicitly stated
|
|
219
|
+
- What is implicit or assumed
|
|
220
|
+
- What information is missing or ambiguous
|
|
221
|
+
- The likely intent behind the request
|
|
222
|
+
|
|
223
|
+
2. **Ask clarifying questions** if needed:
|
|
224
|
+
- If the request is too vague or has multiple interpretations
|
|
225
|
+
- If critical information is missing
|
|
226
|
+
- Use the 'invite' or 'choice' tools to gather necessary details
|
|
227
|
+
|
|
228
|
+
3. **Reformulate the request** into a clear, detailed, and actionable prompt:
|
|
229
|
+
- Make implicit requirements explicit
|
|
230
|
+
- Add relevant context from the current project
|
|
231
|
+
- Specify expected outcomes or deliverables
|
|
232
|
+
- Break down complex requests into clear steps if needed
|
|
233
|
+
- Use precise technical terminology when appropriate
|
|
234
|
+
|
|
235
|
+
4. **Present the reformulated request** and ask for confirmation:
|
|
236
|
+
- Show the enhanced version clearly
|
|
237
|
+
- Explain key changes or additions you made
|
|
238
|
+
- Ask if this matches the user's intent
|
|
239
|
+
|
|
240
|
+
The goal is to transform a rough idea into a well-defined request that will produce better AI responses.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-memory-learn",name:"memory-learn",description:"Extract and memorize new knowledge gained from recent context",source:"builtin",commands:[`@ Learn about the following topic and memorize relevant insights if defined:
|
|
241
|
+
|
|
242
|
+
<topic>
|
|
243
|
+
{{PARAMETERS}}
|
|
244
|
+
</topic>
|
|
245
|
+
|
|
246
|
+
If no specific topic is provided, extract learnings from the entire recent conversation context.
|
|
247
|
+
|
|
248
|
+
## Process
|
|
249
|
+
|
|
250
|
+
1. **Identify new knowledge**: From the recent conversation context, identify what you learned that:
|
|
251
|
+
- Was not in the initially given context
|
|
252
|
+
- Is specific to this user or project (not generic knowledge)
|
|
253
|
+
- Is useful and worth remembering
|
|
254
|
+
- Represents understanding, not just file copies
|
|
255
|
+
|
|
256
|
+
2. **Organize insights**: Split the knowledge into cohesive subjects, each with:
|
|
257
|
+
- **Title**: Short and descriptive (one sentence maximum)
|
|
258
|
+
- **Content**: Detailed explanation of what was learned
|
|
259
|
+
- Length: at most 3 paragraphs or short extracts and notes
|
|
260
|
+
- Format: Well-structured markdown
|
|
261
|
+
- Focus: Specific patterns, decisions, constraints, or insights
|
|
262
|
+
|
|
263
|
+
3. **Check for redundancy**: Before memorizing:
|
|
264
|
+
- Review the list of existing memories to avoid duplication
|
|
265
|
+
- If a similar memory exists, consider updating it instead of creating a new one
|
|
266
|
+
- delete memories if needed
|
|
267
|
+
|
|
268
|
+
4. **Memorize**: Use the memorization tools to save each subject:
|
|
269
|
+
- Choose appropriate level if available (PROJECT or USER)
|
|
270
|
+
- Ensure clear structure and completeness
|
|
271
|
+
- Memorize one subject at a time
|
|
272
|
+
|
|
273
|
+
## Guidelines
|
|
274
|
+
- Focus on actionable insights, not generic facts
|
|
275
|
+
- Ensure memories are self-contained and clear
|
|
276
|
+
- Avoid redundancy with existing memories
|
|
277
|
+
- Prioritize quality over quantity`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-memory-curate",name:"memory-curate",description:"Analyze and clean up the memory system by consolidating redundancies and removing outdated information",source:"builtin",commands:[`@ we start a 4 phase memory curation process. Complete only the requested phase at each time.
|
|
278
|
+
|
|
279
|
+
Phase 1: Analyze redundancies
|
|
280
|
+
|
|
281
|
+
Review all current memories to identify:
|
|
282
|
+
|
|
283
|
+
1. **Redundant memories** that:
|
|
284
|
+
- Cover similar or overlapping topics
|
|
285
|
+
- Contain duplicate information
|
|
286
|
+
- Could be consolidated for better clarity
|
|
287
|
+
|
|
288
|
+
2. **For each group of redundant memories**:
|
|
289
|
+
- List the memory titles involved
|
|
290
|
+
- Explain the redundancy briefly
|
|
291
|
+
- Propose a consolidation approach
|
|
292
|
+
|
|
293
|
+
Do not make changes yet - just analyze and report findings.`,`@ Phase 2: Consolidate redundancies
|
|
294
|
+
|
|
295
|
+
Based on the analysis from Phase 1:
|
|
296
|
+
|
|
297
|
+
1. **For each identified redundancy**:
|
|
298
|
+
- Delete the individual redundant memories using deleteMemory
|
|
299
|
+
- Create a new consolidated memory that:
|
|
300
|
+
- Maintains all critical details from the originals
|
|
301
|
+
- Provides clear, well-structured content
|
|
302
|
+
- Uses appropriate level (PROJECT or USER)
|
|
303
|
+
- Explain your consolidation reasoning
|
|
304
|
+
|
|
305
|
+
2. **Be proactive but careful**: Preserve important details while eliminating duplication.`,`@ Phase 3: Check for outdated information
|
|
306
|
+
|
|
307
|
+
Review remaining memories for accuracy and relevance:
|
|
308
|
+
|
|
309
|
+
1. **Compare each memory against**:
|
|
310
|
+
- Other memories for inconsistencies
|
|
311
|
+
- Current project context for outdated information
|
|
312
|
+
- Core documentation for misalignments
|
|
313
|
+
|
|
314
|
+
2. **For each problematic memory**:
|
|
315
|
+
- List the memory title with brief explanation of the issue
|
|
316
|
+
- Take appropriate action:
|
|
317
|
+
- Delete if outdated or incorrect
|
|
318
|
+
- Update if incomplete or partially incorrect
|
|
319
|
+
- Consolidate if it fits better elsewhere
|
|
320
|
+
- Explain your reasoning clearly
|
|
321
|
+
|
|
322
|
+
Be thorough in your analysis.`,`@ Phase 4: Final verification
|
|
323
|
+
|
|
324
|
+
Verify the memory system's overall health:
|
|
325
|
+
|
|
326
|
+
1. **Review the current state**:
|
|
327
|
+
- Check overall structure and organization
|
|
328
|
+
- Verify each memory for completeness and validity
|
|
329
|
+
- Confirm proper categorization (PROJECT vs USER)
|
|
330
|
+
|
|
331
|
+
2. **Document the results**:
|
|
332
|
+
- Summarize what was consolidated or removed
|
|
333
|
+
- List any remaining issues or concerns
|
|
334
|
+
- Provide recommendations for maintaining memory quality
|
|
335
|
+
|
|
336
|
+
This ensures the memory system stays efficient and valuable.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""}];var tP=[hi.type,mi.type,Hn.type,go.type,ci.type,di.type,on.type];var Jp={CONFLUENCE:[],GIT:[],GITLAB:[],JIRA:[],SLACK:[],ZENDESK:[],BASECAMP:[]},vP=Object.keys(Jp).filter(i=>Jp[i]?.length===0);var Un=class i{eventSource=null;eventsSubject=new F;connectionStatusSubject=new re({connected:!1,reconnectAttempts:0,maxAttempts:3});reconnectAttempts=0;MAX_RECONNECT_ATTEMPTS=3;RECONNECT_DELAY=2e3;events$=this.eventsSubject.asObservable();connectionStatus$=this.connectionStatusSubject.asObservable();ngZone=d(ue);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 n=`/api/projects/${t}/threads/${e}/event-stream`;console.log("[SSE] EventSource URL:",n),this.eventSource=new EventSource(n),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),n=Gd(e);n?(console.log("[SSE] Event:",n.type),this.eventsSubject.next(n)):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 En({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 En({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||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var Li=class i{http=d(Ge);projectState=d(we);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})}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`,{})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var Dt=class i{selectedThreadIdSubject=new re(null);isLoadingSubject=new re(!1);isLoadingThreadListSubject=new re(!1);refreshThreadListSubject=new F;threadListSubject=new re([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=d(Li);projectStateService=d(we);projectName$=this.projectStateService.selectedProject$.pipe(be(t=>t?.name),ja());constructor(){Xn([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(Ft(void 0))]).pipe(st(([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))}),Dn(([t])=>t?(console.log("[THREAD_STATE] Fetching threads for project:",t),this.threadApi.listThreads().pipe(be(e=>({threads:e,projectName:t})),Ui(e=>(console.error("[THREAD_STATE] Error loading thread list:",e),wt({threads:[],projectName:t}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),wt({threads:[],projectName:null}))),st(({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();selectedThread$=Xn([this.projectName$,this.selectedThreadIdSubject.pipe(ja())]).pipe(st(([t,e])=>{console.log("\u{1F43C} combineLatest emitted:",{projectName:t,threadId:e})}),Dn(([t,e])=>!t||!e?(console.log("\u{1F43C} null"),wt(null)):(console.log("\u{1F43C} loading thread:",e),this.isLoadingSubject.next(!0),this.threadApi.getThread(e).pipe(st(n=>{console.log("\u{1F43C} loaded thread:",n?.id)}),bi({bufferSize:1,refCount:!0})))),st(()=>{console.log("\u{1F43C} finished loading"),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()}renameThread(t,e){let n=e.trim();return!n||n.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),Ar(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",t,"to:",n),this.threadApi.updateThread(t,n).pipe(st(o=>{console.log("[THREAD_STATE] Thread renamed successfully:",o),this.refreshThreadList()}),Ui(o=>(console.error("[THREAD_STATE] Error renaming thread:",o),Ar(()=>o)))))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var sr=class i{http=d(Ge);projectState=d(we);threadState=d(Dt);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"})}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||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var hn=class i{destroy$=new F;currentProject=null;currentThread=null;messagesSubject=new re([]);isThinkingSubject=new re(!1);currentChoiceSubject=new re(null);projectTitleSubject=new re("Coday");currentInviteEventSubject=new re(null);messageToRestoreSubject=new re("");threadUpdateEventSubject=new re(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new re("");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=d(Un);messageApi=d(sr);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),setTimeout(()=>this.processUnansweredInvites(),500)}processUnansweredInvites(){let t=this.messagesSubject.value,e=t.filter(n=>n.type==="text"&&n.parentKey===void 0&&n.invite!==void 0).filter(n=>!t.some(o=>o.type==="text"&&o.role==="user"&&o.parentKey===n.id));e.length>0&&console.log("[CODAY] Found",e.length,"unanswered invite(s)")}resetMessages(){this.messagesSubject.next([]),this.currentChoiceSubject.next(null),this.currentInviteEventSubject.next(null),this.currentChoiceEvent=null,this.accumulatedChunks="",this.streamingTextSubject.next(""),this.stopThinking()}sendMessage(t){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send message: no project or thread selected");return}this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive();let e=this.currentInviteEventSubject.value;if(e){let n=e.buildAnswer(t);this.currentInviteEventSubject.next(null),this.messageApi.sendMessage(n).subscribe({error:o=>{console.error("[CODAY] Send error:",o),this.stopThinking()}})}else{let n=new on({answer:t});this.messageApi.sendMessage(n).subscribe({error:o=>{console.error("[CODAY] Send error:",o),this.stopThinking()}})}}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:n=>{console.error("[CODAY-CHOICE] Choice error:",n),this.stopThinking()}})}else console.error("[CODAY-CHOICE] No choice event available for choice:",t)}deleteMessage(t){let e=this.messagesSubject.value.find(o=>o.id===t),n=this.extractTextContentFromMessage(e);return this.messageApi.deleteMessage(t).pipe(st(o=>{o.success&&(this.removeMessagesFromIndex(t),n.trim()&&this.messageToRestoreSubject.next(n))}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive()}initializeEventHandling(){this.eventStream.events$.pipe(z(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){t instanceof hi?this.handleMessageEvent(t):t instanceof or?this.handleTextChunkEvent(t):t instanceof uo?this.handleTextEvent(t):t instanceof on?this.handleAnswerEvent(t):t instanceof En?this.handleErrorEvent(t):t instanceof po?this.handleWarnEvent(t):t instanceof Ni?this.handleThinkingEvent(t):t instanceof mi?this.handleToolRequestEvent(t):t instanceof Hn?this.handleToolResponseEvent(t):t instanceof di?this.handleChoiceEvent(t):t instanceof ir?this.handleHeartBeatEvent(t):t instanceof ci?this.handleInviteEvent(t):t instanceof rr?this.handleThreadUpdateEvent(t):t instanceof ar||t instanceof Wn||console.warn("[CODAY] Unhandled event type:",t.type)}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:new 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:new Date,type:t.speaker?"text":"technical"};this.addMessage(e)}handleAnswerEvent(t){let e={id:t.timestamp,role:"user",speaker:"User",content:[{type:"text",content:t.answer}],timestamp:new 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:new 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:new 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()},Ni.debounce+1e3))}handleToolRequestEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:new 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:new Date,type:"technical",eventId:t.timestamp};this.addMessage(e)}handleChoiceEvent(t){this.stopThinking(),this.currentChoiceEvent=t,this.tabTitleService?.setSystemInactive();let e=t.options.map(o=>({value:o,label:o})),n=t.optionalQuestion?`${t.optionalQuestion} ${t.invite}`:t.invite;this.currentChoiceSubject.next({options:e,label:n})}handleHeartBeatEvent(t){}handleInviteEvent(t){this.stopThinking();let e=this.messagesSubject.value,n=e[e.length-1];if(!(!(t.invite===qd)&&n&&n.role==="assistant"&&n.content.some(a=>a.type==="text"&&a.content.includes(t.invite)))&&t.invite!==qd){let a={id:t.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:t.invite}],timestamp:new Date,type:"text"};this.addMessage(a)}this.currentInviteEventSubject.next(t),this.tabTitleService?.setSystemInactive()}addMessage(t){let n=[...this.messagesSubject.value,t];this.messagesSubject.next(n)}removeMessagesFromIndex(t){let e=this.messagesSubject.value,n=e.findIndex(r=>r.id===t);if(n===-1||n===0)return;let o=e.slice(0,n);this.messagesSubject.next(o),this.stopThinking()}extractTextContentFromMessage(t){return t?t.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
337
|
+
|
|
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||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var lr=class i{http=d(Ge);agentsCache=new Map;getAgents(t){let e=this.agentsCache.get(t);return e?wt(e):this.http.get(`/api/projects/${t}/agents`).pipe(st(n=>{this.agentsCache.set(t,n)}))}getAgentsAutocomplete(t,e){return this.getAgents(t).pipe(be(n=>{if(!e)return n;let o=e.toLowerCase();return n.filter(r=>{let a=r.name.toLowerCase(),c=r.description?.toLowerCase()||"";return a.includes(o)||c.includes(o)})}))}clearCache(t){this.agentsCache.delete(t)}clearAllCache(){this.agentsCache.clear()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var un=class i{http=d(Ge);projectState=d(we);promptsCache=new Map;getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/prompts`}listPrompts(){return this.http.get(this.getBaseUrl())}getPromptsAutocomplete(t,e){let n=this.promptsCache.get(t);return n?wt(this.filterPromptsForAutocomplete(n,e)):this.http.get(`/api/projects/${t}/prompts`).pipe(be(o=>(this.promptsCache.set(t,o),this.filterPromptsForAutocomplete(o,e))))}filterPromptsForAutocomplete(t,e){let n=e.toLowerCase();return t.filter(r=>r.name.toLowerCase().includes(n)||r.description.toLowerCase().includes(n)).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(be(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}updatePrompt(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e).pipe(be(n=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),n)))}deletePrompt(t){return this.http.delete(`${this.getBaseUrl()}/${t}`).pipe(be(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||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var pl=class i{sanitizer=d(Rn);transform(t,e){if(!e||!t)return t;let n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`(${n})`,"gi"),r=t.replace(o,"<strong>$1</strong>");return this.sanitizer.bypassSecurityTrustHtml(r)}static \u0275fac=function(e){return new(e||i)};static \u0275pipe=Gm({name:"highlight",type:i,pure:!0})};var f0=["messageInput"],_0=["fileInput"],b0=(i,t)=>t.name;function v0(i,t){i&1&&(s(0,"div",3),I(1,"span",7),h(2," Recording... Click mic to stop "),l())}function y0(i,t){if(i&1&&(s(0,"span",12),h(1),l()),i&2){let e=g().$implicit,n=g(2);m(),B(" "+(n.getParameterFormat(e)||""))}}function C0(i,t){if(i&1){let e=E();s(0,"div",9),_("click",function(){let o=v(e).$index,r=g(2);return y(r.selectAutocompleteItemByClick(o))})("keydown.enter",function(){let o=v(e).$index,r=g(2);return y(r.selectAutocompleteItemByClick(o))})("keydown.space",function(){let o=v(e).$index,r=g(2);return y(r.selectAutocompleteItemByClick(o))})("mouseenter",function(){let o=v(e).$index,r=g(2);return y(r.selectedAutocompleteIndex=o)}),s(1,"div",10),I(2,"span",11),Yi(3,"highlight"),w(4,y0,2,1,"span",12),l(),I(5,"div",13),Yi(6,"highlight"),l()}if(i&2){let e=t.$implicit,n=t.$index,o=g(2);A("selected",n===o.selectedAutocompleteIndex),G("aria-selected",n===o.selectedAutocompleteIndex),m(2),x("innerHTML",Nr(3,6,o.autocompleteTrigger+e.name,o.getAutocompleteQuery()),Zt),m(2),S(o.hasParameterFormat(e)?4:-1),m(),x("innerHTML",Nr(6,9,e.description,o.getAutocompleteQuery()),Zt)}}function x0(i,t){if(i&1&&(s(0,"div",4),Oe(1,C0,7,12,"div",8,b0),l()),i&2){let e=g();m(),Ae(e.autocompleteItems)}}function w0(i,t){if(i&1){let e=E();s(0,"ds-icon-button",15),_("action",function(){v(e);let o=g(2);return y(o.onStopClick())}),l()}}function S0(i,t){if(i&1){let e=E();s(0,"ds-icon-button",18),_("action",function(){v(e);let o=g(3);return y(o.triggerFileUpload())}),l(),s(1,"input",19,1),_("change",function(o){v(e);let r=g(3);return y(r.onFileInputChange(o))}),l()}if(i&2){let e=g(3);x("disabled",e.isDisabled||e.isLocallyDisabled)}}function k0(i,t){if(i&1){let e=E();s(0,"ds-icon-button",16),_("action",function(){v(e);let o=g(2);return y(o.sendMessage())}),l(),w(1,S0,3,1),s(2,"ds-icon-button",17),_("action",function(){v(e);let o=g(2);return y(o.toggleRecording())}),l()}if(i&2){let e=g(2);A("hidden",e.isDisabled||!e.message.trim()||e.isLocallyDisabled)("active",!!e.message.trim()&&!e.isDisabled&&!e.isLocallyDisabled),x("title",e.getSendButtonTooltip())("disabled",e.isDisabled||!e.message.trim()||e.isLocallyDisabled),m(),S(e.showWelcome?-1:1),m(),A("recording",e.isRecording)("hidden",e.message.trim()),x("icon",e.isRecording?"fiber_manual_record":"mic")("title",e.isRecording?"Click to stop recording":"Click to start recording")}}function M0(i,t){if(i&1&&w(0,w0,1,0,"ds-icon-button",14)(1,k0,3,13),i&2){let e=g();S(e.isThinking?0:1)}}var cr=class i{static MIN_TEXTAREA_LINES=2;static MAX_TEXTAREA_LINES=15;isDisabled=!1;showWelcome=!1;isThinking=!1;isStarting=!1;isSessionInitializing=!1;isStopping=!1;isLocallyDisabled=!1;filesPasted=new H;messageSubmitted=new H;voiceRecordingToggled=new H;heightChanged=new H;stopRequested=new H;messageInput;fileInput;message="";isRecording=!1;isFocused=!1;recognition=null;sessionHadTranscript=!1;pendingLineBreaksTimeout=null;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=d(rt);codayService=d(hn);agentApiService=d(lr);promptApiService=d(un);projectStateService=d(we);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,this.isLocallyDisabled=!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"),this.isLocallyDisabled=!1,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 n=Array.from(e).filter(r=>r.kind==="file");if(!n.length)return;t.preventDefault();let o=n.reduce((r,a)=>{let c=a.getAsFile();return c?[...r,c]:r},[]);o.length&&this.filesPasted.emit(o)}triggerFileUpload(){console.log("[CHAT-TEXTAREA] Triggering file upload"),this.fileInput?.nativeElement?.click()}onFileInputChange(t){let e=t.target,n=e.files;if(!n||n.length===0){console.log("[CHAT-TEXTAREA] No files selected");return}console.log("[CHAT-TEXTAREA] Files selected:",n.length);let o=Array.from(n);this.filesPasted.emit(o),e.value=""}onDocumentClick(t){if(!this.autocompleteVisible)return;let e=t.target,n=document.querySelector(".autocomplete-popup"),o=this.messageInput?.nativeElement;n&&!n.contains(e)&&o&&!o.contains(e)&&this.hideAutocomplete()}sendMessage(t=!1){let e=this.message.trim();!this.isDisabled&&!this.isLocallyDisabled&&(t||e)&&(this.isLocallyDisabled=!0,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 n="";for(let o=e.resultIndex;o<e.results.length;o++){let r=e.results[o][0].transcript;e.results[o].isFinal&&(n+=r)}if(n){let o=this.improveTranscriptPunctuation(n.trim());this.sessionHadTranscript=!0,console.log("[SPEECH] onresult ending, appending to textarea",this.isRecording),this.appendToTextarea(o)}},this.recognition.onend=()=>{console.log("[SPEECH] Recognition ended. Was recording:",this.isRecording),this.isRecording=!1,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.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 J(this,null,function*(){if(!(!this.recognition||this.isRecording))try{this.isRecording=!0,this.sessionHadTranscript=!1,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 n=this.message.length;this.messageInput.nativeElement.setSelectionRange(n,n)}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
|
+
|
|
340
|
+
`),this.sessionHadTranscript=!1),this.pendingLineBreaksTimeout=null},500)}clearPendingLineBreaks(){this.pendingLineBreaksTimeout&&(clearTimeout(this.pendingLineBreaksTimeout),this.pendingLineBreaksTimeout=null)}adjustTextareaHeight(){let t=this.messageInput?.nativeElement;if(!t)return;let e=window.getComputedStyle(t),n=parseFloat(e.fontSize),o=parseFloat(e.lineHeight)||n*1.5,r=o*i.MIN_TEXTAREA_LINES+parseFloat(e.paddingTop)+parseFloat(e.paddingBottom),a=o*i.MAX_TEXTAREA_LINES+parseFloat(e.paddingTop)+parseFloat(e.paddingBottom);t.style.height="auto";let c=t.scrollHeight;c<r?c=r:c>a&&(c=a),t.style.height=`${c}px`;let u=t.parentElement?.offsetHeight??c+32;this.heightChanged.emit(u)}getSendButtonShortcut(){return this.useEnterToSend?"Enter":navigator.platform.toLowerCase().includes("mac")?"\u2318+Enter":"Ctrl+Enter"}getSendButtonTooltip(){return this.useEnterToSend?"Send message (Enter) - Shift+Enter for new line":`Send message (${navigator.platform.toLowerCase().includes("mac")?"Cmd+Enter":"Ctrl+Enter"}) - Enter for new line`}getPlaceholder(){return this.isSessionInitializing?"Initializing session...":this.isThinking?this.isStopping?"Stopping...":this.isStarting?"Processing request...":this.currentThinkingPhrase:this.showWelcome?"How can I help you today?":"Type '@' for agents, '/' for commands, or just your message..."}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..."}subscribeToInviteEvents(){this.subscriptions.push(this.codayService.currentInviteEvent$.subscribe(t=>{t?this.handleInviteEvent(t.invite,t.defaultValue):this.currentInvite=""}))}handleInviteEvent(t,e){this.currentInvite=t,this.isLocallyDisabled=!1,e&&(this.message=e,setTimeout(()=>this.adjustTextareaHeight(),0)),setTimeout(()=>{this.messageInput?.nativeElement&&this.messageInput.nativeElement.focus()},50)}subscribeToMessageRestore(){this.subscriptions.push(this.codayService.messageToRestore$.subscribe(t=>{t.trim()&&(console.log("[CHAT-TEXTAREA] Restoring message content:",t.substring(0,50)+"..."),this.restoreMessageContent(t))}))}restoreMessageContent(t){this.message=t,this.messageInput?.nativeElement&&(this.messageInput.nativeElement.focus(),setTimeout(()=>{let e=this.messageInput.nativeElement,n=this.message.length;e.setSelectionRange(n,n)},0)),setTimeout(()=>this.adjustTextareaHeight(),10)}focusTextarea(){let t=this.messageInput?.nativeElement;console.log("[CHAT-TEXTAREA] focusTextarea called",{hasElement:!!t,isDisabled:this.isDisabled,isThinking:this.isThinking,elementDisabled:t?.disabled,isSessionInitializing:this.isSessionInitializing}),t&&!t.disabled?(t.focus(),console.log("[CHAT-TEXTAREA] Textarea focused successfully")):console.log("[CHAT-TEXTAREA] Focus blocked - element disabled or not available")}checkForAutocomplete(){let t=this.message;if(t.startsWith("@")){let e=t.substring(1);if(e.includes(" ")){this.hideAutocomplete();return}this.showAgentAutocomplete(e);return}if(t.startsWith("/")){let e=t.substring(1);if(e.includes(" ")){this.hideAutocomplete();return}this.showPromptAutocomplete(e);return}this.hideAutocomplete()}showAgentAutocomplete(t){this.autocompleteTrigger="@";try{let e=this.projectStateService.getSelectedProjectIdOrThrow();this.agentApiService.getAgentsAutocomplete(e,t).subscribe({next:n=>{this.autocompleteItems=n,this.autocompleteVisible=n.length>0,this.selectedAutocompleteIndex=0},error:n=>{console.error("[AUTOCOMPLETE] Error loading agents:",n),this.hideAutocomplete()}})}catch{console.warn("[AUTOCOMPLETE] No project selected, cannot load agents"),this.hideAutocomplete()}}showPromptAutocomplete(t){this.autocompleteTrigger="/";try{let e=this.projectStateService.getSelectedProjectIdOrThrow();this.promptApiService.getPromptsAutocomplete(e,t).subscribe({next:n=>{this.autocompleteItems=n,this.autocompleteVisible=n.length>0,this.selectedAutocompleteIndex=0},error:n=>{console.error("[AUTOCOMPLETE] Error loading prompts:",n),this.hideAutocomplete()}})}catch{console.warn("[AUTOCOMPLETE] No project selected, cannot load prompts"),this.hideAutocomplete()}}hideAutocomplete(){this.autocompleteVisible=!1,this.autocompleteItems=[],this.selectedAutocompleteIndex=0}selectAutocompleteItem(){let t=this.autocompleteItems[this.selectedAutocompleteIndex];if(!t)return;let e=null;if(this.autocompleteTrigger==="/"){let n=t,o=n.parameterFormat;if(console.log(n),o===void 0)this.message=`/${t.name}`;else if(o==="")this.message=`/${t.name} `;else{this.message=`/${t.name} ${o}`;let r=this.message.indexOf('=""');r!==-1&&(e=r+2)}}else this.message=`@${t.name} `;this.hideAutocomplete(),setTimeout(()=>{if(this.messageInput?.nativeElement)if(this.messageInput.nativeElement.focus(),e!==null)this.messageInput.nativeElement.setSelectionRange(e,e);else{let n=this.message.length;this.messageInput.nativeElement.setSelectionRange(n,n)}},0)}selectAutocompleteItemByClick(t){this.selectedAutocompleteIndex=t,this.selectAutocompleteItem()}getAutocompleteQuery(){return this.message.substring(1).split(" ")[0]??""}getParameterFormat(t){return t.parameterFormat}hasParameterFormat(t){return this.autocompleteTrigger==="/"&&t.parameterFormat!==void 0}scrollSelectedItemIntoView(){setTimeout(()=>{let t=document.querySelector(".autocomplete-popup");if(!t)return;let e=t.querySelector(".autocomplete-item.selected");e&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},0)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["app-chat-textarea"]],viewQuery:function(e,n){if(e&1&&(ie(f0,7),ie(_0,5)),e&2){let o;U(o=$())&&(n.messageInput=o.first),U(o=$())&&(n.fileInput=o.first)}},hostBindings:function(e,n){e&1&&_("paste",function(r){return n.onPaste(r)})("click",function(r){return n.onDocumentClick(r)},$m)},inputs:{isDisabled:"isDisabled",showWelcome:"showWelcome",isThinking:"isThinking",isStarting:"isStarting",isSessionInitializing:"isSessionInitializing"},outputs:{filesPasted:"filesPasted",messageSubmitted:"messageSubmitted",voiceRecordingToggled:"voiceRecordingToggled",heightChanged:"heightChanged",stopRequested:"stopRequested"},features:[Ve],decls:7,vars:12,consts:[["messageInput",""],["fileInput",""],[1,"chat-input-container"],[1,"recording-indicator"],[1,"autocomplete-popup"],[1,"input-row","grouped-input"],[1,"message-input",3,"ngModelChange","keydown","input","focus","blur","ngModel","placeholder","disabled"],[1,"recording-dot"],["role","option","tabindex","0",1,"autocomplete-item",3,"selected"],["role","option","tabindex","0",1,"autocomplete-item",3,"click","keydown.enter","keydown.space","mouseenter"],[1,"item-name"],[3,"innerHTML"],[1,"parameter-format"],[1,"item-description",3,"innerHTML"],["icon","stop","variant","danger","title","Stop generation",1,"action-btn"],["icon","stop","variant","danger","title","Stop generation",1,"action-btn",3,"action"],["icon","send","variant","primary",1,"send-btn",3,"action","title","disabled"],["variant","default",1,"voice-btn",3,"action","icon","title"],["icon","attach_file","variant","default","title","Upload files (images or documents)",1,"upload-btn",3,"action","disabled"],["type","file","multiple","","accept","image/*,application/pdf,.pdf,.doc,.docx,.txt,.md,.json,.yaml,.yml,.csv,.xml,.html",2,"display","none",3,"change"]],template:function(e,n){if(e&1){let o=E();s(0,"div",2),w(1,v0,3,0,"div",3),w(2,x0,3,0,"div",4),s(3,"div",5)(4,"textarea",6,0),L("ngModelChange",function(a){return v(o),V(n.message,a)||(n.message=a),y(a)}),_("keydown",function(a){return v(o),y(n.onKeyDown(a))})("input",function(){return v(o),y(n.onInput())})("focus",function(){return v(o),y(n.isFocused=!0)})("blur",function(){return v(o),y(n.isFocused=!1)}),l(),w(6,M0,2,1),l()()}e&2&&(m(),S(n.isRecording?1:-1),m(),S(n.autocompleteVisible?2:-1),m(),A("focused",n.isFocused)("welcome-mode",n.showWelcome)("is-thinking",n.isThinking),m(),N("ngModel",n.message),x("placeholder",n.getPlaceholder())("disabled",n.isDisabled||n.isThinking||n.isLocallyDisabled),m(2),S(n.isSessionInitializing?-1:6))},dependencies:[Xe,je,Qe,We,yh,pl],styles:['@keyframes _ngcontent-%COMP%_gradientBorderShift{0%{background-position:0 0}50%{background-position:100% 0}to{background-position:0 0}}.chat-input-container[_ngcontent-%COMP%]{flex-shrink:0;width:100%;position:relative}.thinking-progress[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;height:3px;z-index:1}.thinking-progress[_ngcontent-%COMP%] .mdc-linear-progress__bar-inner{border-top-width:3px}.input-row.grouped-input[_ngcontent-%COMP%]{display:flex;align-items:center;background:var(--glass-bg);border-radius:16px;padding:0 .15rem 0 1.25rem;position:relative;transition:border-color .2s,box-shadow .2s,background .3s}.input-row[_ngcontent-%COMP%]{position:relative;background:var(--glass-bg, #1e1e1e)!important;background-clip:padding-box}.input-row[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:-2px;border-radius:inherit;background-size:200% 100%;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;padding:1px;pointer-events:none;z-index:-1;animation:_ngcontent-%COMP%_gradientBorderShift 3s ease-in-out infinite}.input-row.is-thinking[_ngcontent-%COMP%]:before{inset:0;mask:none;padding:0;opacity:.15;z-index:0;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% 100%;animation:_ngcontent-%COMP%_gradientBorderShift 3s ease-in-out infinite}.input-row.is-thinking[_ngcontent-%COMP%] .message-input[_ngcontent-%COMP%], .input-row.is-thinking[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{position:relative;z-index:1}.input-row.grouped-input.focused[_ngcontent-%COMP%]:not(.is-thinking){box-shadow:0 0 0 4px #007aff1a}.input-row.grouped-input.focused[_ngcontent-%COMP%]:not(.is-thinking):before{background:var(--color-primary);animation:none}.message-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent!important;box-shadow:none;font-size:1rem;padding:1rem 0;color:var(--color-text);resize:none;min-height:36px;max-height:70vh;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;line-height:1.5}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.message-input[_ngcontent-%COMP%]:focus{outline:none;border:none;box-shadow:none}.message-input[_ngcontent-%COMP%]:disabled{background-color:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;opacity:.6}.message-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);transition:opacity .3s ease-in-out}.message-input[_ngcontent-%COMP%]:disabled::placeholder{animation:_ngcontent-%COMP%_thinkingPulsate 2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_thinkingPulsate{0%,to{opacity:.6}50%{opacity:1}}.voice-btn[_ngcontent-%COMP%], .send-btn[_ngcontent-%COMP%], .action-btn[_ngcontent-%COMP%], .upload-btn[_ngcontent-%COMP%]{margin:0 .5rem 0 .08rem}.voice-btn.recording[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--color-error);animation:_ngcontent-%COMP%_pulse 1.5s infinite}.send-btn[_ngcontent-%COMP%]{transition:opacity .4s,margin-left .4s}.send-btn.active[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{opacity:1}.send-btn[_ngcontent-%COMP%]:not(.active) button[_ngcontent-%COMP%]{opacity:0;margin-left:calc(-.5rem - 36px)}.send-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){color:#fff;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-primary, #3b82f6) 20%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 80%,var(--color-primary, #3b82f6) 100%);background-size:300% auto;animation:sendButtonGradientShift 6s ease-in-out infinite;box-shadow:0 4px 14px #007aff30;transform:scale(1.2)}.send-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:active:not(:disabled){transform:scale(1.3);box-shadow:0 4px 24px #007aff30}.recording-indicator[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-top:.2rem;margin-bottom:.2rem;color:var(--color-error, #ff5555);font-size:.9rem;position:absolute;top:-1.5rem}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:1}50%{opacity:.5}}.autocomplete-popup[_ngcontent-%COMP%]{position:absolute;bottom:100%;left:0;right:0;margin-bottom:.5rem;background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-backdrop-blur);backdrop-filter:var(--glass-backdrop-blur);border-radius:12px;box-shadow:0 8px 32px #00000026;border:1px solid var(--color-border);max-height:400px;max-width:500px;overflow-y:auto;z-index:100}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%]{padding:.75rem 1rem;cursor:pointer;transition:background .2s;border-left:3px solid transparent}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%]:hover, .autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item.selected[_ngcontent-%COMP%]{background:var(--color-bg-hover)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item.selected[_ngcontent-%COMP%]{border-left-color:var(--color-primary)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%]{font-weight:600;color:var(--color-text);margin-bottom:.25rem;font-family:SF Mono,Monaco,Menlo,Cascadia Code,Consolas,monospace;font-size:.95rem}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%] strong{font-weight:700;color:var(--color-primary);background:var(--color-primary-light, rgba(99, 102, 241, .1));padding:0 2px;border-radius:2px}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%] .parameter-format[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-weight:400;opacity:.7}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-description[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);line-height:1.3}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-description[_ngcontent-%COMP%] strong{font-weight:700;color:var(--color-primary);background:var(--color-primary-light, rgba(99, 102, 241, .1))}@media print{.thinking-progress[_ngcontent-%COMP%], .action-btn[_ngcontent-%COMP%], .voice-btn[_ngcontent-%COMP%], .send-btn[_ngcontent-%COMP%], .upload-btn[_ngcontent-%COMP%], .recording-indicator[_ngcontent-%COMP%], .autocomplete-popup[_ngcontent-%COMP%]{display:none!important}}']})};var E0=(i,t)=>t.label;function T0(i,t){if(i&1){let e=E();s(0,"button",2),_("click",function(o){let r=v(e).$implicit,a=g();return y(a.executeAction(r,o))}),s(1,"mat-icon"),h(2),l()()}if(i&2){let e=t.$implicit;G("title",e.tooltip||e.label),m(),G("aria-label",e.label),m(),B(e.icon)}}var gl=class i{actions=[];executeAction(t,e){e.stopPropagation(),t.action()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["app-message-context-menu"]],inputs:{actions:"actions"},decls:3,vars:0,consts:[[1,"context-menu-wrapper"],["mat-icon-button",""],["mat-icon-button","",3,"click"]],template:function(e,n){e&1&&(s(0,"div",0),Oe(1,T0,3,3,"button",1,E0),l()),e&2&&(m(),Ae(n.actions))},dependencies:[De,vt,xe],styles:[".context-menu-wrapper[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center}.context-menu-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{transform:scale(.75)}"]})};var fl=class i{snackBar=d(Xr);success(t,e=2e3){this.snackBar.open(t,"",{duration:e,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-success"]})}error(t,e=3e3){this.snackBar.open(t,"",{duration:e,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-error"]})}info(t,e=2e3){this.snackBar.open(t,"",{duration:e,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-info"]})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var P0=i=>({"user-message-wrapper":i});function O0(i,t){if(i&1&&(s(0,"div",5)(1,"div",8),h(2),l()()),i&2){let e=g(2);m(2),oe(" ",e.message.speaker," ")}}function A0(i,t){if(i&1&&(s(0,"div",7),I(1,"app-message-context-menu",9),l()),i&2){let e=g(2);m(),x("actions",e.actions)}}function D0(i,t){if(i&1&&(w(0,O0,3,1,"div",5),I(1,"div",6),w(2,A0,2,1,"div",7)),i&2){let e=g();S(e.shouldShowSpeaker?0:-1),m(),x("innerHTML",e.renderedContent,Zt),m(),S(e.isLongMessage&&e.shouldShowActions&&e.message.role==="assistant"?2:-1)}}function I0(i,t){if(i&1&&(s(0,"a",11),h(1,"view"),l()),i&2){let e=g(2);x("href",e.eventLink,Io)}}function R0(i,t){if(i&1&&(s(0,"div",2),I(1,"span",10),w(2,I0,2,1,"a",11),l()),i&2){let e=g();m(),x("innerHTML",e.renderedContent,Zt),m(),S(e.eventLink?2:-1)}}function F0(i,t){if(i&1&&(s(0,"div",3),I(1,"app-message-context-menu",9),l()),i&2){let e=g();m(),x("actions",e.actions)}}function N0(i,t){if(i&1&&(s(0,"div",4),I(1,"app-message-context-menu",9),l()),i&2){let e=g();m(),x("actions",e.actions)}}var _l=class i{destroy$=new F;message;canDelete=!0;copyRequested=new H;deleteRequested=new H;renderedContent="";shouldHideTechnical=!1;shouldHideWarning=!1;sanitizer=d(Rn);notificationService=d(fl);preferencesService=d(rt);projectState=d(we);threadState=d(Dt);markdownService=d(zn);get messageClasses(){return{[this.message.role]:!0,[this.message.type]:!0,"hidden-technical":this.shouldHideTechnical&&this.message.type==="technical","hidden-warning":this.shouldHideWarning&&this.message.type==="warning"}}ngOnInit(){return J(this,null,function*(){yield this.renderMarkdown(),this.preferencesService.hideTechnicalMessages$.pipe(z(this.destroy$)).subscribe(t=>{this.shouldHideTechnical=t}),this.preferencesService.hideWarningMessages$.pipe(z(this.destroy$)).subscribe(t=>{this.shouldHideWarning=t}),this.shouldHideTechnical=this.preferencesService.getHideTechnicalMessages(),this.shouldHideWarning=this.preferencesService.getHideWarningMessages()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get shouldShowSpeaker(){return this.message.role==="user"?this.message.speaker.startsWith("@"):this.message.role==="assistant"}get shouldShowActions(){return this.message.role==="user"||this.message.role==="assistant"}get isSimplified(){return this.message.role!=="user"&&this.message.role!=="assistant"}get isLongMessage(){let t=this.extractTextContent();return t.length>1e3||t.split(`
|
|
341
|
+
`).length>20}get actions(){let t=[];return this.message.role==="user"&&this.canDelete&&t.push({icon:"delete",label:"Delete from here",tooltip:"Delete this message and all following messages",action:()=>this.onDelete(),destructive:!0}),t.push({icon:"content_copy",label:"Copy message",tooltip:"Copy message content to clipboard",action:()=>this.onCopy()}),t}get eventLink(){if(!this.message.eventId)return null;let t=this.projectState.getSelectedProjectId(),e=this.threadState.getSelectedThreadId();return!t||!e?null:`/api/projects/${t}/threads/${e}/messages/${encodeURIComponent(this.message.eventId)}/formatted`}renderMarkdown(){return J(this,null,function*(){try{let t=yield this.renderRichContent(this.message.content);this.renderedContent=this.sanitizer.bypassSecurityTrustHtml(t)}catch(t){console.error("Error parsing rich content:",t);let e=this.extractTextContent();this.renderedContent=this.sanitizer.bypassSecurityTrustHtml(e)}})}renderRichContent(t){return J(this,null,function*(){let e=[];for(let n of t)if(n.type==="text"){let o=yield this.markdownService.parse(n.content);e.push(`<div class="text-part">${o}</div>`)}else if(n.type==="image"){let o=`data:${n.mimeType};base64,${n.content}`,r=n.source||"Image",a=`
|
|
342
|
+
<div class="image-content">
|
|
343
|
+
<img src="${o}"
|
|
344
|
+
alt="${r}"
|
|
345
|
+
class="message-image"
|
|
346
|
+
style="max-width: 100%; height: auto; margin: 8px 0; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.2s ease, box-shadow 0.2s ease;"
|
|
347
|
+
onclick="window.open(this.src, '_blank')" />
|
|
348
|
+
</div>
|
|
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
|
+
|
|
351
|
+
`)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["app-chat-message"]],inputs:{message:"message",canDelete:"canDelete"},outputs:{copyRequested:"copyRequested",deleteRequested:"deleteRequested"},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,"actions","bottom-actions"],[1,"speaker"],[3,"actions"],[3,"innerHTML"],["target","_blank",1,"event-link",3,"href"]],template:function(e,n){e&1&&(s(0,"div",0)(1,"div",1),w(2,D0,3,3),w(3,R0,3,2,"div",2),l(),w(4,F0,2,1,"div",3),w(5,N0,2,1,"div",4),l()),e&2&&(x("ngClass",Zm(6,P0,n.message.role==="user")),m(),x("ngClass",n.messageClasses),m(),S(n.isSimplified?-1:2),m(),S(n.isSimplified?3:-1),m(),S(!n.isLongMessage&&n.shouldShowActions&&n.message.role==="assistant"?4:-1),m(),S(n.shouldShowActions&&n.message.role==="user"?5:-1))},dependencies:[gl,Fo],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[_ngcontent-%COMP%]{position:relative}.message.user[_ngcontent-%COMP%]{padding:1rem 1.25rem;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%]:hover{transform:translateY(-1px);box-shadow:0 12px 40px #1f268733}.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 dr=class i{unreadCountSubject=new re(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||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var mr=class i{destroy$=new F;voices;currentUtterance=null;currentOnEndCallback=null;speakingSubject=new re(!1);speaking$=this.speakingSubject.asObservable();volume=.8;rate=1.2;language="en-US";selectedVoice;preferencesService=d(rt);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 n=speechSynthesis.getVoices();if(n.length)t(n);else{let o=setTimeout(()=>{e("no voices found")},2e3);speechSynthesis.addEventListener("voiceschanged",()=>{let r=speechSynthesis.getVoices();r.length&&(clearTimeout(o),t(r))})}}),console.log("[VOICE-SERVICE] Speech synthesis initialized")}subscribeToPreferences(){this.preferencesService.voiceVolume$.pipe(z(this.destroy$)).subscribe(t=>{this.volume=t,console.log("[VOICE-SERVICE] Volume updated to:",t)}),this.preferencesService.voiceRate$.pipe(z(this.destroy$)).subscribe(t=>{this.rate=t,console.log("[VOICE-SERVICE] Rate updated to:",t)}),this.preferencesService.voiceLanguage$.pipe(z(this.destroy$)).subscribe(t=>{this.language=t,console.log("[VOICE-SERVICE] Language updated to:",t),this.updateSelectedVoiceForLanguage()}),this.preferencesService.selectedVoice$.pipe(z(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 J(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 n=this.extractPlainText(t);if(!n.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),!1;this.stopSpeech();try{let o=new SpeechSynthesisUtterance(n);o.voice=this.selectedVoice,o.lang=this.selectedVoice.lang,o.volume=this.volume,o.rate=this.rate,this.currentOnEndCallback=e||null,e&&(o.onend=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())},o.onerror=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())}),this.currentUtterance=o,this.speakingSubject.next(!0);let r=o.onend,a=o.onerror;return o.onend=c=>{this.speakingSubject.next(!1),r&&r.call(o,c)},o.onerror=c=>{this.speakingSubject.next(!1),a&&a.call(o,c)},speechSynthesis.speak(o),console.log("[VOICE-SERVICE] Started speaking:",t.substring(0,50)+"..."),!0}catch(o){return console.error("[VOICE-SERVICE] Error speaking:",o),!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(),n=t.createGain();e.connect(n),n.connect(t.destination),e.frequency.setValueAtTime(800,t.currentTime),n.gain.setValueAtTime(.1,t.currentTime),n.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 J(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 n=e.filter(o=>o.lang.toLowerCase().startsWith(t)).sort((o,r)=>o.localService&&!r.localService?-1:!o.localService&&r.localService?1:o.name.localeCompare(r.name));return console.log("[VOICE-SERVICE] Found matching voices:",n.length,"for language:",t),n.map(o=>({name:o.name,lang:o.lang,localService:o.localService,default:o.default,displayName:this.formatVoiceDisplayName(o)}))}catch(t){return console.error("[VOICE-SERVICE] Error getting voices for language:",t),[]}})}formatVoiceDisplayName(t){let e=t.localService?"\u{1F3E0}":"\u2601\uFE0F",n=t.default?" \u2B50":"";return`${e} ${t.name} (${t.lang})${n}`}setSelectedVoice(t){return J(this,null,function*(){if(!t){this.selectedVoice=void 0;return}let[e,n]=t.split("|");if(!e||!n){this.selectedVoice=void 0;return}let o=(yield this.voices)?.find(r=>r.name===e&&r.lang===n);o?(this.selectedVoice=o,console.log("[VOICE-SERVICE] Selected voice:",o.name,o.lang)):(this.selectedVoice=void 0,console.warn("[VOICE-SERVICE] Voice not found:",e,n))})}updateSelectedVoiceForLanguage(){return J(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[o,r]=e.split("|"),a=r?.slice(0,2),c=this.language.slice(0,2);if(a===c&&t.some(p=>p.name===o&&p.lang===r)){console.log("[VOICE-SERVICE] Keeping current voice for language:",e);return}}let n=t[0];if(n){let o=`${n.name}|${n.lang}`;this.preferencesService.setSelectedVoice(o),console.log("[VOICE-SERVICE] Auto-selected voice for language change:",n.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(/ /g," ").replace(/&/g,"and").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"');return e=this.addNaturalPunctuation(e),e.replace(/\s+/g," ").trim()}addNaturalPunctuation(t){return t.replace(/\n+/g,`
|
|
352
|
+
`).split(`
|
|
353
|
+
`).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||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var bl=class i{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||i)};static \u0275cmp=M({type:i,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,n){e&1&&(an(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),Gi(5,"img",5),sn(),an(6,"p",6),h(7),sn()()()()()),e&2&&(m(7),B(n.currentThinkingPhrase))},dependencies:[De],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 V0=(i,t)=>t.id;function L0(i,t){if(i&1){let e=E();s(0,"app-chat-message",4),_("copyRequested",function(o){v(e);let r=g();return y(r.onCopyMessage(o))})("deleteRequested",function(o){v(e);let r=g();return y(r.onDeleteMessage(o))}),l()}if(i&2){let e=t.$implicit,n=t.$index,o=g();x("message",e)("canDelete",o.canDeleteMessage(n))}}function j0(i,t){if(i&1&&(s(0,"div",2),I(1,"div",5),l()),i&2){let e=g();m(),x("innerHTML",e.renderedStreamingText,Zt)}}function z0(i,t){i&1&&I(0,"app-thinking-loader")}function B0(i,t){if(i&1){let e=E();s(0,"button",6),_("click",function(){v(e);let o=g();return y(o.goToBottom())}),s(1,"mat-icon",7),h(2,"arrow_downward"),l()()}}var vl=class i{messages=[];streamingText="";isThinking=!1;copyRequested=new H;stopRequested=new H;lastMessageCount=0;destroy$=new F;renderedStreamingText="";isTracking=!0;showGoToBottom=!1;scrollContainer=null;lastScrollTop=0;NEAR_BOTTOM_THRESHOLD=100;scrollCheckTimeout;isProgrammaticScroll=!1;MESSAGE_FRESHNESS_THRESHOLD=300*1e3;elementRef=d(ne);unreadService=d(dr);voiceSynthesisService=d(mr);preferencesService=d(rt);codayService=d(hn);markdownService=d(zn);sanitizer=d(Rn);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(n=>n.type==="text").map(n=>n.content).join(`
|
|
354
|
+
|
|
355
|
+
`);navigator.clipboard.writeText(e).then(()=>console.log("Message copied")).catch(n=>console.error("Failed to copy:",n)),this.copyRequested.emit(t)}onStop(){this.stopRequested.emit()}canDeleteMessage(t){return t===0?!1:!this.isThinking}onDeleteMessage(t){if(console.log("[CHAT-HISTORY] Delete requested for message:",t.id),this.messages.findIndex(o=>o.id===t.id)===0){console.warn("[CHAT-HISTORY] Cannot delete first message");return}if(this.isThinking){console.warn("[CHAT-HISTORY] Cannot delete message while agent is thinking");return}if(t.role!=="user"){console.warn("[CHAT-HISTORY] Can only delete user messages");return}confirm(`Delete this message and all following messages?
|
|
356
|
+
|
|
357
|
+
This action cannot be undone once you post another message.`)&&(console.log("[CHAT-HISTORY] Proceeding with message deletion"),this.codayService.deleteMessage(t.id).subscribe({next:o=>{o.success?console.log("[CHAT-HISTORY] Message deleted successfully"):(console.error("[CHAT-HISTORY] Failed to delete message:",o.error),alert(`Failed to delete message: ${o.error}`))},error:o=>{console.error("[CHAT-HISTORY] Error deleting message:",o),alert(`Error deleting message: ${o.message||"Unknown error"}`)}}))}onScroll(){}findScrollContainer(){let t=this.elementRef.nativeElement;this.scrollContainer=t.closest(".chat-wrapper"),this.scrollContainer?(console.log("[CHAT-HISTORY] Scroll container found"),this.scrollContainer.addEventListener("scroll",this.handleScroll.bind(this)),this.lastScrollTop=this.scrollContainer.scrollTop,this.checkScrollPosition()):(console.warn("[CHAT-HISTORY] Scroll container not found"),setTimeout(()=>this.findScrollContainer(),100))}handleScroll=()=>{if(!this.scrollContainer)return;let t=this.scrollContainer.scrollTop;if(Math.abs(t-this.lastScrollTop)<1){this.lastScrollTop=t;return}if(this.isProgrammaticScroll){this.lastScrollTop=t;return}console.log("[CHAT-HISTORY] User scroll detected - disabling auto-scroll"),this.isTracking&&(this.isTracking=!1,this.showGoToBottom=!0),clearTimeout(this.scrollCheckTimeout),this.scrollCheckTimeout=setTimeout(()=>{this.checkScrollPosition()},500),this.lastScrollTop=t};checkScrollPosition(){if(!this.scrollContainer)return;let{scrollTop:t,scrollHeight:e,clientHeight:n}=this.scrollContainer,r=e-t-n<=this.NEAR_BOTTOM_THRESHOLD;r&&!this.isTracking&&(console.log("[CHAT-HISTORY] Near bottom - re-enabling auto-scroll"),this.isTracking=!0,this.showGoToBottom=!1,this.unreadService.markAllAsRead()),!this.isTracking&&!r&&(this.showGoToBottom=!0)}goToBottom(){console.log("[CHAT-HISTORY] Go to bottom clicked - re-enabling auto-scroll"),this.scrollToBottom(),this.isTracking=!0,this.showGoToBottom=!1,this.unreadService.markAllAsRead()}handleNewMessages(t){let n=this.messages.slice(-t).filter(r=>r.role==="assistant");if(n.length===0){console.log("[CHAT-HISTORY] No new assistant messages to count");return}if(this.shouldMarkNewMessagesAsUnread()){console.log("[CHAT-HISTORY] Marking",n.length,"new assistant messages as unread");for(let r=0;r<n.length;r++)this.unreadService.addUnread()}else console.log("[CHAT-HISTORY] New assistant messages are considered read (user is focused and tracking)")}shouldMarkNewMessagesAsUnread(){return document.hasFocus()?this.isTracking?!1:(console.log("[CHAT-HISTORY] User is not tracking (scrolled up) -> unread"),!0):(console.log("[CHAT-HISTORY] Tab does not have focus -> unread"),!0)}setupFocusListeners(){window.addEventListener("focus",this.handleWindowFocus),window.addEventListener("blur",this.handleWindowBlur)}handleWindowFocus=()=>{console.log("[CHAT-HISTORY] Window gained focus"),this.isTracking&&(console.log("[CHAT-HISTORY] User is tracking and focused -> marking messages as read"),this.unreadService.markAllAsRead())};handleWindowBlur=()=>{console.log("[CHAT-HISTORY] Window lost focus")};handleVoiceAnnouncement(t){if(!this.preferencesService.getVoiceAnnounceEnabled())return;let o=this.messages.slice(-t).filter(c=>c.role==="assistant");if(o.length===0){console.log("[CHAT-HISTORY] No new assistant messages to announce");return}let r=o[o.length-1];if(!r){console.warn("[CHAT-HISTORY] No last assistant message found");return}if(!this.isMessageRecentEnoughForAnnouncement(r)){console.log("[CHAT-HISTORY] Message too old for voice announcement");return}if(this.preferencesService.getVoiceMode()==="notification")console.log("[CHAT-HISTORY] Playing notification sound for new assistant message"),this.voiceSynthesisService.ding();else{let c=this.extractTextContentFromMessage(r);if(c.trim()){console.log("[CHAT-HISTORY] Announcing new assistant message via speech");let p=this.preferencesService.getVoiceReadFullText()?c:this.extractPartialText(c);this.voiceSynthesisService.speak(p).then(b=>{b||console.warn("[CHAT-HISTORY] Failed to announce message via speech")}).catch(b=>{console.error("[CHAT-HISTORY] Error during voice announcement:",b)})}}}isMessageRecentEnoughForAnnouncement(t){try{let e=t.timestamp.getTime();return Date.now()-e<=this.MESSAGE_FRESHNESS_THRESHOLD}catch(e){return console.warn("[CHAT-HISTORY] Error checking message freshness:",e),!0}}extractTextContentFromMessage(t){return t.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
358
|
+
|
|
359
|
+
`)}extractPartialText(t){return t.split(`
|
|
360
|
+
`).filter(a=>a.trim().length>0).reduce((a,c)=>{if(a.paragraphs>=3)return a;let u=c.length>80?1:0;return{paragraphs:a.paragraphs+u,text:a.text+(a.text?`
|
|
361
|
+
`:"")+c}},{paragraphs:0,text:""}).text||t}renderStreamingText(){return J(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||i)};static \u0275cmp=M({type:i,selectors:[["app-chat-history"]],hostBindings:function(e,n){e&1&&_("scroll",function(){return n.onScroll()})},inputs:{messages:"messages",streamingText:"streamingText",isThinking:"isThinking"},outputs:{copyRequested:"copyRequested",stopRequested:"stopRequested"},features:[Ve],decls:6,vars:3,consts:[[1,"chat-history"],[3,"message","canDelete"],[1,"streaming-message","message","assistant"],["mat-fab","","color","primary","title","Go to bottom",1,"go-to-bottom-btn"],[3,"copyRequested","deleteRequested","message","canDelete"],[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,n){e&1&&(s(0,"div",0),Oe(1,L0,1,2,"app-chat-message",1,V0),w(3,j0,2,1,"div",2),w(4,z0,1,0,"app-thinking-loader"),w(5,B0,3,0,"button",3),l()),e&2&&(m(),Ae(n.messages),m(2),S(n.streamingText?3:-1),m(),S(n.isThinking?4:-1),m(),S(n.showGoToBottom?5:-1))},dependencies:[_l,xe,bl,os],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:120px!important;right:2rem!important;z-index:1000!important}@media (max-width: 768px){.go-to-bottom-btn[_ngcontent-%COMP%]{right:1rem!important;bottom:100px!important}}@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 yl=class i{http=d(Ge);projectState=d(we);threadState=d(Dt);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/files`}uploadFile(t){let e=this.projectState.getSelectedProjectIdOrThrow(),n=this.threadState.getSelectedThreadIdOrThrow();return new rn(o=>{let r=new FileReader;r.onload=()=>{let c=r.result.split(",")[1];this.http.post(`/api/projects/${e}/threads/${n}/upload`,{content:c,mimeType:t.type||"application/octet-stream",filename:t.name}).subscribe({next:u=>{o.next({success:u.success,filename:u.filename}),o.complete()},error:u=>o.error(u)})},r.onerror=()=>o.error(new Error("Failed to read file")),r.readAsDataURL(t)})}listFiles(){return this.http.get(this.getBaseUrl()).pipe(be(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||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var hr=class i{fileApi=d(yl);eventStream=d(Un);filesSignal=Te([]);isLoadingSignal=Te(!1);currentProjectSignal=Te(null);currentThreadSignal=Te(null);files=ft(()=>this.filesSignal());isLoading=ft(()=>this.isLoadingSignal());fileCount=ft(()=>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(n=>Ie(Y({},n),{lastModified:new Date(n.lastModified)})).sort((n,o)=>o.lastModified.getTime()-n.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 J(this,null,function*(){return new Promise(e=>{this.fileApi.uploadFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:n=>{console.error("[FILE_EXCHANGE_STATE] Upload error:",n),e({success:!1,error:n.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,n)=>{setTimeout(()=>{this.downloadFile(e.filename)},n*300)})}downloadFile(t){this.fileApi.downloadFile(t).subscribe({next:e=>{let n=window.URL.createObjectURL(e),o=document.createElement("a");o.href=n,o.download=t,o.click(),window.URL.revokeObjectURL(n)},error:e=>{console.error("[FILE_EXCHANGE_STATE] Download error:",e)}})}deleteFile(t){return J(this,null,function*(){return new Promise(e=>{this.fileApi.deleteFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:n=>{console.error("[FILE_EXCHANGE_STATE] Delete error:",n),e({success:!1,error:n.message||"Delete failed"})}})})})}subscribeToFileEvents(){this.eventStream.events$.pipe(he(t=>t instanceof Vi),Vs()).subscribe(t=>{this.handleFileEvent(t)})}handleFileEvent(t){let e=this.filesSignal();switch(t.operation){case"created":{let n=t.timestamp,o=t.timestamp.lastIndexOf("-");if(o>0){let a=t.timestamp.substring(o+1);a.length===5&&/^[a-z0-9]+$/.test(a)&&(n=t.timestamp.substring(0,o))}let r={filename:t.filename,size:t.size||0,lastModified:new Date(n)};this.filesSignal.set([r,...e]);break}case"updated":{let n=e.filter(u=>u.filename!==t.filename),o=e.find(u=>u.filename===t.filename),r=t.timestamp,a=t.timestamp.lastIndexOf("-");if(a>0){let u=t.timestamp.substring(a+1);u.length===5&&/^[a-z0-9]+$/.test(u)&&(r=t.timestamp.substring(0,a))}let c={filename:t.filename,size:t.size||o?.size||0,lastModified:new Date(r)};this.filesSignal.set([c,...n]);break}case"deleted":{let n=e.filter(o=>o.filename!==t.filename);this.filesSignal.set(n);break}}}static \u0275fac=function(e){return new(e||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var H0=["determinateSpinner"];function W0(i,t){if(i&1&&(Kn(),s(0,"svg",11),I(1,"circle",12),l()),i&2){let e=g();G("viewBox",e._viewBox()),m(),In("stroke-dasharray",e._strokeCircumference(),"px")("stroke-dashoffset",e._strokeCircumference()/2,"px")("stroke-width",e._circleStrokeWidth(),"%"),G("r",e._circleRadius())}}var U0=new te("mat-progress-spinner-default-options",{providedIn:"root",factory:$0});function $0(){return{diameter:eg}}var eg=100,q0=10,Cl=(()=>{class i{_elementRef=d(ne);_noopAnimations;get color(){return this._color||this._defaultColor}set color(e){this._color=e}_color;_defaultColor="primary";_determinateCircle;constructor(){let e=d(U0),n=vh(),o=this._elementRef.nativeElement;this._noopAnimations=n==="di-disabled"&&!!e&&!e._forceAnimations,this.mode=o.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&n==="reduced-motion"&&o.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=eg;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(e){this._strokeWidth=e||0}_strokeWidth;_circleRadius(){return(this.diameter-q0)/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(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(n,o){if(n&1&&ie(H0,5),n&2){let r;U(r=$())&&(o._determinateCircle=r.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(n,o){n&2&&(G("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",o.mode==="determinate"?o.value:null)("mode",o.mode),Zn("mat-"+o.color),In("width",o.diameter,"px")("height",o.diameter,"px")("--mat-progress-spinner-size",o.diameter+"px")("--mat-progress-spinner-active-indicator-width",o.diameter+"px"),A("_mat-animation-noopable",o._noopAnimations)("mdc-circular-progress--indeterminate",o.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",bn],diameter:[2,"diameter","diameter",bn],strokeWidth:[2,"strokeWidth","strokeWidth",bn]},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(n,o){if(n&1&&(qe(0,W0,2,8,"ng-template",null,0,$a),s(2,"div",2,1),Kn(),s(4,"svg",3),I(5,"circle",4),l()(),Ha(),s(6,"div",5)(7,"div",6)(8,"div",7),Ua(9,8),l(),s(10,"div",9),Ua(11,8),l(),s(12,"div",10),Ua(13,8),l()()()),n&2){let r=en(1);m(4),G("viewBox",o._viewBox()),m(),In("stroke-dasharray",o._strokeCircumference(),"px")("stroke-dashoffset",o._strokeDashOffset(),"px")("stroke-width",o._circleStrokeWidth(),"%"),G("r",o._circleRadius()),m(4),x("ngTemplateOutlet",r),m(2),x("ngTemplateOutlet",r),m(2),x("ngTemplateOutlet",r)}},dependencies:[Ya],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)}}
|
|
362
|
+
`],encapsulation:2,changeDetection:0})}return i})();var xl=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({imports:[ce]})}return i})();function G0(i,t){if(i&1&&I(0,"div",1),i&2){let e=g();x("innerHTML",e.renderedContent,Zt)}}function Y0(i,t){if(i&1&&I(0,"iframe",2),i&2){let e=g();x("srcdoc",e.content,Zt)}}function Q0(i,t){if(i&1&&(s(0,"pre",3),h(1),l()),i&2){let e=g();m(),B(e.content)}}var wl=class i{content="";format="text";renderedContent="";sanitizer=d(Rn);markdownService=d(zn);ngOnChanges(t){(t.content||t.format)&&this.renderContent()}renderContent(){this.format==="markdown"?this.renderMarkdown():this.format==="json"&&this.formatJson()}renderMarkdown(){return J(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||i)};static \u0275cmp=M({type:i,selectors:[["app-content-renderer"]],inputs:{content:"content",format:"format"},features:[Ve],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,n){e&1&&(s(0,"div",0),w(1,G0,1,1,"div",1)(2,Y0,1,1,"iframe",2)(3,Q0,2,1,"pre",3),l()),e&2&&(x("ngClass","format-"+n.format),m(),S(n.format==="markdown"?1:n.format==="html"?2:3))},dependencies:[De,Fo],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 ur=class i{http=d(Ge);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,n){let o=`/api/projects/${t}/threads/${e}/files/${encodeURIComponent(n)}`,r=this.detectFormat(n);return this.http.get(o,{responseType:"text",observe:"response"}).pipe(be(a=>{let c=a.body||"",u=new Blob([c]).size;return{content:c,format:r,filename:n,size:u}}),Ui(a=>(console.error("[CONTENT_VIEWER] Error loading file:",n,a),Ar(()=>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||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};function X0(i,t){if(i&1){let e=E();s(0,"button",12),_("click",function(){v(e);let o=g();return y(o.download())}),s(1,"mat-icon"),h(2,"download"),l()()}}function K0(i,t){i&1&&(s(0,"div",9),I(1,"mat-spinner",13),s(2,"p"),h(3,"Loading file content..."),l()())}function Z0(i,t){if(i&1){let e=E();s(0,"div",10)(1,"mat-icon",14),h(2,"error_outline"),l(),s(3,"p",15),h(4),l(),s(5,"button",16),_("click",function(){v(e);let o=g();return y(o.download())}),s(6,"mat-icon"),h(7,"download"),l(),h(8," Download instead "),l()()}if(i&2){let e=g();m(4),B(e.error)}}function J0(i,t){if(i&1&&I(0,"app-content-renderer",11),i&2){let e=g();x("content",e.fileContent.content)("format",e.fileContent.format)}}var Sl=class i{destroy$=new F;file;projectName;threadId;closeViewer=new H;contentService=d(ur);eventStream=d(Un);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),n=document.createElement("a");n.href=e,n.download=this.file.filename,n.click(),window.URL.revokeObjectURL(e)}formatSize(t){return this.contentService.formatSize(t)}subscribeToFileEvents(){this.eventStream.events$.pipe(he(t=>t instanceof Vi),he(t=>t.filename===this.file.filename),he(t=>t.operation==="updated"),z(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||i)};static \u0275cmp=M({type:i,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,n){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),h(4),l(),s(5,"span",4),h(6),l()(),s(7,"div",5),w(8,X0,3,0,"button",6),s(9,"button",7),_("click",function(){return n.onClose()}),s(10,"mat-icon"),h(11,"chevron_right"),l()()()(),s(12,"div",8),w(13,K0,4,0,"div",9),w(14,Z0,9,1,"div",10),w(15,J0,1,2,"app-content-renderer",11),l()()),e&2&&(m(4),B(n.file.filename),m(2),B(n.formatSize(n.file.size)),m(2),S(n.fileContent&&!n.isLoading&&!n.error?8:-1),m(5),S(n.isLoading?13:-1),m(),S(n.error?14:-1),m(),S(n.fileContent&&!n.isLoading&&!n.error?15:-1))},dependencies:[De,Ye,xe,yt,At,vt,xl,Cl,wl],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 ey=Math.pow(10,8)*24*60*60*1e3,_R=-ey,kl=6048e5,ig=864e5;var ty=3600;var og=ty*24,bR=og*7,ny=og*365.2425,iy=ny/12,vR=iy*3,Yd=Symbol.for("constructDateFrom");function ut(i,t){return typeof i=="function"?i(t):i&&typeof i=="object"&&Yd in i?i[Yd](t):i instanceof Date?new i.constructor(t):new Date(t)}function Ke(i,t){return ut(t||i,i)}function rg(i,t,e){let n=Ke(i,e?.in);return isNaN(t)?ut(e?.in||i,NaN):(t&&n.setDate(n.getDate()+t),n)}var oy={};function ji(){return oy}function ui(i,t){let e=ji(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,o=Ke(i,t?.in),r=o.getDay(),a=(r<n?7:0)+r-n;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function _o(i,t){return ui(i,Ie(Y({},t),{weekStartsOn:1}))}function Ml(i,t){let e=Ke(i,t?.in),n=e.getFullYear(),o=ut(e,0);o.setFullYear(n+1,0,4),o.setHours(0,0,0,0);let r=_o(o),a=ut(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);let c=_o(a);return e.getTime()>=r.getTime()?n+1:e.getTime()>=c.getTime()?n:n-1}function Qd(i){let t=Ke(i),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+i-+e}function pr(i,...t){let e=ut.bind(null,i||t.find(n=>typeof n=="object"));return t.map(e)}function gr(i,t){let e=Ke(i,t?.in);return e.setHours(0,0,0,0),e}function El(i,t,e){let[n,o]=pr(e?.in,i,t),r=gr(n),a=gr(o),c=+r-Qd(r),u=+a-Qd(a);return Math.round((c-u)/ig)}function ag(i,t){let e=Ml(i,t),n=ut(t?.in||i,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),_o(n)}function sg(i){return ut(i,Date.now())}function lg(i,t,e){let[n,o]=pr(e?.in,i,t);return+gr(n)==+gr(o)}function cg(i){return i instanceof Date||typeof i=="object"&&Object.prototype.toString.call(i)==="[object Date]"}function dg(i){return!(!cg(i)&&typeof i!="number"||isNaN(+Ke(i)))}function hg(i,t,e){let[n,o]=pr(e?.in,i,t),r=mg(n,o),a=Math.abs(El(n,o));n.setDate(n.getDate()-r*a);let c=+(mg(n,o)===-r),u=r*(a-c);return u===0?0:u}function mg(i,t){let e=i.getFullYear()-t.getFullYear()||i.getMonth()-t.getMonth()||i.getDate()-t.getDate()||i.getHours()-t.getHours()||i.getMinutes()-t.getMinutes()||i.getSeconds()-t.getSeconds()||i.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function ug(i,t){let e=Ke(i,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}var ry={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"}},pg=(i,t,e)=>{let n,o=ry[i];return typeof o=="string"?n=o:t===1?n=o.one:n=o.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+n:n+" ago":n};function Tl(i){return(t={})=>{let e=t.width?String(t.width):i.defaultWidth;return i.formats[e]||i.formats[i.defaultWidth]}}var ay={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},sy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ly={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},gg={date:Tl({formats:ay,defaultWidth:"full"}),time:Tl({formats:sy,defaultWidth:"full"}),dateTime:Tl({formats:ly,defaultWidth:"full"})};var cy={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},fg=(i,t,e,n)=>cy[i];function fr(i){return(t,e)=>{let n=e?.context?String(e.context):"standalone",o;if(n==="formatting"&&i.formattingValues){let a=i.defaultFormattingWidth||i.defaultWidth,c=e?.width?String(e.width):a;o=i.formattingValues[c]||i.formattingValues[a]}else{let a=i.defaultWidth,c=e?.width?String(e.width):i.defaultWidth;o=i.values[c]||i.values[a]}let r=i.argumentCallback?i.argumentCallback(t):t;return o[r]}}var dy={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},my={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},hy={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"]},uy={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"]},py={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"}},gy={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"}},fy=(i,t)=>{let e=Number(i),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},_g={ordinalNumber:fy,era:fr({values:dy,defaultWidth:"wide"}),quarter:fr({values:my,defaultWidth:"wide",argumentCallback:i=>i-1}),month:fr({values:hy,defaultWidth:"wide"}),day:fr({values:uy,defaultWidth:"wide"}),dayPeriod:fr({values:py,defaultWidth:"wide",formattingValues:gy,defaultFormattingWidth:"wide"})};function _r(i){return(t,e={})=>{let n=e.width,o=n&&i.matchPatterns[n]||i.matchPatterns[i.defaultMatchWidth],r=t.match(o);if(!r)return null;let a=r[0],c=n&&i.parsePatterns[n]||i.parsePatterns[i.defaultParseWidth],u=Array.isArray(c)?by(c,C=>C.test(a)):_y(c,C=>C.test(a)),p;p=i.valueCallback?i.valueCallback(u):u,p=e.valueCallback?e.valueCallback(p):p;let b=t.slice(a.length);return{value:p,rest:b}}}function _y(i,t){for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)&&t(i[e]))return e}function by(i,t){for(let e=0;e<i.length;e++)if(t(i[e]))return e}function bg(i){return(t,e={})=>{let n=t.match(i.matchPattern);if(!n)return null;let o=n[0],r=t.match(i.parsePattern);if(!r)return null;let a=i.valueCallback?i.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;let c=t.slice(o.length);return{value:a,rest:c}}}var vy=/^(\d+)(th|st|nd|rd)?/i,yy=/\d+/i,Cy={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},xy={any:[/^b/i,/^(a|c)/i]},wy={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Sy={any:[/1/i,/2/i,/3/i,/4/i]},ky={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},My={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]},Ey={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},Ty={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]},Py={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},Oy={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}},vg={ordinalNumber:bg({matchPattern:vy,parsePattern:yy,valueCallback:i=>parseInt(i,10)}),era:_r({matchPatterns:Cy,defaultMatchWidth:"wide",parsePatterns:xy,defaultParseWidth:"any"}),quarter:_r({matchPatterns:wy,defaultMatchWidth:"wide",parsePatterns:Sy,defaultParseWidth:"any",valueCallback:i=>i+1}),month:_r({matchPatterns:ky,defaultMatchWidth:"wide",parsePatterns:My,defaultParseWidth:"any"}),day:_r({matchPatterns:Ey,defaultMatchWidth:"wide",parsePatterns:Ty,defaultParseWidth:"any"}),dayPeriod:_r({matchPatterns:Py,defaultMatchWidth:"any",parsePatterns:Oy,defaultParseWidth:"any"})};var Xd={code:"en-US",formatDistance:pg,formatLong:gg,formatRelative:fg,localize:_g,match:vg,options:{weekStartsOn:0,firstWeekContainsDate:1}};function yg(i,t){let e=Ke(i,t?.in);return El(e,ug(e))+1}function Cg(i,t){let e=Ke(i,t?.in),n=+_o(e)-+ag(e);return Math.round(n/kl)+1}function Pl(i,t){let e=Ke(i,t?.in),n=e.getFullYear(),o=ji(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=ut(t?.in||i,0);a.setFullYear(n+1,0,r),a.setHours(0,0,0,0);let c=ui(a,t),u=ut(t?.in||i,0);u.setFullYear(n,0,r),u.setHours(0,0,0,0);let p=ui(u,t);return+e>=+c?n+1:+e>=+p?n:n-1}function xg(i,t){let e=ji(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,o=Pl(i,t),r=ut(t?.in||i,0);return r.setFullYear(o,0,n),r.setHours(0,0,0,0),ui(r,t)}function wg(i,t){let e=Ke(i,t?.in),n=+ui(e,t)-+xg(e,t);return Math.round(n/kl)+1}function ke(i,t){let e=i<0?"-":"",n=Math.abs(i).toString().padStart(t,"0");return e+n}var pi={y(i,t){let e=i.getFullYear(),n=e>0?e:1-e;return ke(t==="yy"?n%100:n,t.length)},M(i,t){let e=i.getMonth();return t==="M"?String(e+1):ke(e+1,2)},d(i,t){return ke(i.getDate(),t.length)},a(i,t){let e=i.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(i,t){return ke(i.getHours()%12||12,t.length)},H(i,t){return ke(i.getHours(),t.length)},m(i,t){return ke(i.getMinutes(),t.length)},s(i,t){return ke(i.getSeconds(),t.length)},S(i,t){let e=t.length,n=i.getMilliseconds(),o=Math.trunc(n*Math.pow(10,e-3));return ke(o,t.length)}};var br={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Kd={G:function(i,t,e){let n=i.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(n,{width:"abbreviated"});case"GGGGG":return e.era(n,{width:"narrow"});case"GGGG":default:return e.era(n,{width:"wide"})}},y:function(i,t,e){if(t==="yo"){let n=i.getFullYear(),o=n>0?n:1-n;return e.ordinalNumber(o,{unit:"year"})}return pi.y(i,t)},Y:function(i,t,e,n){let o=Pl(i,n),r=o>0?o:1-o;if(t==="YY"){let a=r%100;return ke(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):ke(r,t.length)},R:function(i,t){let e=Ml(i);return ke(e,t.length)},u:function(i,t){let e=i.getFullYear();return ke(e,t.length)},Q:function(i,t,e){let n=Math.ceil((i.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return ke(n,2);case"Qo":return e.ordinalNumber(n,{unit:"quarter"});case"QQQ":return e.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(n,{width:"wide",context:"formatting"})}},q:function(i,t,e){let n=Math.ceil((i.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return ke(n,2);case"qo":return e.ordinalNumber(n,{unit:"quarter"});case"qqq":return e.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(n,{width:"wide",context:"standalone"})}},M:function(i,t,e){let n=i.getMonth();switch(t){case"M":case"MM":return pi.M(i,t);case"Mo":return e.ordinalNumber(n+1,{unit:"month"});case"MMM":return e.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(n,{width:"wide",context:"formatting"})}},L:function(i,t,e){let n=i.getMonth();switch(t){case"L":return String(n+1);case"LL":return ke(n+1,2);case"Lo":return e.ordinalNumber(n+1,{unit:"month"});case"LLL":return e.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(n,{width:"wide",context:"standalone"})}},w:function(i,t,e,n){let o=wg(i,n);return t==="wo"?e.ordinalNumber(o,{unit:"week"}):ke(o,t.length)},I:function(i,t,e){let n=Cg(i);return t==="Io"?e.ordinalNumber(n,{unit:"week"}):ke(n,t.length)},d:function(i,t,e){return t==="do"?e.ordinalNumber(i.getDate(),{unit:"date"}):pi.d(i,t)},D:function(i,t,e){let n=yg(i);return t==="Do"?e.ordinalNumber(n,{unit:"dayOfYear"}):ke(n,t.length)},E:function(i,t,e){let n=i.getDay();switch(t){case"E":case"EE":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"})}},e:function(i,t,e,n){let o=i.getDay(),r=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return ke(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(o,{width:"short",context:"formatting"});case"eeee":default:return e.day(o,{width:"wide",context:"formatting"})}},c:function(i,t,e,n){let o=i.getDay(),r=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return ke(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(o,{width:"narrow",context:"standalone"});case"cccccc":return e.day(o,{width:"short",context:"standalone"});case"cccc":default:return e.day(o,{width:"wide",context:"standalone"})}},i:function(i,t,e){let n=i.getDay(),o=n===0?7:n;switch(t){case"i":return String(o);case"ii":return ke(o,t.length);case"io":return e.ordinalNumber(o,{unit:"day"});case"iii":return e.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(n,{width:"short",context:"formatting"});case"iiii":default:return e.day(n,{width:"wide",context:"formatting"})}},a:function(i,t,e){let o=i.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(i,t,e){let n=i.getHours(),o;switch(n===12?o=br.noon:n===0?o=br.midnight:o=n/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(i,t,e){let n=i.getHours(),o;switch(n>=17?o=br.evening:n>=12?o=br.afternoon:n>=4?o=br.morning:o=br.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(i,t,e){if(t==="ho"){let n=i.getHours()%12;return n===0&&(n=12),e.ordinalNumber(n,{unit:"hour"})}return pi.h(i,t)},H:function(i,t,e){return t==="Ho"?e.ordinalNumber(i.getHours(),{unit:"hour"}):pi.H(i,t)},K:function(i,t,e){let n=i.getHours()%12;return t==="Ko"?e.ordinalNumber(n,{unit:"hour"}):ke(n,t.length)},k:function(i,t,e){let n=i.getHours();return n===0&&(n=24),t==="ko"?e.ordinalNumber(n,{unit:"hour"}):ke(n,t.length)},m:function(i,t,e){return t==="mo"?e.ordinalNumber(i.getMinutes(),{unit:"minute"}):pi.m(i,t)},s:function(i,t,e){return t==="so"?e.ordinalNumber(i.getSeconds(),{unit:"second"}):pi.s(i,t)},S:function(i,t){return pi.S(i,t)},X:function(i,t,e){let n=i.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return kg(n);case"XXXX":case"XX":return bo(n);case"XXXXX":case"XXX":default:return bo(n,":")}},x:function(i,t,e){let n=i.getTimezoneOffset();switch(t){case"x":return kg(n);case"xxxx":case"xx":return bo(n);case"xxxxx":case"xxx":default:return bo(n,":")}},O:function(i,t,e){let n=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Sg(n,":");case"OOOO":default:return"GMT"+bo(n,":")}},z:function(i,t,e){let n=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Sg(n,":");case"zzzz":default:return"GMT"+bo(n,":")}},t:function(i,t,e){let n=Math.trunc(+i/1e3);return ke(n,t.length)},T:function(i,t,e){return ke(+i,t.length)}};function Sg(i,t=""){let e=i>0?"-":"+",n=Math.abs(i),o=Math.trunc(n/60),r=n%60;return r===0?e+String(o):e+String(o)+t+ke(r,2)}function kg(i,t){return i%60===0?(i>0?"-":"+")+ke(Math.abs(i)/60,2):bo(i,t)}function bo(i,t=""){let e=i>0?"-":"+",n=Math.abs(i),o=ke(Math.trunc(n/60),2),r=ke(n%60,2);return e+o+t+r}var Mg=(i,t)=>{switch(i){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"})}},Eg=(i,t)=>{switch(i){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"})}},Ay=(i,t)=>{let e=i.match(/(P+)(p+)?/)||[],n=e[1],o=e[2];if(!o)return Mg(i,t);let r;switch(n){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}}",Mg(n,t)).replace("{{time}}",Eg(o,t))},Tg={p:Eg,P:Ay};var Dy=/^D+$/,Iy=/^Y+$/,Ry=["D","DD","YY","YYYY"];function Pg(i){return Dy.test(i)}function Og(i){return Iy.test(i)}function Ag(i,t,e){let n=Fy(i,t,e);if(console.warn(n),Ry.includes(i))throw new RangeError(n)}function Fy(i,t,e){let n=i[0]==="Y"?"years":"days of the month";return`Use \`${i.toLowerCase()}\` instead of \`${i}\` (in \`${t}\`) for formatting ${n} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var Ny=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Vy=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ly=/^'([^]*?)'?$/,jy=/''/g,zy=/[a-zA-Z]/;function Zd(i,t,e){let n=ji(),o=e?.locale??n.locale??Xd,r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,c=Ke(i,e?.in);if(!dg(c))throw new RangeError("Invalid time value");let u=t.match(Vy).map(b=>{let C=b[0];if(C==="p"||C==="P"){let T=Tg[C];return T(b,o.formatLong)}return b}).join("").match(Ny).map(b=>{if(b==="''")return{isToken:!1,value:"'"};let C=b[0];if(C==="'")return{isToken:!1,value:By(b)};if(Kd[C])return{isToken:!0,value:b};if(C.match(zy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:b}});o.localize.preprocessor&&(u=o.localize.preprocessor(c,u));let p={firstWeekContainsDate:r,weekStartsOn:a,locale:o};return u.map(b=>{if(!b.isToken)return b.value;let C=b.value;(!e?.useAdditionalWeekYearTokens&&Og(C)||!e?.useAdditionalDayOfYearTokens&&Pg(C))&&Ag(C,t,String(i));let T=Kd[C[0]];return T(c,C,o.localize,p)}).join("")}function By(i){let t=i.match(Ly);return t?t[1].replace(jy,"'"):i}function Dg(i,t,e){return rg(i,-t,e)}function Ig(i,t){return lg(ut(t?.in||i,i),Dg(sg(t?.in||i),1))}function Rg(i){if(!i||isNaN(i.getTime()))return"unknown";let t=new Date,e=Zd(i,"HH:mm:ss"),n=t.getTime()-i.getTime(),o=Math.floor(n/(1e3*60));if(o<1)return`just now (${e})`;if(o<60)return`${o} min ago (${e})`;let r=Math.floor(n/(1e3*60*60));if(r<24)return`${r}h ago (${e})`;if(Ig(i))return`yesterday ${e}`;let a=hg(t,i);return a<7?`${a}d ago ${e}`:`${Zd(i,"dd/MM/yyyy")} ${e}`}var Hy=(i,t)=>t.filename;function Wy(i,t){if(i&1){let e=E();s(0,"button",11),_("click",function(){v(e);let o=g(2);return y(o.downloadAll())}),s(1,"mat-icon"),h(2,"download_for_offline"),l()()}}function Uy(i,t){i&1&&(s(0,"div",10),I(1,"span",12),s(2,"span",13),h(3,"Loading files..."),l()())}function $y(i,t){i&1&&(s(0,"div",14)(1,"mat-icon",15),h(2,"folder_open"),l(),s(3,"p",16),h(4,"No files in exchange space"),l(),s(5,"p",17),h(6,"Upload files to share with the agent"),l()())}function qy(i,t){if(i&1){let e=E();s(0,"button",28),_("click",function(){v(e);let o=g().$implicit,r=g(4);return y(r.viewFile(o))}),s(1,"mat-icon"),h(2,"visibility"),l()()}}function Gy(i,t){if(i&1){let e=E();s(0,"div",18)(1,"div",19)(2,"mat-icon",20),h(3),l(),s(4,"div",21)(5,"span",22),h(6),l(),s(7,"span",23),h(8),l()()(),s(9,"div",24),w(10,qy,3,0,"button",25),s(11,"button",26),_("click",function(){let o=v(e).$implicit,r=g(4);return y(r.download(o))}),s(12,"mat-icon"),h(13,"download"),l()(),s(14,"button",27),_("click",function(){let o=v(e).$implicit,r=g(4);return y(r.delete(o))}),s(15,"mat-icon"),h(16,"delete"),l()()()()}if(i&2){let e=t.$implicit,n=g(4);m(3),B(n.getFileIcon(e.filename)),m(2),x("title",e.filename),m(),B(e.filename),m(2),yi("",n.formatSize(e.size)," \u2022 ",n.formatDate(e.lastModified)),m(2),S(n.canViewFile(e)?10:-1)}}function Yy(i,t){if(i&1&&Oe(0,Gy,17,6,"div",18,Hy),i&2){let e=g(3);Ae(e.files())}}function Qy(i,t){if(i&1&&w(0,$y,7,0,"div",14)(1,Yy,2,0),i&2){let e=g(2);S(e.files().length===0?0:1)}}function Xy(i,t){if(i&1){let e=E();s(0,"div",0)(1,"div",2)(2,"div",3)(3,"h3",4),h(4,"Exchange"),l(),s(5,"span",5),h(6),l()(),s(7,"div",6),w(8,Wy,3,0,"button",7),s(9,"button",8),_("click",function(){v(e);let o=g();return y(o.close())}),s(10,"mat-icon"),h(11,"chevron_right"),l()()()(),s(12,"div",9),w(13,Uy,4,0,"div",10)(14,Qy,2,1),l()()}if(i&2){let e=g();m(6),oe("(",e.files().length,")"),m(2),S(e.files().length>0?8:-1),m(5),S(e.isLoading()?13:14)}}function Ky(i,t){if(i&1){let e=E();s(0,"app-content-viewer",29),_("closeViewer",function(){v(e);let o=g();return y(o.backToList())}),l()}if(i&2){let e=g();x("file",e.currentFile)("projectName",e.projectName)("threadId",e.threadId)}}var Ol=class i{projectName;threadId;closeDrawer=new H;fileExchangeState=d(hr);contentViewerService=d(ur);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 J(this,null,function*(){if(!confirm(`Delete file "${t.filename}"?`))return;let n=yield this.fileExchangeState.deleteFile(t.filename);n.success||alert(`Failed to delete file: ${n.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 Rg(t)}canViewFile(t){return this.contentViewerService.isFormatViewable(t.filename)&&this.contentViewerService.isViewable(t.size)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,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,n){e&1&&(w(0,Xy,15,3,"div",0),w(1,Ky,1,3,"app-content-viewer",1)),e&2&&(S(n.viewerState==="list"?0:-1),m(),S(n.viewerState==="content"&&n.currentFile?1:-1))},dependencies:[De,Ye,xe,yt,vt,Sl],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}}"]})};var Dl=["*"],Zy=["content"],Jy=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],eC=["mat-drawer","mat-drawer-content","*"];function tC(i,t){if(i&1){let e=E();s(0,"div",1),_("click",function(){v(e);let o=g();return y(o._onBackdropClicked())}),l()}if(i&2){let e=g();A("mat-drawer-shown",e._isShowingBackdrop())}}function nC(i,t){i&1&&(s(0,"mat-drawer-content"),me(1,2),l())}var iC=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],oC=["mat-sidenav","mat-sidenav-content","*"];function rC(i,t){if(i&1){let e=E();s(0,"div",1),_("click",function(){v(e);let o=g();return y(o._onBackdropClicked())}),l()}if(i&2){let e=g();A("mat-drawer-shown",e._isShowingBackdrop())}}function aC(i,t){i&1&&(s(0,"mat-sidenav-content"),me(1,2),l())}var sC=`.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}
|
|
363
|
+
`;var lC=new te("MAT_DRAWER_DEFAULT_AUTOSIZE",{providedIn:"root",factory:cC}),Jd=new te("MAT_DRAWER_CONTAINER");function cC(){return!1}var vr=(()=>{class i extends Di{_platform=d(ct);_changeDetectorRef=d(He);_container=d(Ca);constructor(){let e=d(ne),n=d(Uo),o=d(ue);super(e,n,o)}ngAfterContentInit(){this._container._contentMarginChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})}_shouldBeHidden(){if(this._platform.isBrowser)return!1;let{start:e,end:n}=this._container;return e!=null&&e.mode!=="over"&&e.opened||n!=null&&n.mode!=="over"&&n.opened}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["mat-drawer-content"]],hostAttrs:[1,"mat-drawer-content"],hostVars:6,hostBindings:function(n,o){n&2&&(In("margin-left",o._container._contentMargins.left,"px")("margin-right",o._container._contentMargins.right,"px"),A("mat-drawer-content-hidden",o._shouldBeHidden()))},features:[ge([{provide:Di,useExisting:i}]),ye],ngContentSelectors:Dl,decls:1,vars:0,template:function(n,o){n&1&&(Be(),me(0))},encapsulation:2,changeDetection:0})}return i})(),ya=(()=>{class i{_elementRef=d(ne);_focusTrapFactory=d(Ja);_focusMonitor=d(ki);_platform=d(ct);_ngZone=d(ue);_renderer=d(nt);_interactivityChecker=d(No);_doc=d(lt);_container=d(Jd,{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=tn(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=tn(e)),this._autoFocus=e}_autoFocus;get opened(){return this._opened()}set opened(e){this.toggle(tn(e))}_opened=Te(!1);_openedVia;_animationStarted=new F;_animationEnd=new F;openedChange=new H(!0);_openedStream=this.openedChange.pipe(he(e=>e),be(()=>{}));openedStart=this._animationStarted.pipe(he(()=>this.opened),pc(void 0));_closedStream=this.openedChange.pipe(he(e=>!e),be(()=>{}));closedStart=this._animationStarted.pipe(he(()=>!this.opened),pc(void 0));_destroyed=new F;onPositionChanged=new H;_content;_modeChanged=new F;_injector=d(ve);_changeDetectorRef=d(He);constructor(){this.openedChange.pipe(z(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(he(n=>n.keyCode===27&&!this.disableClose&&!Pt(n)),z(this._destroyed)).subscribe(n=>this._ngZone.run(()=>{this.close(),n.stopPropagation(),n.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,n){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let o=()=>{r(),a(),e.removeAttribute("tabindex")},r=this._renderer.listen(e,"blur",o),a=this._renderer.listen(e,"mousedown",o)})),e.focus(n)}_focusByCssSelector(e,n){let o=this._elementRef.nativeElement.querySelector(e);o&&this._forceFocus(o,n)}_takeFocus(){if(!this._focusTrap)return;let e=this._elementRef.nativeElement;switch(this.autoFocus){case!1:case"dialog":return;case!0:case"first-tabbable":Gt(()=>{!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,n){e&&n&&(this._openedVia=n);let o=this._setOpen(e,!e&&this._isFocusWithinDrawer(),this._openedVia||"program");return e||(this._openedVia=null),o}_setOpen(e,n,o){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&&n&&this._restoreFocus(o),this._changeDetectorRef.markForCheck(),this._updateFocusTrapState(),new Promise(r=>{this.openedChange.pipe(St(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 n=this._elementRef.nativeElement,o=n.parentNode;e==="end"?(this._anchor||(this._anchor=this._doc.createComment("mat-drawer-anchor"),o.insertBefore(this._anchor,n)),o.appendChild(n)):this._anchor&&this._anchor.parentNode.insertBefore(n,this._anchor)}_handleTransitionEvent=e=>{let n=this._elementRef.nativeElement;e.target===n&&this._ngZone.run(()=>{e.type==="transitionrun"?this._animationStarted.next(e):(e.type==="transitionend"&&this._setIsAnimating(!1),this._animationEnd.next(e))})};static \u0275fac=function(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["mat-drawer"]],viewQuery:function(n,o){if(n&1&&ie(Zy,5),n&2){let r;U(r=$())&&(o._content=r.first)}},hostAttrs:[1,"mat-drawer"],hostVars:12,hostBindings:function(n,o){n&2&&(G("align",null)("tabIndex",o.mode!=="side"?"-1":null),In("visibility",!o._container&&!o.opened?"hidden":null),A("mat-drawer-end",o.position==="end")("mat-drawer-over",o.mode==="over")("mat-drawer-push",o.mode==="push")("mat-drawer-side",o.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:Dl,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(n,o){n&1&&(Be(),s(0,"div",1,0),me(2),l())},dependencies:[Di],encapsulation:2,changeDetection:0})}return i})(),Ca=(()=>{class i{_dir=d(Ot,{optional:!0});_element=d(ne);_ngZone=d(ue);_changeDetectorRef=d(He);_animationDisabled=ot();_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=tn(e)}_autosize=d(lC);get hasBackdrop(){return this._drawerHasBackdrop(this._start)||this._drawerHasBackdrop(this._end)}set hasBackdrop(e){this._backdropOverride=e==null?null:tn(e)}_backdropOverride;backdropClick=new H;_start;_end;_left;_right;_destroyed=new F;_doCheckSubject=new F;_contentMargins={left:null,right:null};_contentMarginChanges=new F;get scrollable(){return this._userContent||this._content}_injector=d(ve);constructor(){let e=d(ct),n=d(ii);this._dir?.change.pipe(z(this._destroyed)).subscribe(()=>{this._validateDrawers(),this.updateContentMargins()}),n.change().pipe(z(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(Ft(this._allDrawers),z(this._destroyed)).subscribe(e=>{this._drawers.reset(e.filter(n=>!n._container||n._container===this)),this._drawers.notifyOnChanges()}),this._drawers.changes.pipe(Ft(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(jm(10),z(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,n=0;if(this._left&&this._left.opened){if(this._left.mode=="side")e+=this._left._getWidth();else if(this._left.mode=="push"){let o=this._left._getWidth();e+=o,n-=o}}if(this._right&&this._right.opened){if(this._right.mode=="side")n+=this._right._getWidth();else if(this._right.mode=="push"){let o=this._right._getWidth();n+=o,e-=o}}e=e||null,n=n||null,(e!==this._contentMargins.left||n!==this._contentMargins.right)&&(this._contentMargins={left:e,right:n},this._ngZone.run(()=>this._contentMarginChanges.next(this._contentMargins)))}ngDoCheck(){this._autosize&&this._isPushed()&&this._ngZone.runOutsideAngular(()=>this._doCheckSubject.next())}_watchDrawerToggle(e){e._animationStarted.pipe(z(this._drawers.changes)).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),e.mode!=="side"&&e.openedChange.pipe(z(this._drawers.changes)).subscribe(()=>this._setContainerClass(e.opened))}_watchDrawerPosition(e){e.onPositionChanged.pipe(z(this._drawers.changes)).subscribe(()=>{Gt({read:()=>this._validateDrawers()},{injector:this._injector})})}_watchDrawerMode(e){e._modeChanged.pipe(z(An(this._drawers.changes,this._destroyed))).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()})}_setContainerClass(e){let n=this._element.nativeElement.classList,o="mat-drawer-container-has-open";e?n.add(o):n.remove(o)}_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(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["mat-drawer-container"]],contentQueries:function(n,o,r){if(n&1&&(kt(r,vr,5),kt(r,ya,5)),n&2){let a;U(a=$())&&(o._content=a.first),U(a=$())&&(o._allDrawers=a)}},viewQuery:function(n,o){if(n&1&&ie(vr,5),n&2){let r;U(r=$())&&(o._userContent=r.first)}},hostAttrs:[1,"mat-drawer-container"],hostVars:2,hostBindings:function(n,o){n&2&&A("mat-drawer-container-explicit-backdrop",o._backdropOverride)},inputs:{autosize:"autosize",hasBackdrop:"hasBackdrop"},outputs:{backdropClick:"backdropClick"},exportAs:["matDrawerContainer"],features:[ge([{provide:Jd,useExisting:i}])],ngContentSelectors:eC,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(n,o){n&1&&(Be(Jy),w(0,tC,1,2,"div",0),me(1),me(2,1),w(3,nC,2,0,"mat-drawer-content")),n&2&&(S(o.hasBackdrop?0:-1),m(3),S(o._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}
|
|
364
|
+
`],encapsulation:2,changeDetection:0})}return i})(),Al=(()=>{class i extends vr{static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275cmp=M({type:i,selectors:[["mat-sidenav-content"]],hostAttrs:[1,"mat-drawer-content","mat-sidenav-content"],features:[ge([{provide:Di,useExisting:i}]),ye],ngContentSelectors:Dl,decls:1,vars:0,template:function(n,o){n&1&&(Be(),me(0))},encapsulation:2,changeDetection:0})}return i})(),em=(()=>{class i extends ya{get fixedInViewport(){return this._fixedInViewport}set fixedInViewport(e){this._fixedInViewport=tn(e)}_fixedInViewport=!1;get fixedTopGap(){return this._fixedTopGap}set fixedTopGap(e){this._fixedTopGap=Si(e)}_fixedTopGap=0;get fixedBottomGap(){return this._fixedBottomGap}set fixedBottomGap(e){this._fixedBottomGap=Si(e)}_fixedBottomGap=0;static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275cmp=M({type:i,selectors:[["mat-sidenav"]],hostAttrs:[1,"mat-drawer","mat-sidenav"],hostVars:16,hostBindings:function(n,o){n&2&&(G("tabIndex",o.mode!=="side"?"-1":null)("align",null),In("top",o.fixedInViewport?o.fixedTopGap:null,"px")("bottom",o.fixedInViewport?o.fixedBottomGap:null,"px"),A("mat-drawer-end",o.position==="end")("mat-drawer-over",o.mode==="over")("mat-drawer-push",o.mode==="push")("mat-drawer-side",o.mode==="side")("mat-sidenav-fixed",o.fixedInViewport))},inputs:{fixedInViewport:"fixedInViewport",fixedTopGap:"fixedTopGap",fixedBottomGap:"fixedBottomGap"},exportAs:["matSidenav"],features:[ge([{provide:ya,useExisting:i}]),ye],ngContentSelectors:Dl,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(n,o){n&1&&(Be(),s(0,"div",1,0),me(2),l())},dependencies:[Di],encapsulation:2,changeDetection:0})}return i})(),Fg=(()=>{class i extends Ca{_allDrawers=void 0;_content=void 0;static \u0275fac=(()=>{let e;return function(o){return(e||(e=tt(i)))(o||i)}})();static \u0275cmp=M({type:i,selectors:[["mat-sidenav-container"]],contentQueries:function(n,o,r){if(n&1&&(kt(r,Al,5),kt(r,em,5)),n&2){let a;U(a=$())&&(o._content=a.first),U(a=$())&&(o._allDrawers=a)}},hostAttrs:[1,"mat-drawer-container","mat-sidenav-container"],hostVars:2,hostBindings:function(n,o){n&2&&A("mat-drawer-container-explicit-backdrop",o._backdropOverride)},exportAs:["matSidenavContainer"],features:[ge([{provide:Jd,useExisting:i},{provide:Ca,useExisting:i}]),ye],ngContentSelectors:oC,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(n,o){n&1&&(Be(iC),w(0,rC,1,2,"div",0),me(1),me(2,1),w(3,aC,2,0,"mat-sidenav-content")),n&2&&(S(o.hasBackdrop?0:-1),m(3),S(o._content?-1:3))},dependencies:[Al],styles:[sC],encapsulation:2,changeDetection:0})}return i})(),Il=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({imports:[ce,eo,eo,ce]})}return i})();var Vg="mat-badge-content",dC=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["ng-component"]],decls:0,vars:0,template:function(n,o){},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)}
|
|
365
|
+
`],encapsulation:2,changeDetection:0})}return i})(),Lg=(()=>{class i{_ngZone=d(ue);_elementRef=d(ne);_ariaDescriber=d(_h);_renderer=d(nt);_animationsDisabled=ot();_idGenerator=d(Re);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=d(No);_document=d(lt);constructor(){let e=d(Nt);e.load(dC),e.load(Za)}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"),n="mat-badge-active";return e.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),e.setAttribute("aria-hidden","true"),e.classList.add(Vg),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(n)})}):e.classList.add(n),e}_updateRenderedContent(e){let n=`${e??""}`.trim();this._isInitialized&&n&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=n),this._content=n}_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 n=this._elementRef.nativeElement.classList;n.remove(`mat-badge-${this._color}`),e&&n.add(`mat-badge-${e}`)}_clearExistingBadges(){let e=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Vg}`);for(let n of Array.from(e))n!==this._badgeElement&&n.remove()}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(n,o){n&2&&A("mat-badge-overlap",o.overlap)("mat-badge-above",o.isAbove())("mat-badge-below",!o.isAbove())("mat-badge-before",!o.isAfter())("mat-badge-after",o.isAfter())("mat-badge-small",o.size==="small")("mat-badge-medium",o.size==="medium")("mat-badge-large",o.size==="large")("mat-badge-hidden",o.hidden||!o.content)("mat-badge-disabled",o.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",K],disabled:[2,"matBadgeDisabled","disabled",K],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",K]}})}return i})(),jg=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({imports:[ts,ce,ce]})}return i})();var yr=class i{ATTENTION_EMOJI="\u{1F534}";isSystemActive=!1;systemActiveTimer=null;SYSTEM_ACTIVE_TIMEOUT=4e3;unreadService=d(dr);project=d(we);constructor(){this.initializeTitleUpdates()}initializeTitleUpdates(){Xn([this.project.selectedProject$,this.unreadService.unreadCount$]).subscribe(([t,e])=>{this.updateTitle(t?.name??"...",e)})}updateTitle(t,e){let n;this.isSystemActive?n=`\u23F3${e>0?` (${e}) `:" "}${t}`:e>0?n=`${this.ATTENTION_EMOJI} (${e}) ${t}`:n=t,document.title=n,console.log("[TAB-TITLE] Updated to:",n)}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||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var Rl=class i{http=d(Ge);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 J(this,null,function*(){return new Promise((e,n)=>{let o=new FileReader;o.onload=()=>{let r=o.result;if(!r){n(new Error("Failed to read file"));return}let a=r.split(",")[1];if(!a){n(new Error("Invalid file format"));return}e(a)},o.onerror=n,o.readAsDataURL(t)})})}getUploadUrl(t,e){return`/api/projects/${t}/threads/${e}/upload`}uploadImage(t,e,n){console.log("[IMAGE-UPLOAD] uploadImage - file:",t.name,t.type,t.size),console.log("[IMAGE-UPLOAD] uploadImage - project:",e,"thread:",n);try{console.log("[IMAGE-UPLOAD] Validating file..."),this.validateFile(t)}catch(o){return console.log("[IMAGE-UPLOAD] Validation failed:",o),wt({success:!1,error:o instanceof Error?o.message:"Validation failed"})}return new rn(o=>{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,n),{content:r,mimeType:t.type,filename:t.name}).pipe(be(a=>(console.log("[IMAGE-UPLOAD] Upload success result:",a),{success:!0,processedSize:a.processedSize,dimensions:a.dimensions})),Ui(a=>{console.log("[IMAGE-UPLOAD] Upload failed:",a);let c=a.error?.error||a.message||"Upload failed";return wt({success:!1,error:c})})).subscribe({next:a=>{o.next(a),o.complete()},error:a=>o.error(a)})}).catch(r=>{console.log("[IMAGE-UPLOAD] Base64 conversion failed:",r),o.next({success:!1,error:r instanceof Error?r.message:"Failed to read file"}),o.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(o=>({name:o.name,type:o.type})));let n=e.some(o=>this.supportedTypes.includes(o.type));return console.log("[IMAGE-UPLOAD] hasImageFiles - result:",n),n}filterImageFiles(t){return Array.from(t).filter(n=>this.supportedTypes.includes(n.type))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var Cr=class i{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||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var hC=["inputSection"];function uC(i,t){if(i&1){let e=E();s(0,"button",18),_("click",function(){v(e);let o=g();return y(o.toggleFileDrawer())}),s(1,"mat-icon"),h(2,"folder_open"),l()()}if(i&2){let e=g();A("has-files",e.fileCount>0),x("title",Ci("Files Exchange",e.fileCount>0?" ("+e.fileCount+" file"+(e.fileCount>1?"s":"")+")":""))("matBadge",e.fileCount>0?e.fileCount:null)}}function pC(i,t){if(i&1&&(s(0,"div",5),h(1),l()),i&2){let e=g();m(),yi(" \u26A0\uFE0F Connection lost. Reconnecting... (",e.connectionStatus.reconnectAttempts,"/",e.connectionStatus.maxAttempts,") ")}}function gC(i,t){if(i&1&&(s(0,"div",19),h(1),l()),i&2){let e=g();A("error",e.uploadStatus.isError),m(),oe(" ",e.uploadStatus.message," ")}}function fC(i,t){if(i&1){let e=E();s(0,"app-chat-textarea",20),_("messageSubmitted",function(o){v(e);let r=g();return y(r.onMessageSubmitted(o))})("voiceRecordingToggled",function(o){v(e);let r=g();return y(r.onVoiceToggled(o))})("heightChanged",function(o){v(e);let r=g();return y(r.onInputHeightChanged(o))})("stopRequested",function(){v(e);let o=g();return y(o.onStopRequested())})("filesPasted",function(o){v(e);let r=g();return y(r.onFilesPasted(o))}),l()}if(i&2){let e=g();x("isDisabled",!e.isConnected)("isSessionInitializing",!1)("showWelcome",!1)("isThinking",e.isThinking)("isStarting",!1)}}function _C(i,t){if(i&1){let e=E();s(0,"app-choice-select",21),_("choiceSelected",function(o){v(e);let r=g();return y(r.onChoiceSelected(o))}),l()}if(i&2){let e=g();x("options",e.currentChoice.options)("labelHtml",e.currentChoice.label)("isVisible",!!e.currentChoice)}}function bC(i,t){i&1&&(s(0,"div",17)(1,"div",22)(2,"div",23),h(3,"\u{1F4CE}"),l(),s(4,"div",24),h(5,"Drop files here to upload"),l(),s(6,"div",25),h(7,"Images will be added to conversation, other files to exchange space"),l()()())}var Fl=class i{projectName;threadId;destroy$=new F;inputSection;messages=[];streamingText="";isThinking=!1;currentChoice=null;connectionStatus=null;isConnected=!1;showConnectionStatus=!1;hasEverConnected=!1;inputSectionHeight=80;uploadStatus={message:"",isError:!1};isDragOver=!1;isFileDrawerOpen=!1;get fileCount(){return this.fileExchangeState.fileCount()}pendingFirstMessage=null;subscriptions=[];codayService=d(hn);preferencesService=d(rt);titleService=d(yr);elementRef=d(ne);threadState=d(Dt);imageUploadService=d(Rl);fileExchangeState=d(hr);firstMessageState=d(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.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.codayService.messages$.pipe(z(this.destroy$)).subscribe(e=>{console.log("[THREAD] Messages updated:",e.length),this.messages=e}),this.codayService.streamingText$.pipe(z(this.destroy$)).subscribe(e=>{this.streamingText=e}),this.codayService.isThinking$.pipe(z(this.destroy$)).subscribe(e=>{this.isThinking=e}),this.codayService.currentChoice$.pipe(z(this.destroy$)).subscribe(e=>{this.currentChoice=e}),this.codayService.connectionStatus$.pipe(z(this.destroy$)).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(z(this.destroy$)).subscribe(e=>{e&&(console.log("[THREAD] Thread update event received:",e),this.threadState.refreshThreadList())}),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.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),n=t.filter(o=>!o.type.startsWith("image/"));e.length&&this.uploadFilesSequentially(e,0),n.length&&this.uploadFilesToExchangeSpace(n),!e.length&&!n.length&&this.showUploadError("No supported files found")}toggleFileDrawer(){console.log("[THREAD] Toggling file drawer"),this.isFileDrawerOpen=!this.isFileDrawerOpen}closeFileDrawer(){console.log("[THREAD] Closing file drawer"),this.isFileDrawerOpen=!1}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 n=this.imageUploadService.filterImageFiles(e),o=Array.from(e).filter(r=>!r.type.startsWith("image/"));console.log("[THREAD] Image files:",n.length,"Other files:",o.length),n.length>0&&this.uploadFilesSequentially(n,0),o.length>0&&this.uploadFilesToExchangeSpace(o),n.length===0&&o.length===0&&this.showUploadError("No supported files found")}uploadFilesSequentially(t,e){if(e>=t.length)return;let n=t[e];if(!n){console.error("[THREAD] File at index",e,"is undefined");return}console.log("[THREAD] Uploading file:",n.name),this.uploadStatus={message:`Uploading ${n.name}...`,isError:!1},this.imageUploadService.uploadImage(n,this.projectName,this.threadId).subscribe({next:o=>{o.success?(console.log("[THREAD] Upload successful:",n.name),this.uploadStatus={message:`\u2713 ${n.name} uploaded (${(o.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:",n.name,o.error),this.showUploadError(`Failed to upload ${n.name}: ${o.error}`))},error:o=>{console.error("[THREAD] Upload error:",n.name,o),this.showUploadError(`Failed to upload ${n.name}: ${o.message||"Unknown error"}`)}})}showUploadError(t){this.uploadStatus={message:t,isError:!0},setTimeout(()=>{this.uploadStatus={message:"",isError:!1}},5e3)}uploadFilesToExchangeSpace(t){return J(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 n=yield this.fileExchangeState.uploadFile(e);if(n.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,n.error),this.showUploadError(`Failed to upload ${e.name}: ${n.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||i)};static \u0275cmp=M({type:i,selectors:[["app-thread"]],viewQuery:function(e,n){if(e&1&&ie(hC,5),e&2){let o;U(o=$())&&(n.inputSection=o.first)}},inputs:{projectName:"projectName",threadId:"threadId"},features:[Ve],decls:19,vars:13,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"],[1,"connection-status"],[1,"chat-wrapper"],[1,"chat-center"],[3,"copyRequested","stopRequested","messages","streamingText","isThinking"],[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"],["mode","side","position","end",3,"closed","opened"],[3,"closeDrawer","projectName","threadId"],[1,"drag-overlay"],["matFab","","type","button",1,"file-drawer-toggle-btn",3,"click","matBadge","title"],[1,"upload-status"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","stopRequested","filesPasted","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"],[1,"choice-overlay",3,"choiceSelected","options","labelHtml","isVisible"],[1,"drag-overlay-content"],[1,"drag-icon"],[1,"drag-text"],[1,"drag-hint"]],template:function(e,n){if(e&1){let o=E();s(0,"div",1),_("dragenter",function(a){return v(o),y(n.onDragEnter(a))})("dragover",function(a){return v(o),y(n.onDragOver(a))})("dragleave",function(a){return v(o),y(n.onDragLeave(a))})("drop",function(a){return v(o),y(n.onDrop(a))}),s(1,"mat-drawer-container",2)(2,"mat-drawer-content")(3,"div",3),w(4,uC,3,5,"button",4),w(5,pC,2,2,"div",5),s(6,"div",6)(7,"div",7)(8,"app-chat-history",8),_("copyRequested",function(a){return v(o),y(n.onCopyMessage(a))})("stopRequested",function(){return v(o),y(n.onStopRequested())}),l(),w(9,gC,2,3,"div",9),l()(),s(10,"div",10,0)(12,"div",11)(13,"div",12),w(14,fC,1,5,"app-chat-textarea",13),w(15,_C,1,3,"app-choice-select",14),l()()()()(),s(16,"mat-drawer",15),_("closed",function(){return v(o),y(n.closeFileDrawer())}),s(17,"app-file-exchange-drawer",16),_("closeDrawer",function(){return v(o),y(n.closeFileDrawer())}),l()()(),w(18,bC,8,0,"div",17),l()}e&2&&(m(),x("hasBackdrop",!1),m(3),S(n.isFileDrawerOpen?-1:4),m(),S(n.showConnectionStatus&&n.connectionStatus&&!n.connectionStatus.connected?5:-1),m(3),x("messages",n.messages)("streamingText",n.streamingText)("isThinking",n.isThinking),m(),S(n.uploadStatus.message?9:-1),m(5),S(n.currentChoice?-1:14),m(),S(n.currentChoice?15:-1),m(),x("opened",n.isFileDrawerOpen),m(),x("projectName",n.projectName)("threadId",n.threadId),m(),S(n.isDragOver?18:-1))},dependencies:[vl,cr,Zo,Ol,Il,ya,Ca,vr,Ye,xe,yt,os,jg,Lg],styles:[".drag-drop-wrapper[_ngcontent-%COMP%]{height:100vh;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}@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;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}}.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 1rem;display:flex;flex-direction:column;gap:1rem}.upload-status[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:8px;background:var(--color-primary-light);color:var(--color-text);text-align:center;font-size:.9rem;margin-top:1rem}.upload-status.error[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.input-section[_ngcontent-%COMP%]{flex-shrink:0;width:100%;padding:1rem 0;background:var(--color-background)}.input-center[_ngcontent-%COMP%]{max-width:800px;width:100%;margin:0 auto;padding:0 1rem}.input-glass[_ngcontent-%COMP%]{position:relative;background:transparent;border-radius:12px;display:flex;flex-direction:column}.choice-overlay[_ngcontent-%COMP%]{width:100%;background:var(--color-bg-solid);border-radius:12px;padding:1.5rem;box-shadow:0 4px 12px #00000026}.drag-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;background:#000000b3;z-index:10000;display:flex;align-items:center;justify-content:center;pointer-events:none}.drag-overlay-content[_ngcontent-%COMP%]{text-align:center;color:#fff;padding:2rem;border:3px dashed white;border-radius:12px;background:#00000080}.drag-icon[_ngcontent-%COMP%]{font-size:4rem;margin-bottom:1rem}.drag-text[_ngcontent-%COMP%]{font-size:1.5rem;font-weight:500}.drag-hint[_ngcontent-%COMP%]{font-size:.9rem;margin-top:.5rem;opacity:.8}@media (max-width: 768px){.chat-center[_ngcontent-%COMP%], .input-center[_ngcontent-%COMP%]{padding:0 .5rem}.drag-text[_ngcontent-%COMP%]{font-size:1.2rem}.drag-icon[_ngcontent-%COMP%]{font-size:3rem}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:100vw;max-width:100vw}.file-drawer-toggle-btn[_ngcontent-%COMP%]{top:.75rem!important;right:.75rem!important}}@media print{.connection-status[_ngcontent-%COMP%], .input-section[_ngcontent-%COMP%], .drag-overlay[_ngcontent-%COMP%], .file-drawer-toggle-btn[_ngcontent-%COMP%], .file-drawer-container[_ngcontent-%COMP%]{display:none!important}.chat-wrapper[_ngcontent-%COMP%]{overflow:visible;height:auto}.thread-container[_ngcontent-%COMP%]{height:auto}}"]})};var zg=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({imports:[ce,ce]})}return i})();var Bg=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({imports:[ce]})}return i})();var $n=class i{http=d(Ge);getUserConfig(){return this.http.get("/api/config/user").pipe(st(t=>console.log("[CONFIG-API] User config retrieved:",t)))}updateUserConfig(t){return this.http.put("/api/config/user",t).pipe(st(e=>console.log("[CONFIG-API] User config updated:",e)))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var xr=class i{currentThemeSubject=new re("light");currentTheme$=this.currentThemeSubject.asObservable();preferences=d(rt);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 n=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";console.log("[THEME] System theme resolved to:",n),this.setDocumentTheme(n)}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||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var vC=["mat-internal-form-field",""],yC=["*"],Nl=(()=>{class i{labelPosition;static \u0275fac=function(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["div","mat-internal-form-field",""]],hostAttrs:[1,"mdc-form-field","mat-internal-form-field"],hostVars:2,hostBindings:function(n,o){n&2&&A("mdc-form-field--align-end",o.labelPosition==="before")},inputs:{labelPosition:"labelPosition"},attrs:vC,ngContentSelectors:yC,decls:1,vars:0,template:function(n,o){n&1&&(Be(),me(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}
|
|
366
|
+
`],encapsulation:2,changeDetection:0})}return i})();var CC=["switch"],xC=["*"];function wC(i,t){i&1&&(s(0,"span",11),Kn(),s(1,"svg",13),I(2,"path",14),l(),s(3,"svg",15),I(4,"path",16),l()())}var SC=new te("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),Vl=class{source;checked;constructor(t,e){this.source=t,this.checked=e}},vo=(()=>{class i{_elementRef=d(ne);_focusMonitor=d(ki);_changeDetectorRef=d(He);defaults=d(SC);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(e){return new Vl(this,e)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations=ot();_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(){d(Nt).load(Ei);let e=d(new xi("tabindex"),{optional:!0}),n=this.defaults;this.tabIndex=e==null?0:parseInt(e)||0,this.color=n.color||"accent",this.id=this._uniqueId=d(Re).getId("mat-mdc-slide-toggle-"),this.hideIcon=n.hideIcon??!1,this.disabledInteractive=n.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 Vl(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["mat-slide-toggle"]],viewQuery:function(n,o){if(n&1&&ie(CC,5),n&2){let r;U(r=$())&&(o._switchElement=r.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(n,o){n&2&&(Jt("id",o.id),G("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),Zn(o.color?"mat-"+o.color:""),A("mat-mdc-slide-toggle-focused",o._focused)("mat-mdc-slide-toggle-checked",o.checked)("_mat-animation-noopable",o._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",K],color:"color",disabled:[2,"disabled","disabled",K],disableRipple:[2,"disableRipple","disableRipple",K],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:bn(e)],checked:[2,"checked","checked",K],hideIcon:[2,"hideIcon","hideIcon",K],disabledInteractive:[2,"disabledInteractive","disabledInteractive",K]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[ge([{provide:Xt,useExisting:it(()=>i),multi:!0},{provide:Mn,useExisting:i,multi:!0}]),Ve],ngContentSelectors:xC,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(n,o){if(n&1){let r=E();Be(),s(0,"div",1)(1,"button",2,0),_("click",function(){return v(r),y(o._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(),w(11,wC,5,0,"span",11),l()()(),s(12,"label",12),_("click",function(c){return v(r),y(c.stopPropagation())}),me(13),l()()}if(n&2){let r=en(2);x("labelPosition",o.labelPosition),m(),A("mdc-switch--selected",o.checked)("mdc-switch--unselected",!o.checked)("mdc-switch--checked",o.checked)("mdc-switch--disabled",o.disabled)("mat-mdc-slide-toggle-disabled-interactive",o.disabledInteractive),x("tabIndex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("disabled",o.disabled&&!o.disabledInteractive),G("id",o.buttonId)("name",o.name)("aria-label",o.ariaLabel)("aria-labelledby",o._getAriaLabelledBy())("aria-describedby",o.ariaDescribedby)("aria-required",o.required||null)("aria-checked",o.checked)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null),m(9),x("matRippleTrigger",r)("matRippleDisabled",o.disableRipple||o.disabled)("matRippleCentered",!0),m(),S(o.hideIcon?-1:11),m(),x("for",o.buttonId),G("id",o._labelId)}},dependencies:[Mi,Nl],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%)}
|
|
367
|
+
`],encapsulation:2,changeDetection:0})}return i})(),Ll=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({imports:[vo,ce,ce]})}return i})();var kC=(i,t)=>t.code,MC=(i,t)=>t.name+t.lang;function EC(i,t){i&1&&(s(0,"div",15)(1,"mat-icon",32),h(2,"warning"),l(),s(3,"span",33),h(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),l()())}function TC(i,t){if(i&1&&(s(0,"option",18),h(1),l()),i&2){let e=t.$implicit;x("value",e.code),m(),yi("",e.flag," ",e.label)}}function PC(i,t){i&1&&(s(0,"option",25),h(1,"Loading voices..."),l())}function OC(i,t){i&1&&(s(0,"option",25),h(1,"No voice available"),l())}function AC(i,t){if(i&1&&(s(0,"option",18),h(1),l()),i&2){let e=t.$implicit;x("value",e.name+"|"+e.lang),m(),oe(" ",e.displayName," ")}}var xa=class i{destroy$=new F;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=d(rt);voiceSynthesisService=d(mr);themeService=d(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(z(this.destroy$)).subscribe(t=>{this.selectedTheme=t}),this.preferencesService.voiceLanguage$.pipe(z(this.destroy$)).subscribe(t=>{this.selectedVoiceLanguage=t}),this.preferencesService.enterToSend$.pipe(z(this.destroy$)).subscribe(t=>{this.useEnterToSend=t}),this.preferencesService.printTechnicalMessages$.pipe(z(this.destroy$)).subscribe(t=>{this.printTechnicalMessages=t}),this.preferencesService.hideTechnicalMessages$.pipe(z(this.destroy$)).subscribe(t=>{this.showTechnicalMessages=!t}),this.preferencesService.hideWarningMessages$.pipe(z(this.destroy$)).subscribe(t=>{this.showWarningMessages=!t}),this.preferencesService.voiceAnnounceEnabled$.pipe(z(this.destroy$)).subscribe(t=>{this.voiceAnnounceEnabled=t}),this.preferencesService.voiceMode$.pipe(z(this.destroy$)).subscribe(t=>{this.voiceMode=t}),this.preferencesService.voiceReadFullText$.pipe(z(this.destroy$)).subscribe(t=>{this.voiceReadFullText=t}),this.preferencesService.voiceVolume$.pipe(z(this.destroy$)).subscribe(t=>{this.voiceVolume=Math.round(t*100)}),this.preferencesService.voiceRate$.pipe(z(this.destroy$)).subscribe(t=>{this.voiceRate=Math.round(t*100)}),this.preferencesService.selectedVoice$.pipe(z(this.destroy$)).subscribe(t=>{this.selectedVoiceId=t}),this.preferencesService.voiceLanguage$.pipe(z(this.destroy$)).subscribe(()=>{this.loadAvailableVoices()}),this.preferencesService.agentNotificationEnabled$.pipe(z(this.destroy$)).subscribe(t=>{this.agentNotificationEnabled=t}),this.preferencesService.notificationSoundEnabled$.pipe(z(this.destroy$)).subscribe(t=>{this.notificationSoundEnabled=t}),this.preferencesService.browserNotificationEnabled$.pipe(z(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 J(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||i)};static \u0275cmp=M({type:i,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,n){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),h(4,"palette"),l(),s(5,"span"),h(6,"Appearance"),l()(),s(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),L("ngModelChange",function(r){return V(n.selectedTheme,r)||(n.selectedTheme=r),r}),_("change",function(){return n.onThemeChange()}),l(),I(11,"span",7),h(12," Light "),l(),s(13,"label",5)(14,"input",8),L("ngModelChange",function(r){return V(n.selectedTheme,r)||(n.selectedTheme=r),r}),_("change",function(){return n.onThemeChange()}),l(),I(15,"span",7),h(16," Dark "),l(),s(17,"label",5)(18,"input",9),L("ngModelChange",function(r){return V(n.selectedTheme,r)||(n.selectedTheme=r),r}),_("change",function(){return n.onThemeChange()}),l(),I(19,"span",7),h(20," System "),l()()()(),s(21,"div",1)(22,"div",2)(23,"mat-icon"),h(24,"chat_bubble_outline"),l(),s(25,"span"),h(26,"Messaging"),l()(),s(27,"div",3)(28,"span",10),h(29,"Send message behavior:"),l(),s(30,"div",4)(31,"label",5)(32,"input",11),L("ngModelChange",function(r){return V(n.useEnterToSend,r)||(n.useEnterToSend=r),r}),_("change",function(){return n.onEnterToSendChange()}),l(),I(33,"span",7),h(34," Enter to send "),l(),s(35,"label",5)(36,"input",11),L("ngModelChange",function(r){return V(n.useEnterToSend,r)||(n.useEnterToSend=r),r}),_("change",function(){return n.onEnterToSendChange()}),l(),I(37,"span",7),h(38," Enter for new line "),l()()(),s(39,"div",3)(40,"div",12)(41,"span",10),h(42,"Show technical messages"),l(),s(43,"mat-slide-toggle",13),L("ngModelChange",function(r){return V(n.showTechnicalMessages,r)||(n.showTechnicalMessages=r),r}),_("change",function(){return n.onShowTechnicalMessagesChange()}),l()()(),s(44,"div",3)(45,"div",12)(46,"span",10),h(47,"Show warning messages"),l(),s(48,"mat-slide-toggle",13),L("ngModelChange",function(r){return V(n.showWarningMessages,r)||(n.showWarningMessages=r),r}),_("change",function(){return n.onShowWarningMessagesChange()}),l()()(),s(49,"div",3)(50,"div",12)(51,"span",10),h(52,"Include technical messages in print"),l(),s(53,"mat-slide-toggle",13),L("ngModelChange",function(r){return V(n.printTechnicalMessages,r)||(n.printTechnicalMessages=r),r}),_("change",function(){return n.onPrintTechnicalMessagesChange()}),l()()()(),s(54,"div",1)(55,"div",2)(56,"mat-icon"),h(57,"notifications"),l(),s(58,"span"),h(59,"Notifications"),l()(),s(60,"div",3)(61,"div",12)(62,"span",10),h(63,"Notify when the agent answers or requests input"),l(),s(64,"mat-slide-toggle",13),L("ngModelChange",function(r){return V(n.agentNotificationEnabled,r)||(n.agentNotificationEnabled=r),r}),_("change",function(){return n.onAgentNotificationEnabledChange()}),l()()(),s(65,"div",3)(66,"div",12)(67,"span",10),h(68,"Notification sound"),l(),s(69,"mat-slide-toggle",14),L("ngModelChange",function(r){return V(n.notificationSoundEnabled,r)||(n.notificationSoundEnabled=r),r}),_("change",function(){return n.onNotificationSoundEnabledChange()}),l()()(),s(70,"div",3)(71,"div",12)(72,"span",10),h(73,"Browser notification"),l(),s(74,"mat-slide-toggle",14),L("ngModelChange",function(r){return V(n.browserNotificationEnabled,r)||(n.browserNotificationEnabled=r),r}),_("change",function(){return n.onBrowserNotificationEnabledChange()}),l()(),w(75,EC,5,0,"div",15),l()(),s(76,"div",1)(77,"div",2)(78,"mat-icon"),h(79,"record_voice_over"),l(),s(80,"span"),h(81,"Voice & Speech"),l()(),s(82,"div",3)(83,"label",16),h(84,"Voice recognition language:"),l(),s(85,"select",17),L("ngModelChange",function(r){return V(n.selectedVoiceLanguage,r)||(n.selectedVoiceLanguage=r),r}),_("change",function(){return n.onVoiceLanguageChange()}),Oe(86,TC,2,3,"option",18,kC),l()(),s(88,"div",3)(89,"span",10),h(90,"Automatic announcement:"),l(),s(91,"div",4)(92,"label",5)(93,"input",19),L("ngModelChange",function(r){return V(n.voiceAnnounceEnabled,r)||(n.voiceAnnounceEnabled=r),r}),_("change",function(){return n.onVoiceAnnounceEnabledChange()}),l(),I(94,"span",7),h(95," Enabled "),l(),s(96,"label",5)(97,"input",19),L("ngModelChange",function(r){return V(n.voiceAnnounceEnabled,r)||(n.voiceAnnounceEnabled=r),r}),_("change",function(){return n.onVoiceAnnounceEnabledChange()}),l(),I(98,"span",7),h(99," Disabled "),l()()(),s(100,"div",3)(101,"span",10),h(102,"Voice mode:"),l(),s(103,"div",4)(104,"label",5)(105,"input",20),L("ngModelChange",function(r){return V(n.voiceMode,r)||(n.voiceMode=r),r}),_("change",function(){return n.onVoiceModeChange()}),l(),I(106,"span",7),h(107," Voice synthesis "),l(),s(108,"label",5)(109,"input",21),L("ngModelChange",function(r){return V(n.voiceMode,r)||(n.voiceMode=r),r}),_("change",function(){return n.onVoiceModeChange()}),l(),I(110,"span",7),h(111," Sound notification "),l()()(),s(112,"div",3)(113,"span",10),h(114,"Message reading:"),l(),s(115,"div",4)(116,"label",5)(117,"input",22),L("ngModelChange",function(r){return V(n.voiceReadFullText,r)||(n.voiceReadFullText=r),r}),_("change",function(){return n.onVoiceReadFullTextChange()}),l(),I(118,"span",7),h(119," Full message "),l(),s(120,"label",5)(121,"input",22),L("ngModelChange",function(r){return V(n.voiceReadFullText,r)||(n.voiceReadFullText=r),r}),_("change",function(){return n.onVoiceReadFullTextChange()}),l(),I(122,"span",7),h(123," First paragraphs only "),l()()(),s(124,"div",3)(125,"label",23),h(126,"Selected voice:"),l(),s(127,"select",24),L("ngModelChange",function(r){return V(n.selectedVoiceId,r)||(n.selectedVoiceId=r),r}),_("change",function(){return n.onSelectedVoiceChange()}),w(128,PC,2,0,"option",25),w(129,OC,2,0,"option",25),Oe(130,AC,2,2,"option",18,MC),l(),I(132,"div",10),s(133,"a",26),_("click",function(){return n.testVoice()}),s(134,"span",27),h(135,"Test voice"),l()()(),s(136,"div",3)(137,"label",28),h(138),l(),s(139,"input",29),L("ngModelChange",function(r){return V(n.voiceVolume,r)||(n.voiceVolume=r),r}),_("input",function(){return n.onVoiceVolumeChange()}),l()(),s(140,"div",3)(141,"label",30),h(142),l(),s(143,"input",31),L("ngModelChange",function(r){return V(n.voiceRate,r)||(n.voiceRate=r),r}),_("input",function(){return n.onVoiceRateChange()}),l()()()()),e&2&&(m(10),N("ngModel",n.selectedTheme),m(4),N("ngModel",n.selectedTheme),m(4),N("ngModel",n.selectedTheme),m(14),x("value",!0),N("ngModel",n.useEnterToSend),m(4),x("value",!1),N("ngModel",n.useEnterToSend),m(7),N("ngModel",n.showTechnicalMessages),m(5),N("ngModel",n.showWarningMessages),m(5),N("ngModel",n.printTechnicalMessages),m(11),N("ngModel",n.agentNotificationEnabled),m(5),N("ngModel",n.notificationSoundEnabled),x("disabled",!n.agentNotificationEnabled),m(5),N("ngModel",n.browserNotificationEnabled),x("disabled",!n.agentNotificationEnabled||n.browserNotificationDenied),m(),S(n.browserNotificationDenied?75:-1),m(10),N("ngModel",n.selectedVoiceLanguage),m(),Ae(n.voiceLanguageOptions),m(7),x("value",!0),N("ngModel",n.voiceAnnounceEnabled),m(4),x("value",!1),N("ngModel",n.voiceAnnounceEnabled),m(8),N("ngModel",n.voiceMode),m(4),N("ngModel",n.voiceMode),m(8),x("value",!0),N("ngModel",n.voiceReadFullText),m(4),x("value",!1),N("ngModel",n.voiceReadFullText),m(6),N("ngModel",n.selectedVoiceId),x("disabled",n.loadingVoices||n.availableVoices.length===0),m(),S(n.loadingVoices?128:-1),m(),S(!n.loadingVoices&&n.availableVoices.length===0?129:-1),m(),Ae(n.availableVoices),m(8),oe("Volume: ",n.voiceVolume,"%"),m(),N("ngModel",n.voiceVolume),m(3),oe("Speed: ",n.voiceRate,"%"),m(),N("ngModel",n.voiceRate))},dependencies:[Xe,sl,ll,je,Hd,al,mo,Qe,We,xe,vo],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 DC=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(n,o){},styles:[`textarea.cdk-textarea-autosize{resize:none}textarea.cdk-textarea-autosize-measuring{padding:2px 0 !important;box-sizing:content-box !important;height:auto !important;overflow:hidden !important}textarea.cdk-textarea-autosize-measuring-firefox{padding:2px 0 !important;box-sizing:content-box !important;height:0 !important}@keyframes cdk-text-field-autofill-start{/*!*/}@keyframes cdk-text-field-autofill-end{/*!*/}.cdk-text-field-autofill-monitored:-webkit-autofill{animation:cdk-text-field-autofill-start 0s 1ms}.cdk-text-field-autofill-monitored:not(:-webkit-autofill){animation:cdk-text-field-autofill-end 0s 1ms}
|
|
368
|
+
`],encapsulation:2,changeDetection:0})}return i})(),IC={passive:!0},Wg=(()=>{class i{_platform=d(ct);_ngZone=d(ue);_renderer=d(fn).createRenderer(null,null);_styleLoader=d(Nt);_monitoredElements=new Map;constructor(){}monitor(e){if(!this._platform.isBrowser)return Im;this._styleLoader.load(DC);let n=Lr(e),o=this._monitoredElements.get(n);if(o)return o.subject;let r=new F,a="cdk-text-field-autofilled",c=p=>{p.animationName==="cdk-text-field-autofill-start"&&!n.classList.contains(a)?(n.classList.add(a),this._ngZone.run(()=>r.next({target:p.target,isAutofilled:!0}))):p.animationName==="cdk-text-field-autofill-end"&&n.classList.contains(a)&&(n.classList.remove(a),this._ngZone.run(()=>r.next({target:p.target,isAutofilled:!1})))},u=this._ngZone.runOutsideAngular(()=>(n.classList.add("cdk-text-field-autofill-monitored"),this._renderer.listen(n,"animationstart",c,IC)));return this._monitoredElements.set(n,{subject:r,unlisten:u}),r}stopMonitoring(e){let n=Lr(e),o=this._monitoredElements.get(n);o&&(o.unlisten(),o.subject.complete(),n.classList.remove("cdk-text-field-autofill-monitored"),n.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(n))}ngOnDestroy(){this._monitoredElements.forEach((e,n)=>this.stopMonitoring(n))}static \u0275fac=function(n){return new(n||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Ug=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({})}return i})();var $g=new te("MAT_INPUT_VALUE_ACCESSOR");var tm=class{_box;_destroyed=new F;_resizeSubject=new F;_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 rn(e=>{let n=this._resizeSubject.subscribe(e);return this._resizeObserver?.observe(t,{box:this._box}),()=>{this._resizeObserver?.unobserve(t),n.unsubscribe(),this._elementObservables.delete(t)}}).pipe(he(e=>e.some(n=>n.target===t)),bi({bufferSize:1,refCount:!0}),z(this._destroyed))),this._elementObservables.get(t)}destroy(){this._destroyed.next(),this._destroyed.complete(),this._resizeSubject.complete(),this._elementObservables.clear()}},qg=(()=>{class i{_cleanupErrorListener;_observers=new Map;_ngZone=d(ue);constructor(){typeof ResizeObserver<"u"}ngOnDestroy(){for(let[,e]of this._observers)e.destroy();this._observers.clear(),this._cleanupErrorListener?.()}observe(e,n){let o=n?.box||"content-box";return this._observers.has(o)||this._observers.set(o,new tm(o)),this._observers.get(o).observe(e)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var RC=["notch"],FC=["matFormFieldNotchedOutline",""],NC=["*"],Gg=["iconPrefixContainer"],Yg=["textPrefixContainer"],Qg=["iconSuffixContainer"],Xg=["textSuffixContainer"],VC=["textField"],LC=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],jC=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function zC(i,t){i&1&&I(0,"span",21)}function BC(i,t){if(i&1&&(s(0,"label",20),me(1,1),w(2,zC,1,0,"span",21),l()),i&2){let e=g(2);x("floating",e._shouldLabelFloat())("monitorResize",e._hasOutline())("id",e._labelId),G("for",e._control.disableAutomaticLabeling?null:e._control.id),m(2),S(!e.hideRequiredMarker&&e._control.required?2:-1)}}function HC(i,t){if(i&1&&w(0,BC,3,5,"label",20),i&2){let e=g();S(e._hasFloatingLabel()?0:-1)}}function WC(i,t){i&1&&I(0,"div",7)}function UC(i,t){}function $C(i,t){if(i&1&&qe(0,UC,0,0,"ng-template",13),i&2){g(2);let e=en(1);x("ngTemplateOutlet",e)}}function qC(i,t){if(i&1&&(s(0,"div",9),w(1,$C,1,1,null,13),l()),i&2){let e=g();x("matFormFieldNotchedOutlineOpen",e._shouldLabelFloat()),m(),S(e._forceDisplayInfixLabel()?-1:1)}}function GC(i,t){i&1&&(s(0,"div",10,2),me(2,2),l())}function YC(i,t){i&1&&(s(0,"div",11,3),me(2,3),l())}function QC(i,t){}function XC(i,t){if(i&1&&qe(0,QC,0,0,"ng-template",13),i&2){g();let e=en(1);x("ngTemplateOutlet",e)}}function KC(i,t){i&1&&(s(0,"div",14,4),me(2,4),l())}function ZC(i,t){i&1&&(s(0,"div",15,5),me(2,5),l())}function JC(i,t){i&1&&I(0,"div",16)}function ex(i,t){i&1&&(s(0,"div",18),me(1,6),l())}function tx(i,t){if(i&1&&(s(0,"mat-hint",22),h(1),l()),i&2){let e=g(2);x("id",e._hintLabelId),m(),B(e.hintLabel)}}function nx(i,t){if(i&1&&(s(0,"div",19),w(1,tx,2,2,"mat-hint",22),me(2,7),I(3,"div",23),me(4,8),l()),i&2){let e=g();m(),S(e.hintLabel?1:-1)}}var Ht=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i,selectors:[["mat-label"]]})}return i})(),ix=new te("MatError");var gi=(()=>{class i{align="start";id=d(Re).getId("mat-mdc-hint-");static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(n,o){n&2&&(Jt("id",o.id),G("align",null),A("mat-mdc-form-field-hint-end",o.align==="end"))},inputs:{align:"align",id:"id"}})}return i})(),of=new te("MatPrefix"),yo=(()=>{class i{set _isTextSelector(e){this._isText=!0}_isText=!1;static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i,selectors:[["","matPrefix",""],["","matIconPrefix",""],["","matTextPrefix",""]],inputs:{_isTextSelector:[0,"matTextPrefix","_isTextSelector"]},features:[ge([{provide:of,useExisting:i}])]})}return i})(),ox=new te("MatSuffix");var rf=new te("FloatingLabelParent"),Kg=(()=>{class i{_elementRef=d(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=d(qg);_ngZone=d(ue);_parent=d(rf);_resizeSubscription=new On;constructor(){}ngOnDestroy(){this._resizeSubscription.unsubscribe()}getWidth(){return rx(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(n){return new(n||i)};static \u0275dir=ee({type:i,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(n,o){n&2&&A("mdc-floating-label--float-above",o.floating)},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return i})();function rx(i){let t=i;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 n=e.scrollWidth;return e.remove(),n}var Zg="mdc-line-ripple--active",jl="mdc-line-ripple--deactivating",Jg=(()=>{class i{_elementRef=d(ne);_cleanupTransitionEnd;constructor(){let e=d(ue),n=d(nt);e.runOutsideAngular(()=>{this._cleanupTransitionEnd=n.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd)})}activate(){let e=this._elementRef.nativeElement.classList;e.remove(jl),e.add(Zg)}deactivate(){this._elementRef.nativeElement.classList.add(jl)}_handleTransitionEnd=e=>{let n=this._elementRef.nativeElement.classList,o=n.contains(jl);e.propertyName==="opacity"&&o&&n.remove(Zg,jl)};ngOnDestroy(){this._cleanupTransitionEnd()}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return i})(),ef=(()=>{class i{_elementRef=d(ne);_ngZone=d(ue);open=!1;_notch;ngAfterViewInit(){let e=this._elementRef.nativeElement,n=e.querySelector(".mdc-floating-label");n?(e.classList.add("mdc-notched-outline--upgraded"),typeof requestAnimationFrame=="function"&&(n.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>n.style.transitionDuration="")}))):e.classList.add("mdc-notched-outline--no-label")}_setNotchWidth(e){let n=this._notch.nativeElement;!this.open||!e?n.style.width="":n.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(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(n,o){if(n&1&&ie(RC,5),n&2){let r;U(r=$())&&(o._notch=r.first)}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(n,o){n&2&&A("mdc-notched-outline--notched",o.open)},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},attrs:FC,ngContentSelectors:NC,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(n,o){n&1&&(Be(),Gi(0,"div",1),an(1,"div",2,0),me(3),sn(),Gi(4,"div",3))},encapsulation:2,changeDetection:0})}return i})(),wa=(()=>{class i{value;stateChanges;id;placeholder;ngControl;focused;empty;shouldLabelFloat;required;disabled;errorState;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;describedByIds;static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i})}return i})();var Sa=new te("MatFormField"),ax=new te("MAT_FORM_FIELD_DEFAULT_OPTIONS"),tf="fill",sx="auto",nf="fixed",lx="translateY(-50%)",Wt=(()=>{class i{_elementRef=d(ne);_changeDetectorRef=d(He);_platform=d(ct);_idGenerator=d(Re);_ngZone=d(ue);_defaults=d(ax,{optional:!0});_currentDirection;_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_iconPrefixContainerSignal=Vr("iconPrefixContainer");_textPrefixContainerSignal=Vr("textPrefixContainer");_iconSuffixContainerSignal=Vr("iconSuffixContainer");_textSuffixContainerSignal=Vr("textSuffixContainer");_prefixSuffixContainers=ft(()=>[this._iconPrefixContainerSignal(),this._textPrefixContainerSignal(),this._iconSuffixContainerSignal(),this._textSuffixContainerSignal()].map(e=>e?.nativeElement).filter(e=>e!==void 0));_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=th(Ht);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(e){this._hideRequiredMarker=tn(e)}_hideRequiredMarker=!1;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||sx}set floatLabel(e){e!==this._floatLabel&&(this._floatLabel=e,this._changeDetectorRef.markForCheck())}_floatLabel;get appearance(){return this._appearanceSignal()}set appearance(e){let n=e||this._defaults?.appearance||tf;this._appearanceSignal.set(n)}_appearanceSignal=Te(tf);get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||nf}set subscriptSizing(e){this._subscriptSizing=e||this._defaults?.subscriptSizing||nf}_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 F;_isFocused=null;_explicitFormFieldControl;_previousControl=null;_previousControlValidatorFn=null;_stateChanges;_valueChanges;_describedByChanges;_outlineLabelOffsetResizeObserver=null;_animationsDisabled=ot();constructor(){let e=this._defaults,n=d(Ot);e&&(e.appearance&&(this.appearance=e.appearance),this._hideRequiredMarker=!!e?.hideRequiredMarker,e.color&&(this.color=e.color)),Ro(()=>this._currentDirection=n.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=ft(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always")}_initializeControl(e){let n=this._control,o="mat-mdc-form-field-type-";e&&this._elementRef.nativeElement.classList.remove(o+e.controlType),n.controlType&&this._elementRef.nativeElement.classList.add(o+n.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=n.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck()}),this._describedByChanges?.unsubscribe(),this._describedByChanges=n.stateChanges.pipe(Ft([void 0,void 0]),be(()=>[n.errorState,n.userAriaDescribedBy]),Do(),he(([[r,a],[c,u]])=>r!==c||a!==u)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),n.ngControl&&n.ngControl.valueChanges&&(this._valueChanges=n.ngControl.valueChanges.pipe(z(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(),An(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(){nh({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=ft(()=>!!this._labelChild());_shouldLabelFloat(){return this._hasFloatingLabel()?this._control.shouldLabelFloat||this._shouldAlwaysFloat():!1}_shouldForward(e){let n=this._control?this._control.ngControl:null;return n&&n[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 n=this._control.describedByIds,o;if(n){let r=this._describedByIds||e;o=e.concat(n.filter(a=>a&&!r.includes(a)))}else o=e;this._control.setDescribedByIds(o),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,n=this._textPrefixContainer?.nativeElement,o=this._iconSuffixContainer?.nativeElement,r=this._textSuffixContainer?.nativeElement,a=e?.getBoundingClientRect().width??0,c=n?.getBoundingClientRect().width??0,u=o?.getBoundingClientRect().width??0,p=r?.getBoundingClientRect().width??0,b=this._currentDirection==="rtl"?"-1":"1",C=`${a+c}px`,P=`calc(${b} * (${C} + var(--mat-mdc-form-field-label-offset-x, 0px)))`,k=`var(--mat-mdc-form-field-label-transform, ${lx} translateX(${P}))`,j=a+c+u+p;return[k,j]}_writeOutlinedLabelStyles(e){if(e!==null){let[n,o]=e;this._floatingLabel&&(this._floatingLabel.element.style.transform=n),o!==null&&this._notchedOutline?._setMaxWidth(o)}}_isAttachedToDom(){let e=this._elementRef.nativeElement;if(e.getRootNode){let n=e.getRootNode();return n&&n!==e}return document.documentElement.contains(e)}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["mat-form-field"]],contentQueries:function(n,o,r){if(n&1&&(Km(r,o._labelChild,Ht,5),kt(r,wa,5),kt(r,of,5),kt(r,ox,5),kt(r,ix,5),kt(r,gi,5)),n&2){_c();let a;U(a=$())&&(o._formFieldControl=a.first),U(a=$())&&(o._prefixChildren=a),U(a=$())&&(o._suffixChildren=a),U(a=$())&&(o._errorChildren=a),U(a=$())&&(o._hintChildren=a)}},viewQuery:function(n,o){if(n&1&&(Fr(o._iconPrefixContainerSignal,Gg,5),Fr(o._textPrefixContainerSignal,Yg,5),Fr(o._iconSuffixContainerSignal,Qg,5),Fr(o._textSuffixContainerSignal,Xg,5),ie(VC,5),ie(Gg,5),ie(Yg,5),ie(Qg,5),ie(Xg,5),ie(Kg,5),ie(ef,5),ie(Jg,5)),n&2){_c(4);let r;U(r=$())&&(o._textField=r.first),U(r=$())&&(o._iconPrefixContainer=r.first),U(r=$())&&(o._textPrefixContainer=r.first),U(r=$())&&(o._iconSuffixContainer=r.first),U(r=$())&&(o._textSuffixContainer=r.first),U(r=$())&&(o._floatingLabel=r.first),U(r=$())&&(o._notchedOutline=r.first),U(r=$())&&(o._lineRipple=r.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:38,hostBindings:function(n,o){n&2&&A("mat-mdc-form-field-label-always-float",o._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",o._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",o._hasIconSuffix)("mat-form-field-invalid",o._control.errorState)("mat-form-field-disabled",o._control.disabled)("mat-form-field-autofilled",o._control.autofilled)("mat-form-field-appearance-fill",o.appearance=="fill")("mat-form-field-appearance-outline",o.appearance=="outline")("mat-form-field-hide-placeholder",o._hasFloatingLabel()&&!o._shouldLabelFloat())("mat-primary",o.color!=="accent"&&o.color!=="warn")("mat-accent",o.color==="accent")("mat-warn",o.color==="warn")("ng-untouched",o._shouldForward("untouched"))("ng-touched",o._shouldForward("touched"))("ng-pristine",o._shouldForward("pristine"))("ng-dirty",o._shouldForward("dirty"))("ng-valid",o._shouldForward("valid"))("ng-invalid",o._shouldForward("invalid"))("ng-pending",o._shouldForward("pending"))},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[ge([{provide:Sa,useExisting:i},{provide:rf,useExisting:i}])],ngContentSelectors:jC,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(n,o){if(n&1){let r=E();Be(LC),qe(0,HC,1,1,"ng-template",null,0,$a),s(2,"div",6,1),_("click",function(c){return v(r),y(o._control.onContainerClick(c))}),w(4,WC,1,0,"div",7),s(5,"div",8),w(6,qC,2,2,"div",9),w(7,GC,3,0,"div",10),w(8,YC,3,0,"div",11),s(9,"div",12),w(10,XC,1,1,null,13),me(11),l(),w(12,KC,3,0,"div",14),w(13,ZC,3,0,"div",15),l(),w(14,JC,1,0,"div",16),l(),s(15,"div",17),w(16,ex,2,0,"div",18)(17,nx,5,1,"div",19),l()}if(n&2){let r;m(2),A("mdc-text-field--filled",!o._hasOutline())("mdc-text-field--outlined",o._hasOutline())("mdc-text-field--no-label",!o._hasFloatingLabel())("mdc-text-field--disabled",o._control.disabled)("mdc-text-field--invalid",o._control.errorState),m(2),S(!o._hasOutline()&&!o._control.disabled?4:-1),m(2),S(o._hasOutline()?6:-1),m(),S(o._hasIconPrefix?7:-1),m(),S(o._hasTextPrefix?8:-1),m(2),S(!o._hasOutline()||o._forceDisplayInfixLabel()?10:-1),m(2),S(o._hasTextSuffix?12:-1),m(),S(o._hasIconSuffix?13:-1),m(),S(o._hasOutline()?-1:14),m(),A("mat-mdc-form-field-subscript-dynamic-size",o.subscriptSizing==="dynamic");let a=o._getSubscriptMessageType();m(),S((r=a)==="error"?16:r==="hint"?17:-1)}},dependencies:[Kg,ef,Ya,Jg,gi],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)}
|
|
369
|
+
`],encapsulation:2,changeDetection:0})}return i})();var zl=(()=>{class i{isErrorState(e,n){return!!(e&&e.invalid&&(e.touched||n&&n.submitted))}static \u0275fac=function(n){return new(n||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var wr=class{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(t,e,n,o,r){this._defaultMatcher=t,this.ngControl=e,this._parentFormGroup=n,this._parentForm=o,this._stateChanges=r}updateErrorState(){let t=this.errorState,e=this._parentFormGroup||this._parentForm,n=this.matcher||this._defaultMatcher,o=this.ngControl?this.ngControl.control:null,r=n?.isErrorState(o,e)??!1;r!==t&&(this.errorState=r,this._stateChanges.next())}};var pt=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({imports:[ce,ph,Wt,ce]})}return i})();var cx=["button","checkbox","file","hidden","image","radio","range","reset","submit"],dx=new te("MAT_INPUT_CONFIG"),pn=(()=>{class i{_elementRef=d(ne);_platform=d(ct);ngControl=d(Bn,{optional:!0,self:!0});_autofillMonitor=d(Wg);_ngZone=d(ue);_formField=d(Sa,{optional:!0});_renderer=d(nt);_uid=d(Re).getId("mat-input-");_previousNativeValue;_inputValueAccessor;_signalBasedValueAccessor;_previousPlaceholder;_errorStateTracker;_config=d(dx,{optional:!0});_cleanupIosKeyup;_cleanupWebkitWheel;_isServer;_isNativeSelect;_isTextarea;_isInFormField;focused=!1;stateChanges=new F;controlType="mat-input";autofilled=!1;get disabled(){return this._disabled}set disabled(e){this._disabled=tn(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(nr.required)??!1}set required(e){this._required=tn(e)}_required;get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&xc().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=tn(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=>xc().has(e));constructor(){let e=d(fa,{optional:!0}),n=d(ba,{optional:!0}),o=d(zl),r=d($g,{optional:!0,self:!0}),a=this._elementRef.nativeElement,c=a.nodeName.toLowerCase();r?Wa(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(o,this.ngControl,n,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&&Ro(()=>{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 n=this._elementRef.nativeElement;n.type==="number"?(n.type="text",n.setSelectionRange(0,0),n.type="number"):n.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 n=this._elementRef.nativeElement;this._previousPlaceholder=e,e?n.setAttribute("placeholder",e):n.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){cx.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,n=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&n&&n.label)}else return this.focused&&!this.disabled||!this.empty}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let n=this._elementRef.nativeElement;e.length?n.setAttribute("aria-describedby",e.join(" ")):n.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 n=e.target;!n.value&&n.selectionStart===0&&n.selectionEnd===0&&(n.setSelectionRange(1,1),n.setSelectionRange(0,0))};_getReadonlyAttribute(){return this._isNativeSelect?null:this.readonly||this.disabled&&this.disabledInteractive?"true":null}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:21,hostBindings:function(n,o){n&1&&_("focus",function(){return o._focusChanged(!0)})("blur",function(){return o._focusChanged(!1)})("input",function(){return o._onInput()}),n&2&&(Jt("id",o.id)("disabled",o.disabled&&!o.disabledInteractive)("required",o.required),G("name",o.name||null)("readonly",o._getReadonlyAttribute())("aria-disabled",o.disabled&&o.disabledInteractive?"true":null)("aria-invalid",o.empty&&o.required?null:o.errorState)("aria-required",o.required)("id",o.id),A("mat-input-server",o._isServer)("mat-mdc-form-field-textarea-control",o._isInFormField&&o._isTextarea)("mat-mdc-form-field-input-control",o._isInFormField)("mat-mdc-input-disabled-interactive",o.disabledInteractive)("mdc-text-field__input",o._isInFormField)("mat-mdc-native-select-inline",o._isInlineSelect()))},inputs:{disabled:"disabled",id:"id",placeholder:"placeholder",name:"name",required:"required",type:"type",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],value:"value",readonly:"readonly",disabledInteractive:[2,"disabledInteractive","disabledInteractive",K]},exportAs:["matInput"],features:[ge([{provide:wa,useExisting:i}]),Ve]})}return i})(),Kt=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({imports:[ce,pt,pt,Ug,ce]})}return i})();var Bl=class i{http=d(Ge);usernameSubject=new re(null);username$=this.usernameSubject.asObservable();fetchCurrentUser(){return this.http.get("/api/user/me").pipe(st(t=>{this.usernameSubject.next(t.username)}))}getUsername(){return this.usernameSubject.value}static \u0275fac=function(e){return new(e||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var mx=(i,t)=>t.label,hx=(i,t)=>t.id;function ux(i,t){i&1&&(s(0,"div",3),I(1,"span",4),s(2,"span",5),h(3,"Loading threads..."),l()())}function px(i,t){if(i&1&&(s(0,"div",18),h(1),l()),i&2){let e=g(6);m(),B(e.renameErrorMessage)}}function gx(i,t){if(i&1){let e=E();s(0,"div",11)(1,"input",17),L("ngModelChange",function(o){v(e);let r=g(5);return V(r.editingThreadName,o)||(r.editingThreadName=o),y(o)}),_("keydown",function(o){v(e);let r=g(5);return y(r.onEditKeydown(o))})("blur",function(){v(e);let o=g(5);return y(o.onEditBlur())})("click",function(o){return v(e),y(o.stopPropagation())}),l(),w(2,px,2,1,"div",18),l()}if(i&2){let e=g(5);m(),N("ngModel",e.editingThreadName),x("disabled",e.isRenamingThread),m(),S(e.renameErrorMessage?2:-1)}}function fx(i,t){if(i&1&&(s(0,"span",20),h(1),l()),i&2){let e=g(2).$implicit;m(),B(e.name)}}function _x(i,t){i&1&&(I(0,"mat-spinner",21),s(1,"span",22),h(2,"Generating name..."),l()),i&2&&x("diameter",16)}function bx(i,t){if(i&1){let e=E();s(0,"a",19),_("click",function(o){v(e);let r=g().$implicit;return g(4).selectThread(r.id),y(o.preventDefault())})("keydown.enter",function(o){v(e);let r=g().$implicit;return g(4).selectThread(r.id),y(o.preventDefault())})("keydown.space",function(o){v(e);let r=g().$implicit;return g(4).selectThread(r.id),y(o.preventDefault())}),w(1,fx,2,1,"span",20)(2,_x,3,1),l()}if(i&2){let e=g().$implicit;x("title",e.name||"Generating name..."),m(),S(e.name?1:2)}}function vx(i,t){if(i&1){let e=E();s(0,"button",23),_("click",function(o){v(e);let r=g().$implicit,a=g(4);return y(a.startEditingThreadName(o,r))}),s(1,"mat-icon"),h(2,"edit"),l()()}}function yx(i,t){if(i&1){let e=E();s(0,"div",10),w(1,gx,3,3,"div",11)(2,bx,3,2,"a",12),s(3,"div",13),w(4,vx,3,0,"button",14),s(5,"button",15),_("click",function(o){let r=v(e).$implicit,a=g(4);return y(a.toggleStar(o,r))}),s(6,"mat-icon"),h(7),l()(),s(8,"button",16),_("click",function(o){let r=v(e).$implicit,a=g(4);return y(a.deleteThread(o,r))}),s(9,"mat-icon"),h(10,"delete"),l()()()()}if(i&2){let e,n=t.$implicit,o=g(4);A("current",n.id===((e=o.currentThread())==null?null:e.id)),m(),S(o.editingThreadId===n.id?1:2),m(3),S(o.editingThreadId!==n.id&&n.name?4:-1),m(),A("starred",o.isStarred(n)),x("title",o.isStarred(n)?"Unstar thread":"Star thread"),m(2),B(o.isStarred(n)?"star":"star_outline")}}function Cx(i,t){if(i&1&&(s(0,"div",6)(1,"div",8),h(2),l(),Oe(3,yx,11,8,"div",9,hx),l()),i&2){let e=t.$implicit;m(2),B(e.label),m(),Ae(e.threads)}}function xx(i,t){i&1&&(s(0,"div",7),h(1,"No existing threads"),l())}function wx(i,t){if(i&1&&(s(0,"div",7),h(1),l()),i&2){let e=g(3);m(),oe('No threads matching "',e.searchQuery,'"')}}function Sx(i,t){if(i&1&&(Oe(0,Cx,5,1,"div",6,mx),w(2,xx,2,0,"div",7)(3,wx,2,1,"div",7)),i&2){let e,n=g(2);Ae(n.getGroupedThreads()),m(2),S(!((e=n.threads())!=null&&e.length)&&!n.searchQuery?2:n.searchQuery&&n.getGroupedThreads().length===0?3:-1)}}function kx(i,t){if(i&1&&(s(0,"div",1),w(1,ux,4,0,"div",3)(2,Sx,4,1),l()),i&2){let e=g();m(),S(e.isLoadingThreadList()?1:2)}}function Mx(i,t){i&1&&(s(0,"span",24),h(1,"No project selected"),l())}function Ex(i,t){i&1&&(s(0,"span",24),h(1,"Loading..."),l())}function Tx(i,t){if(i&1&&(s(0,"div",2),w(1,Mx,2,0,"span",24)(2,Ex,2,0,"span",24),l()),i&2){let e,n=g();m(),S((e=n.currentProject())!=null&&e.name?2:1)}}var Hl=class i{projects=null;searchMode=!1;searchQuery="";searchModeChange=new H;projectStateService=d(we);threadStateService=d(Dt);threadApiService=d(Li);userService=d(Bl);router=d(wi);currentThread=Vt(this.threadStateService.selectedThread$);currentProject=Vt(this.projectStateService.selectedProject$);threads=Vt(this.threadStateService.threadList$);isLoadingThreadList=Vt(this.threadStateService.isLoadingThreadList$);username=Vt(this.userService.username$);editingThreadId=null;editingThreadName="";isRenamingThread=!1;renameErrorMessage="";ngOnInit(){this.userService.fetchCurrentUser().subscribe({error:t=>{console.error("[THREAD-SELECTOR] Failed to load current user:",t)}})}selectThread(t){this.threadStateService.selectThread(t),this.router.navigate(["project",this.currentProject()?.name,"thread",t])}getGroupedThreads(){let t=this.threads();if(!t?.length)return[];if(this.searchQuery&&this.searchQuery.trim()){let p=this.searchQuery.toLowerCase().trim();t=t.filter(b=>b.name.toLowerCase().includes(p))}if(!t.length)return[];let e=this.username();if(!e)return[];let n=t.filter(p=>p.starring&&p.starring.includes(e)),o=t.filter(p=>!p.starring||!p.starring.includes(e)),r=new Map,a=new Date;a.setHours(0,0,0,0);for(let p of o){let b=new Date(p.modifiedDate);b.setHours(0,0,0,0);let C=a.getTime()-b.getTime(),T=Math.floor(C/(1e3*60*60*24)),P;T===0?P="Today":T===1?P="Yesterday":T<7?P="This Week":T<30?P="This Month":T<90?P="Last 3 Months":P="Older",r.has(P)||r.set(P,[]),r.get(P).push(p)}let c=[];if(n.length>0){let p=[...n].sort((b,C)=>b.modifiedDate>C.modifiedDate?-1:1);c.push({label:"Starred",threads:p})}return["Today","Yesterday","This Week","This Month","Last 3 Months","Older"].filter(p=>r.has(p)).forEach(p=>{c.push({label:p,threads:r.get(p)})}),c}isStarred(t){let e=this.username();return!!e&&t.starring&&t.starring.includes(e)}toggleStar(t,e){t.stopPropagation();let n=this.username();if(!n)return;(e.starring&&e.starring.includes(n)?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 n=this.currentProject()?.name;!n||!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",n])),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),o=new Date().getTime()-e.getTime(),r=Math.floor(o/(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 n=document.querySelector(".thread-name-input");n&&(n.focus(),n.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 n=this.editingThreadId;this.isRenamingThread=!0,this.renameErrorMessage="",this.threadStateService.renameThread(n,e).subscribe({next:()=>{console.log("[THREAD-SELECTOR] Thread renamed successfully"),this.cancelEditingThreadName(),this.isRenamingThread=!1},error:o=>{console.error("[THREAD-SELECTOR] Error renaming thread:",o),this.renameErrorMessage=o.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||i)};static \u0275cmp=M({type:i,selectors:[["app-thread-selector"]],inputs:{searchMode:"searchMode",searchQuery:"searchQuery"},outputs:{searchModeChange:"searchModeChange"},decls:3,vars:1,consts:[["tabindex","0","role","application","aria-label","Thread selector",1,"thread-selector",3,"click","keydown"],["role","menu","aria-label","Thread selection",1,"thread-list"],[1,"thread-disabled"],[1,"thread-loading"],[1,"loading-spinner"],[1,"loading-text"],[1,"thread-group"],[1,"thread-empty"],[1,"thread-group-header"],[1,"thread-item-wrapper",3,"current"],[1,"thread-item-wrapper"],[1,"thread-name-edit-wrapper"],["role","menuitem","tabindex","0",1,"thread-item",3,"title"],[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"],["role","menuitem","tabindex","0",1,"thread-item",3,"click","keydown.enter","keydown.space","title"],[1,"thread-name"],[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,n){if(e&1&&(s(0,"div",0),_("click",function(r){return r.stopPropagation()})("keydown",function(r){return r.stopPropagation()}),w(1,kx,3,1,"div",1)(2,Tx,3,1,"div",2),l()),e&2){let o;m(),S((o=n.currentProject())!=null&&o.name?1:2)}},dependencies:[De,Xe,je,Qe,Ud,We,Ye,xe,yt,vt,Kt,pt,xl,Cl],styles:[".thread-selector[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;min-height:0}.sidenav-thread-selector[_nghost-%COMP%] .thread-selector[_ngcontent-%COMP%], .sidenav-thread-selector [_nghost-%COMP%] .thread-selector[_ngcontent-%COMP%]{flex:1;min-height:0}.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}@media (max-width: 768px){.thread-item[_ngcontent-%COMP%]{padding:.6rem .8rem}.thread-name[_ngcontent-%COMP%]{font-size:.8rem}}"]})};function Px(i,t){if(i&1&&(s(0,"div",3),h(1),l()),i&2){let e=g();m(),oe("\u274C ",e.errorMessage)}}var ka=class i{dialogRef=d(nn);data=d(Vn);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||i)};static \u0275cmp=M({type:i,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,n){e&1&&(s(0,"div",0),h(1),s(2,"button",1),_("click",function(){return n.onCancel()}),s(3,"mat-icon"),h(4,"close"),l()()(),s(5,"mat-dialog-content")(6,"textarea",2),L("ngModelChange",function(r){return V(n.jsonContent,r)||(n.jsonContent=r),r}),l(),w(7,Px,2,1,"div",3),l(),s(8,"mat-dialog-actions",4)(9,"button",5),_("click",function(){return n.onCancel()}),h(10,"Cancel"),l(),s(11,"button",6),_("click",function(){return n.onSave()}),h(12,"Save"),l()()),e&2&&(m(),oe(" ",n.title," "),m(5),N("ngModel",n.jsonContent),m(),S(n.errorMessage?7:-1))},dependencies:[De,Xe,je,Qe,We,xe,vt,At,ai,si,li],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 Ox(i,t){if(i&1){let e=E();s(0,"div",9)(1,"mat-form-field",18)(2,"mat-label"),h(3),l(),s(4,"textarea",19),L("ngModelChange",function(o){let r=v(e).$index,a=g();return V(a.commands[r],o)||(a.commands[r]=o),y(o)}),l(),s(5,"mat-hint"),h(6,"Use placeholder for dynamic values"),l()(),s(7,"button",20),_("click",function(){let o=v(e).$index,r=g();return y(r.removeCommand(o))}),s(8,"mat-icon"),h(9,"delete"),l()()()}if(i&2){let e=t.$index,n=g();m(3),oe("Command ",e+1),m(),N("ngModel",n.commands[e]),m(3),x("disabled",n.commands.length===1)}}function Ax(i,t){if(i&1){let e=E();s(0,"div",10)(1,"h3"),h(2,"Save to"),l(),s(3,"div",21)(4,"label",22)(5,"input",23),L("ngModelChange",function(o){v(e);let r=g();return V(r.source,o)||(r.source=o),y(o)}),l(),s(6,"div",24)(7,"div",25)(8,"span",26),h(9,"\u{1F464}"),l(),s(10,"span",27),h(11,"Local"),l()(),s(12,"p",28),h(13,"Personal prompt in ~/.coday/... (not committed)"),l()()(),s(14,"label",22)(15,"input",29),L("ngModelChange",function(o){v(e);let r=g();return V(r.source,o)||(r.source=o),y(o)}),l(),s(16,"div",24)(17,"div",25)(18,"span",26),h(19,"\u{1F4E6}"),l(),s(20,"span",27),h(21,"Project"),l()(),s(22,"p",28),h(23,"Shared prompt in ./prompts/ (committable)"),l()()()(),s(24,"p",30),h(25,"Storage location is permanent and cannot be changed after creation"),l()()}if(i&2){let e=g();m(4),A("selected",e.source==="local"),m(),N("ngModel",e.source),m(9),A("selected",e.source==="project"),m(),N("ngModel",e.source)}}function Dx(i,t){if(i&1&&(s(0,"div",11)(1,"h3"),h(2,"Storage Location"),l(),s(3,"div",31)(4,"span",26),h(5),l(),s(6,"span",27),h(7),l()(),s(8,"p",30),h(9,"Cannot be changed after creation"),l()()),i&2){let e=g();m(3),A("badge-local",e.source==="local")("badge-project",e.source==="project"),m(2),B(e.source==="local"?"\u{1F464}":"\u{1F4E6}"),m(2),B(e.source==="local"?"Local":"Project")}}function Ix(i,t){if(i&1){let e=E();s(0,"div",12)(1,"label",32)(2,"input",33),L("ngModelChange",function(o){v(e);let r=g();return V(r.webhookEnabled,o)||(r.webhookEnabled=o),y(o)}),l(),s(3,"span"),h(4,"Enable webhook"),l()(),s(5,"p",30),h(6,"Enable webhook to trigger this prompt via HTTP POST"),l()()}if(i&2){let e=g();m(2),N("ngModel",e.webhookEnabled)}}function Rx(i,t){if(i&1){let e=E();s(0,"div",13)(1,"div",34)(2,"mat-icon",35),h(3,"link"),l(),s(4,"h4"),h(5,"Webhook URL"),l()(),s(6,"div",36)(7,"p",37),h(8),l(),s(9,"button",38),_("click",function(){v(e);let o=g();return y(o.copyWebhookUrl())}),s(10,"mat-icon"),h(11,"content_copy"),l(),s(12,"span"),h(13,"Copy URL"),l()()(),s(14,"p",30),h(15,"Use this URL to trigger the prompt via HTTP POST"),l()()}if(i&2){let e=g();m(8),B(e.getWebhookUrl())}}function Fx(i,t){if(i&1&&(s(0,"div",14)(1,"mat-icon"),h(2,"error"),l(),s(3,"span"),h(4),l()()),i&2){let e=g();m(4),B(e.errorMessage)}}var Ma=class i{promptApi=d(un);dialogRef=d(nn);configApi=d($n);snackBar=d(Xr);name="";description="";commands=[""];webhookEnabled=!1;threadLifetime="";source="local";isSaving=!1;errorMessage="";isAdmin=!1;isEditMode=!1;promptId="";data=d(Vn);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:n=>{console.error("Error updating prompt:",n),this.errorMessage=n?.error?.error||n?.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:n=>{console.error("Error creating prompt:",n),this.errorMessage=n?.error?.error||n?.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||i)};static \u0275cmp=M({type:i,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,n){e&1&&(s(0,"h2",0),h(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),h(6,"Name"),l(),s(7,"input",3),L("ngModelChange",function(r){return V(n.name,r)||(n.name=r),r}),_("blur",function(){return n.normalizeName()}),l(),s(8,"mat-hint"),h(9,"A descriptive name (spaces and punctuation will be replaced with hyphens)"),l()(),s(10,"mat-form-field",2)(11,"mat-label"),h(12,"Description"),l(),s(13,"textarea",4),L("ngModelChange",function(r){return V(n.description,r)||(n.description=r),r}),l(),s(14,"mat-hint"),h(15,"Explain the purpose of this prompt"),l()(),s(16,"div",5)(17,"div",6)(18,"h3"),h(19,"Commands"),l(),s(20,"button",7),_("click",function(){return n.addCommand()}),s(21,"mat-icon"),h(22,"add"),l()()(),s(23,"div",8),Oe(24,Ox,10,3,"div",9,qi),l()(),w(26,Ax,26,6,"div",10),w(27,Dx,10,6,"div",11),w(28,Ix,7,1,"div",12),w(29,Rx,16,1,"div",13),w(30,Fx,5,1,"div",14),l()(),s(31,"mat-dialog-actions",15)(32,"button",16),_("click",function(){return n.cancel()}),h(33,"Cancel"),l(),s(34,"button",17),_("click",function(){return n.save()}),h(35),l()()),e&2&&(m(),B(n.isEditMode?"Edit Prompt":"Create Prompt"),m(6),N("ngModel",n.name),m(6),N("ngModel",n.description),m(11),Ae(n.commands),m(2),S(n.isEditMode?-1:26),m(),S(n.isEditMode?27:-1),m(),S(n.isAdmin?28:-1),m(),S(n.isEditMode&&n.webhookEnabled&&n.isAdmin?29:-1),m(),S(n.errorMessage?30:-1),m(2),x("disabled",n.isSaving),m(2),x("disabled",n.isSaving),m(),oe(" ",n.isSaving?"Saving...":"Save"," "))},dependencies:[De,Xe,je,Fd,mo,Qe,ho,We,ro,ai,li,si,yt,At,vt,Kt,pn,Wt,Ht,gi,pt,Ye,xe,Qo],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 Nx(i,t){i&1&&(s(0,"div",12),h(1,"Loading prompts..."),l())}function Vx(i,t){if(i&1&&(s(0,"div",13),h(1),l()),i&2){let e=g();m(),B(e.errorMessage)}}function Lx(i,t){i&1&&(s(0,"div",14),h(1," No prompts found. Create your first prompt to get started. "),l())}function jx(i,t){i&1&&(s(0,"div",14),h(1," No prompts match your search. "),l())}function zx(i,t){if(i&1&&(s(0,"span",31),h(1),l()),i&2){let e=g().$implicit;x("title",Ci("Created by ",e.createdBy)),m(),oe(" \u{1F464} ",e.createdBy," ")}}function Bx(i,t){if(i&1){let e=E();s(0,"button",32),_("click",function(){v(e);let o=g().$implicit,r=g(2);return y(r.toggleWebhook(o))}),h(1),l()}if(i&2){let e=g().$implicit;A("btn-webhook-enabled",e.webhookEnabled)("btn-webhook-disabled",!e.webhookEnabled),m(),oe(" ",e.webhookEnabled?"Disable Webhook":"Enable Webhook"," ")}}function Hx(i,t){if(i&1){let e=E();s(0,"div",17)(1,"div",18)(2,"div",19)(3,"h3"),h(4),l(),s(5,"div",20)(6,"span",21),h(7),l(),qe(8,zx,2,3,"span",22),l()(),s(9,"p",23),h(10),l(),s(11,"div",24)(12,"span",25),h(13),l(),s(14,"span",26),h(15),l()()(),s(16,"div",27)(17,"button",28),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.editPrompt(o))}),h(18,"Edit"),l(),qe(19,Bx,2,5,"button",29),s(20,"button",30),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.deletePrompt(o.id))}),h(21,"Delete"),l()()()}if(i&2){let e=t.$implicit,n=g(2);m(4),B(e.name),m(2),A("badge-local",e.source==="local")("badge-project",e.source==="project"),x("title",e.source==="local"?"Local prompt (~/.coday/)":"Project prompt (./prompts/)"),m(),oe(" ",e.source==="local"?"\u{1F464}":"\u{1F4E6}"," "),m(),x("ngIf",e.createdBy!==n.getCurrentUsername()),m(2),B(e.description),m(3),oe("ID: ",e.id),m(),A("enabled",e.webhookEnabled),m(),oe(" Webhook: ",e.webhookEnabled?"Enabled":"Disabled"," "),m(4),x("ngIf",n.isAdmin)}}function Wx(i,t){if(i&1&&(s(0,"div",15),qe(1,Hx,22,14,"div",16),l()),i&2){let e=g();m(),x("ngForOf",e.filteredPrompts)}}var Wl=class i{promptApi=d(un);dialog=d(Cn);configApi=d($n);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 n=e?.error?.error??e?.message??"Failed to delete prompt";alert(`Failed to delete prompt: ${n}`)}})}toggleWebhook(t){(t.webhookEnabled?this.promptApi.disableWebhook(t.id):this.promptApi.enableWebhook(t.id)).subscribe({next:()=>{this.loadPrompts()},error:n=>{console.error("Error toggling webhook:",n);let o=n?.error?.error??n?.message??"Failed to toggle webhook";alert(`Failed to toggle webhook: ${o}`)}})}createPrompt(){this.dialog.open(Ma,{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(n=>this.isMyPrompt(n)):[...this.prompts];t&&(e=e.filter(n=>n.name.toLowerCase().includes(t)||n.description.toLowerCase().includes(t)?!0:n.createdBy.toLowerCase().includes(t))),this.filteredPrompts=e}onSearchChange(){this.applyFilter()}editPrompt(t){this.promptApi.getPrompt(t.id).subscribe({next:e=>{this.dialog.open(Ma,{width:"700px",maxHeight:"90vh",data:{mode:"edit",prompt:e}}).afterClosed().subscribe(o=>{o&&this.loadPrompts()})},error:e=>{console.error("Error loading prompt details:",e);let n=e?.error?.error??e?.message??"Failed to load prompt details";alert(`Failed to load prompt details: ${n}`)}})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,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,n){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),h(3,"Prompts"),l(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),h(7,"Search"),l(),s(8,"input",4),L("ngModelChange",function(r){return V(n.searchQuery,r)||(n.searchQuery=r),r}),_("input",function(){return n.onSearchChange()}),l(),s(9,"mat-icon",5),h(10,"search"),l()(),s(11,"mat-slide-toggle",6),L("ngModelChange",function(r){return V(n.showOnlyMine,r)||(n.showOnlyMine=r),r}),_("change",function(){return n.applyFilter()}),h(12," Mine "),l(),s(13,"button",7),_("click",function(){return n.createPrompt()}),s(14,"mat-icon"),h(15,"add"),l(),s(16,"span"),h(17,"Create Prompt"),l()()()(),qe(18,Nx,2,0,"div",8)(19,Vx,2,1,"div",9)(20,Lx,2,0,"div",10)(21,jx,2,0,"div",10)(22,Wx,2,1,"div",11),l()),e&2&&(m(8),N("ngModel",n.searchQuery),m(3),N("ngModel",n.showOnlyMine),m(7),x("ngIf",n.isLoading),m(),x("ngIf",n.errorMessage),m(),x("ngIf",!n.isLoading&&n.prompts.length===0),m(),x("ngIf",!n.isLoading&&n.prompts.length>0&&n.filteredPrompts.length===0),m(),x("ngIf",!n.isLoading&&n.filteredPrompts.length>0))},dependencies:[De,qa,Ga,Xe,je,Qe,We,Ye,xe,Kt,pn,Wt,Ht,yo,pt,Ll,vo],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 i{http=d(Ge);projectState=d(we);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||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ul=(()=>{class i{_animationsDisabled=ot();state="unchecked";disabled=!1;appearance="full";constructor(){}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:12,hostBindings:function(n,o){n&2&&A("mat-pseudo-checkbox-indeterminate",o.state==="indeterminate")("mat-pseudo-checkbox-checked",o.state==="checked")("mat-pseudo-checkbox-disabled",o.disabled)("mat-pseudo-checkbox-minimal",o.appearance==="minimal")("mat-pseudo-checkbox-full",o.appearance==="full")("_mat-animation-noopable",o._animationsDisabled)},inputs:{state:"state",disabled:"disabled",appearance:"appearance"},decls:0,vars:0,template:function(n,o){},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}
|
|
370
|
+
`],encapsulation:2,changeDetection:0})}return i})();var Ux=["text"],$x=[[["mat-icon"]],"*"],qx=["mat-icon","*"];function Gx(i,t){if(i&1&&I(0,"mat-pseudo-checkbox",1),i&2){let e=g();x("disabled",e.disabled)("state",e.selected?"checked":"unchecked")}}function Yx(i,t){if(i&1&&I(0,"mat-pseudo-checkbox",3),i&2){let e=g();x("disabled",e.disabled)}}function Qx(i,t){if(i&1&&(s(0,"span",4),h(1),l()),i&2){let e=g();m(),oe("(",e.group.label,")")}}var im=new te("MAT_OPTION_PARENT_COMPONENT"),om=new te("MatOptgroup");var nm=class{source;isUserInput;constructor(t,e=!1){this.source=t,this.isUserInput=e}},Co=(()=>{class i{_element=d(ne);_changeDetectorRef=d(He);_parent=d(im,{optional:!0});group=d(om,{optional:!0});_signalDisableRipple=!1;_selected=!1;_active=!1;_mostRecentViewValue="";get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}value;id=d(Re).getId("mat-option-");get disabled(){return this.group&&this.group.disabled||this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=Te(!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 F;constructor(){let e=d(Nt);e.load(Ei),e.load(Za),this._signalDisableRipple=!!this._parent&&Wa(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,n){let o=this._getHostElement();typeof o.focus=="function"&&o.focus(n)}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)&&!Pt(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 nm(this,e))}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["mat-option"]],viewQuery:function(n,o){if(n&1&&ie(Ux,7),n&2){let r;U(r=$())&&(o._text=r.first)}},hostAttrs:["role","option",1,"mat-mdc-option","mdc-list-item"],hostVars:11,hostBindings:function(n,o){n&1&&_("click",function(){return o._selectViaInteraction()})("keydown",function(a){return o._handleKeydown(a)}),n&2&&(Jt("id",o.id),G("aria-selected",o.selected)("aria-disabled",o.disabled.toString()),A("mdc-list-item--selected",o.selected)("mat-mdc-option-multiple",o.multiple)("mat-mdc-option-active",o.active)("mdc-list-item--disabled",o.disabled))},inputs:{value:"value",id:"id",disabled:[2,"disabled","disabled",K]},outputs:{onSelectionChange:"onSelectionChange"},exportAs:["matOption"],ngContentSelectors:qx,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(n,o){n&1&&(Be($x),w(0,Gx,1,2,"mat-pseudo-checkbox",1),me(1),s(2,"span",2,0),me(4,1),l(),w(5,Yx,1,1,"mat-pseudo-checkbox",3),w(6,Qx,2,1,"span",4),I(7,"div",5)),n&2&&(S(o.multiple?0:-1),m(5),S(!o.multiple&&o.selected&&!o.hideSingleSelectionIndicator?5:-1),m(),S(o.group&&o.group._inert?6:-1),m(),x("matRippleTrigger",o._getHostElement())("matRippleDisabled",o.disabled||o.disableRipple))},dependencies:[Ul,Mi],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:""}
|
|
371
|
+
`],encapsulation:2,changeDetection:0})}return i})();function af(i,t,e){if(e.length){let n=t.toArray(),o=e.toArray(),r=0;for(let a=0;a<i+1;a++)n[a].group&&n[a].group===o[r]&&r++;return r}return 0}function sf(i,t,e,n){return i<e?i:i+t>e+n?Math.max(0,i-n+t):e}var xo=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 F;constructor(t=!1,e,n=!0,o){this._multiple=t,this._emitChanges=n,this.compareWith=o,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(n=>this._markSelected(n));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}deselect(...t){this._verifyValueAssignment(t),t.forEach(n=>this._unmarkSelected(n));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}setSelection(...t){this._verifyValueAssignment(t);let e=this.selected,n=new Set(t.map(r=>this._getConcreteValue(r)));t.forEach(r=>this._markSelected(r)),e.filter(r=>!n.has(this._getConcreteValue(r,n))).forEach(r=>this._unmarkSelected(r));let o=this._hasQueuedChanges();return this._emitChangeEvent(),o}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 n of e)if(this.compareWith(t,n))return n;return t}else return t}};var lf=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({imports:[ce]})}return i})();var rm=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({imports:[is,ce,lf,Co]})}return i})();var Kx=["trigger"],Zx=["panel"],Jx=[[["mat-select-trigger"]],"*"],ew=["mat-select-trigger","*"];function tw(i,t){if(i&1&&(s(0,"span",4),h(1),l()),i&2){let e=g();m(),B(e.placeholder)}}function nw(i,t){i&1&&me(0)}function iw(i,t){if(i&1&&(s(0,"span",11),h(1),l()),i&2){let e=g(2);m(),B(e.triggerValue)}}function ow(i,t){if(i&1&&(s(0,"span",5),w(1,nw,1,0)(2,iw,2,1,"span",11),l()),i&2){let e=g();m(),S(e.customTrigger?1:2)}}function rw(i,t){if(i&1){let e=E();s(0,"div",12,1),_("keydown",function(o){v(e);let r=g();return y(r._handleKeydown(o))}),me(2,1),l()}if(i&2){let e=g();Zn(Ci("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",e._getPanelTheme())),A("mat-select-panel-animations-enabled",!e._animationsDisabled),x("ngClass",e.panelClass),G("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var lm=new te("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let i=d(ve);return()=>io(i)}});function cf(i){let t=d(ve);return()=>io(t)}var df=new te("MAT_SELECT_CONFIG"),mf={provide:lm,deps:[],useFactory:cf},hf=new te("MatSelectTrigger"),Gl=class{source;value;constructor(t,e){this.source=t,this.value=e}},cm=(()=>{class i{_viewportRuler=d(ii);_changeDetectorRef=d(He);_elementRef=d(ne);_dir=d(Ot,{optional:!0});_idGenerator=d(Re);_renderer=d(nt);_parentFormField=d(Sa,{optional:!0});ngControl=d(Bn,{self:!0,optional:!0});_liveAnnouncer=d(es);_defaultOptions=d(df,{optional:!0});_animationsDisabled=ot();_initialized=new F;_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 n=this.options.toArray()[e];if(n){let o=this.panel.nativeElement,r=af(e,this.options,this.optionGroups),a=n._getHostElement();e===0&&r===1?o.scrollTop=0:o.scrollTop=sf(a.offsetTop,a.offsetHeight,o.scrollTop,o.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new Gl(this,e)}_scrollStrategyFactory=d(lm);_panelOpen=!1;_compareWith=(e,n)=>e===n;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new F;_errorStateTracker;stateChanges=new F;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=Te(!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(nr.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(Ft(e),Dn(()=>An(...e.map(n=>n.onSelectionChange)))):this._initialized.pipe(Dn(()=>this.optionSelectionChanges))});openedChange=new H;_openedStream=this.openedChange.pipe(he(e=>e),be(()=>{}));_closedStream=this.openedChange.pipe(he(e=>!e),be(()=>{}));selectionChange=new H;valueChange=new H;constructor(){let e=d(zl),n=d(fa,{optional:!0}),o=d(ba,{optional:!0}),r=d(new xi("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,o,n,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=r==null?0:parseInt(r)||0,this.id=this.id}ngOnInit(){this._selectionModel=new xo(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(z(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(z(this._destroy)).subscribe(e=>{e.added.forEach(n=>n.select()),e.removed.forEach(n=>n.deselect())}),this.options.changes.pipe(Ft(null),z(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),n=this.ngControl;if(e!==this._triggerAriaLabelledBy){let o=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?o.setAttribute("aria-labelledby",e):o.removeAttribute("aria-labelledby")}n&&(this._previousControl!==n.control&&(this._previousControl!==void 0&&n.disabled!==null&&n.disabled!==this.disabled&&(this.disabled=n.disabled),this._previousControl=n.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(St(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 n=`${this.id}-panel`;this._trackedModal&&yc(this._trackedModal,"aria-owns",n),fh(e,"aria-owns",n),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;yc(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=()=>{n(),clearTimeout(o),this._cleanupDetach=void 0};let e=this.panel.nativeElement,n=this._renderer.listen(e,"animationend",r=>{r.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),o=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(n=>n.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 n=e.keyCode,o=n===40||n===38||n===37||n===39,r=n===13||n===32,a=this._keyManager;if(!a.isTyping()&&r&&!Pt(e)||(this.multiple||e.altKey)&&o)e.preventDefault(),this.open();else if(!this.multiple){let c=this.selected;a.onKeydown(e);let u=this.selected;u&&c!==u&&this._liveAnnouncer.announce(u.viewValue,1e4)}}_handleOpenKeydown(e){let n=this._keyManager,o=e.keyCode,r=o===40||o===38,a=n.isTyping();if(r&&e.altKey)e.preventDefault(),this.close();else if(!a&&(o===13||o===32)&&n.activeItem&&!Pt(e))e.preventDefault(),n.activeItem._selectViaInteraction();else if(!a&&this._multiple&&o===65&&e.ctrlKey){e.preventDefault();let c=this.options.some(u=>!u.disabled&&!u.selected);this.options.forEach(u=>{u.disabled||(c?u.select():u.deselect())})}else{let c=n.activeItemIndex;n.onKeydown(e),this._multiple&&r&&e.shiftKey&&n.activeItem&&n.activeItemIndex!==c&&n.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!Pt(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(n=>n.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(n=>this._selectOptionByValue(n)),this._sortValues();else{let n=this._selectOptionByValue(e);n?this._keyManager.updateActiveItem(n):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let n=this.options.find(o=>{if(this._selectionModel.isSelected(o))return!1;try{return(o.value!=null||this.canSelectNullableOptions)&&this._compareWith(o.value,e)}catch{return!1}});return n&&this._selectionModel.select(n),n}_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 qo?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 gh(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=An(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(z(e)).subscribe(n=>{this._onSelect(n.source,n.isUserInput),n.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),An(...this.options.map(n=>n._stateChanges)).pipe(z(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,n){let o=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(o!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),n&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),n&&this.focus())),o!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((n,o)=>this.sortComparator?this.sortComparator(n,o,e):e.indexOf(n)-e.indexOf(o)),this.stateChanges.next()}}_propagateChanges(e){let n;this.multiple?n=this.selected.map(o=>o.value):n=this.selected?this.selected.value:e,this._value=n,this.valueChange.emit(n),this._onChange(n),this.selectionChange.emit(this._getChangeEvent(n)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let n=0;n<this.options.length;n++)if(!this.options.get(n).disabled){e=n;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,n=e?e+" ":"";return this.ariaLabelledby?n+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(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["mat-select"]],contentQueries:function(n,o,r){if(n&1&&(kt(r,hf,5),kt(r,Co,5),kt(r,om,5)),n&2){let a;U(a=$())&&(o.customTrigger=a.first),U(a=$())&&(o.options=a),U(a=$())&&(o.optionGroups=a)}},viewQuery:function(n,o){if(n&1&&(ie(Kx,5),ie(Zx,5),ie(Fs,5)),n&2){let r;U(r=$())&&(o.trigger=r.first),U(r=$())&&(o.panel=r.first),U(r=$())&&(o._overlayDir=r.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(n,o){n&1&&_("keydown",function(a){return o._handleKeydown(a)})("focus",function(){return o._onFocus()})("blur",function(){return o._onBlur()}),n&2&&(G("id",o.id)("tabindex",o.disabled?-1:o.tabIndex)("aria-controls",o.panelOpen?o.id+"-panel":null)("aria-expanded",o.panelOpen)("aria-label",o.ariaLabel||null)("aria-required",o.required.toString())("aria-disabled",o.disabled.toString())("aria-invalid",o.errorState)("aria-activedescendant",o._getAriaActiveDescendant()),A("mat-mdc-select-disabled",o.disabled)("mat-mdc-select-invalid",o.errorState)("mat-mdc-select-required",o.required)("mat-mdc-select-empty",o.empty)("mat-mdc-select-multiple",o.multiple)("mat-select-open",o.panelOpen))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",K],disableRipple:[2,"disableRipple","disableRipple",K],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:bn(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",K],placeholder:"placeholder",required:[2,"required","required",K],multiple:[2,"multiple","multiple",K],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",K],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",bn],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",K]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[ge([{provide:wa,useExisting:i},{provide:im,useExisting:i}]),Ve],ngContentSelectors:ew,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(n,o){if(n&1){let r=E();Be(Jx),s(0,"div",2,0),_("click",function(){return v(r),y(o.open())}),s(3,"div",3),w(4,tw,2,1,"span",4)(5,ow,3,1,"span",5),l(),s(6,"div",6)(7,"div",7),Kn(),s(8,"svg",8),I(9,"path",9),l()()()(),qe(10,rw,3,10,"ng-template",10),_("detach",function(){return v(r),y(o.close())})("backdropClick",function(){return v(r),y(o.close())})("overlayKeydown",function(c){return v(r),y(o._handleOverlayKeydown(c))})}if(n&2){let r=en(1);m(3),G("id",o._valueId),m(),S(o.empty?4:5),m(6),x("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",o._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",o._scrollStrategy)("cdkConnectedOverlayOrigin",o._preferredOverlayOrigin||r)("cdkConnectedOverlayPositions",o._positions)("cdkConnectedOverlayWidth",o._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)}},dependencies:[qo,Fs,Fo],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))}
|
|
372
|
+
`],encapsulation:2,changeDetection:0})}return i})();var Ea=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({providers:[mf],imports:[ri,rm,ce,eo,pt,rm,ce]})}return i})();var sw=["input"],lw=["label"],cw=["*"],dw=new te("mat-checkbox-default-options",{providedIn:"root",factory:pf});function pf(){return{color:"accent",clickAction:"check-indeterminate",disabledInteractive:!1}}var It=(function(i){return i[i.Init=0]="Init",i[i.Checked=1]="Checked",i[i.Unchecked=2]="Unchecked",i[i.Indeterminate=3]="Indeterminate",i})(It||{}),dm=class{source;checked},uf=pf(),mm=(()=>{class i{_elementRef=d(ne);_changeDetectorRef=d(He);_ngZone=d(ue);_animationsDisabled=ot();_options=d(dw,{optional:!0});focus(){this._inputElement.nativeElement.focus()}_createChangeEvent(e){let n=new dm;return n.source=this,n.checked=e,n}_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(){d(Nt).load(Ei);let e=d(new xi("tabindex"),{optional:!0});this._options=this._options||uf,this.color=this._options.color||uf.color,this.tabIndex=e==null?0:parseInt(e)||0,this.id=this._uniqueId=d(Re).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 n=e!=this._indeterminate();this._indeterminate.set(e),n&&(e?this._transitionCheckState(It.Indeterminate):this._transitionCheckState(this.checked?It.Checked:It.Unchecked),this.indeterminateChange.emit(e)),this._syncIndeterminate(e)}_indeterminate=Te(!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 n=this._currentCheckState,o=this._getAnimationTargetElement();if(!(n===e||!o)&&(this._currentAnimationClass&&o.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(n,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){o.classList.add(this._currentAnimationClass);let r=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{o.classList.remove(r)},1e3)})}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.checked),this.change.emit(this._createChangeEvent(this.checked)),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked,this._controlValueAccessorChangeFn(this.checked)}_handleInputClick(){let e=this._options?.clickAction;!this.disabled&&e!=="noop"?(this.indeterminate&&e!=="check"&&Promise.resolve().then(()=>{this._indeterminate.set(!1),this.indeterminateChange.emit(!1)}),this._checked=!this._checked,this._transitionCheckState(this._checked?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,n){if(this._animationsDisabled)return"";switch(e){case It.Init:if(n===It.Checked)return this._animationClasses.uncheckedToChecked;if(n==It.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case It.Unchecked:return n===It.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case It.Checked:return n===It.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case It.Indeterminate:return n===It.Checked?this._animationClasses.indeterminateToChecked:this._animationClasses.indeterminateToUnchecked}return""}_syncIndeterminate(e){let n=this._inputElement;n&&(n.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(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["mat-checkbox"]],viewQuery:function(n,o){if(n&1&&(ie(sw,5),ie(lw,5)),n&2){let r;U(r=$())&&(o._inputElement=r.first),U(r=$())&&(o._labelElement=r.first)}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(n,o){n&2&&(Jt("id",o.id),G("tabindex",null)("aria-label",null)("aria-labelledby",null),Zn(o.color?"mat-"+o.color:"mat-accent"),A("_mat-animation-noopable",o._animationsDisabled)("mdc-checkbox--disabled",o.disabled)("mat-mdc-checkbox-disabled",o.disabled)("mat-mdc-checkbox-checked",o.checked)("mat-mdc-checkbox-disabled-interactive",o.disabledInteractive))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",K],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",K],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",K],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?void 0:bn(e)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",K],checked:[2,"checked","checked",K],disabled:[2,"disabled","disabled",K],indeterminate:[2,"indeterminate","indeterminate",K]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[ge([{provide:Xt,useExisting:it(()=>i),multi:!0},{provide:Mn,useExisting:i,multi:!0}]),Ve],ngContentSelectors:cw,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(n,o){if(n&1){let r=E();Be(),s(0,"div",3),_("click",function(c){return v(r),y(o._preventBubblingFromLabel(c))}),s(1,"div",4,0)(3,"div",5),_("click",function(){return v(r),y(o._onTouchTargetClick())}),l(),s(4,"input",6,1),_("blur",function(){return v(r),y(o._onBlur())})("click",function(){return v(r),y(o._onInputClick())})("change",function(c){return v(r),y(o._onInteractionEvent(c))}),l(),I(6,"div",7),s(7,"div",8),Kn(),s(8,"svg",9),I(9,"path",10),l(),Ha(),I(10,"div",11),l(),I(11,"div",12),l(),s(12,"label",13,2),me(14),l()()}if(n&2){let r=en(2);x("labelPosition",o.labelPosition),m(4),A("mdc-checkbox--selected",o.checked),x("checked",o.checked)("indeterminate",o.indeterminate)("disabled",o.disabled&&!o.disabledInteractive)("id",o.inputId)("required",o.required)("tabIndex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex),G("aria-label",o.ariaLabel||null)("aria-labelledby",o.ariaLabelledby)("aria-describedby",o.ariaDescribedby)("aria-checked",o.indeterminate?"mixed":null)("aria-controls",o.ariaControls)("aria-disabled",o.disabled&&o.disabledInteractive?!0:null)("aria-expanded",o.ariaExpanded)("aria-owns",o.ariaOwns)("name",o.name)("value",o.value),m(7),x("matRippleTrigger",r)("matRippleDisabled",o.disableRipple||o.disabled)("matRippleCentered",!0),m(),x("for",o.inputId)}},dependencies:[Mi,Nl],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:""}
|
|
373
|
+
`],encapsulation:2,changeDetection:0})}return i})(),gf=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({imports:[mm,ce,ce]})}return i})();var hw=["button"],uw=["*"];function pw(i,t){if(i&1&&(s(0,"div",2),I(1,"mat-pseudo-checkbox",6),l()),i&2){let e=g();m(),x("disabled",e.disabled)}}var ff=new te("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:gw});function gw(){return{hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1}}var _f=new te("MatButtonToggleGroup"),fw={provide:Xt,useExisting:it(()=>hm),multi:!0},Yl=class{source;value;constructor(t,e){this.source=t,this.value=e}},hm=(()=>{class i{_changeDetector=d(He);_dir=d(Ot,{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=d(Re).getId("mat-button-toggle-group-");vertical;get value(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e.map(n=>n.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=d(ff,{optional:!0});this.appearance=e&&e.appearance?e.appearance:"standard",this.hideSingleSelectionIndicator=e?.hideSingleSelectionIndicator??!1,this.hideMultipleSelectionIndicator=e?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new xo(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||Pt(e))return;let o=e.target.id,r=this._buttonToggles.toArray().findIndex(c=>c.buttonId===o),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 n=new Yl(e,this.value);this._rawValue=n.value,this._controlValueAccessorChangeFn(n.value),this.change.emit(n)}_syncButtonToggle(e,n,o=!1,r=!1){!this.multiple&&this.selected&&!e.checked&&(this.selected.checked=!1),this._selectionModel?n?this._selectionModel.select(e):this._selectionModel.deselect(e):r=!0,r?Promise.resolve().then(()=>this._updateModelValue(e,o)):this._updateModelValue(e,o)}_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(n=>e.value!=null&&n===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 n=this._buttonToggles.get(e);if(!n.disabled){n.tabIndex=0;break}}}_getNextButton(e,n){let o=this._buttonToggles;for(let r=1;r<=o.length;r++){let a=(e+n*r+o.length)%o.length,c=o.get(a);if(c&&!c.disabled)return c}return null}_setSelectionByValue(e){if(this._rawValue=e,!this._buttonToggles)return;let n=this._buttonToggles.toArray();if(this.multiple&&e?(Array.isArray(e),this._clearSelection(),e.forEach(o=>this._selectValue(o,n))):(this._clearSelection(),this._selectValue(e,n)),!this.multiple&&n.every(o=>o.tabIndex===-1)){for(let o of n)if(!o.disabled){o.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(e=>{e.checked=!1,this.multiple||(e.tabIndex=-1)})}_selectValue(e,n){for(let o of n)if(o.value===e){o.checked=!0,this._selectionModel.select(o),this.multiple||(o.tabIndex=0);break}}_updateModelValue(e,n){n&&this._emitChangeEvent(e),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(e=>e._markForCheck())}static \u0275fac=function(n){return new(n||i)};static \u0275dir=ee({type:i,selectors:[["mat-button-toggle-group"]],contentQueries:function(n,o,r){if(n&1&&kt(r,Ql,5),n&2){let a;U(a=$())&&(o._buttonToggles=a)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(n,o){n&1&&_("keydown",function(a){return o._keydown(a)}),n&2&&(G("role",o.multiple?"group":"radiogroup")("aria-disabled",o.disabled),A("mat-button-toggle-vertical",o.vertical)("mat-button-toggle-group-appearance-standard",o.appearance==="standard"))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",K],value:"value",multiple:[2,"multiple","multiple",K],disabled:[2,"disabled","disabled",K],disabledInteractive:[2,"disabledInteractive","disabledInteractive",K],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",K],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",K]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[ge([fw,{provide:_f,useExisting:i}])]})}return i})(),Ql=(()=>{class i{_changeDetectorRef=d(He);_elementRef=d(ne);_focusMonitor=d(ki);_idGenerator=d(Re);_animationDisabled=ot();_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(){d(Nt).load(Ei);let e=d(_f,{optional:!0}),n=d(new xi("tabindex"),{optional:!0})||"",o=d(ff,{optional:!0});this._tabIndex=Te(parseInt(n)||0),this.buttonToggleGroup=e,this.appearance=o&&o.appearance?o.appearance:"standard",this.disabledInteractive=o?.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 n=this.buttonToggleGroup._buttonToggles.find(o=>o.tabIndex===0);n&&(n.tabIndex=-1),this.tabIndex=0}this.change.emit(new Yl(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(n){return new(n||i)};static \u0275cmp=M({type:i,selectors:[["mat-button-toggle"]],viewQuery:function(n,o){if(n&1&&ie(hw,5),n&2){let r;U(r=$())&&(o._buttonElement=r.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(n,o){n&1&&_("focus",function(){return o.focus()}),n&2&&(G("aria-label",null)("aria-labelledby",null)("id",o.id)("name",null),A("mat-button-toggle-standalone",!o.buttonToggleGroup)("mat-button-toggle-checked",o.checked)("mat-button-toggle-disabled",o.disabled)("mat-button-toggle-disabled-interactive",o.disabledInteractive)("mat-button-toggle-appearance-standard",o.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",K],appearance:"appearance",checked:[2,"checked","checked",K],disabled:[2,"disabled","disabled",K],disabledInteractive:[2,"disabledInteractive","disabledInteractive",K]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:uw,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(n,o){if(n&1){let r=E();Be(),s(0,"button",1,0),_("click",function(){return v(r),y(o._onButtonClick())}),w(2,pw,2,1,"div",2),s(3,"span",3),me(4),l()(),I(5,"span",4)(6,"span",5)}if(n&2){let r=en(1);x("id",o.buttonId)("disabled",o.disabled&&!o.disabledInteractive||null),G("role",o.isSingleSelector()?"radio":"button")("tabindex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("aria-pressed",o.isSingleSelector()?null:o.checked)("aria-checked",o.isSingleSelector()?o.checked:null)("name",o._getButtonName())("aria-label",o.ariaLabel)("aria-labelledby",o.ariaLabelledby)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null),m(2),S(o.buttonToggleGroup&&(!o.buttonToggleGroup.multiple&&!o.buttonToggleGroup.hideSingleSelectionIndicator||o.buttonToggleGroup.multiple&&!o.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),m(4),x("matRippleTrigger",r)("matRippleDisabled",o.disableRipple||o.disabled)}},dependencies:[Mi,Ul],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))}
|
|
374
|
+
`],encapsulation:2,changeDetection:0})}return i})(),bf=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=se({type:i});static \u0275inj=ae({imports:[ce,is,Ql,ce]})}return i})();var bw=(i,t)=>t.id,vw=(i,t)=>t.value;function yw(i,t){if(i&1&&(s(0,"mat-option",5),h(1),l()),i&2){let e=t.$implicit;x("value",e.id),m(),oe(" ",e.name," ")}}function Cw(i,t){if(i&1){let e=E();s(0,"mat-checkbox",35),_("change",function(){let o=v(e).$implicit,r=g();return y(r.toggleDayOfWeek(o.value))}),h(1),l()}if(i&2){let e=t.$implicit,n=g();x("checked",n.isDaySelected(e.value)),m(),oe(" ",e.label," ")}}function xw(i,t){if(i&1){let e=E();s(0,"mat-form-field",2)(1,"mat-label"),h(2,"Number of Occurrences"),l(),s(3,"input",10),L("ngModelChange",function(o){v(e);let r=g();return V(r.endOccurrences,o)||(r.endOccurrences=o),y(o)}),l()()}if(i&2){let e=g();m(3),N("ngModel",e.endOccurrences)}}function ww(i,t){if(i&1){let e=E();s(0,"mat-form-field",2)(1,"mat-label"),h(2,"End Date"),l(),s(3,"input",36),L("ngModelChange",function(o){v(e);let r=g();return V(r.endTimestamp,o)||(r.endTimestamp=o),y(o)}),l()()}if(i&2){let e=g();m(3),N("ngModel",e.endTimestamp)}}function Sw(i,t){if(i&1){let e=E();s(0,"div")(1,"mat-form-field",2)(2,"mat-label"),h(3,"Parameter Value"),l(),s(4,"input",37),L("ngModelChange",function(o){v(e);let r=g();return V(r.simpleParameter,o)||(r.simpleParameter=o),y(o)}),l(),s(5,"mat-hint"),h(6),l()()()}if(i&2){let e=g();m(4),N("ngModel",e.simpleParameter),m(2),oe("Simple value for ","{{PARAMETERS}}"," placeholder or appended to first command")}}function kw(i,t){if(i&1){let e=E();s(0,"div",40)(1,"mat-form-field",41)(2,"mat-label"),h(3,"Key"),l(),s(4,"input",42),L("ngModelChange",function(o){let r=v(e).$implicit;return V(r.key,o)||(r.key=o),y(o)}),l()(),s(5,"mat-form-field",43)(6,"mat-label"),h(7,"Value"),l(),s(8,"input",44),L("ngModelChange",function(o){let r=v(e).$implicit;return V(r.value,o)||(r.value=o),y(o)}),l()(),s(9,"button",45),_("click",function(){let o=v(e).$index,r=g(3);return y(r.removeParameter(o))}),s(10,"mat-icon"),h(11,"delete"),l()()()}if(i&2){let e=t.$implicit;m(4),N("ngModel",e.key),m(4),N("ngModel",e.value)}}function Mw(i,t){if(i&1&&(s(0,"div",39),Oe(1,kw,12,2,"div",40,qi),l()),i&2){let e=g(2);m(),Ae(e.parameters)}}function Ew(i,t){if(i&1){let e=E();s(0,"div")(1,"div",26)(2,"button",38),_("click",function(){v(e);let o=g();return y(o.addParameter())}),s(3,"mat-icon"),h(4,"add"),l()()(),w(5,Mw,3,0,"div",39),s(6,"p",19),h(7),l()()}if(i&2){let e=g();m(5),S(e.parameters.length>0?5:-1),m(2),oe("Key-value pairs for ","{{key}}"," placeholders in prompt commands")}}function Tw(i,t){if(i&1&&(s(0,"div",31)(1,"mat-icon"),h(2,"error"),l(),s(3,"span"),h(4),l()()),i&2){let e=g();m(4),B(e.errorMessage)}}var Ta=class i{schedulerApi=d(kr);promptApi=d(un);dialogRef=d(nn);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=d(Vn);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,n])=>({key:e,value:String(n)}))))}}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(),n=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),r=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0");return`${e}-${n}-${o}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(n=>n.key.trim());if(t.length===0)return;let e={};return t.forEach(n=>{e[n.key]=n.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:n=>{console.error("Error updating scheduler:",n),this.errorMessage=n?.error?.error||n?.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:n=>{console.error("Error creating scheduler:",n),this.errorMessage=n?.error?.error||n?.message||"Failed to create scheduler",this.isSaving=!1}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,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,n){e&1&&(s(0,"h2",0),h(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),h(6,"Name"),l(),s(7,"input",3),L("ngModelChange",function(r){return V(n.name,r)||(n.name=r),r}),l(),s(8,"mat-hint"),h(9,"A descriptive name for this scheduler"),l()(),s(10,"mat-form-field",2)(11,"mat-label"),h(12,"Prompt"),l(),s(13,"mat-select",4),L("ngModelChange",function(r){return V(n.promptId,r)||(n.promptId=r),r}),Oe(14,yw,2,2,"mat-option",5,bw),l(),s(16,"mat-hint"),h(17,"Select the prompt to execute"),l()(),s(18,"mat-form-field",2)(19,"mat-label"),h(20,"Start Date & Time"),l(),s(21,"input",6),L("ngModelChange",function(r){return V(n.startTimestamp,r)||(n.startTimestamp=r),r}),l(),s(22,"mat-hint"),h(23,"When to start the scheduler (leave empty for now)"),l()(),s(24,"div",7)(25,"h3"),h(26,"Schedule Interval"),l(),s(27,"div",8)(28,"mat-form-field",9)(29,"mat-label"),h(30,"Every"),l(),s(31,"input",10),L("ngModelChange",function(r){return V(n.intervalValue,r)||(n.intervalValue=r),r}),l()(),s(32,"mat-form-field",11)(33,"mat-label"),h(34,"Unit"),l(),s(35,"mat-select",4),L("ngModelChange",function(r){return V(n.intervalUnit,r)||(n.intervalUnit=r),r}),s(36,"mat-option",12),h(37,"Minutes (1-59)"),l(),s(38,"mat-option",13),h(39,"Hours (1-24)"),l(),s(40,"mat-option",14),h(41,"Days (1-31)"),l(),s(42,"mat-option",15),h(43,"Months (1-12)"),l()()()()(),s(44,"div",16)(45,"h3"),h(46,"Days of Week (Optional)"),l(),s(47,"div",17),Oe(48,Cw,2,2,"mat-checkbox",18,vw),l(),s(50,"p",19),h(51,"Leave empty to run every day"),l()(),s(52,"div",20)(53,"h3"),h(54,"End Condition (Optional)"),l(),s(55,"mat-form-field",2)(56,"mat-label"),h(57,"End Type"),l(),s(58,"mat-select",21),L("ngModelChange",function(r){return V(n.endConditionType,r)||(n.endConditionType=r),r}),s(59,"mat-option",22),h(60,"Never (run indefinitely)"),l(),s(61,"mat-option",23),h(62,"After X occurrences"),l(),s(63,"mat-option",24),h(64,"Until specific date"),l()()(),w(65,xw,4,1,"mat-form-field",2),w(66,ww,4,1,"mat-form-field",2),l(),s(67,"div",25)(68,"div",26)(69,"h3"),h(70,"Parameters (Optional)"),l(),s(71,"mat-button-toggle-group",27),L("ngModelChange",function(r){return V(n.parameterMode,r)||(n.parameterMode=r),r}),s(72,"mat-button-toggle",28),h(73,"Simple"),l(),s(74,"mat-button-toggle",29),h(75,"Structured"),l()()(),w(76,Sw,7,2,"div"),w(77,Ew,8,2,"div"),l(),s(78,"div",30)(79,"mat-checkbox",21),L("ngModelChange",function(r){return V(n.enabled,r)||(n.enabled=r),r}),h(80,"Enabled"),l(),s(81,"p",19),h(82,"Scheduler will only run if enabled"),l()(),w(83,Tw,5,1,"div",31),l()(),s(84,"mat-dialog-actions",32)(85,"button",33),_("click",function(){return n.cancel()}),h(86,"Cancel"),l(),s(87,"button",34),_("click",function(){return n.save()}),h(88),l()()),e&2&&(m(),B(n.isEditMode?"Edit Scheduler":"Create Scheduler"),m(6),N("ngModel",n.name),m(6),N("ngModel",n.promptId),m(),Ae(n.availablePrompts),m(7),N("ngModel",n.startTimestamp),m(10),N("ngModel",n.intervalValue),m(4),N("ngModel",n.intervalUnit),m(13),Ae(n.daysOfWeekOptions),m(10),N("ngModel",n.endConditionType),m(7),S(n.endConditionType==="occurrences"?65:-1),m(),S(n.endConditionType==="endTimestamp"?66:-1),m(5),N("ngModel",n.parameterMode),m(5),S(n.parameterMode==="simple"?76:-1),m(),S(n.parameterMode==="structured"?77:-1),m(2),N("ngModel",n.enabled),m(4),S(n.errorMessage?83:-1),m(2),x("disabled",n.isSaving),m(2),x("disabled",n.isSaving),m(),oe(" ",n.isSaving?"Saving...":"Save"," "))},dependencies:[De,Xe,je,_a,Qe,ho,va,We,ro,ai,li,si,yt,At,vt,Kt,pn,Wt,Ht,gi,pt,Ye,xe,Ea,cm,Co,gf,mm,bf,hm,Ql],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 Pw(i,t){i&1&&(s(0,"div",12),h(1,"Loading schedulers..."),l())}function Ow(i,t){if(i&1&&(s(0,"div",13),h(1),l()),i&2){let e=g();m(),B(e.errorMessage)}}function Aw(i,t){i&1&&(s(0,"div",14),h(1," No schedulers found. Create your first scheduler to automate prompt execution. "),l())}function Dw(i,t){i&1&&(s(0,"div",14),h(1," No schedulers match your search. "),l())}function Iw(i,t){if(i&1&&(s(0,"span",31),h(1),l()),i&2){let e=g().$implicit;x("title",Ci("Created by ",e.createdBy)),m(),oe(" \u{1F464} ",e.createdBy," ")}}function Rw(i,t){if(i&1&&(s(0,"div",22)(1,"span",23),h(2,"Last Run:"),l(),s(3,"span",24),h(4),Yi(5,"date"),l()()),i&2){let e=g().$implicit;m(4),B(Nr(5,1,e.lastRun,"short"))}}function Fw(i,t){if(i&1){let e=E();s(0,"div",17)(1,"div",18)(2,"h3"),h(3),s(4,"span",19),h(5),l(),qe(6,Iw,2,3,"span",20),l(),s(7,"div",21)(8,"div",22)(9,"span",23),h(10,"Prompt:"),l(),s(11,"span",24),h(12),l()(),s(13,"div",22)(14,"span",23),h(15,"Schedule:"),l(),s(16,"span",24),h(17),l()(),s(18,"div",22)(19,"span",23),h(20,"Next Run:"),l(),s(21,"span",24),h(22),l()(),qe(23,Rw,6,4,"div",25),l()(),s(24,"div",26)(25,"button",27),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.editScheduler(o))}),h(26,"Edit"),l(),s(27,"button",28),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.toggleEnabled(o))}),h(28),l(),s(29,"button",29),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.runNow(o.id))}),h(30,"Run Now"),l(),s(31,"button",30),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.deleteScheduler(o.id))}),h(32,"Delete"),l()()()}if(i&2){let e=t.$implicit,n=g(2);m(3),oe(" ",e.name," "),m(),A("enabled",e.enabled),m(),oe(" ",e.enabled?"Enabled":"Disabled"," "),m(),x("ngIf",e.createdBy!==n.getCurrentUsername()),m(6),B(n.getPromptName(e.promptId)),m(5),B(n.formatInterval(e.schedule.interval)),m(5),B(n.formatNextRun(e.nextRun)),m(),x("ngIf",e.lastRun),m(4),A("btn-enabled",e.enabled)("btn-disabled",!e.enabled),m(),oe(" ",e.enabled?"Disable":"Enable"," ")}}function Nw(i,t){if(i&1&&(s(0,"div",15),qe(1,Fw,33,14,"div",16),l()),i&2){let e=g();m(),x("ngForOf",e.filteredSchedulers)}}var Xl=class i{schedulerApi=d(kr);promptApi=d(un);configApi=d($n);dialog=d(Cn);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 n=e?.error?.error??e?.message??"Failed to delete scheduler";alert(`Failed to delete scheduler: ${n}`)}})}toggleEnabled(t){(t.enabled?this.schedulerApi.disableScheduler(t.id):this.schedulerApi.enableScheduler(t.id)).subscribe({next:()=>{this.loadSchedulers()},error:n=>{console.error("Error toggling scheduler:",n);let o=n?.error?.error??n?.message??"Failed to toggle scheduler";alert(`Failed to toggle scheduler: ${o}`)}})}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 n=e?.error?.error??e?.message??"Failed to run scheduler";alert(`Failed to run scheduler: ${n}`)}})}formatNextRun(t){return t?new Date(t).toLocaleString():"Expired or completed"}getCurrentUsername(){return this.currentUsername}getPromptName(t){let e=this.prompts.find(n=>n.id===t);return e?e.name:t}formatInterval(t){let e=RegExp(/^(\d+)(min|h|d|M)$/).exec(t);if(!e)return t;let[,n,o]=e;if(!n||!o)return t;let a={min:"minute",h:"hour",d:"day",M:"month"}[o]??o;return`Every ${n} ${a}${parseInt(n,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(n=>this.isMyScheduler(n)):[...this.schedulers];t&&(e=e.filter(n=>n.name.toLowerCase().includes(t)||n.promptId.toLowerCase().includes(t)||this.getPromptName(n.promptId).toLowerCase().includes(t)?!0:n.createdBy.toLowerCase().includes(t))),this.filteredSchedulers=e}onSearchChange(){this.applyFilter()}createScheduler(){this.dialog.open(Ta,{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(Ta,{width:"700px",maxHeight:"90vh",data:{mode:"edit",scheduler:e}}).afterClosed().subscribe(o=>{o&&this.loadSchedulers()})},error:e=>{console.error("Error loading scheduler details:",e);let n=e?.error?.error??e?.message??"Failed to load scheduler details";alert(`Failed to load scheduler details: ${n}`)}})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,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,n){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),h(3,"Schedulers"),l(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),h(7,"Search"),l(),s(8,"input",4),L("ngModelChange",function(r){return V(n.searchQuery,r)||(n.searchQuery=r),r}),_("input",function(){return n.onSearchChange()}),l(),s(9,"mat-icon",5),h(10,"search"),l()(),s(11,"mat-slide-toggle",6),L("ngModelChange",function(r){return V(n.showOnlyMine,r)||(n.showOnlyMine=r),r}),_("change",function(){return n.applyFilter()}),h(12," Mine "),l(),s(13,"button",7),_("click",function(){return n.createScheduler()}),s(14,"mat-icon"),h(15,"add"),l(),s(16,"span"),h(17,"Create Scheduler"),l()()()(),qe(18,Pw,2,0,"div",8)(19,Ow,2,1,"div",9)(20,Aw,2,0,"div",10)(21,Dw,2,0,"div",10)(22,Nw,2,1,"div",11),l()),e&2&&(m(8),N("ngModel",n.searchQuery),m(3),N("ngModel",n.showOnlyMine),m(7),x("ngIf",n.isLoading),m(),x("ngIf",n.errorMessage),m(),x("ngIf",!n.isLoading&&n.schedulers.length===0),m(),x("ngIf",!n.isLoading&&n.schedulers.length>0&&n.filteredSchedulers.length===0),m(),x("ngIf",!n.isLoading&&n.filteredSchedulers.length>0))},dependencies:[De,qa,Ga,Xe,je,Qe,We,Ye,xe,Kt,pn,Wt,Ht,yo,pt,Ll,vo,ah],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 Tr=class i{http=d(Ge);projectState=d(we);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 rn(n=>{let o=new FileReader;o.onload=()=>{let r=o.result.split(",")[1];this.http.post(`${this.getBaseUrl()}/documents`,{filename:e.name,content:r,mimeType:e.type},{params:{location:t}}).subscribe(n)},o.onerror=()=>n.error(o.error),o.readAsDataURL(e)})}deleteAgent(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};function Vw(i,t){i&1&&(s(0,"p",15),h(1,"No integrations defined \u2014 agent will have access to all tools."),l())}function Lw(i,t){if(i&1){let e=E();s(0,"div",16)(1,"mat-form-field",22)(2,"mat-label"),h(3,"Integration"),l(),s(4,"input",23),L("ngModelChange",function(o){let r=v(e).$implicit;return V(r.integration,o)||(r.integration=o),y(o)}),l()(),s(5,"mat-form-field",24)(6,"mat-label"),h(7,"Tools (comma-separated)"),l(),s(8,"input",25),L("ngModelChange",function(o){let r=v(e).$implicit;return V(r.tools,o)||(r.tools=o),y(o)}),l()(),s(9,"button",26),_("click",function(){let o=v(e).$index,r=g();return y(r.removeIntegrationRow(o))}),s(10,"mat-icon"),h(11,"delete"),l()()()}if(i&2){let e=t.$implicit;m(4),N("ngModel",e.integration),m(4),N("ngModel",e.tools)}}function jw(i,t){if(i&1&&(s(0,"p",30),h(1),l()),i&2){let e=g(2);m(),B(e.docUploadError)}}function zw(i,t){i&1&&(s(0,"p",15),h(1,"No mandatory documents defined."),l())}function Bw(i,t){if(i&1&&I(0,"option",35),i&2){let e=t.$implicit;x("value","documents/"+e)}}function Hw(i,t){if(i&1){let e=E();s(0,"div",31)(1,"mat-form-field",32)(2,"mat-label"),h(3,"Document path"),l(),s(4,"input",33),L("ngModelChange",function(o){let r=v(e).$index,a=g(2);return V(a.mandatoryDocs[r],o)||(a.mandatoryDocs[r]=o),y(o)}),l(),s(5,"datalist",34),Oe(6,Bw,1,1,"option",35,Xm),l()(),s(8,"button",26),_("click",function(){let o=v(e).$index,r=g(2);return y(r.removeDocRow(o))}),s(9,"mat-icon"),h(10,"delete"),l()()()}if(i&2){let e=t.$index,n=g(2);m(4),N("ngModel",n.mandatoryDocs[e]),G("list","docs-list-"+e),m(),x("id","docs-list-"+e),m(),Ae(n.availableDocuments)}}function Ww(i,t){if(i&1){let e=E();s(0,"div",6)(1,"span"),h(2,"Mandatory Documents"),l(),s(3,"button",27),_("click",function(){v(e);let o=g();return y(o.addDocRow())}),s(4,"mat-icon"),h(5,"add"),l()(),s(6,"label",28)(7,"mat-icon"),h(8,"upload_file"),l(),s(9,"input",29),_("change",function(o){v(e);let r=g();return y(r.onDocFileSelected(o))}),l()()(),w(10,jw,2,1,"p",30),w(11,zw,2,0,"p",15),Oe(12,Hw,11,3,"div",31,qi)}if(i&2){let e=g();m(6),A("uploading",e.isUploadingDoc),m(3),x("disabled",e.isUploadingDoc),m(),S(e.docUploadError?10:-1),m(),S(e.mandatoryDocs.length===0?11:-1),m(),Ae(e.mandatoryDocs)}}function Uw(i,t){i&1&&(s(0,"p",15),h(1,"\u{1F4A1} Documents can be added after the agent is created."),l())}function $w(i,t){if(i&1){let e=E();s(0,"div",6),h(1,"Save to"),l(),s(2,"div",36)(3,"label",37)(4,"input",38),L("ngModelChange",function(o){v(e);let r=g();return V(r.location,o)||(r.location=o),y(o)}),l(),s(5,"div",39)(6,"div",40)(7,"span",41),h(8,"\u{1F464}"),l(),s(9,"span",42),h(10,"Project config"),l()(),s(11,"p",43),h(12),l()()(),s(13,"label",37)(14,"input",44),L("ngModelChange",function(o){v(e);let r=g();return V(r.location,o)||(r.location=o),y(o)}),l(),s(15,"div",39)(16,"div",40)(17,"span",41),h(18,"\u{1F4E6}"),l(),s(19,"span",42),h(20,"Colocated"),l()(),s(21,"p",43),h(22,"Next to coday.yaml in ./agents/ (committable)"),l()()()(),s(23,"p",15),h(24,"Storage location is permanent and cannot be changed after creation."),l()}if(i&2){let e=g();m(3),A("selected",e.location==="project"),m(),N("ngModel",e.location),m(8),yi("~/.coday/projects/","{","name","}","/agents/ (not committed)"),m(),A("selected",e.location==="colocated"),m(),N("ngModel",e.location)}}function qw(i,t){if(i&1&&(s(0,"div",17)(1,"span",6),h(2,"Storage Location"),l(),s(3,"span",45),h(4),l(),s(5,"p",15),h(6,"Cannot be changed after creation."),l()()),i&2){let e=g();m(3),A("badge-project",e.location==="project")("badge-colocated",e.location==="colocated"),m(),oe(" ",e.location==="project"?"\u{1F464} Project config":"\u{1F4E6} Colocated"," ")}}function Gw(i,t){if(i&1&&(s(0,"div",18)(1,"mat-icon"),h(2,"error"),l(),s(3,"span"),h(4),l()()),i&2){let e=g();m(4),B(e.errorMessage)}}var Pa=class i{agentCrudApi=d(Tr);agentApi=d(lr);dialogRef=d(nn);data=d(Vn);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,n])=>({integration:e,tools:n?.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,n=e.files?.[0];n&&(this.isUploadingDoc=!0,this.docUploadError="",this.agentCrudApi.uploadDocument(this.location,n).subscribe({next:o=>{this.isUploadingDoc=!1,this.mandatoryDocs.push(o.relativePath),this.loadAvailableDocuments(),e.value=""},error:o=>{this.isUploadingDoc=!1,this.docUploadError=o?.error?.error??o?.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(n=>n.trim()).filter(Boolean),e=this.integrationRows.length>0?Object.fromEntries(this.integrationRows.filter(n=>n.integration.trim()).map(n=>[n.integration.trim(),n.tools.split(",").map(o=>o.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:n=>{this.isSaving=!1,this.errorMessage=n?.error?.error||n?.message||"Failed to save agent"}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,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,n){e&1&&(s(0,"h2",0),h(1),l(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),h(6,"Name"),l(),s(7,"input",3),L("ngModelChange",function(r){return V(n.name,r)||(n.name=r),r}),l(),s(8,"mat-hint"),h(9,"Alphanumeric, hyphens and underscores only. Cannot be changed after creation."),l()(),s(10,"mat-form-field",2)(11,"mat-label"),h(12,"Description"),l(),s(13,"textarea",4),L("ngModelChange",function(r){return V(n.description,r)||(n.description=r),r}),l()(),s(14,"mat-form-field",2)(15,"mat-label"),h(16,"Instructions"),l(),s(17,"textarea",5),L("ngModelChange",function(r){return V(n.instructions,r)||(n.instructions=r),r}),l(),s(18,"mat-hint"),h(19,"System prompt / instructions sent to the AI model"),l()(),s(20,"div",6),h(21,"AI Configuration"),l(),s(22,"div",7)(23,"mat-form-field",8)(24,"mat-label"),h(25,"AI Provider"),l(),s(26,"input",9),L("ngModelChange",function(r){return V(n.aiProvider,r)||(n.aiProvider=r),r}),l()(),s(27,"mat-form-field",8)(28,"mat-label"),h(29,"Model Name"),l(),s(30,"input",10),L("ngModelChange",function(r){return V(n.modelName,r)||(n.modelName=r),r}),l()()(),s(31,"div",7)(32,"mat-form-field",8)(33,"mat-label"),h(34,"Temperature"),l(),s(35,"input",11),L("ngModelChange",function(r){return V(n.temperature,r)||(n.temperature=r),r}),l(),s(36,"mat-hint"),h(37,"Leave empty for model default"),l()(),s(38,"mat-form-field",8)(39,"mat-label"),h(40,"Max Output Tokens"),l(),s(41,"input",12),L("ngModelChange",function(r){return V(n.maxOutputTokens,r)||(n.maxOutputTokens=r),r}),l(),s(42,"mat-hint"),h(43,"Leave empty for model default"),l()()(),s(44,"mat-form-field",2)(45,"mat-label"),h(46,"OpenAI Assistant ID"),l(),s(47,"input",13),L("ngModelChange",function(r){return V(n.openaiAssistantId,r)||(n.openaiAssistantId=r),r}),l(),s(48,"mat-hint"),h(49,"If set, forces aiProvider to openai"),l()(),s(50,"div",6)(51,"span"),h(52,"Integrations"),l(),s(53,"button",14),_("click",function(){return n.addIntegrationRow()}),s(54,"mat-icon"),h(55,"add"),l()()(),w(56,Vw,2,0,"p",15),Oe(57,Lw,12,2,"div",16,qi),w(59,Ww,14,5)(60,Uw,2,0,"p",15),w(61,$w,25,8),w(62,qw,7,5,"div",17),w(63,Gw,5,1,"div",18),l()(),s(64,"mat-dialog-actions",19)(65,"button",20),_("click",function(){return n.cancel()}),h(66,"Cancel"),l(),s(67,"button",21),_("click",function(){return n.save()}),h(68),l()()),e&2&&(m(),B(n.isEditMode?"Edit Agent":"Create Agent"),m(6),N("ngModel",n.name),x("readonly",n.isEditMode),m(6),N("ngModel",n.description),m(4),N("ngModel",n.instructions),m(9),N("ngModel",n.aiProvider),m(4),N("ngModel",n.modelName),m(5),N("ngModel",n.temperature),m(6),N("ngModel",n.maxOutputTokens),m(6),N("ngModel",n.openaiAssistantId),m(9),S(n.integrationRows.length===0?56:-1),m(),Ae(n.integrationRows),m(2),S(n.isEditMode?59:60),m(2),S(n.isEditMode?-1:61),m(),S(n.isEditMode?62:-1),m(),S(n.errorMessage?63:-1),m(2),x("disabled",n.isSaving),m(2),x("disabled",n.isSaving),m(),oe(" ",n.isSaving?"Saving...":"Save"," "))},dependencies:[Xe,sl,ll,je,_a,mo,Qe,ho,va,Wd,We,ro,ai,li,si,yt,At,vt,Kt,pn,Wt,Ht,gi,pt,Ye,xe,Ea,Qo],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 Yw=(i,t)=>t.name;function Qw(i,t){i&1&&(s(0,"div",7),h(1,"Loading agents..."),l())}function Xw(i,t){if(i&1&&(s(0,"div",8),h(1),l()),i&2){let e=g();m(),B(e.errorMessage)}}function Kw(i,t){i&1&&(s(0,"div",9),h(1,"No file-based agents found. Create your first agent to get started."),l())}function Zw(i,t){i&1&&(s(0,"div",9),h(1,"No agents match your search."),l())}function Jw(i,t){if(i&1){let e=E();s(0,"div",11)(1,"div",12)(2,"div",13)(3,"h3"),h(4),l(),s(5,"span",14),h(6),l()(),s(7,"p",15),h(8),l()(),s(9,"div",16)(10,"button",17),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.editAgent(o))}),h(11,"Edit"),l(),s(12,"button",18),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.deleteAgent(o))}),h(13,"Delete"),l()()()}if(i&2){let e=t.$implicit;m(4),B(e.name),m(),A("badge-project",e.source==="project")("badge-colocated",e.source==="colocated"),x("title",e.source==="project"?"Project config (~/.coday/)":"Colocated (next to coday.yaml)"),m(),oe(" ",e.source==="project"?"\u{1F464}":"\u{1F4E6}"," "),m(2),B(e.description)}}function eS(i,t){if(i&1&&(s(0,"div",10),Oe(1,Jw,14,8,"div",11,Yw),l()),i&2){let e=g();m(),Ae(e.filteredAgents)}}var Kl=class i{agentCrudApi=d(Tr);dialog=d(Cn);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(Pa,{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(Pa,{width:"700px",maxHeight:"90vh",data:{mode:"edit",agent:e}}).afterClosed().subscribe(o=>{o&&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||i)};static \u0275cmp=M({type:i,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,n){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),h(3,"Agents"),l(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),h(7,"Search"),l(),s(8,"input",4),L("ngModelChange",function(r){return V(n.searchQuery,r)||(n.searchQuery=r),r}),_("input",function(){return n.onSearchChange()}),l(),s(9,"mat-icon",5),h(10,"search"),l()(),s(11,"button",6),_("click",function(){return n.createAgent()}),s(12,"mat-icon"),h(13,"add"),l(),s(14,"span"),h(15,"Create Agent"),l()()()(),w(16,Qw,2,0,"div",7),w(17,Xw,2,1,"div",8),w(18,Kw,2,0,"div",9),w(19,Zw,2,0,"div",9),w(20,eS,3,0,"div",10),l()),e&2&&(m(8),N("ngModel",n.searchQuery),m(8),S(n.isLoading?16:-1),m(),S(n.errorMessage?17:-1),m(),S(!n.isLoading&&n.agents.length===0?18:-1),m(),S(!n.isLoading&&n.agents.length>0&&n.filteredAgents.length===0?19:-1),m(),S(!n.isLoading&&n.filteredAgents.length>0?20:-1))},dependencies:[Xe,je,Qe,We,Ye,xe,Kt,pn,Wt,Ht,yo,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 tS=["threadSearchInput"],nS=["*"];function iS(i,t){i&1&&(s(0,"a",27),I(1,"img",28),l()),i&2&&(m(),G("src","CODAY-Logo.png",Io))}function oS(i,t){if(i&1){let e=E();s(0,"button",25),_("click",function(){v(e);let o=g();return y(o.toggle())}),s(1,"mat-icon"),h(2,"menu"),l()(),s(3,"button",26),_("click",function(){v(e);let o=g();return y(o.createNewThread())}),s(4,"mat-icon",10),h(5,"play_circle"),l()(),w(6,iS,2,1,"a",27)}if(i&2){let e=g();m(3),x("disabled",!e.selectedProjectName()),m(3),S(e.isOpen?-1:6)}}function rS(i,t){if(i&1){let e=E();s(0,"div",14)(1,"mat-icon",29),h(2,"search"),l(),s(3,"input",30,0),L("ngModelChange",function(o){v(e);let r=g();return V(r.threadSearchQuery,o)||(r.threadSearchQuery=o),y(o)}),_("input",function(){v(e);let o=g();return y(o.onThreadSearchInput())}),l(),s(5,"button",31),_("click",function(){v(e);let o=g();return y(o.closeThreadSearch())}),s(6,"mat-icon"),h(7,"close"),l()()()}if(i&2){let e=g();m(3),N("ngModel",e.threadSearchQuery)}}function aS(i,t){i&1&&(s(0,"mat-icon",18),h(1,"keyboard_arrow_up"),l())}function sS(i,t){i&1&&(s(0,"mat-icon",19),h(1,"forum"),l())}function lS(i,t){if(i&1){let e=E();s(0,"button",33),_("click",function(o){v(e);let r=g(2);return y(r.toggleThreadSearch(o))}),s(1,"mat-icon"),h(2,"search"),l()()}}function cS(i,t){if(i&1){let e=E();s(0,"a",17),_("click",function(o){return v(e),g().toggleSection("threads"),y(o.preventDefault())}),w(1,aS,2,0,"mat-icon",18)(2,sS,2,0,"mat-icon",19),s(3,"span",20),h(4,"Threads"),l(),w(5,lS,3,0,"button",32),l()}if(i&2){let e=g();A("active",e.expandedSections.threads),m(),S(e.expandedSections.threads?1:2),m(4),S(e.expandedSections.threads?5:-1)}}function dS(i,t){if(i&1){let e=E();s(0,"div",16)(1,"app-thread-selector",34),_("searchModeChange",function(o){v(e);let r=g();return y(r.onThreadSearchModeChange(o))}),l()()}if(i&2){let e=g();m(),x("searchMode",e.isThreadSearchActive)("searchQuery",e.threadSearchQuery)}}function mS(i,t){i&1&&(s(0,"mat-icon",18),h(1,"keyboard_arrow_up"),l())}function hS(i,t){i&1&&(s(0,"mat-icon",19),h(1,"tune"),l())}function uS(i,t){i&1&&(s(0,"div",21)(1,"div",35),I(2,"app-options-panel",36),l()())}function pS(i,t){if(i&1){let e=E();s(0,"div",13)(1,"a",17),_("click",function(o){return v(e),g(2).openProjectConfig(),o.preventDefault(),y(o.stopPropagation())}),s(2,"mat-icon",19),h(3,"settings_applications"),l(),s(4,"span",20),h(5,"Project Configuration"),l()()()}}function gS(i,t){i&1&&(s(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"settings_applications"),l(),s(4,"span",20),h(5,"Project config (No project)"),l()()())}function fS(i,t){if(i&1&&w(0,pS,6,0,"div",13)(1,gS,6,0,"div",13),i&2){let e=g();S(e.selectedProjectName()?0:1)}}function _S(i,t){if(i&1){let e=E();s(0,"div",13)(1,"a",17),_("click",function(o){return v(e),g().openAgents(),o.preventDefault(),y(o.stopPropagation())}),s(2,"mat-icon",19),h(3,"smart_toy"),l(),s(4,"span",20),h(5,"Agents"),l()()()}}function bS(i,t){i&1&&(s(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"smart_toy"),l(),s(4,"span",20),h(5,"Agents (No project)"),l()()())}function vS(i,t){if(i&1){let e=E();s(0,"div",13)(1,"a",17),_("click",function(o){return v(e),g().openPrompts(),o.preventDefault(),y(o.stopPropagation())}),s(2,"mat-icon",19),h(3,"description"),l(),s(4,"span",20),h(5,"Prompts"),l()()()}}function yS(i,t){i&1&&(s(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"description"),l(),s(4,"span",20),h(5,"Prompts (No project)"),l()()())}function CS(i,t){if(i&1){let e=E();s(0,"div",13)(1,"a",17),_("click",function(o){return v(e),g().openSchedulers(),o.preventDefault(),y(o.stopPropagation())}),s(2,"mat-icon",19),h(3,"schedule"),l(),s(4,"span",20),h(5,"Schedulers"),l()()()}}function xS(i,t){i&1&&(s(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"schedule"),l(),s(4,"span",20),h(5,"Schedulers (No project)"),l()()())}function wS(i,t){if(i&1){let e=E();s(0,"div",24)(1,"mat-icon",38),h(2,"warning"),l(),s(3,"span",39),h(4),l(),s(5,"button",40),_("click",function(){v(e);let o=g();return y(o.configErrorMessage="")}),s(6,"mat-icon"),h(7,"close"),l()()()}if(i&2){let e=g();m(4),B(e.configErrorMessage)}}var Zl=class i{destroy$=new F;isOpen=!0;isAdmin=!1;configErrorMessage="";expandedSections={threads:!0,config:!1};isThreadSearchActive=!1;threadSearchQuery="";threadSearchInput;dialog=d(Cn);configApi=d($n);projectStateService=d(we);projectApi=d(Xo);router=d(wi);preferences=d(rt);threadStateService=d(Dt);projects=Vt(this.projectStateService.projectList$);selectedProject=Vt(this.projectStateService.selectedProject$);selectedProjectName=Vt(this.projectStateService.selectedProject$.pipe(be(t=>t?.name)));isProjectVolatile=Vt(this.projectStateService.selectedProject$.pipe(be(t=>t?.config?.volatile||!1)));forcedProject=Vt(this.projectStateService.forcedProject$);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(z(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()}close(){this.isOpen=!1,this.saveSidenavState()}saveSidenavState(){this.preferences.setPreference("sidenavOpen",this.isOpen),console.log("[SIDENAV] Saved sidenav state:",this.isOpen)}openUserConfig(){console.log("[SIDENAV] openUserConfig called"),this.configErrorMessage="",this.configApi.getUserConfig().pipe(z(this.destroy$)).subscribe({next:t=>{console.log("[SIDENAV] User config loaded, opening dialog"),this.dialog.open(ka,{data:{configType:"user",initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(n=>{n&&this.saveUserConfig(n)})},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(z(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(z(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] Project config loaded, opening dialog"),this.dialog.open(ka,{data:{configType:"project",projectName:t,initialContent:JSON.stringify(e,null,2)}}).afterClosed().subscribe(o=>{o&&this.saveProjectConfig(t,o)})},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(z(this.destroy$)).subscribe({next:n=>{console.log("[SIDENAV] Project config saved successfully")},error:n=>{console.error("[SIDENAV] Error saving project config:",n),this.configErrorMessage=n?.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(Kl,"Opening agent manager dialog")}openPrompts(){this.requireProjectSelection("open prompts")&&this.openManagerDialog(Wl,"Opening prompt manager dialog")}openSchedulers(){this.requireProjectSelection("open schedulers")&&this.openManagerDialog(Xl,`Opening scheduler manager dialog for project: ${this.selectedProjectName()}`)}toggleSection(t){let e=this.expandedSections[t];Object.keys(this.expandedSections).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])}toggleThreadSearch(t){t.stopPropagation(),this.isThreadSearchActive=!0,this.threadSearchQuery="",console.log("[SIDENAV] Thread search active:",this.isThreadSearchActive),setTimeout(()=>{this.threadSearchInput?.nativeElement.focus()},0)}closeThreadSearch(){this.isThreadSearchActive=!1,this.threadSearchQuery="",console.log("[SIDENAV] Thread search closed")}onThreadSearchInput(){console.log("[SIDENAV] Search query:",this.threadSearchQuery)}onThreadSearchModeChange(t){t||this.closeThreadSearch()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["app-sidenav"]],viewQuery:function(e,n){if(e&1&&ie(tS,5),e&2){let o;U(o=$())&&(n.threadSearchInput=o.first)}},ngContentSelectors:nS,decls:50,vars:35,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"],[1,"search-header"],["role","button","tabindex","0",1,"section-toggle",3,"active"],[1,"section-content","threads"],["role","button","tabindex","0",1,"section-toggle",3,"click"],[1,"arrow-icon","expanded"],[1,"section-icon"],[1,"section-label"],[1,"section-content"],["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"],["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"],["href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer","title","Contribute on GitHub",1,"sidenav-logo-btn"],["alt","Coday",1,"logo"],[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"],["mat-icon-button","","title","Search threads","type","button",1,"search-button",3,"click"],[1,"sidenav-thread-selector",3,"searchModeChange","searchMode","searchQuery"],[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,n){e&1&&(Be(),w(0,oS,7,2),s(1,"mat-sidenav-container",1)(2,"mat-sidenav",2),_("closed",function(){return n.close()}),s(3,"div",3)(4,"button",4),_("click",function(){return n.close()}),s(5,"mat-icon"),h(6,"chevron_left"),l()(),s(7,"img",5),_("click",function(r){return n.navigateToHome(),r.stopPropagation()})("keydown.enter",function(r){return n.navigateToHome(),r.preventDefault(),r.stopPropagation()})("keydown.space",function(r){return n.navigateToHome(),r.preventDefault(),r.stopPropagation()}),l(),s(8,"div",6)(9,"h2",7),h(10),l()()(),s(11,"div",8)(12,"a",9),_("click",function(r){return n.createNewThread(),r.preventDefault()}),s(13,"mat-icon",10),h(14,"play_circle"),l(),s(15,"span",11),h(16,"Start a new thread"),l()()(),s(17,"div",12)(18,"div",13),w(19,rS,8,1,"div",14)(20,cS,6,4,"a",15),w(21,dS,2,2,"div",16),l(),s(22,"div",13)(23,"a",17),_("click",function(r){return n.toggleSection("config"),r.preventDefault()}),w(24,mS,2,0,"mat-icon",18)(25,hS,2,0,"mat-icon",19),s(26,"span",20),h(27,"Preferences"),l()(),w(28,uS,3,0,"div",21),l(),s(29,"div",13)(30,"a",17),_("click",function(r){return n.openUserConfig(),r.preventDefault(),r.stopPropagation()}),s(31,"mat-icon",19),h(32,"settings"),l(),s(33,"span",20),h(34,"User Configuration"),l()()(),w(35,fS,2,1),w(36,_S,6,0,"div",13)(37,bS,6,0,"div",13),w(38,vS,6,0,"div",13)(39,yS,6,0,"div",13),w(40,CS,6,0,"div",13)(41,xS,6,0,"div",13),s(42,"div",13)(43,"a",22),I(44,"img",23),s(45,"span",20),h(46,"Contribute on GitHub"),l()()()()(),s(47,"mat-sidenav-content"),me(48),l()(),w(49,wS,8,1,"div",24)),e&2&&(S(n.isOpen?-1:0),m(),x("hasBackdrop",!1),m(),x("opened",n.isOpen)("disableClose",!0),m(5),A("sidenav-logo",!0)("clickable",!n.forcedProject())("disabled",n.forcedProject()),x("title",n.forcedProject()?"Project selection disabled":"Go to project selection"),G("src","CODAY-Logo.png",Io)("role",n.forcedProject()?null:"button")("tabindex",n.forcedProject()?null:"0"),m(3),B(n.selectedProjectName()),m(7),A("has-footer",!0)("is-admin",n.isAdmin),m(),A("expanded",n.expandedSections.threads),m(),S(n.isThreadSearchActive&&n.expandedSections.threads?19:20),m(2),S(n.expandedSections.threads?21:-1),m(),A("expanded",n.expandedSections.config),m(),A("active",n.expandedSections.config),m(),S(n.expandedSections.config?24:25),m(4),S(n.expandedSections.config?28:-1),m(7),S(n.isAdmin?35:-1),m(),S(n.selectedProjectName()?36:37),m(2),S(n.selectedProjectName()?38:39),m(2),S(n.selectedProjectName()?40:41),m(4),G("src","CODAY-Logo.png",Io),m(5),S(n.configErrorMessage?49:-1))},dependencies:[Xe,je,Qe,We,Il,em,Fg,Al,Ye,xe,yt,vt,zg,Bg,xa,Hl],styles:['[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}.sidenav-container[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1400;transition:width;display:flex}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]{position:relative!important;transition:width;width:310px;flex-shrink:0}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]:not(.mat-drawer-opened){width:0!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}.sidenav-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:1rem!important;left:1rem!important;z-index:1500!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]{position:fixed!important;top:4.5rem!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}.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:100%;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border-radius:0;overflow:hidden;display:flex;flex-direction:column}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:4px}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text)}.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%]{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;padding:0;height:100%;max-height:calc(100vh - 122px)}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:4px}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text)}.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%]{flex:1;min-height:0;overflow:hidden}.section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overflow-x:hidden;border-bottom:none;position:relative}.section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]:after{content:"";position:sticky;bottom:0;left:0;right:0;height:60px;background:linear-gradient(to bottom,transparent 0%,var(--glass-bg) 100%);pointer-events:none;opacity:1;transition:opacity .3s ease;z-index:10;flex-shrink:0}.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}@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}.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 Jl=class i{destroy$=new F;isSetup=!1;codayService=d(hn);preferencesService=d(rt);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(z(this.destroy$),Do(),he(([t,e])=>t===!0&&e===!1)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled()}),this.preferencesService.browserNotificationEnabled$.pipe(z(this.destroy$),Do(),he(([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(),n=t.createGain();e.connect(n),n.connect(t.destination),e.frequency.setValueAtTime(700,t.currentTime),n.gain.setValueAtTime(.1,t.currentTime),n.gain.exponentialRampToValueAtTime(.01,t.currentTime+.08),e.start(t.currentTime),e.stop(t.currentTime+.08);let o=t.createOscillator(),r=t.createGain();o.connect(r),r.connect(t.destination);let a=t.currentTime+.11;o.frequency.setValueAtTime(950,a),r.gain.setValueAtTime(.1,a),r.gain.exponentialRampToValueAtTime(.01,a+.09),o.start(a),o.stop(a+.09),console.log("[AGENT-NOTIFICATION] Completion sound played")}catch(t){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",t)}}handleBrowserNotificationEnabled(){return J(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||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};var SS=["inputSection"];function kS(i,t){if(i&1&&I(0,"app-thread",2),i&2){let e=g();x("projectName",e.projectName)("threadId",e.threadId)}}function MS(i,t){if(i&1){let e=E();s(0,"div",3),I(1,"app-welcome-message"),l(),s(2,"div",4,0)(4,"div",5)(5,"div",6)(6,"app-chat-textarea",7),_("messageSubmitted",function(o){v(e);let r=g();return y(r.onMessageSubmitted(o))})("voiceRecordingToggled",function(o){v(e);let r=g();return y(r.onVoiceToggled(o))})("heightChanged",function(o){v(e);let r=g();return y(r.onInputHeightChanged(o))}),l()()()()}if(i&2){let e=g();m(6),x("isDisabled",e.isSessionInitializing)("isSessionInitializing",e.isSessionInitializing)("showWelcome",!0)("isThinking",!1)("isStarting",e.isStartingFirstMessage)}}var Oa=class i{destroy$=new F;inputSection;projectName="";threadId=null;isSessionInitializing=!1;isStartingFirstMessage=!1;inputSectionHeight=80;codayService=d(hn);titleService=d(yr);preferencesService=d(rt);route=d(Qa);router=d(wi);threadApiService=d(Li);agentNotificationService=d(Jl);firstMessageState=d(Cr);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)")}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(z(this.destroy$)).subscribe(t=>{let e=t.projectName,n=t.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:e,thread:n,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=e,this.threadId=n,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)}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||i)};static \u0275cmp=M({type:i,selectors:[["app-main"]],viewQuery:function(e,n){if(e&1&&ie(SS,5),e&2){let o;U(o=$())&&(n.inputSection=o.first)}},decls:4,vars:1,consts:[["inputSection",""],[1,"app"],[3,"projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(e,n){e&1&&(s(0,"app-sidenav")(1,"div",1),w(2,kS,1,2,"app-thread",2)(3,MS,7,5),l()()),e&2&&(m(2),S(n.threadId?2:3))},dependencies:[cr,Fl,Jo,Zl],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center}.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 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%}@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 1rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}.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:[Sc("slideIn",[as(":enter",[Ti({transform:"translateY(100%)",opacity:0}),rs("300ms ease-out",Ti({transform:"translateY(0)",opacity:1}))]),as(":leave",[rs("200ms ease-in",Ti({transform:"translateY(100%)",opacity:0}))])])]}})};var ec=class i{route=d(Qa);ngOnInit(){console.log("[OAuth Callback] Component initialized");let t=this.route.snapshot.queryParamMap.get("code"),e=this.route.snapshot.queryParamMap.get("state"),n=this.route.snapshot.queryParamMap.get("error"),o=this.route.snapshot.queryParamMap.get("error_description");if(console.log("[OAuth Callback] Code:",t,"State:",e,"Error:",n,"Opener:",!!window.opener),n){if(console.log("[OAuth Callback] OAuth error received:",n,o),!window.opener){alert(`OAuth error: ${n}${o?" - "+o:""}. Please close this window.`);return}try{window.opener.postMessage({error:n,state:e,errorDescription:o},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||i)};static \u0275cmp=M({type:i,selectors:[["app-oauth-callback"]],decls:2,vars:0,template:function(e,n){e&1&&(an(0,"p"),h(1,"Authentication in progress..."),sn())},encapsulation:2})};var um=i=>J(null,null,function*(){let t=d(we),e=i.params.projectName;return e?t.getSelectedProjectId()===e?!0:(t.selectProject(e),(yield Nm(t.selectedProject$.pipe(zm(o=>o?.name===e))))?.name===e):(console.log("[PROJECT GUARD] no project id in route"),!1)});var vf=i=>J(null,null,function*(){let t=d(Dt),e=i.params.threadId;if(!e)return console.log("[THREAD GUARD] no threadId in route"),!1;if(console.log("[THREAD GUARD] Checking thread:",e),console.log("[THREAD GUARD] Current selected thread:",t.getSelectedThreadId()),t.getSelectedThreadId()===e)return console.log("[THREAD GUARD] Thread already selected, allowing navigation"),!0;console.log("[THREAD GUARD] Selecting thread:",e),t.selectThread(e);try{let n=yield Fm(Xn([t.isLoading$,t.selectedThread$]).pipe(st(([r,a])=>console.log(`\u{1F43C} [${r?"loading":"loaded"}]`,a?.id)),he(([r,a])=>!r&&!!a),St(1),be(([r,a])=>a?.id))),o=n===e;return o?console.log("[THREAD GUARD] Thread validated, allowing navigation"):console.error("[THREAD GUARD] Thread ID mismatch - route:",e,"loaded:",n),o}catch(n){return console.error("[THREAD GUARD] Error loading thread:",n),!1}});var yf=[{path:"",component:hl},{path:"oauth/callback",component:ec},{path:"project/:projectName",component:Oa,canActivate:[um]},{path:"project/:projectName/thread/:threadId",component:Oa,canActivate:[um,vf]},{path:"agentos",loadChildren:()=>import("./chunk-OM6QEVE5.js").then(i=>i.AGENTOS_ROUTES)},{path:"**",redirectTo:""}];var tc=class i{eventStream=d(Un);messageApi=d(sr);pendingStates=new Map;popupCheckInterval=null;constructor(){this.eventStream.events$.pipe(he(t=>t.type==="oauth_request")).subscribe(t=>this.handleOAuthRequest(t)),window.addEventListener("message",t=>this.handlePopupMessage(t))}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 n=this.pendingStates.get(e);if(this.pendingStates.delete(e),n){let o=new Wn({state:e,integrationName:n,error:"user_cancelled",errorDescription:"User closed the popup without completing authentication"});this.messageApi.sendMessage(o).subscribe({next:()=>console.log("[OAuth Service] Cancellation sent to backend"),error:r=>console.error("[OAuth Service] Failed to send cancellation:",r)})}}},500)}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()));let e=600,n=900,o=window.screenX+(window.outerWidth-e)/2,r=window.screenY+(window.outerHeight-n)/2,a=`width=${e},height=${n},left=${o},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))}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:n,error:o,errorDescription:r}=t.data??{};if(o){console.log("[OAuth Service] OAuth error received:",o,r);let u=this.pendingStates.get(n);if(u){this.pendingStates.delete(n),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let p=new Wn({state:n,integrationName:u,error:o,errorDescription:r});this.messageApi.sendMessage(p).subscribe({next:()=>console.log("[OAuth Service] Error callback sent to backend"),error:b=>console.error("[OAuth Service] Failed to send error callback:",b)})}return}if(!e||!n){console.warn("[OAuth Service] Message missing code or state:",t.data);return}console.log("[OAuth Service] Processing callback - code:",e,"state:",n);let a=this.pendingStates.get(n);if(!a){console.warn("[OAuth Service] Unknown state received:",n,"Pending states:",Array.from(this.pendingStates.keys()));return}console.log("[OAuth Service] Found integration:",a),this.pendingStates.delete(n),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let c=new Wn({code:e,state:n,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:u=>console.error("[OAuth Service] Failed to send callback:",u)})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=D({token:i,factory:i.\u0275fac,providedIn:"root"})};function ES(i){return()=>i.initializeDefaultProject()}function TS(i){return()=>{console.log("[APP_INIT] OAuthService initialized")}}var Cf={providers:[Wm(),eh({eventCoalescing:!0}),mh(yf),ch(),bu(),Hm(Qo),{provide:fc,useFactory:ES,deps:[we],multi:!0},{provide:fc,useFactory:TS,deps:[tc],multi:!0},{provide:wc,useFactory:()=>{let i=new wc;return i.rootUrl="/api/agentos",i}},{provide:Ns,useValue:{width:"80vw",maxWidth:"80vw",maxHeight:"80vh"}}]};var nc=class i{title="client";themeService=d(xr);ngOnInit(){console.log("[APP] Application initialized with theme:",this.themeService.getCurrentTheme())}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=M({type:i,selectors:[["app-root"]],decls:1,vars:0,template:function(e,n){e&1&&I(0,"router-outlet")},dependencies:[hh,dh],encapsulation:2})};lh(nc,Cf).catch(i=>console.error(i));
|