multimodalsim-viewer 0.1.0.1__py3-none-any.whl → 0.1.0.2__py3-none-any.whl
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.
- multimodalsim_viewer/server/data_manager.py +3 -3
- multimodalsim_viewer/ui/static/index.html +1 -1
- multimodalsim_viewer/ui/static/{main-7DV4COXP.js → main-AA2XDGWI.js} +1 -1
- {multimodalsim_viewer-0.1.0.1.dist-info → multimodalsim_viewer-0.1.0.2.dist-info}/METADATA +1 -1
- {multimodalsim_viewer-0.1.0.1.dist-info → multimodalsim_viewer-0.1.0.2.dist-info}/RECORD +8 -8
- {multimodalsim_viewer-0.1.0.1.dist-info → multimodalsim_viewer-0.1.0.2.dist-info}/WHEEL +0 -0
- {multimodalsim_viewer-0.1.0.1.dist-info → multimodalsim_viewer-0.1.0.2.dist-info}/entry_points.txt +0 -0
- {multimodalsim_viewer-0.1.0.1.dist-info → multimodalsim_viewer-0.1.0.2.dist-info}/top_level.txt +0 -0
@@ -1694,7 +1694,7 @@ void main(void)
|
|
1694
1694
|
gl_Position = filterVertexPosition();
|
1695
1695
|
vTextureCoord = filterTextureCoord();
|
1696
1696
|
}
|
1697
|
-
`;var YL=n$,n0=a$;var a0=class{constructor(e){this.renderer=e}contextChange(e){let t;if(this.renderer.context.webGLVersion===1){let r=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,r)}else{let r=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,r)}t>=_r.HIGH?this.multisample=_r.HIGH:t>=_r.MEDIUM?this.multisample=_r.MEDIUM:t>=_r.LOW?this.multisample=_r.LOW:this.multisample=_r.NONE}destroy(){}};a0.extension={type:Xe.RendererSystem,name:"_multisample"};nt.add(a0);var qC=class{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}};var o0=class{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){let{gl:t,CONTEXT_UID:r}=this,n=e._glBuffers[r]||this.createGLBuffer(e);t.bindBuffer(e.type,n.buffer)}unbind(e){let{gl:t}=this;t.bindBuffer(e,null)}bindBufferBase(e,t){let{gl:r,CONTEXT_UID:n}=this;if(this.boundBufferBases[t]!==e){let a=e._glBuffers[n]||this.createGLBuffer(e);this.boundBufferBases[t]=e,r.bindBufferBase(r.UNIFORM_BUFFER,t,a.buffer)}}bindBufferRange(e,t,r){let{gl:n,CONTEXT_UID:a}=this;r=r||0;let o=e._glBuffers[a]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,t||0,o.buffer,r*256,256)}update(e){let{gl:t,CONTEXT_UID:r}=this,n=e._glBuffers[r]||this.createGLBuffer(e);if(e._updateID!==n.updateID)if(n.updateID=e._updateID,t.bindBuffer(e.type,n.buffer),n.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{let a=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,a)}}dispose(e,t){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];let r=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),r&&(t||n.deleteBuffer(r.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){let t=Object.keys(this.managedBuffers);for(let r=0;r<t.length;r++)this.dispose(this.managedBuffers[t[r]],e)}createGLBuffer(e){let{CONTEXT_UID:t,gl:r}=this;return e._glBuffers[t]=new qC(r.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[t]}};o0.extension={type:Xe.RendererSystem,name:"buffer"};nt.add(o0);var s0=class{constructor(e){this.renderer=e}render(e,t){let r=this.renderer,n,a,o,s;if(t&&(n=t.renderTexture,a=t.clear,o=t.transform,s=t.skipUpdateTransform),this.renderingToScreen=!n,r.runners.prerender.emit(),r.emit("prerender"),r.projection.transform=o,!r.context.isLost){if(n||(this.lastObjectRendered=e),!s){let l=e.enableTempParent();e.updateTransform(),e.disableTempParent(l)}r.renderTexture.bind(n),r.batch.currentRenderer.start(),(a??r.background.clearBeforeRender)&&r.renderTexture.clear(),e.render(r),r.batch.currentRenderer.flush(),n&&(t.blit&&r.framebuffer.blit(),n.baseTexture.update()),r.runners.postrender.emit(),r.projection.transform=null,r.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}};s0.extension={type:Xe.RendererSystem,name:"objectRenderer"};nt.add(s0);var ZC=class JL extends Kg{constructor(e){super(),this.type=k2.WEBGL,e=Object.assign({},Qe.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new co({projectionMatrix:new Ni},!0);let t={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:JL.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(t),"useContextAlpha"in e&&(yi("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),e.premultipliedAlpha=e.useContextAlpha&&e.useContextAlpha!=="notMultiplied",e.backgroundAlpha=e.useContextAlpha===!1?1:e.backgroundAlpha),this._plugin.rendererPlugins=JL.__plugins,this.options=e,this.startup.run(this.options)}static test(e){return e?.forceCanvas?!1:xC()}render(e,t){this.objectRenderer.render(e,t)}resize(e,t){this._view.resizeView(e,t)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(e=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:e}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(e){this._view.resolution=e,this.runners.resolutionChange.emit(e)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return yi("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return yi("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return yi("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return yi("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(e){yi("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=e}get backgroundAlpha(){return yi("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(e){yi("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=e}get powerPreference(){return yi("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(e,t){return this.textureGenerator.generateTexture(e,t)}};ZC.extension={type:Xe.Renderer,priority:1},ZC.__plugins={},ZC.__systems={};var YC=ZC;nt.handleByMap(Xe.RendererPlugin,YC.__plugins);nt.handleByMap(Xe.RendererSystem,YC.__systems);nt.add(YC);var $h=class extends ss{constructor(e,t){let{width:r,height:n}=t||{};super(r,n),this.items=[],this.itemDirtyIds=[];for(let a=0;a<e;a++){let o=new Jt;this.items.push(o),this.itemDirtyIds.push(-2)}this.length=e,this._load=null,this.baseTexture=null}initFromArray(e,t){for(let r=0;r<this.length;r++)e[r]&&(e[r].castToBaseTexture?this.addBaseTextureAt(e[r].castToBaseTexture(),r):e[r]instanceof ss?this.addResourceAt(e[r],r):this.addResourceAt(wg(e[r],t),r))}dispose(){for(let e=0,t=this.length;e<t;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(e,t){if(!this.items[t])throw new Error(`Index ${t} is out of bounds`);return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[t].setResource(e),this}bind(e){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(e);for(let t=0;t<this.length;t++)this.items[t].parentTextureArray=e,this.items[t].on("update",e.update,e)}unbind(e){super.unbind(e);for(let t=0;t<this.length;t++)this.items[t].parentTextureArray=null,this.items[t].off("update",e.update,e)}load(){if(this._load)return this._load;let e=this.items.map(t=>t.resource).filter(t=>t).map(t=>t.load());return this._load=Promise.all(e).then(()=>{let{realWidth:t,realHeight:r}=this.items[0];return this.resize(t,r),this.update(),Promise.resolve(this)}),this._load}};var l0=class extends $h{constructor(e,t){let{width:r,height:n}=t||{},a,o;Array.isArray(e)?(a=e,o=e.length):o=e,super(o,{width:r,height:n}),a&&this.initFromArray(a,t)}addBaseTextureAt(e,t){if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=ku.TEXTURE_2D_ARRAY}upload(e,t,r){let{length:n,itemDirtyIds:a,items:o}=this,{gl:s}=e;r.dirtyId<0&&s.texImage3D(s.TEXTURE_2D_ARRAY,0,r.internalFormat,this._width,this._height,n,0,t.format,r.type,null);for(let l=0;l<n;l++){let c=o[l];a[l]<c.dirtyId&&(a[l]=c.dirtyId,c.valid&&s.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,l,c.resource.width,c.resource.height,1,t.format,r.type,c.resource.source))}return!0}};var c0=class extends Gn{constructor(e){super(e)}static test(e){let{OffscreenCanvas:t}=globalThis;return t&&e instanceof t?!0:globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement}};var nBe=(()=>{let i=class u0 extends $h{constructor(t,r){let{width:n,height:a,autoLoad:o,linkBaseTexture:s}=r||{};if(t&&t.length!==u0.SIDES)throw new Error(`Invalid length. Got ${t.length}, expected 6`);super(6,{width:n,height:a});for(let l=0;l<u0.SIDES;l++)this.items[l].target=ku.TEXTURE_CUBE_MAP_POSITIVE_X+l;this.linkBaseTexture=s!==!1,t&&this.initFromArray(t,r),o!==!1&&this.load()}bind(t){super.bind(t),t.target=ku.TEXTURE_CUBE_MAP}addBaseTextureAt(t,r,n){if(n===void 0&&(n=this.linkBaseTexture),!this.items[r])throw new Error(`Index ${r} is out of bounds`);if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0)if(t.resource)this.addResourceAt(t.resource,r);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=ku.TEXTURE_CUBE_MAP_POSITIVE_X+r,t.parentTextureArray=this.baseTexture,this.items[r]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[r]=t,this}upload(t,r,n){let a=this.itemDirtyIds;for(let o=0;o<u0.SIDES;o++){let s=this.items[o];(a[o]<s.dirtyId||n.dirtyId<r.dirtyId)&&(s.valid&&s.resource?(s.resource.upload(t,s,n),a[o]=s.dirtyId):a[o]<-1&&(t.gl.texImage2D(s.target,0,n.internalFormat,r.realWidth,r.realHeight,0,r.format,n.type,null),a[o]=-1))}return!0}static test(t){return Array.isArray(t)&&t.length===u0.SIDES}};return i.SIDES=6,i})(),$L=nBe;var h0=class i extends Gn{constructor(e,t){t=t||{};let r,n,a;typeof e=="string"?(r=i.EMPTY,n=e,a=!0):(r=e,n=null,a=!1),super(r),this.url=n,this.crossOrigin=t.crossOrigin??!0,this.alphaMode=typeof t.alphaMode=="number"?t.alphaMode:null,this.ownsImageBitmap=t.ownsImageBitmap??a,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise((e,t)=>Ce(this,null,function*(){if(this.url===null){e(this);return}try{let r=yield Qe.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;let n=yield r.blob();if(this.destroyed)return;let a=yield createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===an.UNPACK?"premultiply":"none"});if(this.destroyed){a.close();return}this.source=a,this.update(),e(this)}catch(r){if(this.destroyed)return;t(r),this.onError.emit(r)}})),this._load)}upload(e,t,r){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),super.upload(e,t,r)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return i._EMPTY=i._EMPTY??Qe.ADAPTER.createCanvas(0,0),i._EMPTY}};var XL=class JC extends Gn{constructor(e,t){t=t||{},super(Qe.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.update(),e(this)},JC.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){let e=new Image;Gn.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{this._resolve&&(e.onerror=null,this.onError.emit(t))},e.onload=()=>{if(!this._resolve)return;let t=e.width,r=e.height;if(!t||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=t*this.scale,a=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/r*t,a=this._overrideHeight||this._overrideWidth/t*r),n=Math.round(n),a=Math.round(a);let o=this.source;o.width=n,o.height=a,o._pixiId=`canvas_${_c()}`,o.getContext("2d").drawImage(e,0,0,t,r,0,0,n,a),this._resolve(),this._resolve=null}}static getSize(e){let t=JC.SVG_SIZE.exec(e),r={};return t&&(r[t[1]]=Math.round(parseFloat(t[3])),r[t[5]]=Math.round(parseFloat(t[7]))),r}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,t){return t==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&JC.SVG_XML.test(e)}};XL.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,XL.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var qg=XL;var $C=class extends Gn{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}};var QL=class eI extends Gn{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){let r=document.createElement("video");t.autoLoad!==!1&&r.setAttribute("preload","auto"),t.playsinline!==!1&&(r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline","")),t.muted===!0&&(r.setAttribute("muted",""),r.muted=!0),t.loop===!0&&r.setAttribute("loop",""),t.autoPlay!==!1&&r.setAttribute("autoplay",""),typeof e=="string"&&(e=[e]);let n=e[0].src||e[0];Gn.crossOrigin(r,n,t.crossorigin);for(let a=0;a<e.length;++a){let o=document.createElement("source"),{src:s,mime:l}=e[a];if(s=s||e[a],s.startsWith("data:"))l=s.slice(5,s.indexOf(";"));else if(!s.startsWith("blob:")){let c=s.split("?").shift().toLowerCase(),u=c.slice(c.lastIndexOf(".")+1);l=l||eI.MIME_TYPES[u]||`video/${u}`}o.src=s,l&&(o.type=l),r.appendChild(o)}e=r}super(e),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}update(e=0){if(!this.destroyed){if(this._updateFPS){let t=sn.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}_videoFrameRequestCallback(){this.update(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)}load(){if(this._load)return this._load;let e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise((t,r)=>{this.valid?t(this):(this._resolve=t,this._reject=r,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){let e=this.source;return!e.paused&&!e.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){let e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);let t=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!t&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._configureAutoUpdate();let e=this.source;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(sn.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(sn.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(sn.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||eI.TYPES.includes(t)}};QL.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],QL.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};var d0=QL;Gv.push(h0,Nm,c0,d0,$C,qg,Ml,$L,l0);var o$=["vehicle","stop","passenger","all"],s$=["zoomed-in","zoomed-out","any"],l$=["circle","square","triangle","pentagon","hexagon","octagon","star","cross","diamond"],Zg=class i{VERSION=4;SPRITE_SIZE=40;BACKGROUND_SHAPE_SIZE=60;KEY_TEXTURES="multimodal.textures";DEFAULT_UNDEFINED_TEXTURE_URL="/images/undefined-texture.png";DEFAULT_VEHICLE_TEXTURE_URL="/images/vehicle.png";DEFAULT_PASSENGER_TEXTURE_URL="/images/passenger.png";DEFAULT_STOP_TEXTURE_URL="/images/stop.png";DEFAULT_ZOOMED_OUT_VEHICLE_TEXTURE_URL="/images/zoomed-out-vehicle.png";DEFAULT_ZOOMED_OUT_PASSENGER_TEXTURE_URL="/images/zoomed-out-passenger.png";DEFAULT_ZOOMED_OUT_STOP_TEXTURE_URL="/images/zoomed-out-stop.png";PRESET_LIGHT_COLOR_THEME=["#ccffcc","#ffffb3","#ffffb3","#ffb980","#ffb980","#ff3333","#ff3333"];PRESET_SATURATED_COLOR_THEME=["#00ff00","#ffff00","#ff8000","#ff0000"];VEHICLE_SPRITE_SCALE_FACTOR=1;PASSENGER_SPRITE_SCALE_FACTOR=.75;STOP_SPRITE_SCALE_FACTOR=.25;_useZoomedOutSprites=!1;_globalSpriteScale=1;_vehicleTexture=Ft.from(this.DEFAULT_VEHICLE_TEXTURE_URL);_passengerTexture=Ft.from(this.DEFAULT_PASSENGER_TEXTURE_URL);_stopTexture=Ft.from(this.DEFAULT_STOP_TEXTURE_URL);_zoomedOutVehicleTexture=Ft.from(this.DEFAULT_ZOOMED_OUT_VEHICLE_TEXTURE_URL);_zoomedOutPassengerTexture=Ft.from(this.DEFAULT_ZOOMED_OUT_PASSENGER_TEXTURE_URL);_zoomedOutStopTexture=Ft.from(this.DEFAULT_ZOOMED_OUT_STOP_TEXTURE_URL);_customTextures=[];_backgroundShapes=[];_colorPresetIndex=0;_customColors=["#00ff00","#ff0000"];_currentColorPreset=this.PRESET_LIGHT_COLOR_THEME;_textureMap=new Map;_customizationUpdatedSignal=Bt(0);get useZoomedOutSprites(){return this._useZoomedOutSprites}get vehicleSpriteScale(){return this.VEHICLE_SPRITE_SCALE_FACTOR*this._globalSpriteScale}get passengerSpriteScale(){return this.PASSENGER_SPRITE_SCALE_FACTOR*this._globalSpriteScale}get stopSpriteScale(){return this.STOP_SPRITE_SCALE_FACTOR*this._globalSpriteScale}get vehicleTexture(){return this._vehicleTexture}get passengerTexture(){return this._passengerTexture}get stopTexture(){return this._stopTexture}get zoomedOutVehicleTexture(){return this._zoomedOutVehicleTexture}get zoomedOutPassengerTexture(){return this._zoomedOutPassengerTexture}get zoomedOutStopTexture(){return this._zoomedOutStopTexture}get colorPresetIndex(){return this._colorPresetIndex}get customColors(){return this._customColors}get currentColorPreset(){return this._currentColorPreset}get customTextures(){return structuredClone(this._customTextures)}get backgroundShapes(){return structuredClone(this._backgroundShapes)}get customizationUpdatedSignal(){return this._customizationUpdatedSignal}constructor(){this.loadTexturesData()}calculateSpriteScales(e){let o=e.getMap(),s=15,l=o.getZoom(),c=s-l;this._useZoomedOutSprites=l<14;let u=Math.pow(1.5,-c);u=Math.min(Math.max(u,.2),1),this._globalSpriteScale=u/e.getScale()}saveTextureData(e,t,r,n,a,o,s,l,c,u){let h={version:this.VERSION,vehicleTextureUrl:e,passengerTextureUrl:t,stopTextureUrl:r,zoomedOutVehicleTextureUrl:n,zoomedOutPassengerTextureUrl:a,zoomedOutStopTextureUrl:o,customTextures:s,backgroundShapes:l,colorPresetIndex:c,customColors:u};localStorage.setItem(this.KEY_TEXTURES,JSON.stringify(h)),this.applyTexturesData(h)}getVehicleTexture(e,t){let r=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",n=this._customTextures.find(o=>o.isActive&&["vehicle","all"].includes(o.type)&&[r,"any"].includes(o.zoom)&&o.tags.every(s=>t.includes(s))&&(o.mode===null||o.mode===e)),a=this._useZoomedOutSprites?this._zoomedOutVehicleTexture:this._vehicleTexture;return this._textureMap.get(n?.url??"")??a}getPassengerTexture(e){let t=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",r=this._customTextures.find(a=>a.isActive&&["passenger","all"].includes(a.type)&&[t,"any"].includes(a.zoom)&&a.tags.every(o=>e.includes(o))),n=this._useZoomedOutSprites?this._zoomedOutPassengerTexture:this._passengerTexture;return this._textureMap.get(r?.url??"")??n}getStopTexture(e){let t=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",r=this._customTextures.find(a=>a.isActive&&["stop","all"].includes(a.type)&&[t,"any"].includes(a.zoom)&&a.tags.every(o=>e.includes(o))),n=this._useZoomedOutSprites?this._zoomedOutStopTexture:this._stopTexture;return this._textureMap.get(r?.url??"")??n}drawVehicleBackgroundShape(e,t,r){let n=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",a=this._backgroundShapes.find(o=>o.isActive&&["vehicle","all"].includes(o.type)&&[n,"any"].includes(o.zoom)&&o.tags.every(s=>r.includes(s))&&(o.mode===null||o.mode===t));if(!a){e.clear();return}this.drawShape(e,a.shape,a.color)}drawPassengerBackgroundShape(e,t){let r=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",n=this._backgroundShapes.find(a=>a.isActive&&["passenger","all"].includes(a.type)&&[r,"any"].includes(a.zoom)&&a.tags.every(o=>t.includes(o)));if(!n){e.clear();return}this.drawShape(e,n.shape,n.color)}drawStopBackgroundShape(e,t){let r=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",n=this._backgroundShapes.find(a=>a.isActive&&["stop","all"].includes(a.type)&&[r,"any"].includes(a.zoom)&&a.tags.every(o=>t.includes(o)));if(!n){e.clear();return}this.drawShape(e,n.shape,n.color)}loadTexturesData(){let e=localStorage.getItem(this.KEY_TEXTURES);if(!e)return;let t=JSON.parse(e);t.version===void 0||t.version!==this.VERSION||this.applyTexturesData(t)}applyTexturesData(e){this._vehicleTexture=Ft.from(e.vehicleTextureUrl),this._passengerTexture=Ft.from(e.passengerTextureUrl),this._stopTexture=Ft.from(e.stopTextureUrl),this._zoomedOutVehicleTexture=Ft.from(e.zoomedOutVehicleTextureUrl),this._zoomedOutPassengerTexture=Ft.from(e.zoomedOutPassengerTextureUrl),this._zoomedOutStopTexture=Ft.from(e.zoomedOutStopTextureUrl),this._colorPresetIndex=e.colorPresetIndex,this._customColors=e.customColors,this._colorPresetIndex===0&&(this._currentColorPreset=this.PRESET_LIGHT_COLOR_THEME),this._colorPresetIndex===1&&(this._currentColorPreset=this.PRESET_SATURATED_COLOR_THEME),this._colorPresetIndex===2&&e.customColors.length>=2&&(this._currentColorPreset=e.customColors),this._customTextures=e.customTextures;let t=Array.from(new Set(this._customTextures.map(r=>r.url)));this._textureMap.clear(),t.forEach(r=>{this._textureMap.set(r,Ft.from(r))}),this._backgroundShapes=structuredClone(e.backgroundShapes),this._customizationUpdatedSignal.update(r=>r+1)}drawShape(e,t,r){let n=this.BACKGROUND_SHAPE_SIZE;switch(e.clear(),e.beginFill(r),t){case"circle":e.drawCircle(0,0,n/2),e.scale.set(4/Math.PI);break;case"square":e.drawRect(-n/2,-n/2,n,n);break;case"triangle":e.drawPolygon(this.createPolygonCoordinates(3,n/2)),e.scale.set(1.5);break;case"pentagon":e.drawPolygon(this.createPolygonCoordinates(5,n/2)),e.scale.set(4/Math.PI);break;case"hexagon":e.drawPolygon(this.createPolygonCoordinates(6,n/2,0)),e.scale.set(4/Math.PI);break;case"octagon":e.drawPolygon(this.createPolygonCoordinates(8,n/2,360/16)),e.scale.set(4/Math.PI);break;case"star":{let a=n/2,o=a/2.5,s=this.createPolygonCoordinates(5,a,90),l=this.createPolygonCoordinates(5,o,126),c=[];for(let u=0;u<s.length;u+=2)c.push(l[u],l[u+1]),c.push(s[u],s[u+1]);e.drawPolygon(c),e.scale.set(1.8)}break;case"cross":e.drawRect(-n/2,-n/8,n,n/4),e.drawRect(-n/8,-n/2,n/4,n),e.rotation=Math.PI/4,e.scale.set(1.5);break;case"diamond":e.drawPolygon(this.createPolygonCoordinates(4,n/2)),e.scale.set(Math.SQRT2);break}e.endFill()}createPolygonCoordinates(e,t,r=90){let n=[];for(let a=0;a<e;a++){let o=(a*360/e-r)*(Math.PI/180),s=t*Math.cos(o),l=t*Math.sin(o);n.push(s,l)}return n}static \u0275fac=function(t){return new(t||i)};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var aBe=["mat-menu-item",""],oBe=[[["mat-icon"],["","matMenuItemIcon",""]],"*"],sBe=["mat-icon, [matMenuItemIcon]","*"];function lBe(i,e){i&1&&(Sr(),Z(0,"svg",2),Ge(1,"polygon",3),Q())}var cBe=["*"];function uBe(i,e){if(i&1){let t=vt();Z(0,"div",0),Le("click",function(){Ee(t);let n=Se();return Ae(n.closed.emit("click"))})("animationstart",function(n){Ee(t);let a=Se();return Ae(a._onAnimationStart(n.animationName))})("animationend",function(n){Ee(t);let a=Se();return Ae(a._onAnimationDone(n.animationName))})("animationcancel",function(n){Ee(t);let a=Se();return Ae(a._onAnimationDone(n.animationName))}),Z(1,"div",1),Ot(2),Q()()}if(i&2){let t=Se();dn(t._classList),gt("mat-menu-panel-animations-disabled",t._animationsDisabled)("mat-menu-panel-exit-animation",t._panelAnimationState==="void")("mat-menu-panel-animating",t._isAnimating),Re("id",t.panelId),Mt("aria-label",t.ariaLabel||null)("aria-labelledby",t.ariaLabelledby||null)("aria-describedby",t.ariaDescribedby||null)}}var iI=new et("MAT_MENU_PANEL"),Um=(()=>{class i{_elementRef=te(Et);_document=te(li);_focusMonitor=te(In);_parentMenu=te(iI,{optional:!0});_changeDetectorRef=te(_i);role="menuitem";disabled=!1;disableRipple=!1;_hovered=new ct;_focused=new ct;_highlighted=!1;_triggersSubmenu=!1;constructor(){te(ar).load(kn),this._parentMenu?.addItem?.(this)}focus(t,r){this._focusMonitor&&t?this._focusMonitor.focusVia(this._getHostElement(),t,r):this._getHostElement().focus(r),this._focused.next(this)}ngAfterViewInit(){this._focusMonitor&&this._focusMonitor.monitor(this._elementRef,!1)}ngOnDestroy(){this._focusMonitor&&this._focusMonitor.stopMonitoring(this._elementRef),this._parentMenu&&this._parentMenu.removeItem&&this._parentMenu.removeItem(this),this._hovered.complete(),this._focused.complete()}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._elementRef.nativeElement}_checkDisabled(t){this.disabled&&(t.preventDefault(),t.stopPropagation())}_handleMouseEnter(){this._hovered.next(this)}getLabel(){let t=this._elementRef.nativeElement.cloneNode(!0),r=t.querySelectorAll("mat-icon, .material-icons");for(let n=0;n<r.length;n++)r[n].remove();return t.textContent?.trim()||""}_setHighlighted(t){this._highlighted=t,this._changeDetectorRef.markForCheck()}_setTriggersSubmenu(t){this._triggersSubmenu=t,this._changeDetectorRef.markForCheck()}_hasFocus(){return this._document&&this._document.activeElement===this._getHostElement()}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["","mat-menu-item",""]],hostAttrs:[1,"mat-mdc-menu-item","mat-focus-indicator"],hostVars:8,hostBindings:function(r,n){r&1&&Le("click",function(o){return n._checkDisabled(o)})("mouseenter",function(){return n._handleMouseEnter()}),r&2&&(Mt("role",n.role)("tabindex",n._getTabIndex())("aria-disabled",n.disabled)("disabled",n.disabled||null),gt("mat-mdc-menu-item-highlighted",n._highlighted)("mat-mdc-menu-item-submenu-trigger",n._triggersSubmenu))},inputs:{role:"role",disabled:[2,"disabled","disabled",st],disableRipple:[2,"disableRipple","disableRipple",st]},exportAs:["matMenuItem"],features:[si],attrs:aBe,ngContentSelectors:sBe,decls:5,vars:3,consts:[[1,"mat-mdc-menu-item-text"],["matRipple","",1,"mat-mdc-menu-ripple",3,"matRippleDisabled","matRippleTrigger"],["viewBox","0 0 5 10","focusable","false","aria-hidden","true",1,"mat-mdc-menu-submenu-icon"],["points","0,0 5,5 0,10"]],template:function(r,n){r&1&&(Pi(oBe),Ot(0),Z(1,"span",0),Ot(2,1),Q(),Ge(3,"div",1),je(4,lBe,2,0,":svg:svg",2)),r&2&&(oe(3),Re("matRippleDisabled",n.disableRipple||n.disabled)("matRippleTrigger",n._getHostElement()),oe(),Je(n._triggersSubmenu?4:-1))},dependencies:[Ya],encapsulation:2,changeDetection:0})}return i})();var hBe=new et("MatMenuContent");var dBe=new et("mat-menu-default-options",{providedIn:"root",factory:mBe});function mBe(){return{overlapTrigger:!1,xPosition:"after",yPosition:"below",backdropClass:"cdk-overlay-transparent-backdrop"}}var tI="_mat-menu-enter",XC="_mat-menu-exit",Xh=(()=>{class i{_elementRef=te(Et);_changeDetectorRef=te(_i);_injector=te(Ii);_keyManager;_xPosition;_yPosition;_firstItemFocusRef;_exitFallbackTimeout;_animationsDisabled;_allItems;_directDescendantItems=new jc;_classList={};_panelAnimationState="void";_animationDone=new ct;_isAnimating=!1;parentMenu;direction;overlayPanelClass;backdropClass;ariaLabel;ariaLabelledby;ariaDescribedby;get xPosition(){return this._xPosition}set xPosition(t){this._xPosition=t,this.setPositionClasses()}get yPosition(){return this._yPosition}set yPosition(t){this._yPosition=t,this.setPositionClasses()}templateRef;items;lazyContent;overlapTrigger;hasBackdrop;set panelClass(t){let r=this._previousPanelClass,n=ye({},this._classList);r&&r.length&&r.split(" ").forEach(a=>{n[a]=!1}),this._previousPanelClass=t,t&&t.length&&(t.split(" ").forEach(a=>{n[a]=!0}),this._elementRef.nativeElement.className=""),this._classList=n}_previousPanelClass;get classList(){return this.panelClass}set classList(t){this.panelClass=t}closed=new ut;close=this.closed;panelId=te(Di).getId("mat-menu-panel-");constructor(){let t=te(dBe);this.overlayPanelClass=t.overlayPanelClass||"",this._xPosition=t.xPosition,this._yPosition=t.yPosition,this.backdropClass=t.backdropClass,this.overlapTrigger=t.overlapTrigger,this.hasBackdrop=t.hasBackdrop,this._animationsDisabled=te(nr,{optional:!0})==="NoopAnimations"}ngOnInit(){this.setPositionClasses()}ngAfterContentInit(){this._updateDirectDescendants(),this._keyManager=new yh(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd(),this._keyManager.tabOut.subscribe(()=>this.closed.emit("tab")),this._directDescendantItems.changes.pipe(ur(this._directDescendantItems),Er(t=>vr(...t.map(r=>r._focused)))).subscribe(t=>this._keyManager.updateActiveItem(t)),this._directDescendantItems.changes.subscribe(t=>{let r=this._keyManager;if(this._panelAnimationState==="enter"&&r.activeItem?._hasFocus()){let n=t.toArray(),a=Math.max(0,Math.min(n.length-1,r.activeItemIndex||0));n[a]&&!n[a].disabled?r.setActiveItem(a):r.setNextItemActive()}})}ngOnDestroy(){this._keyManager?.destroy(),this._directDescendantItems.destroy(),this.closed.complete(),this._firstItemFocusRef?.destroy(),clearTimeout(this._exitFallbackTimeout)}_hovered(){return this._directDescendantItems.changes.pipe(ur(this._directDescendantItems),Er(r=>vr(...r.map(n=>n._hovered))))}addItem(t){}removeItem(t){}_handleKeydown(t){let r=t.keyCode,n=this._keyManager;switch(r){case 27:Hr(t)||(t.preventDefault(),this.closed.emit("keydown"));break;case 37:this.parentMenu&&this.direction==="ltr"&&this.closed.emit("keydown");break;case 39:this.parentMenu&&this.direction==="rtl"&&this.closed.emit("keydown");break;default:(r===38||r===40)&&n.setFocusOrigin("keyboard"),n.onKeydown(t);return}}focusFirstItem(t="program"){this._firstItemFocusRef?.destroy(),this._firstItemFocusRef=vn(()=>{let r=this._resolvePanel();if(!r||!r.contains(document.activeElement)){let n=this._keyManager;n.setFocusOrigin(t).setFirstItemActive(),!n.activeItem&&r&&r.focus()}},{injector:this._injector})}resetActiveItem(){this._keyManager.setActiveItem(-1)}setElevation(t){}setPositionClasses(t=this.xPosition,r=this.yPosition){this._classList=at(ye({},this._classList),{"mat-menu-before":t==="before","mat-menu-after":t==="after","mat-menu-above":r==="above","mat-menu-below":r==="below"}),this._changeDetectorRef.markForCheck()}_onAnimationDone(t){let r=t===XC;(r||t===tI)&&(r&&(clearTimeout(this._exitFallbackTimeout),this._exitFallbackTimeout=void 0),this._animationDone.next(r?"void":"enter"),this._isAnimating=!1)}_onAnimationStart(t){(t===tI||t===XC)&&(this._isAnimating=!0)}_setIsOpen(t){if(this._panelAnimationState=t?"enter":"void",t){if(this._keyManager.activeItemIndex===0){let r=this._resolvePanel();r&&(r.scrollTop=0)}}else this._animationsDisabled||(this._exitFallbackTimeout=setTimeout(()=>this._onAnimationDone(XC),200));this._animationsDisabled&&setTimeout(()=>{this._onAnimationDone(t?tI:XC)}),this._changeDetectorRef.markForCheck()}_updateDirectDescendants(){this._allItems.changes.pipe(ur(this._allItems)).subscribe(t=>{this._directDescendantItems.reset(t.filter(r=>r._parentMenu===this)),this._directDescendantItems.notifyOnChanges()})}_resolvePanel(){let t=null;return this._directDescendantItems.length&&(t=this._directDescendantItems.first._getHostElement().closest('[role="menu"]')),t}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-menu"]],contentQueries:function(r,n,a){if(r&1&&(Ki(a,hBe,5),Ki(a,Um,5),Ki(a,Um,4)),r&2){let o;St(o=kt())&&(n.lazyContent=o.first),St(o=kt())&&(n._allItems=o),St(o=kt())&&(n.items=o)}},viewQuery:function(r,n){if(r&1&&di(Ta,5),r&2){let a;St(a=kt())&&(n.templateRef=a.first)}},hostVars:3,hostBindings:function(r,n){r&2&&Mt("aria-label",null)("aria-labelledby",null)("aria-describedby",null)},inputs:{backdropClass:"backdropClass",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],xPosition:"xPosition",yPosition:"yPosition",overlapTrigger:[2,"overlapTrigger","overlapTrigger",st],hasBackdrop:[2,"hasBackdrop","hasBackdrop",t=>t==null?null:st(t)],panelClass:[0,"class","panelClass"],classList:"classList"},outputs:{closed:"closed",close:"close"},exportAs:["matMenu"],features:[ei([{provide:iI,useExisting:i}]),si],ngContentSelectors:cBe,decls:1,vars:0,consts:[["tabindex","-1","role","menu",1,"mat-mdc-menu-panel",3,"click","animationstart","animationend","animationcancel","id"],[1,"mat-mdc-menu-content"]],template:function(r,n){r&1&&(Pi(),je(0,uBe,3,12,"ng-template"))},styles:['mat-menu{display:none}.mat-mdc-menu-content{margin:0;padding:8px 0;outline:0}.mat-mdc-menu-content,.mat-mdc-menu-content .mat-mdc-menu-item .mat-mdc-menu-item-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;flex:1;white-space:normal;font-family:var(--mat-menu-item-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-menu-item-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-menu-item-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-menu-item-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-menu-item-label-text-weight, var(--mat-sys-label-large-weight))}@keyframes _mat-menu-enter{from{opacity:0;transform:scale(0.8)}to{opacity:1;transform:none}}@keyframes _mat-menu-exit{from{opacity:1}to{opacity:0}}.mat-mdc-menu-panel{min-width:112px;max-width:280px;overflow:auto;box-sizing:border-box;outline:0;animation:_mat-menu-enter 120ms cubic-bezier(0, 0, 0.2, 1);border-radius:var(--mat-menu-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-menu-container-color, var(--mat-sys-surface-container));box-shadow:var(--mat-menu-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));will-change:transform,opacity}.mat-mdc-menu-panel.mat-menu-panel-exit-animation{animation:_mat-menu-exit 100ms 25ms linear forwards}.mat-mdc-menu-panel.mat-menu-panel-animations-disabled{animation:none}.mat-mdc-menu-panel.mat-menu-panel-animating{pointer-events:none}.mat-mdc-menu-panel.mat-menu-panel-animating:has(.mat-mdc-menu-content:empty){display:none}@media(forced-colors: active){.mat-mdc-menu-panel{outline:solid 1px}}.mat-mdc-menu-panel .mat-divider{color:var(--mat-menu-divider-color, var(--mat-sys-surface-variant));margin-bottom:var(--mat-menu-divider-bottom-spacing, 8px);margin-top:var(--mat-menu-divider-top-spacing, 8px)}.mat-mdc-menu-item{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;cursor:pointer;width:100%;text-align:left;box-sizing:border-box;color:inherit;font-size:inherit;background:none;text-decoration:none;margin:0;min-height:48px;padding-left:var(--mat-menu-item-leading-spacing, 12px);padding-right:var(--mat-menu-item-trailing-spacing, 12px);-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-menu-item::-moz-focus-inner{border:0}[dir=rtl] .mat-mdc-menu-item{padding-left:var(--mat-menu-item-trailing-spacing, 12px);padding-right:var(--mat-menu-item-leading-spacing, 12px)}.mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-leading-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-trailing-spacing, 12px)}[dir=rtl] .mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-trailing-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-leading-spacing, 12px)}.mat-mdc-menu-item,.mat-mdc-menu-item:visited,.mat-mdc-menu-item:link{color:var(--mat-menu-item-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-menu-item .mat-icon-no-color,.mat-mdc-menu-item .mat-mdc-menu-submenu-icon{color:var(--mat-menu-item-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-menu-item[disabled]{cursor:default;opacity:.38}.mat-mdc-menu-item[disabled]::after{display:block;position:absolute;content:"";top:0;left:0;bottom:0;right:0}.mat-mdc-menu-item:focus{outline:0}.mat-mdc-menu-item .mat-icon{flex-shrink:0;margin-right:var(--mat-menu-item-spacing, 12px);height:var(--mat-menu-item-icon-size, 24px);width:var(--mat-menu-item-icon-size, 24px)}[dir=rtl] .mat-mdc-menu-item{text-align:right}[dir=rtl] .mat-mdc-menu-item .mat-icon{margin-right:0;margin-left:var(--mat-menu-item-spacing, 12px)}.mat-mdc-menu-item:not([disabled]):hover{background-color:var(--mat-menu-item-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-menu-item:not([disabled]).cdk-program-focused,.mat-mdc-menu-item:not([disabled]).cdk-keyboard-focused,.mat-mdc-menu-item:not([disabled]).mat-mdc-menu-item-highlighted{background-color:var(--mat-menu-item-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}@media(forced-colors: active){.mat-mdc-menu-item{margin-top:1px}}.mat-mdc-menu-submenu-icon{width:var(--mat-menu-item-icon-size, 24px);height:10px;fill:currentColor;padding-left:var(--mat-menu-item-spacing, 12px)}[dir=rtl] .mat-mdc-menu-submenu-icon{padding-right:var(--mat-menu-item-spacing, 12px);padding-left:0}[dir=rtl] .mat-mdc-menu-submenu-icon polygon{transform:scaleX(-1);transform-origin:center}@media(forced-colors: active){.mat-mdc-menu-submenu-icon{fill:CanvasText}}.mat-mdc-menu-item .mat-mdc-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}'],encapsulation:2,changeDetection:0})}return i})(),h$=new et("mat-menu-scroll-strategy",{providedIn:"root",factory:()=>{let i=te(Rr);return()=>i.scrollStrategies.reposition()}});function pBe(i){return()=>i.scrollStrategies.reposition()}var fBe={provide:h$,deps:[Rr],useFactory:pBe},u$=ca({passive:!0});var m0=new WeakMap,QC=(()=>{class i{_overlay=te(Rr);_element=te(Et);_viewContainerRef=te(sa);_menuItemInstance=te(Um,{optional:!0,self:!0});_dir=te(Pr,{optional:!0});_focusMonitor=te(In);_ngZone=te(Kt);_scrollStrategy=te(h$);_changeDetectorRef=te(_i);_portal;_overlayRef=null;_menuOpen=!1;_closingActionsSubscription=tr.EMPTY;_hoverSubscription=tr.EMPTY;_menuCloseSubscription=tr.EMPTY;_pendingRemoval;_parentMaterialMenu;_parentInnerPadding;_handleTouchStart=t=>{im(t)||(this._openedBy="touch")};_openedBy=void 0;get _deprecatedMatMenuTriggerFor(){return this.menu}set _deprecatedMatMenuTriggerFor(t){this.menu=t}get menu(){return this._menu}set menu(t){t!==this._menu&&(this._menu=t,this._menuCloseSubscription.unsubscribe(),t&&(this._parentMaterialMenu,this._menuCloseSubscription=t.close.subscribe(r=>{this._destroyMenu(r),(r==="click"||r==="tab")&&this._parentMaterialMenu&&this._parentMaterialMenu.closed.emit(r)})),this._menuItemInstance?._setTriggersSubmenu(this.triggersSubmenu()))}_menu;menuData;restoreFocus=!0;menuOpened=new ut;onMenuOpen=this.menuOpened;menuClosed=new ut;onMenuClose=this.menuClosed;constructor(){let t=te(iI,{optional:!0});this._parentMaterialMenu=t instanceof Xh?t:void 0,this._element.nativeElement.addEventListener("touchstart",this._handleTouchStart,u$)}ngAfterContentInit(){this._handleHover()}ngOnDestroy(){this.menu&&this._ownsMenu(this.menu)&&m0.delete(this.menu),this._element.nativeElement.removeEventListener("touchstart",this._handleTouchStart,u$),this._pendingRemoval?.unsubscribe(),this._menuCloseSubscription.unsubscribe(),this._closingActionsSubscription.unsubscribe(),this._hoverSubscription.unsubscribe(),this._overlayRef&&(this._overlayRef.dispose(),this._overlayRef=null)}get menuOpen(){return this._menuOpen}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}triggersSubmenu(){return!!(this._menuItemInstance&&this._parentMaterialMenu&&this.menu)}toggleMenu(){return this._menuOpen?this.closeMenu():this.openMenu()}openMenu(){let t=this.menu;if(this._menuOpen||!t)return;this._pendingRemoval?.unsubscribe();let r=m0.get(t);m0.set(t,this),r&&r!==this&&r.closeMenu();let n=this._createOverlay(t),a=n.getConfig(),o=a.positionStrategy;this._setPosition(t,o),a.hasBackdrop=t.hasBackdrop==null?!this.triggersSubmenu():t.hasBackdrop,n.hasAttached()||(n.attach(this._getPortal(t)),t.lazyContent?.attach(this.menuData)),this._closingActionsSubscription=this._menuClosingActions().subscribe(()=>this.closeMenu()),t.parentMenu=this.triggersSubmenu()?this._parentMaterialMenu:void 0,t.direction=this.dir,t.focusFirstItem(this._openedBy||"program"),this._setIsMenuOpen(!0),t instanceof Xh&&(t._setIsOpen(!0),t._directDescendantItems.changes.pipe(gi(t.close)).subscribe(()=>{o.withLockedPosition(!1).reapplyLastPosition(),o.withLockedPosition(!0)}))}closeMenu(){this.menu?.close.emit()}focus(t,r){this._focusMonitor&&t?this._focusMonitor.focusVia(this._element,t,r):this._element.nativeElement.focus(r)}updatePosition(){this._overlayRef?.updatePosition()}_destroyMenu(t){let r=this._overlayRef,n=this._menu;!r||!this.menuOpen||(this._closingActionsSubscription.unsubscribe(),this._pendingRemoval?.unsubscribe(),n instanceof Xh&&this._ownsMenu(n)?(this._pendingRemoval=n._animationDone.pipe(Ir(1)).subscribe(()=>{r.detach(),n.lazyContent?.detach()}),n._setIsOpen(!1)):(r.detach(),n?.lazyContent?.detach()),n&&this._ownsMenu(n)&&m0.delete(n),this.restoreFocus&&(t==="keydown"||!this._openedBy||!this.triggersSubmenu())&&this.focus(this._openedBy),this._openedBy=void 0,this._setIsMenuOpen(!1))}_setIsMenuOpen(t){t!==this._menuOpen&&(this._menuOpen=t,this._menuOpen?this.menuOpened.emit():this.menuClosed.emit(),this.triggersSubmenu()&&this._menuItemInstance._setHighlighted(t),this._changeDetectorRef.markForCheck())}_createOverlay(t){if(!this._overlayRef){let r=this._getOverlayConfig(t);this._subscribeToPositions(t,r.positionStrategy),this._overlayRef=this._overlay.create(r),this._overlayRef.keydownEvents().subscribe(n=>{this.menu instanceof Xh&&this.menu._handleKeydown(n)})}return this._overlayRef}_getOverlayConfig(t){return new Ds({positionStrategy:this._overlay.position().flexibleConnectedTo(this._element).withLockedPosition().withGrowAfterOpen().withTransformOriginOn(".mat-menu-panel, .mat-mdc-menu-panel"),backdropClass:t.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:t.overlayPanelClass,scrollStrategy:this._scrollStrategy(),direction:this._dir||"ltr"})}_subscribeToPositions(t,r){t.setPositionClasses&&r.positionChanges.subscribe(n=>{this._ngZone.run(()=>{let a=n.connectionPair.overlayX==="start"?"after":"before",o=n.connectionPair.overlayY==="top"?"below":"above";t.setPositionClasses(a,o)})})}_setPosition(t,r){let[n,a]=t.xPosition==="before"?["end","start"]:["start","end"],[o,s]=t.yPosition==="above"?["bottom","top"]:["top","bottom"],[l,c]=[o,s],[u,h]=[n,a],d=0;if(this.triggersSubmenu()){if(h=n=t.xPosition==="before"?"start":"end",a=u=n==="end"?"start":"end",this._parentMaterialMenu){if(this._parentInnerPadding==null){let p=this._parentMaterialMenu.items.first;this._parentInnerPadding=p?p._getHostElement().offsetTop:0}d=o==="bottom"?this._parentInnerPadding:-this._parentInnerPadding}}else t.overlapTrigger||(l=o==="top"?"bottom":"top",c=s==="top"?"bottom":"top");r.withPositions([{originX:n,originY:l,overlayX:u,overlayY:o,offsetY:d},{originX:a,originY:l,overlayX:h,overlayY:o,offsetY:d},{originX:n,originY:c,overlayX:u,overlayY:s,offsetY:-d},{originX:a,originY:c,overlayX:h,overlayY:s,offsetY:-d}])}_menuClosingActions(){let t=this._overlayRef.backdropClick(),r=this._overlayRef.detachments(),n=this._parentMaterialMenu?this._parentMaterialMenu.closed:Qt(),a=this._parentMaterialMenu?this._parentMaterialMenu._hovered().pipe(Yi(o=>this._menuOpen&&o!==this._menuItemInstance)):Qt();return vr(t,n,a,r)}_handleMousedown(t){tm(t)||(this._openedBy=t.button===0?"mouse":void 0,this.triggersSubmenu()&&t.preventDefault())}_handleKeydown(t){let r=t.keyCode;(r===13||r===32)&&(this._openedBy="keyboard"),this.triggersSubmenu()&&(r===39&&this.dir==="ltr"||r===37&&this.dir==="rtl")&&(this._openedBy="keyboard",this.openMenu())}_handleClick(t){this.triggersSubmenu()?(t.stopPropagation(),this.openMenu()):this.toggleMenu()}_handleHover(){this.triggersSubmenu()&&this._parentMaterialMenu&&(this._hoverSubscription=this._parentMaterialMenu._hovered().subscribe(t=>{t===this._menuItemInstance&&!t.disabled&&(this._openedBy="mouse",this.openMenu())}))}_getPortal(t){return(!this._portal||this._portal.templateRef!==t.templateRef)&&(this._portal=new Xa(t.templateRef,this._viewContainerRef)),this._portal}_ownsMenu(t){return m0.get(t)===this}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","mat-menu-trigger-for",""],["","matMenuTriggerFor",""]],hostAttrs:[1,"mat-mdc-menu-trigger"],hostVars:3,hostBindings:function(r,n){r&1&&Le("click",function(o){return n._handleClick(o)})("mousedown",function(o){return n._handleMousedown(o)})("keydown",function(o){return n._handleKeydown(o)}),r&2&&Mt("aria-haspopup",n.menu?"menu":null)("aria-expanded",n.menuOpen)("aria-controls",n.menuOpen?n.menu.panelId:null)},inputs:{_deprecatedMatMenuTriggerFor:[0,"mat-menu-trigger-for","_deprecatedMatMenuTriggerFor"],menu:[0,"matMenuTriggerFor","menu"],menuData:[0,"matMenuTriggerData","menuData"],restoreFocus:[0,"matMenuTriggerRestoreFocus","restoreFocus"]},outputs:{menuOpened:"menuOpened",onMenuOpen:"onMenuOpen",menuClosed:"menuClosed",onMenuClose:"onMenuClose"},exportAs:["matMenuTrigger"]})}return i})(),eM=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({providers:[fBe],imports:[Ko,ti,Uo,pl,ti]})}return i})(),d$={transformMenu:Cs("transformMenu",[Ms("void",mn({opacity:0,transform:"scale(0.8)"})),Ba("void => enter",Pa("120ms cubic-bezier(0, 0, 0.2, 1)",mn({opacity:1,transform:"scale(1)"}))),Ba("* => void",Pa("100ms 25ms linear",mn({opacity:0})))]),fadeInItems:Cs("fadeInItems",[Ms("showing",mn({opacity:1})),Ba("void => *",[mn({opacity:0}),Pa("400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])},N_t=d$.fadeInItems,G_t=d$.transformMenu;var gBe=i=>({shape:i});function yBe(i,e){i&1&&Od(0)}function _Be(i,e){i&1&&Od(0)}function bBe(i,e){if(i&1){let t=vt();Z(0,"button",6),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.shapeOutputEmitter.emit(n))}),je(1,_Be,1,0,"ng-container",3),Q()}if(i&2){let t=e.$implicit;Se();let r=Or(8);oe(),Re("ngTemplateOutlet",r)("ngTemplateOutletContext",mP(2,gBe,t))}}function vBe(i,e){i&1&&(Sr(),Ge(0,"circle",8))}function SBe(i,e){i&1&&(Sr(),Ge(0,"rect",9))}function kBe(i,e){i&1&&(Sr(),Ge(0,"polygon",10))}function xBe(i,e){i&1&&(Sr(),Ge(0,"polygon",11))}function wBe(i,e){i&1&&(Sr(),Ge(0,"polygon",12))}function CBe(i,e){i&1&&(Sr(),Ge(0,"polygon",13))}function MBe(i,e){i&1&&(Sr(),Ge(0,"polygon",14))}function TBe(i,e){i&1&&(Sr(),Ge(0,"rect",16)(1,"rect",17))}function EBe(i,e){i&1&&(Sr(),Ge(0,"polygon",15))}function ABe(i,e){if(i&1&&(Sr(),Z(0,"svg",7),je(1,vBe,1,0,":svg:circle",8)(2,SBe,1,0,":svg:rect",9)(3,kBe,1,0,":svg:polygon",10)(4,xBe,1,0,":svg:polygon",11)(5,wBe,1,0,":svg:polygon",12)(6,CBe,1,0,":svg:polygon",13)(7,MBe,1,0,":svg:polygon",14)(8,TBe,2,0)(9,EBe,1,0,":svg:polygon",15),Q()),i&2){let t,r=e.shape;Se();let n=fi(0);Mt("fill",n.color),oe(),Je((t=r)==="circle"?1:t==="square"?2:t==="triangle"?3:t==="pentagon"?4:t==="hexagon"?5:t==="octagon"?6:t==="star"?7:t==="cross"?8:t==="diamond"?9:-1)}}var tM=class i{BACKGROUND_SHAPE_TYPES=l$;backgroundShapeInputSignal=sl.required({alias:"backgroundShape"});shapeOutputEmitter=Uc({alias:"shapeChange"});static \u0275fac=function(t){return new(t||i)};static \u0275cmp=tt({type:i,selectors:[["app-background-shape"]],inputs:{backgroundShapeInputSignal:[1,"backgroundShape","backgroundShapeInputSignal"]},outputs:{shapeOutputEmitter:"shapeChange"},decls:9,vars:4,consts:[["shapeMenu","matMenu"],["shape",""],[1,"select-shape","flex-row","align-cross-center",3,"matMenuTriggerFor"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"shape-menu"],["mat-menu-item",""],["mat-menu-item","",3,"click"],["width","40px","height","40px","viewBox","0 0 40 40"],["cx","20","cy","20","r","20"],["x","0","y","0","width","40","height","40"],["points","19.999999999999996,0 37.32050807568878,29.999999999999986 2.679491924311222,29.999999999999996 "],["points","19.999999999999996,0 39.02113032590307,13.819660112501047 31.755705045849467,36.180339887498945 8.244294954150542,36.18033988749895 0.9788696740969272,13.819660112501058 "],["points","40,20 30,37.32050807568877 10.000000000000004,37.32050807568878 0,20.000000000000004 9.999999999999991,2.6794919243112325 30,2.679491924311229 "],["points","38.477590650225736,27.653668647301796 27.653668647301796,38.477590650225736 12.346331352698206,38.477590650225736 1.5224093497742643,27.6536686473018 1.5224093497742643,12.346331352698208 12.346331352698193,1.5224093497742714 27.6536686473018,1.522409349774268 38.47759065022573,12.346331352698192 "],["points","19.999999999999996,0 24.702282018339783,13.52786404500042 39.02113032590307,13.819660112501047 27.60845213036123,22.472135954999576 31.755705045849467,36.180339887498945 20.000000000000004,28 8.244294954150542,36.18033988749895 12.391547869638773,22.472135954999583 0.9788696740969272,13.819660112501058 15.297717981660213,13.527864045000422 "],["points","20,0 40,20 20,40 0,20"],["x","15","y","0","width","10","height","40",1,"rotate"],["x","0","y","15","width","40","height","10",1,"rotate"]],template:function(t,r){if(t&1&&(Ri(0),Z(1,"div",2),je(2,yBe,1,0,"ng-container",3),Q(),Z(3,"mat-menu",4,0),ui(5,bBe,2,4,"button",5,Ea),Q(),je(7,ABe,10,2,"ng-template",null,1,Gp)),t&2){let n=Or(4),a=Or(8),o=hr(r.backgroundShapeInputSignal());oe(),Re("matMenuTriggerFor",n),oe(),Re("ngTemplateOutlet",a)("ngTemplateOutletContext",o),oe(3),hi(r.BACKGROUND_SHAPE_TYPES)}},dependencies:[Wp,eM,Xh,Um,QC],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}.select-shape[_ngcontent-%COMP%]{cursor:pointer}.rotate[_ngcontent-%COMP%]{transform:translate(20px,-10px) rotate(45deg)} .shape-menu .mat-mdc-menu-content{--menu-item-width: 40px;--menu-item-height: 40px;--menu-item-padding: 8px;--max-number-of-items: 3;--menu-gap: .5rem;display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--menu-gap);padding:1rem;max-width:calc(var(--max-number-of-items) * (var(--menu-item-width) + 2 * var(--menu-item-padding)) + (var(--max-number-of-items) - 1) * var(--menu-gap))} .shape-menu .mat-mdc-menu-content>button{box-sizing:content-box;min-width:var(--menu-item-width);max-width:var(--menu-item-width);min-height:var(--menu-item-height);max-height:var(--menu-item-height);padding:var(--menu-item-padding)} .shape-menu .mat-mdc-menu-content>button>span{max-width:var(--menu-item-width);max-height:var(--menu-item-height)}"]})};var PBe=["iconFileUpload"];function BBe(i,e){if(i&1&&(Z(0,"mat-error"),ce(1),Q()),i&2){let t=Se();oe(),Ti(t.currentError)}}function RBe(i,e){i&1&&(Z(0,"div",9)(1,"p"),ce(2,"No background shapes added yet."),Q()())}function DBe(i,e){i&1&&Ge(0,"div",43)}function LBe(i,e){if(i&1&&(Z(0,"div",40),Ge(1,"div",41)(2,"div",42),Z(3,"div",30)(4,"div",31),Ge(5,"div",43)(6,"div",43),je(7,DBe,1,0,"div",43),Q(),Z(8,"div",31),Ge(9,"div",43),Q()(),Ge(10,"div",42),Q()),i&2){let t=Se().$implicit;oe(7),Je(t.type==="vehicle"?7:-1)}}function IBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function FBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function OBe(i,e){if(i&1){let t=vt();Z(0,"mat-form-field",32)(1,"mat-label"),ce(2,"Vehicle Mode"),Q(),Z(3,"input",44),mh("ngModelChange",function(n){Ee(t);let a=Se().$implicit;return dh(a.mode,n)||(a.mode=n),Ae(n)}),Q()()}if(i&2){let t=Se().$implicit;oe(3),hh("ngModel",t.mode)}}function zBe(i,e){if(i&1){let t=vt();Z(0,"mat-chip-row",45),Le("removed",function(){let n=Ee(t).$implicit,a=Se().$index,o=Se();return Ae(o.removeTagFromBackgroundShape(a,n))})("edited",function(n){let a=Ee(t).$implicit,o=Se().$index,s=Se();return Ae(s.editTagInBackgroundShape(o,a,n))}),ce(1),Z(2,"button",46)(3,"mat-icon"),ce(4,"cancel"),Q()()()}if(i&2){let t=e.$implicit;Re("aria-description","press enter to edit "+t)("editable",!0),oe(),_t(" ",t," "),oe(),Mt("aria-label","remove "+t)}}function HBe(i,e){if(i&1){let t=vt();Z(0,"div",11),je(1,LBe,11,1,"div",26),Z(2,"div",27)(3,"app-background-shape",28),Le("shapeChange",function(n){let a=Ee(t).$index,o=Se();return Ae(o.onBackgroundShapeTypeChange(a,n))}),Q()(),Z(4,"input",29),Le("input",function(n){let a=Ee(t).$index,o=Se();return Ae(o.onBackgroundShapeColorChange(a,n))}),Q(),Z(5,"div",30)(6,"div",31)(7,"mat-form-field",32)(8,"mat-label"),ce(9,"Type"),Q(),Z(10,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.type,n)||(a.type=n),Ae(n)}),ui(11,IBe,3,4,"mat-option",15,_o),Q()(),Z(13,"mat-form-field",32)(14,"mat-label"),ce(15,"Zoom"),Q(),Z(16,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.zoom,n)||(a.zoom=n),Ae(n)}),ui(17,FBe,3,4,"mat-option",15,_o),Q()(),je(19,OBe,4,1,"mat-form-field",32),Q(),Z(20,"div",31)(21,"mat-form-field",32)(22,"mat-label"),ce(23,"Tags"),Q(),Z(24,"mat-chip-grid",34,2),ui(26,zBe,5,4,"mat-chip-row",35,Ea),Z(28,"input",36),Le("matChipInputTokenEnd",function(n){let a=Ee(t).$index,o=Se();return Ae(o.addTagToBackgroundShape(a,n))}),Q()(),Z(29,"mat-hint"),ce(30," If multiple tags are selected, the shape will be used for entities that have all of them. "),Q()()()(),Z(31,"div",37)(32,"button",38),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.duplicateBackgroundShape(n))}),Z(33,"mat-icon"),ce(34,"content_copy"),Q()(),Z(35,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.toggleBackgroundShapeIsActive(n))}),Z(36,"mat-icon"),ce(37),Q()()(),Z(38,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.removeBackgroundShape(n))}),Z(39,"mat-icon"),ce(40,"cancel"),Q()()()}if(i&2){let t=e.$implicit,r=Or(25),n=Se();oe(3),Re("backgroundShape",t),oe(),Re("value",t.color.substring(0,7)),oe(6),hh("value",t.type),oe(),hi(n.CUSTOMIZATION_ENTITY_TYPES),oe(5),hh("value",t.zoom),oe(),hi(n.CUSTOMIZATION_ZOOMS),oe(2),Je(t.type==="vehicle"?19:-1),oe(7),hi(t.tags),oe(2),Re("matChipInputAddOnBlur",!0)("matChipInputFor",r),oe(7),ax("matTooltip","",t.isActive?"Deactivate":"Activate"," Background Shape"),oe(2),_t(" ",t.isActive?"visibility":"visibility_off"," "),oe(),Re("matTooltip","Remove background shape")}}function NBe(i,e){i&1&&(Z(0,"div",9)(1,"p"),ce(2,"No custom icons added yet."),Q()())}function GBe(i,e){i&1&&Ge(0,"div",43)}function VBe(i,e){if(i&1&&(Z(0,"div",40),Ge(1,"div",41)(2,"div",42),Z(3,"div",30)(4,"div",31),Ge(5,"div",43)(6,"div",43),je(7,GBe,1,0,"div",43),Q(),Z(8,"div",31),Ge(9,"div",43),Q()(),Ge(10,"div",42),Q()),i&2){let t=Se().$implicit;oe(7),Je(t.type==="vehicle"?7:-1)}}function KBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function WBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function UBe(i,e){if(i&1){let t=vt();Z(0,"mat-form-field",32)(1,"mat-label"),ce(2,"Vehicle Mode"),Q(),Z(3,"input",44),mh("ngModelChange",function(n){Ee(t);let a=Se().$implicit;return dh(a.mode,n)||(a.mode=n),Ae(n)}),Q()()}if(i&2){let t=Se().$implicit;oe(3),hh("ngModel",t.mode)}}function jBe(i,e){if(i&1){let t=vt();Z(0,"mat-chip-row",45),Le("removed",function(){let n=Ee(t).$implicit,a=Se().$index,o=Se();return Ae(o.removeTagFromCustomTexture(a,n))})("edited",function(n){let a=Ee(t).$implicit,o=Se().$index,s=Se();return Ae(s.editTagInCustomTexture(o,a,n))}),ce(1),Z(2,"button",46)(3,"mat-icon"),ce(4,"cancel"),Q()()()}if(i&2){let t=e.$implicit;Re("aria-description","press enter to edit "+t)("editable",!0),oe(),_t(" ",t," "),oe(),Mt("aria-label","remove "+t)}}function qBe(i,e){if(i&1){let t=vt();Z(0,"div",11),je(1,VBe,11,1,"div",26),Z(2,"div",27),Ge(3,"img",47),Q(),Z(4,"button",48),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.uploadCustomTexture(n))}),Z(5,"mat-icon"),ce(6,"upload"),Q()(),Z(7,"div",30)(8,"div",31)(9,"mat-form-field",32)(10,"mat-label"),ce(11,"Type"),Q(),Z(12,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.type,n)||(a.type=n),Ae(n)}),ui(13,KBe,3,4,"mat-option",15,_o),Q()(),Z(15,"mat-form-field",32)(16,"mat-label"),ce(17,"Zoom"),Q(),Z(18,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.zoom,n)||(a.zoom=n),Ae(n)}),ui(19,WBe,3,4,"mat-option",15,_o),Q()(),je(21,UBe,4,1,"mat-form-field",32),Q(),Z(22,"div",31)(23,"mat-form-field",32)(24,"mat-label"),ce(25,"Tags"),Q(),Z(26,"mat-chip-grid",34,2),ui(28,jBe,5,4,"mat-chip-row",35,Ea),Z(30,"input",36),Le("matChipInputTokenEnd",function(n){let a=Ee(t).$index,o=Se();return Ae(o.addTagToCustomTexture(a,n))}),Q()(),Z(31,"mat-hint"),ce(32," If multiple tags are selected, the icon will be used for entities that have all of them. "),Q()()()(),Z(33,"div",37)(34,"button",49),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.duplicateCustomTexture(n))}),Z(35,"mat-icon"),ce(36,"content_copy"),Q()(),Z(37,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.toggleCustomTextureIsActive(n))}),Z(38,"mat-icon"),ce(39),Q()()(),Z(40,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.removeCustomTexture(n))}),Z(41,"mat-icon"),ce(42,"cancel"),Q()()()}if(i&2){let t=e.$implicit,r=Or(27),n=Se();oe(3),Re("src",t.url,rx),oe(9),hh("value",t.type),oe(),hi(n.CUSTOMIZATION_ENTITY_TYPES),oe(5),hh("value",t.zoom),oe(),hi(n.CUSTOMIZATION_ZOOMS),oe(2),Je(t.type==="vehicle"?21:-1),oe(7),hi(t.tags),oe(2),Re("matChipInputAddOnBlur",!0)("matChipInputFor",r),oe(7),ax("matTooltip","",t.isActive?"Deactivate":"Activate"," Custom Icon"),oe(2),_t(" ",t.isActive?"visibility":"visibility_off"," "),oe(),Re("matTooltip","Remove custom icon")}}function ZBe(i,e){if(i&1){let t=vt();Ri(0),Z(1,"div",13)(2,"div",27),Ge(3,"img",47),Q(),Z(4,"button",48),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.uploadDefaultTexture(n))}),Z(5,"mat-icon"),ce(6,"upload"),Q()(),Z(7,"mat-form-field",50),Ge(8,"input",51),Vr(9,"titlecase"),Q(),Z(10,"button",52),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.resetDefaultTexture(n))}),Z(11,"mat-icon"),ce(12,"restart_alt"),Q()()()}if(i&2){let t=e.$implicit,r=Se().getTextureUrlSignal(t)();oe(3),Re("src",r,rx),oe(5),ax("value","Default ",En(9,3,t.replaceAll("-"," "))," Icon")}}function YBe(i,e){if(i&1&&Ge(0,"div",54),i&2){let t=e.$implicit;yr("background-color",t)}}function JBe(i,e){if(i&1&&(Z(0,"div",16)(1,"span"),ce(2,"Light Preset:"),Q(),ui(3,YBe,1,2,"div",53,_o),Q()),i&2){let t=Se();oe(3),hi(t.PRESET_LIGHT_COLOR_THEME)}}function $Be(i,e){if(i&1&&Ge(0,"div",54),i&2){let t=e.$implicit;yr("background-color",t)}}function XBe(i,e){if(i&1&&(Z(0,"div",16)(1,"span"),ce(2,"Saturated Preset:"),Q(),ui(3,$Be,1,2,"div",53,_o),Q()),i&2){let t=Se();oe(3),hi(t.PRESET_SATURATED_COLOR_THEME)}}function QBe(i,e){i&1&&Ge(0,"div",60)}function eRe(i,e){if(i&1){let t=vt();Z(0,"div",57),je(1,QBe,1,0,"div",58),Z(2,"input",59),Le("input",function(n){let a=Ee(t).$index,o=Se(2);return Ae(o.onColorChange(a,n))}),Q()()}if(i&2){let t=e.$implicit;oe(2),Re("value",t)}}function tRe(i,e){if(i&1){let t=vt();Z(0,"div",16)(1,"span"),ce(2,"Custom:"),Q(),Z(3,"button",55),Le("click",function(){Ee(t);let n=Se();return Ae(n.removeCustomColor())}),Z(4,"mat-icon"),ce(5,"remove_circle_outline"),Q()(),Z(6,"div",56),Le("cdkDropListDropped",function(n){Ee(t);let a=Se();return Ae(a.dropCustomColor(n))}),ui(7,eRe,3,1,"div",57,_o),Q(),Z(9,"button",55),Le("click",function(){Ee(t);let n=Se();return Ae(n.addCustomColor())}),Z(10,"mat-icon"),ce(11,"add_circle_outline"),Q()()(),Z(12,"span"),ce(13,"*Click to set their color. Drag to change their order."),Q()}if(i&2){let t=Se();oe(3),Re("disabled",!t.canRemoveColor()),oe(4),hi(t.customColors()),oe(2),Re("disabled",!t.canAddColor())}}function iRe(i,e){if(i&1&&(Z(0,"div",18),Ri(1),Ge(2,"img",47)(3,"div",61),Q()),i&2){let t=e.$implicit,r=Se(),n=r.getTextureUrlSignal(t)();oe(2),Re("src",n,rx),oe(),yr("background-color",r.testScaleColor)("mask-image","url("+n+")")("webkit-mask-image","url("+n+")")}}var rRe=["vehicle","passenger","stop","zoomed-out-vehicle","zoomed-out-passenger","zoomed-out-stop"],iM=class i{constructor(e,t){this.dialogRef=e;this.spritesService=t;this.SPRITE_SIZE=this.spritesService.SPRITE_SIZE,this.PRESET_LIGHT_COLOR_THEME=this.spritesService.PRESET_LIGHT_COLOR_THEME,this.PRESET_SATURATED_COLOR_THEME=this.spritesService.PRESET_SATURATED_COLOR_THEME,this.vehicleTextureUrlSignal.set(this.spritesService.vehicleTexture.baseTexture.resource.url),this.passengerTextureUrlSignal.set(this.spritesService.passengerTexture.baseTexture.resource.url),this.stopTextureUrlSignal.set(this.spritesService.stopTexture.baseTexture.resource.url),this.zoomedOutVehicleTextureUrlSignal.set(this.spritesService.zoomedOutVehicleTexture.baseTexture.resource.url),this.zoomedOutPassengerTextureUrlSignal.set(this.spritesService.zoomedOutPassengerTexture.baseTexture.resource.url),this.zoomedOutStopTextureUrlSignal.set(this.spritesService.zoomedOutStopTexture.baseTexture.resource.url),this.customTexturesSignal.set(this.spritesService.customTextures),this.backgroundShapesSignal.set(this.spritesService.backgroundShapes),this.colorPresetIndex=this.spritesService.colorPresetIndex,this.customColors.set(structuredClone(this.spritesService.customColors))}SPRITE_SIZE;PRESET_LIGHT_COLOR_THEME;PRESET_SATURATED_COLOR_THEME;EDITABLE_DEFAULT_ICON_TYPES=rRe;CUSTOMIZATION_ENTITY_TYPES=o$;CUSTOMIZATION_ZOOMS=s$;MIN_COLOR_COUNT=2;MAX_COLOR_COUNT=12;currentError="";colorPresetIndex=0;customColors=Bt(["#00ff00","#ff0000"]);testScaleValue=0;testScaleColor="#ffffff";customTexturesSignal=Bt([]);backgroundShapesSignal=Bt([]);vehicleTextureUrlSignal=Bt("");passengerTextureUrlSignal=Bt("");stopTextureUrlSignal=Bt("");zoomedOutVehicleTextureUrlSignal=Bt("");zoomedOutPassengerTextureUrlSignal=Bt("");zoomedOutStopTextureUrlSignal=Bt("");uploadButton=lh.required("iconFileUpload");selectedTextureIndex=null;selectedDefaultTextureType=null;dropCustomColor(e){this.customColors.update(t=>(Bf(t,e.previousIndex,e.currentIndex),t)),this.applyColorGradientTester()}canRemoveColor=$t(()=>this.customColors().length>this.MIN_COLOR_COUNT);canAddColor=$t(()=>this.customColors().length<this.MAX_COLOR_COUNT);addCustomColor(){this.canAddColor()&&(this.customColors.update(e=>[...e,"#dd0000"]),this.applyColorGradientTester())}removeCustomColor(){this.canRemoveColor()&&(this.customColors.update(e=>(e.pop(),[...e])),this.applyColorGradientTester())}onColorChange(e,t){let r=t.target.value;this.customColors.update(n=>(n[e]=r,n)),this.applyColorGradientTester()}onColorSetIndexChange(e){this.applyColorGradientTester()}onColorScaleChange(e){this.testScaleValue=parseInt(e.target.value)/100,this.applyColorGradientTester()}applyColorGradientTester(){let e=[];if(this.colorPresetIndex==0&&(e=this.spritesService.PRESET_LIGHT_COLOR_THEME),this.colorPresetIndex==1&&(e=this.spritesService.PRESET_SATURATED_COLOR_THEME),this.colorPresetIndex==2&&(e=this.customColors()),this.testScaleValue===0){this.testScaleColor="#ffffff";return}let t=Hf(e),r=sc(t(this.testScaleValue))?.formatHex()??"#ffffff";this.testScaleColor=r}onIconFileUpload(e){let t=e.target;if(!t||!t.files)return;let r=new FileReader;r.onloadend=()=>Ce(this,null,function*(){if(r.result)try{let n=yield hq.read(r.result);n.resize({w:this.SPRITE_SIZE});let a=yield n.getBase64("image/png");if(this.selectedTextureIndex!==null)this.setCustomTexture(this.selectedTextureIndex,a);else if(this.selectedDefaultTextureType!==null)this.getTextureUrlSignal(this.selectedDefaultTextureType).set(a);else{this.currentError="No texture selected for upload.";return}this.currentError=""}catch{this.currentError="Cannot upload this image."}finally{t.value=""}}),r.readAsDataURL(t.files[0])}onConfigurationFileUpload(e){let t=e.target;if(!t||!t.files)return;let r=new FileReader;r.onloadend=()=>{if(r.result)try{let n=JSON.parse(r.result);if(n.version!==this.spritesService.VERSION){this.currentError="Import data format is outdated.";return}if(n.vehicleTextureUrl===void 0){this.currentError="JSON has missing data: vehicleTextureUrl";return}if(n.passengerTextureUrl===void 0){this.currentError="JSON has missing data: passengerTextureUrl";return}if(n.stopTextureUrl===void 0){this.currentError="JSON has missing data: stopTextureUrl";return}if(n.zoomedOutVehicleTextureUrl===void 0){this.currentError="JSON has missing data: zoomedOutVehicleTextureUrl";return}if(n.zoomedOutPassengerTextureUrl===void 0){this.currentError="JSON has missing data: zoomedOutPassengerTextureUrl";return}if(n.zoomedOutStopTextureUrl===void 0){this.currentError="JSON has missing data: zoomedOutStopTextureUrl";return}if(n.customTextures===void 0){this.currentError="JSON has missing data: customTextures";return}if(n.colorPresetIndex===void 0){this.currentError="JSON has missing data: colorPresetIndex";return}if(n.customColors===void 0){this.currentError="JSON has missing data: customColors";return}this.vehicleTextureUrlSignal.set(n.vehicleTextureUrl),this.passengerTextureUrlSignal.set(n.passengerTextureUrl),this.stopTextureUrlSignal.set(n.stopTextureUrl),this.zoomedOutVehicleTextureUrlSignal.set(n.zoomedOutVehicleTextureUrl),this.zoomedOutPassengerTextureUrlSignal.set(n.zoomedOutPassengerTextureUrl),this.zoomedOutStopTextureUrlSignal.set(n.zoomedOutStopTextureUrl),this.customTexturesSignal.set(n.customTextures),this.backgroundShapesSignal.set(n.backgroundShapes),this.colorPresetIndex=n.colorPresetIndex,n.customColors.length>=2&&this.customColors.set(n.customColors),this.currentError=""}catch{this.currentError="Could not parse JSON data."}finally{t.value=""}},r.readAsText(t.files[0])}uploadDefaultTexture(e){this.selectedTextureIndex=null,this.selectedDefaultTextureType=e,this.uploadButton().nativeElement.click()}getTextureUrlSignal(e){switch(e){case"vehicle":return this.vehicleTextureUrlSignal;case"passenger":return this.passengerTextureUrlSignal;case"stop":return this.stopTextureUrlSignal;case"zoomed-out-vehicle":return this.zoomedOutVehicleTextureUrlSignal;case"zoomed-out-passenger":return this.zoomedOutPassengerTextureUrlSignal;case"zoomed-out-stop":return this.zoomedOutStopTextureUrlSignal}}resetDefaultTexture(e){switch(e){case"vehicle":this.vehicleTextureUrlSignal.set(this.spritesService.DEFAULT_VEHICLE_TEXTURE_URL);break;case"passenger":this.passengerTextureUrlSignal.set(this.spritesService.DEFAULT_PASSENGER_TEXTURE_URL);break;case"stop":this.stopTextureUrlSignal.set(this.spritesService.DEFAULT_STOP_TEXTURE_URL);break;case"zoomed-out-vehicle":this.zoomedOutVehicleTextureUrlSignal.set(this.spritesService.DEFAULT_ZOOMED_OUT_VEHICLE_TEXTURE_URL);break;case"zoomed-out-passenger":this.zoomedOutPassengerTextureUrlSignal.set(this.spritesService.DEFAULT_ZOOMED_OUT_PASSENGER_TEXTURE_URL);break;case"zoomed-out-stop":this.zoomedOutStopTextureUrlSignal.set(this.spritesService.DEFAULT_ZOOMED_OUT_STOP_TEXTURE_URL)}}uploadCustomTexture(e){this.selectedTextureIndex=e,this.selectedDefaultTextureType=null,this.uploadButton().nativeElement.click()}addCustomTexture(){this.customTexturesSignal.update(e=>[...e,{mode:null,url:this.spritesService.DEFAULT_UNDEFINED_TEXTURE_URL,tags:[],type:"vehicle",zoom:"any",isActive:!0}])}removeCustomTexture(e){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(t=>(t.splice(e,1),[...t]))}setCustomTexture(e,t){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(r=>(r[e].url=t,[...r]))}dropCustomTexture(e){this.customTexturesSignal.update(t=>(Bf(t,e.previousIndex,e.currentIndex),structuredClone(t)))}addTagToCustomTexture(e,t){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(r=>{let n=structuredClone(r[e]),a=t.value.trim();return a?(n.tags.includes(a)||(n.tags.push(a),n.tags.sort()),t.chipInput.clear(),r[e]=n,[...r]):r})}removeTagFromCustomTexture(e,t){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(r=>{let n=structuredClone(r[e]);return n.tags=n.tags.filter(a=>a!==t),r[e]=n,[...r]})}editTagInCustomTexture(e,t,r){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(n=>{let a=structuredClone(n[e]),o=r.value.trim();return t&&(a.tags=a.tags.filter(s=>s!==t)),o&&!a.tags.includes(o)&&(a.tags.push(o),a.tags.sort()),n[e]=a,[...n]})}addBackgroundShape(){this.backgroundShapesSignal.update(e=>[...e,{color:"#ff000080",shape:"circle",mode:null,tags:[],type:"vehicle",zoom:"any",isActive:!0}])}removeBackgroundShape(e){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(t=>(t.splice(e,1),[...t]))}dropBackgroundShape(e){this.backgroundShapesSignal.update(t=>(Bf(t,e.previousIndex,e.currentIndex),structuredClone(t)))}addTagToBackgroundShape(e,t){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(r=>{let n=structuredClone(r[e]),a=t.value.trim();return a?(n.tags.includes(a)||(n.tags.push(a),n.tags.sort()),t.chipInput.clear(),r[e]=n,[...r]):r})}removeTagFromBackgroundShape(e,t){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(r=>{let n=structuredClone(r[e]);return n.tags=n.tags.filter(a=>a!==t),r[e]=n,[...r]})}editTagInBackgroundShape(e,t,r){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(n=>{let a=structuredClone(n[e]),o=r.value.trim();return t&&(a.tags=a.tags.filter(s=>s!==t)),o&&!a.tags.includes(o)&&(a.tags.push(o),a.tags.sort()),n[e]=a,[...n]})}onBackgroundShapeTypeChange(e,t){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(r=>{let n=structuredClone(r[e]);return n.shape=t,r[e]=n,[...r]})}onBackgroundShapeColorChange(e,t){if(e>=this.backgroundShapesSignal().length)return;let r=t.target.value;this.backgroundShapesSignal.update(n=>{let a=structuredClone(n[e]);return a.color=r+"80",n[e]=a,[...n]})}exportTextures(){let e={version:this.spritesService.VERSION,vehicleTextureUrl:this.vehicleTextureUrlSignal(),passengerTextureUrl:this.passengerTextureUrlSignal(),stopTextureUrl:this.stopTextureUrlSignal(),zoomedOutVehicleTextureUrl:this.zoomedOutVehicleTextureUrlSignal(),zoomedOutPassengerTextureUrl:this.zoomedOutPassengerTextureUrlSignal(),zoomedOutStopTextureUrl:this.zoomedOutStopTextureUrlSignal(),customTextures:this.customTexturesSignal(),backgroundShapes:this.backgroundShapesSignal(),colorPresetIndex:this.colorPresetIndex,customColors:this.customColors()},t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download="multimodal-icons.json",n.click(),URL.revokeObjectURL(r)}onSave(){this.spritesService.saveTextureData(this.vehicleTextureUrlSignal(),this.passengerTextureUrlSignal(),this.stopTextureUrlSignal(),this.zoomedOutVehicleTextureUrlSignal(),this.zoomedOutPassengerTextureUrlSignal(),this.zoomedOutStopTextureUrlSignal(),this.customTexturesSignal(),this.backgroundShapesSignal(),this.colorPresetIndex,this.customColors()),this.dialogRef.close()}duplicateCustomTexture(e){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(t=>{let r=structuredClone(t[e]);return[...t.slice(0,e+1),r,...t.slice(e+1)]})}duplicateBackgroundShape(e){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(t=>{let r=structuredClone(t[e]);return[...t.slice(0,e+1),r,...t.slice(e+1)]})}toggleCustomTextureIsActive(e){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(t=>{let r=structuredClone(t[e]);return r.isActive=!r.isActive,t[e]=r,[...t]})}toggleBackgroundShapeIsActive(e){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(t=>{let r=structuredClone(t[e]);return r.isActive=!r.isActive,t[e]=r,[...t]})}static \u0275fac=function(t){return new(t||i)(rt(jo),rt(Zg))};static \u0275cmp=tt({type:i,selectors:[["app-edit-map-icons-dialog"]],viewQuery:function(t,r){t&1&&ch(r.uploadButton,PBe,5),t&2&&uh()},decls:66,vars:11,consts:[["iconFileUpload",""],["configurationFileUpload",""],["chipGrid",""],["mat-dialog-title",""],["type","file","accept",".png, .jpg, .jpeg, .bmp",1,"file-upload",3,"change"],["type","file","accept",".json",1,"file-upload",3,"change"],[1,"text-content"],[1,"add-container"],["mat-button","",1,"add-button",3,"click"],[1,"no-custom-textures"],["cdkDropList","","cdkDropListOrientation","vertical",1,"icon-list",3,"cdkDropListDropped"],["cdkDrag","",1,"icon-list-item"],[1,"icon-list"],[1,"icon-list-item"],[1,"color-group",3,"ngModelChange","change","ngModel"],[3,"value"],[1,"color-list-container"],[1,"color-tester"],[1,"icon","wrapper-icon"],["min","0","max","100","discrete","","showTickMarks",""],["matSliderThumb","",3,"input"],[1,"file-porters"],["mat-icon-button","","matTooltip","Export JSON",3,"click"],["mat-icon-button","","matTooltip","Import JSON",3,"click"],["mat-button","","mat-dialog-close",""],["mat-button","",3,"click"],["class","icon-placeholder-container icon-list-item",4,"cdkDragPlaceholder"],[1,"icon"],[3,"shapeChange","backgroundShape"],["type","color",1,"shape-color-picker",3,"input","value"],[1,"form-fields"],[1,"form-field-row"],["appearance","outline","subscriptSizing","dynamic",1,"compact-input","custom-icon-form-field"],[3,"valueChange","value"],["aria-label","Enter fruits"],[3,"aria-description","editable"],[3,"matChipInputTokenEnd","matChipInputAddOnBlur","matChipInputFor"],[1,"flex-column","gap-0-5-rem"],["mat-icon-button","","matTooltip","Duplicate Background Shape",3,"click"],["mat-icon-button","",3,"click","matTooltip"],[1,"icon-placeholder-container","icon-list-item"],[1,"icon-placeholder","icon"],[1,"icon-button-placeholder"],[1,"form-field-placeholder","custom-icon-form-field"],["matInput","",3,"ngModelChange","ngModel"],[3,"removed","edited","aria-description","editable"],["matChipRemove",""],["width","40","alt","icon",3,"src"],["mat-icon-button","","matTooltip","Upload image",3,"click"],["mat-icon-button","","matTooltip","Duplicate Custom Icon",3,"click"],["appearance","outline","subscriptSizing","dynamic",1,"compact-input","default-icon-type"],["matInput","","disabled","",3,"value"],["mat-icon-button","","matTooltip","Reset icon",3,"click"],[1,"preset-color",3,"background-color"],[1,"preset-color"],["mat-icon-button","",1,"mini-icon-button",3,"click","disabled"],["cdkDropList","","cdkDropListOrientation","horizontal",1,"custom-color-list",3,"cdkDropListDropped"],["cdkDrag","",1,"custom-color"],["class","color-placeholder",4,"cdkDragPlaceholder"],["type","color",1,"color-picker",3,"input","value"],[1,"color-placeholder"],[1,"color-overlay"]],template:function(t,r){if(t&1){let n=vt();Z(0,"h1",3),ce(1,"Customize Entities"),Q(),Z(2,"mat-dialog-content")(3,"h2"),ce(4,"Edit Icons"),Q(),Z(5,"input",4,0),Le("change",function(o){return Ee(n),Ae(r.onIconFileUpload(o))}),Q(),Z(7,"input",5,1),Le("change",function(o){return Ee(n),Ae(r.onConfigurationFileUpload(o))}),Q(),Z(9,"div")(10,"div",6)(11,"p"),ce(12),Q(),Z(13,"p"),ce(14," The icons are in decreasing order of priority, meaning that if two icons match for an entity, the one that appears first in the list will be used. You can drag and drop the icons lines to change their order. Background shapes are also in decreasing order of priority, but have no effect on the icons. These shapes are displayed behind the icons and are generally used to visually group entities. "),Q(),je(15,BBe,2,1,"mat-error"),Q(),Z(16,"div",7)(17,"button",8),Le("click",function(){return Ee(n),Ae(r.addCustomTexture())}),ce(18," Add Custom Icon "),Q(),Z(19,"button",8),Le("click",function(){return Ee(n),Ae(r.addBackgroundShape())}),ce(20," Add Background Shape "),Q()(),je(21,RBe,3,0,"div",9),Z(22,"section",10),Le("cdkDropListDropped",function(o){return Ee(n),Ae(r.dropBackgroundShape(o))}),ui(23,HBe,41,11,"div",11,_o),Ge(25,"mat-divider"),Q(),je(26,NBe,3,0,"div",9),Z(27,"section",10),Le("cdkDropListDropped",function(o){return Ee(n),Ae(r.dropCustomTexture(o))}),ui(28,qBe,43,10,"div",11,_o),Ge(30,"mat-divider"),Q(),Z(31,"section",12),ui(32,ZBe,13,5,"div",13,Ea),Ge(34,"mat-divider"),Z(35,"h2"),ce(36,"Capacity color gradient"),Q(),Z(37,"mat-radio-group",14),mh("ngModelChange",function(o){return Ee(n),dh(r.colorPresetIndex,o)||(r.colorPresetIndex=o),Ae(o)}),Le("change",function(o){return Ee(n),Ae(r.onColorSetIndexChange(o))}),Z(38,"mat-radio-button",15),ce(39,"Light"),Q(),Z(40,"mat-radio-button",15),ce(41,"Saturated"),Q(),Z(42,"mat-radio-button",15),ce(43,"Custom"),Q()(),je(44,JBe,5,0,"div",16)(45,XBe,5,0,"div",16)(46,tRe,14,2),Z(47,"span"),ce(48,"*Test the color gradient using the slider below."),Q(),Z(49,"div",17),ui(50,iRe,4,7,"div",18,Ea),Z(52,"mat-slider",19)(53,"input",20),Le("input",function(o){return Ee(n),Ae(r.onColorScaleChange(o))}),Q()()()()()(),Z(54,"mat-dialog-actions")(55,"div",21)(56,"button",22),Le("click",function(){return Ee(n),Ae(r.exportTextures())}),Z(57,"mat-icon"),ce(58,"download_for_offline"),Q()(),Z(59,"button",23),Le("click",function(){Ee(n);let o=Or(8);return Ae(o.click())}),Z(60,"mat-icon"),ce(61,"upload_file"),Q()()(),Z(62,"button",24),ce(63,"Cancel"),Q(),Z(64,"button",25),Le("click",function(){return Ee(n),Ae(r.onSave())}),ce(65,"Save"),Q()()}t&2&&(oe(12),_t(" The uploaded icons will be rescaled to ",r.SPRITE_SIZE,"px in width. For a better result, the icons should not be too wide or too thin. "),oe(3),Je(r.currentError!==""?15:-1),oe(6),Je(r.backgroundShapesSignal().length<=0?21:-1),oe(2),hi(r.backgroundShapesSignal()),oe(3),Je(r.customTexturesSignal().length<=0?26:-1),oe(2),hi(r.customTexturesSignal()),oe(4),hi(r.EDITABLE_DEFAULT_ICON_TYPES),oe(5),hh("ngModel",r.colorPresetIndex),oe(),Re("value",0),oe(2),Re("value",1),oe(2),Re("value",2),oe(2),Je(r.colorPresetIndex===0?44:-1),oe(),Je(r.colorPresetIndex===1?45:-1),oe(),Je(r.colorPresetIndex===2?46:-1),oe(4),hi(r.EDITABLE_DEFAULT_ICON_TYPES))},dependencies:[Os,Is,Fs,vo,Br,pn,Xl,Cw,Ps,ec,uR,ha,ac,zs,Ef,Af,Rs,Eh,Dw,$l,tc,So,qo,pr,mr,Ah,Kw,Rn,Da,qw,jw,Ff,Uw,Hb,Lf,u8,c8,l8,cx,qn,_8,b8,Df,UR,tM],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}p[_ngcontent-%COMP%]{margin-top:0}.add-container[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:10px}.icon-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.icon-list-item[_ngcontent-%COMP%]{padding:5px 0;width:100%;display:flex;flex-direction:row;align-items:center;gap:10px;overflow:visible}.icon[_ngcontent-%COMP%]{width:40px;display:flex;align-items:baseline;justify-content:center}.form-fields[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;min-width:0;flex:1}.form-field-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:10px}.custom-icon-form-field[_ngcontent-%COMP%]{flex:1}.icon-placeholder-container[_ngcontent-%COMP%]{--placeholder-background-color: #f0f0f0;border:dotted 3px #999}.icon-placeholder[_ngcontent-%COMP%]{background-color:var(--placeholder-background-color);min-height:40px}.icon-button-placeholder[_ngcontent-%COMP%]{background-color:var(--placeholder-background-color);min-width:48px;min-height:48px}.form-field-placeholder[_ngcontent-%COMP%]{background-color:var(--placeholder-background-color);border-radius:4px;min-height:36px}.file-upload[_ngcontent-%COMP%]{display:none}.file-porters[_ngcontent-%COMP%]{margin-right:auto}.file-porters[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.color-title[_ngcontent-%COMP%]{margin:0}.color-group[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.color-picker[_ngcontent-%COMP%]{border:none;width:15px;height:15px;margin:2px;padding:0;background:none;cursor:pointer}.color-picker[_ngcontent-%COMP%]::-webkit-color-swatch-wrapper{padding:0}.color-picker[_ngcontent-%COMP%]::-webkit-color-swatch{border:1px solid black;border-radius:0}.color-picker[_ngcontent-%COMP%]::-moz-color-swatch{border:1px solid black;border-radius:0}.shape-color-picker[_ngcontent-%COMP%]{border:none;width:24px;height:24px;margin:8px;padding:0;background:none;cursor:pointer}.shape-color-picker[_ngcontent-%COMP%]::-webkit-color-swatch-wrapper{padding:0}.shape-color-picker[_ngcontent-%COMP%]::-webkit-color-swatch{border:1px solid black;border-radius:0}.shape-color-picker[_ngcontent-%COMP%]::-moz-color-swatch{border:1px solid black;border-radius:0}.color-list-container[_ngcontent-%COMP%], .custom-color-list[_ngcontent-%COMP%], .custom-color[_ngcontent-%COMP%], .preset-color[_ngcontent-%COMP%]{display:flex;align-items:center}.color-list-container[_ngcontent-%COMP%]{gap:5px}.preset-color[_ngcontent-%COMP%]{width:15px;height:15px;border:1px solid black}.color-placeholder[_ngcontent-%COMP%]{background:#ccc;border:dotted 3px #999;width:15px;height:15px;transition:transform .25s cubic-bezier(0,0,.2,1)}.mini-icon-button[_ngcontent-%COMP%]{width:32px;height:32px;padding:7px 4px 4px}.mini-icon-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px}.color-tester[_ngcontent-%COMP%]{display:flex;gap:10px}.wrapper-icon[_ngcontent-%COMP%]{position:relative}.color-overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0;mix-blend-mode:multiply;pointer-events:none;mask-repeat:no-repeat;width:40px;height:100%;mask-size:40px;-webkit-mask-repeat:no-repeat;-webkit-mask-size:contain}.default-icon-type[_ngcontent-%COMP%]{flex:1}mat-divider[_ngcontent-%COMP%]{padding-block-end:1rem}"]})};function nRe(i,e){i&1&&(Z(0,"mat-icon",2),ce(1," error "),Q())}function aRe(i,e){i&1&&(Z(0,"mat-icon",3),ce(1," warning "),Q())}function oRe(i,e){i&1&&(Z(0,"mat-icon"),ce(1," info "),Q())}function sRe(i,e){}function lRe(i,e){if(i&1&&(Z(0,"button",4),ce(1),Q()),i&2){let t,r=Se();Re("mat-dialog-close",!1),oe(),_t(" ",(t=r.data.cancelButtonOverride)!==null&&t!==void 0?t:"Close"," ")}}var rM=class i{constructor(e){this.data=e}static \u0275fac=function(t){return new(t||i)(rt(sm))};static \u0275cmp=tt({type:i,selectors:[["app-information-dialog"]],decls:14,vars:6,consts:[["mat-dialog-title",""],[1,"flex-row","align-main-start","align-cross-center","gap-1-rem"],[1,"text-red"],[1,"text-yellow"],["mat-button","",3,"mat-dialog-close"]],template:function(t,r){if(t&1&&(Z(0,"h2",0),ce(1),Q(),Z(2,"mat-dialog-content")(3,"div",1),je(4,nRe,2,0,"mat-icon",2)(5,aRe,2,0,"mat-icon",3)(6,oRe,2,0,"mat-icon")(7,sRe,0,0),Z(8,"p"),ce(9),Q()()(),Z(10,"mat-dialog-actions"),je(11,lRe,2,2,"button",4),Z(12,"button",4),ce(13),Q()()),t&2){let n,a;oe(),Ti(r.data.title),oe(3),Je((n=r.data.type)==="error"?4:n==="warning"?5:n==="info"?6:7),oe(5),_t(" ",r.data.message," "),oe(2),Je(r.data.canCancel?11:-1),oe(),Re("mat-dialog-close",!0),oe(),_t(" ",(a=r.data.confirmButtonOverride)!==null&&a!==void 0?a:r.data.canCancel?"Confirm":"Close"," ")}},dependencies:[Is,Os,vo,Fs,Br,pn,mr],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}mat-icon[_ngcontent-%COMP%]{min-width:24px}"]})};var v$=go(nI());var cRe=["starting","paused","running","stopping","completed","lost","corrupted","outdated","future"];function uRe(i){return cRe.includes(i)}var Bu=["starting","running","paused","stopping","lost"],f$={starting:0,running:1,paused:1,stopping:2,lost:3,completed:4,corrupted:5,outdated:5,future:5};function g$(i){if(typeof i!="string")return console.error("Invalid data type for start time",i),null;if(!/^\d{8}-\d{9}$/.test(i))return console.error("Invalid format for start time",i),null;let e=parseInt(i.slice(0,4)),t=parseInt(i.slice(4,6))-1,r=parseInt(i.slice(6,8)),n=parseInt(i.slice(9,11)),a=parseInt(i.slice(11,13)),o=parseInt(i.slice(13,15)),s=parseInt(i.slice(16,19));return new Date(e,t,r,n,a,o,s)}function hRe(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for simulation",i),null;if(!("id"in i)||typeof i.id!="string")return console.error("Invalid simulation ID in simulation",i),null;let e=i.id;if(!("status"in i)||!uRe(i.status))return console.error("Invalid simulation status in simulation",i),null;let t=i.status;if(i.status==="corrupted"){let g=i.id.split(lf)[1]??"unknown",_=g$(i.id.split(lf)[0])??new Date(0);return{id:e,name:g,data:"unknown",status:t,startTime:_,simulationStartTime:null,simulationEndTime:null,simulationTime:null,simulationEstimatedEndTime:null,lastUpdateIndex:null,completion:-1,configuration:{maxDuration:null},polylinesVersion:-1,size:null}}if(!("name"in i)||typeof i.name!="string")return console.error("Invalid simulation name in simulation",i),null;let r=i.name;if(!("data"in i)||typeof i.data!="string")return console.error("Invalid simulation data in simulation",i),null;let n=i.data;if(!("startTime"in i))return console.error("Invalid simulation start time in simulation",i),null;let a=g$(i.startTime);if(a===null)return console.error("Invalid simulation start time",i.startTime,"in simulation",i),null;let o=null;if("simulationStartTime"in i){if(typeof i.simulationStartTime!="number")return console.error("Invalid simulation start time",i.simulationStartTime,"in simulation",i),null;o=i.simulationStartTime}let s=null;if("simulationEndTime"in i){if(typeof i.simulationEndTime!="number")return console.error("Invalid simulation end time",i.simulationEndTime,"in simulation",i),null;s=i.simulationEndTime}let l=null;if("simulationTime"in i){if(typeof i.simulationTime!="number")return console.error("Invalid simulation time",i.simulationTime,"in simulation",i),null;l=i.simulationTime}let c=null;if("simulationEstimatedEndTime"in i){if(typeof i.simulationEstimatedEndTime!="number")return console.error("Invalid simulation estimated end time",i.simulationEstimatedEndTime,"in simulation",i),null;c=i.simulationEstimatedEndTime}let u=null;if("lastUpdateIndex"in i){if(typeof i.lastUpdateIndex!="number")return console.error("Invalid last update index",i.lastUpdateIndex,"in simulation",i),null;u=i.lastUpdateIndex}let h=1;Bu.includes(t)&&(o!==null&&l!==null&&c!==null?h=(l-o)/(c-o):(console.warn("Incomplete simulation data for completion calculation",i),h=0));let d=null;if("configuration"in i){if(typeof i.configuration!="object"||i.configuration===null)return console.error("Invalid configuration",i.configuration,"in simulation",i),null;if("maxDuration"in i.configuration){if(i.configuration.maxDuration!==null&&typeof i.configuration.maxDuration!="number")return console.error("Invalid max duration",i.configuration.maxDuration,"in simulation",i),null;d=i.configuration.maxDuration}}let p=-1;if("polylinesVersion"in i){if(typeof i.polylinesVersion!="number")return console.error("Invalid polylines version",i.polylinesVersion,"in simulation",i),null;p=i.polylinesVersion}let f=null;if("size"in i){if(i.size!==null&&typeof i.size!="number")return console.error("Invalid size",i.size,"in simulation",i),null;f=i.size}return{id:e,name:r,data:n,status:t,startTime:a,simulationStartTime:o,simulationEndTime:s,simulationTime:l,simulationEstimatedEndTime:c,lastUpdateIndex:u,completion:h,configuration:{maxDuration:d},polylinesVersion:p,size:f}}function y$(i){if(!Array.isArray(i))return console.error("Invalid data type for simulations",i),[];let e=[];for(let t of i){let r=hRe(t);if(r!==null)e.push(r);else return console.error("Invalid simulation data",t),null}return e}function _$(i,e){let t=f$[i.status],r=f$[e.status];return t<r?-1:t>r||i.startTime<e.startTime?1:-1}var To=class i{constructor(e,t){this.socket=e;this.dialogService=t;Ji(()=>{this._communicationStatusSignal()==="disconnected"?this.disconnectedDialogRef===null&&(this.disconnectedDialogRef=this.dialogService.openInformationDialog({title:"Disconnected",message:"The connection to the server has been lost. Please verify that the server is running and try again. The application will attempt to reconnect automatically.",type:"error",confirmButtonOverride:"Continue Anyway",cancelButtonOverride:null,canCancel:!1})):this.disconnectedDialogRef!==null&&(this.disconnectedDialogRef.close(),this.disconnectedDialogRef=null)}),this.onConnect(()=>{this._communicationStatusSignal.set("connected")}),this.onDisconnect(()=>{this._communicationStatusSignal.set("disconnected"),console.error("Disconnected from the server")}),this.on("error",r=>{console.error("Socket error:",r)}),setTimeout(()=>{this._communicationStatusSignal.update(r=>r==="connecting"?"disconnected":r)},1e3)}_communicationStatusSignal=Bt("connecting");disconnectedDialogRef=null;get isConnectedSignal(){return $t(()=>this._communicationStatusSignal()==="connected")}get communicationStatusSignal(){return this._communicationStatusSignal}emit(e,...t){this.socket.emit(e,...t)}on(e,t){this.socket.on(e,t)}onDisconnect(e){this.socket.on("disconnect",e)}onConnect(e){this.socket.on("connect",e)}removeAllListeners(e){this.socket.removeAllListeners(e)}static \u0275fac=function(t){return new(t||i)(Zt(sf),Zt(Js))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Qh=class i{constructor(e){this.communicationService=e;this.listen(),this.query(),this.communicationService.onConnect(()=>{this.query()})}_simulationsSignal=Bt([]);_availableSimulationDataSignal=Bt([]);get simulationsSignal(){return $t(()=>this._simulationsSignal().sort(_$))}get availableSimulationDataSignal(){return this._availableSimulationDataSignal}queryAvailableData(){this.communicationService.emit("get-available-data")}listen(){this.communicationService.on("simulations",e=>{let t=y$(e);if(t===null){console.error("Invalid simulations data",e);return}this._simulationsSignal.set(t)}),this.communicationService.on("available-data",e=>{if(!Array.isArray(e)||!e.every(t=>typeof t=="string")){console.error("Invalid available data",e);return}this._availableSimulationDataSignal.set(e)})}query(){this.querySimulations(),this.queryAvailableData()}querySimulations(){this.communicationService.emit("get-simulations")}static \u0275fac=function(t){return new(t||i)(Zt(To))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Jg=class i{constructor(e){this.http=e}apiUrl=Ux.apiUrl;exportFolder(e,t){return this.http.get(this.apiUrl+`${e}/${t}`,{responseType:"blob"})}importFolder(e,t,r){return this.http.post(this.apiUrl+`${e}/${t}`,r)}deleteFolder(e,t){return this.http.delete(this.apiUrl+`${e}/${t}`)}static \u0275fac=function(t){return new(t||i)(Zt(F_))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};function dRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Name is required"),Q())}function mRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Name must be at least 3 characters long"),Q())}function pRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Name must be at most 50 characters long"),Q())}function fRe(i,e){if(i&1&&(Z(0,"mat-error"),ce(1),Q()),i&2){let t=Se(2);oe(),_t(" The name must not contain the simulation save file separator (",t.SIMULATION_SAVE_FILE_SEPARATOR,") ")}}function gRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,' The name muse not contain characters that might affect the file system (e.g. /, \\, :, *, ?, ", <, >, |) '),Q())}function yRe(i,e){if(i&1&&(Z(0,"mat-option",14),ce(1),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),Ti(t)}}function _Re(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Data is required"),Q())}function bRe(i,e){if(i&1){let t=vt();Z(0,"h3"),ce(1,"General"),Q(),Z(2,"div",8)(3,"section",9)(4,"mat-form-field",10),Ge(5,"input",11),Z(6,"mat-label"),ce(7,"Name"),Q(),Z(8,"mat-hint"),ce(9,"Spaces will be replaced by underscores"),Q(),je(10,dRe,2,0,"mat-error")(11,mRe,2,0,"mat-error")(12,pRe,2,0,"mat-error")(13,fRe,2,1,"mat-error")(14,gRe,2,0,"mat-error"),Q(),Z(15,"mat-form-field",10)(16,"mat-select",12),Le("openedChange",function(){Ee(t);let n=Se();return Ae(n.refreshAvailableData())}),Z(17,"mat-option",13),Le("click",function(){Ee(t);let n=Se();return Ae(n.importInputData())}),ce(18,"\u2795 Import New Folder"),Q(),ui(19,yRe,2,2,"mat-option",14,Ea),Q(),Z(21,"mat-label"),ce(22,"Data"),Q(),je(23,_Re,2,0,"mat-error"),Q()(),Z(24,"mat-checkbox",15),ce(25," Run in background "),Q()()}if(i&2){let t=Se();oe(4),Re("subscriptSizing","dynamic"),oe(6),Je(t.nameFormControl.hasError("required")?10:t.nameFormControl.hasError("minlength")?11:t.nameFormControl.hasError("maxlength")?12:t.nameFormControl.hasError("invalidPattern")?13:t.nameFormControl.hasError("invalidCharacter")?14:-1),oe(5),Re("subscriptSizing","dynamic"),oe(4),hi(t.availableSimulationDataSignal()),oe(4),Je(t.dataFormControl.hasError("required")?23:-1)}}function vRe(i,e){i&1&&(Z(0,"span",3)(1,"mat-icon",16),ce(2,"error"),Q(),Z(3,"span"),ce(4,"Select a valid data source before changing the configuration the simulation"),Q()())}function SRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Max duration must be greater than 0"),Q())}function kRe(i,e){i&1&&ce(0," Start ")}function xRe(i,e){i&1&&ce(0," Save ")}var nM=class i{constructor(e,t,r,n,a){this.data=e;this.dataService=t;this.dialogRef=r;this.formBuilder=n;this.httpService=a;this.nameFormControl=this.formBuilder.control(null,[Fn.minLength(3),Fn.maxLength(50),this.validateName()]),this.data.mode==="start"&&this.nameFormControl.addValidators(Fn.required),this.dataFormControl=this.formBuilder.control(null),this.data.mode==="start"&&this.dataFormControl.addValidators(Fn.required),this.shouldRunInBackgroundFormControl=this.formBuilder.control(!1),this.maxDurationFormControl=this.formBuilder.control(null,[Fn.min(0)]),this.generalFormGroup=this.formBuilder.group({name:this.nameFormControl,data:this.dataFormControl,shouldRunInBackground:this.shouldRunInBackgroundFormControl}),this.configurationFormGroup=this.formBuilder.group({maxDuration:this.maxDurationFormControl}),this.formGroup=this.formBuilder.group({general:this.generalFormGroup,configuration:this.configurationFormGroup}),this.data.mode==="edit"&&this.data.currentConfiguration&&this.maxDurationFormControl.setValue(this.data.currentConfiguration.maxDuration===null?null:this.data.currentConfiguration.maxDuration/3600),this.data.mode==="start"&&(this.dataFormControl.valueChanges.pipe(gi(this.unsubscribe$)).subscribe(o=>{o?this.enableConfigurationFields():this.disableConfigurationFields()}),this.dataFormControl.value||this.disableConfigurationFields())}SIMULATION_SAVE_FILE_SEPARATOR=lf;formGroup;generalFormGroup;configurationFormGroup;nameFormControl;dataFormControl;maxDurationFormControl;shouldRunInBackgroundFormControl;unsubscribe$=new ct;ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}onSave(){this.formGroup.valid?this.dialogRef.close(this.buildResult()):console.error("Invalid form",this.formGroup)}get availableSimulationDataSignal(){return this.dataService.availableSimulationDataSignal}refreshAvailableData(){this.dataService.queryAvailableData()}buildResult(){let e=this.nameFormControl.value;return typeof e=="string"&&(e=e.trim().replace(/\s/g,"_")),{general:{name:e,data:this.dataFormControl.value,shouldRunInBackground:!!this.shouldRunInBackgroundFormControl.value},configuration:{maxDuration:this.maxDurationFormControl.value===null?null:Math.ceil(this.maxDurationFormControl.value*3600)}}}disableConfigurationFields(){this.maxDurationFormControl.disable()}enableConfigurationFields(){this.maxDurationFormControl.enable()}validateName(){return e=>{if(typeof e.value=="string"){if(e.value.match(lf))return{invalidPattern:!0};if(e.value.match(/[<>:"/\\|?*]/))return{invalidCharacter:!0}}return null}}importInputData(){let e=document.createElement("input");e.type="file",e.webkitdirectory=!0,e.multiple=!0;let t=r=>Ce(this,null,function*(){let n=r.target.files;if(!n||n.length===0)return;let a=new v$.default,o=n[0].webkitRelativePath.split("/")[0];for(let u of Array.from(n)){let h=u.webkitRelativePath.replace(o+"/","");a.file(h,u)}let s=yield a.generateAsync({type:"blob"}),l="input_data",c=new FormData;c.append("file",s,"folder.zip"),this.httpService.importFolder(l,o,c).subscribe({next:u=>{this.refreshAvailableData();let h="actual_folder_name"in u?u.actual_folder_name:o;setTimeout(()=>{this.dataFormControl.setValue(h)},100)},error:u=>{console.error("Upload failed:",u)}})});e.addEventListener("change",r=>{t(r).catch(n=>{console.error("Error handling file change:",n)})}),e.click()}exportInputData(e){this.httpService.exportFolder("input_data",e).subscribe(r=>{let n=new Blob([r],{type:"application/zip"}),a=window.URL.createObjectURL(n),o=document.createElement("a");o.href=a,o.download=e+".zip",document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(a)})}deleteInputData(e){this.httpService.deleteFolder("input_data",e).subscribe({next:r=>{r.message||r.error&&console.error("Failed to delete the data folder:",r.error)},error:r=>{console.error("HTTP error during deletion:",r)}})}static \u0275fac=function(t){return new(t||i)(rt(sm),rt(Qh),rt(jo),rt(wf),rt(Jg))};static \u0275cmp=tt({type:i,selectors:[["app-simulation-configuration-dialog"]],decls:24,vars:5,consts:[["mat-dialog-title",""],[3,"formGroup"],["formGroupName","configuration",1,"flex-column","gap-1-rem"],[1,"error-message","flex-row","align-cross-center","gap-0-5-rem"],["type","number","matInput","","formControlName","maxDuration"],["matTextSuffix",""],["mat-button","","mat-dialog-close",""],["mat-button","",3,"click"],["formGroupName","general"],[1,"flex-row","gap-1-rem","no-stretch"],[3,"subscriptSizing"],["matInput","","formControlName","name"],["formControlName","data",3,"openedChange"],[3,"click"],[3,"value"],["formControlName","shouldRunInBackground"],[1,"error-icon"]],template:function(t,r){if(t&1&&(Z(0,"h2",0),ce(1,"Configure Simulation"),Q(),Z(2,"mat-dialog-content")(3,"form",1),je(4,bRe,26,4),Z(5,"h3"),ce(6,"Simulation"),Q(),Z(7,"div",2),je(8,vRe,5,0,"span",3),Z(9,"mat-form-field"),Ge(10,"input",4),Z(11,"mat-label"),ce(12,"Simulation Duration (optional)"),Q(),je(13,SRe,2,0,"mat-error"),Z(14,"span",5),ce(15,"h"),Q(),Z(16,"mat-hint"),ce(17," The simulation will stop after this in-simulation duration, even if not finished (0.5 = 30min) "),Q()()()()(),Z(18,"mat-dialog-actions")(19,"button",6),ce(20,"Cancel"),Q(),Z(21,"button",7),Le("click",function(){return r.onSave()}),je(22,kRe,1,0)(23,xRe,1,0),Q()()),t&2){let n;oe(3),Re("formGroup",r.formGroup),oe(),Je(r.data.mode==="start"?4:-1),oe(4),Je(r.data.mode==="start"&&!r.dataFormControl.valid?8:-1),oe(5),Je(r.maxDurationFormControl.hasError("min")?13:-1),oe(9),Je((n=r.data.mode)==="start"?22:n==="edit"?23:-1)}},dependencies:[Os,Is,Fs,vo,Br,pn,ha,ac,zs,Ef,Af,Rw,Rs,wh,Ps,Cb,ec,xh,Bs,Tb,ww,Eh,Dw,$l,tc,Mw,So,qo,pr,mr],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}.error-icon[_ngcontent-%COMP%]{min-width:24px}.error-message[_ngcontent-%COMP%]{max-width:calc(424px + 1rem)}.no-stretch[_ngcontent-%COMP%]{align-items:flex-start}.no-stretch[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1}"]})};var Y$=go(nI());function aM(i){return new Date(i*1e3).toISOString().slice(11,19)}var ed=class i{transform(e){return aM(e)}static \u0275fac=function(t){return new(t||i)};static \u0275pipe=W4({name:"simulationTime",type:i,pure:!0})};var A$=go(sI());function hs(i){return typeof i=="object"&&i!==null&&"tags"in i&&Array.isArray(i.tags)&&i.tags.every(e=>typeof e=="string")}var MRe=["previous","current","next"];function lI(i){return MRe.includes(i)}function $g(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for leg",i),null;let e=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags in leg",i),null;e=i.tags.sort((u,h)=>u.localeCompare(h))}if(!("legType"in i)||!lI(i.legType))return console.error("Invalid leg type",i),null;let t=i.legType,r=null;if("assignedVehicleId"in i){if(i.assignedVehicleId!==null&&typeof i.assignedVehicleId!="string")return console.error("Invalid assigned vehicle ID",i.assignedVehicleId,"for leg",i),null;r=i.assignedVehicleId}let n=null;if("boardingStopId"in i){if(i.boardingStopId!==null&&typeof i.boardingStopId!="string")return console.error("Invalid boarding stop index",i.boardingStopId,"for leg",i),null;n=i.boardingStopId}let a=null;if("alightingStopId"in i){if(i.alightingStopId!==null&&typeof i.alightingStopId!="string")return console.error("Invalid alighting stop index",i.alightingStopId,"for leg",i),null;a=i.alightingStopId}let o=null;if("boardingStopIndex"in i){if(i.boardingStopIndex!==null&&typeof i.boardingStopIndex!="number")return console.error("Invalid boarding stop index",i.boardingStopIndex,"for leg",i),null;o=i.boardingStopIndex}let s=null;if("alightingStopIndex"in i){if(i.alightingStopIndex!==null&&typeof i.alightingStopIndex!="number")return console.error("Invalid alighting stop index",i.alightingStopIndex,"for leg",i),null;s=i.alightingStopIndex}let l=null;if("boardingTime"in i){if(i.boardingTime!==null&&typeof i.boardingTime!="number")return console.error("Invalid boarding time",i.boardingTime,"for leg",i),null;l=i.boardingTime}let c=null;if("alightingTime"in i){if(i.alightingTime!==null&&typeof i.alightingTime!="number")return console.error("Invalid alighting time",i.alightingTime,"for leg",i),null;c=i.alightingTime}return{tags:e,legType:t,assignedVehicleId:r,boardingStopId:n,alightingStopId:a,boardingStopIndex:o,alightingStopIndex:s,boardingTime:l,alightingTime:c}}var TRe=["release","assigned","ready","onboard","complete"];function cI(i){return TRe.includes(i)}function P$(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for passenger",i),null;if(!("id"in i)||typeof i.id!="string")return console.error("Invalid ID for passenger",i),null;let e=i.id,t=(0,A$.default)({seed:e});if(!("status"in i)||!cI(i.status))return console.error("Invalid status for passenger",i),null;let r=i.status;if(!("numberOfPassengers"in i)||typeof i.numberOfPassengers!="number")return console.error("Invalid number of passengers for passenger",i),null;let n=i.numberOfPassengers;if(!("previousLegs"in i)||!Array.isArray(i.previousLegs))return console.error("Invalid previous legs in passenger",i),null;let a=i.previousLegs.map($g);if(!a.every(c=>c!==null)){let c=a.find(u=>u===null);return console.error("Invalid previous legs, including",c,"in passenger",i),null}let o=null;if("currentLeg"in i&&(o=$g(i.currentLeg),o===null))return console.error("Invalid current leg in passenger",i),null;if(!("nextLegs"in i)||!Array.isArray(i.nextLegs))return console.error("Invalid next legs in passenger",i),null;let s=i.nextLegs.map($g);if(!s.every(c=>c!==null)){let c=s.find(u=>u===null);return console.error("Invalid next legs, including",c,"in passenger",i),null}let l=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags",i.tags,"in passenger",i),null;l=i.tags.sort((c,u)=>c.localeCompare(u))}return{id:e,name:t,entityType:"passenger",status:r,previousLegs:a,currentLeg:o,nextLegs:s,numberOfPassengers:n,tags:l,error:null}}function td(i){return i.previousLegs.forEach(e=>e.legType="previous"),i.currentLeg!==null&&(i.currentLeg.legType="current"),i.nextLegs.forEach(e=>e.legType="next"),i.previousLegs.concat(i.currentLeg===null?[]:[i.currentLeg],i.nextLegs)}function B$(i,e){let t=i.currentLeg??i.nextLegs[0]??null;return t===null||t.assignedVehicleId===null?null:t.boardingTime===null||t.boardingTime>e?t.boardingStopId===null?null:{stopId:t.boardingStopId,vehicleId:t.assignedVehicleId}:t.alightingTime===null||t.alightingTime>e||t.alightingStopId===null?null:{stopId:t.alightingStopId,vehicleId:t.assignedVehicleId}}function R$(i,e){let t=i.currentLeg??i.nextLegs[0]??null;return t===null||t.boardingTime===null||t.boardingTime>e?null:t.alightingTime===null||t.alightingTime>e?t.assignedVehicleId:null}function D$(i,e,t){let r=i.currentLeg??i.nextLegs[0]??null;return r===null?!1:r.boardingTime===null||r.boardingTime>t?e===r.boardingStopId:r.alightingTime===null||r.alightingTime>t?!1:e===r.alightingStopId}function L$(i,e,t){let r=i.currentLeg??i.nextLegs[0]??null;return r===null||r.boardingTime===null||r.boardingTime>t?!1:r.alightingTime===null||r.alightingTime>t?r.assignedVehicleId===e:!1}var Xg=class{constructor(e){this.compare=e}_items=[];add(e){let t=this.findInsertionIndex(e);this._items.splice(t,0,e)}shift(){return this._items.shift()}get length(){return this._items.length}get items(){return this._items}get editableItems(){return this._items}findInsertionIndex(e){let t=0,r=this._items.length-1;for(;t<=r;){let n=Math.floor((t+r)/2),a=this.compare(this._items[n],e);if(a<0)t=n+1;else if(a>0)r=n-1;else return n}return t}};var Ru=1,I$=2;function uI(){return new Xg((i,e)=>e.priority-i.priority)}var id=class{constructor(e,t){this.priority=e;this.queue=t}addToQueue(){this.queue.add(this)}get numberOfTasks(){return 1}},jm=class extends id{constructor(t,r,n){super(t,r);this.taskFunction=n}process(){this.taskFunction()}},Pl=class extends id{hasCalledBeforeAll=!1;subtasks=uI();constructor(e,t){super(e,t)}process(){if(!this.hasCalledBeforeAll)this.beforeAll(),this.hasCalledBeforeAll=!0;else{let e=this.subtasks.shift();if(!e){this.afterAll();return}e.process()}this.addToQueue()}get numberOfTasks(){return this.subtasks.items.reduce((e,t)=>e+t.numberOfTasks,1)}};function hI(i){return!(typeof i!="object"||i===null||!("latitude"in i)||typeof i.latitude!="number"||!("longitude"in i)||typeof i.longitude!="number")}var ERe=["previous","current","next"];function dI(i){return ERe.includes(i)}var ARe=10;function PRe(i){let e=hI(i)?i:i.position;return""+e.latitude+","+e.longitude}function Qg(i,e){if(typeof i!="object"||i===null)return console.error("Invalid data type for stop",i),null;let t=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags",i.tags,"in stop",i),null;t=i.tags.sort((u,h)=>u.localeCompare(h))}if(!("stopType"in i)||!dI(i.stopType))return console.error("Invalid stop type in stop",i),null;let r=i.stopType;if(!("arrivalTime"in i)||typeof i.arrivalTime!="number")return console.error("Invalid arrival time in stop",i),null;let n=i.arrivalTime,a=null;if("departureTime"in i){if(i.departureTime!==null&&typeof i.departureTime!="number")return console.error("Invalid departure time",i.departureTime,"in stop",i),null;a=i.departureTime}if(!("position"in i)||!hI(i.position))return console.error("Invalid position in stop",i),null;let o=i.position,s=ARe;if("capacity"in i){if(typeof i.capacity!="number")return console.error("Invalid capacity",i.capacity,"in stop",i),null;s=i.capacity}if(!("label"in i)||typeof i.label!="string")return console.error("Invalid label in stop",i),null;let l=i.label;return{id:PRe(o),name:l,entityType:"stop",tags:t,stopType:r,arrivalTime:n,departureTime:a,position:o,capacity:s,label:l,vehicleId:e,error:null}}var BRe=["release","idle","boarding","enroute","alighting","complete"];function mI(i){return BRe.includes(i)}function F$(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for vehicle",i),null;if(!("id"in i)||typeof i.id!="string")return console.error("Invalid ID for vehicle",i),null;let e=i.id;if(!("name"in i)||typeof i.name!="string")return console.error("Invalid name for vehicle",i),null;let t=i.name,r=null;if("mode"in i){if(typeof i.mode!="string")return console.error("Invalid mode for vehicle",i.mode,"in vehicle",i),null;r=i.mode}if(!("status"in i)||!mI(i.status))return console.error("Invalid status for vehicle",i),null;let n=i.status;if(!("previousStops"in i)||!Array.isArray(i.previousStops))return console.error("Invalid previous stops for vehicle",i),null;let a=i.previousStops.map(u=>Qg(u,e));if(!a.every(u=>u!==null)){let u=a.find(h=>h===null);return console.error("Invalid previous stops, including",u,"in vehicle",i),null}let o=null;if("currentStop"in i&&(o=Qg(i.currentStop,e),o===null))return console.error("Invalid current stop for vehicle",i),null;if(!("nextStops"in i)||!Array.isArray(i.nextStops))return console.error("Invalid next stops for vehicle",i),null;let s=i.nextStops.map(u=>Qg(u,e));if(!s.every(u=>u!==null)){let u=s.find(h=>h===null);return console.error("Invalid next stops, including",u,"in vehicle",i),null}if(!("capacity"in i)||typeof i.capacity!="number")return console.error("Invalid capacity for vehicle",i),null;let l=i.capacity,c=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags",i.tags,"for vehicle",i),null;c=i.tags.sort((u,h)=>u.localeCompare(h))}return{id:e,name:t,entityType:"vehicle",mode:r,status:n,previousStops:a,currentStop:o,nextStops:s,capacity:l,tags:c,error:null}}function Bl(i){return i.previousStops.forEach(e=>e.stopType="previous"),i.currentStop!==null&&(i.currentStop.stopType="current"),i.nextStops.forEach(e=>e.stopType="next"),i.previousStops.concat(i.currentStop===null?[]:[i.currentStop],i.nextStops)}function _I(){return{passengerTags:[],vehicleTags:[],stopTags:[],legTags:[],passengerLegs:{},vehicleStops:{}}}var sM=class extends Pl{constructor(t,r,n,a){super(I$,t);this.states=r;this.references=n;this.callback=a}continuousEnvironments=[];beforeAll(){for(let t of this.states)new gI(this.subtasks,t,this.references,this.continuousEnvironments).addToQueue()}afterAll(){this.callback(this.continuousEnvironments)}},gI=class extends Pl{constructor(t,r,n,a){super(0,t);this.state=r;this.references=n;this.continuousEnvironments=a;this.continuousEnvironment=this.buildEmptyContinuousEnvironment()}continuousEnvironment;beforeAll(){for(let r of Object.values(this.state.passengers))new jm(0,this.subtasks,()=>O$(this.continuousEnvironment.passengers,this.continuousEnvironment.allPassengers,r,this.continuousEnvironment.startTimestamp,this.continuousEnvironment.endTimestamp,this.state.updateIndex,this.references)).addToQueue();for(let r of Object.values(this.state.vehicles))new jm(0,this.subtasks,()=>z$(this.continuousEnvironment.vehicles,this.continuousEnvironment.allVehicles,r,this.continuousEnvironment.startTimestamp,this.continuousEnvironment.endTimestamp,this.state.updateIndex,this.references)).addToQueue();new jm(0,this.subtasks,()=>H$(this.continuousEnvironment.statistics,this.state.statistics,this.continuousEnvironment.startTimestamp,this.continuousEnvironment.endTimestamp,this.state.updateIndex)).addToQueue();let t=new yI(this.state,this.continuousEnvironment,this.references);for(let r of this.state.updates)new jm(-r.updateIndex-1,this.subtasks,()=>{t.visitUpdate(r)}).addToQueue()}afterAll(){this.continuousEnvironments.push(this.continuousEnvironment)}buildEmptyContinuousEnvironment(){let t=this.state.timestamp,r=this.state.updateIndex,n=this.state.updates,a=n[n.length-1],o=a.timestamp,s=a.updateIndex+1,l=this.state.isComplete;return{passengers:{},allPassengers:[],vehicles:{},allVehicles:[],statistics:[],startTimestamp:t,startUpdateIndex:r,endTimestamp:o,endUpdateIndex:s,isComplete:l}}},yI=class{constructor(e,t,r){this.environment=e;this.continuousEnvironment=t;this.references=r}visitUpdate(e){e.apply(this.environment),e.accept(this)}visitPassengerUpdate(e){let t=this.environment.passengers[e.passengerId];O$(this.continuousEnvironment.passengers,this.continuousEnvironment.allPassengers,t,e.timestamp,this.continuousEnvironment.endTimestamp,e.updateIndex,this.references)}visitVehicleUpdate(e){let t=this.environment.vehicles[e.vehicleId];z$(this.continuousEnvironment.vehicles,this.continuousEnvironment.allVehicles,t,e.timestamp,this.continuousEnvironment.endTimestamp,e.updateIndex,this.references)}visitStatisticsUpdate(e){H$(this.continuousEnvironment.statistics,e.statistics,e.timestamp,this.continuousEnvironment.endTimestamp,e.updateIndex)}};function O$(i,e,t,r,n,a,o){let s=i[t.id];s||(s=[],i[t.id]=s,e.push(s));let l=s[s.length-1];l!==void 0&&(l.startTimestamp===r?s.pop():l.endTimestamp=r);let c=at(ye({},t),{startTimestamp:r,endTimestamp:a,updateIndex:n});LRe(c,o),s.push(c)}function z$(i,e,t,r,n,a,o){let s=i[t.id];s||(s=[],i[t.id]=s,e.push(s));let l=s[s.length-1];l!==void 0&&(l.startTimestamp===r?s.pop():l.endTimestamp=r);let c=at(ye({},t),{startTimestamp:r,endTimestamp:n,updateIndex:a});IRe(c,o),s.push(c)}function H$(i,e,t,r,n){let a=i[i.length-1];a!==void 0&&(a.startTimestamp===t?i.pop():a.endTimestamp=t);let o={statistics:e,startTimestamp:t,endTimestamp:r,updateIndex:n};i.push(o)}function lM(i,e){let t=e.tags,r=i.find(n=>bI(n,t));if(!r){let n=[...t];i.push(n),r=n}e.tags=r}function pI(i,e){let t=i.find(n=>FRe(n,e));if(t)return t;let r=ye({},e);return i.push(r),r}function RRe(i,e){let t=e.previousLegs.map(a=>pI(i,a)),r=e.currentLeg?pI(i,e.currentLeg):null,n=e.nextLegs.map(a=>pI(i,a));e.previousLegs=t,e.currentLeg=r,e.nextLegs=n}function fI(i,e){let t=zRe(i,e);if(t!==null)return i[t];let r=ye({},e);return HRe(i,r),r}function DRe(i,e){let t=e.previousStops.map(a=>fI(i,a)),r=e.currentStop?fI(i,e.currentStop):null,n=e.nextStops.map(a=>fI(i,a));e.previousStops=t,e.currentStop=r,e.nextStops=n}function LRe(i,e){lM(e.passengerTags,i);let t=e.passengerLegs[i.id];t||(t=[],e.passengerLegs[i.id]=t),RRe(t,i);let r=td(i);for(let n of r)lM(e.legTags,n)}function IRe(i,e){lM(e.vehicleTags,i);let t=e.vehicleStops[i.id];t||(t=[],e.vehicleStops[i.id]=t),DRe(t,i);let r=Bl(i);for(let n of r)lM(e.stopTags,n)}function bI(i,e){if(i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!==e[t])return!1;return!0}function FRe(i,e){return i.assignedVehicleId===e.assignedVehicleId&&i.boardingStopId===e.boardingStopId&&i.alightingStopId===e.alightingStopId&&i.boardingStopIndex===e.boardingStopIndex&&i.alightingStopIndex===e.alightingStopIndex&&i.boardingTime===e.boardingTime&&i.alightingTime===e.alightingTime&&bI(i.tags,e.tags)}function ORe(i,e){return i.id===e.id&&i.name===e.name&&i.arrivalTime===e.arrivalTime&&i.departureTime===e.departureTime&&i.position.latitude===e.position.latitude&&i.position.longitude===e.position.longitude&&i.capacity===e.capacity&&i.label===e.label&&bI(i.tags,e.tags)}function zRe(i,e){let t=Du(i,n=>n.id.localeCompare(e.id));if(t===null)return null;let r=t;for(;r<i.length&&i[r].id===e.id;){if(ORe(i[r],e))return r;r++}return null}function HRe(i,e){let t=NRe(i,r=>r.id.localeCompare(e.id));i.splice(t,0,e)}function Du(i,e){let t=0,r=i.length-1;for(;t<=r;){let n=Math.floor((t+r)/2),a=e(i[n]);if(a===0){let o=n-1;if(o<0||e(i[o])!==0)return n;r=o}else a<0?t=n+1:r=n-1}return null}function NRe(i,e){let t=0,r=i.length-1;for(;t<=r;){let n=Math.floor((t+r)/2);e(i[n])<0?t=n+1:r=n-1}return t}function N$(i,e){for(let t=0;t<i.length-1;t++){let r=i[t];if(e.includes(r.endUpdateIndex))continue;let n=i[t+1];if(r.endUpdateIndex===n.startUpdateIndex){r.endTimestamp=n.startTimestamp;for(let o=0;o<r.allPassengers.length;o++){let s=r.allPassengers[o],l=s[s.length-1];l&&(l.endTimestamp=n.startTimestamp)}for(let o=0;o<r.allVehicles.length;o++){let s=r.allVehicles[o],l=s[s.length-1];l&&(l.endTimestamp=n.startTimestamp)}let a=r.statistics[r.statistics.length-1];a&&(a.endTimestamp=n.startTimestamp),e.push(r.endUpdateIndex)}}}function cM(i,e){if(e===null||i.length===0)return null;let t=Du(i,r=>r.startTimestamp>e?1:r.endTimestamp<=e?-1:0);return t!==null||(t=Du(i,r=>r.startTimestamp>e?1:r.endTimestamp<e?-1:0),t!==null)?i[t]:null}function uM(i,e){if(e<i.startTimestamp||e>i.endTimestamp)throw console.error(i),new Error(`Timestamp ${e} is out of bounds for the continuous environment with start ${i.startTimestamp} and end ${i.endTimestamp}`);let t=i.startUpdateIndex,r={},n=[];for(let h=0;h<i.allPassengers.length;h++){let d=i.allPassengers[h],p=Du(d,g=>g.startTimestamp>e?1:g.endTimestamp<=e?-1:0);if(p===null&&(p=Du(d,g=>g.startTimestamp>e?1:g.endTimestamp<e?-1:0),p===null))continue;let f=d[p];f.updateIndex>t&&(t=f.updateIndex),r[f.id]=f,n.push(f)}let a={},o=[],s={};for(let h=0;h<i.allVehicles.length;h++){let d=i.allVehicles[h],p=Du(d,_=>_.startTimestamp>e?1:_.endTimestamp<=e?-1:0);if(p===null&&(p=Du(d,_=>_.startTimestamp>e?1:_.endTimestamp<e?-1:0),p===null))continue;let f=d[p];f.updateIndex>t&&(t=f.updateIndex);let g=Bl(f);for(let _=0;_<g.length;_++){let b=g[_];s[b.id]=b}a[f.id]=f,o.push(f)}let l=Du(i.statistics,h=>h.startTimestamp>e?1:h.endTimestamp<=e?-1:0);if(l===null&&(l=Du(i.statistics,h=>h.startTimestamp>e?1:h.endTimestamp<e?-1:0),l===null))throw console.error(i),new Error(`No statistics found for timestamp ${e} in the continuous environment`);let c=i.statistics[l];c.updateIndex>t&&(t=c.updateIndex);let u=c.statistics;return{passengers:r,vehicles:a,stops:s,statistics:u,timestamp:e,updateIndex:t,allVehicles:o,allPassengers:n,allStops:Object.values(s)}}function vI(i){if(i.length===0)return[];let e=null,t=[];for(let r of i){if(e===null){e={start:r.startTimestamp,end:r.endTimestamp};continue}r.startTimestamp===e.end?e.end=r.endTimestamp:(t.push(e),e={start:r.startTimestamp,end:r.endTimestamp})}return e!==null&&t.push(e),t}function G$(i,e,t){if(i.length===0)return!1;let r=vI(i);for(let n of r)if(n.start<=e&&n.end>=t)return!0;return!1}var V$=function(i,e){e===void 0&&(e=5);for(var t=Math.pow(10,e),r=i.length,n=new Array(Math.floor(i.length/2)),a=0,o=0,s=0,l=0;a<r;++l){var c=1,u=0,h=void 0;do h=i.charCodeAt(a++)-63-1,c+=h<<u,u+=5;while(h>=31);o+=c&1?~(c>>1):c>>1,c=1,u=0;do h=i.charCodeAt(a++)-63-1,c+=h<<u,u+=5;while(h>=31);s+=c&1?~(c>>1):c>>1,n[l]=[o/t,s/t]}return n.length=l,n};function K$(i,e){if(!Array.isArray(i)||!i.every(r=>typeof r=="string"))return console.error("Invalid serialized polylines by coordinates",i),null;if(typeof e!="number")return console.error("Invalid polylines version",e),null;let t={};for(let r of i){let n=JSON.parse(r);if(typeof n!="object"||n===null)return console.error("Invalid data type for polyline",n),null;if(!("coordinatesString"in n)||typeof n.coordinatesString!="string")return console.error("Invalid coordinates string in polyline",n),null;let a=n.coordinatesString;if(!("coefficients"in n)||!Array.isArray(n.coefficients)||!n.coefficients.every(c=>typeof c=="number"))return console.error("Invalid coefficients in polyline",n),null;let o=n.coefficients;if(!("encodedPolyline"in n)||typeof n.encodedPolyline!="string")return console.error("Invalid encoded polyline in polyline",n),null;let s=n.encodedPolyline,l=V$(s).map(c=>({latitude:c[0],longitude:c[1]}));if(l.length>1&&o.length!==l.length-1)if(o.length===1&&o[0]===1){let c=[];for(let h=0;h<l.length-1;h++){let d=l[h],p=l[h+1],f=Math.sqrt((p.latitude-d.latitude)**2+(p.longitude-d.longitude)**2);c.push(f)}let u=c.reduce((h,d)=>h+d,0);if(u===0)return console.error("Total distance is zero, cannot calculate coefficients of decoded polyline",l,"in polyline",n),null;o.splice(0,o.length,...c.map(h=>h/u))}else return console.error("Polyline coefficients length mismatch in decoded polyline",l,"in polyline",n),null;t[a]={polyline:l,coefficients:o}}return{version:e,polylinesByCoordinates:t}}function f0(i){if(typeof i!="object"||i===null)return!1;for(let e of Object.values(i))if(typeof e!="string"&&typeof e!="number"&&!f0(e))return!1;return!0}var W$=go(sI());var GRe=["passenger","vehicle","statistics"];function U$(i){return GRe.includes(i)}var rd=class i{constructor(e,t,r,n,a){this.updateType=e;this.updateIndex=t;this.eventIndex=r;this.eventName=n;this.timestamp=a}apply(e){e.updateIndex=this.updateIndex,e.timestamp=this.timestamp}accept(e){}static deserialize(e){return typeof e!="object"||!e?(console.error("Invalid data type for update",e),null):!("updateType"in e)||!U$(e.updateType)?(console.error("Invalid update type in serialized update",e),null):!("updateIndex"in e)||typeof e.updateIndex!="number"?(console.error("Invalid update index in serialized update",e),null):!("eventIndex"in e)||typeof e.eventIndex!="number"?(console.error("Invalid event index in serialized update",e),null):!("eventName"in e)||typeof e.eventName!="string"?(console.error("Invalid event name in serialized update",e),null):!("timestamp"in e)||typeof e.timestamp!="number"?(console.error("Invalid timestamp in serialized update",e),null):new i(e.updateType,e.updateIndex,e.eventIndex,e.eventName,e.timestamp)}},SI=class i extends rd{constructor(t,r,n,a,o,s,l,c,u){super("passenger",t,r,n,a);this.passengerId=o;this.differences=s;this.numberOfLegsToRemove=l;this.legsToAdd=c;this.legsDifferences=u}static DEFAULT_DIFFERENCES={};static DEFAULT_LEGS_TO_ADD=[];static DEFAULT_LEGS_DIFFERENCES=[];static DEFAULT_NUMBER_OF_LEGS_TO_REMOVE=0;apply(t){super.apply(t);let r=this.differences.status,n=this.differences.numberOfPassengers,a=this.differences.tags,o=t.passengers[this.passengerId];if(o===void 0){if(r===void 0){console.error(`Passenger with ID ${this.passengerId} does not exist and no status provided.`);return}if(n===void 0){console.error(`Passenger with ID ${this.passengerId} does not exist and no numberOfPassengers provided.`);return}if(a===void 0){console.error(`Passenger with ID ${this.passengerId} does not exist and no tags provided.`);return}o={id:this.passengerId,entityType:"passenger",name:(0,W$.default)({seed:this.passengerId}),status:r,numberOfPassengers:n,tags:a,previousLegs:[],currentLeg:null,nextLegs:[],error:null}}else o=ye(ye({},o),this.differences);let s=td(o);this.numberOfLegsToRemove>0&&s.splice(s.length-this.numberOfLegsToRemove,this.numberOfLegsToRemove),s.push(...this.legsToAdd);for(let c of this.legsDifferences){let l=c,{index:u}=l,h=oa(l,["index"]);if(u<0||u>=s.length){console.error(`Invalid leg index ${u} for passenger ${this.passengerId}.`,this,t);continue}s[u]=ye(ye({},s[u]),h)}o.previousLegs=[],o.currentLeg=null,o.nextLegs=[];for(let c of s)c.legType==="previous"?o.previousLegs.push(c):c.legType==="current"?o.currentLeg=c:c.legType==="next"&&o.nextLegs.push(c);t.passengers[this.passengerId]=o}accept(t){t.visitPassengerUpdate(this)}static deserialize(t){if(typeof t!="object"||t===null)return console.error("Invalid data type for passenger update",t),null;let r=rd.deserialize(t);if(r===null)return console.error("Invalid base update in serialized passenger update",t),null;if(!("passengerId"in t)||typeof t.passengerId!="string")return console.error("Invalid passenger ID in serialized update",t),null;let n=t.passengerId,a=this.DEFAULT_DIFFERENCES;if("differences"in t){if(!this.isPassengerDifferences(t.differences))return console.error("Invalid differences",t.differences,"in serialized passenger update",t),null;a=t.differences}let o=this.DEFAULT_NUMBER_OF_LEGS_TO_REMOVE;if("numberOfLegsToRemove"in t){if(typeof t.numberOfLegsToRemove!="number")return console.error("Invalid number of legs to remove",t.numberOfLegsToRemove,"in serialized passenger update",t),null;o=t.numberOfLegsToRemove}let s=this.DEFAULT_LEGS_TO_ADD;if("legsToAdd"in t){if(!Array.isArray(t.legsToAdd))return console.error("Invalid legs to add",t.legsToAdd,"in serialized passenger update",t),null;let c=t.legsToAdd.map($g);if(!c.every(u=>u!==null)){let u=c.find(h=>h===null);return console.error("Invalid legs to add, including",u,"in serialized passenger update",t),null}s=c}let l=this.DEFAULT_LEGS_DIFFERENCES;if("legsDifferences"in t){if(!this.isLegDifferencesArray(t.legsDifferences))return console.error("Invalid legs differences",t.legsDifferences,"in serialized passenger update",t),null;l=t.legsDifferences}return new i(r.updateIndex,r.eventIndex,r.eventName,r.timestamp,n,a,o,s,l)}static isPassengerDifferences(t){if(typeof t!="object"||t===null||"status"in t&&!cI(t.status)||"numberOfPassengers"in t&&typeof t.numberOfPassengers!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!0}static isLegDifferencesArray(t){return Array.isArray(t)&&t.every(this.isLegDifferences)}static isLegDifferences(t){if(typeof t!="object"||t===null||"index"in t&&typeof t.index!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!("legType"in t&&!lI(t.legType)||"assignedVehicleId"in t&&t.assignedVehicleId!==null&&typeof t.assignedVehicleId!="string"||"boardingStopId"in t&&t.boardingStopId!==null&&typeof t.boardingStopId!="string"||"alightingStopId"in t&&t.alightingStopId!==null&&typeof t.alightingStopId!="string"||"boardingStopIndex"in t&&t.boardingStopIndex!==null&&typeof t.boardingStopIndex!="number"||"alightingStopIndex"in t&&t.alightingStopIndex!==null&&typeof t.alightingStopIndex!="number"||"boardingTime"in t&&t.boardingTime!==null&&typeof t.boardingTime!="number"||"alightingTime"in t&&t.alightingTime!==null&&typeof t.alightingTime!="number")}},kI=class i extends rd{constructor(t,r,n,a,o,s,l,c,u){super("vehicle",t,r,n,a);this.vehicleId=o;this.differences=s;this.numberOfStopsToRemove=l;this.stopsToAdd=c;this.stopsDifferences=u}static DEFAULT_DIFFERENCES={};static DEFAULT_STOPS_TO_ADD=[];static DEFAULT_STOPS_DIFFERENCES=[];static DEFAULT_NUMBER_OF_STOPS_TO_REMOVE=0;apply(t){super.apply(t);let r=this.differences.name,n=this.differences.mode,a=this.differences.status,o=this.differences.capacity,s=this.differences.tags,l=t.vehicles[this.vehicleId];if(l===void 0){if(r===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no name provided.`);return}if(n===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no mode provided.`);return}if(a===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no status provided.`);return}if(o===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no capacity provided.`);return}if(s===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no tags provided.`);return}l={id:this.vehicleId,entityType:"vehicle",name:r,mode:n,status:a,capacity:o,tags:s,previousStops:[],currentStop:null,nextStops:[],error:null}}else l=ye(ye({},l),this.differences);let c=Bl(l);this.numberOfStopsToRemove>0&&c.splice(c.length-this.numberOfStopsToRemove,this.numberOfStopsToRemove),c.push(...this.stopsToAdd);for(let h of this.stopsDifferences){let u=h,{index:d}=u,p=oa(u,["index"]);if(d<0||d>=c.length){console.error(`Invalid stop index ${d} for vehicle ${this.vehicleId}.`,this,t);continue}c[d]=ye(ye({},c[d]),p)}l.previousStops=[],l.currentStop=null,l.nextStops=[];for(let h of c)h.stopType==="previous"?l.previousStops.push(h):h.stopType==="current"?l.currentStop=h:h.stopType==="next"&&l.nextStops.push(h);t.vehicles[this.vehicleId]=l}accept(t){t.visitVehicleUpdate(this)}static deserialize(t){if(typeof t!="object"||t===null)return console.error("Invalid data type for vehicle update",t),null;let r=rd.deserialize(t);if(r===null)return null;if(!("vehicleId"in t)||typeof t.vehicleId!="string")return console.error("Invalid vehicle ID in serialized update",t),null;let n=t.vehicleId,a=this.DEFAULT_DIFFERENCES;if("differences"in t){if(!this.isVehicleDifferences(t.differences))return console.error("Invalid differences",t.differences,"in serialized vehicle update",t),null;a=t.differences}let o=this.DEFAULT_NUMBER_OF_STOPS_TO_REMOVE;if("numberOfStopsToRemove"in t){if(typeof t.numberOfStopsToRemove!="number")return console.error("Invalid number of stops to remove",t.numberOfStopsToRemove,"in serialized vehicle update",t),null;o=t.numberOfStopsToRemove}let s=this.DEFAULT_STOPS_TO_ADD;if("stopsToAdd"in t){if(!Array.isArray(t.stopsToAdd))return console.error("Invalid stops to add",t.stopsToAdd,"in serialized vehicle update",t),null;let c=t.stopsToAdd.map(u=>Qg(u,n));if(!c.every(u=>u!==null)){let u=c.find(h=>h===null);return console.error("Invalid stops to add, including",u,"in serialized vehicle update",t),null}s=c}let l=this.DEFAULT_STOPS_DIFFERENCES;if("stopsDifferences"in t){if(!this.isStopDifferencesArray(t.stopsDifferences))return console.error("Invalid stops differences",t.stopsDifferences,"in serialized vehicle update",t),null;l=t.stopsDifferences}return new i(r.updateIndex,r.eventIndex,r.eventName,r.timestamp,n,a,o,s,l)}static isVehicleDifferences(t){if(typeof t!="object"||t===null||"name"in t&&typeof t.name!="string"||"mode"in t&&typeof t.mode!="string"&&t.mode!==null||"status"in t&&!mI(t.status)||"capacity"in t&&typeof t.capacity!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!0}static isStopDifferencesArray(t){return Array.isArray(t)&&t.every(this.isStopDifferences)}static isStopDifferences(t){if(typeof t!="object"||t===null||"index"in t&&typeof t.index!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!("stopType"in t&&!dI(t.stopType)||"arrivalTime"in t&&typeof t.arrivalTime!="number"||"departureTime"in t&&t.departureTime!==null&&typeof t.departureTime!="number"||"latitude"in t&&typeof t.latitude!="number"||"longitude"in t&&typeof t.longitude!="number"||"capacity"in t&&typeof t.capacity!="number"||"label"in t&&typeof t.label!="string")}},xI=class i extends rd{statistics;constructor(e,t,r,n,a){super("statistics",e,t,r,n),this.statistics=Object.freeze(a)}apply(e){super.apply(e),e.statistics=this.statistics}accept(e){e.visitStatisticsUpdate(this)}static deserialize(e){if(typeof e!="object"||e===null)return console.error("Invalid data type for statistics update",e),null;let t=rd.deserialize(e);if(t===null)return null;if(!("statistics"in e)||!f0(e.statistics))return console.error("Invalid statistics in serialized update",e),null;let r=e.statistics;return new i(t.updateIndex,t.eventIndex,t.eventName,t.timestamp,r)}};function j$(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for update",i),null;if(!("updateType"in i)||!U$(i.updateType))return console.error("Invalid update type in data",i),null;switch(i.updateType){case"passenger":return SI.deserialize(i);case"vehicle":return kI.deserialize(i);case"statistics":return xI.deserialize(i)}}var hM=class extends Pl{constructor(t,r,n,a){super(Ru,t);this.serializedEnvironments=r;this.serializedUpdates=n;this.callback=a}environments=[];updatesByFirstUpdateIndex={};beforeAll(){new wI(this.subtasks,this.serializedEnvironments,this.environments).addToQueue(),new EI(this.subtasks,this.serializedUpdates,this.updatesByFirstUpdateIndex).addToQueue()}afterAll(){let t=[];for(let r of this.environments){let n=this.updatesByFirstUpdateIndex[r.updateIndex];if(n===void 0){console.error("No updates found for environment",r,"in updates",this.updatesByFirstUpdateIndex,"from serialized updates",this.serializedUpdates,"and serialized environments",this.serializedEnvironments),this.callback(null);continue}t.push(at(ye({},r),{updates:n}))}this.callback(t)}},wI=class extends Pl{constructor(t,r,n){super(Ru,t);this.serializedEnvironments=r;this.environments=n}beforeAll(){if(!Array.isArray(this.serializedEnvironments)){console.error("Invalid data type for serialized environments",this.serializedEnvironments);return}for(let t of this.serializedEnvironments)new CI(this.subtasks,t,this.environments).addToQueue()}afterAll(){}},CI=class extends Pl{constructor(t,r,n){super(Ru,t);this.serializedEnvironment=r;this.environments=n}environment={timestamp:-1,updateIndex:-1,statistics:{},passengers:{},vehicles:{},isComplete:!1};beforeAll(){if(typeof this.serializedEnvironment!="object"||this.serializedEnvironment===null){console.error("Invalid data type for serialized environment",this.serializedEnvironment);return}if(!("timestamp"in this.serializedEnvironment)||typeof this.serializedEnvironment.timestamp!="number"){console.error("Invalid timestamp in serialized environment",this.serializedEnvironment);return}if(this.environment.timestamp=this.serializedEnvironment.timestamp,!("updateIndex"in this.serializedEnvironment)||typeof this.serializedEnvironment.updateIndex!="number"){console.error("Invalid update index in serialized environment",this.serializedEnvironment);return}if(this.environment.updateIndex=this.serializedEnvironment.updateIndex,!("isComplete"in this.serializedEnvironment)||typeof this.serializedEnvironment.isComplete!="boolean"){console.error("Invalid isComplete in serialized environment",this.serializedEnvironment);return}if(this.environment.isComplete=this.serializedEnvironment.isComplete,!("statistics"in this.serializedEnvironment)||typeof this.serializedEnvironment.statistics!="string"){console.error("Invalid statistics in serialized environment",this.serializedEnvironment);return}let t=JSON.parse(this.serializedEnvironment.statistics);if(!f0(t)){console.error("Invalid statistics object in serialized environment",this.serializedEnvironment);return}if(this.environment.statistics=t,!("passengers"in this.serializedEnvironment)||!Array.isArray(this.serializedEnvironment.passengers)){console.error("Invalid passengers in serialized environment",this.serializedEnvironment);return}for(let r of this.serializedEnvironment.passengers)new MI(this.subtasks,r,this.environment.passengers).addToQueue();if(!("vehicles"in this.serializedEnvironment)||!Array.isArray(this.serializedEnvironment.vehicles)){console.error("Invalid vehicles in serialized environment",this.serializedEnvironment);return}for(let r of this.serializedEnvironment.vehicles)new TI(this.subtasks,r,this.environment.vehicles).addToQueue()}afterAll(){this.environments.push(this.environment)}},MI=class extends id{constructor(t,r,n){super(Ru,t);this.serializedPassenger=r;this.passengers=n}process(){if(typeof this.serializedPassenger!="string"){console.error("Invalid data type for serialized passenger",this.serializedPassenger);return}let t=JSON.parse(this.serializedPassenger),r=P$(t);if(r===null){console.error("Invalid passenger",this.serializedPassenger);return}this.passengers[r.id]=r}},TI=class extends id{constructor(t,r,n){super(Ru,t);this.serializedVehicle=r;this.vehicles=n}process(){if(typeof this.serializedVehicle!="string"){console.error("Invalid data type for serialized vehicle",this.serializedVehicle);return}let t=JSON.parse(this.serializedVehicle),r=F$(t);if(r===null){console.error("Invalid vehicle",this.serializedVehicle);return}this.vehicles[r.id]=r}},EI=class extends Pl{constructor(t,r,n){super(Ru,t);this.serializedUpdates=r;this.updatesByFirstUpdateIndex=n}beforeAll(){if(typeof this.serializedUpdates!="object"||this.serializedUpdates===null){console.error("Invalid data type for serialized updates",this.serializedUpdates);return}for(let[t,r]of Object.entries(this.serializedUpdates))new AI(this.subtasks,t,r,this.updatesByFirstUpdateIndex).addToQueue()}afterAll(){}},AI=class extends Pl{constructor(t,r,n,a){super(Ru,t);this.serializedUpdatesKey=r;this.serializedUpdates=n;this.updatesByFirstUpdateIndex=a}updates=new Xg((t,r)=>t.updateIndex-r.updateIndex);beforeAll(){if(typeof this.serializedUpdatesKey!="string"){console.error("Invalid data type for key",this.serializedUpdatesKey,"with serialized updates",this.serializedUpdates);return}let t=parseInt(this.serializedUpdatesKey);if(isNaN(t)){console.error("Key is not a valid number",this.serializedUpdatesKey,"with serialized updates",this.serializedUpdates);return}if(!Array.isArray(this.serializedUpdates)){console.error("Invalid data type for serialized updates",this.serializedUpdates,"with key",this.serializedUpdatesKey);return}this.updatesByFirstUpdateIndex[t]=this.updates.editableItems;for(let r of this.serializedUpdates)new PI(this.subtasks,r,this.updates).addToQueue()}afterAll(){}},PI=class extends id{constructor(t,r,n){super(Ru,t);this.serializedUpdate=r;this.updates=n}process(){if(typeof this.serializedUpdate!="string"){console.error("Invalid data type for serialized update",this.serializedUpdate);return}let t=j$(JSON.parse(this.serializedUpdate));if(t===null){console.error("Invalid update",this.serializedUpdate);return}this.updates.add(t)}};var nd=class i{queue=uI();processTasks(e){for(this.processTask();this.queue.length>0&&performance.now()<e;)this.processTask()}processTask(){let e=this.queue.shift();e&&e.process()}extractStateTask(e,t,r){new hM(this.queue,e,t,r).addToQueue()}buildContinuousEnvironmentsTask(e,t,r){new sM(this.queue,e,t,r).addToQueue()}get numberOfTasks(){return this.queue.items.reduce((e,t)=>e+t.numberOfTasks,0)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ha=class i{constructor(e,t,r){this.dataService=e;this.communicationService=t;this.taskService=r}_activeSimulationIdSignal=Bt(null);_simulationPolylinesSignal=Bt(null);_isFetchingStatesSignal=Bt(!1);_isFetchingPolylinesSignal=Bt(!1);_continuousEnvironmentsSignal=Bt([]);alreadyUpdatedEnvironmentUpdateIndexes=[];references=_I();_hasAllStatesSignal=Bt(!1);getPolylinesDebounceSettings={debounceTime:500,lastExecutionTime:null,timeoutId:null};getMissingSimulationStatesDebounceSettings={debounceTime:500,lastExecutionTime:null,timeoutId:null};setActiveSimulationId(e){this.unsetActiveSimulationId(),this._activeSimulationIdSignal.set(e),this.communicationService.on("missing-simulation-states",(t,r,n)=>{this.onMissingSimulationStates(t,r,n)}),this.communicationService.on(`polylines-${e}`,(t,r)=>{this._isFetchingPolylinesSignal.set(!1),this._simulationPolylinesSignal.set(K$(t,r))})}unsetActiveSimulationId(){let e=this._activeSimulationIdSignal();this._activeSimulationIdSignal.set(null),this._simulationPolylinesSignal.set(null),this._isFetchingStatesSignal.set(!1),this._isFetchingPolylinesSignal.set(!1),this.communicationService.removeAllListeners("missing-simulation-states"),e&&this.communicationService.removeAllListeners(`polylines-${e}`),this._continuousEnvironmentsSignal.set([]),this.alreadyUpdatedEnvironmentUpdateIndexes=[],this.references=_I(),this._hasAllStatesSignal.set(!1)}get activeSimulationSignal(){return $t(()=>{let e=this._activeSimulationIdSignal();return e?this.dataService.simulationsSignal().find(n=>n.id===e)??null:null})}pauseSimulation(e){this.communicationService.emit("pause-simulation",e)}resumeSimulation(e){this.communicationService.emit("resume-simulation",e)}stopSimulation(e){this.communicationService.emit("stop-simulation",e)}editSimulationConfiguration(e,t){this.communicationService.emit("edit-simulation-configuration",e,t)}getMissingSimulationStates(e,t,r){return this.runWithDebounce(()=>{this.getMissingSimulationStatesWithDebounce(e,t,r)},this.getMissingSimulationStatesDebounceSettings)}getMissingSimulationStatesWithDebounce(e,t,r){this._isFetchingStatesSignal.set(!0),this.communicationService.emit("get-missing-simulation-states",e,t,r)}getPolylines(e){this.runWithDebounce(()=>{this.getPolylinesWithoutDebounce(e)},this.getPolylinesDebounceSettings)}getPolylinesWithoutDebounce(e){this._isFetchingPolylinesSignal.set(!0),this.communicationService.emit("get-polylines",e)}get simulationPolylinesSignal(){return this._simulationPolylinesSignal}get isFetchingStatesSignal(){return this._isFetchingStatesSignal}get isFetchingPolylinesSignal(){return this._isFetchingPolylinesSignal}get continuousEnvironmentsSignal(){return this._continuousEnvironmentsSignal}get hasAllStatesSignal(){return this._hasAllStatesSignal}onMissingSimulationStates(e,t,r){this.taskService.extractStateTask(e,t,n=>this.afterExtractStateTask(n,r))}afterExtractStateTask(e,t){if(e===null){console.error("Failed to extract missing simulation states from the server response."),this._isFetchingStatesSignal.set(!1);return}this.taskService.buildContinuousEnvironmentsTask(e,this.references,r=>this.afterBuildContinuousEnvironmentsTask(r,t))}afterBuildContinuousEnvironmentsTask(e,t){this._continuousEnvironmentsSignal.update(r=>{let n=[...r];for(let a of e){let o=n.findIndex(s=>s.startUpdateIndex===a.startUpdateIndex);o===-1?n.push(a):n[o]=a}return n.sort((a,o)=>a.startUpdateIndex-o.startUpdateIndex),N$(n,this.alreadyUpdatedEnvironmentUpdateIndexes),n}),typeof t!="boolean"?(console.error("Received invalid hasAllStates value from the server."),t=!1):this._hasAllStatesSignal.set(t),this._isFetchingStatesSignal.set(!1)}runWithDebounce(e,t){t.timeoutId!==null&&(clearTimeout(t.timeoutId),t.timeoutId=null);let r=Date.now(),n=r-(t.lastExecutionTime??0);if(n<t.debounceTime){t.timeoutId=setTimeout(()=>{t.timeoutId=null,t.lastExecutionTime=Date.now(),e()},t.debounceTime-n);return}t.lastExecutionTime=r,e()}static \u0275fac=function(t){return new(t||i)(Zt(Qh),Zt(To),Zt(nd))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};function VRe(i,e){if(i&1){let t=vt();Z(0,"div",1)(1,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.action())}),ce(2),Q()()}if(i&2){let t=Se();oe(2),_t(" ",t.data.action," ")}}var KRe=["label"];function WRe(i,e){}var URe=Math.pow(2,31)-1,y0=class{_overlayRef;instance;containerInstance;_afterDismissed=new ct;_afterOpened=new ct;_onAction=new ct;_durationTimeoutId;_dismissedByAction=!1;constructor(e,t){this._overlayRef=t,this.containerInstance=e,e._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(e){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(e,URe))}_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}},q$=new et("MatSnackBarData"),ey=class{politeness="assertive";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},jRe=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return i})(),qRe=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return i})(),ZRe=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return i})(),YRe=(()=>{class i{snackBarRef=te(y0);data=te(q$);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["mat-button","","matSnackBarAction","",3,"click"]],template:function(r,n){r&1&&(Z(0,"div",0),ce(1),Q(),je(2,VRe,3,1,"div",1)),r&2&&(oe(),_t(" ",n.data.message,`
|
1697
|
+
`;var YL=n$,n0=a$;var a0=class{constructor(e){this.renderer=e}contextChange(e){let t;if(this.renderer.context.webGLVersion===1){let r=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,r)}else{let r=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,r)}t>=_r.HIGH?this.multisample=_r.HIGH:t>=_r.MEDIUM?this.multisample=_r.MEDIUM:t>=_r.LOW?this.multisample=_r.LOW:this.multisample=_r.NONE}destroy(){}};a0.extension={type:Xe.RendererSystem,name:"_multisample"};nt.add(a0);var qC=class{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}};var o0=class{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){let{gl:t,CONTEXT_UID:r}=this,n=e._glBuffers[r]||this.createGLBuffer(e);t.bindBuffer(e.type,n.buffer)}unbind(e){let{gl:t}=this;t.bindBuffer(e,null)}bindBufferBase(e,t){let{gl:r,CONTEXT_UID:n}=this;if(this.boundBufferBases[t]!==e){let a=e._glBuffers[n]||this.createGLBuffer(e);this.boundBufferBases[t]=e,r.bindBufferBase(r.UNIFORM_BUFFER,t,a.buffer)}}bindBufferRange(e,t,r){let{gl:n,CONTEXT_UID:a}=this;r=r||0;let o=e._glBuffers[a]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,t||0,o.buffer,r*256,256)}update(e){let{gl:t,CONTEXT_UID:r}=this,n=e._glBuffers[r]||this.createGLBuffer(e);if(e._updateID!==n.updateID)if(n.updateID=e._updateID,t.bindBuffer(e.type,n.buffer),n.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{let a=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,a)}}dispose(e,t){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];let r=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),r&&(t||n.deleteBuffer(r.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){let t=Object.keys(this.managedBuffers);for(let r=0;r<t.length;r++)this.dispose(this.managedBuffers[t[r]],e)}createGLBuffer(e){let{CONTEXT_UID:t,gl:r}=this;return e._glBuffers[t]=new qC(r.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[t]}};o0.extension={type:Xe.RendererSystem,name:"buffer"};nt.add(o0);var s0=class{constructor(e){this.renderer=e}render(e,t){let r=this.renderer,n,a,o,s;if(t&&(n=t.renderTexture,a=t.clear,o=t.transform,s=t.skipUpdateTransform),this.renderingToScreen=!n,r.runners.prerender.emit(),r.emit("prerender"),r.projection.transform=o,!r.context.isLost){if(n||(this.lastObjectRendered=e),!s){let l=e.enableTempParent();e.updateTransform(),e.disableTempParent(l)}r.renderTexture.bind(n),r.batch.currentRenderer.start(),(a??r.background.clearBeforeRender)&&r.renderTexture.clear(),e.render(r),r.batch.currentRenderer.flush(),n&&(t.blit&&r.framebuffer.blit(),n.baseTexture.update()),r.runners.postrender.emit(),r.projection.transform=null,r.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}};s0.extension={type:Xe.RendererSystem,name:"objectRenderer"};nt.add(s0);var ZC=class JL extends Kg{constructor(e){super(),this.type=k2.WEBGL,e=Object.assign({},Qe.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new co({projectionMatrix:new Ni},!0);let t={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:JL.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(t),"useContextAlpha"in e&&(yi("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),e.premultipliedAlpha=e.useContextAlpha&&e.useContextAlpha!=="notMultiplied",e.backgroundAlpha=e.useContextAlpha===!1?1:e.backgroundAlpha),this._plugin.rendererPlugins=JL.__plugins,this.options=e,this.startup.run(this.options)}static test(e){return e?.forceCanvas?!1:xC()}render(e,t){this.objectRenderer.render(e,t)}resize(e,t){this._view.resizeView(e,t)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(e=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:e}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(e){this._view.resolution=e,this.runners.resolutionChange.emit(e)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return yi("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return yi("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return yi("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return yi("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(e){yi("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=e}get backgroundAlpha(){return yi("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(e){yi("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=e}get powerPreference(){return yi("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(e,t){return this.textureGenerator.generateTexture(e,t)}};ZC.extension={type:Xe.Renderer,priority:1},ZC.__plugins={},ZC.__systems={};var YC=ZC;nt.handleByMap(Xe.RendererPlugin,YC.__plugins);nt.handleByMap(Xe.RendererSystem,YC.__systems);nt.add(YC);var $h=class extends ss{constructor(e,t){let{width:r,height:n}=t||{};super(r,n),this.items=[],this.itemDirtyIds=[];for(let a=0;a<e;a++){let o=new Jt;this.items.push(o),this.itemDirtyIds.push(-2)}this.length=e,this._load=null,this.baseTexture=null}initFromArray(e,t){for(let r=0;r<this.length;r++)e[r]&&(e[r].castToBaseTexture?this.addBaseTextureAt(e[r].castToBaseTexture(),r):e[r]instanceof ss?this.addResourceAt(e[r],r):this.addResourceAt(wg(e[r],t),r))}dispose(){for(let e=0,t=this.length;e<t;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(e,t){if(!this.items[t])throw new Error(`Index ${t} is out of bounds`);return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[t].setResource(e),this}bind(e){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(e);for(let t=0;t<this.length;t++)this.items[t].parentTextureArray=e,this.items[t].on("update",e.update,e)}unbind(e){super.unbind(e);for(let t=0;t<this.length;t++)this.items[t].parentTextureArray=null,this.items[t].off("update",e.update,e)}load(){if(this._load)return this._load;let e=this.items.map(t=>t.resource).filter(t=>t).map(t=>t.load());return this._load=Promise.all(e).then(()=>{let{realWidth:t,realHeight:r}=this.items[0];return this.resize(t,r),this.update(),Promise.resolve(this)}),this._load}};var l0=class extends $h{constructor(e,t){let{width:r,height:n}=t||{},a,o;Array.isArray(e)?(a=e,o=e.length):o=e,super(o,{width:r,height:n}),a&&this.initFromArray(a,t)}addBaseTextureAt(e,t){if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=ku.TEXTURE_2D_ARRAY}upload(e,t,r){let{length:n,itemDirtyIds:a,items:o}=this,{gl:s}=e;r.dirtyId<0&&s.texImage3D(s.TEXTURE_2D_ARRAY,0,r.internalFormat,this._width,this._height,n,0,t.format,r.type,null);for(let l=0;l<n;l++){let c=o[l];a[l]<c.dirtyId&&(a[l]=c.dirtyId,c.valid&&s.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,l,c.resource.width,c.resource.height,1,t.format,r.type,c.resource.source))}return!0}};var c0=class extends Gn{constructor(e){super(e)}static test(e){let{OffscreenCanvas:t}=globalThis;return t&&e instanceof t?!0:globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement}};var nBe=(()=>{let i=class u0 extends $h{constructor(t,r){let{width:n,height:a,autoLoad:o,linkBaseTexture:s}=r||{};if(t&&t.length!==u0.SIDES)throw new Error(`Invalid length. Got ${t.length}, expected 6`);super(6,{width:n,height:a});for(let l=0;l<u0.SIDES;l++)this.items[l].target=ku.TEXTURE_CUBE_MAP_POSITIVE_X+l;this.linkBaseTexture=s!==!1,t&&this.initFromArray(t,r),o!==!1&&this.load()}bind(t){super.bind(t),t.target=ku.TEXTURE_CUBE_MAP}addBaseTextureAt(t,r,n){if(n===void 0&&(n=this.linkBaseTexture),!this.items[r])throw new Error(`Index ${r} is out of bounds`);if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0)if(t.resource)this.addResourceAt(t.resource,r);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=ku.TEXTURE_CUBE_MAP_POSITIVE_X+r,t.parentTextureArray=this.baseTexture,this.items[r]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[r]=t,this}upload(t,r,n){let a=this.itemDirtyIds;for(let o=0;o<u0.SIDES;o++){let s=this.items[o];(a[o]<s.dirtyId||n.dirtyId<r.dirtyId)&&(s.valid&&s.resource?(s.resource.upload(t,s,n),a[o]=s.dirtyId):a[o]<-1&&(t.gl.texImage2D(s.target,0,n.internalFormat,r.realWidth,r.realHeight,0,r.format,n.type,null),a[o]=-1))}return!0}static test(t){return Array.isArray(t)&&t.length===u0.SIDES}};return i.SIDES=6,i})(),$L=nBe;var h0=class i extends Gn{constructor(e,t){t=t||{};let r,n,a;typeof e=="string"?(r=i.EMPTY,n=e,a=!0):(r=e,n=null,a=!1),super(r),this.url=n,this.crossOrigin=t.crossOrigin??!0,this.alphaMode=typeof t.alphaMode=="number"?t.alphaMode:null,this.ownsImageBitmap=t.ownsImageBitmap??a,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise((e,t)=>Ce(this,null,function*(){if(this.url===null){e(this);return}try{let r=yield Qe.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;let n=yield r.blob();if(this.destroyed)return;let a=yield createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===an.UNPACK?"premultiply":"none"});if(this.destroyed){a.close();return}this.source=a,this.update(),e(this)}catch(r){if(this.destroyed)return;t(r),this.onError.emit(r)}})),this._load)}upload(e,t,r){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),super.upload(e,t,r)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return i._EMPTY=i._EMPTY??Qe.ADAPTER.createCanvas(0,0),i._EMPTY}};var XL=class JC extends Gn{constructor(e,t){t=t||{},super(Qe.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.update(),e(this)},JC.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){let e=new Image;Gn.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{this._resolve&&(e.onerror=null,this.onError.emit(t))},e.onload=()=>{if(!this._resolve)return;let t=e.width,r=e.height;if(!t||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=t*this.scale,a=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/r*t,a=this._overrideHeight||this._overrideWidth/t*r),n=Math.round(n),a=Math.round(a);let o=this.source;o.width=n,o.height=a,o._pixiId=`canvas_${_c()}`,o.getContext("2d").drawImage(e,0,0,t,r,0,0,n,a),this._resolve(),this._resolve=null}}static getSize(e){let t=JC.SVG_SIZE.exec(e),r={};return t&&(r[t[1]]=Math.round(parseFloat(t[3])),r[t[5]]=Math.round(parseFloat(t[7]))),r}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,t){return t==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&JC.SVG_XML.test(e)}};XL.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,XL.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var qg=XL;var $C=class extends Gn{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}};var QL=class eI extends Gn{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){let r=document.createElement("video");t.autoLoad!==!1&&r.setAttribute("preload","auto"),t.playsinline!==!1&&(r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline","")),t.muted===!0&&(r.setAttribute("muted",""),r.muted=!0),t.loop===!0&&r.setAttribute("loop",""),t.autoPlay!==!1&&r.setAttribute("autoplay",""),typeof e=="string"&&(e=[e]);let n=e[0].src||e[0];Gn.crossOrigin(r,n,t.crossorigin);for(let a=0;a<e.length;++a){let o=document.createElement("source"),{src:s,mime:l}=e[a];if(s=s||e[a],s.startsWith("data:"))l=s.slice(5,s.indexOf(";"));else if(!s.startsWith("blob:")){let c=s.split("?").shift().toLowerCase(),u=c.slice(c.lastIndexOf(".")+1);l=l||eI.MIME_TYPES[u]||`video/${u}`}o.src=s,l&&(o.type=l),r.appendChild(o)}e=r}super(e),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}update(e=0){if(!this.destroyed){if(this._updateFPS){let t=sn.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}_videoFrameRequestCallback(){this.update(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)}load(){if(this._load)return this._load;let e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise((t,r)=>{this.valid?t(this):(this._resolve=t,this._reject=r,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){let e=this.source;return!e.paused&&!e.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){let e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);let t=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!t&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._configureAutoUpdate();let e=this.source;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(sn.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(sn.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(sn.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||eI.TYPES.includes(t)}};QL.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],QL.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};var d0=QL;Gv.push(h0,Nm,c0,d0,$C,qg,Ml,$L,l0);var o$=["vehicle","stop","passenger","all"],s$=["zoomed-in","zoomed-out","any"],l$=["circle","square","triangle","pentagon","hexagon","octagon","star","cross","diamond"],Zg=class i{VERSION=4;SPRITE_SIZE=40;BACKGROUND_SHAPE_SIZE=60;KEY_TEXTURES="multimodal.textures";DEFAULT_UNDEFINED_TEXTURE_URL="/images/undefined-texture.png";DEFAULT_VEHICLE_TEXTURE_URL="/images/vehicle.png";DEFAULT_PASSENGER_TEXTURE_URL="/images/passenger.png";DEFAULT_STOP_TEXTURE_URL="/images/stop.png";DEFAULT_ZOOMED_OUT_VEHICLE_TEXTURE_URL="/images/zoomed-out-vehicle.png";DEFAULT_ZOOMED_OUT_PASSENGER_TEXTURE_URL="/images/zoomed-out-passenger.png";DEFAULT_ZOOMED_OUT_STOP_TEXTURE_URL="/images/zoomed-out-stop.png";PRESET_LIGHT_COLOR_THEME=["#ccffcc","#ffffb3","#ffffb3","#ffb980","#ffb980","#ff3333","#ff3333"];PRESET_SATURATED_COLOR_THEME=["#00ff00","#ffff00","#ff8000","#ff0000"];VEHICLE_SPRITE_SCALE_FACTOR=1;PASSENGER_SPRITE_SCALE_FACTOR=.75;STOP_SPRITE_SCALE_FACTOR=.25;_useZoomedOutSprites=!1;_globalSpriteScale=1;_vehicleTexture=Ft.from(this.DEFAULT_VEHICLE_TEXTURE_URL);_passengerTexture=Ft.from(this.DEFAULT_PASSENGER_TEXTURE_URL);_stopTexture=Ft.from(this.DEFAULT_STOP_TEXTURE_URL);_zoomedOutVehicleTexture=Ft.from(this.DEFAULT_ZOOMED_OUT_VEHICLE_TEXTURE_URL);_zoomedOutPassengerTexture=Ft.from(this.DEFAULT_ZOOMED_OUT_PASSENGER_TEXTURE_URL);_zoomedOutStopTexture=Ft.from(this.DEFAULT_ZOOMED_OUT_STOP_TEXTURE_URL);_customTextures=[];_backgroundShapes=[];_colorPresetIndex=0;_customColors=["#00ff00","#ff0000"];_currentColorPreset=this.PRESET_LIGHT_COLOR_THEME;_textureMap=new Map;_customizationUpdatedSignal=Bt(0);get useZoomedOutSprites(){return this._useZoomedOutSprites}get vehicleSpriteScale(){return this.VEHICLE_SPRITE_SCALE_FACTOR*this._globalSpriteScale}get passengerSpriteScale(){return this.PASSENGER_SPRITE_SCALE_FACTOR*this._globalSpriteScale}get stopSpriteScale(){return this.STOP_SPRITE_SCALE_FACTOR*this._globalSpriteScale}get vehicleTexture(){return this._vehicleTexture}get passengerTexture(){return this._passengerTexture}get stopTexture(){return this._stopTexture}get zoomedOutVehicleTexture(){return this._zoomedOutVehicleTexture}get zoomedOutPassengerTexture(){return this._zoomedOutPassengerTexture}get zoomedOutStopTexture(){return this._zoomedOutStopTexture}get colorPresetIndex(){return this._colorPresetIndex}get customColors(){return this._customColors}get currentColorPreset(){return this._currentColorPreset}get customTextures(){return structuredClone(this._customTextures)}get backgroundShapes(){return structuredClone(this._backgroundShapes)}get customizationUpdatedSignal(){return this._customizationUpdatedSignal}constructor(){this.loadTexturesData()}calculateSpriteScales(e){let o=e.getMap(),s=15,l=o.getZoom(),c=s-l;this._useZoomedOutSprites=l<14;let u=Math.pow(1.5,-c);u=Math.min(Math.max(u,.2),1),this._globalSpriteScale=u/e.getScale()}saveTextureData(e,t,r,n,a,o,s,l,c,u){let h={version:this.VERSION,vehicleTextureUrl:e,passengerTextureUrl:t,stopTextureUrl:r,zoomedOutVehicleTextureUrl:n,zoomedOutPassengerTextureUrl:a,zoomedOutStopTextureUrl:o,customTextures:s,backgroundShapes:l,colorPresetIndex:c,customColors:u};localStorage.setItem(this.KEY_TEXTURES,JSON.stringify(h)),this.applyTexturesData(h)}getVehicleTexture(e,t){let r=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",n=this._customTextures.find(o=>o.isActive&&["vehicle","all"].includes(o.type)&&[r,"any"].includes(o.zoom)&&o.tags.every(s=>t.includes(s))&&(o.mode===null||o.mode===e)),a=this._useZoomedOutSprites?this._zoomedOutVehicleTexture:this._vehicleTexture;return this._textureMap.get(n?.url??"")??a}getPassengerTexture(e){let t=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",r=this._customTextures.find(a=>a.isActive&&["passenger","all"].includes(a.type)&&[t,"any"].includes(a.zoom)&&a.tags.every(o=>e.includes(o))),n=this._useZoomedOutSprites?this._zoomedOutPassengerTexture:this._passengerTexture;return this._textureMap.get(r?.url??"")??n}getStopTexture(e){let t=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",r=this._customTextures.find(a=>a.isActive&&["stop","all"].includes(a.type)&&[t,"any"].includes(a.zoom)&&a.tags.every(o=>e.includes(o))),n=this._useZoomedOutSprites?this._zoomedOutStopTexture:this._stopTexture;return this._textureMap.get(r?.url??"")??n}drawVehicleBackgroundShape(e,t,r){let n=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",a=this._backgroundShapes.find(o=>o.isActive&&["vehicle","all"].includes(o.type)&&[n,"any"].includes(o.zoom)&&o.tags.every(s=>r.includes(s))&&(o.mode===null||o.mode===t));if(!a){e.clear();return}this.drawShape(e,a.shape,a.color)}drawPassengerBackgroundShape(e,t){let r=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",n=this._backgroundShapes.find(a=>a.isActive&&["passenger","all"].includes(a.type)&&[r,"any"].includes(a.zoom)&&a.tags.every(o=>t.includes(o)));if(!n){e.clear();return}this.drawShape(e,n.shape,n.color)}drawStopBackgroundShape(e,t){let r=this._useZoomedOutSprites?"zoomed-out":"zoomed-in",n=this._backgroundShapes.find(a=>a.isActive&&["stop","all"].includes(a.type)&&[r,"any"].includes(a.zoom)&&a.tags.every(o=>t.includes(o)));if(!n){e.clear();return}this.drawShape(e,n.shape,n.color)}loadTexturesData(){let e=localStorage.getItem(this.KEY_TEXTURES);if(!e)return;let t=JSON.parse(e);t.version===void 0||t.version!==this.VERSION||this.applyTexturesData(t)}applyTexturesData(e){this._vehicleTexture=Ft.from(e.vehicleTextureUrl),this._passengerTexture=Ft.from(e.passengerTextureUrl),this._stopTexture=Ft.from(e.stopTextureUrl),this._zoomedOutVehicleTexture=Ft.from(e.zoomedOutVehicleTextureUrl),this._zoomedOutPassengerTexture=Ft.from(e.zoomedOutPassengerTextureUrl),this._zoomedOutStopTexture=Ft.from(e.zoomedOutStopTextureUrl),this._colorPresetIndex=e.colorPresetIndex,this._customColors=e.customColors,this._colorPresetIndex===0&&(this._currentColorPreset=this.PRESET_LIGHT_COLOR_THEME),this._colorPresetIndex===1&&(this._currentColorPreset=this.PRESET_SATURATED_COLOR_THEME),this._colorPresetIndex===2&&e.customColors.length>=2&&(this._currentColorPreset=e.customColors),this._customTextures=e.customTextures;let t=Array.from(new Set(this._customTextures.map(r=>r.url)));this._textureMap.clear(),t.forEach(r=>{this._textureMap.set(r,Ft.from(r))}),this._backgroundShapes=structuredClone(e.backgroundShapes),this._customizationUpdatedSignal.update(r=>r+1)}drawShape(e,t,r){let n=this.BACKGROUND_SHAPE_SIZE;switch(e.clear(),e.beginFill(r),t){case"circle":e.drawCircle(0,0,n/2),e.scale.set(4/Math.PI);break;case"square":e.drawRect(-n/2,-n/2,n,n);break;case"triangle":e.drawPolygon(this.createPolygonCoordinates(3,n/2)),e.scale.set(1.5);break;case"pentagon":e.drawPolygon(this.createPolygonCoordinates(5,n/2)),e.scale.set(4/Math.PI);break;case"hexagon":e.drawPolygon(this.createPolygonCoordinates(6,n/2,0)),e.scale.set(4/Math.PI);break;case"octagon":e.drawPolygon(this.createPolygonCoordinates(8,n/2,360/16)),e.scale.set(4/Math.PI);break;case"star":{let a=n/2,o=a/2.5,s=this.createPolygonCoordinates(5,a,90),l=this.createPolygonCoordinates(5,o,126),c=[];for(let u=0;u<s.length;u+=2)c.push(l[u],l[u+1]),c.push(s[u],s[u+1]);e.drawPolygon(c),e.scale.set(1.8)}break;case"cross":e.drawRect(-n/2,-n/8,n,n/4),e.drawRect(-n/8,-n/2,n/4,n),e.rotation=Math.PI/4,e.scale.set(1.5);break;case"diamond":e.drawPolygon(this.createPolygonCoordinates(4,n/2)),e.scale.set(Math.SQRT2);break}e.endFill()}createPolygonCoordinates(e,t,r=90){let n=[];for(let a=0;a<e;a++){let o=(a*360/e-r)*(Math.PI/180),s=t*Math.cos(o),l=t*Math.sin(o);n.push(s,l)}return n}static \u0275fac=function(t){return new(t||i)};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var aBe=["mat-menu-item",""],oBe=[[["mat-icon"],["","matMenuItemIcon",""]],"*"],sBe=["mat-icon, [matMenuItemIcon]","*"];function lBe(i,e){i&1&&(Sr(),Z(0,"svg",2),Ge(1,"polygon",3),Q())}var cBe=["*"];function uBe(i,e){if(i&1){let t=vt();Z(0,"div",0),Le("click",function(){Ee(t);let n=Se();return Ae(n.closed.emit("click"))})("animationstart",function(n){Ee(t);let a=Se();return Ae(a._onAnimationStart(n.animationName))})("animationend",function(n){Ee(t);let a=Se();return Ae(a._onAnimationDone(n.animationName))})("animationcancel",function(n){Ee(t);let a=Se();return Ae(a._onAnimationDone(n.animationName))}),Z(1,"div",1),Ot(2),Q()()}if(i&2){let t=Se();dn(t._classList),gt("mat-menu-panel-animations-disabled",t._animationsDisabled)("mat-menu-panel-exit-animation",t._panelAnimationState==="void")("mat-menu-panel-animating",t._isAnimating),Re("id",t.panelId),Mt("aria-label",t.ariaLabel||null)("aria-labelledby",t.ariaLabelledby||null)("aria-describedby",t.ariaDescribedby||null)}}var iI=new et("MAT_MENU_PANEL"),Um=(()=>{class i{_elementRef=te(Et);_document=te(li);_focusMonitor=te(In);_parentMenu=te(iI,{optional:!0});_changeDetectorRef=te(_i);role="menuitem";disabled=!1;disableRipple=!1;_hovered=new ct;_focused=new ct;_highlighted=!1;_triggersSubmenu=!1;constructor(){te(ar).load(kn),this._parentMenu?.addItem?.(this)}focus(t,r){this._focusMonitor&&t?this._focusMonitor.focusVia(this._getHostElement(),t,r):this._getHostElement().focus(r),this._focused.next(this)}ngAfterViewInit(){this._focusMonitor&&this._focusMonitor.monitor(this._elementRef,!1)}ngOnDestroy(){this._focusMonitor&&this._focusMonitor.stopMonitoring(this._elementRef),this._parentMenu&&this._parentMenu.removeItem&&this._parentMenu.removeItem(this),this._hovered.complete(),this._focused.complete()}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._elementRef.nativeElement}_checkDisabled(t){this.disabled&&(t.preventDefault(),t.stopPropagation())}_handleMouseEnter(){this._hovered.next(this)}getLabel(){let t=this._elementRef.nativeElement.cloneNode(!0),r=t.querySelectorAll("mat-icon, .material-icons");for(let n=0;n<r.length;n++)r[n].remove();return t.textContent?.trim()||""}_setHighlighted(t){this._highlighted=t,this._changeDetectorRef.markForCheck()}_setTriggersSubmenu(t){this._triggersSubmenu=t,this._changeDetectorRef.markForCheck()}_hasFocus(){return this._document&&this._document.activeElement===this._getHostElement()}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["","mat-menu-item",""]],hostAttrs:[1,"mat-mdc-menu-item","mat-focus-indicator"],hostVars:8,hostBindings:function(r,n){r&1&&Le("click",function(o){return n._checkDisabled(o)})("mouseenter",function(){return n._handleMouseEnter()}),r&2&&(Mt("role",n.role)("tabindex",n._getTabIndex())("aria-disabled",n.disabled)("disabled",n.disabled||null),gt("mat-mdc-menu-item-highlighted",n._highlighted)("mat-mdc-menu-item-submenu-trigger",n._triggersSubmenu))},inputs:{role:"role",disabled:[2,"disabled","disabled",st],disableRipple:[2,"disableRipple","disableRipple",st]},exportAs:["matMenuItem"],features:[si],attrs:aBe,ngContentSelectors:sBe,decls:5,vars:3,consts:[[1,"mat-mdc-menu-item-text"],["matRipple","",1,"mat-mdc-menu-ripple",3,"matRippleDisabled","matRippleTrigger"],["viewBox","0 0 5 10","focusable","false","aria-hidden","true",1,"mat-mdc-menu-submenu-icon"],["points","0,0 5,5 0,10"]],template:function(r,n){r&1&&(Pi(oBe),Ot(0),Z(1,"span",0),Ot(2,1),Q(),Ge(3,"div",1),je(4,lBe,2,0,":svg:svg",2)),r&2&&(oe(3),Re("matRippleDisabled",n.disableRipple||n.disabled)("matRippleTrigger",n._getHostElement()),oe(),Je(n._triggersSubmenu?4:-1))},dependencies:[Ya],encapsulation:2,changeDetection:0})}return i})();var hBe=new et("MatMenuContent");var dBe=new et("mat-menu-default-options",{providedIn:"root",factory:mBe});function mBe(){return{overlapTrigger:!1,xPosition:"after",yPosition:"below",backdropClass:"cdk-overlay-transparent-backdrop"}}var tI="_mat-menu-enter",XC="_mat-menu-exit",Xh=(()=>{class i{_elementRef=te(Et);_changeDetectorRef=te(_i);_injector=te(Ii);_keyManager;_xPosition;_yPosition;_firstItemFocusRef;_exitFallbackTimeout;_animationsDisabled;_allItems;_directDescendantItems=new jc;_classList={};_panelAnimationState="void";_animationDone=new ct;_isAnimating=!1;parentMenu;direction;overlayPanelClass;backdropClass;ariaLabel;ariaLabelledby;ariaDescribedby;get xPosition(){return this._xPosition}set xPosition(t){this._xPosition=t,this.setPositionClasses()}get yPosition(){return this._yPosition}set yPosition(t){this._yPosition=t,this.setPositionClasses()}templateRef;items;lazyContent;overlapTrigger;hasBackdrop;set panelClass(t){let r=this._previousPanelClass,n=ye({},this._classList);r&&r.length&&r.split(" ").forEach(a=>{n[a]=!1}),this._previousPanelClass=t,t&&t.length&&(t.split(" ").forEach(a=>{n[a]=!0}),this._elementRef.nativeElement.className=""),this._classList=n}_previousPanelClass;get classList(){return this.panelClass}set classList(t){this.panelClass=t}closed=new ut;close=this.closed;panelId=te(Di).getId("mat-menu-panel-");constructor(){let t=te(dBe);this.overlayPanelClass=t.overlayPanelClass||"",this._xPosition=t.xPosition,this._yPosition=t.yPosition,this.backdropClass=t.backdropClass,this.overlapTrigger=t.overlapTrigger,this.hasBackdrop=t.hasBackdrop,this._animationsDisabled=te(nr,{optional:!0})==="NoopAnimations"}ngOnInit(){this.setPositionClasses()}ngAfterContentInit(){this._updateDirectDescendants(),this._keyManager=new yh(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd(),this._keyManager.tabOut.subscribe(()=>this.closed.emit("tab")),this._directDescendantItems.changes.pipe(ur(this._directDescendantItems),Er(t=>vr(...t.map(r=>r._focused)))).subscribe(t=>this._keyManager.updateActiveItem(t)),this._directDescendantItems.changes.subscribe(t=>{let r=this._keyManager;if(this._panelAnimationState==="enter"&&r.activeItem?._hasFocus()){let n=t.toArray(),a=Math.max(0,Math.min(n.length-1,r.activeItemIndex||0));n[a]&&!n[a].disabled?r.setActiveItem(a):r.setNextItemActive()}})}ngOnDestroy(){this._keyManager?.destroy(),this._directDescendantItems.destroy(),this.closed.complete(),this._firstItemFocusRef?.destroy(),clearTimeout(this._exitFallbackTimeout)}_hovered(){return this._directDescendantItems.changes.pipe(ur(this._directDescendantItems),Er(r=>vr(...r.map(n=>n._hovered))))}addItem(t){}removeItem(t){}_handleKeydown(t){let r=t.keyCode,n=this._keyManager;switch(r){case 27:Hr(t)||(t.preventDefault(),this.closed.emit("keydown"));break;case 37:this.parentMenu&&this.direction==="ltr"&&this.closed.emit("keydown");break;case 39:this.parentMenu&&this.direction==="rtl"&&this.closed.emit("keydown");break;default:(r===38||r===40)&&n.setFocusOrigin("keyboard"),n.onKeydown(t);return}}focusFirstItem(t="program"){this._firstItemFocusRef?.destroy(),this._firstItemFocusRef=vn(()=>{let r=this._resolvePanel();if(!r||!r.contains(document.activeElement)){let n=this._keyManager;n.setFocusOrigin(t).setFirstItemActive(),!n.activeItem&&r&&r.focus()}},{injector:this._injector})}resetActiveItem(){this._keyManager.setActiveItem(-1)}setElevation(t){}setPositionClasses(t=this.xPosition,r=this.yPosition){this._classList=at(ye({},this._classList),{"mat-menu-before":t==="before","mat-menu-after":t==="after","mat-menu-above":r==="above","mat-menu-below":r==="below"}),this._changeDetectorRef.markForCheck()}_onAnimationDone(t){let r=t===XC;(r||t===tI)&&(r&&(clearTimeout(this._exitFallbackTimeout),this._exitFallbackTimeout=void 0),this._animationDone.next(r?"void":"enter"),this._isAnimating=!1)}_onAnimationStart(t){(t===tI||t===XC)&&(this._isAnimating=!0)}_setIsOpen(t){if(this._panelAnimationState=t?"enter":"void",t){if(this._keyManager.activeItemIndex===0){let r=this._resolvePanel();r&&(r.scrollTop=0)}}else this._animationsDisabled||(this._exitFallbackTimeout=setTimeout(()=>this._onAnimationDone(XC),200));this._animationsDisabled&&setTimeout(()=>{this._onAnimationDone(t?tI:XC)}),this._changeDetectorRef.markForCheck()}_updateDirectDescendants(){this._allItems.changes.pipe(ur(this._allItems)).subscribe(t=>{this._directDescendantItems.reset(t.filter(r=>r._parentMenu===this)),this._directDescendantItems.notifyOnChanges()})}_resolvePanel(){let t=null;return this._directDescendantItems.length&&(t=this._directDescendantItems.first._getHostElement().closest('[role="menu"]')),t}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-menu"]],contentQueries:function(r,n,a){if(r&1&&(Ki(a,hBe,5),Ki(a,Um,5),Ki(a,Um,4)),r&2){let o;St(o=kt())&&(n.lazyContent=o.first),St(o=kt())&&(n._allItems=o),St(o=kt())&&(n.items=o)}},viewQuery:function(r,n){if(r&1&&di(Ta,5),r&2){let a;St(a=kt())&&(n.templateRef=a.first)}},hostVars:3,hostBindings:function(r,n){r&2&&Mt("aria-label",null)("aria-labelledby",null)("aria-describedby",null)},inputs:{backdropClass:"backdropClass",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],xPosition:"xPosition",yPosition:"yPosition",overlapTrigger:[2,"overlapTrigger","overlapTrigger",st],hasBackdrop:[2,"hasBackdrop","hasBackdrop",t=>t==null?null:st(t)],panelClass:[0,"class","panelClass"],classList:"classList"},outputs:{closed:"closed",close:"close"},exportAs:["matMenu"],features:[ei([{provide:iI,useExisting:i}]),si],ngContentSelectors:cBe,decls:1,vars:0,consts:[["tabindex","-1","role","menu",1,"mat-mdc-menu-panel",3,"click","animationstart","animationend","animationcancel","id"],[1,"mat-mdc-menu-content"]],template:function(r,n){r&1&&(Pi(),je(0,uBe,3,12,"ng-template"))},styles:['mat-menu{display:none}.mat-mdc-menu-content{margin:0;padding:8px 0;outline:0}.mat-mdc-menu-content,.mat-mdc-menu-content .mat-mdc-menu-item .mat-mdc-menu-item-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;flex:1;white-space:normal;font-family:var(--mat-menu-item-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-menu-item-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-menu-item-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-menu-item-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-menu-item-label-text-weight, var(--mat-sys-label-large-weight))}@keyframes _mat-menu-enter{from{opacity:0;transform:scale(0.8)}to{opacity:1;transform:none}}@keyframes _mat-menu-exit{from{opacity:1}to{opacity:0}}.mat-mdc-menu-panel{min-width:112px;max-width:280px;overflow:auto;box-sizing:border-box;outline:0;animation:_mat-menu-enter 120ms cubic-bezier(0, 0, 0.2, 1);border-radius:var(--mat-menu-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-menu-container-color, var(--mat-sys-surface-container));box-shadow:var(--mat-menu-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));will-change:transform,opacity}.mat-mdc-menu-panel.mat-menu-panel-exit-animation{animation:_mat-menu-exit 100ms 25ms linear forwards}.mat-mdc-menu-panel.mat-menu-panel-animations-disabled{animation:none}.mat-mdc-menu-panel.mat-menu-panel-animating{pointer-events:none}.mat-mdc-menu-panel.mat-menu-panel-animating:has(.mat-mdc-menu-content:empty){display:none}@media(forced-colors: active){.mat-mdc-menu-panel{outline:solid 1px}}.mat-mdc-menu-panel .mat-divider{color:var(--mat-menu-divider-color, var(--mat-sys-surface-variant));margin-bottom:var(--mat-menu-divider-bottom-spacing, 8px);margin-top:var(--mat-menu-divider-top-spacing, 8px)}.mat-mdc-menu-item{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;cursor:pointer;width:100%;text-align:left;box-sizing:border-box;color:inherit;font-size:inherit;background:none;text-decoration:none;margin:0;min-height:48px;padding-left:var(--mat-menu-item-leading-spacing, 12px);padding-right:var(--mat-menu-item-trailing-spacing, 12px);-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-menu-item::-moz-focus-inner{border:0}[dir=rtl] .mat-mdc-menu-item{padding-left:var(--mat-menu-item-trailing-spacing, 12px);padding-right:var(--mat-menu-item-leading-spacing, 12px)}.mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-leading-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-trailing-spacing, 12px)}[dir=rtl] .mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-trailing-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-leading-spacing, 12px)}.mat-mdc-menu-item,.mat-mdc-menu-item:visited,.mat-mdc-menu-item:link{color:var(--mat-menu-item-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-menu-item .mat-icon-no-color,.mat-mdc-menu-item .mat-mdc-menu-submenu-icon{color:var(--mat-menu-item-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-menu-item[disabled]{cursor:default;opacity:.38}.mat-mdc-menu-item[disabled]::after{display:block;position:absolute;content:"";top:0;left:0;bottom:0;right:0}.mat-mdc-menu-item:focus{outline:0}.mat-mdc-menu-item .mat-icon{flex-shrink:0;margin-right:var(--mat-menu-item-spacing, 12px);height:var(--mat-menu-item-icon-size, 24px);width:var(--mat-menu-item-icon-size, 24px)}[dir=rtl] .mat-mdc-menu-item{text-align:right}[dir=rtl] .mat-mdc-menu-item .mat-icon{margin-right:0;margin-left:var(--mat-menu-item-spacing, 12px)}.mat-mdc-menu-item:not([disabled]):hover{background-color:var(--mat-menu-item-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-menu-item:not([disabled]).cdk-program-focused,.mat-mdc-menu-item:not([disabled]).cdk-keyboard-focused,.mat-mdc-menu-item:not([disabled]).mat-mdc-menu-item-highlighted{background-color:var(--mat-menu-item-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}@media(forced-colors: active){.mat-mdc-menu-item{margin-top:1px}}.mat-mdc-menu-submenu-icon{width:var(--mat-menu-item-icon-size, 24px);height:10px;fill:currentColor;padding-left:var(--mat-menu-item-spacing, 12px)}[dir=rtl] .mat-mdc-menu-submenu-icon{padding-right:var(--mat-menu-item-spacing, 12px);padding-left:0}[dir=rtl] .mat-mdc-menu-submenu-icon polygon{transform:scaleX(-1);transform-origin:center}@media(forced-colors: active){.mat-mdc-menu-submenu-icon{fill:CanvasText}}.mat-mdc-menu-item .mat-mdc-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}'],encapsulation:2,changeDetection:0})}return i})(),h$=new et("mat-menu-scroll-strategy",{providedIn:"root",factory:()=>{let i=te(Rr);return()=>i.scrollStrategies.reposition()}});function pBe(i){return()=>i.scrollStrategies.reposition()}var fBe={provide:h$,deps:[Rr],useFactory:pBe},u$=ca({passive:!0});var m0=new WeakMap,QC=(()=>{class i{_overlay=te(Rr);_element=te(Et);_viewContainerRef=te(sa);_menuItemInstance=te(Um,{optional:!0,self:!0});_dir=te(Pr,{optional:!0});_focusMonitor=te(In);_ngZone=te(Kt);_scrollStrategy=te(h$);_changeDetectorRef=te(_i);_portal;_overlayRef=null;_menuOpen=!1;_closingActionsSubscription=tr.EMPTY;_hoverSubscription=tr.EMPTY;_menuCloseSubscription=tr.EMPTY;_pendingRemoval;_parentMaterialMenu;_parentInnerPadding;_handleTouchStart=t=>{im(t)||(this._openedBy="touch")};_openedBy=void 0;get _deprecatedMatMenuTriggerFor(){return this.menu}set _deprecatedMatMenuTriggerFor(t){this.menu=t}get menu(){return this._menu}set menu(t){t!==this._menu&&(this._menu=t,this._menuCloseSubscription.unsubscribe(),t&&(this._parentMaterialMenu,this._menuCloseSubscription=t.close.subscribe(r=>{this._destroyMenu(r),(r==="click"||r==="tab")&&this._parentMaterialMenu&&this._parentMaterialMenu.closed.emit(r)})),this._menuItemInstance?._setTriggersSubmenu(this.triggersSubmenu()))}_menu;menuData;restoreFocus=!0;menuOpened=new ut;onMenuOpen=this.menuOpened;menuClosed=new ut;onMenuClose=this.menuClosed;constructor(){let t=te(iI,{optional:!0});this._parentMaterialMenu=t instanceof Xh?t:void 0,this._element.nativeElement.addEventListener("touchstart",this._handleTouchStart,u$)}ngAfterContentInit(){this._handleHover()}ngOnDestroy(){this.menu&&this._ownsMenu(this.menu)&&m0.delete(this.menu),this._element.nativeElement.removeEventListener("touchstart",this._handleTouchStart,u$),this._pendingRemoval?.unsubscribe(),this._menuCloseSubscription.unsubscribe(),this._closingActionsSubscription.unsubscribe(),this._hoverSubscription.unsubscribe(),this._overlayRef&&(this._overlayRef.dispose(),this._overlayRef=null)}get menuOpen(){return this._menuOpen}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}triggersSubmenu(){return!!(this._menuItemInstance&&this._parentMaterialMenu&&this.menu)}toggleMenu(){return this._menuOpen?this.closeMenu():this.openMenu()}openMenu(){let t=this.menu;if(this._menuOpen||!t)return;this._pendingRemoval?.unsubscribe();let r=m0.get(t);m0.set(t,this),r&&r!==this&&r.closeMenu();let n=this._createOverlay(t),a=n.getConfig(),o=a.positionStrategy;this._setPosition(t,o),a.hasBackdrop=t.hasBackdrop==null?!this.triggersSubmenu():t.hasBackdrop,n.hasAttached()||(n.attach(this._getPortal(t)),t.lazyContent?.attach(this.menuData)),this._closingActionsSubscription=this._menuClosingActions().subscribe(()=>this.closeMenu()),t.parentMenu=this.triggersSubmenu()?this._parentMaterialMenu:void 0,t.direction=this.dir,t.focusFirstItem(this._openedBy||"program"),this._setIsMenuOpen(!0),t instanceof Xh&&(t._setIsOpen(!0),t._directDescendantItems.changes.pipe(gi(t.close)).subscribe(()=>{o.withLockedPosition(!1).reapplyLastPosition(),o.withLockedPosition(!0)}))}closeMenu(){this.menu?.close.emit()}focus(t,r){this._focusMonitor&&t?this._focusMonitor.focusVia(this._element,t,r):this._element.nativeElement.focus(r)}updatePosition(){this._overlayRef?.updatePosition()}_destroyMenu(t){let r=this._overlayRef,n=this._menu;!r||!this.menuOpen||(this._closingActionsSubscription.unsubscribe(),this._pendingRemoval?.unsubscribe(),n instanceof Xh&&this._ownsMenu(n)?(this._pendingRemoval=n._animationDone.pipe(Ir(1)).subscribe(()=>{r.detach(),n.lazyContent?.detach()}),n._setIsOpen(!1)):(r.detach(),n?.lazyContent?.detach()),n&&this._ownsMenu(n)&&m0.delete(n),this.restoreFocus&&(t==="keydown"||!this._openedBy||!this.triggersSubmenu())&&this.focus(this._openedBy),this._openedBy=void 0,this._setIsMenuOpen(!1))}_setIsMenuOpen(t){t!==this._menuOpen&&(this._menuOpen=t,this._menuOpen?this.menuOpened.emit():this.menuClosed.emit(),this.triggersSubmenu()&&this._menuItemInstance._setHighlighted(t),this._changeDetectorRef.markForCheck())}_createOverlay(t){if(!this._overlayRef){let r=this._getOverlayConfig(t);this._subscribeToPositions(t,r.positionStrategy),this._overlayRef=this._overlay.create(r),this._overlayRef.keydownEvents().subscribe(n=>{this.menu instanceof Xh&&this.menu._handleKeydown(n)})}return this._overlayRef}_getOverlayConfig(t){return new Ds({positionStrategy:this._overlay.position().flexibleConnectedTo(this._element).withLockedPosition().withGrowAfterOpen().withTransformOriginOn(".mat-menu-panel, .mat-mdc-menu-panel"),backdropClass:t.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:t.overlayPanelClass,scrollStrategy:this._scrollStrategy(),direction:this._dir||"ltr"})}_subscribeToPositions(t,r){t.setPositionClasses&&r.positionChanges.subscribe(n=>{this._ngZone.run(()=>{let a=n.connectionPair.overlayX==="start"?"after":"before",o=n.connectionPair.overlayY==="top"?"below":"above";t.setPositionClasses(a,o)})})}_setPosition(t,r){let[n,a]=t.xPosition==="before"?["end","start"]:["start","end"],[o,s]=t.yPosition==="above"?["bottom","top"]:["top","bottom"],[l,c]=[o,s],[u,h]=[n,a],d=0;if(this.triggersSubmenu()){if(h=n=t.xPosition==="before"?"start":"end",a=u=n==="end"?"start":"end",this._parentMaterialMenu){if(this._parentInnerPadding==null){let p=this._parentMaterialMenu.items.first;this._parentInnerPadding=p?p._getHostElement().offsetTop:0}d=o==="bottom"?this._parentInnerPadding:-this._parentInnerPadding}}else t.overlapTrigger||(l=o==="top"?"bottom":"top",c=s==="top"?"bottom":"top");r.withPositions([{originX:n,originY:l,overlayX:u,overlayY:o,offsetY:d},{originX:a,originY:l,overlayX:h,overlayY:o,offsetY:d},{originX:n,originY:c,overlayX:u,overlayY:s,offsetY:-d},{originX:a,originY:c,overlayX:h,overlayY:s,offsetY:-d}])}_menuClosingActions(){let t=this._overlayRef.backdropClick(),r=this._overlayRef.detachments(),n=this._parentMaterialMenu?this._parentMaterialMenu.closed:Qt(),a=this._parentMaterialMenu?this._parentMaterialMenu._hovered().pipe(Yi(o=>this._menuOpen&&o!==this._menuItemInstance)):Qt();return vr(t,n,a,r)}_handleMousedown(t){tm(t)||(this._openedBy=t.button===0?"mouse":void 0,this.triggersSubmenu()&&t.preventDefault())}_handleKeydown(t){let r=t.keyCode;(r===13||r===32)&&(this._openedBy="keyboard"),this.triggersSubmenu()&&(r===39&&this.dir==="ltr"||r===37&&this.dir==="rtl")&&(this._openedBy="keyboard",this.openMenu())}_handleClick(t){this.triggersSubmenu()?(t.stopPropagation(),this.openMenu()):this.toggleMenu()}_handleHover(){this.triggersSubmenu()&&this._parentMaterialMenu&&(this._hoverSubscription=this._parentMaterialMenu._hovered().subscribe(t=>{t===this._menuItemInstance&&!t.disabled&&(this._openedBy="mouse",this.openMenu())}))}_getPortal(t){return(!this._portal||this._portal.templateRef!==t.templateRef)&&(this._portal=new Xa(t.templateRef,this._viewContainerRef)),this._portal}_ownsMenu(t){return m0.get(t)===this}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","mat-menu-trigger-for",""],["","matMenuTriggerFor",""]],hostAttrs:[1,"mat-mdc-menu-trigger"],hostVars:3,hostBindings:function(r,n){r&1&&Le("click",function(o){return n._handleClick(o)})("mousedown",function(o){return n._handleMousedown(o)})("keydown",function(o){return n._handleKeydown(o)}),r&2&&Mt("aria-haspopup",n.menu?"menu":null)("aria-expanded",n.menuOpen)("aria-controls",n.menuOpen?n.menu.panelId:null)},inputs:{_deprecatedMatMenuTriggerFor:[0,"mat-menu-trigger-for","_deprecatedMatMenuTriggerFor"],menu:[0,"matMenuTriggerFor","menu"],menuData:[0,"matMenuTriggerData","menuData"],restoreFocus:[0,"matMenuTriggerRestoreFocus","restoreFocus"]},outputs:{menuOpened:"menuOpened",onMenuOpen:"onMenuOpen",menuClosed:"menuClosed",onMenuClose:"onMenuClose"},exportAs:["matMenuTrigger"]})}return i})(),eM=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({providers:[fBe],imports:[Ko,ti,Uo,pl,ti]})}return i})(),d$={transformMenu:Cs("transformMenu",[Ms("void",mn({opacity:0,transform:"scale(0.8)"})),Ba("void => enter",Pa("120ms cubic-bezier(0, 0, 0.2, 1)",mn({opacity:1,transform:"scale(1)"}))),Ba("* => void",Pa("100ms 25ms linear",mn({opacity:0})))]),fadeInItems:Cs("fadeInItems",[Ms("showing",mn({opacity:1})),Ba("void => *",[mn({opacity:0}),Pa("400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])},N_t=d$.fadeInItems,G_t=d$.transformMenu;var gBe=i=>({shape:i});function yBe(i,e){i&1&&Od(0)}function _Be(i,e){i&1&&Od(0)}function bBe(i,e){if(i&1){let t=vt();Z(0,"button",6),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.shapeOutputEmitter.emit(n))}),je(1,_Be,1,0,"ng-container",3),Q()}if(i&2){let t=e.$implicit;Se();let r=Or(8);oe(),Re("ngTemplateOutlet",r)("ngTemplateOutletContext",mP(2,gBe,t))}}function vBe(i,e){i&1&&(Sr(),Ge(0,"circle",8))}function SBe(i,e){i&1&&(Sr(),Ge(0,"rect",9))}function kBe(i,e){i&1&&(Sr(),Ge(0,"polygon",10))}function xBe(i,e){i&1&&(Sr(),Ge(0,"polygon",11))}function wBe(i,e){i&1&&(Sr(),Ge(0,"polygon",12))}function CBe(i,e){i&1&&(Sr(),Ge(0,"polygon",13))}function MBe(i,e){i&1&&(Sr(),Ge(0,"polygon",14))}function TBe(i,e){i&1&&(Sr(),Ge(0,"rect",16)(1,"rect",17))}function EBe(i,e){i&1&&(Sr(),Ge(0,"polygon",15))}function ABe(i,e){if(i&1&&(Sr(),Z(0,"svg",7),je(1,vBe,1,0,":svg:circle",8)(2,SBe,1,0,":svg:rect",9)(3,kBe,1,0,":svg:polygon",10)(4,xBe,1,0,":svg:polygon",11)(5,wBe,1,0,":svg:polygon",12)(6,CBe,1,0,":svg:polygon",13)(7,MBe,1,0,":svg:polygon",14)(8,TBe,2,0)(9,EBe,1,0,":svg:polygon",15),Q()),i&2){let t,r=e.shape;Se();let n=fi(0);Mt("fill",n.color),oe(),Je((t=r)==="circle"?1:t==="square"?2:t==="triangle"?3:t==="pentagon"?4:t==="hexagon"?5:t==="octagon"?6:t==="star"?7:t==="cross"?8:t==="diamond"?9:-1)}}var tM=class i{BACKGROUND_SHAPE_TYPES=l$;backgroundShapeInputSignal=sl.required({alias:"backgroundShape"});shapeOutputEmitter=Uc({alias:"shapeChange"});static \u0275fac=function(t){return new(t||i)};static \u0275cmp=tt({type:i,selectors:[["app-background-shape"]],inputs:{backgroundShapeInputSignal:[1,"backgroundShape","backgroundShapeInputSignal"]},outputs:{shapeOutputEmitter:"shapeChange"},decls:9,vars:4,consts:[["shapeMenu","matMenu"],["shape",""],[1,"select-shape","flex-row","align-cross-center",3,"matMenuTriggerFor"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"shape-menu"],["mat-menu-item",""],["mat-menu-item","",3,"click"],["width","40px","height","40px","viewBox","0 0 40 40"],["cx","20","cy","20","r","20"],["x","0","y","0","width","40","height","40"],["points","19.999999999999996,0 37.32050807568878,29.999999999999986 2.679491924311222,29.999999999999996 "],["points","19.999999999999996,0 39.02113032590307,13.819660112501047 31.755705045849467,36.180339887498945 8.244294954150542,36.18033988749895 0.9788696740969272,13.819660112501058 "],["points","40,20 30,37.32050807568877 10.000000000000004,37.32050807568878 0,20.000000000000004 9.999999999999991,2.6794919243112325 30,2.679491924311229 "],["points","38.477590650225736,27.653668647301796 27.653668647301796,38.477590650225736 12.346331352698206,38.477590650225736 1.5224093497742643,27.6536686473018 1.5224093497742643,12.346331352698208 12.346331352698193,1.5224093497742714 27.6536686473018,1.522409349774268 38.47759065022573,12.346331352698192 "],["points","19.999999999999996,0 24.702282018339783,13.52786404500042 39.02113032590307,13.819660112501047 27.60845213036123,22.472135954999576 31.755705045849467,36.180339887498945 20.000000000000004,28 8.244294954150542,36.18033988749895 12.391547869638773,22.472135954999583 0.9788696740969272,13.819660112501058 15.297717981660213,13.527864045000422 "],["points","20,0 40,20 20,40 0,20"],["x","15","y","0","width","10","height","40",1,"rotate"],["x","0","y","15","width","40","height","10",1,"rotate"]],template:function(t,r){if(t&1&&(Ri(0),Z(1,"div",2),je(2,yBe,1,0,"ng-container",3),Q(),Z(3,"mat-menu",4,0),ui(5,bBe,2,4,"button",5,Ea),Q(),je(7,ABe,10,2,"ng-template",null,1,Gp)),t&2){let n=Or(4),a=Or(8),o=hr(r.backgroundShapeInputSignal());oe(),Re("matMenuTriggerFor",n),oe(),Re("ngTemplateOutlet",a)("ngTemplateOutletContext",o),oe(3),hi(r.BACKGROUND_SHAPE_TYPES)}},dependencies:[Wp,eM,Xh,Um,QC],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}.select-shape[_ngcontent-%COMP%]{cursor:pointer}.rotate[_ngcontent-%COMP%]{transform:translate(20px,-10px) rotate(45deg)} .shape-menu .mat-mdc-menu-content{--menu-item-width: 40px;--menu-item-height: 40px;--menu-item-padding: 8px;--max-number-of-items: 3;--menu-gap: .5rem;display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--menu-gap);padding:1rem;max-width:calc(var(--max-number-of-items) * (var(--menu-item-width) + 2 * var(--menu-item-padding)) + (var(--max-number-of-items) - 1) * var(--menu-gap))} .shape-menu .mat-mdc-menu-content>button{box-sizing:content-box;min-width:var(--menu-item-width);max-width:var(--menu-item-width);min-height:var(--menu-item-height);max-height:var(--menu-item-height);padding:var(--menu-item-padding)} .shape-menu .mat-mdc-menu-content>button>span{max-width:var(--menu-item-width);max-height:var(--menu-item-height)}"]})};var PBe=["iconFileUpload"];function BBe(i,e){if(i&1&&(Z(0,"mat-error"),ce(1),Q()),i&2){let t=Se();oe(),Ti(t.currentError)}}function RBe(i,e){i&1&&(Z(0,"div",9)(1,"p"),ce(2,"No background shapes added yet."),Q()())}function DBe(i,e){i&1&&Ge(0,"div",43)}function LBe(i,e){if(i&1&&(Z(0,"div",40),Ge(1,"div",41)(2,"div",42),Z(3,"div",30)(4,"div",31),Ge(5,"div",43)(6,"div",43),je(7,DBe,1,0,"div",43),Q(),Z(8,"div",31),Ge(9,"div",43),Q()(),Ge(10,"div",42),Q()),i&2){let t=Se().$implicit;oe(7),Je(t.type==="vehicle"?7:-1)}}function IBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function FBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function OBe(i,e){if(i&1){let t=vt();Z(0,"mat-form-field",32)(1,"mat-label"),ce(2,"Vehicle Mode"),Q(),Z(3,"input",44),mh("ngModelChange",function(n){Ee(t);let a=Se().$implicit;return dh(a.mode,n)||(a.mode=n),Ae(n)}),Q()()}if(i&2){let t=Se().$implicit;oe(3),hh("ngModel",t.mode)}}function zBe(i,e){if(i&1){let t=vt();Z(0,"mat-chip-row",45),Le("removed",function(){let n=Ee(t).$implicit,a=Se().$index,o=Se();return Ae(o.removeTagFromBackgroundShape(a,n))})("edited",function(n){let a=Ee(t).$implicit,o=Se().$index,s=Se();return Ae(s.editTagInBackgroundShape(o,a,n))}),ce(1),Z(2,"button",46)(3,"mat-icon"),ce(4,"cancel"),Q()()()}if(i&2){let t=e.$implicit;Re("aria-description","press enter to edit "+t)("editable",!0),oe(),_t(" ",t," "),oe(),Mt("aria-label","remove "+t)}}function HBe(i,e){if(i&1){let t=vt();Z(0,"div",11),je(1,LBe,11,1,"div",26),Z(2,"div",27)(3,"app-background-shape",28),Le("shapeChange",function(n){let a=Ee(t).$index,o=Se();return Ae(o.onBackgroundShapeTypeChange(a,n))}),Q()(),Z(4,"input",29),Le("input",function(n){let a=Ee(t).$index,o=Se();return Ae(o.onBackgroundShapeColorChange(a,n))}),Q(),Z(5,"div",30)(6,"div",31)(7,"mat-form-field",32)(8,"mat-label"),ce(9,"Type"),Q(),Z(10,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.type,n)||(a.type=n),Ae(n)}),ui(11,IBe,3,4,"mat-option",15,_o),Q()(),Z(13,"mat-form-field",32)(14,"mat-label"),ce(15,"Zoom"),Q(),Z(16,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.zoom,n)||(a.zoom=n),Ae(n)}),ui(17,FBe,3,4,"mat-option",15,_o),Q()(),je(19,OBe,4,1,"mat-form-field",32),Q(),Z(20,"div",31)(21,"mat-form-field",32)(22,"mat-label"),ce(23,"Tags"),Q(),Z(24,"mat-chip-grid",34,2),ui(26,zBe,5,4,"mat-chip-row",35,Ea),Z(28,"input",36),Le("matChipInputTokenEnd",function(n){let a=Ee(t).$index,o=Se();return Ae(o.addTagToBackgroundShape(a,n))}),Q()(),Z(29,"mat-hint"),ce(30," If multiple tags are selected, the shape will be used for entities that have all of them. "),Q()()()(),Z(31,"div",37)(32,"button",38),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.duplicateBackgroundShape(n))}),Z(33,"mat-icon"),ce(34,"content_copy"),Q()(),Z(35,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.toggleBackgroundShapeIsActive(n))}),Z(36,"mat-icon"),ce(37),Q()()(),Z(38,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.removeBackgroundShape(n))}),Z(39,"mat-icon"),ce(40,"cancel"),Q()()()}if(i&2){let t=e.$implicit,r=Or(25),n=Se();oe(3),Re("backgroundShape",t),oe(),Re("value",t.color.substring(0,7)),oe(6),hh("value",t.type),oe(),hi(n.CUSTOMIZATION_ENTITY_TYPES),oe(5),hh("value",t.zoom),oe(),hi(n.CUSTOMIZATION_ZOOMS),oe(2),Je(t.type==="vehicle"?19:-1),oe(7),hi(t.tags),oe(2),Re("matChipInputAddOnBlur",!0)("matChipInputFor",r),oe(7),ax("matTooltip","",t.isActive?"Deactivate":"Activate"," Background Shape"),oe(2),_t(" ",t.isActive?"visibility":"visibility_off"," "),oe(),Re("matTooltip","Remove background shape")}}function NBe(i,e){i&1&&(Z(0,"div",9)(1,"p"),ce(2,"No custom icons added yet."),Q()())}function GBe(i,e){i&1&&Ge(0,"div",43)}function VBe(i,e){if(i&1&&(Z(0,"div",40),Ge(1,"div",41)(2,"div",42),Z(3,"div",30)(4,"div",31),Ge(5,"div",43)(6,"div",43),je(7,GBe,1,0,"div",43),Q(),Z(8,"div",31),Ge(9,"div",43),Q()(),Ge(10,"div",42),Q()),i&2){let t=Se().$implicit;oe(7),Je(t.type==="vehicle"?7:-1)}}function KBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function WBe(i,e){if(i&1&&(Z(0,"mat-option",15),ce(1),Vr(2,"titlecase"),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),_t(" ",En(2,2,t.replaceAll("-"," "))," ")}}function UBe(i,e){if(i&1){let t=vt();Z(0,"mat-form-field",32)(1,"mat-label"),ce(2,"Vehicle Mode"),Q(),Z(3,"input",44),mh("ngModelChange",function(n){Ee(t);let a=Se().$implicit;return dh(a.mode,n)||(a.mode=n),Ae(n)}),Q()()}if(i&2){let t=Se().$implicit;oe(3),hh("ngModel",t.mode)}}function jBe(i,e){if(i&1){let t=vt();Z(0,"mat-chip-row",45),Le("removed",function(){let n=Ee(t).$implicit,a=Se().$index,o=Se();return Ae(o.removeTagFromCustomTexture(a,n))})("edited",function(n){let a=Ee(t).$implicit,o=Se().$index,s=Se();return Ae(s.editTagInCustomTexture(o,a,n))}),ce(1),Z(2,"button",46)(3,"mat-icon"),ce(4,"cancel"),Q()()()}if(i&2){let t=e.$implicit;Re("aria-description","press enter to edit "+t)("editable",!0),oe(),_t(" ",t," "),oe(),Mt("aria-label","remove "+t)}}function qBe(i,e){if(i&1){let t=vt();Z(0,"div",11),je(1,VBe,11,1,"div",26),Z(2,"div",27),Ge(3,"img",47),Q(),Z(4,"button",48),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.uploadCustomTexture(n))}),Z(5,"mat-icon"),ce(6,"upload"),Q()(),Z(7,"div",30)(8,"div",31)(9,"mat-form-field",32)(10,"mat-label"),ce(11,"Type"),Q(),Z(12,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.type,n)||(a.type=n),Ae(n)}),ui(13,KBe,3,4,"mat-option",15,_o),Q()(),Z(15,"mat-form-field",32)(16,"mat-label"),ce(17,"Zoom"),Q(),Z(18,"mat-select",33),mh("valueChange",function(n){let a=Ee(t).$implicit;return dh(a.zoom,n)||(a.zoom=n),Ae(n)}),ui(19,WBe,3,4,"mat-option",15,_o),Q()(),je(21,UBe,4,1,"mat-form-field",32),Q(),Z(22,"div",31)(23,"mat-form-field",32)(24,"mat-label"),ce(25,"Tags"),Q(),Z(26,"mat-chip-grid",34,2),ui(28,jBe,5,4,"mat-chip-row",35,Ea),Z(30,"input",36),Le("matChipInputTokenEnd",function(n){let a=Ee(t).$index,o=Se();return Ae(o.addTagToCustomTexture(a,n))}),Q()(),Z(31,"mat-hint"),ce(32," If multiple tags are selected, the icon will be used for entities that have all of them. "),Q()()()(),Z(33,"div",37)(34,"button",49),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.duplicateCustomTexture(n))}),Z(35,"mat-icon"),ce(36,"content_copy"),Q()(),Z(37,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.toggleCustomTextureIsActive(n))}),Z(38,"mat-icon"),ce(39),Q()()(),Z(40,"button",39),Le("click",function(){let n=Ee(t).$index,a=Se();return Ae(a.removeCustomTexture(n))}),Z(41,"mat-icon"),ce(42,"cancel"),Q()()()}if(i&2){let t=e.$implicit,r=Or(27),n=Se();oe(3),Re("src",t.url,rx),oe(9),hh("value",t.type),oe(),hi(n.CUSTOMIZATION_ENTITY_TYPES),oe(5),hh("value",t.zoom),oe(),hi(n.CUSTOMIZATION_ZOOMS),oe(2),Je(t.type==="vehicle"?21:-1),oe(7),hi(t.tags),oe(2),Re("matChipInputAddOnBlur",!0)("matChipInputFor",r),oe(7),ax("matTooltip","",t.isActive?"Deactivate":"Activate"," Custom Icon"),oe(2),_t(" ",t.isActive?"visibility":"visibility_off"," "),oe(),Re("matTooltip","Remove custom icon")}}function ZBe(i,e){if(i&1){let t=vt();Ri(0),Z(1,"div",13)(2,"div",27),Ge(3,"img",47),Q(),Z(4,"button",48),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.uploadDefaultTexture(n))}),Z(5,"mat-icon"),ce(6,"upload"),Q()(),Z(7,"mat-form-field",50),Ge(8,"input",51),Vr(9,"titlecase"),Q(),Z(10,"button",52),Le("click",function(){let n=Ee(t).$implicit,a=Se();return Ae(a.resetDefaultTexture(n))}),Z(11,"mat-icon"),ce(12,"restart_alt"),Q()()()}if(i&2){let t=e.$implicit,r=Se().getTextureUrlSignal(t)();oe(3),Re("src",r,rx),oe(5),ax("value","Default ",En(9,3,t.replaceAll("-"," "))," Icon")}}function YBe(i,e){if(i&1&&Ge(0,"div",54),i&2){let t=e.$implicit;yr("background-color",t)}}function JBe(i,e){if(i&1&&(Z(0,"div",16)(1,"span"),ce(2,"Light Preset:"),Q(),ui(3,YBe,1,2,"div",53,_o),Q()),i&2){let t=Se();oe(3),hi(t.PRESET_LIGHT_COLOR_THEME)}}function $Be(i,e){if(i&1&&Ge(0,"div",54),i&2){let t=e.$implicit;yr("background-color",t)}}function XBe(i,e){if(i&1&&(Z(0,"div",16)(1,"span"),ce(2,"Saturated Preset:"),Q(),ui(3,$Be,1,2,"div",53,_o),Q()),i&2){let t=Se();oe(3),hi(t.PRESET_SATURATED_COLOR_THEME)}}function QBe(i,e){i&1&&Ge(0,"div",60)}function eRe(i,e){if(i&1){let t=vt();Z(0,"div",57),je(1,QBe,1,0,"div",58),Z(2,"input",59),Le("input",function(n){let a=Ee(t).$index,o=Se(2);return Ae(o.onColorChange(a,n))}),Q()()}if(i&2){let t=e.$implicit;oe(2),Re("value",t)}}function tRe(i,e){if(i&1){let t=vt();Z(0,"div",16)(1,"span"),ce(2,"Custom:"),Q(),Z(3,"button",55),Le("click",function(){Ee(t);let n=Se();return Ae(n.removeCustomColor())}),Z(4,"mat-icon"),ce(5,"remove_circle_outline"),Q()(),Z(6,"div",56),Le("cdkDropListDropped",function(n){Ee(t);let a=Se();return Ae(a.dropCustomColor(n))}),ui(7,eRe,3,1,"div",57,_o),Q(),Z(9,"button",55),Le("click",function(){Ee(t);let n=Se();return Ae(n.addCustomColor())}),Z(10,"mat-icon"),ce(11,"add_circle_outline"),Q()()(),Z(12,"span"),ce(13,"*Click to set their color. Drag to change their order."),Q()}if(i&2){let t=Se();oe(3),Re("disabled",!t.canRemoveColor()),oe(4),hi(t.customColors()),oe(2),Re("disabled",!t.canAddColor())}}function iRe(i,e){if(i&1&&(Z(0,"div",18),Ri(1),Ge(2,"img",47)(3,"div",61),Q()),i&2){let t=e.$implicit,r=Se(),n=r.getTextureUrlSignal(t)();oe(2),Re("src",n,rx),oe(),yr("background-color",r.testScaleColor)("mask-image","url("+n+")")("webkit-mask-image","url("+n+")")}}var rRe=["vehicle","passenger","stop","zoomed-out-vehicle","zoomed-out-passenger","zoomed-out-stop"],iM=class i{constructor(e,t){this.dialogRef=e;this.spritesService=t;this.SPRITE_SIZE=this.spritesService.SPRITE_SIZE,this.PRESET_LIGHT_COLOR_THEME=this.spritesService.PRESET_LIGHT_COLOR_THEME,this.PRESET_SATURATED_COLOR_THEME=this.spritesService.PRESET_SATURATED_COLOR_THEME,this.vehicleTextureUrlSignal.set(this.spritesService.vehicleTexture.baseTexture.resource.url),this.passengerTextureUrlSignal.set(this.spritesService.passengerTexture.baseTexture.resource.url),this.stopTextureUrlSignal.set(this.spritesService.stopTexture.baseTexture.resource.url),this.zoomedOutVehicleTextureUrlSignal.set(this.spritesService.zoomedOutVehicleTexture.baseTexture.resource.url),this.zoomedOutPassengerTextureUrlSignal.set(this.spritesService.zoomedOutPassengerTexture.baseTexture.resource.url),this.zoomedOutStopTextureUrlSignal.set(this.spritesService.zoomedOutStopTexture.baseTexture.resource.url),this.customTexturesSignal.set(this.spritesService.customTextures),this.backgroundShapesSignal.set(this.spritesService.backgroundShapes),this.colorPresetIndex=this.spritesService.colorPresetIndex,this.customColors.set(structuredClone(this.spritesService.customColors))}SPRITE_SIZE;PRESET_LIGHT_COLOR_THEME;PRESET_SATURATED_COLOR_THEME;EDITABLE_DEFAULT_ICON_TYPES=rRe;CUSTOMIZATION_ENTITY_TYPES=o$;CUSTOMIZATION_ZOOMS=s$;MIN_COLOR_COUNT=2;MAX_COLOR_COUNT=12;currentError="";colorPresetIndex=0;customColors=Bt(["#00ff00","#ff0000"]);testScaleValue=0;testScaleColor="#ffffff";customTexturesSignal=Bt([]);backgroundShapesSignal=Bt([]);vehicleTextureUrlSignal=Bt("");passengerTextureUrlSignal=Bt("");stopTextureUrlSignal=Bt("");zoomedOutVehicleTextureUrlSignal=Bt("");zoomedOutPassengerTextureUrlSignal=Bt("");zoomedOutStopTextureUrlSignal=Bt("");uploadButton=lh.required("iconFileUpload");selectedTextureIndex=null;selectedDefaultTextureType=null;dropCustomColor(e){this.customColors.update(t=>(Bf(t,e.previousIndex,e.currentIndex),t)),this.applyColorGradientTester()}canRemoveColor=$t(()=>this.customColors().length>this.MIN_COLOR_COUNT);canAddColor=$t(()=>this.customColors().length<this.MAX_COLOR_COUNT);addCustomColor(){this.canAddColor()&&(this.customColors.update(e=>[...e,"#dd0000"]),this.applyColorGradientTester())}removeCustomColor(){this.canRemoveColor()&&(this.customColors.update(e=>(e.pop(),[...e])),this.applyColorGradientTester())}onColorChange(e,t){let r=t.target.value;this.customColors.update(n=>(n[e]=r,n)),this.applyColorGradientTester()}onColorSetIndexChange(e){this.applyColorGradientTester()}onColorScaleChange(e){this.testScaleValue=parseInt(e.target.value)/100,this.applyColorGradientTester()}applyColorGradientTester(){let e=[];if(this.colorPresetIndex==0&&(e=this.spritesService.PRESET_LIGHT_COLOR_THEME),this.colorPresetIndex==1&&(e=this.spritesService.PRESET_SATURATED_COLOR_THEME),this.colorPresetIndex==2&&(e=this.customColors()),this.testScaleValue===0){this.testScaleColor="#ffffff";return}let t=Hf(e),r=sc(t(this.testScaleValue))?.formatHex()??"#ffffff";this.testScaleColor=r}onIconFileUpload(e){let t=e.target;if(!t||!t.files)return;let r=new FileReader;r.onloadend=()=>Ce(this,null,function*(){if(r.result)try{let n=yield hq.read(r.result);n.resize({w:this.SPRITE_SIZE});let a=yield n.getBase64("image/png");if(this.selectedTextureIndex!==null)this.setCustomTexture(this.selectedTextureIndex,a);else if(this.selectedDefaultTextureType!==null)this.getTextureUrlSignal(this.selectedDefaultTextureType).set(a);else{this.currentError="No texture selected for upload.";return}this.currentError=""}catch{this.currentError="Cannot upload this image."}finally{t.value=""}}),r.readAsDataURL(t.files[0])}onConfigurationFileUpload(e){let t=e.target;if(!t||!t.files)return;let r=new FileReader;r.onloadend=()=>{if(r.result)try{let n=JSON.parse(r.result);if(n.version!==this.spritesService.VERSION){this.currentError="Import data format is outdated.";return}if(n.vehicleTextureUrl===void 0){this.currentError="JSON has missing data: vehicleTextureUrl";return}if(n.passengerTextureUrl===void 0){this.currentError="JSON has missing data: passengerTextureUrl";return}if(n.stopTextureUrl===void 0){this.currentError="JSON has missing data: stopTextureUrl";return}if(n.zoomedOutVehicleTextureUrl===void 0){this.currentError="JSON has missing data: zoomedOutVehicleTextureUrl";return}if(n.zoomedOutPassengerTextureUrl===void 0){this.currentError="JSON has missing data: zoomedOutPassengerTextureUrl";return}if(n.zoomedOutStopTextureUrl===void 0){this.currentError="JSON has missing data: zoomedOutStopTextureUrl";return}if(n.customTextures===void 0){this.currentError="JSON has missing data: customTextures";return}if(n.colorPresetIndex===void 0){this.currentError="JSON has missing data: colorPresetIndex";return}if(n.customColors===void 0){this.currentError="JSON has missing data: customColors";return}this.vehicleTextureUrlSignal.set(n.vehicleTextureUrl),this.passengerTextureUrlSignal.set(n.passengerTextureUrl),this.stopTextureUrlSignal.set(n.stopTextureUrl),this.zoomedOutVehicleTextureUrlSignal.set(n.zoomedOutVehicleTextureUrl),this.zoomedOutPassengerTextureUrlSignal.set(n.zoomedOutPassengerTextureUrl),this.zoomedOutStopTextureUrlSignal.set(n.zoomedOutStopTextureUrl),this.customTexturesSignal.set(n.customTextures),this.backgroundShapesSignal.set(n.backgroundShapes),this.colorPresetIndex=n.colorPresetIndex,n.customColors.length>=2&&this.customColors.set(n.customColors),this.currentError=""}catch{this.currentError="Could not parse JSON data."}finally{t.value=""}},r.readAsText(t.files[0])}uploadDefaultTexture(e){this.selectedTextureIndex=null,this.selectedDefaultTextureType=e,this.uploadButton().nativeElement.click()}getTextureUrlSignal(e){switch(e){case"vehicle":return this.vehicleTextureUrlSignal;case"passenger":return this.passengerTextureUrlSignal;case"stop":return this.stopTextureUrlSignal;case"zoomed-out-vehicle":return this.zoomedOutVehicleTextureUrlSignal;case"zoomed-out-passenger":return this.zoomedOutPassengerTextureUrlSignal;case"zoomed-out-stop":return this.zoomedOutStopTextureUrlSignal}}resetDefaultTexture(e){switch(e){case"vehicle":this.vehicleTextureUrlSignal.set(this.spritesService.DEFAULT_VEHICLE_TEXTURE_URL);break;case"passenger":this.passengerTextureUrlSignal.set(this.spritesService.DEFAULT_PASSENGER_TEXTURE_URL);break;case"stop":this.stopTextureUrlSignal.set(this.spritesService.DEFAULT_STOP_TEXTURE_URL);break;case"zoomed-out-vehicle":this.zoomedOutVehicleTextureUrlSignal.set(this.spritesService.DEFAULT_ZOOMED_OUT_VEHICLE_TEXTURE_URL);break;case"zoomed-out-passenger":this.zoomedOutPassengerTextureUrlSignal.set(this.spritesService.DEFAULT_ZOOMED_OUT_PASSENGER_TEXTURE_URL);break;case"zoomed-out-stop":this.zoomedOutStopTextureUrlSignal.set(this.spritesService.DEFAULT_ZOOMED_OUT_STOP_TEXTURE_URL)}}uploadCustomTexture(e){this.selectedTextureIndex=e,this.selectedDefaultTextureType=null,this.uploadButton().nativeElement.click()}addCustomTexture(){this.customTexturesSignal.update(e=>[...e,{mode:null,url:this.spritesService.DEFAULT_UNDEFINED_TEXTURE_URL,tags:[],type:"vehicle",zoom:"any",isActive:!0}])}removeCustomTexture(e){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(t=>(t.splice(e,1),[...t]))}setCustomTexture(e,t){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(r=>(r[e].url=t,[...r]))}dropCustomTexture(e){this.customTexturesSignal.update(t=>(Bf(t,e.previousIndex,e.currentIndex),structuredClone(t)))}addTagToCustomTexture(e,t){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(r=>{let n=structuredClone(r[e]),a=t.value.trim();return a?(n.tags.includes(a)||(n.tags.push(a),n.tags.sort()),t.chipInput.clear(),r[e]=n,[...r]):r})}removeTagFromCustomTexture(e,t){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(r=>{let n=structuredClone(r[e]);return n.tags=n.tags.filter(a=>a!==t),r[e]=n,[...r]})}editTagInCustomTexture(e,t,r){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(n=>{let a=structuredClone(n[e]),o=r.value.trim();return t&&(a.tags=a.tags.filter(s=>s!==t)),o&&!a.tags.includes(o)&&(a.tags.push(o),a.tags.sort()),n[e]=a,[...n]})}addBackgroundShape(){this.backgroundShapesSignal.update(e=>[...e,{color:"#ff000080",shape:"circle",mode:null,tags:[],type:"vehicle",zoom:"any",isActive:!0}])}removeBackgroundShape(e){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(t=>(t.splice(e,1),[...t]))}dropBackgroundShape(e){this.backgroundShapesSignal.update(t=>(Bf(t,e.previousIndex,e.currentIndex),structuredClone(t)))}addTagToBackgroundShape(e,t){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(r=>{let n=structuredClone(r[e]),a=t.value.trim();return a?(n.tags.includes(a)||(n.tags.push(a),n.tags.sort()),t.chipInput.clear(),r[e]=n,[...r]):r})}removeTagFromBackgroundShape(e,t){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(r=>{let n=structuredClone(r[e]);return n.tags=n.tags.filter(a=>a!==t),r[e]=n,[...r]})}editTagInBackgroundShape(e,t,r){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(n=>{let a=structuredClone(n[e]),o=r.value.trim();return t&&(a.tags=a.tags.filter(s=>s!==t)),o&&!a.tags.includes(o)&&(a.tags.push(o),a.tags.sort()),n[e]=a,[...n]})}onBackgroundShapeTypeChange(e,t){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(r=>{let n=structuredClone(r[e]);return n.shape=t,r[e]=n,[...r]})}onBackgroundShapeColorChange(e,t){if(e>=this.backgroundShapesSignal().length)return;let r=t.target.value;this.backgroundShapesSignal.update(n=>{let a=structuredClone(n[e]);return a.color=r+"80",n[e]=a,[...n]})}exportTextures(){let e={version:this.spritesService.VERSION,vehicleTextureUrl:this.vehicleTextureUrlSignal(),passengerTextureUrl:this.passengerTextureUrlSignal(),stopTextureUrl:this.stopTextureUrlSignal(),zoomedOutVehicleTextureUrl:this.zoomedOutVehicleTextureUrlSignal(),zoomedOutPassengerTextureUrl:this.zoomedOutPassengerTextureUrlSignal(),zoomedOutStopTextureUrl:this.zoomedOutStopTextureUrlSignal(),customTextures:this.customTexturesSignal(),backgroundShapes:this.backgroundShapesSignal(),colorPresetIndex:this.colorPresetIndex,customColors:this.customColors()},t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download="multimodal-icons.json",n.click(),URL.revokeObjectURL(r)}onSave(){this.spritesService.saveTextureData(this.vehicleTextureUrlSignal(),this.passengerTextureUrlSignal(),this.stopTextureUrlSignal(),this.zoomedOutVehicleTextureUrlSignal(),this.zoomedOutPassengerTextureUrlSignal(),this.zoomedOutStopTextureUrlSignal(),this.customTexturesSignal(),this.backgroundShapesSignal(),this.colorPresetIndex,this.customColors()),this.dialogRef.close()}duplicateCustomTexture(e){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(t=>{let r=structuredClone(t[e]);return[...t.slice(0,e+1),r,...t.slice(e+1)]})}duplicateBackgroundShape(e){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(t=>{let r=structuredClone(t[e]);return[...t.slice(0,e+1),r,...t.slice(e+1)]})}toggleCustomTextureIsActive(e){e>=this.customTexturesSignal().length||this.customTexturesSignal.update(t=>{let r=structuredClone(t[e]);return r.isActive=!r.isActive,t[e]=r,[...t]})}toggleBackgroundShapeIsActive(e){e>=this.backgroundShapesSignal().length||this.backgroundShapesSignal.update(t=>{let r=structuredClone(t[e]);return r.isActive=!r.isActive,t[e]=r,[...t]})}static \u0275fac=function(t){return new(t||i)(rt(jo),rt(Zg))};static \u0275cmp=tt({type:i,selectors:[["app-edit-map-icons-dialog"]],viewQuery:function(t,r){t&1&&ch(r.uploadButton,PBe,5),t&2&&uh()},decls:66,vars:11,consts:[["iconFileUpload",""],["configurationFileUpload",""],["chipGrid",""],["mat-dialog-title",""],["type","file","accept",".png, .jpg, .jpeg, .bmp",1,"file-upload",3,"change"],["type","file","accept",".json",1,"file-upload",3,"change"],[1,"text-content"],[1,"add-container"],["mat-button","",1,"add-button",3,"click"],[1,"no-custom-textures"],["cdkDropList","","cdkDropListOrientation","vertical",1,"icon-list",3,"cdkDropListDropped"],["cdkDrag","",1,"icon-list-item"],[1,"icon-list"],[1,"icon-list-item"],[1,"color-group",3,"ngModelChange","change","ngModel"],[3,"value"],[1,"color-list-container"],[1,"color-tester"],[1,"icon","wrapper-icon"],["min","0","max","100","discrete","","showTickMarks",""],["matSliderThumb","",3,"input"],[1,"file-porters"],["mat-icon-button","","matTooltip","Export JSON",3,"click"],["mat-icon-button","","matTooltip","Import JSON",3,"click"],["mat-button","","mat-dialog-close",""],["mat-button","",3,"click"],["class","icon-placeholder-container icon-list-item",4,"cdkDragPlaceholder"],[1,"icon"],[3,"shapeChange","backgroundShape"],["type","color",1,"shape-color-picker",3,"input","value"],[1,"form-fields"],[1,"form-field-row"],["appearance","outline","subscriptSizing","dynamic",1,"compact-input","custom-icon-form-field"],[3,"valueChange","value"],["aria-label","Enter fruits"],[3,"aria-description","editable"],[3,"matChipInputTokenEnd","matChipInputAddOnBlur","matChipInputFor"],[1,"flex-column","gap-0-5-rem"],["mat-icon-button","","matTooltip","Duplicate Background Shape",3,"click"],["mat-icon-button","",3,"click","matTooltip"],[1,"icon-placeholder-container","icon-list-item"],[1,"icon-placeholder","icon"],[1,"icon-button-placeholder"],[1,"form-field-placeholder","custom-icon-form-field"],["matInput","",3,"ngModelChange","ngModel"],[3,"removed","edited","aria-description","editable"],["matChipRemove",""],["width","40","alt","icon",3,"src"],["mat-icon-button","","matTooltip","Upload image",3,"click"],["mat-icon-button","","matTooltip","Duplicate Custom Icon",3,"click"],["appearance","outline","subscriptSizing","dynamic",1,"compact-input","default-icon-type"],["matInput","","disabled","",3,"value"],["mat-icon-button","","matTooltip","Reset icon",3,"click"],[1,"preset-color",3,"background-color"],[1,"preset-color"],["mat-icon-button","",1,"mini-icon-button",3,"click","disabled"],["cdkDropList","","cdkDropListOrientation","horizontal",1,"custom-color-list",3,"cdkDropListDropped"],["cdkDrag","",1,"custom-color"],["class","color-placeholder",4,"cdkDragPlaceholder"],["type","color",1,"color-picker",3,"input","value"],[1,"color-placeholder"],[1,"color-overlay"]],template:function(t,r){if(t&1){let n=vt();Z(0,"h1",3),ce(1,"Customize Entities"),Q(),Z(2,"mat-dialog-content")(3,"h2"),ce(4,"Edit Icons"),Q(),Z(5,"input",4,0),Le("change",function(o){return Ee(n),Ae(r.onIconFileUpload(o))}),Q(),Z(7,"input",5,1),Le("change",function(o){return Ee(n),Ae(r.onConfigurationFileUpload(o))}),Q(),Z(9,"div")(10,"div",6)(11,"p"),ce(12),Q(),Z(13,"p"),ce(14," The icons are in decreasing order of priority, meaning that if two icons match for an entity, the one that appears first in the list will be used. You can drag and drop the icons lines to change their order. Background shapes are also in decreasing order of priority, but have no effect on the icons. These shapes are displayed behind the icons and are generally used to visually group entities. "),Q(),je(15,BBe,2,1,"mat-error"),Q(),Z(16,"div",7)(17,"button",8),Le("click",function(){return Ee(n),Ae(r.addCustomTexture())}),ce(18," Add Custom Icon "),Q(),Z(19,"button",8),Le("click",function(){return Ee(n),Ae(r.addBackgroundShape())}),ce(20," Add Background Shape "),Q()(),je(21,RBe,3,0,"div",9),Z(22,"section",10),Le("cdkDropListDropped",function(o){return Ee(n),Ae(r.dropBackgroundShape(o))}),ui(23,HBe,41,11,"div",11,_o),Ge(25,"mat-divider"),Q(),je(26,NBe,3,0,"div",9),Z(27,"section",10),Le("cdkDropListDropped",function(o){return Ee(n),Ae(r.dropCustomTexture(o))}),ui(28,qBe,43,10,"div",11,_o),Ge(30,"mat-divider"),Q(),Z(31,"section",12),ui(32,ZBe,13,5,"div",13,Ea),Ge(34,"mat-divider"),Z(35,"h2"),ce(36,"Capacity color gradient"),Q(),Z(37,"mat-radio-group",14),mh("ngModelChange",function(o){return Ee(n),dh(r.colorPresetIndex,o)||(r.colorPresetIndex=o),Ae(o)}),Le("change",function(o){return Ee(n),Ae(r.onColorSetIndexChange(o))}),Z(38,"mat-radio-button",15),ce(39,"Light"),Q(),Z(40,"mat-radio-button",15),ce(41,"Saturated"),Q(),Z(42,"mat-radio-button",15),ce(43,"Custom"),Q()(),je(44,JBe,5,0,"div",16)(45,XBe,5,0,"div",16)(46,tRe,14,2),Z(47,"span"),ce(48,"*Test the color gradient using the slider below."),Q(),Z(49,"div",17),ui(50,iRe,4,7,"div",18,Ea),Z(52,"mat-slider",19)(53,"input",20),Le("input",function(o){return Ee(n),Ae(r.onColorScaleChange(o))}),Q()()()()()(),Z(54,"mat-dialog-actions")(55,"div",21)(56,"button",22),Le("click",function(){return Ee(n),Ae(r.exportTextures())}),Z(57,"mat-icon"),ce(58,"download_for_offline"),Q()(),Z(59,"button",23),Le("click",function(){Ee(n);let o=Or(8);return Ae(o.click())}),Z(60,"mat-icon"),ce(61,"upload_file"),Q()()(),Z(62,"button",24),ce(63,"Cancel"),Q(),Z(64,"button",25),Le("click",function(){return Ee(n),Ae(r.onSave())}),ce(65,"Save"),Q()()}t&2&&(oe(12),_t(" The uploaded icons will be rescaled to ",r.SPRITE_SIZE,"px in width. For a better result, the icons should not be too wide or too thin. "),oe(3),Je(r.currentError!==""?15:-1),oe(6),Je(r.backgroundShapesSignal().length<=0?21:-1),oe(2),hi(r.backgroundShapesSignal()),oe(3),Je(r.customTexturesSignal().length<=0?26:-1),oe(2),hi(r.customTexturesSignal()),oe(4),hi(r.EDITABLE_DEFAULT_ICON_TYPES),oe(5),hh("ngModel",r.colorPresetIndex),oe(),Re("value",0),oe(2),Re("value",1),oe(2),Re("value",2),oe(2),Je(r.colorPresetIndex===0?44:-1),oe(),Je(r.colorPresetIndex===1?45:-1),oe(),Je(r.colorPresetIndex===2?46:-1),oe(4),hi(r.EDITABLE_DEFAULT_ICON_TYPES))},dependencies:[Os,Is,Fs,vo,Br,pn,Xl,Cw,Ps,ec,uR,ha,ac,zs,Ef,Af,Rs,Eh,Dw,$l,tc,So,qo,pr,mr,Ah,Kw,Rn,Da,qw,jw,Ff,Uw,Hb,Lf,u8,c8,l8,cx,qn,_8,b8,Df,UR,tM],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}p[_ngcontent-%COMP%]{margin-top:0}.add-container[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:10px}.icon-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.icon-list-item[_ngcontent-%COMP%]{padding:5px 0;width:100%;display:flex;flex-direction:row;align-items:center;gap:10px;overflow:visible}.icon[_ngcontent-%COMP%]{width:40px;display:flex;align-items:baseline;justify-content:center}.form-fields[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;min-width:0;flex:1}.form-field-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:10px}.custom-icon-form-field[_ngcontent-%COMP%]{flex:1}.icon-placeholder-container[_ngcontent-%COMP%]{--placeholder-background-color: #f0f0f0;border:dotted 3px #999}.icon-placeholder[_ngcontent-%COMP%]{background-color:var(--placeholder-background-color);min-height:40px}.icon-button-placeholder[_ngcontent-%COMP%]{background-color:var(--placeholder-background-color);min-width:48px;min-height:48px}.form-field-placeholder[_ngcontent-%COMP%]{background-color:var(--placeholder-background-color);border-radius:4px;min-height:36px}.file-upload[_ngcontent-%COMP%]{display:none}.file-porters[_ngcontent-%COMP%]{margin-right:auto}.file-porters[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.color-title[_ngcontent-%COMP%]{margin:0}.color-group[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.color-picker[_ngcontent-%COMP%]{border:none;width:15px;height:15px;margin:2px;padding:0;background:none;cursor:pointer}.color-picker[_ngcontent-%COMP%]::-webkit-color-swatch-wrapper{padding:0}.color-picker[_ngcontent-%COMP%]::-webkit-color-swatch{border:1px solid black;border-radius:0}.color-picker[_ngcontent-%COMP%]::-moz-color-swatch{border:1px solid black;border-radius:0}.shape-color-picker[_ngcontent-%COMP%]{border:none;width:24px;height:24px;margin:8px;padding:0;background:none;cursor:pointer}.shape-color-picker[_ngcontent-%COMP%]::-webkit-color-swatch-wrapper{padding:0}.shape-color-picker[_ngcontent-%COMP%]::-webkit-color-swatch{border:1px solid black;border-radius:0}.shape-color-picker[_ngcontent-%COMP%]::-moz-color-swatch{border:1px solid black;border-radius:0}.color-list-container[_ngcontent-%COMP%], .custom-color-list[_ngcontent-%COMP%], .custom-color[_ngcontent-%COMP%], .preset-color[_ngcontent-%COMP%]{display:flex;align-items:center}.color-list-container[_ngcontent-%COMP%]{gap:5px}.preset-color[_ngcontent-%COMP%]{width:15px;height:15px;border:1px solid black}.color-placeholder[_ngcontent-%COMP%]{background:#ccc;border:dotted 3px #999;width:15px;height:15px;transition:transform .25s cubic-bezier(0,0,.2,1)}.mini-icon-button[_ngcontent-%COMP%]{width:32px;height:32px;padding:7px 4px 4px}.mini-icon-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px}.color-tester[_ngcontent-%COMP%]{display:flex;gap:10px}.wrapper-icon[_ngcontent-%COMP%]{position:relative}.color-overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0;mix-blend-mode:multiply;pointer-events:none;mask-repeat:no-repeat;width:40px;height:100%;mask-size:40px;-webkit-mask-repeat:no-repeat;-webkit-mask-size:contain}.default-icon-type[_ngcontent-%COMP%]{flex:1}mat-divider[_ngcontent-%COMP%]{padding-block-end:1rem}"]})};function nRe(i,e){i&1&&(Z(0,"mat-icon",2),ce(1," error "),Q())}function aRe(i,e){i&1&&(Z(0,"mat-icon",3),ce(1," warning "),Q())}function oRe(i,e){i&1&&(Z(0,"mat-icon"),ce(1," info "),Q())}function sRe(i,e){}function lRe(i,e){if(i&1&&(Z(0,"button",4),ce(1),Q()),i&2){let t,r=Se();Re("mat-dialog-close",!1),oe(),_t(" ",(t=r.data.cancelButtonOverride)!==null&&t!==void 0?t:"Close"," ")}}var rM=class i{constructor(e){this.data=e}static \u0275fac=function(t){return new(t||i)(rt(sm))};static \u0275cmp=tt({type:i,selectors:[["app-information-dialog"]],decls:14,vars:6,consts:[["mat-dialog-title",""],[1,"flex-row","align-main-start","align-cross-center","gap-1-rem"],[1,"text-red"],[1,"text-yellow"],["mat-button","",3,"mat-dialog-close"]],template:function(t,r){if(t&1&&(Z(0,"h2",0),ce(1),Q(),Z(2,"mat-dialog-content")(3,"div",1),je(4,nRe,2,0,"mat-icon",2)(5,aRe,2,0,"mat-icon",3)(6,oRe,2,0,"mat-icon")(7,sRe,0,0),Z(8,"p"),ce(9),Q()()(),Z(10,"mat-dialog-actions"),je(11,lRe,2,2,"button",4),Z(12,"button",4),ce(13),Q()()),t&2){let n,a;oe(),Ti(r.data.title),oe(3),Je((n=r.data.type)==="error"?4:n==="warning"?5:n==="info"?6:7),oe(5),_t(" ",r.data.message," "),oe(2),Je(r.data.canCancel?11:-1),oe(),Re("mat-dialog-close",!0),oe(),_t(" ",(a=r.data.confirmButtonOverride)!==null&&a!==void 0?a:r.data.canCancel?"Confirm":"Close"," ")}},dependencies:[Is,Os,vo,Fs,Br,pn,mr],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}mat-icon[_ngcontent-%COMP%]{min-width:24px}"]})};var v$=go(nI());var cRe=["starting","paused","running","stopping","completed","lost","corrupted","outdated","future"];function uRe(i){return cRe.includes(i)}var Bu=["starting","running","paused","stopping","lost"],f$={starting:0,running:1,paused:1,stopping:2,lost:3,completed:4,corrupted:5,outdated:5,future:5};function g$(i){if(typeof i!="string")return console.error("Invalid data type for start time",i),null;if(!/^\d{8}-\d{9}$/.test(i))return console.error("Invalid format for start time",i),null;let e=parseInt(i.slice(0,4)),t=parseInt(i.slice(4,6))-1,r=parseInt(i.slice(6,8)),n=parseInt(i.slice(9,11)),a=parseInt(i.slice(11,13)),o=parseInt(i.slice(13,15)),s=parseInt(i.slice(16,19));return new Date(e,t,r,n,a,o,s)}function hRe(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for simulation",i),null;if(!("id"in i)||typeof i.id!="string")return console.error("Invalid simulation ID in simulation",i),null;let e=i.id;if(!("status"in i)||!uRe(i.status))return console.error("Invalid simulation status in simulation",i),null;let t=i.status;if(i.status==="corrupted"){let g=i.id.split(lf)[1]??"unknown",_=g$(i.id.split(lf)[0])??new Date(0);return{id:e,name:g,data:"unknown",status:t,startTime:_,simulationStartTime:null,simulationEndTime:null,simulationTime:null,simulationEstimatedEndTime:null,lastUpdateIndex:null,completion:-1,configuration:{maxDuration:null},polylinesVersion:-1,size:null}}if(!("name"in i)||typeof i.name!="string")return console.error("Invalid simulation name in simulation",i),null;let r=i.name;if(!("data"in i)||typeof i.data!="string")return console.error("Invalid simulation data in simulation",i),null;let n=i.data;if(!("startTime"in i))return console.error("Invalid simulation start time in simulation",i),null;let a=g$(i.startTime);if(a===null)return console.error("Invalid simulation start time",i.startTime,"in simulation",i),null;let o=null;if("simulationStartTime"in i){if(typeof i.simulationStartTime!="number")return console.error("Invalid simulation start time",i.simulationStartTime,"in simulation",i),null;o=i.simulationStartTime}let s=null;if("simulationEndTime"in i){if(typeof i.simulationEndTime!="number")return console.error("Invalid simulation end time",i.simulationEndTime,"in simulation",i),null;s=i.simulationEndTime}let l=null;if("simulationTime"in i){if(typeof i.simulationTime!="number")return console.error("Invalid simulation time",i.simulationTime,"in simulation",i),null;l=i.simulationTime}let c=null;if("simulationEstimatedEndTime"in i){if(typeof i.simulationEstimatedEndTime!="number")return console.error("Invalid simulation estimated end time",i.simulationEstimatedEndTime,"in simulation",i),null;c=i.simulationEstimatedEndTime}let u=null;if("lastUpdateIndex"in i){if(typeof i.lastUpdateIndex!="number")return console.error("Invalid last update index",i.lastUpdateIndex,"in simulation",i),null;u=i.lastUpdateIndex}let h=1;Bu.includes(t)&&(o!==null&&l!==null&&c!==null?h=(l-o)/(c-o):(console.warn("Incomplete simulation data for completion calculation",i),h=0));let d=null;if("configuration"in i){if(typeof i.configuration!="object"||i.configuration===null)return console.error("Invalid configuration",i.configuration,"in simulation",i),null;if("maxDuration"in i.configuration){if(i.configuration.maxDuration!==null&&typeof i.configuration.maxDuration!="number")return console.error("Invalid max duration",i.configuration.maxDuration,"in simulation",i),null;d=i.configuration.maxDuration}}let p=-1;if("polylinesVersion"in i){if(typeof i.polylinesVersion!="number")return console.error("Invalid polylines version",i.polylinesVersion,"in simulation",i),null;p=i.polylinesVersion}let f=null;if("size"in i){if(i.size!==null&&typeof i.size!="number")return console.error("Invalid size",i.size,"in simulation",i),null;f=i.size}return{id:e,name:r,data:n,status:t,startTime:a,simulationStartTime:o,simulationEndTime:s,simulationTime:l,simulationEstimatedEndTime:c,lastUpdateIndex:u,completion:h,configuration:{maxDuration:d},polylinesVersion:p,size:f}}function y$(i){if(!Array.isArray(i))return console.error("Invalid data type for simulations",i),[];let e=[];for(let t of i){let r=hRe(t);if(r!==null)e.push(r);else return console.error("Invalid simulation data",t),null}return e}function _$(i,e){let t=f$[i.status],r=f$[e.status];return t<r?-1:t>r||i.startTime<e.startTime?1:-1}var To=class i{constructor(e,t){this.socket=e;this.dialogService=t;Ji(()=>{this._communicationStatusSignal()==="disconnected"?this.disconnectedDialogRef===null&&(this.disconnectedDialogRef=this.dialogService.openInformationDialog({title:"Disconnected",message:"The connection to the server has been lost. Please verify that the server is running and try again. The application will attempt to reconnect automatically.",type:"error",confirmButtonOverride:"Continue Anyway",cancelButtonOverride:null,canCancel:!1})):this.disconnectedDialogRef!==null&&(this.disconnectedDialogRef.close(),this.disconnectedDialogRef=null)}),this.onConnect(()=>{this._communicationStatusSignal.set("connected")}),this.onDisconnect(()=>{this._communicationStatusSignal.set("disconnected"),console.error("Disconnected from the server")}),this.on("error",r=>{console.error("Socket error:",r)}),setTimeout(()=>{this._communicationStatusSignal.update(r=>r==="connecting"?"disconnected":r)},1e3)}_communicationStatusSignal=Bt("connecting");disconnectedDialogRef=null;get isConnectedSignal(){return $t(()=>this._communicationStatusSignal()==="connected")}get communicationStatusSignal(){return this._communicationStatusSignal}emit(e,...t){this.socket.emit(e,...t)}on(e,t){this.socket.on(e,t)}onDisconnect(e){this.socket.on("disconnect",e)}onConnect(e){this.socket.on("connect",e)}removeAllListeners(e){this.socket.removeAllListeners(e)}static \u0275fac=function(t){return new(t||i)(Zt(sf),Zt(Js))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Qh=class i{constructor(e){this.communicationService=e;this.listen(),this.query(),this.communicationService.onConnect(()=>{this.query()})}_simulationsSignal=Bt([]);_availableSimulationDataSignal=Bt([]);get simulationsSignal(){return $t(()=>this._simulationsSignal().sort(_$))}get availableSimulationDataSignal(){return this._availableSimulationDataSignal}queryAvailableData(){this.communicationService.emit("get-available-data")}listen(){this.communicationService.on("simulations",e=>{let t=y$(e);if(t===null){console.error("Invalid simulations data",e);return}this._simulationsSignal.set(t)}),this.communicationService.on("available-data",e=>{if(!Array.isArray(e)||!e.every(t=>typeof t=="string")){console.error("Invalid available data",e);return}this._availableSimulationDataSignal.set(e)})}query(){this.querySimulations(),this.queryAvailableData()}querySimulations(){this.communicationService.emit("get-simulations")}static \u0275fac=function(t){return new(t||i)(Zt(To))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Jg=class i{constructor(e){this.http=e}apiUrl=Ux.apiUrl;exportFolder(e,t){return this.http.get(this.apiUrl+`${e}/${t}`,{responseType:"blob"})}importFolder(e,t,r){return this.http.post(this.apiUrl+`${e}/${t}`,r)}deleteFolder(e,t){return this.http.delete(this.apiUrl+`${e}/${t}`)}static \u0275fac=function(t){return new(t||i)(Zt(F_))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};function dRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Name is required"),Q())}function mRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Name must be at least 3 characters long"),Q())}function pRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Name must be at most 50 characters long"),Q())}function fRe(i,e){if(i&1&&(Z(0,"mat-error"),ce(1),Q()),i&2){let t=Se(2);oe(),_t(" The name must not contain the simulation save file separator (",t.SIMULATION_SAVE_FILE_SEPARATOR,") ")}}function gRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,' The name muse not contain characters that might affect the file system (e.g. /, \\, :, *, ?, ", <, >, |) '),Q())}function yRe(i,e){if(i&1&&(Z(0,"mat-option",14),ce(1),Q()),i&2){let t=e.$implicit;Re("value",t),oe(),Ti(t)}}function _Re(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Data is required"),Q())}function bRe(i,e){if(i&1){let t=vt();Z(0,"h3"),ce(1,"General"),Q(),Z(2,"div",8)(3,"section",9)(4,"mat-form-field",10),Ge(5,"input",11),Z(6,"mat-label"),ce(7,"Name"),Q(),Z(8,"mat-hint"),ce(9,"Spaces will be replaced by underscores"),Q(),je(10,dRe,2,0,"mat-error")(11,mRe,2,0,"mat-error")(12,pRe,2,0,"mat-error")(13,fRe,2,1,"mat-error")(14,gRe,2,0,"mat-error"),Q(),Z(15,"mat-form-field",10)(16,"mat-select",12),Le("openedChange",function(){Ee(t);let n=Se();return Ae(n.refreshAvailableData())}),Z(17,"mat-option",13),Le("click",function(){Ee(t);let n=Se();return Ae(n.importInputData())}),ce(18,"\u2795 Import New Folder"),Q(),ui(19,yRe,2,2,"mat-option",14,Ea),Q(),Z(21,"mat-label"),ce(22,"Data"),Q(),je(23,_Re,2,0,"mat-error"),Q()(),Z(24,"mat-checkbox",15),ce(25," Run in background "),Q()()}if(i&2){let t=Se();oe(4),Re("subscriptSizing","dynamic"),oe(6),Je(t.nameFormControl.hasError("required")?10:t.nameFormControl.hasError("minlength")?11:t.nameFormControl.hasError("maxlength")?12:t.nameFormControl.hasError("invalidPattern")?13:t.nameFormControl.hasError("invalidCharacter")?14:-1),oe(5),Re("subscriptSizing","dynamic"),oe(4),hi(t.availableSimulationDataSignal()),oe(4),Je(t.dataFormControl.hasError("required")?23:-1)}}function vRe(i,e){i&1&&(Z(0,"span",3)(1,"mat-icon",16),ce(2,"error"),Q(),Z(3,"span"),ce(4,"Select a valid data source before changing the configuration the simulation"),Q()())}function SRe(i,e){i&1&&(Z(0,"mat-error"),ce(1,"Max duration must be greater than 0"),Q())}function kRe(i,e){i&1&&ce(0," Start ")}function xRe(i,e){i&1&&ce(0," Save ")}var nM=class i{constructor(e,t,r,n,a){this.data=e;this.dataService=t;this.dialogRef=r;this.formBuilder=n;this.httpService=a;this.nameFormControl=this.formBuilder.control(null,[Fn.minLength(3),Fn.maxLength(50),this.validateName()]),this.data.mode==="start"&&this.nameFormControl.addValidators(Fn.required),this.dataFormControl=this.formBuilder.control(null),this.data.mode==="start"&&this.dataFormControl.addValidators(Fn.required),this.shouldRunInBackgroundFormControl=this.formBuilder.control(!1),this.maxDurationFormControl=this.formBuilder.control(null,[Fn.min(0)]),this.generalFormGroup=this.formBuilder.group({name:this.nameFormControl,data:this.dataFormControl,shouldRunInBackground:this.shouldRunInBackgroundFormControl}),this.configurationFormGroup=this.formBuilder.group({maxDuration:this.maxDurationFormControl}),this.formGroup=this.formBuilder.group({general:this.generalFormGroup,configuration:this.configurationFormGroup}),this.data.mode==="edit"&&this.data.currentConfiguration&&this.maxDurationFormControl.setValue(this.data.currentConfiguration.maxDuration===null?null:this.data.currentConfiguration.maxDuration/3600),this.data.mode==="start"&&(this.dataFormControl.valueChanges.pipe(gi(this.unsubscribe$)).subscribe(o=>{o?this.enableConfigurationFields():this.disableConfigurationFields()}),this.dataFormControl.value||this.disableConfigurationFields())}SIMULATION_SAVE_FILE_SEPARATOR=lf;formGroup;generalFormGroup;configurationFormGroup;nameFormControl;dataFormControl;maxDurationFormControl;shouldRunInBackgroundFormControl;unsubscribe$=new ct;ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}onSave(){this.formGroup.valid?this.dialogRef.close(this.buildResult()):console.error("Invalid form",this.formGroup)}get availableSimulationDataSignal(){return this.dataService.availableSimulationDataSignal}refreshAvailableData(){this.dataService.queryAvailableData()}buildResult(){let e=this.nameFormControl.value;return typeof e=="string"&&(e=e.trim().replace(/\s/g,"_")),{general:{name:e,data:this.dataFormControl.value,shouldRunInBackground:!!this.shouldRunInBackgroundFormControl.value},configuration:{maxDuration:this.maxDurationFormControl.value===null?null:Math.ceil(this.maxDurationFormControl.value*3600)}}}disableConfigurationFields(){this.maxDurationFormControl.disable()}enableConfigurationFields(){this.maxDurationFormControl.enable()}validateName(){return e=>{if(typeof e.value=="string"){if(e.value.match(lf))return{invalidPattern:!0};if(e.value.match(/[<>:"/\\|?*]/))return{invalidCharacter:!0}}return null}}importInputData(){let e=document.createElement("input");e.type="file",e.webkitdirectory=!0,e.multiple=!0;let t=r=>Ce(this,null,function*(){let n=r.target.files;if(!n||n.length===0)return;let a=new v$.default,o=n[0].webkitRelativePath.split("/")[0];for(let u of Array.from(n)){let h=u.webkitRelativePath.replace(o+"/","");a.file(h,u)}let s=yield a.generateAsync({type:"blob"}),l="input_data",c=new FormData;c.append("file",s,"folder.zip"),this.httpService.importFolder(l,o,c).subscribe({next:u=>{this.refreshAvailableData();let h="actual_folder_name"in u?u.actual_folder_name:o;setTimeout(()=>{this.dataFormControl.setValue(h)},100)},error:u=>{console.error("Upload failed:",u)}})});e.addEventListener("change",r=>{t(r).catch(n=>{console.error("Error handling file change:",n)})}),e.click()}exportInputData(e){this.httpService.exportFolder("input_data",e).subscribe(r=>{let n=new Blob([r],{type:"application/zip"}),a=window.URL.createObjectURL(n),o=document.createElement("a");o.href=a,o.download=e+".zip",document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(a)})}deleteInputData(e){this.httpService.deleteFolder("input_data",e).subscribe({next:r=>{r.message||r.error&&console.error("Failed to delete the data folder:",r.error)},error:r=>{console.error("HTTP error during deletion:",r)}})}static \u0275fac=function(t){return new(t||i)(rt(sm),rt(Qh),rt(jo),rt(wf),rt(Jg))};static \u0275cmp=tt({type:i,selectors:[["app-simulation-configuration-dialog"]],decls:24,vars:5,consts:[["mat-dialog-title",""],[3,"formGroup"],["formGroupName","configuration",1,"flex-column","gap-1-rem"],[1,"error-message","flex-row","align-cross-center","gap-0-5-rem"],["type","number","matInput","","formControlName","maxDuration"],["matTextSuffix",""],["mat-button","","mat-dialog-close",""],["mat-button","",3,"click"],["formGroupName","general"],[1,"flex-row","gap-1-rem","no-stretch"],[3,"subscriptSizing"],["matInput","","formControlName","name"],["formControlName","data",3,"openedChange"],[3,"click"],[3,"value"],["formControlName","shouldRunInBackground"],[1,"error-icon"]],template:function(t,r){if(t&1&&(Z(0,"h2",0),ce(1,"Configure Simulation"),Q(),Z(2,"mat-dialog-content")(3,"form",1),je(4,bRe,26,4),Z(5,"h3"),ce(6,"Simulation"),Q(),Z(7,"div",2),je(8,vRe,5,0,"span",3),Z(9,"mat-form-field"),Ge(10,"input",4),Z(11,"mat-label"),ce(12,"Simulation Duration (optional)"),Q(),je(13,SRe,2,0,"mat-error"),Z(14,"span",5),ce(15,"h"),Q(),Z(16,"mat-hint"),ce(17," The simulation will stop after this in-simulation duration, even if not finished (0.5 = 30min) "),Q()()()()(),Z(18,"mat-dialog-actions")(19,"button",6),ce(20,"Cancel"),Q(),Z(21,"button",7),Le("click",function(){return r.onSave()}),je(22,kRe,1,0)(23,xRe,1,0),Q()()),t&2){let n;oe(3),Re("formGroup",r.formGroup),oe(),Je(r.data.mode==="start"?4:-1),oe(4),Je(r.data.mode==="start"&&!r.dataFormControl.valid?8:-1),oe(5),Je(r.maxDurationFormControl.hasError("min")?13:-1),oe(9),Je((n=r.data.mode)==="start"?22:n==="edit"?23:-1)}},dependencies:[Os,Is,Fs,vo,Br,pn,ha,ac,zs,Ef,Af,Rw,Rs,wh,Ps,Cb,ec,xh,Bs,Tb,ww,Eh,Dw,$l,tc,Mw,So,qo,pr,mr],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}.error-icon[_ngcontent-%COMP%]{min-width:24px}.error-message[_ngcontent-%COMP%]{max-width:calc(424px + 1rem)}.no-stretch[_ngcontent-%COMP%]{align-items:flex-start}.no-stretch[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1}"]})};var Y$=go(nI());function aM(i){return new Date(i*1e3).toISOString().slice(11,19)}var ed=class i{transform(e){return aM(e)}static \u0275fac=function(t){return new(t||i)};static \u0275pipe=W4({name:"simulationTime",type:i,pure:!0})};var A$=go(sI());function hs(i){return typeof i=="object"&&i!==null&&"tags"in i&&Array.isArray(i.tags)&&i.tags.every(e=>typeof e=="string")}var MRe=["previous","current","next"];function lI(i){return MRe.includes(i)}function $g(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for leg",i),null;let e=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags in leg",i),null;e=i.tags.sort((u,h)=>u.localeCompare(h))}if(!("legType"in i)||!lI(i.legType))return console.error("Invalid leg type",i),null;let t=i.legType,r=null;if("assignedVehicleId"in i){if(i.assignedVehicleId!==null&&typeof i.assignedVehicleId!="string")return console.error("Invalid assigned vehicle ID",i.assignedVehicleId,"for leg",i),null;r=i.assignedVehicleId}let n=null;if("boardingStopId"in i){if(i.boardingStopId!==null&&typeof i.boardingStopId!="string")return console.error("Invalid boarding stop index",i.boardingStopId,"for leg",i),null;n=i.boardingStopId}let a=null;if("alightingStopId"in i){if(i.alightingStopId!==null&&typeof i.alightingStopId!="string")return console.error("Invalid alighting stop index",i.alightingStopId,"for leg",i),null;a=i.alightingStopId}let o=null;if("boardingStopIndex"in i){if(i.boardingStopIndex!==null&&typeof i.boardingStopIndex!="number")return console.error("Invalid boarding stop index",i.boardingStopIndex,"for leg",i),null;o=i.boardingStopIndex}let s=null;if("alightingStopIndex"in i){if(i.alightingStopIndex!==null&&typeof i.alightingStopIndex!="number")return console.error("Invalid alighting stop index",i.alightingStopIndex,"for leg",i),null;s=i.alightingStopIndex}let l=null;if("boardingTime"in i){if(i.boardingTime!==null&&typeof i.boardingTime!="number")return console.error("Invalid boarding time",i.boardingTime,"for leg",i),null;l=i.boardingTime}let c=null;if("alightingTime"in i){if(i.alightingTime!==null&&typeof i.alightingTime!="number")return console.error("Invalid alighting time",i.alightingTime,"for leg",i),null;c=i.alightingTime}return{tags:e,legType:t,assignedVehicleId:r,boardingStopId:n,alightingStopId:a,boardingStopIndex:o,alightingStopIndex:s,boardingTime:l,alightingTime:c}}var TRe=["release","assigned","ready","onboard","complete"];function cI(i){return TRe.includes(i)}function P$(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for passenger",i),null;if(!("id"in i)||typeof i.id!="string")return console.error("Invalid ID for passenger",i),null;let e=i.id,t=(0,A$.default)({seed:e});if(!("status"in i)||!cI(i.status))return console.error("Invalid status for passenger",i),null;let r=i.status;if(!("numberOfPassengers"in i)||typeof i.numberOfPassengers!="number")return console.error("Invalid number of passengers for passenger",i),null;let n=i.numberOfPassengers;if(!("previousLegs"in i)||!Array.isArray(i.previousLegs))return console.error("Invalid previous legs in passenger",i),null;let a=i.previousLegs.map($g);if(!a.every(c=>c!==null)){let c=a.find(u=>u===null);return console.error("Invalid previous legs, including",c,"in passenger",i),null}let o=null;if("currentLeg"in i&&(o=$g(i.currentLeg),o===null))return console.error("Invalid current leg in passenger",i),null;if(!("nextLegs"in i)||!Array.isArray(i.nextLegs))return console.error("Invalid next legs in passenger",i),null;let s=i.nextLegs.map($g);if(!s.every(c=>c!==null)){let c=s.find(u=>u===null);return console.error("Invalid next legs, including",c,"in passenger",i),null}let l=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags",i.tags,"in passenger",i),null;l=i.tags.sort((c,u)=>c.localeCompare(u))}return{id:e,name:t,entityType:"passenger",status:r,previousLegs:a,currentLeg:o,nextLegs:s,numberOfPassengers:n,tags:l,error:null}}function td(i){return i.previousLegs.forEach(e=>e.legType="previous"),i.currentLeg!==null&&(i.currentLeg.legType="current"),i.nextLegs.forEach(e=>e.legType="next"),i.previousLegs.concat(i.currentLeg===null?[]:[i.currentLeg],i.nextLegs)}function B$(i,e){let t=i.currentLeg??i.nextLegs[0]??null;return t===null||t.assignedVehicleId===null?null:t.boardingTime===null||t.boardingTime>e?t.boardingStopId===null?null:{stopId:t.boardingStopId,vehicleId:t.assignedVehicleId}:t.alightingTime===null||t.alightingTime>e||t.alightingStopId===null?null:{stopId:t.alightingStopId,vehicleId:t.assignedVehicleId}}function R$(i,e){let t=i.currentLeg??i.nextLegs[0]??null;return t===null||t.boardingTime===null||t.boardingTime>e?null:t.alightingTime===null||t.alightingTime>e?t.assignedVehicleId:null}function D$(i,e,t){let r=i.currentLeg??i.nextLegs[0]??null;return r===null?!1:r.boardingTime===null||r.boardingTime>t?e===r.boardingStopId:r.alightingTime===null||r.alightingTime>t?!1:e===r.alightingStopId}function L$(i,e,t){let r=i.currentLeg??i.nextLegs[0]??null;return r===null||r.boardingTime===null||r.boardingTime>t?!1:r.alightingTime===null||r.alightingTime>t?r.assignedVehicleId===e:!1}var Xg=class{constructor(e){this.compare=e}_items=[];add(e){let t=this.findInsertionIndex(e);this._items.splice(t,0,e)}shift(){return this._items.shift()}get length(){return this._items.length}get items(){return this._items}get editableItems(){return this._items}findInsertionIndex(e){let t=0,r=this._items.length-1;for(;t<=r;){let n=Math.floor((t+r)/2),a=this.compare(this._items[n],e);if(a<0)t=n+1;else if(a>0)r=n-1;else return n}return t}};var Ru=1,I$=2;function uI(){return new Xg((i,e)=>e.priority-i.priority)}var id=class{constructor(e,t){this.priority=e;this.queue=t}addToQueue(){this.queue.add(this)}get numberOfTasks(){return 1}},jm=class extends id{constructor(t,r,n){super(t,r);this.taskFunction=n}process(){this.taskFunction()}},Pl=class extends id{hasCalledBeforeAll=!1;subtasks=uI();constructor(e,t){super(e,t)}process(){if(!this.hasCalledBeforeAll)this.beforeAll(),this.hasCalledBeforeAll=!0;else{let e=this.subtasks.shift();if(!e){this.afterAll();return}e.process()}this.addToQueue()}get numberOfTasks(){return this.subtasks.items.reduce((e,t)=>e+t.numberOfTasks,1)}};function hI(i){return!(typeof i!="object"||i===null||!("latitude"in i)||typeof i.latitude!="number"||!("longitude"in i)||typeof i.longitude!="number")}var ERe=["previous","current","next"];function dI(i){return ERe.includes(i)}var ARe=10;function PRe(i){let e=hI(i)?i:i.position;return""+e.latitude+","+e.longitude}function Qg(i,e){if(typeof i!="object"||i===null)return console.error("Invalid data type for stop",i),null;let t=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags",i.tags,"in stop",i),null;t=i.tags.sort((u,h)=>u.localeCompare(h))}if(!("stopType"in i)||!dI(i.stopType))return console.error("Invalid stop type in stop",i),null;let r=i.stopType;if(!("arrivalTime"in i)||typeof i.arrivalTime!="number")return console.error("Invalid arrival time in stop",i),null;let n=i.arrivalTime,a=null;if("departureTime"in i){if(i.departureTime!==null&&typeof i.departureTime!="number")return console.error("Invalid departure time",i.departureTime,"in stop",i),null;a=i.departureTime}if(!("position"in i)||!hI(i.position))return console.error("Invalid position in stop",i),null;let o=i.position,s=ARe;if("capacity"in i){if(typeof i.capacity!="number")return console.error("Invalid capacity",i.capacity,"in stop",i),null;s=i.capacity}if(!("label"in i)||typeof i.label!="string")return console.error("Invalid label in stop",i),null;let l=i.label;return{id:PRe(o),name:l,entityType:"stop",tags:t,stopType:r,arrivalTime:n,departureTime:a,position:o,capacity:s,label:l,vehicleId:e,error:null}}var BRe=["release","idle","boarding","enroute","alighting","complete"];function mI(i){return BRe.includes(i)}function F$(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for vehicle",i),null;if(!("id"in i)||typeof i.id!="string")return console.error("Invalid ID for vehicle",i),null;let e=i.id;if(!("name"in i)||typeof i.name!="string")return console.error("Invalid name for vehicle",i),null;let t=i.name,r=null;if("mode"in i){if(typeof i.mode!="string")return console.error("Invalid mode for vehicle",i.mode,"in vehicle",i),null;r=i.mode}if(!("status"in i)||!mI(i.status))return console.error("Invalid status for vehicle",i),null;let n=i.status;if(!("previousStops"in i)||!Array.isArray(i.previousStops))return console.error("Invalid previous stops for vehicle",i),null;let a=i.previousStops.map(u=>Qg(u,e));if(!a.every(u=>u!==null)){let u=a.find(h=>h===null);return console.error("Invalid previous stops, including",u,"in vehicle",i),null}let o=null;if("currentStop"in i&&(o=Qg(i.currentStop,e),o===null))return console.error("Invalid current stop for vehicle",i),null;if(!("nextStops"in i)||!Array.isArray(i.nextStops))return console.error("Invalid next stops for vehicle",i),null;let s=i.nextStops.map(u=>Qg(u,e));if(!s.every(u=>u!==null)){let u=s.find(h=>h===null);return console.error("Invalid next stops, including",u,"in vehicle",i),null}if(!("capacity"in i)||typeof i.capacity!="number")return console.error("Invalid capacity for vehicle",i),null;let l=i.capacity,c=[];if("tags"in i){if(!hs(i))return console.error("Invalid tags",i.tags,"for vehicle",i),null;c=i.tags.sort((u,h)=>u.localeCompare(h))}return{id:e,name:t,entityType:"vehicle",mode:r,status:n,previousStops:a,currentStop:o,nextStops:s,capacity:l,tags:c,error:null}}function Bl(i){return i.previousStops.forEach(e=>e.stopType="previous"),i.currentStop!==null&&(i.currentStop.stopType="current"),i.nextStops.forEach(e=>e.stopType="next"),i.previousStops.concat(i.currentStop===null?[]:[i.currentStop],i.nextStops)}function _I(){return{passengerTags:[],vehicleTags:[],stopTags:[],legTags:[],passengerLegs:{},vehicleStops:{}}}var sM=class extends Pl{constructor(t,r,n,a){super(I$,t);this.states=r;this.references=n;this.callback=a}continuousEnvironments=[];beforeAll(){for(let t of this.states)new gI(this.subtasks,t,this.references,this.continuousEnvironments).addToQueue()}afterAll(){this.callback(this.continuousEnvironments)}},gI=class extends Pl{constructor(t,r,n,a){super(0,t);this.state=r;this.references=n;this.continuousEnvironments=a;this.continuousEnvironment=this.buildEmptyContinuousEnvironment()}continuousEnvironment;beforeAll(){for(let r of Object.values(this.state.passengers))new jm(0,this.subtasks,()=>O$(this.continuousEnvironment.passengers,this.continuousEnvironment.allPassengers,r,this.continuousEnvironment.startTimestamp,this.continuousEnvironment.endTimestamp,this.state.updateIndex,this.references)).addToQueue();for(let r of Object.values(this.state.vehicles))new jm(0,this.subtasks,()=>z$(this.continuousEnvironment.vehicles,this.continuousEnvironment.allVehicles,r,this.continuousEnvironment.startTimestamp,this.continuousEnvironment.endTimestamp,this.state.updateIndex,this.references)).addToQueue();new jm(0,this.subtasks,()=>H$(this.continuousEnvironment.statistics,this.state.statistics,this.continuousEnvironment.startTimestamp,this.continuousEnvironment.endTimestamp,this.state.updateIndex)).addToQueue();let t=new yI(this.state,this.continuousEnvironment,this.references);for(let r of this.state.updates)new jm(-r.updateIndex-1,this.subtasks,()=>{t.visitUpdate(r)}).addToQueue()}afterAll(){this.continuousEnvironments.push(this.continuousEnvironment)}buildEmptyContinuousEnvironment(){let t=this.state.timestamp,r=this.state.updateIndex,n=this.state.updates,a=n[n.length-1],o=a.timestamp,s=a.updateIndex+1,l=this.state.isComplete;return{passengers:{},allPassengers:[],vehicles:{},allVehicles:[],statistics:[],startTimestamp:t,startUpdateIndex:r,endTimestamp:o,endUpdateIndex:s,isComplete:l}}},yI=class{constructor(e,t,r){this.environment=e;this.continuousEnvironment=t;this.references=r}visitUpdate(e){e.apply(this.environment),e.accept(this)}visitPassengerUpdate(e){let t=this.environment.passengers[e.passengerId];O$(this.continuousEnvironment.passengers,this.continuousEnvironment.allPassengers,t,e.timestamp,this.continuousEnvironment.endTimestamp,e.updateIndex,this.references)}visitVehicleUpdate(e){let t=this.environment.vehicles[e.vehicleId];z$(this.continuousEnvironment.vehicles,this.continuousEnvironment.allVehicles,t,e.timestamp,this.continuousEnvironment.endTimestamp,e.updateIndex,this.references)}visitStatisticsUpdate(e){H$(this.continuousEnvironment.statistics,e.statistics,e.timestamp,this.continuousEnvironment.endTimestamp,e.updateIndex)}};function O$(i,e,t,r,n,a,o){let s=i[t.id];s||(s=[],i[t.id]=s,e.push(s));let l=s[s.length-1];l!==void 0&&(l.startTimestamp===r?s.pop():l.endTimestamp=r);let c=at(ye({},t),{startTimestamp:r,endTimestamp:n,updateIndex:a});LRe(c,o),s.push(c)}function z$(i,e,t,r,n,a,o){let s=i[t.id];s||(s=[],i[t.id]=s,e.push(s));let l=s[s.length-1];l!==void 0&&(l.startTimestamp===r?s.pop():l.endTimestamp=r);let c=at(ye({},t),{startTimestamp:r,endTimestamp:n,updateIndex:a});IRe(c,o),s.push(c)}function H$(i,e,t,r,n){let a=i[i.length-1];a!==void 0&&(a.startTimestamp===t?i.pop():a.endTimestamp=t);let o={statistics:e,startTimestamp:t,endTimestamp:r,updateIndex:n};i.push(o)}function lM(i,e){let t=e.tags,r=i.find(n=>bI(n,t));if(!r){let n=[...t];i.push(n),r=n}e.tags=r}function pI(i,e){let t=i.find(n=>FRe(n,e));if(t)return t;let r=ye({},e);return i.push(r),r}function RRe(i,e){let t=e.previousLegs.map(a=>pI(i,a)),r=e.currentLeg?pI(i,e.currentLeg):null,n=e.nextLegs.map(a=>pI(i,a));e.previousLegs=t,e.currentLeg=r,e.nextLegs=n}function fI(i,e){let t=zRe(i,e);if(t!==null)return i[t];let r=ye({},e);return HRe(i,r),r}function DRe(i,e){let t=e.previousStops.map(a=>fI(i,a)),r=e.currentStop?fI(i,e.currentStop):null,n=e.nextStops.map(a=>fI(i,a));e.previousStops=t,e.currentStop=r,e.nextStops=n}function LRe(i,e){lM(e.passengerTags,i);let t=e.passengerLegs[i.id];t||(t=[],e.passengerLegs[i.id]=t),RRe(t,i);let r=td(i);for(let n of r)lM(e.legTags,n)}function IRe(i,e){lM(e.vehicleTags,i);let t=e.vehicleStops[i.id];t||(t=[],e.vehicleStops[i.id]=t),DRe(t,i);let r=Bl(i);for(let n of r)lM(e.stopTags,n)}function bI(i,e){if(i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!==e[t])return!1;return!0}function FRe(i,e){return i.assignedVehicleId===e.assignedVehicleId&&i.boardingStopId===e.boardingStopId&&i.alightingStopId===e.alightingStopId&&i.boardingStopIndex===e.boardingStopIndex&&i.alightingStopIndex===e.alightingStopIndex&&i.boardingTime===e.boardingTime&&i.alightingTime===e.alightingTime&&bI(i.tags,e.tags)}function ORe(i,e){return i.id===e.id&&i.name===e.name&&i.arrivalTime===e.arrivalTime&&i.departureTime===e.departureTime&&i.position.latitude===e.position.latitude&&i.position.longitude===e.position.longitude&&i.capacity===e.capacity&&i.label===e.label&&bI(i.tags,e.tags)}function zRe(i,e){let t=Du(i,n=>n.id.localeCompare(e.id));if(t===null)return null;let r=t;for(;r<i.length&&i[r].id===e.id;){if(ORe(i[r],e))return r;r++}return null}function HRe(i,e){let t=NRe(i,r=>r.id.localeCompare(e.id));i.splice(t,0,e)}function Du(i,e){let t=0,r=i.length-1;for(;t<=r;){let n=Math.floor((t+r)/2),a=e(i[n]);if(a===0){let o=n-1;if(o<0||e(i[o])!==0)return n;r=o}else a<0?t=n+1:r=n-1}return null}function NRe(i,e){let t=0,r=i.length-1;for(;t<=r;){let n=Math.floor((t+r)/2);e(i[n])<0?t=n+1:r=n-1}return t}function N$(i,e){for(let t=0;t<i.length-1;t++){let r=i[t];if(e.includes(r.endUpdateIndex))continue;let n=i[t+1];if(r.endUpdateIndex===n.startUpdateIndex){r.endTimestamp=n.startTimestamp;for(let o=0;o<r.allPassengers.length;o++){let s=r.allPassengers[o],l=s[s.length-1];l&&(l.endTimestamp=n.startTimestamp)}for(let o=0;o<r.allVehicles.length;o++){let s=r.allVehicles[o],l=s[s.length-1];l&&(l.endTimestamp=n.startTimestamp)}let a=r.statistics[r.statistics.length-1];a&&(a.endTimestamp=n.startTimestamp),e.push(r.endUpdateIndex)}}}function cM(i,e){if(e===null||i.length===0)return null;let t=Du(i,r=>r.startTimestamp>e?1:r.endTimestamp<=e?-1:0);return t!==null||(t=Du(i,r=>r.startTimestamp>e?1:r.endTimestamp<e?-1:0),t!==null)?i[t]:null}function uM(i,e){if(e<i.startTimestamp||e>i.endTimestamp)throw console.error(i),new Error(`Timestamp ${e} is out of bounds for the continuous environment with start ${i.startTimestamp} and end ${i.endTimestamp}`);let t=i.startUpdateIndex,r={},n=[];for(let h=0;h<i.allPassengers.length;h++){let d=i.allPassengers[h],p=Du(d,g=>g.startTimestamp>e?1:g.endTimestamp<=e?-1:0);if(p===null&&(p=Du(d,g=>g.startTimestamp>e?1:g.endTimestamp<e?-1:0),p===null))continue;let f=d[p];f.updateIndex>t&&(t=f.updateIndex),r[f.id]=f,n.push(f)}let a={},o=[],s={};for(let h=0;h<i.allVehicles.length;h++){let d=i.allVehicles[h],p=Du(d,_=>_.startTimestamp>e?1:_.endTimestamp<=e?-1:0);if(p===null&&(p=Du(d,_=>_.startTimestamp>e?1:_.endTimestamp<e?-1:0),p===null))continue;let f=d[p];f.updateIndex>t&&(t=f.updateIndex);let g=Bl(f);for(let _=0;_<g.length;_++){let b=g[_];s[b.id]=b}a[f.id]=f,o.push(f)}let l=Du(i.statistics,h=>h.startTimestamp>e?1:h.endTimestamp<=e?-1:0);if(l===null&&(l=Du(i.statistics,h=>h.startTimestamp>e?1:h.endTimestamp<e?-1:0),l===null))throw console.error(i),new Error(`No statistics found for timestamp ${e} in the continuous environment`);let c=i.statistics[l];c.updateIndex>t&&(t=c.updateIndex);let u=c.statistics;return{passengers:r,vehicles:a,stops:s,statistics:u,timestamp:e,updateIndex:t,allVehicles:o,allPassengers:n,allStops:Object.values(s)}}function vI(i){if(i.length===0)return[];let e=null,t=[];for(let r of i){if(e===null){e={start:r.startTimestamp,end:r.endTimestamp};continue}r.startTimestamp===e.end?e.end=r.endTimestamp:(t.push(e),e={start:r.startTimestamp,end:r.endTimestamp})}return e!==null&&t.push(e),t}function G$(i,e,t){if(i.length===0)return!1;let r=vI(i);for(let n of r)if(n.start<=e&&n.end>=t)return!0;return!1}var V$=function(i,e){e===void 0&&(e=5);for(var t=Math.pow(10,e),r=i.length,n=new Array(Math.floor(i.length/2)),a=0,o=0,s=0,l=0;a<r;++l){var c=1,u=0,h=void 0;do h=i.charCodeAt(a++)-63-1,c+=h<<u,u+=5;while(h>=31);o+=c&1?~(c>>1):c>>1,c=1,u=0;do h=i.charCodeAt(a++)-63-1,c+=h<<u,u+=5;while(h>=31);s+=c&1?~(c>>1):c>>1,n[l]=[o/t,s/t]}return n.length=l,n};function K$(i,e){if(!Array.isArray(i)||!i.every(r=>typeof r=="string"))return console.error("Invalid serialized polylines by coordinates",i),null;if(typeof e!="number")return console.error("Invalid polylines version",e),null;let t={};for(let r of i){let n=JSON.parse(r);if(typeof n!="object"||n===null)return console.error("Invalid data type for polyline",n),null;if(!("coordinatesString"in n)||typeof n.coordinatesString!="string")return console.error("Invalid coordinates string in polyline",n),null;let a=n.coordinatesString;if(!("coefficients"in n)||!Array.isArray(n.coefficients)||!n.coefficients.every(c=>typeof c=="number"))return console.error("Invalid coefficients in polyline",n),null;let o=n.coefficients;if(!("encodedPolyline"in n)||typeof n.encodedPolyline!="string")return console.error("Invalid encoded polyline in polyline",n),null;let s=n.encodedPolyline,l=V$(s).map(c=>({latitude:c[0],longitude:c[1]}));if(l.length>1&&o.length!==l.length-1)if(o.length===1&&o[0]===1){let c=[];for(let h=0;h<l.length-1;h++){let d=l[h],p=l[h+1],f=Math.sqrt((p.latitude-d.latitude)**2+(p.longitude-d.longitude)**2);c.push(f)}let u=c.reduce((h,d)=>h+d,0);if(u===0)return console.error("Total distance is zero, cannot calculate coefficients of decoded polyline",l,"in polyline",n),null;o.splice(0,o.length,...c.map(h=>h/u))}else return console.error("Polyline coefficients length mismatch in decoded polyline",l,"in polyline",n),null;t[a]={polyline:l,coefficients:o}}return{version:e,polylinesByCoordinates:t}}function f0(i){if(typeof i!="object"||i===null)return!1;for(let e of Object.values(i))if(typeof e!="string"&&typeof e!="number"&&!f0(e))return!1;return!0}var W$=go(sI());var GRe=["passenger","vehicle","statistics"];function U$(i){return GRe.includes(i)}var rd=class i{constructor(e,t,r,n,a){this.updateType=e;this.updateIndex=t;this.eventIndex=r;this.eventName=n;this.timestamp=a}apply(e){e.updateIndex=this.updateIndex,e.timestamp=this.timestamp}accept(e){}static deserialize(e){return typeof e!="object"||!e?(console.error("Invalid data type for update",e),null):!("updateType"in e)||!U$(e.updateType)?(console.error("Invalid update type in serialized update",e),null):!("updateIndex"in e)||typeof e.updateIndex!="number"?(console.error("Invalid update index in serialized update",e),null):!("eventIndex"in e)||typeof e.eventIndex!="number"?(console.error("Invalid event index in serialized update",e),null):!("eventName"in e)||typeof e.eventName!="string"?(console.error("Invalid event name in serialized update",e),null):!("timestamp"in e)||typeof e.timestamp!="number"?(console.error("Invalid timestamp in serialized update",e),null):new i(e.updateType,e.updateIndex,e.eventIndex,e.eventName,e.timestamp)}},SI=class i extends rd{constructor(t,r,n,a,o,s,l,c,u){super("passenger",t,r,n,a);this.passengerId=o;this.differences=s;this.numberOfLegsToRemove=l;this.legsToAdd=c;this.legsDifferences=u}static DEFAULT_DIFFERENCES={};static DEFAULT_LEGS_TO_ADD=[];static DEFAULT_LEGS_DIFFERENCES=[];static DEFAULT_NUMBER_OF_LEGS_TO_REMOVE=0;apply(t){super.apply(t);let r=this.differences.status,n=this.differences.numberOfPassengers,a=this.differences.tags,o=t.passengers[this.passengerId];if(o===void 0){if(r===void 0){console.error(`Passenger with ID ${this.passengerId} does not exist and no status provided.`);return}if(n===void 0){console.error(`Passenger with ID ${this.passengerId} does not exist and no numberOfPassengers provided.`);return}if(a===void 0){console.error(`Passenger with ID ${this.passengerId} does not exist and no tags provided.`);return}o={id:this.passengerId,entityType:"passenger",name:(0,W$.default)({seed:this.passengerId}),status:r,numberOfPassengers:n,tags:a,previousLegs:[],currentLeg:null,nextLegs:[],error:null}}else o=ye(ye({},o),this.differences);let s=td(o);this.numberOfLegsToRemove>0&&s.splice(s.length-this.numberOfLegsToRemove,this.numberOfLegsToRemove),s.push(...this.legsToAdd);for(let c of this.legsDifferences){let l=c,{index:u}=l,h=oa(l,["index"]);if(u<0||u>=s.length){console.error(`Invalid leg index ${u} for passenger ${this.passengerId}.`,this,t);continue}s[u]=ye(ye({},s[u]),h)}o.previousLegs=[],o.currentLeg=null,o.nextLegs=[];for(let c of s)c.legType==="previous"?o.previousLegs.push(c):c.legType==="current"?o.currentLeg=c:c.legType==="next"&&o.nextLegs.push(c);t.passengers[this.passengerId]=o}accept(t){t.visitPassengerUpdate(this)}static deserialize(t){if(typeof t!="object"||t===null)return console.error("Invalid data type for passenger update",t),null;let r=rd.deserialize(t);if(r===null)return console.error("Invalid base update in serialized passenger update",t),null;if(!("passengerId"in t)||typeof t.passengerId!="string")return console.error("Invalid passenger ID in serialized update",t),null;let n=t.passengerId,a=this.DEFAULT_DIFFERENCES;if("differences"in t){if(!this.isPassengerDifferences(t.differences))return console.error("Invalid differences",t.differences,"in serialized passenger update",t),null;a=t.differences}let o=this.DEFAULT_NUMBER_OF_LEGS_TO_REMOVE;if("numberOfLegsToRemove"in t){if(typeof t.numberOfLegsToRemove!="number")return console.error("Invalid number of legs to remove",t.numberOfLegsToRemove,"in serialized passenger update",t),null;o=t.numberOfLegsToRemove}let s=this.DEFAULT_LEGS_TO_ADD;if("legsToAdd"in t){if(!Array.isArray(t.legsToAdd))return console.error("Invalid legs to add",t.legsToAdd,"in serialized passenger update",t),null;let c=t.legsToAdd.map($g);if(!c.every(u=>u!==null)){let u=c.find(h=>h===null);return console.error("Invalid legs to add, including",u,"in serialized passenger update",t),null}s=c}let l=this.DEFAULT_LEGS_DIFFERENCES;if("legsDifferences"in t){if(!this.isLegDifferencesArray(t.legsDifferences))return console.error("Invalid legs differences",t.legsDifferences,"in serialized passenger update",t),null;l=t.legsDifferences}return new i(r.updateIndex,r.eventIndex,r.eventName,r.timestamp,n,a,o,s,l)}static isPassengerDifferences(t){if(typeof t!="object"||t===null||"status"in t&&!cI(t.status)||"numberOfPassengers"in t&&typeof t.numberOfPassengers!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!0}static isLegDifferencesArray(t){return Array.isArray(t)&&t.every(this.isLegDifferences)}static isLegDifferences(t){if(typeof t!="object"||t===null||"index"in t&&typeof t.index!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!("legType"in t&&!lI(t.legType)||"assignedVehicleId"in t&&t.assignedVehicleId!==null&&typeof t.assignedVehicleId!="string"||"boardingStopId"in t&&t.boardingStopId!==null&&typeof t.boardingStopId!="string"||"alightingStopId"in t&&t.alightingStopId!==null&&typeof t.alightingStopId!="string"||"boardingStopIndex"in t&&t.boardingStopIndex!==null&&typeof t.boardingStopIndex!="number"||"alightingStopIndex"in t&&t.alightingStopIndex!==null&&typeof t.alightingStopIndex!="number"||"boardingTime"in t&&t.boardingTime!==null&&typeof t.boardingTime!="number"||"alightingTime"in t&&t.alightingTime!==null&&typeof t.alightingTime!="number")}},kI=class i extends rd{constructor(t,r,n,a,o,s,l,c,u){super("vehicle",t,r,n,a);this.vehicleId=o;this.differences=s;this.numberOfStopsToRemove=l;this.stopsToAdd=c;this.stopsDifferences=u}static DEFAULT_DIFFERENCES={};static DEFAULT_STOPS_TO_ADD=[];static DEFAULT_STOPS_DIFFERENCES=[];static DEFAULT_NUMBER_OF_STOPS_TO_REMOVE=0;apply(t){super.apply(t);let r=this.differences.name,n=this.differences.mode,a=this.differences.status,o=this.differences.capacity,s=this.differences.tags,l=t.vehicles[this.vehicleId];if(l===void 0){if(r===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no name provided.`);return}if(n===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no mode provided.`);return}if(a===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no status provided.`);return}if(o===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no capacity provided.`);return}if(s===void 0){console.error(`Vehicle with ID ${this.vehicleId} does not exist and no tags provided.`);return}l={id:this.vehicleId,entityType:"vehicle",name:r,mode:n,status:a,capacity:o,tags:s,previousStops:[],currentStop:null,nextStops:[],error:null}}else l=ye(ye({},l),this.differences);let c=Bl(l);this.numberOfStopsToRemove>0&&c.splice(c.length-this.numberOfStopsToRemove,this.numberOfStopsToRemove),c.push(...this.stopsToAdd);for(let h of this.stopsDifferences){let u=h,{index:d}=u,p=oa(u,["index"]);if(d<0||d>=c.length){console.error(`Invalid stop index ${d} for vehicle ${this.vehicleId}.`,this,t);continue}c[d]=ye(ye({},c[d]),p)}l.previousStops=[],l.currentStop=null,l.nextStops=[];for(let h of c)h.stopType==="previous"?l.previousStops.push(h):h.stopType==="current"?l.currentStop=h:h.stopType==="next"&&l.nextStops.push(h);t.vehicles[this.vehicleId]=l}accept(t){t.visitVehicleUpdate(this)}static deserialize(t){if(typeof t!="object"||t===null)return console.error("Invalid data type for vehicle update",t),null;let r=rd.deserialize(t);if(r===null)return null;if(!("vehicleId"in t)||typeof t.vehicleId!="string")return console.error("Invalid vehicle ID in serialized update",t),null;let n=t.vehicleId,a=this.DEFAULT_DIFFERENCES;if("differences"in t){if(!this.isVehicleDifferences(t.differences))return console.error("Invalid differences",t.differences,"in serialized vehicle update",t),null;a=t.differences}let o=this.DEFAULT_NUMBER_OF_STOPS_TO_REMOVE;if("numberOfStopsToRemove"in t){if(typeof t.numberOfStopsToRemove!="number")return console.error("Invalid number of stops to remove",t.numberOfStopsToRemove,"in serialized vehicle update",t),null;o=t.numberOfStopsToRemove}let s=this.DEFAULT_STOPS_TO_ADD;if("stopsToAdd"in t){if(!Array.isArray(t.stopsToAdd))return console.error("Invalid stops to add",t.stopsToAdd,"in serialized vehicle update",t),null;let c=t.stopsToAdd.map(u=>Qg(u,n));if(!c.every(u=>u!==null)){let u=c.find(h=>h===null);return console.error("Invalid stops to add, including",u,"in serialized vehicle update",t),null}s=c}let l=this.DEFAULT_STOPS_DIFFERENCES;if("stopsDifferences"in t){if(!this.isStopDifferencesArray(t.stopsDifferences))return console.error("Invalid stops differences",t.stopsDifferences,"in serialized vehicle update",t),null;l=t.stopsDifferences}return new i(r.updateIndex,r.eventIndex,r.eventName,r.timestamp,n,a,o,s,l)}static isVehicleDifferences(t){if(typeof t!="object"||t===null||"name"in t&&typeof t.name!="string"||"mode"in t&&typeof t.mode!="string"&&t.mode!==null||"status"in t&&!mI(t.status)||"capacity"in t&&typeof t.capacity!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!0}static isStopDifferencesArray(t){return Array.isArray(t)&&t.every(this.isStopDifferences)}static isStopDifferences(t){if(typeof t!="object"||t===null||"index"in t&&typeof t.index!="number")return!1;if("tags"in t){if(!hs(t))return!1;t.tags=t.tags.sort((r,n)=>r.localeCompare(n))}return!("stopType"in t&&!dI(t.stopType)||"arrivalTime"in t&&typeof t.arrivalTime!="number"||"departureTime"in t&&t.departureTime!==null&&typeof t.departureTime!="number"||"latitude"in t&&typeof t.latitude!="number"||"longitude"in t&&typeof t.longitude!="number"||"capacity"in t&&typeof t.capacity!="number"||"label"in t&&typeof t.label!="string")}},xI=class i extends rd{statistics;constructor(e,t,r,n,a){super("statistics",e,t,r,n),this.statistics=Object.freeze(a)}apply(e){super.apply(e),e.statistics=this.statistics}accept(e){e.visitStatisticsUpdate(this)}static deserialize(e){if(typeof e!="object"||e===null)return console.error("Invalid data type for statistics update",e),null;let t=rd.deserialize(e);if(t===null)return null;if(!("statistics"in e)||!f0(e.statistics))return console.error("Invalid statistics in serialized update",e),null;let r=e.statistics;return new i(t.updateIndex,t.eventIndex,t.eventName,t.timestamp,r)}};function j$(i){if(typeof i!="object"||i===null)return console.error("Invalid data type for update",i),null;if(!("updateType"in i)||!U$(i.updateType))return console.error("Invalid update type in data",i),null;switch(i.updateType){case"passenger":return SI.deserialize(i);case"vehicle":return kI.deserialize(i);case"statistics":return xI.deserialize(i)}}var hM=class extends Pl{constructor(t,r,n,a){super(Ru,t);this.serializedEnvironments=r;this.serializedUpdates=n;this.callback=a}environments=[];updatesByFirstUpdateIndex={};beforeAll(){new wI(this.subtasks,this.serializedEnvironments,this.environments).addToQueue(),new EI(this.subtasks,this.serializedUpdates,this.updatesByFirstUpdateIndex).addToQueue()}afterAll(){let t=[];for(let r of this.environments){let n=this.updatesByFirstUpdateIndex[r.updateIndex];if(n===void 0){console.error("No updates found for environment",r,"in updates",this.updatesByFirstUpdateIndex,"from serialized updates",this.serializedUpdates,"and serialized environments",this.serializedEnvironments),this.callback(null);continue}t.push(at(ye({},r),{updates:n}))}this.callback(t)}},wI=class extends Pl{constructor(t,r,n){super(Ru,t);this.serializedEnvironments=r;this.environments=n}beforeAll(){if(!Array.isArray(this.serializedEnvironments)){console.error("Invalid data type for serialized environments",this.serializedEnvironments);return}for(let t of this.serializedEnvironments)new CI(this.subtasks,t,this.environments).addToQueue()}afterAll(){}},CI=class extends Pl{constructor(t,r,n){super(Ru,t);this.serializedEnvironment=r;this.environments=n}environment={timestamp:-1,updateIndex:-1,statistics:{},passengers:{},vehicles:{},isComplete:!1};beforeAll(){if(typeof this.serializedEnvironment!="object"||this.serializedEnvironment===null){console.error("Invalid data type for serialized environment",this.serializedEnvironment);return}if(!("timestamp"in this.serializedEnvironment)||typeof this.serializedEnvironment.timestamp!="number"){console.error("Invalid timestamp in serialized environment",this.serializedEnvironment);return}if(this.environment.timestamp=this.serializedEnvironment.timestamp,!("updateIndex"in this.serializedEnvironment)||typeof this.serializedEnvironment.updateIndex!="number"){console.error("Invalid update index in serialized environment",this.serializedEnvironment);return}if(this.environment.updateIndex=this.serializedEnvironment.updateIndex,!("isComplete"in this.serializedEnvironment)||typeof this.serializedEnvironment.isComplete!="boolean"){console.error("Invalid isComplete in serialized environment",this.serializedEnvironment);return}if(this.environment.isComplete=this.serializedEnvironment.isComplete,!("statistics"in this.serializedEnvironment)||typeof this.serializedEnvironment.statistics!="string"){console.error("Invalid statistics in serialized environment",this.serializedEnvironment);return}let t=JSON.parse(this.serializedEnvironment.statistics);if(!f0(t)){console.error("Invalid statistics object in serialized environment",this.serializedEnvironment);return}if(this.environment.statistics=t,!("passengers"in this.serializedEnvironment)||!Array.isArray(this.serializedEnvironment.passengers)){console.error("Invalid passengers in serialized environment",this.serializedEnvironment);return}for(let r of this.serializedEnvironment.passengers)new MI(this.subtasks,r,this.environment.passengers).addToQueue();if(!("vehicles"in this.serializedEnvironment)||!Array.isArray(this.serializedEnvironment.vehicles)){console.error("Invalid vehicles in serialized environment",this.serializedEnvironment);return}for(let r of this.serializedEnvironment.vehicles)new TI(this.subtasks,r,this.environment.vehicles).addToQueue()}afterAll(){this.environments.push(this.environment)}},MI=class extends id{constructor(t,r,n){super(Ru,t);this.serializedPassenger=r;this.passengers=n}process(){if(typeof this.serializedPassenger!="string"){console.error("Invalid data type for serialized passenger",this.serializedPassenger);return}let t=JSON.parse(this.serializedPassenger),r=P$(t);if(r===null){console.error("Invalid passenger",this.serializedPassenger);return}this.passengers[r.id]=r}},TI=class extends id{constructor(t,r,n){super(Ru,t);this.serializedVehicle=r;this.vehicles=n}process(){if(typeof this.serializedVehicle!="string"){console.error("Invalid data type for serialized vehicle",this.serializedVehicle);return}let t=JSON.parse(this.serializedVehicle),r=F$(t);if(r===null){console.error("Invalid vehicle",this.serializedVehicle);return}this.vehicles[r.id]=r}},EI=class extends Pl{constructor(t,r,n){super(Ru,t);this.serializedUpdates=r;this.updatesByFirstUpdateIndex=n}beforeAll(){if(typeof this.serializedUpdates!="object"||this.serializedUpdates===null){console.error("Invalid data type for serialized updates",this.serializedUpdates);return}for(let[t,r]of Object.entries(this.serializedUpdates))new AI(this.subtasks,t,r,this.updatesByFirstUpdateIndex).addToQueue()}afterAll(){}},AI=class extends Pl{constructor(t,r,n,a){super(Ru,t);this.serializedUpdatesKey=r;this.serializedUpdates=n;this.updatesByFirstUpdateIndex=a}updates=new Xg((t,r)=>t.updateIndex-r.updateIndex);beforeAll(){if(typeof this.serializedUpdatesKey!="string"){console.error("Invalid data type for key",this.serializedUpdatesKey,"with serialized updates",this.serializedUpdates);return}let t=parseInt(this.serializedUpdatesKey);if(isNaN(t)){console.error("Key is not a valid number",this.serializedUpdatesKey,"with serialized updates",this.serializedUpdates);return}if(!Array.isArray(this.serializedUpdates)){console.error("Invalid data type for serialized updates",this.serializedUpdates,"with key",this.serializedUpdatesKey);return}this.updatesByFirstUpdateIndex[t]=this.updates.editableItems;for(let r of this.serializedUpdates)new PI(this.subtasks,r,this.updates).addToQueue()}afterAll(){}},PI=class extends id{constructor(t,r,n){super(Ru,t);this.serializedUpdate=r;this.updates=n}process(){if(typeof this.serializedUpdate!="string"){console.error("Invalid data type for serialized update",this.serializedUpdate);return}let t=j$(JSON.parse(this.serializedUpdate));if(t===null){console.error("Invalid update",this.serializedUpdate);return}this.updates.add(t)}};var nd=class i{queue=uI();processTasks(e){for(this.processTask();this.queue.length>0&&performance.now()<e;)this.processTask()}processTask(){let e=this.queue.shift();e&&e.process()}extractStateTask(e,t,r){new hM(this.queue,e,t,r).addToQueue()}buildContinuousEnvironmentsTask(e,t,r){new sM(this.queue,e,t,r).addToQueue()}get numberOfTasks(){return this.queue.items.reduce((e,t)=>e+t.numberOfTasks,0)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ha=class i{constructor(e,t,r){this.dataService=e;this.communicationService=t;this.taskService=r}_activeSimulationIdSignal=Bt(null);_simulationPolylinesSignal=Bt(null);_isFetchingStatesSignal=Bt(!1);_isFetchingPolylinesSignal=Bt(!1);_continuousEnvironmentsSignal=Bt([]);alreadyUpdatedEnvironmentUpdateIndexes=[];references=_I();_hasAllStatesSignal=Bt(!1);getPolylinesDebounceSettings={debounceTime:500,lastExecutionTime:null,timeoutId:null};getMissingSimulationStatesDebounceSettings={debounceTime:500,lastExecutionTime:null,timeoutId:null};setActiveSimulationId(e){this.unsetActiveSimulationId(),this._activeSimulationIdSignal.set(e),this.communicationService.on("missing-simulation-states",(t,r,n)=>{this.onMissingSimulationStates(t,r,n)}),this.communicationService.on(`polylines-${e}`,(t,r)=>{this._isFetchingPolylinesSignal.set(!1),this._simulationPolylinesSignal.set(K$(t,r))})}unsetActiveSimulationId(){let e=this._activeSimulationIdSignal();this._activeSimulationIdSignal.set(null),this._simulationPolylinesSignal.set(null),this._isFetchingStatesSignal.set(!1),this._isFetchingPolylinesSignal.set(!1),this.communicationService.removeAllListeners("missing-simulation-states"),e&&this.communicationService.removeAllListeners(`polylines-${e}`),this._continuousEnvironmentsSignal.set([]),this.alreadyUpdatedEnvironmentUpdateIndexes=[],this.references=_I(),this._hasAllStatesSignal.set(!1)}get activeSimulationSignal(){return $t(()=>{let e=this._activeSimulationIdSignal();return e?this.dataService.simulationsSignal().find(n=>n.id===e)??null:null})}pauseSimulation(e){this.communicationService.emit("pause-simulation",e)}resumeSimulation(e){this.communicationService.emit("resume-simulation",e)}stopSimulation(e){this.communicationService.emit("stop-simulation",e)}editSimulationConfiguration(e,t){this.communicationService.emit("edit-simulation-configuration",e,t)}getMissingSimulationStates(e,t,r){return this.runWithDebounce(()=>{this.getMissingSimulationStatesWithDebounce(e,t,r)},this.getMissingSimulationStatesDebounceSettings)}getMissingSimulationStatesWithDebounce(e,t,r){this._isFetchingStatesSignal.set(!0),this.communicationService.emit("get-missing-simulation-states",e,t,r)}getPolylines(e){this.runWithDebounce(()=>{this.getPolylinesWithoutDebounce(e)},this.getPolylinesDebounceSettings)}getPolylinesWithoutDebounce(e){this._isFetchingPolylinesSignal.set(!0),this.communicationService.emit("get-polylines",e)}get simulationPolylinesSignal(){return this._simulationPolylinesSignal}get isFetchingStatesSignal(){return this._isFetchingStatesSignal}get isFetchingPolylinesSignal(){return this._isFetchingPolylinesSignal}get continuousEnvironmentsSignal(){return this._continuousEnvironmentsSignal}get hasAllStatesSignal(){return this._hasAllStatesSignal}onMissingSimulationStates(e,t,r){this.taskService.extractStateTask(e,t,n=>this.afterExtractStateTask(n,r))}afterExtractStateTask(e,t){if(e===null){console.error("Failed to extract missing simulation states from the server response."),this._isFetchingStatesSignal.set(!1);return}this.taskService.buildContinuousEnvironmentsTask(e,this.references,r=>this.afterBuildContinuousEnvironmentsTask(r,t))}afterBuildContinuousEnvironmentsTask(e,t){this._continuousEnvironmentsSignal.update(r=>{let n=[...r];for(let a of e){let o=n.findIndex(s=>s.startUpdateIndex===a.startUpdateIndex);o===-1?n.push(a):n[o]=a}return n.sort((a,o)=>a.startUpdateIndex-o.startUpdateIndex),N$(n,this.alreadyUpdatedEnvironmentUpdateIndexes),n}),typeof t!="boolean"?(console.error("Received invalid hasAllStates value from the server."),t=!1):this._hasAllStatesSignal.set(t),this._isFetchingStatesSignal.set(!1)}runWithDebounce(e,t){t.timeoutId!==null&&(clearTimeout(t.timeoutId),t.timeoutId=null);let r=Date.now(),n=r-(t.lastExecutionTime??0);if(n<t.debounceTime){t.timeoutId=setTimeout(()=>{t.timeoutId=null,t.lastExecutionTime=Date.now(),e()},t.debounceTime-n);return}t.lastExecutionTime=r,e()}static \u0275fac=function(t){return new(t||i)(Zt(Qh),Zt(To),Zt(nd))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};function VRe(i,e){if(i&1){let t=vt();Z(0,"div",1)(1,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.action())}),ce(2),Q()()}if(i&2){let t=Se();oe(2),_t(" ",t.data.action," ")}}var KRe=["label"];function WRe(i,e){}var URe=Math.pow(2,31)-1,y0=class{_overlayRef;instance;containerInstance;_afterDismissed=new ct;_afterOpened=new ct;_onAction=new ct;_durationTimeoutId;_dismissedByAction=!1;constructor(e,t){this._overlayRef=t,this.containerInstance=e,e._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(e){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(e,URe))}_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}},q$=new et("MatSnackBarData"),ey=class{politeness="assertive";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},jRe=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return i})(),qRe=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return i})(),ZRe=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return i})(),YRe=(()=>{class i{snackBarRef=te(y0);data=te(q$);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["mat-button","","matSnackBarAction","",3,"click"]],template:function(r,n){r&1&&(Z(0,"div",0),ce(1),Q(),je(2,VRe,3,1,"div",1)),r&2&&(oe(),_t(" ",n.data.message,`
|
1698
1698
|
`),oe(),Je(n.hasAction?2:-1))},dependencies:[pn,jRe,qRe,ZRe],styles:[".mat-mdc-simple-snack-bar{display:flex}"],encapsulation:2,changeDetection:0})}return i})(),JRe={snackBarState:Cs("state",[Ms("void, hidden",mn({transform:"scale(0.8)",opacity:0})),Ms("visible",mn({transform:"scale(1)",opacity:1})),Ba("* => visible",Pa("150ms cubic-bezier(0, 0, 0.2, 1)")),Ba("* => void, * => hidden",Pa("75ms cubic-bezier(0.4, 0.0, 1, 1)",mn({opacity:0})))])},$Re=(()=>{class i extends Mh{_ngZone=te(Kt);_elementRef=te(Et);_changeDetectorRef=te(_i);_platform=te($i);snackBarConfig=te(ey);_document=te(li);_trackedModals=new Set;_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new ct;_onExit=new ct;_onEnter=new ct;_animationState="void";_live;_label;_role;_liveElementId=te(Di).getId("mat-snack-bar-container-live-");constructor(){super();let t=this.snackBarConfig;t.politeness==="assertive"&&!t.announcementMessage?this._live="assertive":t.politeness==="off"?this._live="off":this._live="polite",this._platform.FIREFOX&&(this._live==="polite"&&(this._role="status"),this._live==="assertive"&&(this._role="alert"))}attachComponentPortal(t){this._assertNotAttached();let r=this._portalOutlet.attachComponentPortal(t);return this._afterPortalAttached(),r}attachTemplatePortal(t){this._assertNotAttached();let r=this._portalOutlet.attachTemplatePortal(t);return this._afterPortalAttached(),r}attachDomPortal=t=>{this._assertNotAttached();let r=this._portalOutlet.attachDomPortal(t);return this._afterPortalAttached(),r};onAnimationEnd(t){let{fromState:r,toState:n}=t;if((n==="void"&&r!=="void"||n==="hidden")&&this._completeExit(),n==="visible"){let a=this._onEnter;this._ngZone.run(()=>{a.next(),a.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 t=this._elementRef.nativeElement,r=this.snackBarConfig.panelClass;r&&(Array.isArray(r)?r.forEach(o=>t.classList.add(o)):t.classList.add(r)),this._exposeToModals();let n=this._label.nativeElement,a="mdc-snackbar__label";n.classList.toggle(a,!n.querySelector(`.${a}`))}_exposeToModals(){let t=this._liveElementId,r=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let n=0;n<r.length;n++){let a=r[n],o=a.getAttribute("aria-owns");this._trackedModals.add(a),o?o.indexOf(t)===-1&&a.setAttribute("aria-owns",o+" "+t):a.setAttribute("aria-owns",t)}}_clearFromModals(){this._trackedModals.forEach(t=>{let r=t.getAttribute("aria-owns");if(r){let n=r.replace(this._liveElementId,"").trim();n.length>0?t.setAttribute("aria-owns",n):t.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{let t=this._elementRef.nativeElement.querySelector("[aria-hidden]"),r=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&r){let n=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(n=document.activeElement),t.removeAttribute("aria-hidden"),r.appendChild(t),n?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-snack-bar-container"]],viewQuery:function(r,n){if(r&1&&(di(rc,7),di(KRe,7)),r&2){let a;St(a=kt())&&(n._portalOutlet=a.first),St(a=kt())&&(n._label=a.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:1,hostBindings:function(r,n){r&1&&Z4("@state.done",function(o){return n.onAnimationEnd(o)}),r&2&&q4("@state",n._animationState)},features:[Ai],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(r,n){r&1&&(Z(0,"div",1)(1,"div",2,0)(3,"div",3),je(4,WRe,0,0,"ng-template",4),Q(),Ge(5,"div"),Q()()),r&2&&(oe(5),Mt("aria-live",n._live)("role",n._role)("id",n._liveElementId))},dependencies:[rc],styles:[".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-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(--mdc-snackbar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mdc-snackbar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mdc-snackbar-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(--mdc-snackbar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mdc-snackbar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mdc-snackbar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mdc-snackbar-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-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-text-button-state-layer-color:currentColor;--mat-text-button-ripple-color:currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}"],encapsulation:2,data:{animation:[JRe.snackBarState]}})}return i})();function XRe(){return new ey}var QRe=new et("mat-snack-bar-default-options",{providedIn:"root",factory:XRe}),dM=(()=>{class i{_overlay=te(Rr);_live=te(iw);_injector=te(Ii);_breakpointObserver=te(df);_parentSnackBar=te(i,{optional:!0,skipSelf:!0});_defaultConfig=te(QRe);_snackBarRefAtThisLevel=null;simpleSnackBarComponent=YRe;snackBarContainerComponent=$Re;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){let t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}constructor(){}openFromComponent(t,r){return this._attach(t,r)}openFromTemplate(t,r){return this._attach(t,r)}open(t,r="",n){let a=ye(ye({},this._defaultConfig),n);return a.data={message:t,action:r},a.announcementMessage===t&&(a.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,a)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,r){let n=r&&r.viewContainerRef&&r.viewContainerRef.injector,a=Ii.create({parent:n||this._injector,providers:[{provide:ey,useValue:r}]}),o=new fl(this.snackBarContainerComponent,r.viewContainerRef,a),s=t.attach(o);return s.instance.snackBarConfig=r,s.instance}_attach(t,r){let n=ye(ye(ye({},new ey),this._defaultConfig),r),a=this._createOverlay(n),o=this._attachSnackBarContainer(a,n),s=new y0(o,a);if(t instanceof Ta){let l=new Xa(t,null,{$implicit:n.data,snackBarRef:s});s.instance=o.attachTemplatePortal(l)}else{let l=this._createInjector(n,s),c=new fl(t,void 0,l),u=o.attachComponentPortal(c);s.instance=u.instance}return this._breakpointObserver.observe(Jx.HandsetPortrait).pipe(gi(a.detachments())).subscribe(l=>{a.overlayElement.classList.toggle(this.handsetCssClass,l.matches)}),n.announcementMessage&&o._onAnnounce.subscribe(()=>{this._live.announce(n.announcementMessage,n.politeness)}),this._animateSnackBar(s,n),this._openedSnackBarRef=s,this._openedSnackBarRef}_animateSnackBar(t,r){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),r.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),r.duration&&r.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(r.duration))}_createOverlay(t){let r=new Ds;r.direction=t.direction;let n=this._overlay.position().global(),a=t.direction==="rtl",o=t.horizontalPosition==="left"||t.horizontalPosition==="start"&&!a||t.horizontalPosition==="end"&&a,s=!o&&t.horizontalPosition!=="center";return o?n.left("0"):s?n.right("0"):n.centerHorizontally(),t.verticalPosition==="top"?n.top("0"):n.bottom("0"),r.positionStrategy=n,this._overlay.create(r)}_createInjector(t,r){let n=t&&t.viewContainerRef&&t.viewContainerRef.injector;return Ii.create({parent:n||this._injector,providers:[{provide:y0,useValue:r},{provide:q$,useValue:t.data}]})}static \u0275fac=function(r){return new(r||i)};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var eDe=(i,e)=>e.group,tDe=(i,e)=>e.id;function iDe(i,e){if(i&1&&(Z(0,"span",12),ce(1),Vr(2,"percent"),Q()),i&2){let t=Se().$implicit;oe(),_t(" ",zd(2,1,t.completion,"1.2-2")," ")}}function rDe(i,e){if(i&1){let t=vt();Ri(0),Z(1,"button",16),Le("click",function(n){Ee(t);let a=Se().$implicit,o=Se(3);return Ae(o.editSimulationConfiguration(a,n))}),Z(2,"mat-icon"),ce(3,"settings"),Q()(),Ri(4)(5),Z(6,"button",16),Le("click",function(n){Ee(t);let a=fi(5),o=Se().$implicit,s=Se(3);return Ae(s.pauseResumeHandler(o.id,a,n))}),Z(7,"mat-icon"),ce(8),Q()(),Ri(9),Z(10,"button",16),Le("click",function(n){Ee(t);let a=Se().$implicit,o=Se(3);return Ae(o.stopSimulation(a.id,n))}),Z(11,"mat-icon"),ce(12,"stop"),Q()()}if(i&2){let t=Se().$implicit,r=t.status==="starting"||t.status==="stopping"||t.status==="lost";oe(),Re("disabled",r)("matTooltip","Configure");let n=t.status==="starting"||t.status==="stopping"||t.status==="lost";oe(4);let a=hr(t.status!=="paused");oe(),Re("disabled",n)("matTooltip",a?"Pause":"Resume"),oe(2),Ti(a?"pause":"play_arrow");let o=t.status==="starting"||t.status==="stopping"||t.status==="lost";oe(2),Re("disabled",o)("matTooltip","Stop")}}function nDe(i,e){if(i&1){let t=vt();Z(0,"button",26),Le("click",function(n){Ee(t);let a=Se().$implicit,o=Se(3);return Ae(o.exportSimulation(a.id,n))}),Z(1,"mat-icon"),ce(2,"cloud_download"),Q()(),Z(3,"button",26),Le("click",function(n){Ee(t);let a=Se().$implicit,o=Se(3);return Ae(o.deleteSimulation(a.id,a.name,n))}),Z(4,"mat-icon"),ce(5,"delete"),Q()()}i&2&&(Re("matTooltip","Export"),oe(3),Re("matTooltip","Delete"))}function aDe(i,e){if(i&1&&(Z(0,"span",27)(1,"span",19),ce(2,"Simulation Time:"),Q(),Z(3,"span",5),ce(4),Vr(5,"simulationTime"),Q()(),Z(6,"span",28)(7,"span",19),ce(8,"Simulation Estimated End Time:"),Q(),Z(9,"span",5),ce(10),Vr(11,"simulationTime"),Q()(),Z(12,"span",14)(13,"span",19),ce(14,"Completion:"),Q(),Z(15,"span",5),ce(16),Vr(17,"percent"),Q()(),Z(18,"span",29)(19,"span",19),ce(20,"Max Duration:"),Q(),Z(21,"span",5),ce(22),Q()()),i&2){let t=Se().$implicit;oe(4),_t(" ",t.simulationTime!==null?En(5,4,t.simulationTime):"N/A"," "),oe(6),_t(" ",t.simulationEstimatedEndTime!==null?En(11,6,t.simulationEstimatedEndTime):"N/A"," "),oe(6),_t(" ",zd(17,8,t.completion,"1.2-2")," "),oe(6),_t(" ",t.configuration.maxDuration!==null?(t.configuration.maxDuration/3600).toString()+"h":"N/A"," ")}}function oDe(i,e){if(i&1){let t=vt();Ri(0),Z(1,"div",7),Le("click",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.toggleSelection(n.id))})("keydown.enter",function(){let n=Ee(t).$implicit,a=Se(3);return Ae(a.toggleSelection(n.id))}),Z(2,"div",8)(3,"mat-icon",9),ce(4,"circle "),Q(),Z(5,"div",10)(6,"div",1)(7,"span",11),ce(8),Q(),je(9,iDe,3,4,"span",12),Q(),Z(10,"div",13)(11,"span"),ce(12),Q(),Z(13,"div",14)(14,"span"),ce(15,"-"),Q(),Ri(16),Z(17,"span"),ce(18),Vr(19,"simulationTime"),Q(),Z(20,"span"),ce(21,"-"),Q(),Z(22,"span"),ce(23),Q(),Z(24,"span"),ce(25,"-"),Q(),Z(26,"span"),ce(27),Q(),Z(28,"span"),ce(29,"-"),Q(),Z(30,"span"),ce(31),Vr(32,"date"),Q()()()(),Z(33,"div",15),je(34,rDe,13,8)(35,nDe,6,2),Ri(36),Z(37,"button",16),Le("click",function(n){let a=Ee(t).$implicit,o=Se(3);return Ae(o.visualizeSimulation(a,n))}),Z(38,"mat-icon"),ce(39,"visibility"),Q()()()(),Z(40,"div",17)(41,"div",18)(42,"span",14)(43,"span",19),ce(44,"Id:"),Q(),Z(45,"span",20),Le("click",function(n){let a=Ee(t).$implicit,o=Se(3);return Ae(o.copyToClipboard(a.id,n))})("keydown.enter",function(n){let a=Ee(t).$implicit,o=Se(3);return Ae(o.copyToClipboard(a.id,n))}),ce(46),Q()(),Z(47,"span",21)(48,"span",19),ce(49,"Name:"),Q(),Z(50,"span",5),ce(51),Q()(),Z(52,"span",21)(53,"span",19),ce(54,"Input Data:"),Q(),Z(55,"span",5),ce(56),Q()(),Z(57,"span",14)(58,"span",19),ce(59,"Status:"),Q(),Z(60,"span",5),ce(61),Q()(),Z(62,"span",22)(63,"span",19),ce(64,"Start Time:"),Q(),Z(65,"span",5),ce(66),Vr(67,"date"),Q()(),Z(68,"span",23)(69,"span",19),ce(70,"Duration:"),Q(),Z(71,"span",5),ce(72),Vr(73,"simulationTime"),Q()(),Z(74,"span",14)(75,"span",19),ce(76,"Size:"),Q(),Z(77,"span",5),ce(78),Q()(),Z(79,"span",24)(80,"span",19),ce(81,"Simulation Start Time :"),Q(),Z(82,"span",5),ce(83),Vr(84,"simulationTime"),Q()(),Z(85,"span",25)(86,"span",19),ce(87,"Simulation End Time :"),Q(),Z(88,"span",5),ce(89),Vr(90,"simulationTime"),Q()()(),Z(91,"div",18),je(92,aDe,23,11),Q()()()}if(i&2){let t=e.$implicit,r=Se(2).$implicit,n=Se(),a=n.selectedSimulationIdSignal()===t.id;oe(),gt("selected",a),oe(2),yr("color","var(--"+n.getColorFromStatus(t.status)+"-text-color)"),oe(4),Re("matTooltip",t.name),oe(),Ti(t.name),oe(),Je(t.status==="running"||t.status==="paused"?9:-1),oe(2),yr("color","var(--"+n.getColorFromStatus(t.status)+"-text-color)"),oe(),_t(" ",t.status," ");let o=n.getDuration(t);oe(6),Ti(En(19,34,o)),oe(5),_t(" ",t.data," "),oe(4),_t(" ",n.megabytes(t.size)," "),oe(4),_t(" ",zd(32,36,t.startTime,"short")," "),oe(3),Je(r.group==="running"?34:-1),oe(),Je(r.group==="completed"?35:-1);let s=t.status==="corrupted"||t.status==="outdated"||t.status==="future";oe(2),Re("disabled",s)("matTooltip","Visualize"),oe(8),Re("matTooltip",t.id+" (Click to copy)")("matTooltipPosition","after"),oe(),Ti(t.id),oe(),Re("matTooltip",t.name),oe(4),Ti(t.name),oe(),Re("matTooltip",t.data),oe(4),Ti(t.data),oe(4),yr("color","var(--"+n.getColorFromStatus(t.status)+"-text-color)"),oe(),_t(" ",t.status," "),oe(5),_t(" ",zd(67,39,t.startTime,"short")," "),oe(6),Ti(En(73,42,n.getDuration(t))),oe(6),Ti(n.megabytes(t.size)),oe(5),_t(" ",t.simulationStartTime!==null?En(84,44,t.simulationStartTime):"N/A"," "),oe(6),_t(" ",t.simulationEndTime!==null?En(90,46,t.simulationEndTime):"N/A"," "),oe(3),Je(n.isSimulationRunning(t)?92:-1)}}function sDe(i,e){if(i&1&&(Z(0,"section",4),ui(1,oDe,93,48,"div",6,tDe),Q()),i&2){let t=Se().$implicit;oe(),hi(t.simulations)}}function lDe(i,e){i&1&&(Z(0,"span",5),ce(1,"No simulations"),Q())}function cDe(i,e){if(i&1&&(Z(0,"h3"),ce(1),Vr(2,"titlecase"),Q(),je(3,sDe,3,0,"section",4)(4,lDe,2,0,"span",5)),i&2){let t=e.$implicit;oe(),Ti(En(2,2,t.group)),oe(2),Je(t.simulations.length>0?3:4)}}var mM=class i{constructor(e,t,r,n,a,o,s){this.dataService=e;this.simulationService=t;this.dialogService=r;this.matDialogRef=n;this.httpService=a;this.communicationService=o;this.snackBar=s}groupedSimulationsSignal=$t(()=>{let e=this.simulationsSignal(),t=e.filter(n=>Bu.includes(n.status)),r=e.filter(n=>!Bu.includes(n.status));return[{group:"running",simulations:t},{group:"completed",simulations:r}]});_selectedSimulationIdSignal=Bt(null);get selectedSimulationIdSignal(){return this._selectedSimulationIdSignal}getColorFromStatus(e){switch(e){case"running":return"green";case"paused":return"yellow";case"starting":case"stopping":case"outdated":case"future":return"gray";case"completed":return"blue";case"lost":case"corrupted":return"red"}}editSimulationConfiguration(e,t){return Ce(this,null,function*(){t.stopPropagation();let r=yield hn(this.dialogService.openSimulationConfigurationDialog({mode:"edit",currentConfiguration:e.configuration}).afterClosed());r&&this.simulationService.editSimulationConfiguration(e.id,r.configuration.maxDuration)})}stopSimulation(e,t){return Ce(this,null,function*(){t.stopPropagation(),(yield hn(this.dialogService.openInformationDialog({title:"Stopping Simulation",message:"Are you sure you want to stop the simulation? This action cannot be undone.",type:"warning",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!0}).afterClosed()))&&this.simulationService.stopSimulation(e)})}visualizeSimulation(e,t){t.stopPropagation(),this.matDialogRef.close({simulationToVisualize:e})}get simulationsSignal(){return this.dataService.simulationsSignal}pauseResumeHandler(e,t,r){r.stopPropagation(),t?this.simulationService.pauseSimulation(e):this.simulationService.resumeSimulation(e)}importSimulation(){let e=document.createElement("input");e.type="file",e.webkitdirectory=!0,e.multiple=!0;let t=r=>Ce(this,null,function*(){let n=r.target.files;if(!n||n.length===0)return;let a=new Y$.default,o=n[0].webkitRelativePath.split("/")[0];for(let c of Array.from(n)){let u=c.webkitRelativePath.replace(o+"/","");a.file(u,c)}let s=yield a.generateAsync({type:"blob"}),l=new FormData;l.append("file",s,"folder.zip"),this.httpService.importFolder("simulation",o,l).subscribe({next:c=>{c.message?this.communicationService.emit("get-simulations"):c.error&&console.error("Upload failed:",c.error)},error:c=>{console.error("HTTP error during upload:",c)}})});e.addEventListener("change",r=>{t(r).catch(n=>{console.error("Error handling file change:",n)})}),e.click()}exportSimulation(e,t){t.stopPropagation(),this.httpService.exportFolder("simulation",e).subscribe(n=>{let a=new Blob([n],{type:"application/zip"}),o=window.URL.createObjectURL(a),s=document.createElement("a");s.href=o,s.download=e+".zip",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(o)})}deleteSimulation(e,t,r){return Ce(this,null,function*(){if(r.stopPropagation(),!(yield this.confirmDeletion(t)))return;this.httpService.deleteFolder("simulation",e).subscribe({next:o=>{o.error&&console.error("Failed to delete simulation:",o.error),this.communicationService.emit("get-simulations")},error:o=>{console.error("HTTP error during deletion:",o)}})})}confirmDeletion(e){return Ce(this,null,function*(){return yield hn(this.dialogService.openInformationDialog({title:"Deleting Saved Simulation",message:`Are you sure you want to delete the simulation "${e}"? This action cannot be undone.`,type:"warning",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!0}).afterClosed())})}getDuration(e){return e.simulationStartTime===null?0:e.simulationEndTime!==null?e.simulationEndTime-e.simulationStartTime:e.simulationTime!==null?e.simulationTime-e.simulationStartTime:0}megabytes(e){return e===null||e<0?"unknown":`${(e/(1024*1024)).toFixed(2)} MB`}toggleSelection(e){this._selectedSimulationIdSignal()===e?this._selectedSimulationIdSignal.set(null):this._selectedSimulationIdSignal.set(e)}copyToClipboard(e,t){return Ce(this,null,function*(){t.stopPropagation(),yield navigator.clipboard.writeText(e).then(()=>{this.snackBar.open("Copied to clipboard!","Close",{duration:2e3})}).catch(r=>{console.error("Failed to copy text: ",r),this.snackBar.open("Failed to copy!","Close",{duration:2e3})})})}isSimulationRunning(e){return Bu.includes(e.status)}static \u0275fac=function(t){return new(t||i)(rt(Qh),rt(Ha),rt(Js),rt(jo),rt(Jg),rt(To),rt(dM))};static \u0275cmp=tt({type:i,selectors:[["app-simulation-list-dialog"]],decls:17,vars:1,consts:[["mat-dialog-title",""],[1,"flex-row","gap-1-rem"],["mat-raised-button","",3,"click","matTooltip"],["mat-button","","mat-dialog-close",""],[1,"flex-column","simulation-list"],[1,"light"],["tabindex","0",1,"list-item","flex-column","gap-0-5-rem","align-main-start","align-cross-stretch",3,"selected"],["tabindex","0",1,"list-item","flex-column","gap-0-5-rem","align-main-start","align-cross-stretch",3,"click","keydown.enter"],[1,"flex-row","align-main-start","align-cross-center","gap-1-rem"],[1,"status-icon"],[1,"flex-column","text-container"],[1,"bold","simulation-name",3,"matTooltip"],[1,"completion"],[1,"light","flex-row","gap-0-5-rem"],[1,"flex-row","gap-0-5-rem"],[1,"actions","align-self-end","flex-row","gap-0-5-rem"],["mat-icon-button","",3,"click","disabled","matTooltip"],[1,"flex-row","gap-0-5-rem","detailed-information"],[1,"flex-column","gap-0-5-rem"],[1,"bold","field"],["tabindex","0",1,"light","copy",3,"click","keydown.enter","matTooltip","matTooltipPosition"],[1,"flex-row","gap-0-5-rem",3,"matTooltip"],["matTooltip","Time when the user started the simulation",1,"flex-row","gap-0-5-rem"],["matTooltip","Time between the first and last events of the simulation. The real time of the processing could be different.",1,"flex-row","gap-0-5-rem"],["matTooltip","Time of the first event in the simulation",1,"flex-row","gap-0-5-rem"],["matTooltip","Time of the last event in the simulation",1,"flex-row","gap-0-5-rem"],["mat-icon-button","",3,"click","matTooltip"],["matTooltip","Time of the current event in the simulation",1,"flex-row","gap-0-5-rem"],["matTooltip","Estimated time of the last event of the simulation",1,"flex-row","gap-0-5-rem"],["matTooltip","User-defined maximum duration of the simulation",1,"flex-row","gap-0-5-rem"]],template:function(t,r){if(t&1){let n=vt();Z(0,"h2",0),ce(1,"Available Simulations"),Q(),Z(2,"mat-dialog-content")(3,"h3"),ce(4,"Actions"),Q(),Z(5,"section",1)(6,"button",2),Le("click",function(){return Ee(n),Ae(r.importSimulation())}),Z(7,"mat-icon"),ce(8,"cloud_upload"),Q(),Z(9,"span"),ce(10,"Import"),Q()()(),Ri(11),ui(12,cDe,5,4,null,null,eDe),Q(),Z(14,"mat-dialog-actions")(15,"button",3),ce(16,"Close"),Q()()}if(t&2){oe(6),Re("matTooltip","Import a simulation");let n=r.groupedSimulationsSignal();oe(6),hi(n)}},dependencies:[Os,Is,Fs,vo,Br,pn,Xl,ha,Rs,Eh,tc,So,pr,mr,Rn,Da,Ah,cx,rV,ed,tV],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}.align-self-end[_ngcontent-%COMP%]{margin-inline-start:auto}.list-item[_ngcontent-%COMP%]{border-radius:.5rem;padding-inline:1rem;padding-block:.25rem;cursor:pointer}.list-item[_ngcontent-%COMP%]:is(:hover,.selected){background-color:#f0f0f0}.list-item[_ngcontent-%COMP%]:is(:hover,.selected) .actions[_ngcontent-%COMP%]{display:flex}.list-item.selected[_ngcontent-%COMP%] .detailed-information[_ngcontent-%COMP%]{display:flex}.list-item[_ngcontent-%COMP%] :is(.actions[_ngcontent-%COMP%], .detailed-information[_ngcontent-%COMP%]){display:none}.detailed-information[_ngcontent-%COMP%]{padding-inline-start:calc(24px + 1rem)}.detailed-information[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1}.detailed-information[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{overflow:hidden;word-wrap:break-word;white-space:nowrap}.detailed-information[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:nth-child(2){overflow:hidden;text-overflow:ellipsis}.completion[_ngcontent-%COMP%]{flex-shrink:0}.simulation-name[_ngcontent-%COMP%]{word-wrap:break-word;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.light[_ngcontent-%COMP%]{font-weight:300}.bold[_ngcontent-%COMP%]{font-weight:500}.status-icon[_ngcontent-%COMP%]{flex-shrink:0}.text-container[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden}.text-container[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{white-space:nowrap}.copy[_ngcontent-%COMP%]{cursor:pointer}.copy[_ngcontent-%COMP%]:hover{text-decoration:underline;font-weight:700}"]})};var pM=class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=tt({type:i,selectors:[["app-user-guide-dialog"]],decls:162,vars:0,consts:[[1,"dialog-header"],["mat-dialog-title",""],["mat-button","","mat-dialog-close",""],[1,"flex-column"],["src","/images/control-bar.png","alt","control-bar.png"],[2,"display","flex","align-items","flex-start","gap","20px"],["src","/images/simulation-control-bar.png","alt","Simulation Control Bar",2,"max-width","300px","height","auto"]],template:function(t,r){t&1&&(Z(0,"div",0)(1,"h2",1),ce(2,"Multimodal Simulation Visualization"),Q(),Z(3,"mat-dialog-actions")(4,"button",2),ce(5,"Close"),Q()()(),Z(6,"mat-dialog-content")(7,"section",3)(8,"h1"),ce(9,"Getting Started"),Q(),Z(10,"p"),ce(11," Welcome to the Multimodal Simulation Visualization. This guide will help you understand how to use all the features. "),Q()(),Z(12,"section",3)(13,"h3"),ce(14,"Starting a simulation"),Q(),Z(15,"p"),ce(16," To start a new simulation, click the "),Z(17,"strong"),ce(18,"Start Simulation"),Q(),ce(19," button from the main menu. You will be presented with the simulation configuration window where you will have to input a few parameters. "),Q(),Z(20,"p"),ce(21," First, you need to name your simulation. We suggest choosing a unique name. It is not necessary, but might lead to confusion later if you want to replay a simulation and it has the same name as an already existing one. "),Q(),Z(22,"p"),ce(23," Next, you need to choose the input data. You can choose one of the existing presets or use the import option to add your own. The import option is the first one in the dropdown menu when selecting the data source. Your import folder does not have to be zipped. We will do that for you. We will also add an index to your imported folder if one by the same name exists already. "),Q(),Z(24,"p"),ce(25," If you wish to run a simulation to get the output logs but do not care about seeing it, you can check the "),Z(26,"strong"),ce(27,"Run in the background"),Q(),ce(28,' option. That will launch the simulation and redirect you to the main menu. You can always visualize any running simulation at any moment by finding it in the "Browse Simulations" window. '),Q(),Z(29,"p"),ce(30," Optionally, define a simulation duration. This defines the maximum amount of in-simulation hours for which the events will be calculated. By default, the simulation will continue until it runs out of events. "),Q()(),Z(31,"section",3)(32,"h3"),ce(33,"Viewing Existing Simulations"),Q(),Z(34,"p"),ce(35," To access saved or background simulations, you can click the "),Z(36,"strong"),ce(37,"Browse Simulations"),Q(),ce(38," button in the main menu. This will show you a list of available simulations as well as their state. "),Q(),Z(39,"p"),ce(40," Here you can stop running simulations as well as delete, import, and export finished ones. The rules for importing simulations are the same as for the starting data. No need to zip the folders, we'll do it for you. Again, try avoiding importing simulations with the same name. It will make it hard to understand which one you are trying to run. "),Q()(),Z(41,"section",3)(42,"h1"),ce(43,"Interacting with a simulation"),Q(),Z(44,"p"),ce(45," Now that you have launched a simulation, let's learn how to control it. "),Q()(),Z(46,"section",3)(47,"h3"),ce(48,"Main Control Bar"),Q(),Z(49,"p"),ce(50," This bar allows you to control the current simulation visualization. No matter what you do within this bar, it will not affect the calculation and processing of the simulation events. "),Q(),Ge(51,"img",4),Z(52,"p"),ce(53," Most of the buttons here are self-explanatory. Still, here is a quick rundown: "),Q(),Z(54,"p"),ce(55," 1. The classic pause/play button. It does not affect the simulation processing, only the visualization. "),Q(),Z(56,"p"),ce(57," 2. Visualization speed setting. This defines how fast things are happening. Adjust it to speed up or slow down your visualization. "),Q(),Z(58,"p"),ce(59," 3. These are the time skip buttons. They will move you a number of seconds forwards or backwards in the simulation. The number of seconds is the same as the speed multiplier. "),Q(),Z(60,"p"),ce(61," 4. This button allows you to toggle the visualization direction. You can play it forwards or backwards. "),Q(),Z(62,"p"),ce(63," 5. The map center button allows you to center the map on the entities in case you wander off on the map. "),Q(),Z(64,"p"),ce(65," 6. The entity follow button allows you to follow the selected entity on the map without losing focus. "),Q(),Z(66,"p"),ce(67," 7. The progress bar allows you to instantly skip to a time within the simulation. However, if you are actively running a simulation, you can only jump to a timestamp before the grey circle, as anything past that is yet to be calculated. If you are replaying a saved simulation, you can jump to any timestamp at any time. "),Q(),Z(68,"p"),ce(69," 8. This button will send you back to the main menu. If you are running a simulation, it will continue to run in the background. "),Q()(),Z(70,"section",3)(71,"h3"),ce(72,"The Simulation Status Control"),Q(),Z(73,"div",5),Ge(74,"img",6),Z(75,"div")(76,"p"),ce(77," This is the control bar for the actual simulation running on the server. This little window allows you to pause the simulation processing, adjust the maximum simulation duration, or stop the simulation completely. "),Q(),Z(78,"p"),ce(79," Note that a stop and a pause are not the same. A stopped simulation is effectively completed and cannot be resumed, only replayed. "),Q(),Z(80,"p"),ce(81," The "),Z(82,"strong"),ce(83,"Estimated end"),Q(),ce(84," is the in-simulation approximated time at which the simulation is expected to end. It has nothing to do with the time in real life. "),Q()()()(),Z(85,"section",3)(86,"h3"),ce(87,"The Information Panel"),Q(),Z(88,"p"),ce(89," This panel displays useful information about your current simulation. You can access it by clicking any of the icons in the top left corner of your screen. Here you can check the simulation name and source files, see the statistics, access entities that are not displayed on the map, and check detailed information about the entity you have selected. "),Q()(),Z(90,"section",3)(91,"h3"),ce(92,"Searching and Entity Selection"),Q(),Z(93,"p"),ce(94," There are a few ways you can select an entity such as a passenger or a vehicle The easiest way would be by simply clicking it on the map. If multiple entities are clumped together, a small dialog will pop up, allowing you to make a more precise choice. Your selected entity will be highlighted in yellow, and you will see its path if it has one. "),Q(),Z(95,"p"),ce(96," You can also select an entity by using the search bar. To open the bar, click on the "),Z(97,"mat-icon"),ce(98,"search"),Q(),ce(99," in the top right corner of your screen. You can search for any entity by typing its ID and selecting it among the autocomplete suggestions. For passengers, you can also find them using their names. "),Q(),Z(100,"p")(101,"strong"),ce(102,"Pro Tip:"),Q(),ce(103,' If you are looking for a vehicle with a specific mode, you can start a search with "mode:". This will prompt you to make a selection, and only vehicles matching your selected mode will be shown in the autocomplete suggestions. '),Q(),Z(104,"p"),ce(105," A history of your selected entities can be accessed by clicking on the "),Z(106,"mat-icon"),ce(107,"history"),Q(),ce(108," icon in the top right corner. "),Q(),Z(109,"p"),ce(110," Once you have selected an entity you can navigate to the selected entity section of the information panel by clicking the "),Z(111,"mat-icon"),ce(112,"touch_app"),Q(),ce(113," icon, and view details such as the entity's ID, name, status, route, etc. In this very section, you can also set the entity as a favorite by clicking the "),Z(114,"mat-icon"),ce(115,"favorite"),Q(),ce(116,". To see the full list of your favorites, click on the "),Z(117,"mat-icon"),ce(118,"star"),Q(),ce(119," in the top right corner. "),Q()(),Z(120,"section",3)(121,"h3"),ce(122,"Display Options"),Q(),Z(123,"p"),ce(124," You have access to a few filters and themes in the top right corner of your simulation. You can decide which entities to display, select a theme for your map, and even change the icons. "),Q(),Z(125,"p"),ce(126," To filter out what is displayed on the map, click the "),Z(127,"mat-icon"),ce(128,"filter_list"),Q(),ce(129," next to the search section. This will allow you to only show certain categories of entities, as well as allow you to see the ones that are completed and no longer shown by default. "),Q(),Z(130,"p"),ce(131," You can change the map theme under the "),Z(132,"mat-icon"),ce(133,"layers"),Q(),ce(134," section. We supply a few themes by default including a dark one, but you are free to add your own. We suggest using OpenStreetMap to avoid compatibility issues. "),Q(),Z(135,"p"),ce(136,' In the same section, you have a "Customize entities" button. This will open a window where you can change the colors, icons and add other effects to the visualization. You have a list of all the default icons for each entity type, which you can edit directly by importing your own images. You also have the option to change the colors used for tinting vehicles and stops according to their occupancy. '),Q(),Z(137,"p"),ce(138," You will see two buttons that allow you to add custom icons and background shapes. Background shapes are colored shapes displayed behind the icons that can be used to group or highlight certain entities. For each shape or icon, you can specify the entity type, the mode (only for vehicles), and the tags. The icon or shape will only be applied to entities matching these criteria. They are displayed in decreasing order of priority, meaning that if two or more rules match an entity, the first one of the list will be applied. Lastly, you can also choose to limit an icon or shape depending on the map zoom level. "),Q(),Z(139,"p"),ce(140," When adding new icons, we strongly recommend using transparent or white images with a black outline. Otherwise, the tinting showing the occupancy of a vehicle or stop might not work as expected. "),Q(),Z(141,"p"),ce(142," You can export and import customization configurations using the buttons on the bottom right. The configuration file is a JSON file with images encoded in base64. You can modify it directly and share it with others. "),Q()(),Z(143,"section",3)(144,"h1"),ce(145,"Folder Structure"),Q(),Z(146,"p"),ce(147," While we do allow imports and exports of important folders, you might still want to access the raw data without having to deal with creating a copy on your machine. "),Q(),Z(148,"p"),ce(149," By default, the input data used to launch a simulation is located in the "),Z(150,"strong"),ce(151,"/data"),Q(),ce(152," folder while the visualizations files are located in the "),Z(153,"strong"),ce(154,"/output"),Q(),ce(155," folder. These folders are relative to the folder you ran the simulation from. You can change these paths by setting the "),Z(156,"strong"),ce(157,"INPUT_DATA_DIRECTORY_PATH"),Q(),ce(158," and "),Z(159,"strong"),ce(160,"OUTPUT_DATA_DIRECTORY_PATH"),Q(),ce(161," environment variables. More on that in the README file. "),Q()()())},dependencies:[SU,Is,Fs,Os,vo,Br,pn,pr,mr],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}*[_ngcontent-%COMP%]{--red-text-color: #ff0000;--red-background-color: #ffdddd;--yellow-text-color: #ffc21b;--yellow-background-color: #ffe6a4;--green-text-color: #00aa00;--green-background-color: #ccffcc;--gray-text-color: #666666;--gray-background-color: #f0f0f0;--blue-text-color: #4488ff;--blue-background-color: #cce5ff;--loaded-slider-color: #005cbb88;--active-button-color: #cce6ff}.text-red[_ngcontent-%COMP%]{color:var(--red-text-color)}.background-red[_ngcontent-%COMP%]{background-color:var(--red-background-color)}.text-yellow[_ngcontent-%COMP%]{color:var(--yellow-text-color)}.background-yellow[_ngcontent-%COMP%]{background-color:var(--yellow-background-color)}.text-green[_ngcontent-%COMP%]{color:var(--green-text-color)}.background-green[_ngcontent-%COMP%]{background-color:var(--green-background-color)}.text-gray[_ngcontent-%COMP%]{color:var(--gray-text-color)}.background-gray[_ngcontent-%COMP%]{background-color:var(--gray-background-color)!important}.text-blue[_ngcontent-%COMP%]{color:var(--blue-text-color)}.background-blue[_ngcontent-%COMP%]{background-color:var(--blue-background-color)}mat-dialog-content[_ngcontent-%COMP%]{max-height:80vh;height:80vh;overflow-y:auto;padding:16px}mat-icon[_ngcontent-%COMP%]{font-size:1.2em;height:auto;width:auto;vertical-align:middle;margin:0 2px}.flex-column[_ngcontent-%COMP%]{margin-bottom:.5rem}.guide-image[_ngcontent-%COMP%]{max-width:100%;margin:1rem 0;border:1px solid #ddd;border-radius:4px}h1[_ngcontent-%COMP%]{font-size:1.5rem;margin-bottom:1rem;color:var(--primary-color)}h3[_ngcontent-%COMP%]{font-size:1.2rem;margin-bottom:.8rem;color:var(--secondary-color)}p[_ngcontent-%COMP%]{margin:.5rem 0}.align-self-end[_ngcontent-%COMP%]{margin-inline-start:auto}.light[_ngcontent-%COMP%]{font-weight:300}.bold[_ngcontent-%COMP%]{font-weight:500}.list-item[_ngcontent-%COMP%], .actions[_ngcontent-%COMP%]{display:none}.dialog-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin:0}.dialog-header[_ngcontent-%COMP%] mat-dialog-title[_ngcontent-%COMP%]{margin:0}.dialog-header[_ngcontent-%COMP%] mat-dialog-actions[_ngcontent-%COMP%]{margin:0;padding:10px}"]})};var Js=class i{constructor(e){this.matDialog=e}openSimulationConfigurationDialog(e){return this.matDialog.open(nM,{data:e,disableClose:!0,autoFocus:!1,maxHeight:"80vh",width:"600px"})}openSimulationListDialog(){return this.matDialog.open(mM,{data:null,disableClose:!0,autoFocus:!1,maxWidth:"80vw",maxHeight:"80vh",width:"840px"})}openInformationDialog(e){return this.matDialog.open(rM,{data:e,disableClose:!0,autoFocus:!1,maxWidth:"80vw",maxHeight:"80vh",width:"600px"})}openAddMapTileDialog(){return this.matDialog.open(Lw,{data:null,disableClose:!0,autoFocus:!1,maxWidth:"80vw",maxHeight:"80vh",minWidth:"600px"})}openUserGuide(){let e=window.innerHeight*.9,t=window.innerWidth*.8,r=4/3*e,n=Math.min(t,r);return this.matDialog.open(pM,{width:`${n}px`,height:`${e}px`,maxHeight:"90vh",maxWidth:"80vw",panelClass:"user-guide-dialog"})}openEditMapIconsDialog(){return this.matDialog.open(iM,{data:null,disableClose:!0,autoFocus:!1,maxWidth:"80vw",maxHeight:"80vh",width:"800px"})}static \u0275fac=function(t){return new(t||i)(Zt(lm))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};var uDe=["determinateSpinner"];function hDe(i,e){if(i&1&&(Sr(),Z(0,"svg",11),Ge(1,"circle",12),Q()),i&2){let t=Se();Mt("viewBox",t._viewBox()),oe(),yr("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),Mt("r",t._circleRadius())}}var dDe=new et("mat-progress-spinner-default-options",{providedIn:"root",factory:mDe});function mDe(){return{diameter:J$}}var J$=100,pDe=10,$$=(()=>{class i{_elementRef=te(Et);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t}_color;_defaultColor="primary";_determinateCircle;constructor(){let t=te(nr,{optional:!0}),r=te(dDe);this._noopAnimations=t==="NoopAnimations"&&!!r&&!r._forceAnimations,this.mode=this._elementRef.nativeElement.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",r&&(r.color&&(this.color=this._defaultColor=r.color),r.diameter&&(this.diameter=r.diameter),r.strokeWidth&&(this.strokeWidth=r.strokeWidth))}mode;get value(){return this.mode==="determinate"?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,t||0))}_value=0;get diameter(){return this._diameter}set diameter(t){this._diameter=t||0}_diameter=J$;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(t){this._strokeWidth=t||0}_strokeWidth;_circleRadius(){return(this.diameter-pDe)/2}_viewBox(){let t=this._circleRadius()*2+this.strokeWidth;return`0 0 ${t} ${t}`}_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(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(r,n){if(r&1&&di(uDe,5),r&2){let a;St(a=kt())&&(n._determinateCircle=a.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(r,n){r&2&&(Mt("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",n.mode==="determinate"?n.value:null)("mode",n.mode),dn("mat-"+n.color),yr("width",n.diameter,"px")("height",n.diameter,"px")("--mdc-circular-progress-size",n.diameter+"px")("--mdc-circular-progress-active-indicator-width",n.diameter+"px"),gt("_mat-animation-noopable",n._noopAnimations)("mdc-circular-progress--indeterminate",n.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",lr],diameter:[2,"diameter","diameter",lr],strokeWidth:[2,"strokeWidth","strokeWidth",lr]},exportAs:["matProgressSpinner"],features:[si],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(r,n){if(r&1&&(je(0,hDe,2,8,"ng-template",null,0,Gp),Z(2,"div",2,1),Sr(),Z(4,"svg",3),Ge(5,"circle",4),Q()(),ex(),Z(6,"div",5)(7,"div",6)(8,"div",7),Od(9,8),Q(),Z(10,"div",9),Od(11,8),Q(),Z(12,"div",10),Od(13,8),Q()()()),r&2){let a=Or(1);oe(4),Mt("viewBox",n._viewBox()),oe(),yr("stroke-dasharray",n._strokeCircumference(),"px")("stroke-dashoffset",n._strokeDashOffset(),"px")("stroke-width",n._circleStrokeWidth(),"%"),Mt("r",n._circleRadius()),oe(4),Re("ngTemplateOutlet",a),oe(2),Re("ngTemplateOutlet",a),oe(2),Re("ngTemplateOutlet",a)}},dependencies:[Wp],styles:[".mat-mdc-progress-spinner{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(--mdc-circular-progress-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}}.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 1568.2352941176ms 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(--mdc-circular-progress-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 1333ms 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 1333ms 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 5332ms 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)}}"],encapsulation:2,changeDetection:0})}return i})();var X$=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({imports:[ti]})}return i})();function gDe(i,e){if(i&1&&(Z(0,"p",2),ce(1),Q()),i&2){let t=Se();oe(),Ti(t.data.message)}}var fM=class i{constructor(e){this.data=e}static \u0275fac=function(t){return new(t||i)(rt(sm))};static \u0275cmp=tt({type:i,selectors:[["app-loading-dialog"]],decls:3,vars:2,consts:[[1,"flex-row","content"],[3,"diameter"],[1,"message"]],template:function(t,r){t&1&&(Z(0,"mat-dialog-content",0),Ge(1,"mat-spinner",1),je(2,gDe,2,1,"p",2),Q()),t&2&&(oe(),Re("diameter",30),oe(),Je(r.data.message?2:-1))},dependencies:[vo,X$,$$],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}.content[_ngcontent-%COMP%]{justify-content:center;align-items:center;gap:20px}.message[_ngcontent-%COMP%]{margin:0}"]})};var ty=class i{constructor(e){this.matDialog=e}loadingDialogRef=null;start(e){this.loadingDialogRef=this.matDialog.open(fM,{data:{message:e},disableClose:!0,autoFocus:!1,maxHeight:"80vh",maxWidth:"80vw",width:"200px"})}stop(){this.loadingDialogRef&&(this.loadingDialogRef.close(),this.loadingDialogRef=null)}static \u0275fac=function(t){return new(t||i)(Zt(lm))};static \u0275prov=lt({token:i,factory:i.\u0275fac,providedIn:"root"})};function yDe(i,e){if(i&1){let t=vt();Z(0,"div",0)(1,"h1",1),ce(2," Multimodal Simulation Visualization "),Q(),Z(3,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.onStartSimulation())}),Z(4,"mat-icon"),ce(5,"add_circle_outline"),Q(),Z(6,"span"),ce(7,"Start a simulation"),Q()(),Z(8,"button",2),Le("click",function(){Ee(t);let n=Se();return Ae(n.onBrowseSimulations())}),Z(9,"mat-icon"),ce(10,"folder_open"),Q(),Z(11,"span"),ce(12,"Browse simulations"),Q()(),Z(13,"div",3)(14,"button",4),Le("click",function(){Ee(t);let n=Se();return Ae(n.onUserGuide())}),Z(15,"mat-icon"),ce(16,"info"),Q(),Z(17,"span"),ce(18,"User guide"),Q()(),Ge(19,"app-github-button",5),Q()()}}var gM=class i{constructor(e,t,r,n){this.dialogService=e;this.loadingService=t;this.communicationService=r;this.router=n}shouldShowMainMenuSignal=Bt(!0);onStartSimulation(){return Ce(this,null,function*(){this.shouldShowMainMenuSignal.set(!1);let e=yield hn(this.dialogService.openSimulationConfigurationDialog({mode:"start",currentConfiguration:null}).afterClosed());if(!e){this.shouldShowMainMenuSignal.set(!0);return}if(!this.communicationService.isConnectedSignal()){yield hn(this.dialogService.openInformationDialog({title:"Disconnected",message:"A connection to the server is needed to create a simulation.",type:"error",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!1}).afterClosed()),this.shouldShowMainMenuSignal.set(!0);return}this.loadingService.start("Starting simulation");let t=Math.random().toString(36).substring(7)+Date.now();try{yield new Promise((r,n)=>{let a=setTimeout(()=>{n(new Error("Timeout"))},3e4);this.communicationService.on(t,o=>Ce(this,null,function*(){if(clearTimeout(a),this.loadingService.stop(),!e.general.shouldRunInBackground)yield this.router.navigate([`visualize/${o}`]);else{yield hn(this.dialogService.openInformationDialog({title:"Simulation started",message:"The simulation is starting in the background. You can check its status in the simulations list.",type:"info",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!1}).afterClosed()),this.shouldShowMainMenuSignal.set(!0);return}r()})),this.communicationService.emit("start-simulation",e.general.name,e.general.data,t,e.configuration.maxDuration)}),this.communicationService.removeAllListeners(t)}catch{this.communicationService.removeAllListeners(t),this.loadingService.stop(),yield hn(this.dialogService.openInformationDialog({title:"Timeout",message:"The simulation took too long to start. Please verify the status of the server.",type:"error",confirmButtonOverride:null,cancelButtonOverride:null,canCancel:!1}).afterClosed()),this.shouldShowMainMenuSignal.set(!0);return}})}onBrowseSimulations(){return Ce(this,null,function*(){this.shouldShowMainMenuSignal.set(!1);let e=yield hn(this.dialogService.openSimulationListDialog().afterClosed());if(!e||!e.simulationToVisualize){this.shouldShowMainMenuSignal.set(!0);return}yield this.router.navigate([`visualize/${e.simulationToVisualize.id}`])})}onUserGuide(){return Ce(this,null,function*(){this.shouldShowMainMenuSignal.set(!1),yield hn(this.dialogService.openUserGuide().afterClosed()),this.shouldShowMainMenuSignal.set(!0)})}static \u0275fac=function(t){return new(t||i)(rt(Js),rt(ty),rt(To),rt(rf))};static \u0275cmp=tt({type:i,selectors:[["app-home"]],decls:1,vars:1,consts:[[1,"main-menu","flex-column","align-main-center","gap-1-rem"],[1,"enable-pointer-events","main-menu-title"],["mat-raised-button","",1,"enable-pointer-events",3,"click"],[1,"flex-row","gap-1-rem"],["mat-raised-button","",1,"enable-pointer-events","flex-1",3,"click"],[1,"enable-pointer-events"]],template:function(t,r){t&1&&je(0,yDe,20,0,"div",0),t&2&&Je(r.shouldShowMainMenuSignal()?0:-1)},dependencies:[Br,pn,pr,mr,dw],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.align-center[_ngcontent-%COMP%], .align-main-center[_ngcontent-%COMP%]{justify-content:center}.align-center[_ngcontent-%COMP%], .align-cross-center[_ngcontent-%COMP%]{align-items:center}.align-main-end[_ngcontent-%COMP%]{justify-content:flex-end}.align-cross-end[_ngcontent-%COMP%]{align-items:flex-end}.align-main-start[_ngcontent-%COMP%]{justify-content:flex-start}.align-cross-start[_ngcontent-%COMP%]{align-items:flex-start}.align-cross-stretch[_ngcontent-%COMP%]{align-items:stretch}.gap-0-5-rem[_ngcontent-%COMP%]{gap:.5rem}.gap-1-rem[_ngcontent-%COMP%]{gap:1rem}.gap-1-5-rem[_ngcontent-%COMP%]{gap:1.5rem}.flex-1[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%]{display:block;width:100%;height:100%;position:absolute;top:0;left:0;z-index:500;background-color:#00000052}.disable-pointer-events[_ngcontent-%COMP%], [_nghost-%COMP%]{pointer-events:none}.enable-pointer-events[_ngcontent-%COMP%]{pointer-events:auto}.main-menu[_ngcontent-%COMP%]{position:absolute;top:50%;left:25%;transform:translate(-50%,-50%);max-width:20rem}.main-menu-title[_ngcontent-%COMP%]{font-size:3.5rem;font-weight:700;text-align:center;color:#fff}"]})};var _De=["panel"],bDe=["*"];function vDe(i,e){if(i&1){let t=vt();Z(0,"div",1,0),Le("@panelAnimation.done",function(n){Ee(t);let a=Se();return Ae(a._animationDone.next(n))}),Ot(2),Q()}if(i&2){let t=e.id,r=Se();dn(r._classList),gt("mat-mdc-autocomplete-visible",r.showPanel)("mat-mdc-autocomplete-hidden",!r.showPanel)("mat-primary",r._color==="primary")("mat-accent",r._color==="accent")("mat-warn",r._color==="warn"),Re("id",r.id)("@panelAnimation",r.isOpen?"visible":"hidden"),Mt("aria-label",r.ariaLabel||null)("aria-labelledby",r._getPanelAriaLabelledby(t))}}var SDe=Cs("panelAnimation",[Ms("void, hidden",mn({opacity:0,transform:"scaleY(0.8)"})),Ba(":enter, hidden => visible",[oV([Pa("0.03s linear",mn({opacity:1})),Pa("0.12s cubic-bezier(0, 0, 0.2, 1)",mn({transform:"scaleY(1)"}))])]),Ba(":leave, visible => hidden",[Pa("0.075s linear",mn({opacity:0}))])]),RI=class{source;option;constructor(e,t){this.source=e,this.option=t}},eX=new et("mat-autocomplete-default-options",{providedIn:"root",factory:kDe});function kDe(){return{autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1}}var tX=(()=>{class i{_changeDetectorRef=te(_i);_elementRef=te(Et);_defaults=te(eX);_activeOptionChanges=tr.EMPTY;_animationDone=new ut;_keyManager;showPanel=!1;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=!1;_latestOpeningTrigger;_setColor(t){this._color=t,this._changeDetectorRef.markForCheck()}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple;optionSelected=new ut;opened=new ut;closed=new ut;optionActivated=new ut;set classList(t){this._classList=t,this._elementRef.nativeElement.className=""}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(t){this._hideSingleSelectionIndicator=t,this._syncParentProperties()}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let t of this.options)t._changeDetectorRef.markForCheck()}id=te(Di).getId("mat-autocomplete-");inertGroups;constructor(){let t=te($i);this.inertGroups=t?.SAFARI||!1,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new pf(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(t=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[t]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe(),this._animationDone.complete()}_setScrollTop(t){this.panel&&(this.panel.nativeElement.scrollTop=t)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(t){let r=new RI(this,t);this.optionSelected.emit(r)}_getPanelAriaLabelledby(t){if(this.ariaLabel)return null;let r=t?t+" ":"";return this.ariaLabelledby?r+this.ariaLabelledby:t}_skipPredicate(){return!1}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-autocomplete"]],contentQueries:function(r,n,a){if(r&1&&(Ki(a,$l,5),Ki(a,yb,5)),r&2){let o;St(o=kt())&&(n.options=o),St(o=kt())&&(n.optionGroups=o)}},viewQuery:function(r,n){if(r&1&&(di(Ta,7),di(_De,5)),r&2){let a;St(a=kt())&&(n.template=a.first),St(a=kt())&&(n.panel=a.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",st],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",st],requireSelection:[2,"requireSelection","requireSelection",st],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",st],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",st]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[ei([{provide:gb,useExisting:i}]),si],ngContentSelectors:bDe,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(r,n){r&1&&(Pi(),je(0,vDe,3,16,"ng-template"))},styles:["div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:static;border-radius:var(--mat-autocomplete-container-shape, var(--mat-sys-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));background-color:var(--mat-autocomplete-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-autocomplete-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}mat-autocomplete{display:none}"],encapsulation:2,data:{animation:[SDe]},changeDetection:0})}return i})();var xDe={provide:Bn,useExisting:Fr(()=>DI),multi:!0};var iX=new et("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let i=te(Rr);return()=>i.scrollStrategies.reposition()}});function wDe(i){return()=>i.scrollStrategies.reposition()}var CDe={provide:iX,deps:[Rr],useFactory:wDe},DI=(()=>{class i{_environmentInjector=te(xs);_element=te(Et);_overlay=te(Rr);_viewContainerRef=te(sa);_zone=te(Kt);_changeDetectorRef=te(_i);_dir=te(Pr,{optional:!0});_formField=te(nu,{optional:!0,host:!0});_document=te(li);_viewportRuler=te(ic);_scrollStrategy=te(iX);_renderer=te(Wr);_defaults=te(eX,{optional:!0});_overlayRef;_portal;_componentDestroyed=!1;_initialized=new ct;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue;_valueOnAttach;_valueOnLastKeydown;_positionStrategy;_manuallyFloatingLabel=!1;_closingActionsSubscription;_viewportSubscription=tr.EMPTY;_breakpointObserver=te(df);_handsetLandscapeSubscription=tr.EMPTY;_canOpenOnNextFocus=!0;_valueBeforeAutoSelection;_pendingAutoselectedOption;_closeKeyEventStream=new ct;_windowBlurHandler=()=>{this._canOpenOnNextFocus=this._document.activeElement!==this._element.nativeElement||this.panelOpen};_onChange=()=>{};_onTouched=()=>{};autocomplete;position="auto";connectedTo;autocompleteAttribute="off";autocompleteDisabled;constructor(){}_aboveClass="mat-mdc-autocomplete-panel-above";ngAfterViewInit(){this._initialized.next(),this._initialized.complete(),this._cleanupWindowBlur=this._renderer.listen("window","blur",this._windowBlurHandler)}ngOnChanges(t){t.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){this._cleanupWindowBlur?.(),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}_overlayAttached=!1;openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&_h(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return vr(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(Yi(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(Yi(()=>this._overlayAttached)):Qt()).pipe(mi(t=>t instanceof fb?t:null))}optionSelections=ol(()=>{let t=this.autocomplete?this.autocomplete.options:null;return t?t.changes.pipe(ur(t),Er(()=>vr(...t.map(r=>r.onSelectionChange)))):this._initialized.pipe(Er(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new wa(t=>{let r=a=>{let o=An(a),s=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,l=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;this._overlayAttached&&o!==this._element.nativeElement&&this._document.activeElement!==this._element.nativeElement&&(!s||!s.contains(o))&&(!l||!l.contains(o))&&this._overlayRef&&!this._overlayRef.overlayElement.contains(o)&&t.next(a)},n=[this._renderer.listen("document","click",r),this._renderer.listen("document","auxclick",r),this._renderer.listen("document","touchend",r)];return()=>{n.forEach(a=>a())}})}writeValue(t){Promise.resolve(null).then(()=>this._assignOptionValue(t))}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this._element.nativeElement.disabled=t}_handleKeydown(t){let r=t.keyCode,n=Hr(t);if(r===27&&!n&&t.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&r===13&&this.panelOpen&&!n)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){let a=this.autocomplete._keyManager.activeItem,o=r===38||r===40;r===9||o&&!n&&this.panelOpen?this.autocomplete._keyManager.onKeydown(t):o&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(o||this.autocomplete._keyManager.activeItem!==a)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(t){let r=t.target,n=r.value;if(r.type==="number"&&(n=n==""?null:parseFloat(n)),this._previousValue!==n){if(this._previousValue=n,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(n),!n)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let a=this.autocomplete.options?.find(o=>o.selected);if(a){let o=this._getDisplayValue(a.value);n!==o&&a.deselect(!1)}}if(this._canOpen()&&this._document.activeElement===t.target){let a=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(a)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_floatLabel(t=!1){this._formField&&this._formField.floatLabel==="auto"&&(t?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let t=new wa(n=>{vn(()=>{n.next()},{injector:this._environmentInjector})}),r=this.autocomplete.options.changes.pipe(Ar(()=>this._positionStrategy.reapplyLastPosition()),S4(0));return vr(t,r).pipe(Er(()=>this._zone.run(()=>{let n=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),n!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),Ir(1)).subscribe(n=>this._setValueAndClose(n))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(t){let r=this.autocomplete;return r&&r.displayWith?r.displayWith(t):t}_assignOptionValue(t){let r=this._getDisplayValue(t);t==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(r??"")}_updateNativeInputValue(t){this._formField?this._formField._control.value=t:this._element.nativeElement.value=t,this._previousValue=t}_setValueAndClose(t){let r=this.autocomplete,n=t?t.source:this._pendingAutoselectedOption;n?(this._clearPreviousSelectedOption(n),this._assignOptionValue(n.value),this._onChange(n.value),r._emitSelectEvent(n),this._element.nativeElement.focus()):r.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),r._animationDone?r._animationDone.pipe(Ir(1)).subscribe(()=>this._onChange(null)):this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(t,r){this.autocomplete?.options?.forEach(n=>{n!==t&&n.selected&&n.deselect(r)})}_openPanelInternal(t=this._element.nativeElement.value){if(this._attachOverlay(t),this._floatLabel(),this._trackedModal){let r=this.autocomplete.id;gf(this._trackedModal,"aria-owns",r)}}_attachOverlay(t){this.autocomplete;let r=this._overlayRef;r?(this._positionStrategy.setOrigin(this._getConnectedElement()),r.updateSize({width:this._getPanelWidth()})):(this._portal=new Xa(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),r=this._overlay.create(this._getOverlayConfig()),this._overlayRef=r,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&r&&r.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(Jx.HandsetLandscape).subscribe(a=>{a.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),r&&!r.hasAttached()&&(r.attach(this._portal),this._valueOnAttach=t,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let n=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&n!==this.panelOpen&&this._emitOpened()}_handlePanelKeydown=t=>{(t.keyCode===27&&!Hr(t)||t.keyCode===38&&Hr(t,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),t.stopPropagation(),t.preventDefault())};_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let t=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=t.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=t.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=null}_getOverlayConfig(){return new Ds({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,panelClass:this._defaults?.overlayPanelClass})}_getOverlayPosition(){let t=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(t),this._positionStrategy=t,t}_setStrategyPositions(t){let r=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],n=this._aboveClass,a=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:n},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:n}],o;this.position==="above"?o=a:this.position==="below"?o=r:o=[...r,...a],t.withPositions(o)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let t=this.autocomplete;if(t.autoActiveFirstOption){let r=-1;for(let n=0;n<t.options.length;n++)if(!t.options.get(n).disabled){r=n;break}t._keyManager.setActiveItem(r)}else t._keyManager.setActiveItem(-1)}_canOpen(){let t=this._element.nativeElement;return!t.readOnly&&!t.disabled&&!this.autocompleteDisabled}_scrollToOption(t){let r=this.autocomplete,n=sw(t,r.options,r.optionGroups);if(t===0&&n===1)r._setScrollTop(0);else if(r.panel){let a=r.options.toArray()[t];if(a){let o=a._getHostElement(),s=lw(o.offsetTop,o.offsetHeight,r._getScrollTop(),r.panel.nativeElement.offsetHeight);r._setScrollTop(s)}}}_trackedModal=null;_applyModalPanelOwnership(){let t=this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!t)return;let r=this.autocomplete.id;this._trackedModal&&_h(this._trackedModal,"aria-owns",r),gf(t,"aria-owns",r),this._trackedModal=t}_clearFromModal(){if(this._trackedModal){let t=this.autocomplete.id;_h(this._trackedModal,"aria-owns",t),this._trackedModal=null}}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(r,n){r&1&&Le("focusin",function(){return n._handleFocus()})("blur",function(){return n._onTouched()})("input",function(o){return n._handleInput(o)})("keydown",function(o){return n._handleKeydown(o)})("click",function(){return n._handleClick()}),r&2&&Mt("autocomplete",n.autocompleteAttribute)("role",n.autocompleteDisabled?null:"combobox")("aria-autocomplete",n.autocompleteDisabled?null:"list")("aria-activedescendant",n.panelOpen&&n.activeOption?n.activeOption.id:null)("aria-expanded",n.autocompleteDisabled?null:n.panelOpen.toString())("aria-controls",n.autocompleteDisabled||!n.panelOpen||n.autocomplete==null?null:n.autocomplete.id)("aria-haspopup",n.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",st]},exportAs:["matAutocompleteTrigger"],features:[ei([xDe]),si,rr]})}return i})(),rX=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({providers:[CDe],imports:[Uo,yf,ti,pl,yf,ti]})}return i})();var TDe=["button"],EDe=["*"];function ADe(i,e){if(i&1&&(Z(0,"div",2),Ge(1,"mat-pseudo-checkbox",6),Q()),i&2){let t=Se();oe(),Re("disabled",t.disabled)}}var nX=new et("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:PDe});function PDe(){return{hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1}}var aX=new et("MatButtonToggleGroup"),BDe={provide:Bn,useExisting:Fr(()=>LI),multi:!0},yM=class{source;value;constructor(e,t){this.source=e,this.value=t}},LI=(()=>{class i{_changeDetector=te(_i);_dir=te(Pr,{optional:!0});_multiple=!1;_disabled=!1;_disabledInteractive=!1;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(t){this._name=t,this._markButtonsForCheck()}_name=te(Di).getId("mat-button-toggle-group-");vertical;get value(){let t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t.map(r=>r.value):t[0]?t[0].value:void 0}set value(t){this._setSelectionByValue(t),this.valueChange.emit(this.value)}valueChange=new ut;get selected(){let t=this._selectionModel?this._selectionModel.selected:[];return this.multiple?t:t[0]||null}get multiple(){return this._multiple}set multiple(t){this._multiple=t,this._markButtonsForCheck()}get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._markButtonsForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(t){this._disabledInteractive=t,this._markButtonsForCheck()}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new ut;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(t){this._hideSingleSelectionIndicator=t,this._markButtonsForCheck()}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(t){this._hideMultipleSelectionIndicator=t,this._markButtonsForCheck()}_hideMultipleSelectionIndicator;constructor(){let t=te(nX,{optional:!0});this.appearance=t&&t.appearance?t.appearance:"standard",this.hideSingleSelectionIndicator=t?.hideSingleSelectionIndicator??!1,this.hideMultipleSelectionIndicator=t?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new Cf(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(t=>t.checked)),this.multiple||this._initializeTabIndex()}writeValue(t){this.value=t,this._changeDetector.markForCheck()}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t}_keydown(t){if(this.multiple||this.disabled)return;let n=t.target.id,a=this._buttonToggles.toArray().findIndex(s=>s.buttonId===n),o=null;switch(t.keyCode){case 32:case 13:o=this._buttonToggles.get(a)||null;break;case 38:o=this._getNextButton(a,-1);break;case 37:o=this._getNextButton(a,this.dir==="ltr"?-1:1);break;case 40:o=this._getNextButton(a,1);break;case 39:o=this._getNextButton(a,this.dir==="ltr"?1:-1);break;default:return}o&&(t.preventDefault(),o._onButtonClick(),o.focus())}_emitChangeEvent(t){let r=new yM(t,this.value);this._rawValue=r.value,this._controlValueAccessorChangeFn(r.value),this.change.emit(r)}_syncButtonToggle(t,r,n=!1,a=!1){!this.multiple&&this.selected&&!t.checked&&(this.selected.checked=!1),this._selectionModel?r?this._selectionModel.select(t):this._selectionModel.deselect(t):a=!0,a?Promise.resolve().then(()=>this._updateModelValue(t,n)):this._updateModelValue(t,n)}_isSelected(t){return this._selectionModel&&this._selectionModel.isSelected(t)}_isPrechecked(t){return typeof this._rawValue>"u"?!1:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(r=>t.value!=null&&r===t.value):t.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(t=>{t.tabIndex=-1}),this.selected)this.selected.tabIndex=0;else for(let t=0;t<this._buttonToggles.length;t++){let r=this._buttonToggles.get(t);if(!r.disabled){r.tabIndex=0;break}}this._markButtonsForCheck()}_getNextButton(t,r){let n=this._buttonToggles;for(let a=1;a<=n.length;a++){let o=(t+r*a+n.length)%n.length,s=n.get(o);if(s&&!s.disabled)return s}return null}_setSelectionByValue(t){if(this._rawValue=t,!this._buttonToggles)return;let r=this._buttonToggles.toArray();if(this.multiple&&t?(Array.isArray(t),this._clearSelection(),t.forEach(n=>this._selectValue(n,r))):(this._clearSelection(),this._selectValue(t,r)),!this.multiple&&r.every(n=>n.tabIndex===-1)){for(let n of r)if(!n.disabled){n.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(t=>{t.checked=!1,this.multiple||(t.tabIndex=-1)})}_selectValue(t,r){for(let n of r)if(n.value!=null&&n.value===t){n.checked=!0,this._selectionModel.select(n),this.multiple||(n.tabIndex=0);break}}_updateModelValue(t,r){r&&this._emitChangeEvent(t),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(t=>t._markForCheck())}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["mat-button-toggle-group"]],contentQueries:function(r,n,a){if(r&1&&Ki(a,_M,5),r&2){let o;St(o=kt())&&(n._buttonToggles=o)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(r,n){r&1&&Le("keydown",function(o){return n._keydown(o)}),r&2&&(Mt("role",n.multiple?"group":"radiogroup")("aria-disabled",n.disabled),gt("mat-button-toggle-vertical",n.vertical)("mat-button-toggle-group-appearance-standard",n.appearance==="standard"))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",st],value:"value",multiple:[2,"multiple","multiple",st],disabled:[2,"disabled","disabled",st],disabledInteractive:[2,"disabledInteractive","disabledInteractive",st],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",st],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",st]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[ei([BDe,{provide:aX,useExisting:i}]),si]})}return i})(),_M=(()=>{class i{_changeDetectorRef=te(_i);_elementRef=te(Et);_focusMonitor=te(In);_idGenerator=te(Di);_animationMode=te(nr,{optional:!0});_checked=!1;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return`${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex}set tabIndex(t){t!==this._tabIndex&&(this._tabIndex=t,this._markForCheck())}_tabIndex;disableRipple;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(t){this._appearance=t}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(t){t!==this._checked&&(this._checked=t,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(t){this._disabled=t}_disabled=!1;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(t){this._disabledInteractive=t}_disabledInteractive;change=new ut;constructor(){te(ar).load(kn);let t=te(aX,{optional:!0}),r=te(new Ma("tabindex"),{optional:!0})||"",n=te(nX,{optional:!0});this._tabIndex=parseInt(r)||0,this.buttonToggleGroup=t,this.appearance=n&&n.appearance?n.appearance:"standard",this.disabledInteractive=n?.disabledInteractive??!1}ngOnInit(){let t=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),t&&(t._isPrechecked(this)?this.checked=!0:t._isSelected(this)!==this._checked&&t._syncButtonToggle(this,this._checked))}ngAfterViewInit(){this._animationMode!=="NoopAnimations"&&this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){let t=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),t&&t._isSelected(this)&&t._syncButtonToggle(this,!1,!1,!0)}focus(t){this._buttonElement.nativeElement.focus(t)}_onButtonClick(){if(this.disabled)return;let t=this.isSingleSelector()?!0:!this._checked;if(t!==this._checked&&(this._checked=t,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let r=this.buttonToggleGroup._buttonToggles.find(n=>n.tabIndex===0);r&&(r.tabIndex=-1),this.tabIndex=0}this.change.emit(new yM(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(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-button-toggle"]],viewQuery:function(r,n){if(r&1&&di(TDe,5),r&2){let a;St(a=kt())&&(n._buttonElement=a.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(r,n){r&1&&Le("focus",function(){return n.focus()}),r&2&&(Mt("aria-label",null)("aria-labelledby",null)("id",n.id)("name",null),gt("mat-button-toggle-standalone",!n.buttonToggleGroup)("mat-button-toggle-checked",n.checked)("mat-button-toggle-disabled",n.disabled)("mat-button-toggle-disabled-interactive",n.disabledInteractive)("mat-button-toggle-appearance-standard",n.appearance==="standard"))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",st],appearance:"appearance",checked:[2,"checked","checked",st],disabled:[2,"disabled","disabled",st],disabledInteractive:[2,"disabledInteractive","disabledInteractive",st]},outputs:{change:"change"},exportAs:["matButtonToggle"],features:[si],ngContentSelectors:EDe,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(r,n){if(r&1){let a=vt();Pi(),Z(0,"button",1,0),Le("click",function(){return Ee(a),Ae(n._onButtonClick())}),je(2,ADe,2,1,"div",2),Z(3,"span",3),Ot(4),Q()(),Ge(5,"span",4)(6,"span",5)}if(r&2){let a=Or(1);Re("id",n.buttonId)("disabled",n.disabled&&!n.disabledInteractive||null),Mt("role",n.isSingleSelector()?"radio":"button")("tabindex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("aria-pressed",n.isSingleSelector()?null:n.checked)("aria-checked",n.isSingleSelector()?n.checked:null)("name",n._getButtonName())("aria-label",n.ariaLabel)("aria-labelledby",n.ariaLabelledby)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),oe(2),Je(n.buttonToggleGroup&&(!n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideSingleSelectionIndicator||n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),oe(4),Re("matRippleTrigger",a)("matRippleDisabled",n.disableRipple||n.disabled)}},dependencies:[Ya,YB],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);transform:translateZ(0);border-radius:var(--mat-legacy-button-toggle-shape)}.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-standard-button-toggle-shape, var(--mat-sys-corner-full));border:solid 1px var(--mat-standard-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-minimal-pseudo-checkbox-selected-checkmark-color: var(--mat-standard-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-legacy-button-toggle-text-color);font-family:var(--mat-legacy-button-toggle-label-text-font);font-size:var(--mat-legacy-button-toggle-label-text-size);line-height:var(--mat-legacy-button-toggle-label-text-line-height);font-weight:var(--mat-legacy-button-toggle-label-text-weight);letter-spacing:var(--mat-legacy-button-toggle-label-text-tracking);--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--mat-legacy-button-toggle-selected-state-text-color)}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-legacy-button-toggle-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-legacy-button-toggle-selected-state-text-color);background-color:var(--mat-legacy-button-toggle-selected-state-background-color)}.mat-button-toggle-disabled{pointer-events:none;color:var(--mat-legacy-button-toggle-disabled-state-text-color);background-color:var(--mat-legacy-button-toggle-disabled-state-background-color);--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color: var(--mat-legacy-button-toggle-disabled-state-text-color)}.mat-button-toggle-disabled.mat-button-toggle-checked{background-color:var(--mat-legacy-button-toggle-disabled-selected-state-background-color)}.mat-button-toggle-disabled-interactive{pointer-events:auto}.mat-button-toggle-appearance-standard{color:var(--mat-standard-button-toggle-text-color, var(--mat-sys-on-surface));background-color:var(--mat-standard-button-toggle-background-color, transparent);font-family:var(--mat-standard-button-toggle-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-standard-button-toggle-label-text-size, var(--mat-sys-label-large-size));line-height:var(--mat-standard-button-toggle-label-text-line-height, var(--mat-sys-label-large-line-height));font-weight:var(--mat-standard-button-toggle-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-standard-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-standard-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-standard-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-standard-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-appearance-standard.mat-button-toggle-checked{color:var(--mat-standard-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container));background-color:var(--mat-standard-button-toggle-selected-state-background-color, var(--mat-sys-secondary-container))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled{color:var(--mat-standard-button-toggle-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-standard-button-toggle-disabled-state-background-color, transparent)}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled .mat-pseudo-checkbox{--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color: var(--mat-standard-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-standard-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-standard-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-standard-button-toggle-state-layer-color, var(--mat-sys-on-surface))}.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{opacity:var(--mat-standard-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-standard-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-legacy-button-toggle-height);position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px;line-height:var(--mat-standard-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-legacy-button-toggle-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-standard-button-toggle-shape, var(--mat-sys-corner-full))}.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-standard-button-toggle-shape, var(--mat-sys-corner-full));border-bottom-right-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full))}.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-standard-button-toggle-shape, var(--mat-sys-corner-full));border-bottom-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full))}.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-standard-button-toggle-shape, var(--mat-sys-corner-full));border-bottom-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full))}.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-standard-button-toggle-shape, var(--mat-sys-corner-full));border-top-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-full))}"],encapsulation:2,changeDetection:0})}return i})(),oX=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({imports:[ti,Ko,_M,ti]})}return i})();var DDe=["*"];var LDe=[[["","mat-card-avatar",""],["","matCardAvatar",""]],[["mat-card-title"],["mat-card-subtitle"],["","mat-card-title",""],["","mat-card-subtitle",""],["","matCardTitle",""],["","matCardSubtitle",""]],"*"],IDe=["[mat-card-avatar], [matCardAvatar]",`mat-card-title, mat-card-subtitle,
|
1699
1699
|
[mat-card-title], [mat-card-subtitle],
|
1700
1700
|
[matCardTitle], [matCardSubtitle]`,"*"],FDe=new et("MAT_CARD_CONFIG"),ea=(()=>{class i{appearance;constructor(){let t=te(FDe,{optional:!0});this.appearance=t?.appearance||"raised"}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-card"]],hostAttrs:[1,"mat-mdc-card","mdc-card"],hostVars:4,hostBindings:function(r,n){r&2&>("mat-mdc-card-outlined",n.appearance==="outlined")("mdc-card--outlined",n.appearance==="outlined")},inputs:{appearance:"appearance"},exportAs:["matCard"],ngContentSelectors:DDe,decls:1,vars:0,template:function(r,n){r&1&&(Pi(),Ot(0))},styles:['.mat-mdc-card{display:flex;flex-direction:column;box-sizing:border-box;position:relative;border-style:solid;border-width:0;background-color:var(--mdc-elevated-card-container-color, var(--mat-sys-surface-container-low));border-color:var(--mdc-elevated-card-container-color, var(--mat-sys-surface-container-low));border-radius:var(--mdc-elevated-card-container-shape, var(--mat-sys-corner-medium));box-shadow:var(--mdc-elevated-card-container-elevation, var(--mat-sys-level1))}.mat-mdc-card::after{position:absolute;top:0;left:0;width:100%;height:100%;border:solid 1px rgba(0,0,0,0);content:"";display:block;pointer-events:none;box-sizing:border-box;border-radius:var(--mdc-elevated-card-container-shape, var(--mat-sys-corner-medium))}.mat-mdc-card-outlined{background-color:var(--mdc-outlined-card-container-color, var(--mat-sys-surface));border-radius:var(--mdc-outlined-card-container-shape, var(--mat-sys-corner-medium));border-width:var(--mdc-outlined-card-outline-width, 1px);border-color:var(--mdc-outlined-card-outline-color, var(--mat-sys-outline-variant));box-shadow:var(--mdc-outlined-card-container-elevation, var(--mat-sys-level0))}.mat-mdc-card-outlined::after{border:none}.mdc-card__media{position:relative;box-sizing:border-box;background-repeat:no-repeat;background-position:center;background-size:cover}.mdc-card__media::before{display:block;content:""}.mdc-card__media:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.mdc-card__media:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.mat-mdc-card-actions{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;min-height:52px;padding:8px}.mat-mdc-card-title{font-family:var(--mat-card-title-text-font, var(--mat-sys-title-large-font));line-height:var(--mat-card-title-text-line-height, var(--mat-sys-title-large-line-height));font-size:var(--mat-card-title-text-size, var(--mat-sys-title-large-size));letter-spacing:var(--mat-card-title-text-tracking, var(--mat-sys-title-large-tracking));font-weight:var(--mat-card-title-text-weight, var(--mat-sys-title-large-weight))}.mat-mdc-card-subtitle{color:var(--mat-card-subtitle-text-color, var(--mat-sys-on-surface));font-family:var(--mat-card-subtitle-text-font, var(--mat-sys-title-medium-font));line-height:var(--mat-card-subtitle-text-line-height, var(--mat-sys-title-medium-line-height));font-size:var(--mat-card-subtitle-text-size, var(--mat-sys-title-medium-size));letter-spacing:var(--mat-card-subtitle-text-tracking, var(--mat-sys-title-medium-tracking));font-weight:var(--mat-card-subtitle-text-weight, var(--mat-sys-title-medium-weight))}.mat-mdc-card-title,.mat-mdc-card-subtitle{display:block;margin:0}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle{padding:16px 16px 0}.mat-mdc-card-header{display:flex;padding:16px 16px 0}.mat-mdc-card-content{display:block;padding:0 16px}.mat-mdc-card-content:first-child{padding-top:16px}.mat-mdc-card-content:last-child{padding-bottom:16px}.mat-mdc-card-title-group{display:flex;justify-content:space-between;width:100%}.mat-mdc-card-avatar{height:40px;width:40px;border-radius:50%;flex-shrink:0;margin-bottom:16px;object-fit:cover}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title{line-height:normal}.mat-mdc-card-sm-image{width:80px;height:80px}.mat-mdc-card-md-image{width:112px;height:112px}.mat-mdc-card-lg-image{width:152px;height:152px}.mat-mdc-card-xl-image{width:240px;height:240px}.mat-mdc-card-subtitle~.mat-mdc-card-title,.mat-mdc-card-title~.mat-mdc-card-subtitle,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-title-group .mat-mdc-card-title,.mat-mdc-card-title-group .mat-mdc-card-subtitle{padding-top:0}.mat-mdc-card-content>:last-child:not(.mat-mdc-card-footer){margin-bottom:0}.mat-mdc-card-actions-align-end{justify-content:flex-end}'],encapsulation:2,changeDetection:0})}return i})(),bM=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["mat-card-title"],["","mat-card-title",""],["","matCardTitle",""]],hostAttrs:[1,"mat-mdc-card-title"]})}return i})();var ta=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["mat-card-content"]],hostAttrs:[1,"mat-mdc-card-content"]})}return i})(),sX=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["mat-card-subtitle"],["","mat-card-subtitle",""],["","matCardSubtitle",""]],hostAttrs:[1,"mat-mdc-card-subtitle"]})}return i})();var lX=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-card-header"]],hostAttrs:[1,"mat-mdc-card-header"],ngContentSelectors:IDe,decls:4,vars:0,consts:[[1,"mat-mdc-card-header-text"]],template:function(r,n){r&1&&(Pi(LDe),Ot(0),Z(1,"div",0),Ot(2,1),Q(),Ot(3,2))},encapsulation:2,changeDetection:0})}return i})();var ia=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({imports:[ti,ti]})}return i})();var II=new et("CdkAccordion"),cX=(()=>{class i{_stateChanges=new ct;_openCloseAllActions=new ct;id=te(Di).getId("cdk-accordion-");multi=!1;openAll(){this.multi&&this._openCloseAllActions.next(!0)}closeAll(){this._openCloseAllActions.next(!1)}ngOnChanges(t){this._stateChanges.next(t)}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete()}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:[2,"multi","multi",st]},exportAs:["cdkAccordion"],features:[ei([{provide:II,useExisting:i}]),si,rr]})}return i})(),uX=(()=>{class i{accordion=te(II,{optional:!0,skipSelf:!0});_changeDetectorRef=te(_i);_expansionDispatcher=te(Mf);_openCloseAllSubscription=tr.EMPTY;closed=new ut;opened=new ut;destroyed=new ut;expandedChange=new ut;id=te(Di).getId("cdk-accordion-child-");get expanded(){return this._expanded}set expanded(t){if(this._expanded!==t){if(this._expanded=t,this.expandedChange.emit(t),t){this.opened.emit();let r=this.accordion?this.accordion.id:this.id;this._expansionDispatcher.notify(this.id,r)}else this.closed.emit();this._changeDetectorRef.markForCheck()}}_expanded=!1;disabled=!1;_removeUniqueSelectionListener=()=>{};constructor(){}ngOnInit(){this._removeUniqueSelectionListener=this._expansionDispatcher.listen((t,r)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===r&&this.id!==t&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(t=>{this.disabled||(this.expanded=t)})}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:[2,"expanded","expanded",st],disabled:[2,"disabled","disabled",st]},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[ei([{provide:II,useValue:void 0}]),si]})}return i})(),hX=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({})}return i})();var ODe=["body"],zDe=["bodyWrapper"],HDe=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],NDe=["mat-expansion-panel-header","*","mat-action-row"];function GDe(i,e){}var VDe=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],KDe=["mat-panel-title","mat-panel-description","*"];function WDe(i,e){i&1&&(Z(0,"span",1),Sr(),Z(1,"svg",2),Ge(2,"path",3),Q()())}var FI=new et("MAT_ACCORDION"),dX=new et("MAT_EXPANSION_PANEL"),UDe=(()=>{class i{_template=te(Ta);_expansionPanel=te(dX,{optional:!0});constructor(){}static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["ng-template","matExpansionPanelContent",""]]})}return i})(),mX=new et("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),qm=(()=>{class i extends uX{_viewContainerRef=te(sa);_animationsDisabled=te(nr,{optional:!0})==="NoopAnimations";_document=te(li);_ngZone=te(Kt);_elementRef=te(Et);_renderer=te(Wr);_cleanupTransitionEnd;get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=t}_hideToggle=!1;get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(t){this._togglePosition=t}_togglePosition;afterExpand=new ut;afterCollapse=new ut;_inputChanges=new ct;accordion=te(FI,{optional:!0,skipSelf:!0});_lazyContent;_body;_bodyWrapper;_portal;_headerId=te(Di).getId("mat-expansion-panel-header-");constructor(){super();let t=te(mX,{optional:!0});this._expansionDispatcher=te(Mf),t&&(this.hideToggle=t.hideToggle)}_hasSpacing(){return this.accordion?this.expanded&&this.accordion.displayMode==="default":!1}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this._lazyContent._expansionPanel===this&&this.opened.pipe(ur(null),Yi(()=>this.expanded&&!this._portal),Ir(1)).subscribe(()=>{this._portal=new Xa(this._lazyContent._template,this._viewContainerRef)}),this._setupAnimationEvents()}ngOnChanges(t){this._inputChanges.next(t)}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTransitionEnd?.(),this._inputChanges.complete()}_containsFocus(){if(this._body){let t=this._document.activeElement,r=this._body.nativeElement;return t===r||r.contains(t)}return!1}_transitionEndListener=({target:t,propertyName:r})=>{t===this._bodyWrapper?.nativeElement&&r==="grid-template-rows"&&this._ngZone.run(()=>{this.expanded?this.afterExpand.emit():this.afterCollapse.emit()})};_setupAnimationEvents(){this._ngZone.runOutsideAngular(()=>{this._animationsDisabled?(this.opened.subscribe(()=>this._ngZone.run(()=>this.afterExpand.emit())),this.closed.subscribe(()=>this._ngZone.run(()=>this.afterCollapse.emit()))):setTimeout(()=>{let t=this._elementRef.nativeElement;this._cleanupTransitionEnd=this._renderer.listen(t,"transitionend",this._transitionEndListener),t.classList.add("mat-expansion-panel-animations-enabled")},200)})}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-expansion-panel"]],contentQueries:function(r,n,a){if(r&1&&Ki(a,UDe,5),r&2){let o;St(o=kt())&&(n._lazyContent=o.first)}},viewQuery:function(r,n){if(r&1&&(di(ODe,5),di(zDe,5)),r&2){let a;St(a=kt())&&(n._body=a.first),St(a=kt())&&(n._bodyWrapper=a.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:4,hostBindings:function(r,n){r&2&>("mat-expanded",n.expanded)("mat-expansion-panel-spacing",n._hasSpacing())},inputs:{hideToggle:[2,"hideToggle","hideToggle",st],togglePosition:"togglePosition"},outputs:{afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[ei([{provide:FI,useValue:void 0},{provide:dX,useExisting:i}]),si,Ai,rr],ngContentSelectors:NDe,decls:9,vars:4,consts:[["bodyWrapper",""],["body",""],[1,"mat-expansion-panel-content-wrapper"],["role","region",1,"mat-expansion-panel-content",3,"id"],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(r,n){r&1&&(Pi(HDe),Ot(0),Z(1,"div",2,0)(3,"div",3,1)(5,"div",4),Ot(6,1),je(7,GDe,0,0,"ng-template",5),Q(),Ot(8,2),Q()()),r&2&&(oe(),Mt("inert",n.expanded?null:""),oe(2),Re("id",n.id),Mt("aria-labelledby",n._headerId),oe(4),Re("cdkPortalOutlet",n._portal))},dependencies:[rc],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;overflow:hidden;position:relative;background:var(--mat-expansion-container-background-color, var(--mat-sys-surface));color:var(--mat-expansion-container-text-color, var(--mat-sys-on-surface));border-radius:var(--mat-expansion-container-shape, 12px)}.mat-expansion-panel.mat-expansion-panel-animations-enabled{transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel: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)}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:var(--mat-expansion-container-shape, 12px);border-top-left-radius:var(--mat-expansion-container-shape, 12px)}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:var(--mat-expansion-container-shape, 12px);border-bottom-left-radius:var(--mat-expansion-container-shape, 12px)}@media(forced-colors: active){.mat-expansion-panel{outline:solid 1px}}.mat-expansion-panel-content-wrapper{display:grid;grid-template-rows:0fr;grid-template-columns:100%}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content-wrapper{transition:grid-template-rows 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{grid-template-rows:1fr}@supports not (grid-template-rows: 0fr){.mat-expansion-panel-content-wrapper{height:0}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{height:auto}}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible;min-height:0;visibility:hidden;font-family:var(--mat-expansion-container-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-expansion-container-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-expansion-container-text-weight, var(--mat-sys-body-large-weight));line-height:var(--mat-expansion-container-text-line-height, var(--mat-sys-body-large-line-height));letter-spacing:var(--mat-expansion-container-text-tracking, var(--mat-sys-body-large-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content{transition:visibility 190ms linear}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper>.mat-expansion-panel-content{visibility:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px;border-top-color:var(--mat-expansion-actions-divider-color, var(--mat-sys-outline))}.mat-action-row .mat-button-base,.mat-action-row .mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row .mat-button-base,[dir=rtl] .mat-action-row .mat-mdc-button-base{margin-left:0;margin-right:8px}"],encapsulation:2,changeDetection:0})}return i})();var Zm=(()=>{class i{panel=te(qm,{host:!0});_element=te(Et);_focusMonitor=te(In);_changeDetectorRef=te(_i);_parentChangeSubscription=tr.EMPTY;constructor(){te(ar).load(kn);let t=this.panel,r=te(mX,{optional:!0}),n=te(new Ma("tabindex"),{optional:!0}),a=t.accordion?t.accordion._stateChanges.pipe(Yi(o=>!!(o.hideToggle||o.togglePosition))):Oo;this.tabIndex=parseInt(n||"")||0,this._parentChangeSubscription=vr(t.opened,t.closed,a,t._inputChanges.pipe(Yi(o=>!!(o.hideToggle||o.disabled||o.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Yi(()=>t._containsFocus())).subscribe(()=>this._focusMonitor.focusVia(this._element,"program")),r&&(this.expandedHeight=r.expandedHeight,this.collapsedHeight=r.collapsedHeight)}expandedHeight;collapsedHeight;tabIndex=0;get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){let t=this._isExpanded();return t&&this.expandedHeight?this.expandedHeight:!t&&this.collapsedHeight?this.collapsedHeight:null}_keydown(t){switch(t.keyCode){case 32:case 13:Hr(t)||(t.preventDefault(),this._toggle());break;default:this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t);return}}focus(t,r){t?this._focusMonitor.focusVia(this._element,t,r):this._element.nativeElement.focus(r)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(t=>{t&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}static \u0275fac=function(r){return new(r||i)};static \u0275cmp=tt({type:i,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:13,hostBindings:function(r,n){r&1&&Le("click",function(){return n._toggle()})("keydown",function(o){return n._keydown(o)}),r&2&&(Mt("id",n.panel._headerId)("tabindex",n.disabled?-1:n.tabIndex)("aria-controls",n._getPanelId())("aria-expanded",n._isExpanded())("aria-disabled",n.panel.disabled),yr("height",n._getHeaderHeight()),gt("mat-expanded",n._isExpanded())("mat-expansion-toggle-indicator-after",n._getTogglePosition()==="after")("mat-expansion-toggle-indicator-before",n._getTogglePosition()==="before"))},inputs:{expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight",tabIndex:[2,"tabIndex","tabIndex",t=>t==null?0:lr(t)]},features:[si],ngContentSelectors:KDe,decls:5,vars:3,consts:[[1,"mat-content"],[1,"mat-expansion-indicator"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 -960 960 960","aria-hidden","true","focusable","false"],["d","M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"]],template:function(r,n){r&1&&(Pi(VDe),Z(0,"span",0),Ot(1),Ot(2,1),Ot(3,2),Q(),je(4,WDe,3,0,"span",1)),r&2&&(gt("mat-content-hide-toggle",!n._showToggle()),oe(4),Je(n._showToggle()?4:-1))},styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;height:var(--mat-expansion-header-collapsed-state-height, 48px);font-family:var(--mat-expansion-header-text-font, var(--mat-sys-title-medium-font));font-size:var(--mat-expansion-header-text-size, var(--mat-sys-title-medium-size));font-weight:var(--mat-expansion-header-text-weight, var(--mat-sys-title-medium-weight));line-height:var(--mat-expansion-header-text-line-height, var(--mat-sys-title-medium-line-height));letter-spacing:var(--mat-expansion-header-text-tracking, var(--mat-sys-title-medium-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-header{transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header::before{border-radius:inherit}.mat-expansion-panel-header.mat-expanded{height:var(--mat-expansion-header-expanded-state-height, 64px)}.mat-expansion-panel-header[aria-disabled=true]{color:var(--mat-expansion-header-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-header-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}@media(hover: none){.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-container-background-color, var(--mat-sys-surface))}}.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-keyboard-focused,.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-program-focused{background:var(--mat-expansion-header-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-content.mat-content-hide-toggle{margin-right:8px}[dir=rtl] .mat-content.mat-content-hide-toggle{margin-right:0;margin-left:8px}.mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-left:24px;margin-right:0}[dir=rtl] .mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-right:24px;margin-left:0}.mat-expansion-panel-header-title{color:var(--mat-expansion-header-text-color, var(--mat-sys-on-surface))}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;flex-basis:0;margin-right:16px;align-items:center}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-title,.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-description{color:inherit}.mat-expansion-panel-header-description{flex-grow:2;color:var(--mat-expansion-header-description-color, var(--mat-sys-on-surface-variant))}.mat-expansion-panel-animations-enabled .mat-expansion-indicator{transition:transform 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header.mat-expanded .mat-expansion-indicator{transform:rotate(180deg)}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle;color:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-legacy-header-indicator-display, none)}.mat-expansion-indicator svg{width:24px;height:24px;margin:0 -8px;vertical-align:middle;fill:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-header-indicator-display, inline-block)}@media(forced-colors: active){.mat-expansion-panel-content{border-top:1px solid;border-top-left-radius:0;border-top-right-radius:0}}'],encapsulation:2,changeDetection:0})}return i})();var iy=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275dir=ft({type:i,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]})}return i})(),ry=(()=>{class i extends cX{_keyManager;_ownHeaders=new jc;_headers;hideToggle=!1;displayMode="default";togglePosition="after";ngAfterContentInit(){this._headers.changes.pipe(ur(this._headers)).subscribe(t=>{this._ownHeaders.reset(t.filter(r=>r.panel.accordion===this)),this._ownHeaders.notifyOnChanges()}),this._keyManager=new yh(this._ownHeaders).withWrap().withHomeAndEnd()}_handleHeaderKeydown(t){this._keyManager.onKeydown(t)}_handleHeaderFocus(t){this._keyManager.updateActiveItem(t)}ngOnDestroy(){super.ngOnDestroy(),this._keyManager?.destroy(),this._ownHeaders.destroy()}static \u0275fac=(()=>{let t;return function(n){return(t||(t=kr(i)))(n||i)}})();static \u0275dir=ft({type:i,selectors:[["mat-accordion"]],contentQueries:function(r,n,a){if(r&1&&Ki(a,Zm,5),r&2){let o;St(o=kt())&&(n._headers=o)}},hostAttrs:[1,"mat-accordion"],hostVars:2,hostBindings:function(r,n){r&2&>("mat-accordion-multi",n.multi)},inputs:{hideToggle:[2,"hideToggle","hideToggle",st],displayMode:"displayMode",togglePosition:"togglePosition"},exportAs:["matAccordion"],features:[ei([{provide:FI,useExisting:i}]),si,Ai]})}return i})(),kc=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({imports:[ti,hX,nc]})}return i})();var pX=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Lt({type:i});static \u0275inj=Dt({imports:[ti,ti]})}return i})();var yVt=go(mG());var eh=go(ny());var OUe=`attribute vec2 aVertexPosition;
|