2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								import  { Conversion ,  DesugaringContext ,  DesugaringStep ,  Fuse ,  OnEvery ,  OnEveryConcat ,  SetDefault }  from  "./Conversion" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  { LayoutConfigJson }  from  "../Json/LayoutConfigJson" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  { PrepareLayer }  from  "./PrepareLayer" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  { LayerConfigJson }  from  "../Json/LayerConfigJson" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  { Utils }  from  "../../../Utils" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  Constants  from  "../../Constants" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  { AllKnownLayouts }  from  "../../../Customizations/AllKnownLayouts" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  CreateNoteImportLayer  from  "./CreateNoteImportLayer" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  LayerConfig  from  "../LayerConfig" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  { TagRenderingConfigJson }  from  "../Json/TagRenderingConfigJson" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  { SubstitutedTranslation }  from  "../../../UI/SubstitutedTranslation" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  DependencyCalculator  from  "../DependencyCalculator" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  SubstituteLayer  extends  Conversion < ( string  |  LayerConfigJson ) ,  LayerConfigJson [ ] >  {  
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    private  readonly  _state : DesugaringContext ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    constructor ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        state : DesugaringContext , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-17 23:54:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        super ( "Converts the identifier of a builtin layer into the actual layer, or converts a 'builtin' syntax with override in the fully expanded form" ,  [ ] , "SubstituteLayer" ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . _state  =  state ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 00:44:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 23:16:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    convert ( json : string  |  LayerConfigJson ,  context : string ) :  {  result : LayerConfigJson [ ] ;  errors : string [ ] ,  information? : string [ ]  }  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        const  errors  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 23:16:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  information  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 02:23:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								         const  state =  this . _state 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 00:44:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        function  reportNotFound ( name : string ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            const  knownLayers  =  Array . from ( state . sharedLayers . keys ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            const  withDistance  =  knownLayers . map ( lname  = >  [ lname ,   Utils . levenshteinDistance ( name ,  lname ) ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            withDistance . sort ( ( a ,  b )  = >  a [ 1 ]  -  b [ 1 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            const  ids  =  withDistance . map ( n  = >  n [ 0 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           // Known builtin layers are "+.join(",")+"\n    For more information, see "
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            errors . push ( ` ${ context } : The layer with name  ${ name }  was not found as a builtin layer. Perhaps you meant  ${ ids [ 0 ] } ,  ${ ids [ 1 ] }  or  ${ ids [ 2 ] } ?
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 For  an  overview  of  all  available  layers ,  refer  to  https : //github.com/pietervdvn/MapComplete/blob/develop/Docs/BuiltinLayers.md`)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        if  ( typeof  json  ===  "string" )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            const  found  =  state . sharedLayers . get ( json ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( found  ===  undefined )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 00:44:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                reportNotFound ( json ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    result : null , 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 00:44:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    errors , 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                result :  [ found ] , 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                errors 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( json [ "builtin" ]  !==  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            let  names  =  json [ "builtin" ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( typeof  names  ===  "string" )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                names  =  [ names ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            const  layers  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 02:23:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            for  ( const  name  of  names )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                const  found  =  Utils . Clone ( state . sharedLayers . get ( name ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( found  ===  undefined )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 00:44:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    reportNotFound ( name ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( json [ "override" ] [ "tagRenderings" ]  !==  undefined  &&  ( found [ "tagRenderings" ]  ? ?  [ ] ) . length  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    errors . push ( ` At  ${ context } : when overriding a layer, an override is not allowed to override into tagRenderings. Use "+tagRenderings" or "tagRenderings+" instead to prepend or append some questions. ` ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                try  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    Utils . Merge ( json [ "override" ] ,  found ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    layers . push ( found ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                }  catch  ( e )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    errors . push ( ` At  ${ context } : could not apply an override due to:  ${ e } . \ nThe override is:  ${ JSON . stringify ( json [ "override" ] , ) } ` ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 02:23:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if ( json [ "hideTagRenderingsWithLabels" ] ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  hideLabels : Set < string >  =  new  Set ( json [ "hideTagRenderingsWithLabels" ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    // These labels caused at least one deletion
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  usedLabels  : Set < string >  =  new  Set < string > ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  filtered  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    for  ( const  tr  of  found . tagRenderings )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        const  labels  =  tr [ "labels" ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        if ( labels  !==  undefined ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            const  forbiddenLabel  =  labels . findIndex ( l  = >  hideLabels . has ( l ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            if ( forbiddenLabel  >=  0 ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                usedLabels . add ( labels [ forbiddenLabel ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 23:16:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                information . push ( context + ": Dropping tagRendering " + tr [ "id" ] + " as it has a forbidden label: " + labels [ forbiddenLabel ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 02:23:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        if ( hideLabels . has ( tr [ "id" ] ) ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            usedLabels . add ( tr [ "id" ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 23:16:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            information . push ( context + ": Dropping tagRendering " + tr [ "id" ] + " as its id is a forbidden label" ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 02:23:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        if ( hideLabels . has ( tr [ "group" ] ) ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            usedLabels . add ( tr [ "group" ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 23:16:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            information . push ( context + ": Dropping tagRendering " + tr [ "id" ] + " as its group `" + tr [ "group" ] + "` is a forbidden label" ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 02:23:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        filtered . push ( tr ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  unused  =  Array . from ( hideLabels ) . filter ( l  = >  ! usedLabels . has ( l ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if ( unused . length  >  0 ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        errors . push ( "This theme specifies that certain tagrenderings have to be removed based on forbidden layers. One or more of these layers did not match any tagRenderings and caused no deletions: " + unused . join ( ", " ) + "\n   This means that this label can be removed or that the original tagRendering that should be deleted does not have this label anymore" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    found . tagRenderings  =  filtered 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                result : layers , 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 02:23:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                errors , 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 23:16:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                information 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            result :  [ json ] , 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            errors 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  AddDefaultLayers  extends  DesugaringStep < LayoutConfigJson >  {  
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    private  _state : DesugaringContext ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    constructor ( state : DesugaringContext )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-14 02:26:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        super ( "Adds the default layers, namely: "  +  Constants . added_by_default . join ( ", " ) ,  [ "layers" ] , "AddDefaultLayers" ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . _state  =  state ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    convert ( json : LayoutConfigJson ,  context : string ) :  {  result : LayoutConfigJson ;  errors : string [ ] ;  warnings : string [ ]  }  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        const  errors  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  warnings  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  state  =  this . _state 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        json . layers  =  [ . . . json . layers ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-31 14:34:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  alreadyLoaded  =  new  Set ( json . layers . map ( l  = >  l [ "id" ] ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  ( const  layerName  of  Constants . added_by_default )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            const  v  =  state . sharedLayers . get ( layerName ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( v  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                errors . push ( "Default layer "  +  layerName  +  " not found" ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-18 13:04:12 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                continue 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-31 14:34:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if ( alreadyLoaded . has ( v . id ) ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                warnings . push ( "Layout " + context + " already has a layer with name " + v . id + "; skipping inclusion of this builtin layer" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            json . layers . push ( v ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            result : json , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            errors , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            warnings 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  AddImportLayers  extends  DesugaringStep < LayoutConfigJson >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    constructor ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-14 02:26:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        super ( "For every layer in the 'layers'-list, create a new layer which'll import notes. (Note that priviliged layers and layers which have a geojson-source set are ignored)" ,  [ "layers" ] , "AddImportLayers" ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 23:16:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    convert ( json : LayoutConfigJson ,  context : string ) :  {  result : LayoutConfigJson ;  errors : string [ ]  }  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        const  errors  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-26 21:40:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        json  =  { . . . json } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  allLayers : LayerConfigJson [ ]  =  < LayerConfigJson [ ] > json . layers ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        json . layers  =  [ . . . json . layers ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-26 21:40:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-31 14:34:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if ( json . enableNoteImports  ? ?  true )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            const  creator  =  new  CreateNoteImportLayer ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  ( let  i1  =  0 ;  i1  <  allLayers . length ;  i1 ++ )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                const  layer  =  allLayers [ i1 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( Constants . priviliged_layers . indexOf ( layer . id )  >=  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    // Priviliged layers are skipped
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-31 14:34:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  ( layer . source [ "geoJson" ]  !==  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    // Layer which don't get their data from OSM are skipped
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-31 14:34:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  ( layer . title  ===  undefined  ||  layer . name  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    // Anonymous layers and layers without popup are skipped
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-31 14:34:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  ( layer . presets  ===  undefined  ||  layer . presets . length  ==  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    // A preset is needed to be able to generate a new point
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    continue ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-31 14:34:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                try  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  importLayerResult  =  creator . convert ( layer ,  context  +  ".(noteimportlayer)["  +  i1  +  "]" ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-31 14:34:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    if  ( importLayerResult . result  !==  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        json . layers . push ( importLayerResult . result ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                }  catch  ( e )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    errors . push ( "Could not generate an import-layer for "  +  layer . id  +  " due to "  +  e ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            errors , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            result : json 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-26 21:12:25 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-26 21:21:12 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								export  class  AddMiniMap  extends  DesugaringStep < LayerConfigJson >  {  
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    private  readonly  _state : DesugaringContext ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    constructor ( state : DesugaringContext ,  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-14 02:26:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        super ( "Adds a default 'minimap'-element to the tagrenderings if none of the elements define such a minimap" ,  [ "tagRenderings" ] , "AddMiniMap" ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . _state  =  state ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    / * * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  Returns  true  if  this  tag  rendering  has  a  minimap  in  some  language . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  Note : this  minimap  can  be  hidden  by  conditions 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-23 19:48:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								     *  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  AddMiniMap . hasMinimap ( { render :  "{minimap()}" } )  // => true
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  AddMiniMap . hasMinimap ( { render :  { en :  "{minimap()}" } } )  // => true
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  AddMiniMap . hasMinimap ( { render :  { en :  "{minimap()}" ,  nl :  "{minimap()}" } } )  // => true
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  AddMiniMap . hasMinimap ( { render :  { en :  "{minimap()}" ,  nl :  "No map for the dutch!" } } )  // => true
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  AddMiniMap . hasMinimap ( { render :  "{minimap()}" } )  // => true
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  AddMiniMap . hasMinimap ( { render :  "{minimap(18,featurelist)}" } )  // => true
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  AddMiniMap . hasMinimap ( { mappings :  [ { if :  "xyz=abc" , then :  "{minimap(18,featurelist)}" } ] } )  // => true
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  AddMiniMap . hasMinimap ( { render :  "Some random value {key}" } )  // => false
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  AddMiniMap . hasMinimap ( { render :  "Some random value {minimap}" } )  // => false
 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								     * / 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-26 21:21:12 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    static  hasMinimap ( renderingConfig : TagRenderingConfigJson ) :  boolean  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  translations : any [ ]  =  Utils . NoNull ( [ renderingConfig . render ,  . . . ( renderingConfig . mappings  ? ?  [ ] ) . map ( m  = >  m . then ) ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  ( let  translation  of  translations )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-26 21:40:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( typeof  translation  ==  "string" )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-26 21:21:12 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                translation  =  { "*" :  translation } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-26 21:40:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-26 21:21:12 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            for  ( const  key  in  translation )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( ! translation . hasOwnProperty ( key ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-26 21:21:12 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                const  template  =  translation [ key ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                const  parts  =  SubstitutedTranslation . ExtractSpecialComponents ( template ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                const  hasMiniMap  =  parts . filter ( part  = >  part . special  !==  undefined ) . some ( special  = >  special . special . func . funcName  ===  "minimap" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( hasMiniMap )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    return  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 23:16:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    convert ( layerConfig : LayerConfigJson ,  context : string ) :  {  result : LayerConfigJson  }  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  state  =  this . _state ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        const  hasMinimap  =  layerConfig . tagRenderings ? . some ( tr  = >  AddMiniMap . hasMinimap ( < TagRenderingConfigJson > tr ) )  ? ?  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( ! hasMinimap )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            layerConfig  =  { . . . layerConfig } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            layerConfig . tagRenderings  =  [ . . . layerConfig . tagRenderings ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-26 20:47:08 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            layerConfig . tagRenderings . push ( state . tagRenderings . get ( "questions" ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            layerConfig . tagRenderings . push ( state . tagRenderings . get ( "minimap" ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            result : layerConfig 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-24 00:59:23 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  ApplyOverrideAll  extends  DesugaringStep < LayoutConfigJson >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    constructor ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-14 02:26:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        super ( "Applies 'overrideAll' onto every 'layer'. The 'overrideAll'-field is removed afterwards" ,  [ "overrideAll" ,  "layers" ] , "ApplyOverrideAll" ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-24 00:59:23 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    convert ( json : LayoutConfigJson ,  context : string ) :  {  result : LayoutConfigJson ;  errors : string [ ] ;  warnings : string [ ]  }  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-24 00:59:23 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  overrideAll  =  json . overrideAll ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( overrideAll  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return  { result : json ,  warnings :  [ ] ,  errors :  [ ] } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        json  =  { . . . json } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        delete  json . overrideAll 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  newLayers  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  ( let  layer  of  json . layers )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-24 03:48:28 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            layer  =  Utils . Clone ( < LayerConfigJson > layer ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-24 00:59:23 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            Utils . Merge ( overrideAll ,  layer ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            newLayers . push ( layer ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        json . layers  =  newLayers 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  { result : json ,  warnings :  [ ] ,  errors :  [ ] } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								class  AddDependencyLayersToTheme  extends  DesugaringStep < LayoutConfigJson >  {  
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    private  readonly  _state : DesugaringContext ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    constructor ( state : DesugaringContext ,  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-14 02:26:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        super ( "If a layer has a dependency on another layer, these layers are added automatically on the theme. (For example: defibrillator depends on 'walls_and_buildings' to snap onto. This layer is added automatically)" ,  [ "layers" ] , "AddDependencyLayersToTheme" ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . _state  =  state ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    private  static  CalculateDependencies ( alreadyLoaded : LayerConfigJson [ ] ,  allKnownLayers : Map < string ,  LayerConfigJson > ,  themeId : string ) :  LayerConfigJson [ ]  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dependenciesToAdd : LayerConfigJson [ ]  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  loadedLayerIds : Set < string >  =  new  Set < string > ( alreadyLoaded . map ( l  = >  l . id ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        // Verify cross-dependencies
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        let  unmetDependencies :  {  neededLayer : string ,  neededBy : string ,  reason : string ,  context? : string  } [ ]  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        do  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            const  dependencies :  {  neededLayer : string ,  reason : string ,  context? : string ,  neededBy : string  } [ ]  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  ( const  layerConfig  of  alreadyLoaded )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                const  layerDeps  =  DependencyCalculator . getLayerDependencies ( new  LayerConfig ( layerConfig ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                dependencies . push ( . . . layerDeps ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-07 01:59:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            for  ( const  dependency  of  dependencies )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if ( loadedLayerIds . has ( dependency . neededLayer ) ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    // We mark the needed layer as 'mustLoad'
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    alreadyLoaded . find ( l  = >  l . id  ===  dependency . neededLayer ) . forceLoad  =  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            // During the generate script, builtin layers are verified but not loaded - so we have to add them manually here
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            // Their existance is checked elsewhere, so this is fine
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            unmetDependencies  =  dependencies . filter ( dep  = >  ! loadedLayerIds . has ( dep . neededLayer ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  ( const  unmetDependency  of  unmetDependencies )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( loadedLayerIds . has ( unmetDependency . neededLayer ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                const  dep  =  allKnownLayers . get ( unmetDependency . neededLayer ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( dep  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  message  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        [ "Loading a dependency failed: layer "  +  unmetDependency . neededLayer  +  " is not found, neither as layer of "  +  themeId  +  " nor as builtin layer." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            "This layer is needed by "  +  unmetDependency . neededBy , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            unmetDependency . reason  +  " (at "  +  unmetDependency . context  +  ")" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            "Loaded layers are: "  +  alreadyLoaded . map ( l  = >  l . id ) . join ( "," ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    throw  message . join ( "\n\t" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                dependenciesToAdd . unshift ( dep ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                loadedLayerIds . add ( dep . id ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                unmetDependencies  =  unmetDependencies . filter ( d  = >  d . neededLayer  !==  unmetDependency . neededLayer ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        }  while  ( unmetDependencies . length  >  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-07 01:59:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  dependenciesToAdd . map ( dep  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            dep  =  Utils . Clone ( dep ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            dep . forceLoad  =  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return  dep 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 23:16:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    convert ( theme : LayoutConfigJson ,  context : string ) :  {  result : LayoutConfigJson ;  information : string [ ]  }  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  state  =  this . _state 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        const  allKnownLayers : Map < string ,  LayerConfigJson >  =  state . sharedLayers ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  knownTagRenderings : Map < string ,  TagRenderingConfigJson >  =  state . tagRenderings ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 23:16:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  information  =  [ ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        const  layers : LayerConfigJson [ ]  =  < LayerConfigJson [ ] > theme . layers ;  // Layers should be expanded at this point
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        knownTagRenderings . forEach ( ( value ,  key )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            value . id  =  key ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  dependencies  =  AddDependencyLayersToTheme . CalculateDependencies ( layers ,  allKnownLayers ,  theme . id ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( dependencies . length  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 23:16:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            information . push ( context  +  ": added "  +  dependencies . map ( d  = >  d . id ) . join ( ", " )  +  " to the theme as they are needed" ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        layers . unshift ( . . . dependencies ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            result :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                . . . theme , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                layers : layers 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } , 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-10 23:16:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            information 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-14 15:41:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								class  PreparePersonalTheme  extends  DesugaringStep < LayoutConfigJson >  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    private  readonly  _state : DesugaringContext ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    constructor ( state : DesugaringContext )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        super ( "Adds every public layer to the personal theme" , [ "layers" ] , "PreparePersonalTheme" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . _state  =  state ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    convert ( json : LayoutConfigJson ,  context : string ) :  {  result : LayoutConfigJson ;  errors? : string [ ] ;  warnings? : string [ ] ;  information? : string [ ]  }  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if ( json . id  !==  "personal" ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return  { result : json } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        
							 
						 
					
						
							
								
									
										
										
										
											2022-02-16 01:27:36 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        json . layers  =  Array . from ( this . _state . sharedLayers . keys ( ) ) . filter ( l  = >  Constants . priviliged_layers . indexOf ( l )  <  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-14 15:41:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        return  { result : json } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-03-24 19:59:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								class  WarnForUnsubstitutedLayersInTheme  extends  DesugaringStep < LayoutConfigJson > {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    constructor ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        super ( "Generates a warning if a theme uses an unsubstituted layer" ,  [ "layers" ] , "WarnForUnsubstitutedLayersInTheme" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    convert ( json : LayoutConfigJson ,  context : string ) :  {  result : LayoutConfigJson ;  errors? : string [ ] ;  warnings? : string [ ] ;  information? : string [ ]  }  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if ( json . hideFromOverview  ===  true ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return  { result : json } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  warnings  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  ( const  layer  of  json . layers )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if ( typeof  layer  ===  "string" ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if ( layer [ "builtin" ]  !==  undefined ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if ( layer [ "source" ] [ "geojson" ]  !==  undefined ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                // We turn a blind eye for import layers
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            const  wrn  =  "The theme " + json . id + " has an inline layer: " + layer [ "id" ] + ". This is discouraged." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            warnings . push ( wrn ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            result : json , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            warnings 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								export  class  PrepareTheme  extends  Fuse < LayoutConfigJson >  {  
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    constructor ( state : DesugaringContext )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        super ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "Fully prepares and expands a theme" , 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-14 15:41:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            new  PreparePersonalTheme ( state ) , 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-24 19:59:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            // new WarnForUnsubstitutedLayersInTheme(),
 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            new  OnEveryConcat ( "layers" ,  new  SubstituteLayer ( state ) ) , 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            new  SetDefault ( "socialImage" ,  "assets/SocialImage.png" ,  true ) , 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-18 23:10:27 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            // We expand all tagrenderings first...
 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            new  OnEvery ( "layers" ,  new  PrepareLayer ( state ) ) , 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-18 23:10:27 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            // Then we apply the override all
 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-24 00:59:23 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            new  ApplyOverrideAll ( ) , 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-18 23:10:27 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            // And then we prepare all the layers _again_ in case that an override all contained unexpanded tagrenderings!
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            new  OnEvery ( "layers" ,  new  PrepareLayer ( state ) ) , 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            new  AddDefaultLayers ( state ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            new  AddDependencyLayersToTheme ( state ) , 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            new  AddImportLayers ( ) , 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-04 01:05:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            new  OnEvery ( "layers" ,  new  AddMiniMap ( state ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 01:57:16 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}