Files
adk-python/src/google/adk/cli/browser/main-CS5OLUMF.js
T

92 lines
2.4 MiB
JavaScript
Raw Normal View History

2025-05-05 17:07:14 -07:00
/**
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var Wv=Object.defineProperty,zv=Object.defineProperties;var jv=Object.getOwnPropertyDescriptors;var AC=Object.getOwnPropertySymbols;var af=Object.prototype.hasOwnProperty,If=Object.prototype.propertyIsEnumerable;var sf=(t,e,A)=>e in t?Wv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:A}):t[e]=A,b=(t,e)=>{for(var A in e||={})af.call(e,A)&&sf(t,A,e[A]);if(AC)for(var A of AC(e))If.call(e,A)&&sf(t,A,e[A]);return t},uA=(t,e)=>zv(t,jv(e));var _c=(t,e)=>{var A={};for(var i in t)af.call(t,i)&&e.indexOf(i)<0&&(A[i]=t[i]);if(t!=null&&AC)for(var i of AC(t))e.indexOf(i)<0&&If.call(t,i)&&(A[i]=t[i]);return A};var $e=(t,e,A)=>new Promise((i,o)=>{var n=s=>{try{r(A.next(s))}catch(a){o(a)}},g=s=>{try{r(A.throw(s))}catch(a){o(a)}},r=s=>s.done?i(s.value):Promise.resolve(s.value).then(n,g);r((A=A.apply(t,e)).next())});function Yc(t,e){return Object.is(t,e)}var Te=null,eC=!1,Jc=1,Mt=Symbol("SIGNAL");function WA(t){let e=Te;return Te=t,e}function Hc(){return Te}var Vg={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:"unknown",producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Ss(t){if(eC)throw new Error("");if(Te===null)return;Te.consumerOnSignalRead(t);let e=Te.nextProducerIndex++;if(gC(Te),e<Te.producerNode.length&&Te.producerNode[e]!==t&&vs(Te)){let A=Te.producerNode[e];nC(A,Te.producerIndexOfThis[e])}Te.producerNode[e]!==t&&(Te.producerNode[e]=t,Te.producerIndexOfThis[e]=vs(Te)?Bf(t,Te,e):0),Te.producerLastReadVersion[e]=t.version}function Cf(){Jc++}function Tc(t){if(!(vs(t)&&!t.dirty)&&!(!t.dirty&&t.lastCleanEpoch===Jc)){if(!t.producerMustRecompute(t)&&!oC(t)){xc(t);return}t.producerRecomputeValue(t),xc(t)}}function Oc(t){if(t.liveConsumerNode===void 0)return;let e=eC;eC=!0;try{for(let A of t.liveConsumerNode)A.dirty||Xv(A)}finally{eC=e}}function Pc(){return Te?.consumerAllowSignalWrites!==!1}function Xv(t){t.dirty=!0,Oc(t),t.consumerMarkedDirty?.(t)}function xc(t){t.dirty=!1,t.lastCleanEpoch=Jc}function Ns(t){return t&&(t.nextProducerIndex=0),WA(t)}function iC(t,e){if(WA(e),!(!t||t.producerNode===void 0||t.producerIndexOfThis===void 0||t.producerLastReadVersion===void 0)){if(vs(t))for(let A=t.nextProducerIndex;A<t.producerNode.length;A++)nC(t.producerNode[A],t.producerIndexOfThis[A]);for(;t.producerNode.length>t.nextProducerIndex;)t.producerNode.pop(),t.producerLastReadVersion.pop(),t.producerIndexOfThis.pop()}}function oC(t){gC(t);for(let e=0;e<t.producerNode.length;e++){let A=t.producerNode[e],i=t.producerLastReadVersion[e];if(i!==A.version||(Tc(A),i!==A.version))return!0}return!1}function Gs(t){if(gC(t),vs(t))for(let e=0;e<t.producerNode.length;e++)nC(t.producerNode[e],t.producerIndexOfThis[e]);t.producerNode.length=t.producerLastReadVersion.length=t.producerIndexOfThis.length=0,t.liveConsumerNode&&(t.liveConsumerNode.length=t.liveConsumerIndexOfThis.length=0)}function Bf(t,e,A){if(Qf(t),t.liveConsumerNode.length===0&&Ef(t))for(let i=0;i<t.producerNode.length;i++)t.producerIndexOfThis[i]=Bf(t.producerNode[i],t,i);return t.liveConsumerIndexOfThis.push(A),t.liveConsumerNode.push(e)-1}function nC(t,e){if(Qf(t),t.liveConsumerNode.length===1&&Ef(t))for(let i=0;i<t.producerNode.length;i++)nC(t.producerNode[i],t.producerIndexOfThis[i]);let A=t.liveConsumerNode.length-1;if(t.liveConsumerNode[e]=t.liveConsumerNode[A],t.liveConsumerIndexOfThis[e]=t.liveConsumerIndexOfThis[A],t.liveConsumerNode.length--,t.liveConsumerIndexOfThis.length--,e<t.liveConsumerNode.length){let i=t.liveConsumerIndexOfThis[e],o=t.liveConsumerNode[e];gC(o),o.producerIndexOfThis[i]=e}}function vs(t){return t.consumerIsAlwaysLive||(t?.liveConsumerNode?.length??0)>0}function gC(t){t.producerNode??=[],t.producerIndexOfThis??=[],t.producerLastReadVersion??=[]}function Qf(t){t.liveConsumerNode??=[],t.liveConsumerIndexOfThis??=[]}function Ef(t){return t.producerNode!==void 0}function rC(t,e){let A=Object
2025-05-05 17:07:14 -07:00
${A.map((i,o)=>`${o+1}) ${i.toString()}`).join(`
`)}`:"",this.name="UnsubscriptionError",this.errors=A});function Pn(t,e){if(t){let A=t.indexOf(e);0<=A&&t.splice(A,1)}}var GA=class t{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:A}=this;if(A)if(this._parentage=null,Array.isArray(A))for(let n of A)n.remove(this);else A.remove(this);let{initialTeardown:i}=this;if(MA(i))try{i()}catch(n){e=n instanceof IC?n.errors:[n]}let{_finalizers:o}=this;if(o){this._finalizers=null;for(let n of o)try{df(n)}catch(g){e=e??[],g instanceof IC?e=[...e,...g.errors]:e.push(g)}}if(e)throw new IC(e)}}add(e){var A;if(e&&e!==this)if(this.closed)df(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(A=this._finalizers)!==null&&A!==void 0?A:[]).push(e)}}_hasParent(e){let{_parentage:A}=this;return A===e||Array.isArray(A)&&A.includes(e)}_addParent(e){let{_parentage:A}=this;this._parentage=Array.isArray(A)?(A.push(e),A):A?[A,e]:e}_removeParent(e){let{_parentage:A}=this;A===e?this._parentage=null:Array.isArray(A)&&Pn(A,e)}remove(e){let{_finalizers:A}=this;A&&Pn(A,e),e instanceof t&&e._removeParent(this)}};GA.EMPTY=(()=>{let t=new GA;return t.closed=!0,t})();var jc=GA.EMPTY;function CC(t){return t instanceof GA||t&&"closed"in t&&MA(t.remove)&&MA(t.add)&&MA(t.unsubscribe)}function df(t){MA(t)?t():t.unsubscribe()}var Di={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var zg={setTimeout(t,e,...A){let{delegate:i}=zg;return i?.setTimeout?i.setTimeout(t,e,...A):setTimeout(t,e,...A)},clearTimeout(t){let{delegate:e}=zg;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function BC(t){zg.setTimeout(()=>{let{onUnhandledError:e}=Di;if(e)e(t);else throw t})}function Ks(){}var hf=Xc("C",void 0,void 0);function uf(t){return Xc("E",void 0,t)}function mf(t){return Xc("N",t,void 0)}function Xc(t,e,A){return{kind:t,value:e,error:A}}var Zn=null;function jg(t){if(Di.useDeprecatedSynchronousErrorHandling){let e=!Zn;if(e&&(Zn={errorThrown:!1,error:null}),t(),e){let{errorThrown:A,error:i}=Zn;if(Zn=null,A)throw i}}else t()}function Df(t){Di.useDeprecatedSynchronousErrorHandling&&Zn&&(Zn.errorThrown=!0,Zn.error=t)}var vo=class extends GA{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,CC(e)&&e.add(this)):this.destination=sS}static create(e,A,i){return new So(e,A,i)}next(e){this.isStopped?Al(mf(e),this):this._next(e)}error(e){this.isStopped?Al(uf(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?Al(hf,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},gS=Function.prototype.bind;function $c(t,e){return gS.call(t,e)}var el=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:A}=this;if(A.next)try{A.next(e)}catch(i){QC(i)}}error(e){let{partialObserver:A}=this;if(A.error)try{A.error(e)}catch(i){QC(i)}else QC(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(A){QC(A)}}},So=class extends vo{constructor(e,A,i){super();let o;if(MA(e)||!e)o={next:e??void 0,error:A??void 0,complete:i??void 0};else{let n;this&&Di.useDeprecatedNextContext?(n=Object.create(e),n.unsubscribe=()=>this.unsubscribe(),o={next:e.next&&$c(e.next,n),error:e.error&&$c(e.error,n),complete:e.complete&&$c(e.complete,n)}):o=e}this.destination=new el(o)}};function QC(t){Di.useDeprecatedSynchronousErrorHandling?Df(t):BC(t)}function rS(t){throw t}function Al(t,e){let{onStoppedNotification:A}=Di;A&&zg.setTimeout(()=>A(t,e))}var sS={closed:!0,next:Ks,error:rS,complete:Ks};var Xg=typeof Symbol=="function"&&Symbol.observable||"@@observable";function ut(t){return t}function tl(...t){return il(t)}function il(t){return t.length===0?ut:t.length===1?t[0]:function(A){return t.reduce((i,o)=
`);return i>=0?A.slice(0,i):A}function yl(t,e){return t?e?`${t} ${e}`:t:e||""}var US=Be({__forward_ref__:Be});function ot(t){return t.__forward_ref__=ot,t.toString=function(){return bt(this())},t}function it(t){return Yp(t)?t():t}function Yp(t){return typeof t=="function"&&t.hasOwnProperty(US)&&t.__forward_ref__===ot}function v(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function j(t){return{providers:t.providers||[],imports:t.imports||[]}}function DB(t){return Of(t,Hp)||Of(t,Tp)}function Jp(t){return DB(t)!==null}function Of(t,e){return t.hasOwnProperty(e)?t[e]:null}function xS(t){let e=t&&(t[Hp]||t[Tp]);return e||null}function Pf(t){return t&&(t.hasOwnProperty(Zf)||t.hasOwnProperty(YS))?t[Zf]:null}var Hp=Be({\u0275prov:Be}),Zf=Be({\u0275inj:Be}),Tp=Be({ngInjectableDef:Be}),YS=Be({ngInjectorDef:Be}),F=class{_desc;ngMetadataName="InjectionToken";\u0275prov;constructor(e,A){this._desc=e,this.\u0275prov=void 0,typeof A=="number"?this.__NG_ELEMENT_ID__=A:A!==void 0&&(this.\u0275prov=v({token:this,providedIn:A.providedIn||"root",factory:A.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function Op(t){return t&&!!t.\u0275providers}var JS=Be({\u0275cmp:Be}),HS=Be({\u0275dir:Be}),TS=Be({\u0275pipe:Be}),OS=Be({\u0275mod:Be}),PC=Be({\u0275fac:Be}),qs=Be({__NG_ELEMENT_ID__:Be}),qf=Be({__NG_ENV_ID__:Be});function ia(t){return typeof t=="string"?t:t==null?"":String(t)}function PS(t){return typeof t=="function"?t.name||t.toString():typeof t=="object"&&t!=null&&typeof t.type=="function"?t.type.name||t.type.toString():ia(t)}function Pp(t,e){throw new H(-200,t)}function Ld(t,e){throw new H(-201,!1)}var zA=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}(zA||{}),Ml;function Zp(){return Ml}function kt(t){let e=Ml;return Ml=t,e}function qp(t,e,A){let i=DB(t);if(i&&i.providedIn=="root")return i.value===void 0?i.value=i.factory():i.value;if(A&zA.Optional)return null;if(e!==void 0)return e;Ld(t,"Injector")}var ZS={},zn=ZS,Rl="__NG_DI_FLAG__",ZC=class{injector;constructor(e){this.injector=e}retrieve(e,A){let i=A;return this.injector.get(e,i.optional?aC:zn,i)}},qC="ngTempTokenPath",qS="ngTokenPath",VS=/\n/gm,WS="\u0275",Vf="__source";function zS(t,e=zA.Default){if(_s()===void 0)throw new H(-203,!1);if(_s()===null)return qp(t,void 0,e);{let A=_s(),i;return A instanceof ZC?i=A.injector:i=A,i.get(t,e&zA.Optional?null:void 0,e)}}function Z(t,e=zA.Default){return(Zp()||zS)(it(t),e)}function B(t,e=zA.Default){return Z(t,fB(e))}function fB(t){return typeof t>"u"||typeof t=="number"?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function kl(t){let e=[];for(let A=0;A<t.length;A++){let i=it(t[A]);if(Array.isArray(i)){if(i.length===0)throw new H(900,!1);let o,n=zA.Default;for(let g=0;g<i.length;g++){let r=i[g],s=jS(r);typeof s=="number"?s===-1?o=r.token:n|=s:o=r}e.push(Z(o,n))}else e.push(Z(i))}return e}function Vp(t,e){return t[Rl]=e,t.prototype[Rl]=e,t}function jS(t){return t[Rl]}function XS(t,e,A,i){let o=t[qC];throw e[Vf]&&o.unshift(e[Vf]),t.message=$S(`
`+t.message,o,A,i),t[qS]=o,t[qC]=null,t}function $S(t,e,A,i=null){t=t&&t.charAt(0)===`
`&&t.charAt(1)==WS?t.slice(2):t;let o=bt(e);if(Array.isArray(e))o=e.map(bt).join(" -> ");else if(typeof e=="object"){let n=[];for(let g in e)if(e.hasOwnProperty(g)){let r=e[g];n.push(g+":"+(typeof r=="string"?JSON.stringify(r):bt(r)))}o=`{${n.join(", ")}}`}return`${A}${i?"("+i+")":""}[${o}]: ${t.replace(VS,`
`)}`}var Ig=Vp(xp("Optional"),8);var oa=Vp(xp("SkipSelf"),4);function Xn(t,e){let A=t.hasOwnProperty(PC);return A?t[PC]:null}function AN(t,e,A){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++){let o=t[i],n=e[i];if(A&&(o=A(o),n=A(n)),n!==o)return!1}return!0}function eN(t){return t.flat(Number.POSITIVE_INFINITY)}function _d(t,e){t.forEach(A=>Array.isArray(A)?_d(A,e):e(A))}function Wp(t,e,A){e>=t.length?t.push(A):t.splice(e,0,A)}function VC(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function tN(t,e){let A=[];for(let i=0;i<t;i++)A.push(e);return A}function iN(t,e,A,i){let o=t.length;if(o==e)t.push(A,i);else if(o===1)t.push(i,t[0]),t[0]=A;else{for(o--,t.push(t[o-1],t[o]);o>e;){let n=o-2;t[o]=t[n],o--}t[e]=A,t[e+1]=i}}function pB(t,e,A){let i=na(t,e);return i>=0?t[i|1]=A:(i=~i,iN(t,i,e,A)),i}function Cl(t,e){let A=na(t,e);if(A>=0)return t[A|1]}function na(t,e){return oN(t,e,1)}function oN(t,e,A){let i=0,o=t.length>>A;for(;o!==i;){let n=i+(o-i>>1),g=t[n<<A];if(e===g)return n<<A;g>e?o=n:i=n+1}return~(o<<A)}var ji={},Dt=[],Qr=new F(""),zp=new F("",-1),jp=new F(""),WC=class{get(e,A=zn){if(A===zn){let i=new Error(`NullInjectorError: No provider for ${bt(e)}!`);throw i.name="NullInjectorError",i}return A}};function Xp(t,e){let A=t[OS]||null;if(!A&&e===!0)throw new Error(`Type ${bt(t)} does not have '\u0275mod' property.`);return A}function En(t){return t[JS]||null}function $p(t){return t[HS]||null}function nN(t){return t[TS]||null}function ga(t){return{\u0275providers:t}}function gN(...t){return{\u0275providers:Aw(!0,t),\u0275fromNgModule:!0}}function Aw(t,...e){let A=[],i=new Set,o,n=g=>{A.push(g)};return _d(e,g=>{let r=g;bl(r,n,[],i)&&(o||=[],o.push(r))}),o!==void 0&&ew(o,n),A}function ew(t,e){for(let A=0;A<t.length;A++){let{ngModule:i,providers:o}=t[A];Kd(o,n=>{e(n,i)})}}function bl(t,e,A,i){if(t=it(t),!t)return!1;let o=null,n=Pf(t),g=!n&&En(t);if(!n&&!g){let s=t.ngModule;if(n=Pf(s),n)o=s;else return!1}else{if(g&&!g.standalone)return!1;o=t}let r=i.has(o);if(g){if(r)return!1;if(i.add(o),g.dependencies){let s=typeof g.dependencies=="function"?g.dependencies():g.dependencies;for(let a of s)bl(a,e,A,i)}}else if(n){if(n.imports!=null&&!r){i.add(o);let a;try{_d(n.imports,Q=>{bl(Q,e,A,i)&&(a||=[],a.push(Q))})}finally{}a!==void 0&&ew(a,e)}if(!r){let a=Xn(o)||(()=>new o);e({provide:o,useFactory:a,deps:Dt},o),e({provide:jp,useValue:o,multi:!0},o),e({provide:Qr,useValue:()=>Z(o),multi:!0},o)}let s=n.providers;if(s!=null&&!r){let a=t;Kd(s,Q=>{e(Q,a)})}}else return!1;return o!==t&&t.providers!==void 0}function Kd(t,e){for(let A of t)Op(A)&&(A=A.\u0275providers),Array.isArray(A)?Kd(A,e):e(A)}var rN=Be({provide:String,useValue:Be});function tw(t){return t!==null&&typeof t=="object"&&rN in t}function sN(t){return!!(t&&t.useExisting)}function aN(t){return!!(t&&t.useFactory)}function Er(t){return typeof t=="function"}function IN(t){return!!t.useClass}var wB=new F(""),YC={},Wf={},Bl;function yB(){return Bl===void 0&&(Bl=new WC),Bl}var Ye=class{},Ws=class extends Ye{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,A,i,o){super(),this.parent=A,this.source=i,this.scopes=o,vl(e,g=>this.processProvider(g)),this.records.set(zp,rr(void 0,this)),o.has("environment")&&this.records.set(Ye,rr(void 0,this));let n=this.records.get(wB);n!=null&&typeof n.value=="string"&&this.scopes.add(n.value),this.injectorDefTypes=new Set(this.get(jp,Dt,zA.Self))}retrieve(e,A){let i=A;return this.get(e,i.optional?aC:zn,i)}destroy(){Ps(this),this._destroyed=!0;let e=WA(null);try{for(let i of this._ngOnDestroyHooks)i.ngOnDestroy();let A=this._onDestroyHooks;this._onDestroyHooks=[];for(let i of A)i()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),WA(e)}}onDestroy(e){return Ps(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){Ps(this);let A=Fo(this),i=kt(void 0),o;try{return e()}finally{Fo(A),kt(i)}}get(e,A=zn,i=zA.Default){if(Ps(this),e.hasOwnProperty(qf))return e[qf](this
`).forEach(A=>{let i=A.indexOf(":");if(i>0){let o=A.slice(0,i),n=A.slice(i+1).trim();this.addHeaderEntry(o,n)}})}:typeof Headers<"u"&&e instanceof Headers?(this.headers=new Map,e.forEach((A,i)=>{this.addHeaderEntry(i,A)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(e).forEach(([A,i])=>{this.setHeaderEntries(A,i)})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();let A=this.headers.get(e.toLowerCase());return A&&A.length>0?A[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,A){return this.clone({name:e,value:A,op:"a"})}set(e,A){return this.clone({name:e,value:A,op:"s"})}delete(e,A){return this.clone({name:e,value:A,op:"d"})}maybeSetNormalizedName(e,A){this.normalizedNames.has(A)||this.normalizedNames.set(A,e)}init(){this.lazyInit&&(this.lazyInit instanceof t?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(A=>{this.headers.set(A,e.headers.get(A)),this.normalizedNames.set(A,e.normalizedNames.get(A))})}clone(e){let A=new t;return A.lazyInit=this.lazyInit&&this.lazyInit instanceof t?this.lazyInit:this,A.lazyUpdate=(this.lazyUpdate||[]).concat([e]),A}applyUpdate(e){let A=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if(typeof i=="string"&&(i=[i]),i.length===0)return;this.maybeSetNormalizedName(e.name,A);let o=(e.op==="a"?this.headers.get(A):void 0)||[];o.push(...i),this.headers.set(A,o);break;case"d":let n=e.value;if(!n)this.headers.delete(A),this.normalizedNames.delete(A);else{let g=this.headers.get(A);if(!g)return;g=g.filter(r=>n.indexOf(r)===-1),g.length===0?(this.headers.delete(A),this.normalizedNames.delete(A)):this.headers.set(A,g)}break}}addHeaderEntry(e,A){let i=e.toLowerCase();this.maybeSetNormalizedName(e,i),this.headers.has(i)?this.headers.get(i).push(A):this.headers.set(i,[A])}setHeaderEntries(e,A){let i=(Array.isArray(A)?A:[A]).map(n=>n.toString()),o=e.toLowerCase();this.headers.set(o,i),this.maybeSetNormalizedName(e,o)}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(A=>e(this.normalizedNames.get(A),this.headers.get(A)))}};var IQ=class{encodeKey(e){return oM(e)}encodeValue(e){return oM(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}};function Ix(t,e){let A=new Map;return t.length>0&&t.replace(/^\?/,"").split("&").forEach(o=>{let n=o.indexOf("="),[g,r]=n==-1?[e.decodeKey(o),""]:[e.decodeKey(o.slice(0,n)),e.decodeValue(o.slice(n+1))],s=A.get(g)||[];s.push(r),A.set(g,s)}),A}var Cx=/%(\d[a-f0-9])/gi,Bx={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function oM(t){return encodeURIComponent(t).replace(Cx,(e,A)=>Bx[A]??e)}function aQ(t){return`${t}`}var qo=class t{map;encoder;updates=null;cloneFrom=null;constructor(e={}){if(this.encoder=e.encoder||new IQ,e.fromString){if(e.fromObject)throw new H(2805,!1);this.map=Ix(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(A=>{let i=e.fromObject[A],o=Array.isArray(i)?i.map(aQ):[aQ(i)];this.map.set(A,o)})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();let A=this.map.get(e);return A?A[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,A){return this.clone({param:e,value:A,op:"a"})}appendAll(e){let A=[];return Object.keys(e).forEach(i=>{let o=e[i];Array.isArray(o)?o.forEach(n=>{A.push({param:i,value:n,op:"a"})}):A.push({param:i,value:o,op:"a"})}),this.clone(A)}set(e,A){return this.clone({param:e,value:A,op:"s"})}delete(e,A){return this.clone({param:e,value:A,op:"d"})}toString(){return this.init(),this.keys().map(e=>{let A=this.encoder.encodeKey(e);return this.map.get(e).map(i=>A+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>e!=="").join("&")}clone(e){let A=new t({encoder:this.encoder});return A.clon
2025-05-05 17:07:14 -07:00
--mat-mdc-form-field-label-transform,
${qT} translateX(${p})
)`;let M=r+s+a+Q;this._elementRef.nativeElement.style.setProperty("--mat-form-field-notch-max-width",`calc(100% - ${M}px)`)}_isAttachedToDom(){let A=this._elementRef.nativeElement;if(A.getRootNode){let i=A.getRootNode();return i&&i!==A}return document.documentElement.contains(A)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=O({type:t,selectors:[["mat-form-field"]],contentQueries:function(i,o,n){if(i&1&&(w0(n,o._labelChild,_E,5),XA(n,hI,5),XA(n,HT,5),XA(n,Jk,5),XA(n,JT,5),XA(n,Gk,5)),i&2){y0();let g;$(g=AA())&&(o._formFieldControl=g.first),$(g=AA())&&(o._prefixChildren=g),$(g=AA())&&(o._suffixChildren=g),$(g=AA())&&(o._errorChildren=g),$(g=AA())&&(o._hintChildren=g)}},viewQuery:function(i,o){if(i&1&&(QA(dT,5),QA(hT,5),QA(uT,5),QA(mT,5),QA(DT,5),QA(Lk,5),QA(Uk,5),QA(Kk,5)),i&2){let n;$(n=AA())&&(o._textField=n.first),$(n=AA())&&(o._iconPrefixContainer=n.first),$(n=AA())&&(o._textPrefixContainer=n.first),$(n=AA())&&(o._iconSuffixContainer=n.first),$(n=AA())&&(o._textSuffixContainer=n.first),$(n=AA())&&(o._floatingLabel=n.first),$(n=AA())&&(o._notchedOutline=n.first),$(n=AA())&&(o._lineRipple=n.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:42,hostBindings:function(i,o){i&2&&nA("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-no-animations",o._animationMode==="NoopAnimations")("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-focused",o._control.focused)("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:[FA([{provide:uI,useExisting:t},{provide:Tk,useExisting:t}])],ngContentSelectors:pT,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",""],[1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],[1,"mat-mdc-form-field-error-wrapper"],[1,"mat-mdc-form-field-hint-wrapper"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(i,o){if(i&1){let n=rA();OA(fT),x(0,MT,1,1,"ng-template",null,0,ha),d(2,"div",6,1),G("click",function(r){return Y(n),J(o._control.onContainerClick(r))}),x(4,RT,1,0,"div",7),d(5,"div",8),x(6,FT,2,2,"div",9)(7,vT,3,0,"div",10)(8,ST,3,0,"div",11),d(9,"div",12),x(10,GT,1,1,null,13),IA(11),h(),x(12,LT,3,0,"div",14)(13,_T,3,0,"div",15),h(),x(14,KT,1,0,"div",16),h(),d(15,"div",17),x(16,UT,2,1,"div",18)(17,YT,5,2,"div",19),h()}if(i&2){let n;D(2),nA("mdc-text-field--filled",!o._hasOutline())("mdc-text-field--outlined",o._hasOutline())("mdc-text-field--no-label",!o._hasFloatingLabel())(
`),D(),_(o.hasAction?2:-1))},dependencies:[Et,N2,G2,L2],styles:[".mat-mdc-simple-snack-bar{display:flex}"],encapsulation:2,changeDetection:0})}return t})(),K2={snackBarState:lo("state",[li("void, hidden",Ue({transform:"scale(0.8)",opacity:0})),li("visible",Ue({transform:"scale(1)",opacity:1})),Yt("* => visible",ii("150ms cubic-bezier(0, 0, 0.2, 1)")),Yt("* => void, * => hidden",ii("75ms cubic-bezier(0.4, 0.0, 1, 1)",Ue({opacity:0})))])},U2=(()=>{class t extends _n{_ngZone=B(tA);_elementRef=B(q);_changeDetectorRef=B(UA);_platform=B(ZA);snackBarConfig=B(Es);_document=B(cA);_trackedModals=new Set;_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new U;_onExit=new U;_onEnter=new U;_animationState="void";_live;_label;_role;_liveElementId=B(re).getId("mat-snack-bar-container-live-");constructor(){super();let A=this.snackBarConfig;A.politeness==="assertive"&&!A.announcementMessage?this._live="assertive":A.politeness==="off"?this._live="off":this._live="polite",this._platform.FIREFOX&&(this._live==="polite"&&(this._role="status"),this._live==="assertive"&&(this._role="alert"))}attachComponentPortal(A){this._assertNotAttached();let i=this._portalOutlet.attachComponentPortal(A);return this._afterPortalAttached(),i}attachTemplatePortal(A){this._assertNotAttached();let i=this._portalOutlet.attachTemplatePortal(A);return this._afterPortalAttached(),i}attachDomPortal=A=>{this._assertNotAttached();let i=this._portalOutlet.attachDomPortal(A);return this._afterPortalAttached(),i};onAnimationEnd(A){let{fromState:i,toState:o}=A;if((o==="void"&&i!=="void"||o==="hidden")&&this._completeExit(),o==="visible"){let n=this._onEnter;this._ngZone.run(()=>{n.next(),n.complete()})}}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}exit(){return this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId)}),this._onExit}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit()}_completeExit(){queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){let A=this._elementRef.nativeElement,i=this.snackBarConfig.panelClass;i&&(Array.isArray(i)?i.forEach(g=>A.classList.add(g)):A.classList.add(i)),this._exposeToModals();let o=this._label.nativeElement,n="mdc-snackbar__label";o.classList.toggle(n,!o.querySelector(`.${n}`))}_exposeToModals(){let A=this._liveElementId,i=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let o=0;o<i.length;o++){let n=i[o],g=n.getAttribute("aria-owns");this._trackedModals.add(n),g?g.indexOf(A)===-1&&n.setAttribute("aria-owns",g+" "+A):n.setAttribute("aria-owns",A)}}_clearFromModals(){this._trackedModals.forEach(A=>{let i=A.getAttribute("aria-owns");if(i){let o=i.replace(this._liveElementId,"").trim();o.length>0?A.setAttribute("aria-owns",o):A.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{let A=this._elementRef.nativeElement.querySelector("[aria-hidden]"),i=this._elementRef.nativeElement.querySelector("[aria-live]");if(A&&i){let o=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&A.contains(document.activeElement)&&(o=document.activeElement),A.removeAttribute("aria-hidden"),i.appendChild(A),o?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=O({type:t,selectors:[["mat-snack-bar-container"]],viewQuery:function(i,o){if(i&1&&(QA(Ei,7),QA(F2,7)),i&2){let n;$(n=AA())&&(o._portalOutlet=n.first),$(n=AA())&&(o._label=n.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:1,hostBindings:function(i,o){i&1&&Kh("@state.done",function(g){return o.onAn
`),!C)return null;Fe=bo(C,!0)}return Fe.shift()})(),put_char(I,C){C===null||C===10?(m(W(I.output)),I.output=[]):C!=0&&I.output.push(C)},fsync(I){I.output&&I.output.length>0&&(m(W(I.output)),I.output=[])},ioctl_tcgets:I=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(I,C,l)=>0,ioctl_tiocgwinsz:I=>[24,80]},default_tty1_ops:{put_char(I,C){C===null||C===10?(e(W(I.output)),I.output=[]):C!=0&&I.output.push(C)},fsync(I){I.output&&I.output.length>0&&(e(W(I.output)),I.output=[])}}},Ti=(I,C)=>Math.ceil(I/C)*C,Zg=I=>{I=Ti(I,65536);var C=He(65536,I);return C&&((l,u)=>{n.fill(0,l,l+u)})(C,I),C},JA={ops_table:null,mount:I=>JA.createNode(null,"/",16895,0),createNode(I,C,l,u){if(E.isBlkdev(l)||E.isFIFO(l))throw new E.ErrnoError(63);JA.ops_table||={dir:{node:{getattr:JA.node_ops.getattr,setattr:JA.node_ops.setattr,lookup:JA.node_ops.lookup,mknod:JA.node_ops.mknod,rename:JA.node_ops.rename,unlink:JA.node_ops.unlink,rmdir:JA.node_ops.rmdir,readdir:JA.node_ops.readdir,symlink:JA.node_ops.symlink},stream:{llseek:JA.stream_ops.llseek}},file:{node:{getattr:JA.node_ops.getattr,setattr:JA.node_ops.setattr},stream:{llseek:JA.stream_ops.llseek,read:JA.stream_ops.read,write:JA.stream_ops.write,allocate:JA.stream_ops.allocate,mmap:JA.stream_ops.mmap,msync:JA.stream_ops.msync}},link:{node:{getattr:JA.node_ops.getattr,setattr:JA.node_ops.setattr,readlink:JA.node_ops.readlink},stream:{}},chrdev:{node:{getattr:JA.node_ops.getattr,setattr:JA.node_ops.setattr},stream:E.chrdev_stream_ops}};var w=E.createNode(I,C,l,u);return E.isDir(w.mode)?(w.node_ops=JA.ops_table.dir.node,w.stream_ops=JA.ops_table.dir.stream,w.contents={}):E.isFile(w.mode)?(w.node_ops=JA.ops_table.file.node,w.stream_ops=JA.ops_table.file.stream,w.usedBytes=0,w.contents=null):E.isLink(w.mode)?(w.node_ops=JA.ops_table.link.node,w.stream_ops=JA.ops_table.link.stream):E.isChrdev(w.mode)&&(w.node_ops=JA.ops_table.chrdev.node,w.stream_ops=JA.ops_table.chrdev.stream),w.timestamp=Date.now(),I&&(I.contents[C]=w,I.timestamp=w.timestamp),w},getFileDataAsTypedArray:I=>I.contents?I.contents.subarray?I.contents.subarray(0,I.usedBytes):new Uint8Array(I.contents):new Uint8Array(0),expandFileStorage(I,C){var l=I.contents?I.contents.length:0;if(!(l>=C)){C=Math.max(C,l*(l<1048576?2:1.125)>>>0),l!=0&&(C=Math.max(C,256));var u=I.contents;I.contents=new Uint8Array(C),I.usedBytes>0&&I.contents.set(u.subarray(0,I.usedBytes),0)}},resizeFileStorage(I,C){if(I.usedBytes!=C)if(C==0)I.contents=null,I.usedBytes=0;else{var l=I.contents;I.contents=new Uint8Array(C),l&&I.contents.set(l.subarray(0,Math.min(C,I.usedBytes))),I.usedBytes=C}},node_ops:{getattr(I){var C={};return C.dev=E.isChrdev(I.mode)?I.id:1,C.ino=I.id,C.mode=I.mode,C.nlink=1,C.uid=0,C.gid=0,C.rdev=I.rdev,E.isDir(I.mode)?C.size=4096:E.isFile(I.mode)?C.size=I.usedBytes:E.isLink(I.mode)?C.size=I.link.length:C.size=0,C.atime=new Date(I.timestamp),C.mtime=new Date(I.timestamp),C.ctime=new Date(I.timestamp),C.blksize=4096,C.blocks=Math.ceil(C.size/C.blksize),C},setattr(I,C){C.mode!==void 0&&(I.mode=C.mode),C.timestamp!==void 0&&(I.timestamp=C.timestamp),C.size!==void 0&&JA.resizeFileStorage(I,C.size)},lookup(I,C){throw E.genericErrors[44]},mknod:(I,C,l,u)=>JA.createNode(I,C,l,u),rename(I,C,l){if(E.isDir(I.mode)){var u;try{u=E.lookupNode(C,l)}catch{}if(u)for(var w in u.contents)throw new E.ErrnoError(55)}delete I.parent.contents[I.name],I.parent.timestamp=Date.now(),I.name=l,C.contents[l]=I,C.timestamp=I.parent.timestamp},unlink(I,C){delete I.contents[C],I.timestamp=Date.now()},rmdir(I,C){var l=E.lookupNode(I,C);for(var u in l.contents)throw new E.ErrnoError(55);delete I.contents[C],I.timestamp=Date.now()},readdir(I){var C=[".",".."];for(var l of Object.keys(I.contents))C.push(l);return C},symlink(I,C,l){var u=JA.createNode(I,C,41471,0);return u.link=l,u},readlink(I){if(!E.isLink(I.mode))throw new E.ErrnoError(28);return I.link}},stream_ops:{read(I,C,l,u,w){var R=I.node.contents;if(w>=I.node.usedBytes)return 0;var S=Math.min(I.node.usedBytes-w,u);if(S>8&&R.subar
2025-05-05 17:07:14 -07:00
<svg xmlns="http://www.w3.org/2000/svg" width="${c.width}" height="${c.height}"></svg>
`;return a.FS.createPath("/",a.PATH.dirname(f)),a.FS.writeFile(f,m),f}):[]}(t,i.images),typeof e=="string")o=function(a,Q){let c;try{let f=a.lengthBytesUTF8(Q);return c=a.ccall("malloc","number",["number"],[f+1]),a.stringToUTF8(Q,c,f+1),a.ccall("viz_read_one_graph","number",["number"],[c])}finally{c&&a.ccall("free","number",["number"],[c])}}(t,e);else{if(typeof e!="object")throw new Error("input must be a string or object");o=function(a,Q){let c=a.ccall("viz_create_graph","number",["string","number","number"],[Q.name,Q.directed===void 0||Q.directed,Q.strict!==void 0&&Q.strict]);return ob(a,c,Q),c}(t,e)}if(o===0)return{status:"failure",output:void 0,errors:DI(t)};if(nb(t,o,i),t.ccall("viz_set_y_invert","number",["number"],[i.yInvert?1:0]),t.ccall("viz_set_reduce","number",["number"],[i.reduce?1:0]),n=t.ccall("viz_create_context"),t.ccall("viz_reset_errors"),t.ccall("viz_layout","number",["number","number","string"],[n,o,i.engine])!==0)return{status:"failure",output:void 0,errors:DI(t)};let s={};for(let a of A){if(g=t.ccall("viz_render","number",["number","number","string"],[n,o,a]),g===0)return{status:"failure",output:void 0,errors:DI(t)};s[a]=t.UTF8ToString(g),t.ccall("free","number",["number"],[g]),g=0}return{status:"success",output:s,errors:DI(t)}}catch(s){if(/^exit\(\d+\)/.test(s))return{status:"failure",output:void 0,errors:DI(t)};throw s}finally{n&&o&&t.ccall("viz_free_layout","number",["number"],[n,o]),o&&t.ccall("viz_free_graph","number",["number"],[o]),n&&t.ccall("viz_free_context","number",["number"],[n]),g&&t.ccall("free","number",["number"],[g]),r&&function(s,a){for(let Q of a)s.FS.analyzePath(Q).exists&&s.FS.unlink(Q)}(t,r)}}function DI(t){return function(e){let A=[],i;for(let o=0;o<e.length;o++)e[o]=="Error"&&e[o+1]==": "?(i="error",o+=1):e[o]=="Warning"&&e[o+1]==": "?(i="warning",o+=1):A.push({message:e[o].trimEnd(),level:i});return A}(t.agerrMessages).concat(t.stderrMessages.map(e=>{for(let A=0;A<Ab.length;A++){let[i,o]=Ab[A],n;if((n=i.exec(e))!==null)return{message:n[1].trimEnd(),level:o}}return{message:e.trimEnd()}}))}function ob(t,e,A){nb(t,e,A),A.nodes&&A.nodes.forEach(i=>{let o=t.ccall("viz_add_node","number",["number","string"],[e,String(i.name)]);i.attributes&&ib(t,e,o,i.attributes)}),A.edges&&A.edges.forEach(i=>{let o=t.ccall("viz_add_edge","number",["number","string","string"],[e,String(i.tail),String(i.head)]);i.attributes&&ib(t,e,o,i.attributes)}),A.subgraphs&&A.subgraphs.forEach(i=>{let o=t.ccall("viz_add_subgraph","number",["number","string"],[e,String(i.name)]);ob(t,o,i)})}function nb(t,e,A){if(A.graphAttributes)for(let[i,o]of Object.entries(A.graphAttributes))YE(t,e,o,n=>{t.ccall("viz_set_default_graph_attribute","number",["number","string","number"],[e,i,n])});if(A.nodeAttributes)for(let[i,o]of Object.entries(A.nodeAttributes))YE(t,e,o,n=>{t.ccall("viz_set_default_node_attribute","number",["number","string","number"],[e,i,n])});if(A.edgeAttributes)for(let[i,o]of Object.entries(A.edgeAttributes))YE(t,e,o,n=>{t.ccall("viz_set_default_edge_attribute","number",["number","string","number"],[e,i,n])})}function ib(t,e,A,i){for(let[o,n]of Object.entries(i))YE(t,e,n,g=>{t.ccall("viz_set_attribute","number",["number","string","number"],[A,o,g])})}function YE(t,e,A,i){let o;if(o=typeof A=="object"&&"html"in A?t.ccall("viz_string_dup_html","number",["number","string"],[e,String(A.html)]):t.ccall("viz_string_dup","number",["number","string"],[e,String(A)]),o==0)throw new Error("couldn't dup string");i(o),t.ccall("viz_string_free","number",["number","number"],[e,o])}var Um=class{constructor(e){this.module=e}get graphvizVersion(){return function(e){let A=e.ccall("viz_get_graphviz_version","number",[],[]);return e.UTF8ToString(A)}(this.module)}get formats(){return eb(this.module,"device")}get engines(){return eb(this.module,"layout")}renderFormats(e,A){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return tb(this.module,e,A,b({engine:"dot"},i))}render(e){let A,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};A=i.format===void 0?"dot":i.format;let o=tb(this.module,e,[A],b({engin
`),h(),d(4,"mat-form-field",1)(5,"input",2),Wt("ngModelChange",function(n){return ai(i.newCaseId,n)||(i.newCaseId=n),n}),h()(),d(6,"mat-dialog-actions",3)(7,"button",4),k(8,"Cancel"),h(),d(9,"button",5),G("click",function(){return i.createNewEvalCase()}),k(10,"Create"),h()()),A&2&&(D(5),Vt("ngModel",i.newCaseId))},dependencies:[ro,Ii,Xt,ho,Hn,Et,uo,mo,Do,Yn],encapsulation:2})};var FI=class t{constructor(e,A,i){this.evalService=e;this.data=A;this.dialogRef=i}newSetId="evalset"+kI().slice(0,6);createNewEvalSet(){!this.newSetId||this.newSetId==""?alert("Cannot create eval set with empty id!"):this.evalService.createNewEvalSet(this.data.appName,this.newSetId).subscribe(e=>{this.dialogRef.close(!0)})}static \u0275fac=function(A){return new(A||t)(V(po),V(oi),V(rt))};static \u0275cmp=O({type:t,selectors:[["app-new-eval-set-dialog-component"]],standalone:!1,decls:11,vars:1,consts:[["mat-dialog-title",""],[2,"padding-left","20px","padding-right","24px"],["matInput","",3,"ngModelChange","ngModel"],["align","end"],["mat-button","","mat-dialog-close",""],["mat-button","","cdkFocusInitial","",3,"click"]],template:function(A,i){A&1&&(d(0,"h2",0),k(1,"Create New Eval Set"),h(),d(2,"mat-dialog-content"),k(3,` Please enter the eval set name
`),h(),d(4,"mat-form-field",1)(5,"input",2),Wt("ngModelChange",function(n){return ai(i.newSetId,n)||(i.newSetId=n),n}),h()(),d(6,"mat-dialog-actions",3)(7,"button",4),k(8,"Cancel"),h(),d(9,"button",5),G("click",function(){return i.createNewEvalSet()}),k(10,"Create"),h()()),A&2&&(D(5),Vt("ngModel",i.newSetId))},dependencies:[ro,Ii,Xt,ho,Hn,Et,uo,mo,Do,Yn],encapsulation:2})};var wo=class t{constructor(e){this.http=e}apiServerDomain=ct.getApiServerBaseUrl();createSession(e,A){if(this.apiServerDomain!=null){let i=this.apiServerDomain+`/apps/${A}/users/${e}/sessions`;return this.http.post(i,null)}return new BA}listSessions(e,A){if(this.apiServerDomain!=null){let i=this.apiServerDomain+`/apps/${A}/users/${e}/sessions`;return this.http.get(i)}return new BA}deleteSession(e,A,i){let o=this.apiServerDomain+`/apps/${A}/users/${e}/sessions/${i}`;return this.http.delete(o)}getSession(e,A,i){let o=this.apiServerDomain+`/apps/${A}/users/${e}/sessions/${i}`;return this.http.get(o)}static \u0275fac=function(A){return new(A||t)(Z(Qt))};static \u0275prov=v({token:t,factory:t.\u0275fac,providedIn:"root"})};var $O=["determinateSpinner"];function A8(t,e){if(t&1&&(At(),d(0,"svg",11),P(1,"circle",12),h()),t&2){let A=y();aA("viewBox",A._viewBox()),D(),qe("stroke-dasharray",A._strokeCircumference(),"px")("stroke-dashoffset",A._strokeCircumference()/2,"px")("stroke-width",A._circleStrokeWidth(),"%"),aA("r",A._circleRadius())}}var e8=new F("mat-progress-spinner-default-options",{providedIn:"root",factory:t8});function t8(){return{diameter:Wb}}var Wb=100,i8=10,zb=(()=>{class t{_elementRef=B(q);_noopAnimations;get color(){return this._color||this._defaultColor}set color(A){this._color=A}_color;_defaultColor="primary";_determinateCircle;constructor(){let A=B(Ae,{optional:!0}),i=B(e8);this._noopAnimations=A==="NoopAnimations"&&!!i&&!i._forceAnimations,this.mode=this._elementRef.nativeElement.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",i&&(i.color&&(this.color=this._defaultColor=i.color),i.diameter&&(this.diameter=i.diameter),i.strokeWidth&&(this.strokeWidth=i.strokeWidth))}mode;get value(){return this.mode==="determinate"?this._value:0}set value(A){this._value=Math.max(0,Math.min(100,A||0))}_value=0;get diameter(){return this._diameter}set diameter(A){this._diameter=A||0}_diameter=Wb;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(A){this._strokeWidth=A||0}_strokeWidth;_circleRadius(){return(this.diameter-i8)/2}_viewBox(){let A=this._circleRadius()*2+this.strokeWidth;return`0 0 ${A} ${A}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=O({type:t,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(i,o){if(i&1&&QA($O,5),i&2){let n;$(n=AA())&&(o._determinateCircle=n.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(i,o){i&2&&(aA("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",o.mode==="determinate"?o.value:null)("mode",o.mode),Je("mat-"+o.color),qe("width",o.diameter,"px")("height",o.diameter,"px")("--mdc-circular-progress-size",o.diameter+"px")("--mdc-circular-progress-active-indicator-width",o.diameter+"px"),nA("_mat-animation-noopable",o._noopAnimations)("mdc-circular-progress--indeterminate",o.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",de],diameter:[2,"diameter","diameter",de],strokeWidth:[2,"strokeWidth","strokeWidth",de]},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
]`).replace("lheading",SF).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),S1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,N1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,GF=/^( {2,}|\\)\n(?!\s*$)/,G1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ac=/[\p{P}\p{S}]/u,kD=/[\s\p{P}\p{S}]/u,LF=/[^\s\p{P}\p{S}]/u,L1=ie(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,kD).getRegex(),_F=/(?!~)[\p{P}\p{S}]/u,_1=/(?!~)[\s\p{P}\p{S}]/u,K1=/(?:[^\s\p{P}\p{S}]|~)/u,U1=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,KF=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,x1=ie(KF,"u").replace(/punct/g,ac).getRegex(),Y1=ie(KF,"u").replace(/punct/g,_F).getRegex(),UF="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",J1=ie(UF,"gu").replace(/notPunctSpace/g,LF).replace(/punctSpace/g,kD).replace(/punct/g,ac).getRegex(),H1=ie(UF,"gu").replace(/notPunctSpace/g,K1).replace(/punctSpace/g,_1).replace(/punct/g,_F).getRegex(),T1=ie("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,LF).replace(/punctSpace/g,kD).replace(/punct/g,ac).getRegex(),O1=ie(/\\(punct)/,"gu").replace(/punct/g,ac).getRegex(),P1=ie(/^<(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(),Z1=ie(MD).replace("(?:-->|$)","-->").getRegex(),q1=ie("^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",Z1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),rc=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,V1=ie(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",rc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xF=ie(/^!?\[(label)\]\[(ref)\]/).replace("label",rc).replace("ref",yD).getRegex(),YF=ie(/^!?\[(ref)\](?:\[\])?/).replace("ref",yD).getRegex(),W1=ie("reflink|nolink(?!\\()","g").replace("reflink",xF).replace("nolink",YF).getRegex(),bD={_backpedal:KI,anyPunctuation:O1,autolink:P1,blockSkip:U1,br:GF,code:N1,del:KI,emStrongLDelim:x1,emStrongRDelimAst:J1,emStrongRDelimUnd:T1,escape:S1,link:V1,nolink:YF,punctuation:L1,reflink:xF,reflinkSearch:W1,tag:q1,text:G1,url:KI},z1=uA(b({},bD),{link:ie(/^!?\[(label)\]\((.*?)\)/).replace("label",rc).getRegex(),reflink:ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",rc).getRegex()}),mD=uA(b({},bD),{emStrongRDelimAst:H1,emStrongLDelim:Y1,url:ie(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),j1=uA(b({},mD),{br:ie(GF).replace("{2,}","*").getRegex(),text:ie(mD.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),gc={normal:RD,gfm:F1,pedantic:v1},LI={normal:bD,gfm:mD,breaks:j1,pedantic:z1},X1={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&
2025-05-05 17:07:14 -07:00
`).map(n=>{let g=n.match(A.other.beginningSpace);if(g===null)return n;let[r]=g;return r.length>=o.length?n.slice(o.length):n}).join(`
`)}var ps=class{options;rules;lexer;constructor(e){this.options=e||Jg}space(e){let A=this.rules.block.newline.exec(e);if(A&&A[0].length>0)return{type:"space",raw:A[0]}}code(e){let A=this.rules.block.code.exec(e);if(A){let i=A[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:A[0],codeBlockStyle:"indented",text:this.options.pedantic?i:_I(i,`
`)}}}fences(e){let A=this.rules.block.fences.exec(e);if(A){let i=A[0],o=AZ(i,A[3]||"",this.rules);return{type:"code",raw:i,lang:A[2]?A[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):A[2],text:o}}}heading(e){let A=this.rules.block.heading.exec(e);if(A){let i=A[2].trim();if(this.rules.other.endingHash.test(i)){let o=_I(i,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(i=o.trim())}return{type:"heading",raw:A[0],depth:A[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(e){let A=this.rules.block.hr.exec(e);if(A)return{type:"hr",raw:_I(A[0],`
`)}}blockquote(e){let A=this.rules.block.blockquote.exec(e);if(A){let i=_I(A[0],`
2025-05-05 17:07:14 -07:00
`).split(`
`),o="",n="",g=[];for(;i.length>0;){let r=!1,s=[],a;for(a=0;a<i.length;a++)if(this.rules.other.blockquoteStart.test(i[a]))s.push(i[a]),r=!0;else if(!r)s.push(i[a]);else break;i=i.slice(a);let Q=s.join(`
`),c=Q.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
${Q}`:Q,n=n?`${n}
${c}`:c;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,g,!0),this.lexer.state.top=f,i.length===0)break;let m=g.at(-1);if(m?.type==="code")break;if(m?.type==="blockquote"){let p=m,M=p.raw+`
`+i.join(`
`),K=this.blockquote(M);g[g.length-1]=K,o=o.substring(0,o.length-p.raw.length)+K.raw,n=n.substring(0,n.length-p.text.length)+K.text;break}else if(m?.type==="list"){let p=m,M=p.raw+`
`+i.join(`
`),K=this.list(M);g[g.length-1]=K,o=o.substring(0,o.length-m.raw.length)+K.raw,n=n.substring(0,n.length-p.raw.length)+K.raw,i=M.substring(g.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:o,tokens:g,text:n}}}list(e){let A=this.rules.block.list.exec(e);if(A){let i=A[1].trim(),o=i.length>1,n={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let g=this.rules.other.listItemRegex(i),r=!1;for(;e;){let a=!1,Q="",c="";if(!(A=g.exec(e))||this.rules.block.hr.test(e))break;Q=A[0],e=e.substring(Q.length);let f=A[2].split(`
`,1)[0].replace(this.rules.other.listReplaceTabs,DA=>" ".repeat(3*DA.length)),m=e.split(`
`,1)[0],p=!f.trim(),M=0;if(this.options.pedantic?(M=2,c=f.trimStart()):p?M=A[1].length+1:(M=A[2].search(this.rules.other.nonSpaceChar),M=M>4?1:M,c=f.slice(M),M+=A[1].length),p&&this.rules.other.blankLine.test(m)&&(Q+=m+`
`,e=e.substring(m.length+1),a=!0),!a){let DA=this.rules.other.nextBulletRegex(M),YA=this.rules.other.hrRegex(M),wA=this.rules.other.fencesBeginRegex(M),yt=this.rules.other.headingBeginRegex(M),we=this.rules.other.htmlBeginRegex(M);for(;e;){let Fe=e.split(`
`,1)[0],he;if(m=Fe,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),he=m):he=m.replace(this.rules.other.tabCharGlobal," "),wA.test(m)||yt.test(m)||we.test(m)||DA.test(m)||YA.test(m))break;if(he.search(this.rules.other.nonSpaceChar)>=M||!m.trim())c+=`
`+he.slice(M);else{if(p||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||wA.test(f)||yt.test(f)||YA.test(f))break;c+=`
`+m}!p&&!m.trim()&&(p=!0),Q+=Fe+`
`,e=e.substring(Fe.length+1),f=he.slice(M)}}n.loose||(r?n.loose=!0:this.rules.other.doubleBlankLine.test(Q)&&(r=!0));let K=null,W;this.options.gfm&&(K=this.rules.other.listIsTask.exec(c),K&&(W=K[0]!=="[ ] ",c=c.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:Q,task:!!K,checked:W,loose:!1,text:c,tokens:[]}),n.raw+=Q}let s=n.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let a=0;a<n.items.length;a++)if(this.lexer.state.top=!1,n.items[a].tokens=this.lexer.blockTokens(n.items[a].text,[]),!n.loose){let Q=n.items[a].tokens.filter(f=>f.type==="space"),c=Q.length>0&&Q.some(f=>this.rules.other.anyLine.test(f.raw));n.loose=c}if(n.loose)for(let a=0;a<n.items.length;a++)n.items[a].loose=!0;return n}}html(e){let A=this.rules.block.html.exec(e);if(A)return{type:"html",block:!0,raw:A[0],pre:A[1]==="pre"||A[1]==="script"||A[1]==="style",text:A[0]}}def(e){let A=this.rules.block.def.exec(e);if(A){let i=A[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=A[2]?A[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=A[3]?A[3].substring(1,A[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):A[3];return{type:"def",tag:i,raw:A[0],href:o,title:n}}}table(e){let A=this.rules.block.table.exec(e);if(!A||!this.rules.other.tableDelimiter.test(A[2]))return;let i=kF(A[1]),o=A[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=A[3]?.trim()?A[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],g={type:"table",raw:A[0],header:[],align:[],rows:[]};if(i.length===o.length){for(let r of o)this.rules.other.tableAlignRight.test(r)?g.align.push("right"):this.rules.other.tableAlignCenter.test(r)?g.align.push("center"):this.rules.other.tableAlignLeft.test(r)?g.align.push("left"):g.align.push(null);for(let r=0;r<i.length;r++)g.header.push({text:i[r],tokens:this.lexer.inline(i[r]),header:!0,align:g.align[r]});for(let r of n)g.rows.push(kF(r,g.header.length).map((s,a)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:g.align[a]})));return g}}lheading(e){let A=this.rules.block.lheading.exec(e);if(A)return{type:"heading",raw:A[0],depth:A[2].charAt(0)==="="?1:2,text:A[1],tokens:this.lexer.inline(A[1])}}paragraph(e){let A=this.rules.block.paragraph.exec(e);if(A){let i=A[1].charAt(A[1].length-1)===`
`?A[1].slice(0,-1):A[1];return{type:"paragraph",raw:A[0],text:i,tokens:this.lexer.inline(i)}}}text(e){let A=this.rules.block.text.exec(e);if(A)return{type:"text",raw:A[0],text:A[0],tokens:this.lexer.inline(A[0])}}escape(e){let A=this.rules.inline.escape.exec(e);if(A)return{type:"escape",raw:A[0],text:A[1]}}tag(e){let A=this.rules.inline.tag.exec(e);if(A)return!this.lexer.state.inLink&&this.rules.other.startATag.test(A[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(A[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(A[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(A[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:A[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:A[0]}}link(e){let A=this.rules.inline.link.exec(e);if(A){let i=A[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let g=_I(i.slice(0,-1),"\\");if((i.length-g.length)%2===0)return}else{let g=$1(A[2],"()");if(g===-2)return;if(g>-1){let s=(A[0].indexOf("!")===0?5:4)+A[1].length+g;A[2]=A[2].substring(0,g),A[0]=A[0].substring(0,s).trim(),A[3]=""}}let o=A[2],n="";if(this.options.pedantic){let g=this.rules.other.pedanticHrefTitle.exec(o);g&&(o=g[1],n=g[3])}else n=A[3]?A[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?o=o.slice(1):o=o.slice(1,-1)),bF(A,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},A[0],this.lexer,this.rules)}}reflink(e,A){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let o=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=A[o.toLowerCase()];if(!n){let g=i[0].charAt(0);return{type:"text",raw:g,text:g}}return bF(i,n,i[0],this.lexer,this.rules)}}emStrong(e,A,i=""){let o=this.rules.inline.emStrongLDelim.exec(e);if(!o||o[3]&&i.match(this.rules.other.unicodeAlphaNumeric))return;if(!(o[1]||o[2]||"")||!i||this.rules.inline.punctuation.exec(i)){let g=[...o[0]].length-1,r,s,a=g,Q=0,c=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,A=A.slice(-1*e.length+g);(o=c.exec(A))!=null;){if(r=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!r)continue;if(s=[...r].length,o[3]||o[4]){a+=s;continue}else if((o[5]||o[6])&&g%3&&!((g+s)%3)){Q+=s;continue}if(a-=s,a>0)continue;s=Math.min(s,s+a+Q);let f=[...o[0]][0].length,m=e.slice(0,g+o.index+f+s);if(Math.min(g,s)%2){let M=m.slice(1,-1);return{type:"em",raw:m,text:M,tokens:this.lexer.inlineTokens(M)}}let p=m.slice(2,-2);return{type:"strong",raw:m,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let A=this.rules.inline.code.exec(e);if(A){let i=A[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(i),n=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return o&&n&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:A[0],text:i}}}br(e){let A=this.rules.inline.br.exec(e);if(A)return{type:"br",raw:A[0]}}del(e){let A=this.rules.inline.del.exec(e);if(A)return{type:"del",raw:A[0],text:A[2],tokens:this.lexer.inlineTokens(A[2])}}autolink(e){let A=this.rules.inline.autolink.exec(e);if(A){let i,o;return A[2]==="@"?(i=A[1],o="mailto:"+i):(i=A[1],o=i),{type:"link",raw:A[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(e){let A;if(A=this.rules.inline.url.exec(e)){let i,o;if(A[2]==="@")i=A[0],o="mailto:"+i;else{let n;do n=A[0],A[0]=this.rules.inline._backpedal.exec(A[0])?.[0]??"";while(n!==A[0]);i=A[0],A[1]==="www."?o="http://"+A[0]:o=A[0]}return{type:"link",raw:A[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let A=this.rules.inline.text.exec(e);if(A){let i=this.lexer.state.inRawBlock;return{type:"text",raw:A[0],text:A[0],escaped:i}}}},Ui=class t{tokens;options;state;tokenizer;inlineQueue;constructor(e){th
`),this.blockTokens(e,this.tokens);for(let A=0;A<this.inlineQueue.length;A++){let i=this.inlineQueue[A];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,A=[],i=!1){for(this.options.pedantic&&(e=e.replace(wt.tabCharGlobal," ").replace(wt.spaceLine,""));e;){let o;if(this.options.extensions?.block?.some(g=>(o=g.call({lexer:this},e,A))?(e=e.substring(o.raw.length),A.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let g=A.at(-1);o.raw.length===1&&g!==void 0?g.raw+=`
`:A.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let g=A.at(-1);g?.type==="paragraph"||g?.type==="text"?(g.raw+=`
2025-05-05 17:07:14 -07:00
`+o.raw,g.text+=`
`+o.text,this.inlineQueue.at(-1).src=g.text):A.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),A.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),A.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),A.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),A.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),A.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),A.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);let g=A.at(-1);g?.type==="paragraph"||g?.type==="text"?(g.raw+=`
2025-05-05 17:07:14 -07:00
`+o.raw,g.text+=`
`+o.raw,this.inlineQueue.at(-1).src=g.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),A.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),A.push(o);continue}let n=e;if(this.options.extensions?.startBlock){let g=1/0,r=e.slice(1),s;this.options.extensions.startBlock.forEach(a=>{s=a.call({lexer:this},r),typeof s=="number"&&s>=0&&(g=Math.min(g,s))}),g<1/0&&g>=0&&(n=e.substring(0,g+1))}if(this.state.top&&(o=this.tokenizer.paragraph(n))){let g=A.at(-1);i&&g?.type==="paragraph"?(g.raw+=`
2025-05-05 17:07:14 -07:00
`+o.raw,g.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):A.push(o),i=n.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let g=A.at(-1);g?.type==="text"?(g.raw+=`
2025-05-05 17:07:14 -07:00
`+o.raw,g.text+=`
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):A.push(o);continue}if(e){let g="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return this.state.top=!0,A}inline(e,A=[]){return this.inlineQueue.push({src:e,tokens:A}),A}inlineTokens(e,A=[]){let i=e,o=null;if(this.tokens.links){let r=Object.keys(this.tokens.links);if(r.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)r.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let n=!1,g="";for(;e;){n||(g=""),n=!1;let r;if(this.options.extensions?.inline?.some(a=>(r=a.call({lexer:this},e,A))?(e=e.substring(r.raw.length),A.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),A.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),A.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),A.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let a=A.at(-1);r.type==="text"&&a?.type==="text"?(a.raw+=r.raw,a.text+=r.text):A.push(r);continue}if(r=this.tokenizer.emStrong(e,i,g)){e=e.substring(r.raw.length),A.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),A.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),A.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),A.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),A.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),A.push(r);continue}let s=e;if(this.options.extensions?.startInline){let a=1/0,Q=e.slice(1),c;this.options.extensions.startInline.forEach(f=>{c=f.call({lexer:this},Q),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(s=e.substring(0,a+1))}if(r=this.tokenizer.inlineText(s)){e=e.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(g=r.raw.slice(-1)),n=!0;let a=A.at(-1);a?.type==="text"?(a.raw+=r.raw,a.text+=r.text):A.push(r);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return A}},Ro=class{options;parser;constructor(e){this.options=e||Jg}space(e){return""}code({text:e,lang:A,escaped:i}){let o=(A||"").match(wt.notSpaceStart)?.[0],n=e.replace(wt.endingNewline,"")+`
`;return o?'<pre><code class="language-'+Mo(o)+'">'+(i?n:Mo(n,!0))+`</code></pre>
`:"<pre><code>"+(i?n:Mo(n,!0))+`</code></pre>
2025-05-05 17:07:14 -07:00
`}blockquote({tokens:e}){return`<blockquote>
${this.parser.parse(e)}</blockquote>
`}html({text:e}){return e}heading({tokens:e,depth:A}){return`<h${A}>${this.parser.parseInline(e)}</h${A}>
2025-05-05 17:07:14 -07:00
`}hr(e){return`<hr>
`}list(e){let A=e.ordered,i=e.start,o="";for(let r=0;r<e.items.length;r++){let s=e.items[r];o+=this.listitem(s)}let n=A?"ol":"ul",g=A&&i!==1?' start="'+i+'"':"";return"<"+n+g+`>
`+o+"</"+n+`>
`}listitem(e){let A="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+Mo(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):A+=i+" "}return A+=this.parser.parse(e.tokens,!!e.loose),`<li>${A}</li>
2025-05-05 17:07:14 -07:00
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
`}table(e){let A="",i="";for(let n=0;n<e.header.length;n++)i+=this.tablecell(e.header[n]);A+=this.tablerow({text:i});let o="";for(let n=0;n<e.rows.length;n++){let g=e.rows[n];i="";for(let r=0;r<g.length;r++)i+=this.tablecell(g[r]);o+=this.tablerow({text:i})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
2025-05-05 17:07:14 -07:00
<thead>
`+A+`</thead>
`+o+`</table>
2025-05-05 17:07:14 -07:00
`}tablerow({text:e}){return`<tr>
${e}</tr>
`}tablecell(e){let A=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+A+`</${i}>
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Mo(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:A,tokens:i}){let o=this.parser.parseInline(i),n=RF(e);if(n===null)return o;e=n;let g='<a href="'+e+'"';return A&&(g+=' title="'+Mo(A)+'"'),g+=">"+o+"</a>",g}image({href:e,title:A,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let n=RF(e);if(n===null)return Mo(i);e=n;let g=`<img src="${e}" alt="${i}"`;return A&&(g+=` title="${Mo(A)}"`),g+=">",g}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Mo(e.text)}},UI=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},xi=class t{options;renderer;textRenderer;constructor(e){this.options=e||Jg,this.options.renderer=this.options.renderer||new Ro,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new UI}static parse(e,A){return new t(A).parse(e)}static parseInline(e,A){return new t(A).parseInline(e)}parse(e,A=!0){let i="";for(let o=0;o<e.length;o++){let n=e[o];if(this.options.extensions?.renderers?.[n.type]){let r=n,s=this.options.extensions.renderers[r.type].call({parser:this},r);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(r.type)){i+=s||"";continue}}let g=n;switch(g.type){case"space":{i+=this.renderer.space(g);continue}case"hr":{i+=this.renderer.hr(g);continue}case"heading":{i+=this.renderer.heading(g);continue}case"code":{i+=this.renderer.code(g);continue}case"table":{i+=this.renderer.table(g);continue}case"blockquote":{i+=this.renderer.blockquote(g);continue}case"list":{i+=this.renderer.list(g);continue}case"html":{i+=this.renderer.html(g);continue}case"paragraph":{i+=this.renderer.paragraph(g);continue}case"text":{let r=g,s=this.renderer.text(r);for(;o+1<e.length&&e[o+1].type==="text";)r=e[++o],s+=`
`+this.renderer.text(r);A?i+=this.renderer.paragraph({type:"paragraph",raw:s,text:s,tokens:[{type:"text",raw:s,text:s,escaped:!0}]}):i+=s;continue}default:{let r='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(r),"";throw new Error(r)}}}return i}parseInline(e,A=this.renderer){let i="";for(let o=0;o<e.length;o++){let n=e[o];if(this.options.extensions?.renderers?.[n.type]){let r=this.options.extensions.renderers[n.type].call({parser:this},n);if(r!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){i+=r||"";continue}}let g=n;switch(g.type){case"escape":{i+=A.text(g);break}case"html":{i+=A.html(g);break}case"link":{i+=A.link(g);break}case"image":{i+=A.image(g);break}case"strong":{i+=A.strong(g);break}case"em":{i+=A.em(g);break}case"codespan":{i+=A.codespan(g);break}case"br":{i+=A.br(g);break}case"del":{i+=A.del(g);break}case"text":{i+=A.text(g);break}default:{let r='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(r),"";throw new Error(r)}}}return i}},fs=class{options;block;constructor(e){this.options=e||Jg}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Ui.lex:Ui.lexInline}provideParser(){return this.block?xi.parse:xi.parseInline}},DD=class{defaults=fD();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=xi;Renderer=Ro;TextRenderer=UI;Lexer=Ui;Tokenizer=ps;Hooks=fs;constructor(...e){this.use(...e)}walkTokens(e,A){let i=[];for(let o of e)switch(i=i.concat(A.call(this,o)),o.type){case"table":{let n=o;for(let g of n.header)i=i.concat(this.walkTokens(g.tokens,A));for(let g of n.rows)for(let r of g)i=i.concat(this.walkTokens(r.tokens,A));break}case"list":{let n=o;i=i.concat(this.walkTokens(n.items,A));break}default:{let n=o;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(g=>{let r=n[g].flat(1/0);i=i.concat(this.walkTokens(r,A))}):n.tokens&&(i=i.concat(this.walkTokens(n.tokens,A)))}}return i}use(...e){let A=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{let o=b({},i);if(o.async=this.defaults.async||o.async||!1,i.extensions&&(i.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let g=A.renderers[n.name];g?A.renderers[n.name]=function(...r){let s=n.renderer.apply(this,r);return s===!1&&(s=g.apply(this,r)),s}:A.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let g=A[n.level];g?g.unshift(n.tokenizer):A[n.level]=[n.tokenizer],n.start&&(n.level==="block"?A.startBlock?A.startBlock.push(n.start):A.startBlock=[n.start]:n.level==="inline"&&(A.startInline?A.startInline.push(n.start):A.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(A.childTokens[n.name]=n.childTokens)}),o.extensions=A),i.renderer){let n=this.defaults.renderer||new Ro(this.defaults);for(let g in i.renderer){if(!(g in n))throw new Error(`renderer '${g}' does not exist`);if(["options","parser"].includes(g))continue;let r=g,s=i.renderer[r],a=n[r];n[r]=(...Q)=>{let c=s.apply(n,Q);return c===!1&&(c=a.apply(n,Q)),c||""}}o.renderer=n}if(i.tokenizer){let n=this.defaults.tokenizer||new ps(this.defaults);for(let g in i.tokenizer){if(!(g in n))throw new Error(`tokenizer '${g}' does not exist`);if(["options","rules","lexer"].includes(g))continue;let r=g,s=i.tokenizer[r],a=n[r];n[r]=(...Q)=>{let c=s.apply(n,Q);return c===!1&&(c=a.apply(n,Q)),c}}o.tokenizer=n}if(i.hooks){let n=this.defaults.hooks||new fs;for(let g in i.hooks){if(!(g in n))throw new Error(`hook '${g}' does not exist`);if(["options","block"].includes(g))continue;let r=g,s=i.hooks[r],a=n[r];fs.passThroughHooks.has(g)?n[r]=Q=>{if(this.defaults.async)return Promise.resolve(s.call(n,Q)).then(f=>a.call(n,f));let c=s.call(n,Q);return a.call(n,c)}:n[r]=(...Q)=>{let c=s.
Please report this to https://github.com/markedjs/marked.`,e){let o="<p>An error occurred:</p><pre>"+Mo(i.message+"",!0)+"</pre>";return A?Promise.resolve(o):o}if(A)return Promise.reject(i);throw i}}},Yg=new DD;function ee(t,e){return Yg.parse(t,e)}ee.options=ee.setOptions=function(t){return Yg.setOptions(t),ee.defaults=Yg.defaults,FF(ee.defaults),ee};ee.getDefaults=fD;ee.defaults=Jg;ee.use=function(...t){return Yg.use(...t),ee.defaults=Yg.defaults,FF(ee.defaults),ee};ee.walkTokens=function(t,e){return Yg.walkTokens(t,e)};ee.parseInline=Yg.parseInline;ee.Parser=xi;ee.parser=xi.parse;ee.Renderer=Ro;ee.TextRenderer=UI;ee.Lexer=Ui;ee.lexer=Ui.lex;ee.Tokenizer=ps;ee.Hooks=fs;ee.parse=ee;var DCA=ee.options,fCA=ee.setOptions,pCA=ee.use,wCA=ee.walkTokens,yCA=ee.parseInline;var MCA=xi.parse,RCA=Ui.lex;var eZ=["*"],tZ="Copy",iZ="Copied",oZ=(()=>{class t{constructor(){this._buttonClick$=new U,this.copied$=this._buttonClick$.pipe(Ie(()=>ye(iA(!0),Vn(3e3).pipe(nr(!1)))),wi(),Go(1)),this.copiedText$=this.copied$.pipe(Me(!1),sA(A=>A?iZ:tZ))}onCopyToClipboardClick(){this._buttonClick$.next()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=O({type:t,selectors:[["markdown-clipboard"]],decls:4,vars:7,consts:[[1,"markdown-clipboard-button",3,"click"]],template:function(i,o){i&1&&(d(0,"button",0),To(1,"async"),G("click",function(){return o.onCopyToClipboardClick()}),k(2),To(3,"async"),h()),i&2&&(nA("copied",br(1,3,o.copied$)),D(2),KA(br(3,5,o.copiedText$)))},dependencies:[wa],encapsulation:2,changeDetection:0})}}return t})(),nZ=new F("CLIPBOARD_OPTIONS");var FD=function(t){return t.CommandLine="command-line",t.LineHighlight="line-highlight",t.LineNumbers="line-numbers",t}(FD||{}),JF=new F("MARKED_EXTENSIONS"),gZ=new F("MARKED_OPTIONS"),rZ=new F("MERMAID_OPTIONS"),sZ="[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information",aZ="[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information",IZ="[ngx-markdown] When using the `mermaid` attribute you *have to* include Mermaid files to `angular.json` or use imports. See README for more information",CZ="[ngx-markdown] When using the `clipboard` attribute you *have to* include Clipboard files to `angular.json` or use imports. See README for more information",BZ="[ngx-markdown] When using the `clipboard` attribute you *have to* provide the `viewContainerRef` parameter to `MarkdownService.render()` function",QZ="[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information",HF=new F("SECURITY_CONTEXT");var TF=(()=>{class t{get options(){return this._options}set options(A){this._options=b(b({},this.DEFAULT_MARKED_OPTIONS),A)}get renderer(){return this.options.renderer}set renderer(A){this.options.renderer=A}constructor(A,i,o,n,g,r,s,a){this.clipboardOptions=A,this.extensions=i,this.mermaidOptions=n,this.platform=g,this.securityContext=r,this.http=s,this.sanitizer=a,this.DEFAULT_MARKED_OPTIONS={renderer:new Ro},this.DEFAULT_KATEX_OPTIONS={delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}]},this.DEFAULT_MERMAID_OPTIONS={startOnLoad:!1},this.DEFAULT_CLIPBOARD_OPTIONS={buttonComponent:void 0},this.DEFAULT_PARSE_OPTIONS={decodeHtml:!1,inline:!1,emoji:!1,mermaid:!1,markedOptions:void 0,disableSanitizer:!1},this.DEFAULT_RENDER_OPTIONS={clipboard:!1,clipboardOptions:void 0,katex:!1,katexOptions:void 0,mermaid:!1,mermaidOptions:void 0},this._reload$=new U,this.reload$=this._reload$.asObservable(),this.options=o}parse(A,i=this.DEFAUL
`+i+"\n```":i}parseMarked(A,i,o=!1){if(i.renderer){let n=b({},i.renderer);delete n.\u0275NgxMarkdownRendererExtendedForExtensions,delete n.\u0275NgxMarkdownRendererExtendedForMermaid,delete i.renderer,ee.use({renderer:n})}return o?ee.parseInline(A,i):ee.parse(A,i)}parseEmoji(A){if(!go(this.platform))return A;if(typeof joypixels>"u"||typeof joypixels.shortnameToUnicode>"u")throw new Error(sZ);return joypixels.shortnameToUnicode(A)}renderKatex(A,i){if(go(this.platform)){if(typeof katex>"u"||typeof renderMathInElement>"u")throw new Error(aZ);renderMathInElement(A,i)}}renderClipboard(A,i,o){if(!go(this.platform))return;if(typeof ClipboardJS>"u")throw new Error(CZ);if(!i)throw new Error(BZ);let{buttonComponent:n,buttonTemplate:g}=o,r=A.querySelectorAll("pre");for(let s=0;s<r.length;s++){let a=r.item(s),Q=document.createElement("div");Q.style.position="relative",a.parentNode.insertBefore(Q,a),Q.appendChild(a);let c=document.createElement("div");c.classList.add("markdown-clipboard-toolbar"),c.style.position="absolute",c.style.top=".5em",c.style.right=".5em",c.style.zIndex="1",Q.insertAdjacentElement("beforeend",c),Q.onmouseenter=()=>c.classList.add("hover"),Q.onmouseleave=()=>c.classList.remove("hover");let f;if(n){let p=i.createComponent(n);f=p.hostView,p.changeDetectorRef.markForCheck()}else if(g)f=i.createEmbeddedView(g);else{let p=i.createComponent(oZ);f=p.hostView,p.changeDetectorRef.markForCheck()}let m;f.rootNodes.forEach(p=>{c.appendChild(p),m=new ClipboardJS(p,{text:()=>a.innerText})}),f.onDestroy(()=>m.destroy())}}renderMermaid(A,i=this.DEFAULT_MERMAID_OPTIONS){if(!go(this.platform))return;if(typeof mermaid>"u"||typeof mermaid.initialize>"u")throw new Error(IZ);let o=A.querySelectorAll(".mermaid");o.length!==0&&(mermaid.initialize(i),mermaid.run({nodes:o}))}trimIndentation(A){if(!A)return"";let i;return A.split(`
2025-05-05 17:07:14 -07:00
`).map(o=>{let n=i;return o.length>0&&(n=isNaN(n)?o.search(/\S|$/):Math.min(o.search(/\S|$/),n)),isNaN(i)&&(i=n),n?o.substring(n):o}).join(`
`)}static{this.\u0275fac=function(i){return new(i||t)(Z(nZ,8),Z(JF,8),Z(gZ,8),Z(rZ,8),Z(si),Z(HF),Z(Qt,8),Z(Vo))}}static{this.\u0275prov=v({token:t,factory:t.\u0275fac})}}return t})(),OF=(()=>{class t{get disableSanitizer(){return this._disableSanitizer}set disableSanitizer(A){this._disableSanitizer=this.coerceBooleanProperty(A)}get inline(){return this._inline}set inline(A){this._inline=this.coerceBooleanProperty(A)}get clipboard(){return this._clipboard}set clipboard(A){this._clipboard=this.coerceBooleanProperty(A)}get emoji(){return this._emoji}set emoji(A){this._emoji=this.coerceBooleanProperty(A)}get katex(){return this._katex}set katex(A){this._katex=this.coerceBooleanProperty(A)}get mermaid(){return this._mermaid}set mermaid(A){this._mermaid=this.coerceBooleanProperty(A)}get lineHighlight(){return this._lineHighlight}set lineHighlight(A){this._lineHighlight=this.coerceBooleanProperty(A)}get lineNumbers(){return this._lineNumbers}set lineNumbers(A){this._lineNumbers=this.coerceBooleanProperty(A)}get commandLine(){return this._commandLine}set commandLine(A){this._commandLine=this.coerceBooleanProperty(A)}constructor(A,i,o){this.element=A,this.markdownService=i,this.viewContainerRef=o,this.error=new z,this.load=new z,this.ready=new z,this._clipboard=!1,this._commandLine=!1,this._disableSanitizer=!1,this._emoji=!1,this._inline=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1,this._mermaid=!1,this.destroyed$=new U}ngOnChanges(){this.loadContent()}loadContent(){if(this.data!=null){this.handleData();return}if(this.src!=null){this.handleSrc();return}}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion(),this.markdownService.reload$.pipe(pA(this.destroyed$)).subscribe(()=>this.loadContent())}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}render(A,i=!1){return $e(this,null,function*(){let o={decodeHtml:i,inline:this.inline,emoji:this.emoji,mermaid:this.mermaid,disableSanitizer:this.disableSanitizer},n={clipboard:this.clipboard,clipboardOptions:this.getClipboardOptions(),katex:this.katex,katexOptions:this.katexOptions,mermaid:this.mermaid,mermaidOptions:this.mermaidOptions},g=yield this.markdownService.parse(A,o);this.element.nativeElement.innerHTML=g,this.handlePlugins(),this.markdownService.render(this.element.nativeElement,n,this.viewContainerRef),this.ready.emit()})}coerceBooleanProperty(A){return A!=null&&`${String(A)}`!="false"}getClipboardOptions(){if(this.clipboardButtonComponent||this.clipboardButtonTemplate)return{buttonComponent:this.clipboardButtonComponent,buttonTemplate:this.clipboardButtonTemplate}}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe({next:A=>{this.render(A).then(()=>{this.load.emit(A)})},error:A=>this.error.emit(A)})}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.commandLine&&(this.setPluginClass(this.element.nativeElement,FD.CommandLine),this.setPluginOptions(this.element.nativeElement,{dataFilterOutput:this.filterOutput,dataHost:this.host,dataPrompt:this.prompt,dataOutput:this.output,dataUser:this.user})),this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,FD.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(A,i){let o=A.querySelectorAll("pre");for(let n=0;n<o.length;n++){let g=i instanceof Array?i:[i];o.item(n).classList.add(...g)}}setPluginOptions(A,i){let o=A.querySelectorAll("pre");for(let n=0;n<o.length;n++)Object.keys(i).forEach(g=>{let r=i[g];if(r){let s=this.toLispCase(g);o.item(n).setAttribute(s,r.toString())}})}toLispCase(A){let i=A.match(/([A-Z])/g);if(!i)return A;let o=A.toString();for(let n=0,g=i.length;n<g;n++)o=o.replace(new RegExp(i[n]),"-"+i[n].toLowerCase());return o.slice(0,1)==="-"&&(o=o.slice(1)),o}static{this.\u0275fac=function(i){return new(i||t)(V(q),V(TF),V(Qe))}}static{this.\u0275cmp=O({type:t,selectors:[["markdown"],["","markdown",""]],inputs:{
`+i;this.openSnackBar(o,"OK")}),new URL(window.location.href).searchParams.has("code")){let i=window.location.href;window.opener?.postMessage({authResponseUrl:i},window.origin),window.close()}this.agentService.getApp().subscribe(i=>{this.appName=i}),mt([this.agentService.getLoadingState(),this.isModelThinkingSubject]).subscribe(([i,o])=>{let n=this.messages[this.messages.length-1];i&&!n?.isLoading?(this.messages.push({role:"bot",isLoading:!0}),this.messagesSubject.next(this.messages)):n?.isLoading&&!o&&(this.messages.pop(),this.messagesSubject.next(this.messages))}),mt([this.messagesSubject,this.scrollInterruptedSubject,this.streamingTextMessageSubject]).subscribe(([i,o,n])=>{o||setTimeout(()=>{this.scrollToBottom()},100)})}ngAfterViewInit(){this.showSidePanel=!0,this.sideDrawer.open()}scrollToBottom(){setTimeout(()=>{this.scrollContainer.nativeElement.scrollTo({top:this.scrollContainer.nativeElement.scrollHeight,behavior:"smooth"})})}selectApp(e){e!=this.appName&&(this.agentService.setApp(e),this.createSession(),this.eventData=new Map,this.eventMessageIndexArray=[],this.messages=[],this.artifacts=[],this.userInput="",this.longRunningEvents=[])}createSession(){this.sessionService.createSession(this.userId,this.appName).subscribe(e=>{this.currentSessionState=e.state,this.sessionId=e.id,this.sessionTab.refreshSession()})}sendMessage(e){return $e(this,null,function*(){if(this.messages.length===0&&(this.scrollContainer.nativeElement.addEventListener("wheel",()=>{this.scrollInterruptedSubject.next(!0)}),this.scrollContainer.nativeElement.addEventListener("touchmove",()=>{this.scrollInterruptedSubject.next(!0)})),this.scrollInterruptedSubject.next(!1),e.preventDefault(),!this.userInput.trim())return;if(this.messages.push({role:"user",text:this.userInput}),this.messagesSubject.next(this.messages),this.selectedFiles.length>0){let o=this.selectedFiles.map(n=>({file:n.file,url:n.url}));this.messages.push({role:"user",attachments:o}),this.messagesSubject.next(this.messages)}let A={appName:this.appName,userId:this.userId,sessionId:this.sessionId,newMessage:{role:"user",parts:yield this.getUserMessageParts()},streaming:this.useSse};this.selectedFiles=[];let i=this.eventMessageIndexArray.length-1;this.streamingTextMessage=null,this.agentService.runSse(A).subscribe({next:o=>$e(this,null,function*(){if(o.startsWith('{"error"')){this.openSnackBar(o,"OK");return}let n=JSON.parse(o);if(n.error){this.openSnackBar(n.error,"OK");return}if(n.content)for(let g of n.content.parts)i+=1,this.processPart(n,g,i)}),error:o=>console.error("SSE error:",o),complete:()=>{this.streamingTextMessage=null,this.sessionTab.reloadSession(this.sessionId),this.eventService.getTrace(this.sessionId).pipe(Oe(o=>o.status===404?iA(null):iA([]))).subscribe(o=>{this.traceData=o})}}),this.userInput=""})}processPart(e,A,i){let o=e.groundingMetadata?.searchEntryPoint?.renderedContent;if(A.text){this.isModelThinkingSubject.next(!1),this.agentService.getLoadingState().next(!1);let n=A.text;if(A.thought)n!==this.latestThought&&(this.storeEvents(A,e,i),this.storeMessage(A,e,i)),this.latestThought=n;else if(this.streamingTextMessage){if(o&&(this.streamingTextMessage.renderedContent=e.groundingMetadata.searchEntryPoint.renderedContent),n==this.streamingTextMessage.text){this.storeEvents(A,e,i),this.eventMessageIndexArray[i]=n,this.streamingTextMessage=null;return}this.streamingTextMessage.text+=n,this.streamingTextMessageSubject.next(this.streamingTextMessage)}else if(this.streamingTextMessage={role:"bot",text:this.processThoughtText(n),thought:!!A.thought,eventId:e.id},o&&(this.streamingTextMessage.renderedContent=e.groundingMetadata.searchEntryPoint.renderedContent),this.messages.push(this.streamingTextMessage),this.messagesSubject.next(this.messages),!this.useSse){this.storeEvents(A,e,i),this.eventMessageIndexArray[i]=n,this.streamingTextMessage=null;return}}else A.thought?this.isModelThinkingSubject.next(!0):(this.isModelThinkingSubject.next(!1),this.agentService.getLoadingState().next(!1),this.storeEvents(A,e,i),this.storeMessage(A,e,i))}getUserMessageParts(){return $e(thi