2020-10-09 20:10:21 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								import  { UIEventSource }  from  "../Logic/UIEventSource" ;  
						 
					
						
							
								
									
										
										
										
											2020-10-12 01:25:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { VariableUiElement }  from  "./Base/VariableUIElement" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  LiveQueryHandler  from  "../Logic/Web/LiveQueryHandler" ;  
						 
					
						
							
								
									
										
										
										
											2020-10-14 12:15:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { ImageCarousel }  from  "./Image/ImageCarousel" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  Combine  from  "./Base/Combine" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  { FixedUiElement }  from  "./Base/FixedUiElement" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  { ImageUploadFlow }  from  "./Image/ImageUploadFlow" ;  
						 
					
						
							
								
									
										
										
										
											2021-01-04 04:06:21 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  ShareButton  from  "./BigComponents/ShareButton" ;  
						 
					
						
							
								
									
										
										
										
											2020-11-22 03:50:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  Svg  from  "../Svg" ;  
						 
					
						
							
								
									
										
										
										
											2020-12-08 23:44:34 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  ReviewElement  from  "./Reviews/ReviewElement" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  MangroveReviews  from  "../Logic/Web/MangroveReviews" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  Translations  from  "./i18n/Translations" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  ReviewForm  from  "./Reviews/ReviewForm" ;  
						 
					
						
							
								
									
										
										
										
											2021-06-16 14:23:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  OpeningHoursVisualization  from  "./OpeningHours/OpeningHoursVisualization" ;  
						 
					
						
							
								
									
										
										
										
											2021-01-03 13:50:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  State  from  "../State" ;  
						 
					
						
							
								
									
										
										
										
											2021-06-11 22:51:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  BaseUIElement  from  "./BaseUIElement" ;  
						 
					
						
							
								
									
										
										
										
											2021-06-21 00:19:19 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  Title  from  "./Base/Title" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  Table  from  "./Base/Table" ;  
						 
					
						
							
								
									
										
										
										
											2021-06-21 03:13:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  Histogram  from  "./BigComponents/Histogram" ;  
						 
					
						
							
								
									
										
										
										
											2021-06-23 02:15:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  Loc  from  "../Models/Loc" ;  
						 
					
						
							
								
									
										
										
										
											2021-06-24 01:17:29 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  { Utils }  from  "../Utils" ;  
						 
					
						
							
								
									
										
										
										
											2021-08-07 23:11:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  LayerConfig  from  "../Models/ThemeConfig/LayerConfig" ;  
						 
					
						
							
								
									
										
										
										
											2021-09-18 02:31:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  ImportButton  from  "./BigComponents/ImportButton" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  { Tag }  from  "../Logic/Tags/Tag" ;  
						 
					
						
							
								
									
										
										
										
											2021-09-21 02:10:42 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  StaticFeatureSource  from  "../Logic/FeatureSource/Sources/StaticFeatureSource" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  ShowDataMultiLayer  from  "./ShowDataLayer/ShowDataMultiLayer" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  Minimap  from  "./Base/Minimap" ;  
						 
					
						
							
								
									
										
										
										
											2021-09-29 23:56:59 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  AllImageProviders  from  "../Logic/ImageProviders/AllImageProviders" ;  
						 
					
						
							
								
									
										
										
										
											2021-10-11 23:41:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  WikipediaBox  from  "./Wikipedia/WikipediaBox" ;  
						 
					
						
							
								
									
										
										
										
											2021-10-10 23:38:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  SimpleMetaTagger  from  "../Logic/SimpleMetaTagger" ;  
						 
					
						
							
								
									
										
										
										
											2021-10-12 02:12:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  MultiApply  from  "./Popup/MultiApply" ;  
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  AllKnownLayers  from  "../Customizations/AllKnownLayers" ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  ShowDataLayer  from  "./ShowDataLayer/ShowDataLayer" ;  
						 
					
						
							
								
									
										
										
										
											2021-01-03 13:50:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-01 02:43:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								export  interface  SpecialVisualization  {  
						 
					
						
							
								
									
										
										
										
											2021-06-27 19:21:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    funcName : string , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    constr :  ( ( state : State ,  tagSource : UIEventSource < any > ,  argument : string [ ] )  = >  BaseUIElement ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    docs : string , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    example? : string , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    args :  {  name : string ,  defaultValue? : string ,  doc : string  } [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-09 20:10:21 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								export  default  class  SpecialVisualizations  {  
						 
					
						
							
								
									
										
										
										
											2021-06-15 01:24:04 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-06-27 19:21:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  static  specialVisualizations : SpecialVisualization [ ]  = 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-22 03:16:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                funcName :  "all_tags" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                docs :  "Prints all key-value pairs of the object - used for debugging" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                args :  [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                constr :  ( ( state : State ,  tags : UIEventSource < any > )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-10 23:38:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  calculatedTags  =  [ ] . concat ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        SimpleMetaTagger . lazyTags , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        . . . state . layoutToUse . layers . map ( l  = >  l . calculatedTags ? . map ( c  = >  c [ 0 ] )  ? ?  [ ] ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-22 03:16:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    return  new  VariableUiElement ( tags . map ( tags  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        const  parts  =  [ ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        for  ( const  key  in  tags )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            if  ( ! tags . hasOwnProperty ( key ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-10 23:38:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                continue 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-22 03:16:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-11 23:28:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            let  v  =  tags [ key ] 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            if  ( v  ===  "" )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-11 23:28:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                v  =  "<b>empty string</b>" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            parts . push ( [ key ,  v  ? ?  "<b>undefined</b>" ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 22:51:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        for  ( const  key  of  calculatedTags )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-10 23:38:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            const  value  =  tags [ key ] 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            if  ( value  ===  undefined )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-10 23:38:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            parts . push ( [ "<i>"  +  key  +  "</i>" ,  value ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-10 23:38:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-18 21:37:14 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        return  new  Table ( 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-09 00:05:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            [ "key" ,  "value" ] , 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-18 21:37:14 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            parts 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-22 03:16:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    } ) ) . SetStyle ( "border: 1px solid black; border-radius: 1em;padding:1em;display:block;" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } , 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 12:15:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                funcName :  "image_carousel" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                docs :  "Creates an image carousel for the given sources. An attempt will be made to guess what source is used. Supported: Wikidata identifiers, Wikipedia pages, Wikimedia categories, IMGUR (with attribution, direct links)" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                args :  [ { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-06 02:30:23 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    name :  "image key/prefix (multiple values allowed if comma-seperated)" , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-20 00:19:03 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    defaultValue : AllImageProviders.defaultKeys.join ( "," ) , 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-17 02:37:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    doc :  "The keys given to the images, e.g. if <span class='literal-code'>image</span> is given, the first picture URL will be added as <span class='literal-code'>image</span>, the second as <span class='literal-code'>image:0</span>, the third as <span class='literal-code'>image:1</span>, etc... " 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-30 00:26:21 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } ] , 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-13 19:07:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                constr :  ( state : State ,  tags ,  args )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-20 00:19:03 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    let  imagePrefixes : string [ ]  =  undefined ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    if  ( args . length  >  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-20 00:19:03 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        imagePrefixes  =  [ ] . concat ( . . . args . map ( a  = >  a . split ( "," ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-06 02:30:23 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-20 00:19:03 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    return  new  ImageCarousel ( AllImageProviders . LoadImagesFor ( tags ,  imagePrefixes ) ,  tags ,  imagePrefixes ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-11 22:37:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 12:15:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                funcName :  "image_upload" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                docs :  "Creates a button where a user can upload an image to IMGUR" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                args :  [ { 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-17 02:37:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    name :  "image-key" , 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 12:15:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    doc :  "Image tag to add the URL to (or image-tag:0, image-tag:1 when multiple images are added)" , 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-17 02:37:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    defaultValue :  "image" 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } ,  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    name :  "label" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    doc :  "The text to show on the button" , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-08 04:33:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    defaultValue :  "Add image" 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 12:15:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } ] , 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-13 19:07:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                constr :  ( state : State ,  tags ,  args )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-08 04:33:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    return  new  ImageUploadFlow ( tags ,  args [ 0 ] ,  args [ 1 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 12:15:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-02 22:31:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                funcName :  "wikipedia" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                docs :  "A box showing the corresponding wikipedia article - based on the wikidata tag" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                args :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        name :  "keyToShowWikipediaFor" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        doc :  "Use the wikidata entry from this key to show the wikipedia article for" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        defaultValue :  "wikidata" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                example :  "`{wikipedia()}` is a basic example, `{wikipedia(name:etymology:wikidata)}` to show the wikipedia page of whom the feature was named after. Also remember that these can be styled, e.g. `{wikipedia():max-height: 10rem}` to limit the height" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                constr :  ( _ ,  tagsSource ,  args )  = > 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-07 22:06:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    new  VariableUiElement ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        tagsSource . map ( tags  = >  tags [ args [ 0 ] ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            . map ( wikidata  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                const  wikidatas : string [ ]  = 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-07 22:06:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                    Utils . NoEmpty ( wikidata ? . split ( ";" ) ? . map ( wd  = >  wd . trim ( ) )  ? ?  [ ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                return  new  WikipediaBox ( wikidatas ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-02 22:31:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-23 02:15:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                funcName :  "minimap" , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                docs :  "A small map showing the selected feature." , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-23 02:15:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                args :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-27 19:21:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        doc :  "The (maximum) zoomlevel: the target zoomlevel after fitting the entire feature. The minimap will fit the entire feature, then zoom out to this zoom level. The higher, the more zoomed in with 1 being the entire world and 19 being really close" , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-23 02:15:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        name :  "zoomlevel" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        defaultValue :  "18" 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-24 01:17:29 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        doc :  "(Matches all resting arguments) This argument should be the key of a property of the feature. The corresponding value is interpreted as either the id or the a list of ID's. The features with these ID's will be shown on this minimap." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        name :  "idKey" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        defaultValue :  "id" 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-23 02:15:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ] , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-24 01:17:29 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                example :  "`{minimap()}`, `{minimap(17, id, _list_of_embedded_feature_ids_calculated_by_calculated_tag):height:10rem; border: 2px solid black}`" , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-23 02:15:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                constr :  ( state ,  tagSource ,  args )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-24 01:17:29 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  keys  =  [ . . . args ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    keys . splice ( 0 ,  1 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  featureStore  =  state . allElements . ContainingFeatures 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-24 01:55:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  featuresToShow : UIEventSource < {  freshness : Date ,  feature : any  } [ ] >  =  tagSource . map ( properties  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-24 01:17:29 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        const  values : string [ ]  =  Utils . NoNull ( keys . map ( key  = >  properties [ key ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        const  features :  {  freshness : Date ,  feature : any  } [ ]  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        for  ( const  value  of  values )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            let  idList  =  [ value ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            if  ( value . startsWith ( "[" ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                // This is a list of values
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                idList  =  JSON . parse ( value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-09 00:05:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-06-24 01:17:29 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            for  ( const  id  of  idList )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                features . push ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                    freshness : new  Date ( ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                    feature : featureStore.get ( id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        return  features 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-23 02:15:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  properties  =  tagSource . data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    let  zoom  =  18 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-24 01:17:29 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    if  ( args [ 0 ] )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-23 02:15:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        const  parsed  =  Number ( args [ 0 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-24 01:17:29 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        if  ( ! isNaN ( parsed )  &&  parsed  >  0  &&  parsed  <  25 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-23 02:15:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            zoom  =  parsed ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-01 02:43:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  locationSource  =  new  UIEventSource < Loc > ( { 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-27 19:21:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        lat : Number ( properties . _lat ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        lon : Number ( properties . _lon ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        zoom : zoom 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-21 02:10:42 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  minimap  =  Minimap . createMiniMap ( 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-23 02:15:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            background : state.backgroundLayer , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-27 19:21:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            location : locationSource , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-23 02:15:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            allowMoving : false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-01 02:43:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-06-27 19:21:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    locationSource . addCallback ( loc  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-01 02:43:49 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        if  ( loc . zoom  >  zoom )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-27 19:21:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            // We zoom back
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            locationSource . data . zoom  =  zoom ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            locationSource . ping ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-23 02:15:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-02 22:31:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    new  ShowDataMultiLayer ( 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-21 02:10:42 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            leafletMap : minimap [ "leafletMap" ] , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-02 22:31:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            enablePopups : false , 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-21 02:10:42 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            zoomToFeatures : true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            layers : State.state.filteredLayers , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-15 05:20:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            features : new  StaticFeatureSource ( featuresToShow ,  true ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            allElements : State.state.allElements 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-21 02:10:42 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-23 02:15:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 23:44:34 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-06-24 01:55:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    minimap . SetStyle ( "overflow: hidden; pointer-events: none;" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    return  minimap ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                funcName :  "sided_minimap" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                docs :  "A small map showing _only one side_ the selected feature. *This features requires to have linerenderings with offset* as only linerenderings with a postive or negative offset will be shown. Note: in most cases, this map will be automatically introduced" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                args :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        doc :  "The side to show, either `left` or `right`" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        name :  "side" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                example :  "`{sided_minimap(left)}`" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                constr :  ( state ,  tagSource ,  args )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  properties  =  tagSource . data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  locationSource  =  new  UIEventSource < Loc > ( { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        lat : Number ( properties . _lat ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        lon : Number ( properties . _lon ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        zoom : 18 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  minimap  =  Minimap . createMiniMap ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            background : state.backgroundLayer , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            location : locationSource , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            allowMoving : false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  side  =  args [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  feature  =  state . allElements . ContainingFeatures . get ( tagSource . data . id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  copy  =  { . . . feature } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    copy . properties  =  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        id : side 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    new  ShowDataLayer ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            leafletMap : minimap [ "leafletMap" ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            enablePopups : false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            zoomToFeatures : true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            layerToShow : AllKnownLayers.sharedLayers.get ( "left_right_style" ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            features : new  StaticFeatureSource ( [ copy ] ,  false ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            allElements : State.state.allElements 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-06-23 02:15:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    minimap . SetStyle ( "overflow: hidden; pointer-events: none;" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    return  minimap ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } , 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 23:44:34 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                funcName :  "reviews" , 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-13 19:07:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                docs :  "Adds an overview of the mangrove-reviews of this object. Mangrove.Reviews needs - in order to identify the reviewed object - a coordinate and a name. By default, the name of the object is given, but this can be overwritten" , 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-18 02:31:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                example :  "`{reviews()}` for a vanilla review, `{reviews(name, play_forest)}` to review a play forest. If a name is known, the name will be used as identifier, otherwise 'play_forest' is used" , 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-31 22:41:52 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                args :  [ { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-13 19:07:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    name :  "subjectKey" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    defaultValue :  "name" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    doc :  "The key to use to determine the subject. If specified, the subject will be <b>tags[subjectKey]</b>" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } ,  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    name :  "fallback" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    doc :  "The identifier to use, if <i>tags[subjectKey]</i> as specified above is not available. This is effectively a fallback value" 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-31 22:41:52 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } ] , 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-13 19:07:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                constr :  ( state : State ,  tags ,  args )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 23:44:34 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  tgs  =  tags . data ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-13 19:07:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  key  =  args [ 0 ]  ? ?  "name" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    let  subject  =  tgs [ key ]  ? ?  args [ 1 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  ( subject  ===  undefined  ||  subject  ===  "" )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 23:44:34 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        return  Translations . t . reviews . name_required ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-31 21:13:16 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  mangrove  =  MangroveReviews . Get ( Number ( tgs . _lon ) ,  Number ( tgs . _lat ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        encodeURIComponent ( subject ) , 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-03 13:50:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        state . mangroveIdentity , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        state . osmConnection . _dryRun 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 23:44:34 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-14 19:21:33 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  form  =  new  ReviewForm ( ( r ,  whenDone )  = >  mangrove . AddReview ( r ,  whenDone ) ,  state . osmConnection ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 23:44:34 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    return  new  ReviewElement ( mangrove . GetSubjectUri ( ) ,  mangrove . GetReviews ( ) ,  form ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } , 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 12:15:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                funcName :  "opening_hours_table" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                docs :  "Creates an opening-hours table. Usage: {opening_hours_table(opening_hours)} to create a table of the tag 'opening_hours'." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                args :  [ { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    name :  "key" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    defaultValue :  "opening_hours" , 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-17 02:37:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    doc :  "The tagkey from which the table is constructed." 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 12:15:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } ] , 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-13 19:07:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                constr :  ( state : State ,  tagSource : UIEventSource < any > ,  args )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-16 14:23:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    return  new  OpeningHoursVisualization ( tagSource ,  args [ 0 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-14 12:15:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } , 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-12 01:25:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                funcName :  "live" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                docs :  "Downloads a JSON from the given URL, e.g. '{live(example.org/data.json, shorthand:x.y.z, other:a.b.c, shorthand)}' will download the given file, will create an object {shorthand: json[x][y][z], other: json[a][b][c] out of it and will return 'other' or 'json[a][b][c]. This is made to use in combination with tags, e.g. {live({url}, {url:format}, needed_value)}" , 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-17 02:37:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                example :  "{live({url},{url:format},hour)} {live(https://data.mobility.brussels/bike/api/counts/?request=live&featureID=CB2105,hour:data.hour_cnt;day:data.day_cnt;year:data.year_cnt,hour)}" , 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-12 01:25:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                args :  [ { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    name :  "Url" ,  doc :  "The URL to load" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } ,  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    name :  "Shorthands" , 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-19 18:30:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    doc :  "A list of shorthands, of the format 'shorthandname:path.path.path'. separated by ;" 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-12 01:25:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } ,  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    name :  "path" ,  doc :  "The path (or shorthand) that should be returned" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } ] , 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-13 19:07:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                constr :  ( state : State ,  tagSource : UIEventSource < any > ,  args )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-12 01:25:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  url  =  args [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  shorthands  =  args [ 1 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  neededValue  =  args [ 2 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  source  =  LiveQueryHandler . FetchLiveData ( url ,  shorthands . split ( ";" ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    return  new  VariableUiElement ( source . map ( data  = >  data [ neededValue ]  ? ?  "Loading..." ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-19 12:08:42 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-20 03:09:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                funcName :  "histogram" , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-21 03:13:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                docs :  "Create a histogram for a list of given values, read from the properties." , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-20 03:09:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                example :  "`{histogram('some_key')}` with properties being `{some_key: ['a','b','a','c']} to create a histogram" , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-21 03:13:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                args :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-20 03:09:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        name :  "key" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        doc :  "The key to be read and to generate a histogram from" 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-21 03:13:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        name :  "title" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        doc :  "The text to put above the given values column" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        defaultValue :  "" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        name :  "countHeader" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        doc :  "The text to put above the counts" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        defaultValue :  "" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-24 01:17:29 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        name :  "colors*" , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-21 03:13:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        doc :  "(Matches all resting arguments - optional) Matches a regex onto a color value, e.g. `3[a-zA-Z+-]*:#33cc33`" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-06-20 03:09:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ] , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-21 03:13:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                constr :  ( state : State ,  tagSource : UIEventSource < any > ,  args : string [ ] )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-20 03:09:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-06-21 03:13:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    let  assignColors  =  undefined ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  ( args . length  >=  3 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        const  colors  =  [ . . . args ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        colors . splice ( 0 ,  3 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        const  mapping  =  colors . map ( c  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            const  splitted  =  c . split ( ":" ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            const  value  =  splitted . pop ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            const  regex  =  splitted . join ( ":" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            return  { regex :  "^"  +  regex  +  "$" ,  color : value } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        assignColors  =  ( key )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            for  ( const  kv  of  mapping )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                if  ( key . match ( kv . regex )  !==  null )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                    return  kv . color 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-20 03:09:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                } 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-21 03:13:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            return  undefined 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  listSource : UIEventSource < string [ ] >  =  tagSource 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        . map ( tags  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            try  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                const  value  =  tags [ args [ 0 ] ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                if  ( value  ===  ""  ||  value  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                    return  undefined 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-20 03:09:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                } 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-21 03:13:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                return  JSON . parse ( value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            }  catch  ( e )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                console . error ( "Could not load histogram: parsing  of the list failed: " ,  e ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                return  undefined ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-20 03:09:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-21 03:13:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    return  new  Histogram ( listSource ,  args [ 1 ] ,  args [ 2 ] ,  assignColors ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-20 03:09:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } , 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-21 16:44:48 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                funcName :  "share_link" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                docs :  "Creates a link that (attempts to) open the native 'share'-screen" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                example :  "{share_link()} to share the current page, {share_link(<some_url>)} to share the given url" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                args :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        name :  "url" , 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-13 19:07:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        doc :  "The url to share (default: current URL)" , 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-21 16:44:48 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ] , 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-13 19:07:38 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                constr :  ( state : State ,  tagSource : UIEventSource < any > ,  args )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-24 12:52:01 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    if  ( window . navigator . share )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-15 01:24:04 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        const  generateShareData  =  ( )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-09-28 18:00:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            const  title  =  state ? . layoutToUse ? . title ? . txt  ? ?  "MapComplete" ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-15 01:24:04 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            let  matchingLayer : LayerConfig  =  undefined ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-28 18:00:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            for  ( const  layer  of  ( state ? . layoutToUse ? . layers  ? ?  [ ] ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-15 01:24:04 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                if  ( layer . source . osmTags . matchesProperties ( tagSource ? . data ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                    matchingLayer  =  layer 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            let  name  =  matchingLayer ? . title ? . GetRenderValue ( tagSource . data ) ? . txt  ? ?  tagSource . data ? . name  ? ?  "POI" ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            if  ( name )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                name  =  ` ${ name }  ( ${ title } ) ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                name  =  title ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            let  url  =  args [ 0 ]  ? ?  "" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            if  ( url  ===  "" )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                url  =  window . location . href 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            return  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                title : name , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                url : url , 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-28 18:00:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                text : state?.layoutToUse?.shortDescription?.txt  ? ?  "MapComplete" 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-15 01:24:04 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-23 12:54:10 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-15 01:24:04 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-06-22 03:16:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        return  new  ShareButton ( Svg . share_svg ( ) . SetClass ( "w-8 h-8" ) ,  generateShareData ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-21 16:44:48 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-23 02:55:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        return  new  FixedUiElement ( "" ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-21 16:44:48 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-17 16:29:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-21 16:44:48 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-22 03:16:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-24 01:55:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                funcName :  "canonical" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                docs :  "Converts a short, canonical value into the long, translated text" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                example :  "{canonical(length)} will give 42 metre (in french)" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                args :  [ { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    name :  "key" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    doc :  "The key of the tag to give the canonical text for" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                constr :  ( state ,  tagSource ,  args )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  key  =  args  [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    return  new  VariableUiElement ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        tagSource . map ( tags  = >  tags [ key ] ) . map ( value  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-02 22:31:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            if  ( value  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                return  undefined 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            const  allUnits  =  [ ] . concat ( . . . state . layoutToUse . layers . map ( lyr  = >  lyr . units ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            const  unit  =  allUnits . filter ( unit  = >  unit . isApplicableToKey ( key ) ) [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            if  ( unit  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                return  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            return  unit . asHumanLongValue ( value ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-24 01:55:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-02 22:31:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        } ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-24 01:55:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-18 02:31:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                funcName :  "import_button" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                args :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        name :  "tags" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        doc :  "Tags to copy-specification. This contains one or more pairs (seperated by a `;`), e.g. `amenity=fast_food; addr:housenumber=$number`. This new point will then have the tags `amenity=fast_food` and `addr:housenumber` with the value that was saved in `number` in the original feature. (Hint: prepare these values, e.g. with calculatedTags)" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        name :  "text" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        doc :  "The text to show on the button" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        defaultValue :  "Import this data into OpenStreetMap" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        name :  "icon" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        doc :  "A nice icon to show in the button" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        defaultValue :  "./assets/svg/addSmall.svg" 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-08 15:11:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    } , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        name :  "minzoom" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        doc :  "How far the contributor must zoom in before being able to import the point" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        defaultValue :  "18" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } ] , 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-18 02:31:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                docs :  ` This button will copy the data from an external dataset into OpenStreetMap. It is only functional in official themes but can be tested in unofficial themes.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								If  you  want  to  import  a  dataset ,  make  sure  that :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								1 .  The  dataset  to  import  has  a  suitable  license  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								2 .  The  community  has  been  informed  of  the  import  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								3 .  All  other  requirements  of  the  [ import  guidelines ] ( https : //wiki.openstreetmap.org/wiki/Import/Guidelines) have been followed
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								There  are  also  some  technicalities  in  your  theme  to  keep  in  mind :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								1 .  The  new  point  will  be  added  and  will  flow  through  the  program  as  any  other  new  point  as  if  it  came  from  OSM .  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    This  means  that  there  should  be  a  layer  which  will  match  the  new  tags  and  which  will  display  it . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								2 .  The  original  point  from  your  geojson  layer  will  gain  the  tag  '_imported=yes' .  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    This  should  be  used  to  change  the  appearance  or  even  to  hide  it  ( eg  by  changing  the  icon  size  to  zero ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								3 .  There  should  be  a  way  for  the  theme  to  detect  previously  imported  points ,  even  after  reloading .  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    A  reference  number  to  the  original  dataset  is  an  excellen  way  to  do  this     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								` ,
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                constr :  ( state ,  tagSource ,  args )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-28 18:00:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    if  ( ! state . layoutToUse . official  &&  ! state . featureSwitchIsTesting . data )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-18 02:31:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        return  new  Combine ( [ new  FixedUiElement ( "The import button is disabled for unofficial themes to prevent accidents." ) . SetClass ( "alert" ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            new  FixedUiElement ( "To test, add 'test=true' to the URL. The changeset will be printed in the console. Please open a PR to officialize this theme to actually enable the import button." ) ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  tgsSpec  =  args [ 0 ] . split ( "," ) . map ( spec  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        const  kv  =  spec . split ( "=" ) . map ( s  = >  s . trim ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        if  ( kv . length  !=  2 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            throw  "Invalid key spec: multiple '=' found in "  +  spec 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        return  kv 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-02 22:31:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  rewrittenTags : UIEventSource < Tag [ ] >  =  tagSource . map ( tags  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        const  newTags : Tag  [ ]  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-18 02:31:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        for  ( const  [ key ,  value ]  of  tgsSpec )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            if  ( value . startsWith ( '$' ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                const  origKey  =  value . substring ( 1 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                newTags . push ( new  Tag ( key ,  tags [ origKey ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                newTags . push ( new  Tag ( key ,  value ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        return  newTags 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  id  =  tagSource . data . id ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-08 15:11:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  feature  =  state . allElements . ContainingFeatures . get ( id ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-18 02:31:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    if  ( feature . geometry . type  !==  "Point" )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        return  new  FixedUiElement ( "Error: can only import point objects" ) . SetClass ( "alert" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  [ lon ,  lat ]  =  feature . geometry . coordinates ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    return  new  ImportButton ( 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-08 15:11:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        args [ 2 ] ,  args [ 1 ] ,  tagSource ,  rewrittenTags ,  lat ,  lon ,  Number ( args [ 3 ] ) ,  state 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-18 02:31:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-12 02:12:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                funcName :  "multi_apply" , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-12 02:12:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                docs :  "A button to apply the tagging of this object onto a list of other features. This is an advanced feature for which you'll need calculatedTags" , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                args :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-12 02:12:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    { name :  "feature_ids" ,  doc :  "A JSOn-serialized list of IDs of features to apply the tagging on" } , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        name :  "keys" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        doc :  "One key (or multiple keys, seperated by ';') of the attribute that should be copied onto the other features." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-12 02:12:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    { name :  "text" ,  doc :  "The text to show on the button" } , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        name :  "autoapply" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        doc :  "A boolean indicating wether this tagging should be applied automatically if the relevant tags on this object are changed. A visual element indicating the multi_apply is still shown" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        name :  "overwrite" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        doc :  "If set to 'true', the tags on the other objects will always be overwritten. The default behaviour will be to only change the tags on other objects if they are either undefined or had the same value before the change" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-12 02:12:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                example :  "{multi_apply(_features_with_the_same_name_within_100m, name:etymology:wikidata;name:etymology, Apply etymology information on all nearby objects with the same name)}" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                constr :  ( state ,  tagsSource ,  args )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  featureIdsKey  =  args [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  keysToApply  =  args [ 1 ] . split ( ";" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  text  =  args [ 2 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  autoapply  =  args [ 3 ] ? . toLowerCase ( )  ===  "true" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  overwrite  =  args [ 4 ] ? . toLowerCase ( )  ===  "true" 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  featureIds : UIEventSource < string [ ] >  =  tagsSource . map ( tags  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        const  ids  =  tags [ featureIdsKey ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        try  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            if  ( ids  ===  undefined )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-13 17:18:14 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                return  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            return  JSON . parse ( ids ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        }  catch  ( e )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-13 17:18:14 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            console . warn ( "Could not parse " ,  ids ,  "as JSON to extract IDS which should be shown on the map." ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            return  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-12 02:12:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    return  new  MultiApply ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            featureIds , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            keysToApply , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            text , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            autoapply , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            overwrite , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            tagsSource , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            state 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-12 02:12:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-21 16:44:48 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-11 22:37:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ] 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-09 00:05:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-03 14:35:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    static  HelpMessage : BaseUIElement  =  SpecialVisualizations . GenHelpMessage ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-09 00:05:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-10-17 02:37:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    private  static  GenHelpMessage() { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  helpTexts  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            SpecialVisualizations . specialVisualizations . map ( viz  = >  new  Combine ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                [ 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-21 00:19:19 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    new  Title ( viz . funcName ,  3 ) , 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-17 02:37:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    viz . docs , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-02 22:31:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    viz . args . length  >  0  ?  new  Table ( [ "name" ,  "default" ,  "description" ] , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-21 00:19:19 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        viz . args . map ( arg  = >  [ arg . name ,  arg . defaultValue  ? ?  "undefined" ,  arg . doc ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-02 22:31:16 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    )  :  undefined , 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-21 00:19:19 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    new  Title ( "Example usage" ,  4 ) , 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-17 02:37:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    new  FixedUiElement ( 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-18 02:31:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        viz . example  ? ?  "`{"  +  viz . funcName  +  "("  +  viz . args . map ( arg  = >  arg . defaultValue ) . join ( "," )  +  ")}`" 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-17 02:37:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ) . SetClass ( "literal-code" ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  new  Combine ( [ 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-21 03:13:05 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                new  Title ( "Special tag renderings" ,  3 ) , 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-17 02:37:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                "In a tagrendering, some special values are substituted by an advanced UI-element. This allows advanced features and visualizations to be reused by custom themes or even to query third-party API's." , 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-19 18:30:43 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                "General usage is `{func_name()}`, `{func_name(arg, someotherarg)}` or `{func_name(args):cssStyle}`. Note that you _do not_fcs need to use quotes around your arguments, the comma is enough to separate them. This also implies you cannot use a comma in your args" , 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-17 02:37:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                . . . helpTexts 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-09 20:10:21 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}