{"version":3,"file":"vendors-a17b7d01.b149463909b5e91f4e75.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACtgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACxKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AClIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACn4CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACxQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AC5JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACxIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC9MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;AClkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://app/./node_modules/ol/interaction.js","webpack://app/./node_modules/ol/interaction/Extent.js","webpack://app/./node_modules/ol/interaction/Interaction.js","webpack://app/./node_modules/ol/interaction/KeyboardPan.js","webpack://app/./node_modules/ol/interaction/KeyboardZoom.js","webpack://app/./node_modules/ol/interaction/Modify.js","webpack://app/./node_modules/ol/interaction/MouseWheelZoom.js","webpack://app/./node_modules/ol/interaction/PinchRotate.js","webpack://app/./node_modules/ol/interaction/PinchZoom.js","webpack://app/./node_modules/ol/interaction/Pointer.js","webpack://app/./node_modules/ol/interaction/Property.js","webpack://app/./node_modules/ol/interaction/Select.js","webpack://app/./node_modules/ol/interaction/Snap.js","webpack://app/./node_modules/ol/interaction/Translate.js"],"sourcesContent":["/**\n * @module ol/interaction\n */\nimport Collection from './Collection.js';\nimport DoubleClickZoom from './interaction/DoubleClickZoom.js';\nimport DragPan from './interaction/DragPan.js';\nimport DragRotate from './interaction/DragRotate.js';\nimport DragZoom from './interaction/DragZoom.js';\nimport KeyboardPan from './interaction/KeyboardPan.js';\nimport KeyboardZoom from './interaction/KeyboardZoom.js';\nimport Kinetic from './Kinetic.js';\nimport MouseWheelZoom from './interaction/MouseWheelZoom.js';\nimport PinchRotate from './interaction/PinchRotate.js';\nimport PinchZoom from './interaction/PinchZoom.js';\nexport { default as DoubleClickZoom } from './interaction/DoubleClickZoom.js';\nexport { default as DragAndDrop } from './interaction/DragAndDrop.js';\nexport { default as DragBox } from './interaction/DragBox.js';\nexport { default as DragPan } from './interaction/DragPan.js';\nexport { default as DragRotate } from './interaction/DragRotate.js';\nexport { default as DragRotateAndZoom } from './interaction/DragRotateAndZoom.js';\nexport { default as DragZoom } from './interaction/DragZoom.js';\nexport { default as Draw } from './interaction/Draw.js';\nexport { default as Extent } from './interaction/Extent.js';\nexport { default as Interaction } from './interaction/Interaction.js';\nexport { default as KeyboardPan } from './interaction/KeyboardPan.js';\nexport { default as KeyboardZoom } from './interaction/KeyboardZoom.js';\nexport { default as Modify } from './interaction/Modify.js';\nexport { default as MouseWheelZoom } from './interaction/MouseWheelZoom.js';\nexport { default as PinchRotate } from './interaction/PinchRotate.js';\nexport { default as PinchZoom } from './interaction/PinchZoom.js';\nexport { default as Pointer } from './interaction/Pointer.js';\nexport { default as Select } from './interaction/Select.js';\nexport { default as Snap } from './interaction/Snap.js';\nexport { default as Translate } from './interaction/Translate.js';\n/**\n * @typedef {Object} DefaultsOptions\n * @property {boolean} [altShiftDragRotate=true] Whether Alt-Shift-drag rotate is\n * desired.\n * @property {boolean} [onFocusOnly=false] Interact only when the map has the\n * focus. This affects the `MouseWheelZoom` and `DragPan` interactions and is\n * useful when page scroll is desired for maps that do not have the browser's\n * focus.\n * @property {boolean} [doubleClickZoom=true] Whether double click zoom is\n * desired.\n * @property {boolean} [keyboard=true] Whether keyboard interaction is desired.\n * @property {boolean} [mouseWheelZoom=true] Whether mousewheel zoom is desired.\n * @property {boolean} [shiftDragZoom=true] Whether Shift-drag zoom is desired.\n * @property {boolean} [dragPan=true] Whether drag pan is desired.\n * @property {boolean} [pinchRotate=true] Whether pinch rotate is desired.\n * @property {boolean} [pinchZoom=true] Whether pinch zoom is desired.\n * @property {number} [zoomDelta] Zoom level delta when using keyboard or double click zoom.\n * @property {number} [zoomDuration] Duration of the zoom animation in\n * milliseconds.\n */\n/**\n * Set of interactions included in maps by default. Specific interactions can be\n * excluded by setting the appropriate option to false in the constructor\n * options, but the order of the interactions is fixed. If you want to specify\n * a different order for interactions, you will need to create your own\n * {@link module:ol/interaction/Interaction~Interaction} instances and insert\n * them into a {@link module:ol/Collection~Collection} in the order you want\n * before creating your {@link module:ol/Map~Map} instance. Changing the order can\n * be of interest if the event propagation needs to be stopped at a point.\n * The default set of interactions, in sequence, is:\n * * {@link module:ol/interaction/DragRotate~DragRotate}\n * * {@link module:ol/interaction/DoubleClickZoom~DoubleClickZoom}\n * * {@link module:ol/interaction/DragPan~DragPan}\n * * {@link module:ol/interaction/PinchRotate~PinchRotate}\n * * {@link module:ol/interaction/PinchZoom~PinchZoom}\n * * {@link module:ol/interaction/KeyboardPan~KeyboardPan}\n * * {@link module:ol/interaction/KeyboardZoom~KeyboardZoom}\n * * {@link module:ol/interaction/MouseWheelZoom~MouseWheelZoom}\n * * {@link module:ol/interaction/DragZoom~DragZoom}\n *\n * @param {DefaultsOptions} [opt_options] Defaults options.\n * @return {import(\"./Collection.js\").default}\n * A collection of interactions to be used with the {@link module:ol/Map~Map}\n * constructor's `interactions` option.\n * @api\n */\nexport function defaults(opt_options) {\n var options = opt_options ? opt_options : {};\n var interactions = new Collection();\n var kinetic = new Kinetic(-0.005, 0.05, 100);\n var altShiftDragRotate = options.altShiftDragRotate !== undefined\n ? options.altShiftDragRotate\n : true;\n if (altShiftDragRotate) {\n interactions.push(new DragRotate());\n }\n var doubleClickZoom = options.doubleClickZoom !== undefined ? options.doubleClickZoom : true;\n if (doubleClickZoom) {\n interactions.push(new DoubleClickZoom({\n delta: options.zoomDelta,\n duration: options.zoomDuration,\n }));\n }\n var dragPan = options.dragPan !== undefined ? options.dragPan : true;\n if (dragPan) {\n interactions.push(new DragPan({\n onFocusOnly: options.onFocusOnly,\n kinetic: kinetic,\n }));\n }\n var pinchRotate = options.pinchRotate !== undefined ? options.pinchRotate : true;\n if (pinchRotate) {\n interactions.push(new PinchRotate());\n }\n var pinchZoom = options.pinchZoom !== undefined ? options.pinchZoom : true;\n if (pinchZoom) {\n interactions.push(new PinchZoom({\n duration: options.zoomDuration,\n }));\n }\n var keyboard = options.keyboard !== undefined ? options.keyboard : true;\n if (keyboard) {\n interactions.push(new KeyboardPan());\n interactions.push(new KeyboardZoom({\n delta: options.zoomDelta,\n duration: options.zoomDuration,\n }));\n }\n var mouseWheelZoom = options.mouseWheelZoom !== undefined ? options.mouseWheelZoom : true;\n if (mouseWheelZoom) {\n interactions.push(new MouseWheelZoom({\n onFocusOnly: options.onFocusOnly,\n duration: options.zoomDuration,\n }));\n }\n var shiftDragZoom = options.shiftDragZoom !== undefined ? options.shiftDragZoom : true;\n if (shiftDragZoom) {\n interactions.push(new DragZoom({\n duration: options.zoomDuration,\n }));\n }\n return interactions;\n}\n//# sourceMappingURL=interaction.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Extent\n */\nimport Event from '../events/Event.js';\nimport Feature from '../Feature.js';\nimport MapBrowserEventType from '../MapBrowserEventType.js';\nimport Point from '../geom/Point.js';\nimport PointerInteraction from './Pointer.js';\nimport VectorLayer from '../layer/Vector.js';\nimport VectorSource from '../source/Vector.js';\nimport { always } from '../events/condition.js';\nimport { boundingExtent, getArea } from '../extent.js';\nimport { closestOnSegment, distance as coordinateDistance, squaredDistance as squaredCoordinateDistance, squaredDistanceToSegment, } from '../coordinate.js';\nimport { createEditingStyle } from '../style/Style.js';\nimport { fromExtent as polygonFromExtent } from '../geom/Polygon.js';\nimport { toUserExtent } from '../proj.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled.\n * Default is {@link module:ol/events/condition.always}.\n * @property {import(\"../extent.js\").Extent} [extent] Initial extent. Defaults to no\n * initial extent.\n * @property {import(\"../style/Style.js\").StyleLike} [boxStyle]\n * Style for the drawn extent box. Defaults to the `Polygon` editing style\n * documented in {@link module:ol/style/Style~Style}\n * @property {number} [pixelTolerance=10] Pixel tolerance for considering the\n * pointer close enough to a segment or vertex for editing.\n * @property {import(\"../style/Style.js\").StyleLike} [pointerStyle]\n * Style for the cursor used to draw the extent. Defaults to the `Point` editing style\n * documented in {@link module:ol/style/Style~Style}\n * @property {boolean} [wrapX=false] Wrap the drawn extent across multiple maps\n * in the X direction? Only affects visuals, not functionality.\n */\n/**\n * @enum {string}\n */\nvar ExtentEventType = {\n /**\n * Triggered after the extent is changed\n * @event ExtentEvent#extentchanged\n * @api\n */\n EXTENTCHANGED: 'extentchanged',\n};\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/Extent~Extent} instances are\n * instances of this type.\n */\nvar ExtentEvent = /** @class */ (function (_super) {\n __extends(ExtentEvent, _super);\n /**\n * @param {import(\"../extent.js\").Extent} extent the new extent\n */\n function ExtentEvent(extent) {\n var _this = _super.call(this, ExtentEventType.EXTENTCHANGED) || this;\n /**\n * The current extent.\n * @type {import(\"../extent.js\").Extent}\n * @api\n */\n _this.extent = extent;\n return _this;\n }\n return ExtentEvent;\n}(Event));\nexport { ExtentEvent };\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature &\n * import(\"../Observable\").OnSignature &\n * import(\"../Observable\").OnSignature<'extentchanged', ExtentEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature} ExtentOnSignature\n */\n/**\n * @classdesc\n * Allows the user to draw a vector box by clicking and dragging on the map.\n * Once drawn, the vector box can be modified by dragging its vertices or edges.\n * This interaction is only supported for mouse devices.\n *\n * @fires ExtentEvent\n * @api\n */\nvar Extent = /** @class */ (function (_super) {\n __extends(Extent, _super);\n /**\n * @param {Options} [opt_options] Options.\n */\n function Extent(opt_options) {\n var _this = this;\n var options = opt_options || {};\n _this = _super.call(this, /** @type {import(\"./Pointer.js\").Options} */ (options)) || this;\n /***\n * @type {ExtentOnSignature}\n */\n _this.on;\n /***\n * @type {ExtentOnSignature}\n */\n _this.once;\n /***\n * @type {ExtentOnSignature}\n */\n _this.un;\n /**\n * Condition\n * @type {import(\"../events/condition.js\").Condition}\n * @private\n */\n _this.condition_ = options.condition ? options.condition : always;\n /**\n * Extent of the drawn box\n * @type {import(\"../extent.js\").Extent}\n * @private\n */\n _this.extent_ = null;\n /**\n * Handler for pointer move events\n * @type {function (import(\"../coordinate.js\").Coordinate): import(\"../extent.js\").Extent|null}\n * @private\n */\n _this.pointerHandler_ = null;\n /**\n * Pixel threshold to snap to extent\n * @type {number}\n * @private\n */\n _this.pixelTolerance_ =\n options.pixelTolerance !== undefined ? options.pixelTolerance : 10;\n /**\n * Is the pointer snapped to an extent vertex\n * @type {boolean}\n * @private\n */\n _this.snappedToVertex_ = false;\n /**\n * Feature for displaying the visible extent\n * @type {Feature}\n * @private\n */\n _this.extentFeature_ = null;\n /**\n * Feature for displaying the visible pointer\n * @type {Feature}\n * @private\n */\n _this.vertexFeature_ = null;\n if (!opt_options) {\n opt_options = {};\n }\n /**\n * Layer for the extentFeature\n * @type {VectorLayer}\n * @private\n */\n _this.extentOverlay_ = new VectorLayer({\n source: new VectorSource({\n useSpatialIndex: false,\n wrapX: !!opt_options.wrapX,\n }),\n style: opt_options.boxStyle\n ? opt_options.boxStyle\n : getDefaultExtentStyleFunction(),\n updateWhileAnimating: true,\n updateWhileInteracting: true,\n });\n /**\n * Layer for the vertexFeature\n * @type {VectorLayer}\n * @private\n */\n _this.vertexOverlay_ = new VectorLayer({\n source: new VectorSource({\n useSpatialIndex: false,\n wrapX: !!opt_options.wrapX,\n }),\n style: opt_options.pointerStyle\n ? opt_options.pointerStyle\n : getDefaultPointerStyleFunction(),\n updateWhileAnimating: true,\n updateWhileInteracting: true,\n });\n if (opt_options.extent) {\n _this.setExtent(opt_options.extent);\n }\n return _this;\n }\n /**\n * @param {import(\"../pixel.js\").Pixel} pixel cursor location\n * @param {import(\"../PluggableMap.js\").default} map map\n * @return {import(\"../coordinate.js\").Coordinate|null} snapped vertex on extent\n * @private\n */\n Extent.prototype.snapToVertex_ = function (pixel, map) {\n var pixelCoordinate = map.getCoordinateFromPixelInternal(pixel);\n var sortByDistance = function (a, b) {\n return (squaredDistanceToSegment(pixelCoordinate, a) -\n squaredDistanceToSegment(pixelCoordinate, b));\n };\n var extent = this.getExtentInternal();\n if (extent) {\n //convert extents to line segments and find the segment closest to pixelCoordinate\n var segments = getSegments(extent);\n segments.sort(sortByDistance);\n var closestSegment = segments[0];\n var vertex = closestOnSegment(pixelCoordinate, closestSegment);\n var vertexPixel = map.getPixelFromCoordinateInternal(vertex);\n //if the distance is within tolerance, snap to the segment\n if (coordinateDistance(pixel, vertexPixel) <= this.pixelTolerance_) {\n //test if we should further snap to a vertex\n var pixel1 = map.getPixelFromCoordinateInternal(closestSegment[0]);\n var pixel2 = map.getPixelFromCoordinateInternal(closestSegment[1]);\n var squaredDist1 = squaredCoordinateDistance(vertexPixel, pixel1);\n var squaredDist2 = squaredCoordinateDistance(vertexPixel, pixel2);\n var dist = Math.sqrt(Math.min(squaredDist1, squaredDist2));\n this.snappedToVertex_ = dist <= this.pixelTolerance_;\n if (this.snappedToVertex_) {\n vertex =\n squaredDist1 > squaredDist2 ? closestSegment[1] : closestSegment[0];\n }\n return vertex;\n }\n }\n return null;\n };\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent pointer move event\n * @private\n */\n Extent.prototype.handlePointerMove_ = function (mapBrowserEvent) {\n var pixel = mapBrowserEvent.pixel;\n var map = mapBrowserEvent.map;\n var vertex = this.snapToVertex_(pixel, map);\n if (!vertex) {\n vertex = map.getCoordinateFromPixelInternal(pixel);\n }\n this.createOrUpdatePointerFeature_(vertex);\n };\n /**\n * @param {import(\"../extent.js\").Extent} extent extent\n * @return {Feature} extent as featrue\n * @private\n */\n Extent.prototype.createOrUpdateExtentFeature_ = function (extent) {\n var extentFeature = this.extentFeature_;\n if (!extentFeature) {\n if (!extent) {\n extentFeature = new Feature({});\n }\n else {\n extentFeature = new Feature(polygonFromExtent(extent));\n }\n this.extentFeature_ = extentFeature;\n this.extentOverlay_.getSource().addFeature(extentFeature);\n }\n else {\n if (!extent) {\n extentFeature.setGeometry(undefined);\n }\n else {\n extentFeature.setGeometry(polygonFromExtent(extent));\n }\n }\n return extentFeature;\n };\n /**\n * @param {import(\"../coordinate.js\").Coordinate} vertex location of feature\n * @return {Feature} vertex as feature\n * @private\n */\n Extent.prototype.createOrUpdatePointerFeature_ = function (vertex) {\n var vertexFeature = this.vertexFeature_;\n if (!vertexFeature) {\n vertexFeature = new Feature(new Point(vertex));\n this.vertexFeature_ = vertexFeature;\n this.vertexOverlay_.getSource().addFeature(vertexFeature);\n }\n else {\n var geometry = vertexFeature.getGeometry();\n geometry.setCoordinates(vertex);\n }\n return vertexFeature;\n };\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n */\n Extent.prototype.handleEvent = function (mapBrowserEvent) {\n if (!mapBrowserEvent.originalEvent || !this.condition_(mapBrowserEvent)) {\n return true;\n }\n //display pointer (if not dragging)\n if (mapBrowserEvent.type == MapBrowserEventType.POINTERMOVE &&\n !this.handlingDownUpSequence) {\n this.handlePointerMove_(mapBrowserEvent);\n }\n //call pointer to determine up/down/drag\n _super.prototype.handleEvent.call(this, mapBrowserEvent);\n //return false to stop propagation\n return false;\n };\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n Extent.prototype.handleDownEvent = function (mapBrowserEvent) {\n var pixel = mapBrowserEvent.pixel;\n var map = mapBrowserEvent.map;\n var extent = this.getExtentInternal();\n var vertex = this.snapToVertex_(pixel, map);\n //find the extent corner opposite the passed corner\n var getOpposingPoint = function (point) {\n var x_ = null;\n var y_ = null;\n if (point[0] == extent[0]) {\n x_ = extent[2];\n }\n else if (point[0] == extent[2]) {\n x_ = extent[0];\n }\n if (point[1] == extent[1]) {\n y_ = extent[3];\n }\n else if (point[1] == extent[3]) {\n y_ = extent[1];\n }\n if (x_ !== null && y_ !== null) {\n return [x_, y_];\n }\n return null;\n };\n if (vertex && extent) {\n var x = vertex[0] == extent[0] || vertex[0] == extent[2] ? vertex[0] : null;\n var y = vertex[1] == extent[1] || vertex[1] == extent[3] ? vertex[1] : null;\n //snap to point\n if (x !== null && y !== null) {\n this.pointerHandler_ = getPointHandler(getOpposingPoint(vertex));\n //snap to edge\n }\n else if (x !== null) {\n this.pointerHandler_ = getEdgeHandler(getOpposingPoint([x, extent[1]]), getOpposingPoint([x, extent[3]]));\n }\n else if (y !== null) {\n this.pointerHandler_ = getEdgeHandler(getOpposingPoint([extent[0], y]), getOpposingPoint([extent[2], y]));\n }\n //no snap - new bbox\n }\n else {\n vertex = map.getCoordinateFromPixelInternal(pixel);\n this.setExtent([vertex[0], vertex[1], vertex[0], vertex[1]]);\n this.pointerHandler_ = getPointHandler(vertex);\n }\n return true; //event handled; start downup sequence\n };\n /**\n * Handle pointer drag events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n */\n Extent.prototype.handleDragEvent = function (mapBrowserEvent) {\n if (this.pointerHandler_) {\n var pixelCoordinate = mapBrowserEvent.coordinate;\n this.setExtent(this.pointerHandler_(pixelCoordinate));\n this.createOrUpdatePointerFeature_(pixelCoordinate);\n }\n };\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n Extent.prototype.handleUpEvent = function (mapBrowserEvent) {\n this.pointerHandler_ = null;\n //If bbox is zero area, set to null;\n var extent = this.getExtentInternal();\n if (!extent || getArea(extent) === 0) {\n this.setExtent(null);\n }\n return false; //Stop handling downup sequence\n };\n /**\n * Remove the interaction from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../PluggableMap.js\").default} map Map.\n */\n Extent.prototype.setMap = function (map) {\n this.extentOverlay_.setMap(map);\n this.vertexOverlay_.setMap(map);\n _super.prototype.setMap.call(this, map);\n };\n /**\n * Returns the current drawn extent in the view projection (or user projection if set)\n *\n * @return {import(\"../extent.js\").Extent} Drawn extent in the view projection.\n * @api\n */\n Extent.prototype.getExtent = function () {\n return toUserExtent(this.getExtentInternal(), this.getMap().getView().getProjection());\n };\n /**\n * Returns the current drawn extent in the view projection\n *\n * @return {import(\"../extent.js\").Extent} Drawn extent in the view projection.\n * @api\n */\n Extent.prototype.getExtentInternal = function () {\n return this.extent_;\n };\n /**\n * Manually sets the drawn extent, using the view projection.\n *\n * @param {import(\"../extent.js\").Extent} extent Extent\n * @api\n */\n Extent.prototype.setExtent = function (extent) {\n //Null extent means no bbox\n this.extent_ = extent ? extent : null;\n this.createOrUpdateExtentFeature_(extent);\n this.dispatchEvent(new ExtentEvent(this.extent_));\n };\n return Extent;\n}(PointerInteraction));\n/**\n * Returns the default style for the drawn bbox\n *\n * @return {import(\"../style/Style.js\").StyleFunction} Default Extent style\n */\nfunction getDefaultExtentStyleFunction() {\n var style = createEditingStyle();\n return function (feature, resolution) {\n return style['Polygon'];\n };\n}\n/**\n * Returns the default style for the pointer\n *\n * @return {import(\"../style/Style.js\").StyleFunction} Default pointer style\n */\nfunction getDefaultPointerStyleFunction() {\n var style = createEditingStyle();\n return function (feature, resolution) {\n return style['Point'];\n };\n}\n/**\n * @param {import(\"../coordinate.js\").Coordinate} fixedPoint corner that will be unchanged in the new extent\n * @return {function (import(\"../coordinate.js\").Coordinate): import(\"../extent.js\").Extent} event handler\n */\nfunction getPointHandler(fixedPoint) {\n return function (point) {\n return boundingExtent([fixedPoint, point]);\n };\n}\n/**\n * @param {import(\"../coordinate.js\").Coordinate} fixedP1 first corner that will be unchanged in the new extent\n * @param {import(\"../coordinate.js\").Coordinate} fixedP2 second corner that will be unchanged in the new extent\n * @return {function (import(\"../coordinate.js\").Coordinate): import(\"../extent.js\").Extent|null} event handler\n */\nfunction getEdgeHandler(fixedP1, fixedP2) {\n if (fixedP1[0] == fixedP2[0]) {\n return function (point) {\n return boundingExtent([fixedP1, [point[0], fixedP2[1]]]);\n };\n }\n else if (fixedP1[1] == fixedP2[1]) {\n return function (point) {\n return boundingExtent([fixedP1, [fixedP2[0], point[1]]]);\n };\n }\n else {\n return null;\n }\n}\n/**\n * @param {import(\"../extent.js\").Extent} extent extent\n * @return {Array>} extent line segments\n */\nfunction getSegments(extent) {\n return [\n [\n [extent[0], extent[1]],\n [extent[0], extent[3]],\n ],\n [\n [extent[0], extent[3]],\n [extent[2], extent[3]],\n ],\n [\n [extent[2], extent[3]],\n [extent[2], extent[1]],\n ],\n [\n [extent[2], extent[1]],\n [extent[0], extent[1]],\n ],\n ];\n}\nexport default Extent;\n//# sourceMappingURL=Extent.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Interaction\n */\nimport BaseObject from '../Object.js';\nimport InteractionProperty from './Property.js';\nimport { easeOut, linear } from '../easing.js';\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature &\n * import(\"../Observable\").OnSignature &\n * import(\"../Observable\").CombinedOnSignature} InteractionOnSignature\n */\n/**\n * Object literal with config options for interactions.\n * @typedef {Object} InteractionOptions\n * @property {function(import(\"../MapBrowserEvent.js\").default):boolean} handleEvent\n * Method called by the map to notify the interaction that a browser event was\n * dispatched to the map. If the function returns a falsy value, propagation of\n * the event to other interactions in the map's interactions chain will be\n * prevented (this includes functions with no explicit return). The interactions\n * are traversed in reverse order of the interactions collection of the map.\n */\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * User actions that change the state of the map. Some are similar to controls,\n * but are not associated with a DOM element.\n * For example, {@link module:ol/interaction/KeyboardZoom~KeyboardZoom} is\n * functionally the same as {@link module:ol/control/Zoom~Zoom}, but triggered\n * by a keyboard event not a button element event.\n * Although interactions do not have a DOM element, some of them do render\n * vectors and so are visible on the screen.\n * @api\n */\nvar Interaction = /** @class */ (function (_super) {\n __extends(Interaction, _super);\n /**\n * @param {InteractionOptions} [opt_options] Options.\n */\n function Interaction(opt_options) {\n var _this = _super.call(this) || this;\n /***\n * @type {InteractionOnSignature}\n */\n _this.on;\n /***\n * @type {InteractionOnSignature}\n */\n _this.once;\n /***\n * @type {InteractionOnSignature}\n */\n _this.un;\n if (opt_options && opt_options.handleEvent) {\n _this.handleEvent = opt_options.handleEvent;\n }\n /**\n * @private\n * @type {import(\"../PluggableMap.js\").default|null}\n */\n _this.map_ = null;\n _this.setActive(true);\n return _this;\n }\n /**\n * Return whether the interaction is currently active.\n * @return {boolean} `true` if the interaction is active, `false` otherwise.\n * @observable\n * @api\n */\n Interaction.prototype.getActive = function () {\n return /** @type {boolean} */ (this.get(InteractionProperty.ACTIVE));\n };\n /**\n * Get the map associated with this interaction.\n * @return {import(\"../PluggableMap.js\").default|null} Map.\n * @api\n */\n Interaction.prototype.getMap = function () {\n return this.map_;\n };\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event}.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @api\n */\n Interaction.prototype.handleEvent = function (mapBrowserEvent) {\n return true;\n };\n /**\n * Activate or deactivate the interaction.\n * @param {boolean} active Active.\n * @observable\n * @api\n */\n Interaction.prototype.setActive = function (active) {\n this.set(InteractionProperty.ACTIVE, active);\n };\n /**\n * Remove the interaction from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../PluggableMap.js\").default|null} map Map.\n */\n Interaction.prototype.setMap = function (map) {\n this.map_ = map;\n };\n return Interaction;\n}(BaseObject));\n/**\n * @param {import(\"../View.js\").default} view View.\n * @param {import(\"../coordinate.js\").Coordinate} delta Delta.\n * @param {number} [opt_duration] Duration.\n */\nexport function pan(view, delta, opt_duration) {\n var currentCenter = view.getCenterInternal();\n if (currentCenter) {\n var center = [currentCenter[0] + delta[0], currentCenter[1] + delta[1]];\n view.animateInternal({\n duration: opt_duration !== undefined ? opt_duration : 250,\n easing: linear,\n center: view.getConstrainedCenter(center),\n });\n }\n}\n/**\n * @param {import(\"../View.js\").default} view View.\n * @param {number} delta Delta from previous zoom level.\n * @param {import(\"../coordinate.js\").Coordinate} [opt_anchor] Anchor coordinate in the user projection.\n * @param {number} [opt_duration] Duration.\n */\nexport function zoomByDelta(view, delta, opt_anchor, opt_duration) {\n var currentZoom = view.getZoom();\n if (currentZoom === undefined) {\n return;\n }\n var newZoom = view.getConstrainedZoom(currentZoom + delta);\n var newResolution = view.getResolutionForZoom(newZoom);\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n view.animate({\n resolution: newResolution,\n anchor: opt_anchor,\n duration: opt_duration !== undefined ? opt_duration : 250,\n easing: easeOut,\n });\n}\nexport default Interaction;\n//# sourceMappingURL=Interaction.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/KeyboardPan\n */\nimport EventType from '../events/EventType.js';\nimport Interaction, { pan } from './Interaction.js';\nimport KeyCode from '../events/KeyCode.js';\nimport { noModifierKeys, targetNotEditable } from '../events/condition.js';\nimport { rotate as rotateCoordinate } from '../coordinate.js';\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. Default is\n * {@link module:ol/events/condition.noModifierKeys} and\n * {@link module:ol/events/condition.targetNotEditable}.\n * @property {number} [duration=100] Animation duration in milliseconds.\n * @property {number} [pixelDelta=128] The amount of pixels to pan on each key\n * press.\n */\n/**\n * @classdesc\n * Allows the user to pan the map using keyboard arrows.\n * Note that, although this interaction is by default included in maps,\n * the keys can only be used when browser focus is on the element to which\n * the keyboard events are attached. By default, this is the map div,\n * though you can change this with the `keyboardEventTarget` in\n * {@link module:ol/Map~Map}. `document` never loses focus but, for any other\n * element, focus will have to be on, and returned to, this element if the keys\n * are to function.\n * See also {@link module:ol/interaction/KeyboardZoom~KeyboardZoom}.\n * @api\n */\nvar KeyboardPan = /** @class */ (function (_super) {\n __extends(KeyboardPan, _super);\n /**\n * @param {Options} [opt_options] Options.\n */\n function KeyboardPan(opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options || {};\n /**\n * @private\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Browser event.\n * @return {boolean} Combined condition result.\n */\n _this.defaultCondition_ = function (mapBrowserEvent) {\n return (noModifierKeys(mapBrowserEvent) && targetNotEditable(mapBrowserEvent));\n };\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ =\n options.condition !== undefined\n ? options.condition\n : _this.defaultCondition_;\n /**\n * @private\n * @type {number}\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 100;\n /**\n * @private\n * @type {number}\n */\n _this.pixelDelta_ =\n options.pixelDelta !== undefined ? options.pixelDelta : 128;\n return _this;\n }\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} if it was a\n * `KeyEvent`, and decides the direction to pan to (if an arrow key was\n * pressed).\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @this {KeyboardPan}\n */\n KeyboardPan.prototype.handleEvent = function (mapBrowserEvent) {\n var stopEvent = false;\n if (mapBrowserEvent.type == EventType.KEYDOWN) {\n var keyEvent = /** @type {KeyboardEvent} */ (mapBrowserEvent.originalEvent);\n var keyCode = keyEvent.keyCode;\n if (this.condition_(mapBrowserEvent) &&\n (keyCode == KeyCode.DOWN ||\n keyCode == KeyCode.LEFT ||\n keyCode == KeyCode.RIGHT ||\n keyCode == KeyCode.UP)) {\n var map = mapBrowserEvent.map;\n var view = map.getView();\n var mapUnitsDelta = view.getResolution() * this.pixelDelta_;\n var deltaX = 0, deltaY = 0;\n if (keyCode == KeyCode.DOWN) {\n deltaY = -mapUnitsDelta;\n }\n else if (keyCode == KeyCode.LEFT) {\n deltaX = -mapUnitsDelta;\n }\n else if (keyCode == KeyCode.RIGHT) {\n deltaX = mapUnitsDelta;\n }\n else {\n deltaY = mapUnitsDelta;\n }\n var delta = [deltaX, deltaY];\n rotateCoordinate(delta, view.getRotation());\n pan(view, delta, this.duration_);\n keyEvent.preventDefault();\n stopEvent = true;\n }\n }\n return !stopEvent;\n };\n return KeyboardPan;\n}(Interaction));\nexport default KeyboardPan;\n//# sourceMappingURL=KeyboardPan.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/KeyboardZoom\n */\nimport EventType from '../events/EventType.js';\nimport Interaction, { zoomByDelta } from './Interaction.js';\nimport { targetNotEditable } from '../events/condition.js';\n/**\n * @typedef {Object} Options\n * @property {number} [duration=100] Animation duration in milliseconds.\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. Default is\n * {@link module:ol/events/condition.targetNotEditable}.\n * @property {number} [delta=1] The zoom level delta on each key press.\n */\n/**\n * @classdesc\n * Allows the user to zoom the map using keyboard + and -.\n * Note that, although this interaction is by default included in maps,\n * the keys can only be used when browser focus is on the element to which\n * the keyboard events are attached. By default, this is the map div,\n * though you can change this with the `keyboardEventTarget` in\n * {@link module:ol/Map~Map}. `document` never loses focus but, for any other\n * element, focus will have to be on, and returned to, this element if the keys\n * are to function.\n * See also {@link module:ol/interaction/KeyboardPan~KeyboardPan}.\n * @api\n */\nvar KeyboardZoom = /** @class */ (function (_super) {\n __extends(KeyboardZoom, _super);\n /**\n * @param {Options} [opt_options] Options.\n */\n function KeyboardZoom(opt_options) {\n var _this = _super.call(this) || this;\n var options = opt_options ? opt_options : {};\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ = options.condition ? options.condition : targetNotEditable;\n /**\n * @private\n * @type {number}\n */\n _this.delta_ = options.delta ? options.delta : 1;\n /**\n * @private\n * @type {number}\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 100;\n return _this;\n }\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} if it was a\n * `KeyEvent`, and decides whether to zoom in or out (depending on whether the\n * key pressed was '+' or '-').\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @this {KeyboardZoom}\n */\n KeyboardZoom.prototype.handleEvent = function (mapBrowserEvent) {\n var stopEvent = false;\n if (mapBrowserEvent.type == EventType.KEYDOWN ||\n mapBrowserEvent.type == EventType.KEYPRESS) {\n var keyEvent = /** @type {KeyboardEvent} */ (mapBrowserEvent.originalEvent);\n var charCode = keyEvent.charCode;\n if (this.condition_(mapBrowserEvent) &&\n (charCode == '+'.charCodeAt(0) || charCode == '-'.charCodeAt(0))) {\n var map = mapBrowserEvent.map;\n var delta = charCode == '+'.charCodeAt(0) ? this.delta_ : -this.delta_;\n var view = map.getView();\n zoomByDelta(view, delta, undefined, this.duration_);\n keyEvent.preventDefault();\n stopEvent = true;\n }\n }\n return !stopEvent;\n };\n return KeyboardZoom;\n}(Interaction));\nexport default KeyboardZoom;\n//# sourceMappingURL=KeyboardZoom.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Modify\n */\nimport Collection from '../Collection.js';\nimport CollectionEventType from '../CollectionEventType.js';\nimport Event from '../events/Event.js';\nimport EventType from '../events/EventType.js';\nimport Feature from '../Feature.js';\nimport MapBrowserEventType from '../MapBrowserEventType.js';\nimport Point from '../geom/Point.js';\nimport PointerInteraction from './Pointer.js';\nimport RBush from '../structs/RBush.js';\nimport VectorEventType from '../source/VectorEventType.js';\nimport VectorLayer from '../layer/Vector.js';\nimport VectorSource from '../source/Vector.js';\nimport { altKeyOnly, always, primaryAction, singleClick, } from '../events/condition.js';\nimport { boundingExtent, buffer as bufferExtent, createOrUpdateFromCoordinate as createExtent, } from '../extent.js';\nimport { closestOnSegment, distance as coordinateDistance, equals as coordinatesEqual, squaredDistance as squaredCoordinateDistance, squaredDistanceToSegment, } from '../coordinate.js';\nimport { createEditingStyle } from '../style/Style.js';\nimport { equals, includes } from '../array.js';\nimport { fromCircle } from '../geom/Polygon.js';\nimport { fromUserCoordinate, fromUserExtent, getUserProjection, toUserCoordinate, toUserExtent, } from '../proj.js';\nimport { getUid } from '../util.js';\n/**\n * The segment index assigned to a circle's center when\n * breaking up a circle into ModifySegmentDataType segments.\n * @type {number}\n */\nvar CIRCLE_CENTER_INDEX = 0;\n/**\n * The segment index assigned to a circle's circumference when\n * breaking up a circle into ModifySegmentDataType segments.\n * @type {number}\n */\nvar CIRCLE_CIRCUMFERENCE_INDEX = 1;\nvar tempExtent = [0, 0, 0, 0];\nvar tempSegment = [];\n/**\n * @enum {string}\n */\nvar ModifyEventType = {\n /**\n * Triggered upon feature modification start\n * @event ModifyEvent#modifystart\n * @api\n */\n MODIFYSTART: 'modifystart',\n /**\n * Triggered upon feature modification end\n * @event ModifyEvent#modifyend\n * @api\n */\n MODIFYEND: 'modifyend',\n};\n/**\n * @typedef {Object} SegmentData\n * @property {Array} [depth] Depth.\n * @property {import(\"../Feature\").FeatureLike} feature Feature.\n * @property {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @property {number} [index] Index.\n * @property {Array>} segment Segment.\n * @property {Array} [featureSegments] FeatureSegments.\n */\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event will be considered to add or move a\n * vertex to the sketch. Default is\n * {@link module:ol/events/condition.primaryAction}.\n * @property {import(\"../events/condition.js\").Condition} [deleteCondition] A function\n * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. By default,\n * {@link module:ol/events/condition.singleClick} with\n * {@link module:ol/events/condition.altKeyOnly} results in a vertex deletion.\n * @property {import(\"../events/condition.js\").Condition} [insertVertexCondition] A\n * function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and\n * returns a boolean to indicate whether a new vertex should be added to the sketch\n * features. Default is {@link module:ol/events/condition.always}.\n * @property {number} [pixelTolerance=10] Pixel tolerance for considering the\n * pointer close enough to a segment or vertex for editing.\n * @property {import(\"../style/Style.js\").StyleLike} [style]\n * Style used for the modification point or vertex. For linestrings and polygons, this will\n * be the affected vertex, for circles a point along the circle, and for points the actual\n * point. If not configured, the default edit style is used (see {@link module:ol/style/Style~Style}).\n * When using a style function, the point feature passed to the function will have a `features`\n * property - an array whose entries are the features that are being modified, and a `geometries`\n * property - an array whose entries are the geometries that are being modified. Both arrays are\n * in the same order. The `geometries` are only useful when modifying geometry collections, where\n * the geometry will be the particular geometry from the collection that is being modified.\n * @property {VectorSource} [source] The vector source with\n * features to modify. If a vector source is not provided, a feature collection\n * must be provided with the `features` option.\n * @property {boolean|import(\"../layer/BaseVector\").default} [hitDetection] When configured, point\n * features will be considered for modification based on their visual appearance, instead of being within\n * the `pixelTolerance` from the pointer location. When a {@link module:ol/layer/BaseVector~BaseVectorLayer} is\n * provided, only the rendered representation of the features on that layer will be considered.\n * @property {Collection} [features]\n * The features the interaction works on. If a feature collection is not\n * provided, a vector source must be provided with the `source` option.\n * @property {boolean} [wrapX=false] Wrap the world horizontally on the sketch\n * overlay.\n * @property {boolean} [snapToPointer=!hitDetection] The vertex, point or segment being modified snaps to the\n * pointer coordinate when clicked within the `pixelTolerance`.\n */\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/Modify~Modify} instances are\n * instances of this type.\n */\nvar ModifyEvent = /** @class */ (function (_super) {\n __extends(ModifyEvent, _super);\n /**\n * @param {ModifyEventType} type Type.\n * @param {Collection} features\n * The features modified.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent\n * Associated {@link module:ol/MapBrowserEvent~MapBrowserEvent}.\n */\n function ModifyEvent(type, features, mapBrowserEvent) {\n var _this = _super.call(this, type) || this;\n /**\n * The features being modified.\n * @type {Collection}\n * @api\n */\n _this.features = features;\n /**\n * Associated {@link module:ol/MapBrowserEvent~MapBrowserEvent}.\n * @type {import(\"../MapBrowserEvent.js\").default}\n * @api\n */\n _this.mapBrowserEvent = mapBrowserEvent;\n return _this;\n }\n return ModifyEvent;\n}(Event));\nexport { ModifyEvent };\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature &\n * import(\"../Observable\").OnSignature &\n * import(\"../Observable\").OnSignature<'modifyend'|'modifystart', ModifyEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature} ModifyOnSignature\n */\n/**\n * @classdesc\n * Interaction for modifying feature geometries. To modify features that have\n * been added to an existing source, construct the modify interaction with the\n * `source` option. If you want to modify features in a collection (for example,\n * the collection used by a select interaction), construct the interaction with\n * the `features` option. The interaction must be constructed with either a\n * `source` or `features` option.\n *\n * Cartesian distance from the pointer is used to determine the features that\n * will be modified. This means that geometries will only be considered for\n * modification when they are within the configured `pixelTolerance`. For point\n * geometries, the `hitDetection` option can be used to match their visual\n * appearance.\n *\n * By default, the interaction will allow deletion of vertices when the `alt`\n * key is pressed. To configure the interaction with a different condition\n * for deletion, use the `deleteCondition` option.\n * @fires ModifyEvent\n * @api\n */\nvar Modify = /** @class */ (function (_super) {\n __extends(Modify, _super);\n /**\n * @param {Options} options Options.\n */\n function Modify(options) {\n var _this = _super.call(this, /** @type {import(\"./Pointer.js\").Options} */ (options)) || this;\n /***\n * @type {ModifyOnSignature}\n */\n _this.on;\n /***\n * @type {ModifyOnSignature}\n */\n _this.once;\n /***\n * @type {ModifyOnSignature}\n */\n _this.un;\n /** @private */\n _this.boundHandleFeatureChange_ = _this.handleFeatureChange_.bind(_this);\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ = options.condition ? options.condition : primaryAction;\n /**\n * @private\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Browser event.\n * @return {boolean} Combined condition result.\n */\n _this.defaultDeleteCondition_ = function (mapBrowserEvent) {\n return altKeyOnly(mapBrowserEvent) && singleClick(mapBrowserEvent);\n };\n /**\n * @type {import(\"../events/condition.js\").Condition}\n * @private\n */\n _this.deleteCondition_ = options.deleteCondition\n ? options.deleteCondition\n : _this.defaultDeleteCondition_;\n /**\n * @type {import(\"../events/condition.js\").Condition}\n * @private\n */\n _this.insertVertexCondition_ = options.insertVertexCondition\n ? options.insertVertexCondition\n : always;\n /**\n * Editing vertex.\n * @type {Feature}\n * @private\n */\n _this.vertexFeature_ = null;\n /**\n * Segments intersecting {@link this.vertexFeature_} by segment uid.\n * @type {Object}\n * @private\n */\n _this.vertexSegments_ = null;\n /**\n * @type {import(\"../pixel.js\").Pixel}\n * @private\n */\n _this.lastPixel_ = [0, 0];\n /**\n * Tracks if the next `singleclick` event should be ignored to prevent\n * accidental deletion right after vertex creation.\n * @type {boolean}\n * @private\n */\n _this.ignoreNextSingleClick_ = false;\n /**\n * @type {Collection}\n * @private\n */\n _this.featuresBeingModified_ = null;\n /**\n * Segment RTree for each layer\n * @type {RBush}\n * @private\n */\n _this.rBush_ = new RBush();\n /**\n * @type {number}\n * @private\n */\n _this.pixelTolerance_ =\n options.pixelTolerance !== undefined ? options.pixelTolerance : 10;\n /**\n * @type {boolean}\n * @private\n */\n _this.snappedToVertex_ = false;\n /**\n * Indicate whether the interaction is currently changing a feature's\n * coordinates.\n * @type {boolean}\n * @private\n */\n _this.changingFeature_ = false;\n /**\n * @type {Array}\n * @private\n */\n _this.dragSegments_ = [];\n /**\n * Draw overlay where sketch features are drawn.\n * @type {VectorLayer}\n * @private\n */\n _this.overlay_ = new VectorLayer({\n source: new VectorSource({\n useSpatialIndex: false,\n wrapX: !!options.wrapX,\n }),\n style: options.style ? options.style : getDefaultStyleFunction(),\n updateWhileAnimating: true,\n updateWhileInteracting: true,\n });\n /**\n * @const\n * @private\n * @type {!Object}\n */\n _this.SEGMENT_WRITERS_ = {\n 'Point': _this.writePointGeometry_.bind(_this),\n 'LineString': _this.writeLineStringGeometry_.bind(_this),\n 'LinearRing': _this.writeLineStringGeometry_.bind(_this),\n 'Polygon': _this.writePolygonGeometry_.bind(_this),\n 'MultiPoint': _this.writeMultiPointGeometry_.bind(_this),\n 'MultiLineString': _this.writeMultiLineStringGeometry_.bind(_this),\n 'MultiPolygon': _this.writeMultiPolygonGeometry_.bind(_this),\n 'Circle': _this.writeCircleGeometry_.bind(_this),\n 'GeometryCollection': _this.writeGeometryCollectionGeometry_.bind(_this),\n };\n /**\n * @type {VectorSource}\n * @private\n */\n _this.source_ = null;\n /**\n * @type {boolean|import(\"../layer/BaseVector\").default}\n */\n _this.hitDetection_ = null;\n var features;\n if (options.features) {\n features = options.features;\n }\n else if (options.source) {\n _this.source_ = options.source;\n features = new Collection(_this.source_.getFeatures());\n _this.source_.addEventListener(VectorEventType.ADDFEATURE, _this.handleSourceAdd_.bind(_this));\n _this.source_.addEventListener(VectorEventType.REMOVEFEATURE, _this.handleSourceRemove_.bind(_this));\n }\n if (!features) {\n throw new Error('The modify interaction requires features, a source or a layer');\n }\n if (options.hitDetection) {\n _this.hitDetection_ = options.hitDetection;\n }\n /**\n * @type {Collection}\n * @private\n */\n _this.features_ = features;\n _this.features_.forEach(_this.addFeature_.bind(_this));\n _this.features_.addEventListener(CollectionEventType.ADD, _this.handleFeatureAdd_.bind(_this));\n _this.features_.addEventListener(CollectionEventType.REMOVE, _this.handleFeatureRemove_.bind(_this));\n /**\n * @type {import(\"../MapBrowserEvent.js\").default}\n * @private\n */\n _this.lastPointerEvent_ = null;\n /**\n * Delta (x, y in map units) between matched rtree vertex and pointer vertex.\n * @type {Array}\n */\n _this.delta_ = [0, 0];\n /**\n * @private\n */\n _this.snapToPointer_ =\n options.snapToPointer === undefined\n ? !_this.hitDetection_\n : options.snapToPointer;\n return _this;\n }\n /**\n * @param {Feature} feature Feature.\n * @private\n */\n Modify.prototype.addFeature_ = function (feature) {\n var geometry = feature.getGeometry();\n if (geometry) {\n var writer = this.SEGMENT_WRITERS_[geometry.getType()];\n if (writer) {\n writer(feature, geometry);\n }\n }\n var map = this.getMap();\n if (map && map.isRendered() && this.getActive()) {\n this.handlePointerAtPixel_(this.lastPixel_, map);\n }\n feature.addEventListener(EventType.CHANGE, this.boundHandleFeatureChange_);\n };\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} evt Map browser event.\n * @param {Array>} segments The segments subject to modification.\n * @private\n */\n Modify.prototype.willModifyFeatures_ = function (evt, segments) {\n if (!this.featuresBeingModified_) {\n this.featuresBeingModified_ = new Collection();\n var features = this.featuresBeingModified_.getArray();\n for (var i = 0, ii = segments.length; i < ii; ++i) {\n var segment = segments[i];\n for (var s = 0, ss = segment.length; s < ss; ++s) {\n var feature = segment[s].feature;\n if (feature && features.indexOf(feature) === -1) {\n this.featuresBeingModified_.push(feature);\n }\n }\n }\n if (this.featuresBeingModified_.getLength() === 0) {\n this.featuresBeingModified_ = null;\n }\n else {\n this.dispatchEvent(new ModifyEvent(ModifyEventType.MODIFYSTART, this.featuresBeingModified_, evt));\n }\n }\n };\n /**\n * @param {Feature} feature Feature.\n * @private\n */\n Modify.prototype.removeFeature_ = function (feature) {\n this.removeFeatureSegmentData_(feature);\n // Remove the vertex feature if the collection of candidate features is empty.\n if (this.vertexFeature_ && this.features_.getLength() === 0) {\n this.overlay_.getSource().removeFeature(this.vertexFeature_);\n this.vertexFeature_ = null;\n }\n feature.removeEventListener(EventType.CHANGE, this.boundHandleFeatureChange_);\n };\n /**\n * @param {Feature} feature Feature.\n * @private\n */\n Modify.prototype.removeFeatureSegmentData_ = function (feature) {\n var rBush = this.rBush_;\n /** @type {Array} */\n var nodesToRemove = [];\n rBush.forEach(\n /**\n * @param {SegmentData} node RTree node.\n */\n function (node) {\n if (feature === node.feature) {\n nodesToRemove.push(node);\n }\n });\n for (var i = nodesToRemove.length - 1; i >= 0; --i) {\n var nodeToRemove = nodesToRemove[i];\n for (var j = this.dragSegments_.length - 1; j >= 0; --j) {\n if (this.dragSegments_[j][0] === nodeToRemove) {\n this.dragSegments_.splice(j, 1);\n }\n }\n rBush.remove(nodeToRemove);\n }\n };\n /**\n * Activate or deactivate the interaction.\n * @param {boolean} active Active.\n * @observable\n * @api\n */\n Modify.prototype.setActive = function (active) {\n if (this.vertexFeature_ && !active) {\n this.overlay_.getSource().removeFeature(this.vertexFeature_);\n this.vertexFeature_ = null;\n }\n _super.prototype.setActive.call(this, active);\n };\n /**\n * Remove the interaction from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../PluggableMap.js\").default} map Map.\n */\n Modify.prototype.setMap = function (map) {\n this.overlay_.setMap(map);\n _super.prototype.setMap.call(this, map);\n };\n /**\n * Get the overlay layer that this interaction renders the modification point or vertex to.\n * @return {VectorLayer} Overlay layer.\n * @api\n */\n Modify.prototype.getOverlay = function () {\n return this.overlay_;\n };\n /**\n * @param {import(\"../source/Vector.js\").VectorSourceEvent} event Event.\n * @private\n */\n Modify.prototype.handleSourceAdd_ = function (event) {\n if (event.feature) {\n this.features_.push(event.feature);\n }\n };\n /**\n * @param {import(\"../source/Vector.js\").VectorSourceEvent} event Event.\n * @private\n */\n Modify.prototype.handleSourceRemove_ = function (event) {\n if (event.feature) {\n this.features_.remove(event.feature);\n }\n };\n /**\n * @param {import(\"../Collection.js\").CollectionEvent} evt Event.\n * @private\n */\n Modify.prototype.handleFeatureAdd_ = function (evt) {\n this.addFeature_(/** @type {Feature} */ (evt.element));\n };\n /**\n * @param {import(\"../events/Event.js\").default} evt Event.\n * @private\n */\n Modify.prototype.handleFeatureChange_ = function (evt) {\n if (!this.changingFeature_) {\n var feature = /** @type {Feature} */ (evt.target);\n this.removeFeature_(feature);\n this.addFeature_(feature);\n }\n };\n /**\n * @param {import(\"../Collection.js\").CollectionEvent} evt Event.\n * @private\n */\n Modify.prototype.handleFeatureRemove_ = function (evt) {\n var feature = /** @type {Feature} */ (evt.element);\n this.removeFeature_(feature);\n };\n /**\n * @param {Feature} feature Feature\n * @param {Point} geometry Geometry.\n * @private\n */\n Modify.prototype.writePointGeometry_ = function (feature, geometry) {\n var coordinates = geometry.getCoordinates();\n /** @type {SegmentData} */\n var segmentData = {\n feature: feature,\n geometry: geometry,\n segment: [coordinates, coordinates],\n };\n this.rBush_.insert(geometry.getExtent(), segmentData);\n };\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/MultiPoint.js\").default} geometry Geometry.\n * @private\n */\n Modify.prototype.writeMultiPointGeometry_ = function (feature, geometry) {\n var points = geometry.getCoordinates();\n for (var i = 0, ii = points.length; i < ii; ++i) {\n var coordinates = points[i];\n /** @type {SegmentData} */\n var segmentData = {\n feature: feature,\n geometry: geometry,\n depth: [i],\n index: i,\n segment: [coordinates, coordinates],\n };\n this.rBush_.insert(geometry.getExtent(), segmentData);\n }\n };\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/LineString.js\").default} geometry Geometry.\n * @private\n */\n Modify.prototype.writeLineStringGeometry_ = function (feature, geometry) {\n var coordinates = geometry.getCoordinates();\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n var segment = coordinates.slice(i, i + 2);\n /** @type {SegmentData} */\n var segmentData = {\n feature: feature,\n geometry: geometry,\n index: i,\n segment: segment,\n };\n this.rBush_.insert(boundingExtent(segment), segmentData);\n }\n };\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/MultiLineString.js\").default} geometry Geometry.\n * @private\n */\n Modify.prototype.writeMultiLineStringGeometry_ = function (feature, geometry) {\n var lines = geometry.getCoordinates();\n for (var j = 0, jj = lines.length; j < jj; ++j) {\n var coordinates = lines[j];\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n var segment = coordinates.slice(i, i + 2);\n /** @type {SegmentData} */\n var segmentData = {\n feature: feature,\n geometry: geometry,\n depth: [j],\n index: i,\n segment: segment,\n };\n this.rBush_.insert(boundingExtent(segment), segmentData);\n }\n }\n };\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/Polygon.js\").default} geometry Geometry.\n * @private\n */\n Modify.prototype.writePolygonGeometry_ = function (feature, geometry) {\n var rings = geometry.getCoordinates();\n for (var j = 0, jj = rings.length; j < jj; ++j) {\n var coordinates = rings[j];\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n var segment = coordinates.slice(i, i + 2);\n /** @type {SegmentData} */\n var segmentData = {\n feature: feature,\n geometry: geometry,\n depth: [j],\n index: i,\n segment: segment,\n };\n this.rBush_.insert(boundingExtent(segment), segmentData);\n }\n }\n };\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/MultiPolygon.js\").default} geometry Geometry.\n * @private\n */\n Modify.prototype.writeMultiPolygonGeometry_ = function (feature, geometry) {\n var polygons = geometry.getCoordinates();\n for (var k = 0, kk = polygons.length; k < kk; ++k) {\n var rings = polygons[k];\n for (var j = 0, jj = rings.length; j < jj; ++j) {\n var coordinates = rings[j];\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n var segment = coordinates.slice(i, i + 2);\n /** @type {SegmentData} */\n var segmentData = {\n feature: feature,\n geometry: geometry,\n depth: [j, k],\n index: i,\n segment: segment,\n };\n this.rBush_.insert(boundingExtent(segment), segmentData);\n }\n }\n }\n };\n /**\n * We convert a circle into two segments. The segment at index\n * {@link CIRCLE_CENTER_INDEX} is the\n * circle's center (a point). The segment at index\n * {@link CIRCLE_CIRCUMFERENCE_INDEX} is\n * the circumference, and is not a line segment.\n *\n * @param {Feature} feature Feature.\n * @param {import(\"../geom/Circle.js\").default} geometry Geometry.\n * @private\n */\n Modify.prototype.writeCircleGeometry_ = function (feature, geometry) {\n var coordinates = geometry.getCenter();\n /** @type {SegmentData} */\n var centerSegmentData = {\n feature: feature,\n geometry: geometry,\n index: CIRCLE_CENTER_INDEX,\n segment: [coordinates, coordinates],\n };\n /** @type {SegmentData} */\n var circumferenceSegmentData = {\n feature: feature,\n geometry: geometry,\n index: CIRCLE_CIRCUMFERENCE_INDEX,\n segment: [coordinates, coordinates],\n };\n var featureSegments = [centerSegmentData, circumferenceSegmentData];\n centerSegmentData.featureSegments = featureSegments;\n circumferenceSegmentData.featureSegments = featureSegments;\n this.rBush_.insert(createExtent(coordinates), centerSegmentData);\n var circleGeometry = /** @type {import(\"../geom/Geometry.js\").default} */ (geometry);\n var userProjection = getUserProjection();\n if (userProjection && this.getMap()) {\n var projection = this.getMap().getView().getProjection();\n circleGeometry = circleGeometry\n .clone()\n .transform(userProjection, projection);\n circleGeometry = fromCircle(\n /** @type {import(\"../geom/Circle.js\").default} */ (circleGeometry)).transform(projection, userProjection);\n }\n this.rBush_.insert(circleGeometry.getExtent(), circumferenceSegmentData);\n };\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/GeometryCollection.js\").default} geometry Geometry.\n * @private\n */\n Modify.prototype.writeGeometryCollectionGeometry_ = function (feature, geometry) {\n var geometries = geometry.getGeometriesArray();\n for (var i = 0; i < geometries.length; ++i) {\n var geometry_1 = geometries[i];\n var writer = this.SEGMENT_WRITERS_[geometry_1.getType()];\n writer(feature, geometry_1);\n }\n };\n /**\n * @param {import(\"../coordinate.js\").Coordinate} coordinates Coordinates.\n * @param {Array} features The features being modified.\n * @param {Array} geometries The geometries being modified.\n * @return {Feature} Vertex feature.\n * @private\n */\n Modify.prototype.createOrUpdateVertexFeature_ = function (coordinates, features, geometries) {\n var vertexFeature = this.vertexFeature_;\n if (!vertexFeature) {\n vertexFeature = new Feature(new Point(coordinates));\n this.vertexFeature_ = vertexFeature;\n this.overlay_.getSource().addFeature(vertexFeature);\n }\n else {\n var geometry = vertexFeature.getGeometry();\n geometry.setCoordinates(coordinates);\n }\n vertexFeature.set('features', features);\n vertexFeature.set('geometries', geometries);\n return vertexFeature;\n };\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} and may modify the geometry.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n */\n Modify.prototype.handleEvent = function (mapBrowserEvent) {\n if (!mapBrowserEvent.originalEvent) {\n return true;\n }\n this.lastPointerEvent_ = mapBrowserEvent;\n var handled;\n if (!mapBrowserEvent.map.getView().getInteracting() &&\n mapBrowserEvent.type == MapBrowserEventType.POINTERMOVE &&\n !this.handlingDownUpSequence) {\n this.handlePointerMove_(mapBrowserEvent);\n }\n if (this.vertexFeature_ && this.deleteCondition_(mapBrowserEvent)) {\n if (mapBrowserEvent.type != MapBrowserEventType.SINGLECLICK ||\n !this.ignoreNextSingleClick_) {\n handled = this.removePoint();\n }\n else {\n handled = true;\n }\n }\n if (mapBrowserEvent.type == MapBrowserEventType.SINGLECLICK) {\n this.ignoreNextSingleClick_ = false;\n }\n return _super.prototype.handleEvent.call(this, mapBrowserEvent) && !handled;\n };\n /**\n * Handle pointer drag events.\n * @param {import(\"../MapBrowserEvent.js\").default} evt Event.\n */\n Modify.prototype.handleDragEvent = function (evt) {\n this.ignoreNextSingleClick_ = false;\n this.willModifyFeatures_(evt, this.dragSegments_);\n var vertex = [\n evt.coordinate[0] + this.delta_[0],\n evt.coordinate[1] + this.delta_[1],\n ];\n var features = [];\n var geometries = [];\n for (var i = 0, ii = this.dragSegments_.length; i < ii; ++i) {\n var dragSegment = this.dragSegments_[i];\n var segmentData = dragSegment[0];\n var feature = segmentData.feature;\n if (features.indexOf(feature) === -1) {\n features.push(feature);\n }\n var geometry = segmentData.geometry;\n if (geometries.indexOf(geometry) === -1) {\n geometries.push(geometry);\n }\n var depth = segmentData.depth;\n var coordinates = void 0;\n var segment = segmentData.segment;\n var index = dragSegment[1];\n while (vertex.length < geometry.getStride()) {\n vertex.push(segment[index][vertex.length]);\n }\n switch (geometry.getType()) {\n case 'Point':\n coordinates = vertex;\n segment[0] = vertex;\n segment[1] = vertex;\n break;\n case 'MultiPoint':\n coordinates = geometry.getCoordinates();\n coordinates[segmentData.index] = vertex;\n segment[0] = vertex;\n segment[1] = vertex;\n break;\n case 'LineString':\n coordinates = geometry.getCoordinates();\n coordinates[segmentData.index + index] = vertex;\n segment[index] = vertex;\n break;\n case 'MultiLineString':\n coordinates = geometry.getCoordinates();\n coordinates[depth[0]][segmentData.index + index] = vertex;\n segment[index] = vertex;\n break;\n case 'Polygon':\n coordinates = geometry.getCoordinates();\n coordinates[depth[0]][segmentData.index + index] = vertex;\n segment[index] = vertex;\n break;\n case 'MultiPolygon':\n coordinates = geometry.getCoordinates();\n coordinates[depth[1]][depth[0]][segmentData.index + index] = vertex;\n segment[index] = vertex;\n break;\n case 'Circle':\n segment[0] = vertex;\n segment[1] = vertex;\n if (segmentData.index === CIRCLE_CENTER_INDEX) {\n this.changingFeature_ = true;\n geometry.setCenter(vertex);\n this.changingFeature_ = false;\n }\n else {\n // We're dragging the circle's circumference:\n this.changingFeature_ = true;\n var projection = evt.map.getView().getProjection();\n var radius = coordinateDistance(fromUserCoordinate(geometry.getCenter(), projection), fromUserCoordinate(vertex, projection));\n var userProjection = getUserProjection();\n if (userProjection) {\n var circleGeometry = geometry\n .clone()\n .transform(userProjection, projection);\n circleGeometry.setRadius(radius);\n radius = circleGeometry\n .transform(projection, userProjection)\n .getRadius();\n }\n geometry.setRadius(radius);\n this.changingFeature_ = false;\n }\n break;\n default:\n // pass\n }\n if (coordinates) {\n this.setGeometryCoordinates_(geometry, coordinates);\n }\n }\n this.createOrUpdateVertexFeature_(vertex, features, geometries);\n };\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserEvent.js\").default} evt Event.\n * @return {boolean} If the event was consumed.\n */\n Modify.prototype.handleDownEvent = function (evt) {\n if (!this.condition_(evt)) {\n return false;\n }\n var pixelCoordinate = evt.coordinate;\n this.handlePointerAtPixel_(evt.pixel, evt.map, pixelCoordinate);\n this.dragSegments_.length = 0;\n this.featuresBeingModified_ = null;\n var vertexFeature = this.vertexFeature_;\n if (vertexFeature) {\n var projection = evt.map.getView().getProjection();\n var insertVertices = [];\n var vertex = vertexFeature.getGeometry().getCoordinates();\n var vertexExtent = boundingExtent([vertex]);\n var segmentDataMatches = this.rBush_.getInExtent(vertexExtent);\n var componentSegments = {};\n segmentDataMatches.sort(compareIndexes);\n for (var i = 0, ii = segmentDataMatches.length; i < ii; ++i) {\n var segmentDataMatch = segmentDataMatches[i];\n var segment = segmentDataMatch.segment;\n var uid = getUid(segmentDataMatch.geometry);\n var depth = segmentDataMatch.depth;\n if (depth) {\n uid += '-' + depth.join('-'); // separate feature components\n }\n if (!componentSegments[uid]) {\n componentSegments[uid] = new Array(2);\n }\n if (segmentDataMatch.geometry.getType() === 'Circle' &&\n segmentDataMatch.index === CIRCLE_CIRCUMFERENCE_INDEX) {\n var closestVertex = closestOnSegmentData(pixelCoordinate, segmentDataMatch, projection);\n if (coordinatesEqual(closestVertex, vertex) &&\n !componentSegments[uid][0]) {\n this.dragSegments_.push([segmentDataMatch, 0]);\n componentSegments[uid][0] = segmentDataMatch;\n }\n continue;\n }\n if (coordinatesEqual(segment[0], vertex) &&\n !componentSegments[uid][0]) {\n this.dragSegments_.push([segmentDataMatch, 0]);\n componentSegments[uid][0] = segmentDataMatch;\n continue;\n }\n if (coordinatesEqual(segment[1], vertex) &&\n !componentSegments[uid][1]) {\n if (componentSegments[uid][0] &&\n componentSegments[uid][0].index === 0) {\n var coordinates = segmentDataMatch.geometry.getCoordinates();\n switch (segmentDataMatch.geometry.getType()) {\n // prevent dragging closed linestrings by the connecting node\n case 'LineString':\n case 'MultiLineString':\n continue;\n // if dragging the first vertex of a polygon, ensure the other segment\n // belongs to the closing vertex of the linear ring\n case 'MultiPolygon':\n coordinates = coordinates[depth[1]];\n /* falls through */\n case 'Polygon':\n if (segmentDataMatch.index !==\n coordinates[depth[0]].length - 2) {\n continue;\n }\n break;\n default:\n // pass\n }\n }\n this.dragSegments_.push([segmentDataMatch, 1]);\n componentSegments[uid][1] = segmentDataMatch;\n continue;\n }\n if (getUid(segment) in this.vertexSegments_ &&\n !componentSegments[uid][0] &&\n !componentSegments[uid][1] &&\n this.insertVertexCondition_(evt)) {\n insertVertices.push(segmentDataMatch);\n }\n }\n if (insertVertices.length) {\n this.willModifyFeatures_(evt, [insertVertices]);\n }\n for (var j = insertVertices.length - 1; j >= 0; --j) {\n this.insertVertex_(insertVertices[j], vertex);\n }\n }\n return !!this.vertexFeature_;\n };\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} evt Event.\n * @return {boolean} If the event was consumed.\n */\n Modify.prototype.handleUpEvent = function (evt) {\n for (var i = this.dragSegments_.length - 1; i >= 0; --i) {\n var segmentData = this.dragSegments_[i][0];\n var geometry = segmentData.geometry;\n if (geometry.getType() === 'Circle') {\n // Update a circle object in the R* bush:\n var coordinates = geometry.getCenter();\n var centerSegmentData = segmentData.featureSegments[0];\n var circumferenceSegmentData = segmentData.featureSegments[1];\n centerSegmentData.segment[0] = coordinates;\n centerSegmentData.segment[1] = coordinates;\n circumferenceSegmentData.segment[0] = coordinates;\n circumferenceSegmentData.segment[1] = coordinates;\n this.rBush_.update(createExtent(coordinates), centerSegmentData);\n var circleGeometry = geometry;\n var userProjection = getUserProjection();\n if (userProjection) {\n var projection = evt.map.getView().getProjection();\n circleGeometry = circleGeometry\n .clone()\n .transform(userProjection, projection);\n circleGeometry = fromCircle(circleGeometry).transform(projection, userProjection);\n }\n this.rBush_.update(circleGeometry.getExtent(), circumferenceSegmentData);\n }\n else {\n this.rBush_.update(boundingExtent(segmentData.segment), segmentData);\n }\n }\n if (this.featuresBeingModified_) {\n this.dispatchEvent(new ModifyEvent(ModifyEventType.MODIFYEND, this.featuresBeingModified_, evt));\n this.featuresBeingModified_ = null;\n }\n return false;\n };\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} evt Event.\n * @private\n */\n Modify.prototype.handlePointerMove_ = function (evt) {\n this.lastPixel_ = evt.pixel;\n this.handlePointerAtPixel_(evt.pixel, evt.map, evt.coordinate);\n };\n /**\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel\n * @param {import(\"../PluggableMap.js\").default} map Map.\n * @param {import(\"../coordinate.js\").Coordinate} [opt_coordinate] The pixel Coordinate.\n * @private\n */\n Modify.prototype.handlePointerAtPixel_ = function (pixel, map, opt_coordinate) {\n var _this = this;\n var pixelCoordinate = opt_coordinate || map.getCoordinateFromPixel(pixel);\n var projection = map.getView().getProjection();\n var sortByDistance = function (a, b) {\n return (projectedDistanceToSegmentDataSquared(pixelCoordinate, a, projection) -\n projectedDistanceToSegmentDataSquared(pixelCoordinate, b, projection));\n };\n /** @type {Array|undefined} */\n var nodes;\n var hitPointGeometry;\n if (this.hitDetection_) {\n var layerFilter = typeof this.hitDetection_ === 'object'\n ? function (layer) { return layer === _this.hitDetection_; }\n : undefined;\n map.forEachFeatureAtPixel(pixel, function (feature, layer, geometry) {\n geometry =\n geometry ||\n /** @type {import(\"../geom/SimpleGeometry\").default} */ (feature.getGeometry());\n if (geometry.getType() === 'Point' &&\n includes(_this.features_.getArray(), feature)) {\n hitPointGeometry = geometry;\n var coordinate = geometry.getFlatCoordinates().slice(0, 2);\n nodes = [\n {\n feature: feature,\n geometry: geometry,\n segment: [coordinate, coordinate],\n },\n ];\n }\n return true;\n }, { layerFilter: layerFilter });\n }\n if (!nodes) {\n var viewExtent = fromUserExtent(createExtent(pixelCoordinate, tempExtent), projection);\n var buffer = map.getView().getResolution() * this.pixelTolerance_;\n var box = toUserExtent(bufferExtent(viewExtent, buffer, tempExtent), projection);\n nodes = this.rBush_.getInExtent(box);\n }\n if (nodes && nodes.length > 0) {\n var node = nodes.sort(sortByDistance)[0];\n var closestSegment = node.segment;\n var vertex = closestOnSegmentData(pixelCoordinate, node, projection);\n var vertexPixel = map.getPixelFromCoordinate(vertex);\n var dist = coordinateDistance(pixel, vertexPixel);\n if (hitPointGeometry || dist <= this.pixelTolerance_) {\n /** @type {Object} */\n var vertexSegments = {};\n vertexSegments[getUid(closestSegment)] = true;\n if (!this.snapToPointer_) {\n this.delta_[0] = vertex[0] - pixelCoordinate[0];\n this.delta_[1] = vertex[1] - pixelCoordinate[1];\n }\n if (node.geometry.getType() === 'Circle' &&\n node.index === CIRCLE_CIRCUMFERENCE_INDEX) {\n this.snappedToVertex_ = true;\n this.createOrUpdateVertexFeature_(vertex, [node.feature], [node.geometry]);\n }\n else {\n var pixel1 = map.getPixelFromCoordinate(closestSegment[0]);\n var pixel2 = map.getPixelFromCoordinate(closestSegment[1]);\n var squaredDist1 = squaredCoordinateDistance(vertexPixel, pixel1);\n var squaredDist2 = squaredCoordinateDistance(vertexPixel, pixel2);\n dist = Math.sqrt(Math.min(squaredDist1, squaredDist2));\n this.snappedToVertex_ = dist <= this.pixelTolerance_;\n if (this.snappedToVertex_) {\n vertex =\n squaredDist1 > squaredDist2\n ? closestSegment[1]\n : closestSegment[0];\n }\n this.createOrUpdateVertexFeature_(vertex, [node.feature], [node.geometry]);\n var geometries = {};\n geometries[getUid(node.geometry)] = true;\n for (var i = 1, ii = nodes.length; i < ii; ++i) {\n var segment = nodes[i].segment;\n if ((coordinatesEqual(closestSegment[0], segment[0]) &&\n coordinatesEqual(closestSegment[1], segment[1])) ||\n (coordinatesEqual(closestSegment[0], segment[1]) &&\n coordinatesEqual(closestSegment[1], segment[0]))) {\n var geometryUid = getUid(nodes[i].geometry);\n if (!(geometryUid in geometries)) {\n geometries[geometryUid] = true;\n vertexSegments[getUid(segment)] = true;\n }\n }\n else {\n break;\n }\n }\n }\n this.vertexSegments_ = vertexSegments;\n return;\n }\n }\n if (this.vertexFeature_) {\n this.overlay_.getSource().removeFeature(this.vertexFeature_);\n this.vertexFeature_ = null;\n }\n };\n /**\n * @param {SegmentData} segmentData Segment data.\n * @param {import(\"../coordinate.js\").Coordinate} vertex Vertex.\n * @private\n */\n Modify.prototype.insertVertex_ = function (segmentData, vertex) {\n var segment = segmentData.segment;\n var feature = segmentData.feature;\n var geometry = segmentData.geometry;\n var depth = segmentData.depth;\n var index = segmentData.index;\n var coordinates;\n while (vertex.length < geometry.getStride()) {\n vertex.push(0);\n }\n switch (geometry.getType()) {\n case 'MultiLineString':\n coordinates = geometry.getCoordinates();\n coordinates[depth[0]].splice(index + 1, 0, vertex);\n break;\n case 'Polygon':\n coordinates = geometry.getCoordinates();\n coordinates[depth[0]].splice(index + 1, 0, vertex);\n break;\n case 'MultiPolygon':\n coordinates = geometry.getCoordinates();\n coordinates[depth[1]][depth[0]].splice(index + 1, 0, vertex);\n break;\n case 'LineString':\n coordinates = geometry.getCoordinates();\n coordinates.splice(index + 1, 0, vertex);\n break;\n default:\n return;\n }\n this.setGeometryCoordinates_(geometry, coordinates);\n var rTree = this.rBush_;\n rTree.remove(segmentData);\n this.updateSegmentIndices_(geometry, index, depth, 1);\n /** @type {SegmentData} */\n var newSegmentData = {\n segment: [segment[0], vertex],\n feature: feature,\n geometry: geometry,\n depth: depth,\n index: index,\n };\n rTree.insert(boundingExtent(newSegmentData.segment), newSegmentData);\n this.dragSegments_.push([newSegmentData, 1]);\n /** @type {SegmentData} */\n var newSegmentData2 = {\n segment: [vertex, segment[1]],\n feature: feature,\n geometry: geometry,\n depth: depth,\n index: index + 1,\n };\n rTree.insert(boundingExtent(newSegmentData2.segment), newSegmentData2);\n this.dragSegments_.push([newSegmentData2, 0]);\n this.ignoreNextSingleClick_ = true;\n };\n /**\n * Removes the vertex currently being pointed.\n * @return {boolean} True when a vertex was removed.\n * @api\n */\n Modify.prototype.removePoint = function () {\n if (this.lastPointerEvent_ &&\n this.lastPointerEvent_.type != MapBrowserEventType.POINTERDRAG) {\n var evt = this.lastPointerEvent_;\n this.willModifyFeatures_(evt, this.dragSegments_);\n var removed = this.removeVertex_();\n if (this.featuresBeingModified_) {\n this.dispatchEvent(new ModifyEvent(ModifyEventType.MODIFYEND, this.featuresBeingModified_, evt));\n }\n this.featuresBeingModified_ = null;\n return removed;\n }\n return false;\n };\n /**\n * Removes a vertex from all matching features.\n * @return {boolean} True when a vertex was removed.\n * @private\n */\n Modify.prototype.removeVertex_ = function () {\n var dragSegments = this.dragSegments_;\n var segmentsByFeature = {};\n var deleted = false;\n var component, coordinates, dragSegment, geometry, i, index, left;\n var newIndex, right, segmentData, uid;\n for (i = dragSegments.length - 1; i >= 0; --i) {\n dragSegment = dragSegments[i];\n segmentData = dragSegment[0];\n uid = getUid(segmentData.feature);\n if (segmentData.depth) {\n // separate feature components\n uid += '-' + segmentData.depth.join('-');\n }\n if (!(uid in segmentsByFeature)) {\n segmentsByFeature[uid] = {};\n }\n if (dragSegment[1] === 0) {\n segmentsByFeature[uid].right = segmentData;\n segmentsByFeature[uid].index = segmentData.index;\n }\n else if (dragSegment[1] == 1) {\n segmentsByFeature[uid].left = segmentData;\n segmentsByFeature[uid].index = segmentData.index + 1;\n }\n }\n for (uid in segmentsByFeature) {\n right = segmentsByFeature[uid].right;\n left = segmentsByFeature[uid].left;\n index = segmentsByFeature[uid].index;\n newIndex = index - 1;\n if (left !== undefined) {\n segmentData = left;\n }\n else {\n segmentData = right;\n }\n if (newIndex < 0) {\n newIndex = 0;\n }\n geometry = segmentData.geometry;\n coordinates = geometry.getCoordinates();\n component = coordinates;\n deleted = false;\n switch (geometry.getType()) {\n case 'MultiLineString':\n if (coordinates[segmentData.depth[0]].length > 2) {\n coordinates[segmentData.depth[0]].splice(index, 1);\n deleted = true;\n }\n break;\n case 'LineString':\n if (coordinates.length > 2) {\n coordinates.splice(index, 1);\n deleted = true;\n }\n break;\n case 'MultiPolygon':\n component = component[segmentData.depth[1]];\n /* falls through */\n case 'Polygon':\n component = component[segmentData.depth[0]];\n if (component.length > 4) {\n if (index == component.length - 1) {\n index = 0;\n }\n component.splice(index, 1);\n deleted = true;\n if (index === 0) {\n // close the ring again\n component.pop();\n component.push(component[0]);\n newIndex = component.length - 1;\n }\n }\n break;\n default:\n // pass\n }\n if (deleted) {\n this.setGeometryCoordinates_(geometry, coordinates);\n var segments = [];\n if (left !== undefined) {\n this.rBush_.remove(left);\n segments.push(left.segment[0]);\n }\n if (right !== undefined) {\n this.rBush_.remove(right);\n segments.push(right.segment[1]);\n }\n if (left !== undefined && right !== undefined) {\n /** @type {SegmentData} */\n var newSegmentData = {\n depth: segmentData.depth,\n feature: segmentData.feature,\n geometry: segmentData.geometry,\n index: newIndex,\n segment: segments,\n };\n this.rBush_.insert(boundingExtent(newSegmentData.segment), newSegmentData);\n }\n this.updateSegmentIndices_(geometry, index, segmentData.depth, -1);\n if (this.vertexFeature_) {\n this.overlay_.getSource().removeFeature(this.vertexFeature_);\n this.vertexFeature_ = null;\n }\n dragSegments.length = 0;\n }\n }\n return deleted;\n };\n /**\n * @param {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @param {Array} coordinates Coordinates.\n * @private\n */\n Modify.prototype.setGeometryCoordinates_ = function (geometry, coordinates) {\n this.changingFeature_ = true;\n geometry.setCoordinates(coordinates);\n this.changingFeature_ = false;\n };\n /**\n * @param {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @param {number} index Index.\n * @param {Array|undefined} depth Depth.\n * @param {number} delta Delta (1 or -1).\n * @private\n */\n Modify.prototype.updateSegmentIndices_ = function (geometry, index, depth, delta) {\n this.rBush_.forEachInExtent(geometry.getExtent(), function (segmentDataMatch) {\n if (segmentDataMatch.geometry === geometry &&\n (depth === undefined ||\n segmentDataMatch.depth === undefined ||\n equals(segmentDataMatch.depth, depth)) &&\n segmentDataMatch.index > index) {\n segmentDataMatch.index += delta;\n }\n });\n };\n return Modify;\n}(PointerInteraction));\n/**\n * @param {SegmentData} a The first segment data.\n * @param {SegmentData} b The second segment data.\n * @return {number} The difference in indexes.\n */\nfunction compareIndexes(a, b) {\n return a.index - b.index;\n}\n/**\n * Returns the distance from a point to a line segment.\n *\n * @param {import(\"../coordinate.js\").Coordinate} pointCoordinates The coordinates of the point from\n * which to calculate the distance.\n * @param {SegmentData} segmentData The object describing the line\n * segment we are calculating the distance to.\n * @param {import(\"../proj/Projection.js\").default} projection The view projection.\n * @return {number} The square of the distance between a point and a line segment.\n */\nfunction projectedDistanceToSegmentDataSquared(pointCoordinates, segmentData, projection) {\n var geometry = segmentData.geometry;\n if (geometry.getType() === 'Circle') {\n var circleGeometry = /** @type {import(\"../geom/Circle.js\").default} */ (geometry);\n if (segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {\n var userProjection = getUserProjection();\n if (userProjection) {\n circleGeometry = /** @type {import(\"../geom/Circle.js\").default} */ (circleGeometry.clone().transform(userProjection, projection));\n }\n var distanceToCenterSquared = squaredCoordinateDistance(circleGeometry.getCenter(), fromUserCoordinate(pointCoordinates, projection));\n var distanceToCircumference = Math.sqrt(distanceToCenterSquared) - circleGeometry.getRadius();\n return distanceToCircumference * distanceToCircumference;\n }\n }\n var coordinate = fromUserCoordinate(pointCoordinates, projection);\n tempSegment[0] = fromUserCoordinate(segmentData.segment[0], projection);\n tempSegment[1] = fromUserCoordinate(segmentData.segment[1], projection);\n return squaredDistanceToSegment(coordinate, tempSegment);\n}\n/**\n * Returns the point closest to a given line segment.\n *\n * @param {import(\"../coordinate.js\").Coordinate} pointCoordinates The point to which a closest point\n * should be found.\n * @param {SegmentData} segmentData The object describing the line\n * segment which should contain the closest point.\n * @param {import(\"../proj/Projection.js\").default} projection The view projection.\n * @return {import(\"../coordinate.js\").Coordinate} The point closest to the specified line segment.\n */\nfunction closestOnSegmentData(pointCoordinates, segmentData, projection) {\n var geometry = segmentData.geometry;\n if (geometry.getType() === 'Circle' &&\n segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {\n var circleGeometry = /** @type {import(\"../geom/Circle.js\").default} */ (geometry);\n var userProjection = getUserProjection();\n if (userProjection) {\n circleGeometry = /** @type {import(\"../geom/Circle.js\").default} */ (circleGeometry.clone().transform(userProjection, projection));\n }\n return toUserCoordinate(circleGeometry.getClosestPoint(fromUserCoordinate(pointCoordinates, projection)), projection);\n }\n var coordinate = fromUserCoordinate(pointCoordinates, projection);\n tempSegment[0] = fromUserCoordinate(segmentData.segment[0], projection);\n tempSegment[1] = fromUserCoordinate(segmentData.segment[1], projection);\n return toUserCoordinate(closestOnSegment(coordinate, tempSegment), projection);\n}\n/**\n * @return {import(\"../style/Style.js\").StyleFunction} Styles.\n */\nfunction getDefaultStyleFunction() {\n var style = createEditingStyle();\n return function (feature, resolution) {\n return style['Point'];\n };\n}\nexport default Modify;\n//# sourceMappingURL=Modify.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/MouseWheelZoom\n */\nimport EventType from '../events/EventType.js';\nimport Interaction, { zoomByDelta } from './Interaction.js';\nimport { DEVICE_PIXEL_RATIO, FIREFOX } from '../has.js';\nimport { all, always, focusWithTabindex } from '../events/condition.js';\nimport { clamp } from '../math.js';\n/**\n * @enum {string}\n */\nexport var Mode = {\n TRACKPAD: 'trackpad',\n WHEEL: 'wheel',\n};\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. Default is\n * {@link module:ol/events/condition.always}.\n * @property {boolean} [onFocusOnly=false] When the map's target has a `tabindex` attribute set,\n * the interaction will only handle events when the map has the focus.\n * @property {number} [maxDelta=1] Maximum mouse wheel delta.\n * @property {number} [duration=250] Animation duration in milliseconds.\n * @property {number} [timeout=80] Mouse wheel timeout duration in milliseconds.\n * @property {boolean} [useAnchor=true] Enable zooming using the mouse's\n * location as the anchor. When set to `false`, zooming in and out will zoom to\n * the center of the screen instead of zooming on the mouse's location.\n * @property {boolean} [constrainResolution=false] If true, the mouse wheel zoom\n * event will always animate to the closest zoom level after an interaction;\n * false means intermediary zoom levels are allowed.\n */\n/**\n * @classdesc\n * Allows the user to zoom the map by scrolling the mouse wheel.\n * @api\n */\nvar MouseWheelZoom = /** @class */ (function (_super) {\n __extends(MouseWheelZoom, _super);\n /**\n * @param {Options} [opt_options] Options.\n */\n function MouseWheelZoom(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, \n /** @type {import(\"./Interaction.js\").InteractionOptions} */ (options)) || this;\n /**\n * @private\n * @type {number}\n */\n _this.totalDelta_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.lastDelta_ = 0;\n /**\n * @private\n * @type {number}\n */\n _this.maxDelta_ = options.maxDelta !== undefined ? options.maxDelta : 1;\n /**\n * @private\n * @type {number}\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 250;\n /**\n * @private\n * @type {number}\n */\n _this.timeout_ = options.timeout !== undefined ? options.timeout : 80;\n /**\n * @private\n * @type {boolean}\n */\n _this.useAnchor_ =\n options.useAnchor !== undefined ? options.useAnchor : true;\n /**\n * @private\n * @type {boolean}\n */\n _this.constrainResolution_ =\n options.constrainResolution !== undefined\n ? options.constrainResolution\n : false;\n var condition = options.condition ? options.condition : always;\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ = options.onFocusOnly\n ? all(focusWithTabindex, condition)\n : condition;\n /**\n * @private\n * @type {?import(\"../coordinate.js\").Coordinate}\n */\n _this.lastAnchor_ = null;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.startTime_ = undefined;\n /**\n * @private\n * @type {?}\n */\n _this.timeoutId_;\n /**\n * @private\n * @type {Mode|undefined}\n */\n _this.mode_ = undefined;\n /**\n * Trackpad events separated by this delay will be considered separate\n * interactions.\n * @type {number}\n */\n _this.trackpadEventGap_ = 400;\n /**\n * @type {?}\n */\n _this.trackpadTimeoutId_;\n /**\n * The number of delta values per zoom level\n * @private\n * @type {number}\n */\n _this.deltaPerZoom_ = 300;\n return _this;\n }\n /**\n * @private\n */\n MouseWheelZoom.prototype.endInteraction_ = function () {\n this.trackpadTimeoutId_ = undefined;\n var map = this.getMap();\n if (!map) {\n return;\n }\n var view = map.getView();\n view.endInteraction(undefined, this.lastDelta_ ? (this.lastDelta_ > 0 ? 1 : -1) : 0, this.lastAnchor_);\n };\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} (if it was a mousewheel-event) and eventually\n * zooms the map.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n */\n MouseWheelZoom.prototype.handleEvent = function (mapBrowserEvent) {\n if (!this.condition_(mapBrowserEvent)) {\n return true;\n }\n var type = mapBrowserEvent.type;\n if (type !== EventType.WHEEL) {\n return true;\n }\n var map = mapBrowserEvent.map;\n var wheelEvent = /** @type {WheelEvent} */ (mapBrowserEvent.originalEvent);\n wheelEvent.preventDefault();\n if (this.useAnchor_) {\n this.lastAnchor_ = mapBrowserEvent.coordinate;\n }\n // Delta normalisation inspired by\n // https://github.com/mapbox/mapbox-gl-js/blob/001c7b9/js/ui/handler/scroll_zoom.js\n var delta;\n if (mapBrowserEvent.type == EventType.WHEEL) {\n delta = wheelEvent.deltaY;\n if (FIREFOX && wheelEvent.deltaMode === WheelEvent.DOM_DELTA_PIXEL) {\n delta /= DEVICE_PIXEL_RATIO;\n }\n if (wheelEvent.deltaMode === WheelEvent.DOM_DELTA_LINE) {\n delta *= 40;\n }\n }\n if (delta === 0) {\n return false;\n }\n else {\n this.lastDelta_ = delta;\n }\n var now = Date.now();\n if (this.startTime_ === undefined) {\n this.startTime_ = now;\n }\n if (!this.mode_ || now - this.startTime_ > this.trackpadEventGap_) {\n this.mode_ = Math.abs(delta) < 4 ? Mode.TRACKPAD : Mode.WHEEL;\n }\n var view = map.getView();\n if (this.mode_ === Mode.TRACKPAD &&\n !(view.getConstrainResolution() || this.constrainResolution_)) {\n if (this.trackpadTimeoutId_) {\n clearTimeout(this.trackpadTimeoutId_);\n }\n else {\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n view.beginInteraction();\n }\n this.trackpadTimeoutId_ = setTimeout(this.endInteraction_.bind(this), this.timeout_);\n view.adjustZoom(-delta / this.deltaPerZoom_, this.lastAnchor_);\n this.startTime_ = now;\n return false;\n }\n this.totalDelta_ += delta;\n var timeLeft = Math.max(this.timeout_ - (now - this.startTime_), 0);\n clearTimeout(this.timeoutId_);\n this.timeoutId_ = setTimeout(this.handleWheelZoom_.bind(this, map), timeLeft);\n return false;\n };\n /**\n * @private\n * @param {import(\"../PluggableMap.js\").default} map Map.\n */\n MouseWheelZoom.prototype.handleWheelZoom_ = function (map) {\n var view = map.getView();\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n var delta = -clamp(this.totalDelta_, -this.maxDelta_ * this.deltaPerZoom_, this.maxDelta_ * this.deltaPerZoom_) / this.deltaPerZoom_;\n if (view.getConstrainResolution() || this.constrainResolution_) {\n // view has a zoom constraint, zoom by 1\n delta = delta ? (delta > 0 ? 1 : -1) : 0;\n }\n zoomByDelta(view, delta, this.lastAnchor_, this.duration_);\n this.mode_ = undefined;\n this.totalDelta_ = 0;\n this.lastAnchor_ = null;\n this.startTime_ = undefined;\n this.timeoutId_ = undefined;\n };\n /**\n * Enable or disable using the mouse's location as an anchor when zooming\n * @param {boolean} useAnchor true to zoom to the mouse's location, false\n * to zoom to the center of the map\n * @api\n */\n MouseWheelZoom.prototype.setMouseAnchor = function (useAnchor) {\n this.useAnchor_ = useAnchor;\n if (!useAnchor) {\n this.lastAnchor_ = null;\n }\n };\n return MouseWheelZoom;\n}(Interaction));\nexport default MouseWheelZoom;\n//# sourceMappingURL=MouseWheelZoom.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/PinchRotate\n */\nimport PointerInteraction, { centroid as centroidFromPointers, } from './Pointer.js';\nimport { FALSE } from '../functions.js';\nimport { disable } from '../rotationconstraint.js';\n/**\n * @typedef {Object} Options\n * @property {number} [duration=250] The duration of the animation in\n * milliseconds.\n * @property {number} [threshold=0.3] Minimal angle in radians to start a rotation.\n */\n/**\n * @classdesc\n * Allows the user to rotate the map by twisting with two fingers\n * on a touch screen.\n * @api\n */\nvar PinchRotate = /** @class */ (function (_super) {\n __extends(PinchRotate, _super);\n /**\n * @param {Options} [opt_options] Options.\n */\n function PinchRotate(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n var pointerOptions = /** @type {import(\"./Pointer.js\").Options} */ (options);\n if (!pointerOptions.stopDown) {\n pointerOptions.stopDown = FALSE;\n }\n _this = _super.call(this, pointerOptions) || this;\n /**\n * @private\n * @type {import(\"../coordinate.js\").Coordinate}\n */\n _this.anchor_ = null;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.lastAngle_ = undefined;\n /**\n * @private\n * @type {boolean}\n */\n _this.rotating_ = false;\n /**\n * @private\n * @type {number}\n */\n _this.rotationDelta_ = 0.0;\n /**\n * @private\n * @type {number}\n */\n _this.threshold_ = options.threshold !== undefined ? options.threshold : 0.3;\n /**\n * @private\n * @type {number}\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 250;\n return _this;\n }\n /**\n * Handle pointer drag events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n */\n PinchRotate.prototype.handleDragEvent = function (mapBrowserEvent) {\n var rotationDelta = 0.0;\n var touch0 = this.targetPointers[0];\n var touch1 = this.targetPointers[1];\n // angle between touches\n var angle = Math.atan2(touch1.clientY - touch0.clientY, touch1.clientX - touch0.clientX);\n if (this.lastAngle_ !== undefined) {\n var delta = angle - this.lastAngle_;\n this.rotationDelta_ += delta;\n if (!this.rotating_ && Math.abs(this.rotationDelta_) > this.threshold_) {\n this.rotating_ = true;\n }\n rotationDelta = delta;\n }\n this.lastAngle_ = angle;\n var map = mapBrowserEvent.map;\n var view = map.getView();\n if (view.getConstraints().rotation === disable) {\n return;\n }\n // rotate anchor point.\n // FIXME: should be the intersection point between the lines:\n // touch0,touch1 and previousTouch0,previousTouch1\n var viewportPosition = map.getViewport().getBoundingClientRect();\n var centroid = centroidFromPointers(this.targetPointers);\n centroid[0] -= viewportPosition.left;\n centroid[1] -= viewportPosition.top;\n this.anchor_ = map.getCoordinateFromPixelInternal(centroid);\n // rotate\n if (this.rotating_) {\n map.render();\n view.adjustRotationInternal(rotationDelta, this.anchor_);\n }\n };\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n PinchRotate.prototype.handleUpEvent = function (mapBrowserEvent) {\n if (this.targetPointers.length < 2) {\n var map = mapBrowserEvent.map;\n var view = map.getView();\n view.endInteraction(this.duration_);\n return false;\n }\n else {\n return true;\n }\n };\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n PinchRotate.prototype.handleDownEvent = function (mapBrowserEvent) {\n if (this.targetPointers.length >= 2) {\n var map = mapBrowserEvent.map;\n this.anchor_ = null;\n this.lastAngle_ = undefined;\n this.rotating_ = false;\n this.rotationDelta_ = 0.0;\n if (!this.handlingDownUpSequence) {\n map.getView().beginInteraction();\n }\n return true;\n }\n else {\n return false;\n }\n };\n return PinchRotate;\n}(PointerInteraction));\nexport default PinchRotate;\n//# sourceMappingURL=PinchRotate.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/PinchZoom\n */\nimport PointerInteraction, { centroid as centroidFromPointers, } from './Pointer.js';\nimport { FALSE } from '../functions.js';\n/**\n * @typedef {Object} Options\n * @property {number} [duration=400] Animation duration in milliseconds.\n */\n/**\n * @classdesc\n * Allows the user to zoom the map by pinching with two fingers\n * on a touch screen.\n * @api\n */\nvar PinchZoom = /** @class */ (function (_super) {\n __extends(PinchZoom, _super);\n /**\n * @param {Options} [opt_options] Options.\n */\n function PinchZoom(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n var pointerOptions = /** @type {import(\"./Pointer.js\").Options} */ (options);\n if (!pointerOptions.stopDown) {\n pointerOptions.stopDown = FALSE;\n }\n _this = _super.call(this, pointerOptions) || this;\n /**\n * @private\n * @type {import(\"../coordinate.js\").Coordinate}\n */\n _this.anchor_ = null;\n /**\n * @private\n * @type {number}\n */\n _this.duration_ = options.duration !== undefined ? options.duration : 400;\n /**\n * @private\n * @type {number|undefined}\n */\n _this.lastDistance_ = undefined;\n /**\n * @private\n * @type {number}\n */\n _this.lastScaleDelta_ = 1;\n return _this;\n }\n /**\n * Handle pointer drag events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n */\n PinchZoom.prototype.handleDragEvent = function (mapBrowserEvent) {\n var scaleDelta = 1.0;\n var touch0 = this.targetPointers[0];\n var touch1 = this.targetPointers[1];\n var dx = touch0.clientX - touch1.clientX;\n var dy = touch0.clientY - touch1.clientY;\n // distance between touches\n var distance = Math.sqrt(dx * dx + dy * dy);\n if (this.lastDistance_ !== undefined) {\n scaleDelta = this.lastDistance_ / distance;\n }\n this.lastDistance_ = distance;\n var map = mapBrowserEvent.map;\n var view = map.getView();\n if (scaleDelta != 1.0) {\n this.lastScaleDelta_ = scaleDelta;\n }\n // scale anchor point.\n var viewportPosition = map.getViewport().getBoundingClientRect();\n var centroid = centroidFromPointers(this.targetPointers);\n centroid[0] -= viewportPosition.left;\n centroid[1] -= viewportPosition.top;\n this.anchor_ = map.getCoordinateFromPixelInternal(centroid);\n // scale, bypass the resolution constraint\n map.render();\n view.adjustResolutionInternal(scaleDelta, this.anchor_);\n };\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n PinchZoom.prototype.handleUpEvent = function (mapBrowserEvent) {\n if (this.targetPointers.length < 2) {\n var map = mapBrowserEvent.map;\n var view = map.getView();\n var direction = this.lastScaleDelta_ > 1 ? 1 : -1;\n view.endInteraction(this.duration_, direction);\n return false;\n }\n else {\n return true;\n }\n };\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n PinchZoom.prototype.handleDownEvent = function (mapBrowserEvent) {\n if (this.targetPointers.length >= 2) {\n var map = mapBrowserEvent.map;\n this.anchor_ = null;\n this.lastDistance_ = undefined;\n this.lastScaleDelta_ = 1;\n if (!this.handlingDownUpSequence) {\n map.getView().beginInteraction();\n }\n return true;\n }\n else {\n return false;\n }\n };\n return PinchZoom;\n}(PointerInteraction));\nexport default PinchZoom;\n//# sourceMappingURL=PinchZoom.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Pointer\n */\nimport Interaction from './Interaction.js';\nimport MapBrowserEventType from '../MapBrowserEventType.js';\n/**\n * @typedef {Object} Options\n * @property {function(import(\"../MapBrowserEvent.js\").default):boolean} [handleDownEvent]\n * Function handling \"down\" events. If the function returns `true` then a drag\n * sequence is started.\n * @property {function(import(\"../MapBrowserEvent.js\").default):void} [handleDragEvent]\n * Function handling \"drag\" events. This function is called on \"move\" events\n * during a drag sequence.\n * @property {function(import(\"../MapBrowserEvent.js\").default):boolean} [handleEvent]\n * Method called by the map to notify the interaction that a browser event was\n * dispatched to the map. The function may return `false` to prevent the\n * propagation of the event to other interactions in the map's interactions\n * chain.\n * @property {function(import(\"../MapBrowserEvent.js\").default):void} [handleMoveEvent]\n * Function handling \"move\" events. This function is called on \"move\" events.\n * This functions is also called during a drag sequence, so during a drag\n * sequence both the `handleDragEvent` function and this function are called.\n * If `handleDownEvent` is defined and it returns true this function will not\n * be called during a drag sequence.\n * @property {function(import(\"../MapBrowserEvent.js\").default):boolean} [handleUpEvent]\n * Function handling \"up\" events. If the function returns `false` then the\n * current drag sequence is stopped.\n * @property {function(boolean):boolean} [stopDown]\n * Should the down event be propagated to other interactions, or should be\n * stopped?\n */\n/**\n * @classdesc\n * Base class that calls user-defined functions on `down`, `move` and `up`\n * events. This class also manages \"drag sequences\".\n *\n * When the `handleDownEvent` user function returns `true` a drag sequence is\n * started. During a drag sequence the `handleDragEvent` user function is\n * called on `move` events. The drag sequence ends when the `handleUpEvent`\n * user function is called and returns `false`.\n * @api\n */\nvar PointerInteraction = /** @class */ (function (_super) {\n __extends(PointerInteraction, _super);\n /**\n * @param {Options} [opt_options] Options.\n */\n function PointerInteraction(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, \n /** @type {import(\"./Interaction.js\").InteractionOptions} */ (options)) || this;\n if (options.handleDownEvent) {\n _this.handleDownEvent = options.handleDownEvent;\n }\n if (options.handleDragEvent) {\n _this.handleDragEvent = options.handleDragEvent;\n }\n if (options.handleMoveEvent) {\n _this.handleMoveEvent = options.handleMoveEvent;\n }\n if (options.handleUpEvent) {\n _this.handleUpEvent = options.handleUpEvent;\n }\n if (options.stopDown) {\n _this.stopDown = options.stopDown;\n }\n /**\n * @type {boolean}\n * @protected\n */\n _this.handlingDownUpSequence = false;\n /**\n * @type {Array}\n * @protected\n */\n _this.targetPointers = [];\n return _this;\n }\n /**\n * Returns the current number of pointers involved in the interaction,\n * e.g. `2` when two fingers are used.\n * @return {number} The number of pointers.\n * @api\n */\n PointerInteraction.prototype.getPointerCount = function () {\n return this.targetPointers.length;\n };\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n * @protected\n */\n PointerInteraction.prototype.handleDownEvent = function (mapBrowserEvent) {\n return false;\n };\n /**\n * Handle pointer drag events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @protected\n */\n PointerInteraction.prototype.handleDragEvent = function (mapBrowserEvent) { };\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} and may call into\n * other functions, if event sequences like e.g. 'drag' or 'down-up' etc. are\n * detected.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @api\n */\n PointerInteraction.prototype.handleEvent = function (mapBrowserEvent) {\n if (!mapBrowserEvent.originalEvent) {\n return true;\n }\n var stopEvent = false;\n this.updateTrackedPointers_(mapBrowserEvent);\n if (this.handlingDownUpSequence) {\n if (mapBrowserEvent.type == MapBrowserEventType.POINTERDRAG) {\n this.handleDragEvent(mapBrowserEvent);\n // prevent page scrolling during dragging\n mapBrowserEvent.originalEvent.preventDefault();\n }\n else if (mapBrowserEvent.type == MapBrowserEventType.POINTERUP) {\n var handledUp = this.handleUpEvent(mapBrowserEvent);\n this.handlingDownUpSequence =\n handledUp && this.targetPointers.length > 0;\n }\n }\n else {\n if (mapBrowserEvent.type == MapBrowserEventType.POINTERDOWN) {\n var handled = this.handleDownEvent(mapBrowserEvent);\n this.handlingDownUpSequence = handled;\n stopEvent = this.stopDown(handled);\n }\n else if (mapBrowserEvent.type == MapBrowserEventType.POINTERMOVE) {\n this.handleMoveEvent(mapBrowserEvent);\n }\n }\n return !stopEvent;\n };\n /**\n * Handle pointer move events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @protected\n */\n PointerInteraction.prototype.handleMoveEvent = function (mapBrowserEvent) { };\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n * @protected\n */\n PointerInteraction.prototype.handleUpEvent = function (mapBrowserEvent) {\n return false;\n };\n /**\n * This function is used to determine if \"down\" events should be propagated\n * to other interactions or should be stopped.\n * @param {boolean} handled Was the event handled by the interaction?\n * @return {boolean} Should the `down` event be stopped?\n */\n PointerInteraction.prototype.stopDown = function (handled) {\n return handled;\n };\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @private\n */\n PointerInteraction.prototype.updateTrackedPointers_ = function (mapBrowserEvent) {\n if (mapBrowserEvent.activePointers) {\n this.targetPointers = mapBrowserEvent.activePointers;\n }\n };\n return PointerInteraction;\n}(Interaction));\n/**\n * @param {Array} pointerEvents List of events.\n * @return {import(\"../pixel.js\").Pixel} Centroid pixel.\n */\nexport function centroid(pointerEvents) {\n var length = pointerEvents.length;\n var clientX = 0;\n var clientY = 0;\n for (var i = 0; i < length; i++) {\n clientX += pointerEvents[i].clientX;\n clientY += pointerEvents[i].clientY;\n }\n return [clientX / length, clientY / length];\n}\nexport default PointerInteraction;\n//# sourceMappingURL=Pointer.js.map","/**\n * @module ol/interaction/Property\n */\n/**\n * @enum {string}\n */\nexport default {\n ACTIVE: 'active',\n};\n//# sourceMappingURL=Property.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Select\n */\nimport Collection from '../Collection.js';\nimport CollectionEventType from '../CollectionEventType.js';\nimport Event from '../events/Event.js';\nimport Interaction from './Interaction.js';\nimport VectorLayer from '../layer/Vector.js';\nimport { TRUE } from '../functions.js';\nimport { clear } from '../obj.js';\nimport { createEditingStyle } from '../style/Style.js';\nimport { extend, includes } from '../array.js';\nimport { getUid } from '../util.js';\nimport { never, shiftKeyOnly, singleClick } from '../events/condition.js';\n/**\n * @enum {string}\n */\nvar SelectEventType = {\n /**\n * Triggered when feature(s) has been (de)selected.\n * @event SelectEvent#select\n * @api\n */\n SELECT: 'select',\n};\n/**\n * A function that takes an {@link module:ol/Feature~Feature} or\n * {@link module:ol/render/Feature~RenderFeature} and an\n * {@link module:ol/layer/Layer~Layer} and returns `true` if the feature may be\n * selected or `false` otherwise.\n * @typedef {function(import(\"../Feature.js\").FeatureLike, import(\"../layer/Layer.js\").default):boolean} FilterFunction\n */\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [addCondition] A function\n * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled.\n * By default, this is {@link module:ol/events/condition.never}. Use this if you\n * want to use different events for add and remove instead of `toggle`.\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. This is the event\n * for the selected features as a whole. By default, this is\n * {@link module:ol/events/condition.singleClick}. Clicking on a feature selects that\n * feature and removes any that were in the selection. Clicking outside any\n * feature removes all from the selection.\n * See `toggle`, `add`, `remove` options for adding/removing extra features to/\n * from the selection.\n * @property {Array|function(import(\"../layer/Layer.js\").default): boolean} [layers]\n * A list of layers from which features should be selected. Alternatively, a\n * filter function can be provided. The function will be called for each layer\n * in the map and should return `true` for layers that you want to be\n * selectable. If the option is absent, all visible layers will be considered\n * selectable.\n * @property {import(\"../style/Style.js\").StyleLike|null} [style]\n * Style for the selected features. By default the default edit style is used\n * (see {@link module:ol/style/Style~Style}). Set to `null` if this interaction should not apply\n * any style changes for selected features.\n * If set to a falsey value, the selected feature's style will not change.\n * @property {import(\"../events/condition.js\").Condition} [removeCondition] A function\n * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled.\n * By default, this is {@link module:ol/events/condition.never}. Use this if you\n * want to use different events for add and remove instead of `toggle`.\n * @property {import(\"../events/condition.js\").Condition} [toggleCondition] A function\n * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. This is in addition\n * to the `condition` event. By default,\n * {@link module:ol/events/condition.shiftKeyOnly}, i.e. pressing `shift` as\n * well as the `condition` event, adds that feature to the current selection if\n * it is not currently selected, and removes it if it is. See `add` and `remove`\n * if you want to use different events instead of a toggle.\n * @property {boolean} [multi=false] A boolean that determines if the default\n * behaviour should select only single features or all (overlapping) features at\n * the clicked map position. The default of `false` means single select.\n * @property {import(\"../Collection.js\").default} [features]\n * Collection where the interaction will place selected features. Optional. If\n * not set the interaction will create a collection. In any case the collection\n * used by the interaction is returned by\n * {@link module:ol/interaction/Select~Select#getFeatures}.\n * @property {FilterFunction} [filter] A function\n * that takes an {@link module:ol/Feature~Feature} and an\n * {@link module:ol/layer/Layer~Layer} and returns `true` if the feature may be\n * selected or `false` otherwise.\n * @property {number} [hitTolerance=0] Hit-detection tolerance. Pixels inside\n * the radius around the given position will be checked for features.\n */\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/Select~Select} instances are instances of\n * this type.\n */\nvar SelectEvent = /** @class */ (function (_super) {\n __extends(SelectEvent, _super);\n /**\n * @param {SelectEventType} type The event type.\n * @param {Array} selected Selected features.\n * @param {Array} deselected Deselected features.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Associated\n * {@link module:ol/MapBrowserEvent~MapBrowserEvent}.\n */\n function SelectEvent(type, selected, deselected, mapBrowserEvent) {\n var _this = _super.call(this, type) || this;\n /**\n * Selected features array.\n * @type {Array}\n * @api\n */\n _this.selected = selected;\n /**\n * Deselected features array.\n * @type {Array}\n * @api\n */\n _this.deselected = deselected;\n /**\n * Associated {@link module:ol/MapBrowserEvent~MapBrowserEvent}.\n * @type {import(\"../MapBrowserEvent.js\").default}\n * @api\n */\n _this.mapBrowserEvent = mapBrowserEvent;\n return _this;\n }\n return SelectEvent;\n}(Event));\nexport { SelectEvent };\n/**\n * Original feature styles to reset to when features are no longer selected.\n * @type {Object|import(\"../style/Style.js\").StyleFunction>}\n */\nvar originalFeatureStyles = {};\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature &\n * import(\"../Observable\").OnSignature &\n * import(\"../Observable\").OnSignature<'select', SelectEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature} SelectOnSignature\n */\n/**\n * @classdesc\n * Interaction for selecting vector features. By default, selected features are\n * styled differently, so this interaction can be used for visual highlighting,\n * as well as selecting features for other actions, such as modification or\n * output. There are three ways of controlling which features are selected:\n * using the browser event as defined by the `condition` and optionally the\n * `toggle`, `add`/`remove`, and `multi` options; a `layers` filter; and a\n * further feature filter using the `filter` option.\n *\n * @fires SelectEvent\n * @api\n */\nvar Select = /** @class */ (function (_super) {\n __extends(Select, _super);\n /**\n * @param {Options} [opt_options] Options.\n */\n function Select(opt_options) {\n var _this = _super.call(this) || this;\n /***\n * @type {SelectOnSignature}\n */\n _this.on;\n /***\n * @type {SelectOnSignature}\n */\n _this.once;\n /***\n * @type {SelectOnSignature}\n */\n _this.un;\n var options = opt_options ? opt_options : {};\n /**\n * @private\n */\n _this.boundAddFeature_ = _this.addFeature_.bind(_this);\n /**\n * @private\n */\n _this.boundRemoveFeature_ = _this.removeFeature_.bind(_this);\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ = options.condition ? options.condition : singleClick;\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.addCondition_ = options.addCondition ? options.addCondition : never;\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.removeCondition_ = options.removeCondition\n ? options.removeCondition\n : never;\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.toggleCondition_ = options.toggleCondition\n ? options.toggleCondition\n : shiftKeyOnly;\n /**\n * @private\n * @type {boolean}\n */\n _this.multi_ = options.multi ? options.multi : false;\n /**\n * @private\n * @type {FilterFunction}\n */\n _this.filter_ = options.filter ? options.filter : TRUE;\n /**\n * @private\n * @type {number}\n */\n _this.hitTolerance_ = options.hitTolerance ? options.hitTolerance : 0;\n /**\n * @private\n * @type {import(\"../style/Style.js\").default|Array|import(\"../style/Style.js\").StyleFunction|null}\n */\n _this.style_ =\n options.style !== undefined ? options.style : getDefaultStyleFunction();\n /**\n * @private\n * @type {import(\"../Collection.js\").default}\n */\n _this.features_ = options.features || new Collection();\n /** @type {function(import(\"../layer/Layer.js\").default): boolean} */\n var layerFilter;\n if (options.layers) {\n if (typeof options.layers === 'function') {\n layerFilter = options.layers;\n }\n else {\n var layers_1 = options.layers;\n layerFilter = function (layer) {\n return includes(layers_1, layer);\n };\n }\n }\n else {\n layerFilter = TRUE;\n }\n /**\n * @private\n * @type {function(import(\"../layer/Layer.js\").default): boolean}\n */\n _this.layerFilter_ = layerFilter;\n /**\n * An association between selected feature (key)\n * and layer (value)\n * @private\n * @type {Object}\n */\n _this.featureLayerAssociation_ = {};\n return _this;\n }\n /**\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../layer/Layer.js\").default} layer Layer.\n * @private\n */\n Select.prototype.addFeatureLayerAssociation_ = function (feature, layer) {\n this.featureLayerAssociation_[getUid(feature)] = layer;\n };\n /**\n * Get the selected features.\n * @return {import(\"../Collection.js\").default} Features collection.\n * @api\n */\n Select.prototype.getFeatures = function () {\n return this.features_;\n };\n /**\n * Returns the Hit-detection tolerance.\n * @return {number} Hit tolerance in pixels.\n * @api\n */\n Select.prototype.getHitTolerance = function () {\n return this.hitTolerance_;\n };\n /**\n * Returns the associated {@link module:ol/layer/Vector~VectorLayer vector layer} of\n * a selected feature.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature\n * @return {import('../layer/Vector.js').default} Layer.\n * @api\n */\n Select.prototype.getLayer = function (feature) {\n return /** @type {import('../layer/Vector.js').default} */ (this.featureLayerAssociation_[getUid(feature)]);\n };\n /**\n * Hit-detection tolerance. Pixels inside the radius around the given position\n * will be checked for features.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @api\n */\n Select.prototype.setHitTolerance = function (hitTolerance) {\n this.hitTolerance_ = hitTolerance;\n };\n /**\n * Remove the interaction from its current map, if any, and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {import(\"../PluggableMap.js\").default|null} map Map.\n * @api\n */\n Select.prototype.setMap = function (map) {\n var currentMap = this.getMap();\n if (currentMap && this.style_) {\n this.features_.forEach(this.restorePreviousStyle_.bind(this));\n }\n _super.prototype.setMap.call(this, map);\n if (map) {\n this.features_.addEventListener(CollectionEventType.ADD, this.boundAddFeature_);\n this.features_.addEventListener(CollectionEventType.REMOVE, this.boundRemoveFeature_);\n if (this.style_) {\n this.features_.forEach(this.applySelectedStyle_.bind(this));\n }\n }\n else {\n this.features_.removeEventListener(CollectionEventType.ADD, this.boundAddFeature_);\n this.features_.removeEventListener(CollectionEventType.REMOVE, this.boundRemoveFeature_);\n }\n };\n /**\n * @param {import(\"../Collection.js\").CollectionEvent} evt Event.\n * @private\n */\n Select.prototype.addFeature_ = function (evt) {\n var feature = evt.element;\n if (this.style_) {\n this.applySelectedStyle_(feature);\n }\n if (!this.getLayer(feature)) {\n var layer = /** @type {VectorLayer} */ (this.getMap()\n .getAllLayers()\n .find(function (layer) {\n if (layer instanceof VectorLayer &&\n layer.getSource() &&\n layer.getSource().hasFeature(feature)) {\n return layer;\n }\n }));\n if (layer) {\n this.addFeatureLayerAssociation_(feature, layer);\n }\n }\n };\n /**\n * @param {import(\"../Collection.js\").CollectionEvent} evt Event.\n * @private\n */\n Select.prototype.removeFeature_ = function (evt) {\n var feature = evt.element;\n if (this.style_) {\n this.restorePreviousStyle_(feature);\n }\n };\n /**\n * @return {import(\"../style/Style.js\").StyleLike|null} Select style.\n */\n Select.prototype.getStyle = function () {\n return this.style_;\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @private\n */\n Select.prototype.applySelectedStyle_ = function (feature) {\n var key = getUid(feature);\n if (!(key in originalFeatureStyles)) {\n originalFeatureStyles[key] = feature.getStyle();\n }\n feature.setStyle(this.style_);\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @private\n */\n Select.prototype.restorePreviousStyle_ = function (feature) {\n var interactions = this.getMap().getInteractions().getArray();\n for (var i = interactions.length - 1; i >= 0; --i) {\n var interaction = interactions[i];\n if (interaction !== this &&\n interaction instanceof Select &&\n interaction.getStyle() &&\n interaction.getFeatures().getArray().lastIndexOf(feature) !== -1) {\n feature.setStyle(interaction.getStyle());\n return;\n }\n }\n var key = getUid(feature);\n feature.setStyle(originalFeatureStyles[key]);\n delete originalFeatureStyles[key];\n };\n /**\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @private\n */\n Select.prototype.removeFeatureLayerAssociation_ = function (feature) {\n delete this.featureLayerAssociation_[getUid(feature)];\n };\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} and may change the\n * selected state of features.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @this {Select}\n */\n Select.prototype.handleEvent = function (mapBrowserEvent) {\n if (!this.condition_(mapBrowserEvent)) {\n return true;\n }\n var add = this.addCondition_(mapBrowserEvent);\n var remove = this.removeCondition_(mapBrowserEvent);\n var toggle = this.toggleCondition_(mapBrowserEvent);\n var set = !add && !remove && !toggle;\n var map = mapBrowserEvent.map;\n var features = this.getFeatures();\n var deselected = [];\n var selected = [];\n if (set) {\n // Replace the currently selected feature(s) with the feature(s) at the\n // pixel, or clear the selected feature(s) if there is no feature at\n // the pixel.\n clear(this.featureLayerAssociation_);\n map.forEachFeatureAtPixel(mapBrowserEvent.pixel, \n /**\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../layer/Layer.js\").default} layer Layer.\n * @return {boolean|undefined} Continue to iterate over the features.\n */\n function (feature, layer) {\n if (this.filter_(feature, layer)) {\n this.addFeatureLayerAssociation_(feature, layer);\n selected.push(feature);\n return !this.multi_;\n }\n }.bind(this), {\n layerFilter: this.layerFilter_,\n hitTolerance: this.hitTolerance_,\n });\n for (var i = features.getLength() - 1; i >= 0; --i) {\n var feature = features.item(i);\n var index = selected.indexOf(feature);\n if (index > -1) {\n // feature is already selected\n selected.splice(index, 1);\n }\n else {\n features.remove(feature);\n deselected.push(feature);\n }\n }\n if (selected.length !== 0) {\n features.extend(selected);\n }\n }\n else {\n // Modify the currently selected feature(s).\n map.forEachFeatureAtPixel(mapBrowserEvent.pixel, \n /**\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../layer/Layer.js\").default} layer Layer.\n * @return {boolean|undefined} Continue to iterate over the features.\n */\n function (feature, layer) {\n if (this.filter_(feature, layer)) {\n if ((add || toggle) && !includes(features.getArray(), feature)) {\n this.addFeatureLayerAssociation_(feature, layer);\n selected.push(feature);\n }\n else if ((remove || toggle) &&\n includes(features.getArray(), feature)) {\n deselected.push(feature);\n this.removeFeatureLayerAssociation_(feature);\n }\n return !this.multi_;\n }\n }.bind(this), {\n layerFilter: this.layerFilter_,\n hitTolerance: this.hitTolerance_,\n });\n for (var j = deselected.length - 1; j >= 0; --j) {\n features.remove(deselected[j]);\n }\n features.extend(selected);\n }\n if (selected.length > 0 || deselected.length > 0) {\n this.dispatchEvent(new SelectEvent(SelectEventType.SELECT, selected, deselected, mapBrowserEvent));\n }\n return true;\n };\n return Select;\n}(Interaction));\n/**\n * @return {import(\"../style/Style.js\").StyleFunction} Styles.\n */\nfunction getDefaultStyleFunction() {\n var styles = createEditingStyle();\n extend(styles['Polygon'], styles['LineString']);\n extend(styles['GeometryCollection'], styles['LineString']);\n return function (feature) {\n if (!feature.getGeometry()) {\n return null;\n }\n return styles[feature.getGeometry().getType()];\n };\n}\nexport default Select;\n//# sourceMappingURL=Select.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Snap\n */\nimport CollectionEventType from '../CollectionEventType.js';\nimport EventType from '../events/EventType.js';\nimport PointerInteraction from './Pointer.js';\nimport RBush from '../structs/RBush.js';\nimport VectorEventType from '../source/VectorEventType.js';\nimport { FALSE, TRUE } from '../functions.js';\nimport { boundingExtent, createEmpty } from '../extent.js';\nimport { closestOnCircle, closestOnSegment, squaredDistance, } from '../coordinate.js';\nimport { fromCircle } from '../geom/Polygon.js';\nimport { fromUserCoordinate, getUserProjection, toUserCoordinate, } from '../proj.js';\nimport { getUid } from '../util.js';\nimport { getValues } from '../obj.js';\nimport { listen, unlistenByKey } from '../events.js';\n/**\n * @typedef {Object} Result\n * @property {import(\"../coordinate.js\").Coordinate|null} vertex Vertex.\n * @property {import(\"../pixel.js\").Pixel|null} vertexPixel VertexPixel.\n */\n/**\n * @typedef {Object} SegmentData\n * @property {import(\"../Feature.js\").default} feature Feature.\n * @property {Array} segment Segment.\n */\n/**\n * @typedef {Object} Options\n * @property {import(\"../Collection.js\").default} [features] Snap to these features. Either this option or source should be provided.\n * @property {boolean} [edge=true] Snap to edges.\n * @property {boolean} [vertex=true] Snap to vertices.\n * @property {number} [pixelTolerance=10] Pixel tolerance for considering the pointer close enough to a segment or\n * vertex for snapping.\n * @property {import(\"../source/Vector.js\").default} [source] Snap to features from this source. Either this option or features should be provided\n */\n/**\n * @param {import(\"../source/Vector.js\").VectorSourceEvent|import(\"../Collection.js\").CollectionEvent} evt Event.\n * @return {import(\"../Feature.js\").default} Feature.\n */\nfunction getFeatureFromEvent(evt) {\n if (\n /** @type {import(\"../source/Vector.js\").VectorSourceEvent} */ (evt).feature) {\n return /** @type {import(\"../source/Vector.js\").VectorSourceEvent} */ (evt)\n .feature;\n }\n else if (\n /** @type {import(\"../Collection.js\").CollectionEvent} */ (evt).element) {\n return /** @type {import(\"../Feature.js\").default} */ (\n /** @type {import(\"../Collection.js\").CollectionEvent} */ (evt).element);\n }\n}\nvar tempSegment = [];\n/**\n * @classdesc\n * Handles snapping of vector features while modifying or drawing them. The\n * features can come from a {@link module:ol/source/Vector~VectorSource} or {@link module:ol/Collection~Collection}\n * Any interaction object that allows the user to interact\n * with the features using the mouse can benefit from the snapping, as long\n * as it is added before.\n *\n * The snap interaction modifies map browser event `coordinate` and `pixel`\n * properties to force the snap to occur to any interaction that them.\n *\n * Example:\n *\n * import Snap from 'ol/interaction/Snap';\n *\n * const snap = new Snap({\n * source: source\n * });\n *\n * map.addInteraction(snap);\n *\n * @api\n */\nvar Snap = /** @class */ (function (_super) {\n __extends(Snap, _super);\n /**\n * @param {Options} [opt_options] Options.\n */\n function Snap(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n var pointerOptions = /** @type {import(\"./Pointer.js\").Options} */ (options);\n if (!pointerOptions.handleDownEvent) {\n pointerOptions.handleDownEvent = TRUE;\n }\n if (!pointerOptions.stopDown) {\n pointerOptions.stopDown = FALSE;\n }\n _this = _super.call(this, pointerOptions) || this;\n /**\n * @type {import(\"../source/Vector.js\").default|null}\n * @private\n */\n _this.source_ = options.source ? options.source : null;\n /**\n * @private\n * @type {boolean}\n */\n _this.vertex_ = options.vertex !== undefined ? options.vertex : true;\n /**\n * @private\n * @type {boolean}\n */\n _this.edge_ = options.edge !== undefined ? options.edge : true;\n /**\n * @type {import(\"../Collection.js\").default|null}\n * @private\n */\n _this.features_ = options.features ? options.features : null;\n /**\n * @type {Array}\n * @private\n */\n _this.featuresListenerKeys_ = [];\n /**\n * @type {Object}\n * @private\n */\n _this.featureChangeListenerKeys_ = {};\n /**\n * Extents are preserved so indexed segment can be quickly removed\n * when its feature geometry changes\n * @type {Object}\n * @private\n */\n _this.indexedFeaturesExtents_ = {};\n /**\n * If a feature geometry changes while a pointer drag|move event occurs, the\n * feature doesn't get updated right away. It will be at the next 'pointerup'\n * event fired.\n * @type {!Object}\n * @private\n */\n _this.pendingFeatures_ = {};\n /**\n * @type {number}\n * @private\n */\n _this.pixelTolerance_ =\n options.pixelTolerance !== undefined ? options.pixelTolerance : 10;\n /**\n * Segment RTree for each layer\n * @type {import(\"../structs/RBush.js\").default}\n * @private\n */\n _this.rBush_ = new RBush();\n /**\n * @const\n * @private\n * @type {Object>, import(\"../geom/Geometry.js\").default): void>}\n */\n _this.GEOMETRY_SEGMENTERS_ = {\n 'Point': _this.segmentPointGeometry_.bind(_this),\n 'LineString': _this.segmentLineStringGeometry_.bind(_this),\n 'LinearRing': _this.segmentLineStringGeometry_.bind(_this),\n 'Polygon': _this.segmentPolygonGeometry_.bind(_this),\n 'MultiPoint': _this.segmentMultiPointGeometry_.bind(_this),\n 'MultiLineString': _this.segmentMultiLineStringGeometry_.bind(_this),\n 'MultiPolygon': _this.segmentMultiPolygonGeometry_.bind(_this),\n 'GeometryCollection': _this.segmentGeometryCollectionGeometry_.bind(_this),\n 'Circle': _this.segmentCircleGeometry_.bind(_this),\n };\n return _this;\n }\n /**\n * Add a feature to the collection of features that we may snap to.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {boolean} [opt_listen] Whether to listen to the feature change or not\n * Defaults to `true`.\n * @api\n */\n Snap.prototype.addFeature = function (feature, opt_listen) {\n var register = opt_listen !== undefined ? opt_listen : true;\n var feature_uid = getUid(feature);\n var geometry = feature.getGeometry();\n if (geometry) {\n var segmenter = this.GEOMETRY_SEGMENTERS_[geometry.getType()];\n if (segmenter) {\n this.indexedFeaturesExtents_[feature_uid] = geometry.getExtent(createEmpty());\n var segments = \n /** @type {Array>} */ ([]);\n segmenter(segments, geometry);\n if (segments.length === 1) {\n this.rBush_.insert(boundingExtent(segments[0]), {\n feature: feature,\n segment: segments[0],\n });\n }\n else if (segments.length > 1) {\n var extents = segments.map(function (s) { return boundingExtent(s); });\n var segmentsData = segments.map(function (segment) { return ({\n feature: feature,\n segment: segment,\n }); });\n this.rBush_.load(extents, segmentsData);\n }\n }\n }\n if (register) {\n this.featureChangeListenerKeys_[feature_uid] = listen(feature, EventType.CHANGE, this.handleFeatureChange_, this);\n }\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @private\n */\n Snap.prototype.forEachFeatureAdd_ = function (feature) {\n this.addFeature(feature);\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @private\n */\n Snap.prototype.forEachFeatureRemove_ = function (feature) {\n this.removeFeature(feature);\n };\n /**\n * @return {import(\"../Collection.js\").default|Array} Features.\n * @private\n */\n Snap.prototype.getFeatures_ = function () {\n var features;\n if (this.features_) {\n features = this.features_;\n }\n else if (this.source_) {\n features = this.source_.getFeatures();\n }\n return features;\n };\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} evt Map browser event.\n * @return {boolean} `false` to stop event propagation.\n */\n Snap.prototype.handleEvent = function (evt) {\n var result = this.snapTo(evt.pixel, evt.coordinate, evt.map);\n if (result) {\n evt.coordinate = result.vertex.slice(0, 2);\n evt.pixel = result.vertexPixel;\n }\n return _super.prototype.handleEvent.call(this, evt);\n };\n /**\n * @param {import(\"../source/Vector.js\").VectorSourceEvent|import(\"../Collection.js\").CollectionEvent} evt Event.\n * @private\n */\n Snap.prototype.handleFeatureAdd_ = function (evt) {\n var feature = getFeatureFromEvent(evt);\n this.addFeature(feature);\n };\n /**\n * @param {import(\"../source/Vector.js\").VectorSourceEvent|import(\"../Collection.js\").CollectionEvent} evt Event.\n * @private\n */\n Snap.prototype.handleFeatureRemove_ = function (evt) {\n var feature = getFeatureFromEvent(evt);\n this.removeFeature(feature);\n };\n /**\n * @param {import(\"../events/Event.js\").default} evt Event.\n * @private\n */\n Snap.prototype.handleFeatureChange_ = function (evt) {\n var feature = /** @type {import(\"../Feature.js\").default} */ (evt.target);\n if (this.handlingDownUpSequence) {\n var uid = getUid(feature);\n if (!(uid in this.pendingFeatures_)) {\n this.pendingFeatures_[uid] = feature;\n }\n }\n else {\n this.updateFeature_(feature);\n }\n };\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} evt Event.\n * @return {boolean} If the event was consumed.\n */\n Snap.prototype.handleUpEvent = function (evt) {\n var featuresToUpdate = getValues(this.pendingFeatures_);\n if (featuresToUpdate.length) {\n featuresToUpdate.forEach(this.updateFeature_.bind(this));\n this.pendingFeatures_ = {};\n }\n return false;\n };\n /**\n * Remove a feature from the collection of features that we may snap to.\n * @param {import(\"../Feature.js\").default} feature Feature\n * @param {boolean} [opt_unlisten] Whether to unlisten to the feature change\n * or not. Defaults to `true`.\n * @api\n */\n Snap.prototype.removeFeature = function (feature, opt_unlisten) {\n var unregister = opt_unlisten !== undefined ? opt_unlisten : true;\n var feature_uid = getUid(feature);\n var extent = this.indexedFeaturesExtents_[feature_uid];\n if (extent) {\n var rBush = this.rBush_;\n var nodesToRemove_1 = [];\n rBush.forEachInExtent(extent, function (node) {\n if (feature === node.feature) {\n nodesToRemove_1.push(node);\n }\n });\n for (var i = nodesToRemove_1.length - 1; i >= 0; --i) {\n rBush.remove(nodesToRemove_1[i]);\n }\n }\n if (unregister) {\n unlistenByKey(this.featureChangeListenerKeys_[feature_uid]);\n delete this.featureChangeListenerKeys_[feature_uid];\n }\n };\n /**\n * Remove the interaction from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../PluggableMap.js\").default} map Map.\n */\n Snap.prototype.setMap = function (map) {\n var currentMap = this.getMap();\n var keys = this.featuresListenerKeys_;\n var features = /** @type {Array} */ (this.getFeatures_());\n if (currentMap) {\n keys.forEach(unlistenByKey);\n keys.length = 0;\n features.forEach(this.forEachFeatureRemove_.bind(this));\n }\n _super.prototype.setMap.call(this, map);\n if (map) {\n if (this.features_) {\n keys.push(listen(this.features_, CollectionEventType.ADD, this.handleFeatureAdd_, this), listen(this.features_, CollectionEventType.REMOVE, this.handleFeatureRemove_, this));\n }\n else if (this.source_) {\n keys.push(listen(this.source_, VectorEventType.ADDFEATURE, this.handleFeatureAdd_, this), listen(this.source_, VectorEventType.REMOVEFEATURE, this.handleFeatureRemove_, this));\n }\n features.forEach(this.forEachFeatureAdd_.bind(this));\n }\n };\n /**\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel\n * @param {import(\"../coordinate.js\").Coordinate} pixelCoordinate Coordinate\n * @param {import(\"../PluggableMap.js\").default} map Map.\n * @return {Result|null} Snap result\n */\n Snap.prototype.snapTo = function (pixel, pixelCoordinate, map) {\n var lowerLeft = map.getCoordinateFromPixel([\n pixel[0] - this.pixelTolerance_,\n pixel[1] + this.pixelTolerance_,\n ]);\n var upperRight = map.getCoordinateFromPixel([\n pixel[0] + this.pixelTolerance_,\n pixel[1] - this.pixelTolerance_,\n ]);\n var box = boundingExtent([lowerLeft, upperRight]);\n var segments = this.rBush_.getInExtent(box);\n var segmentsLength = segments.length;\n if (segmentsLength === 0) {\n return null;\n }\n var projection = map.getView().getProjection();\n var projectedCoordinate = fromUserCoordinate(pixelCoordinate, projection);\n var closestVertex;\n var minSquaredDistance = Infinity;\n var squaredPixelTolerance = this.pixelTolerance_ * this.pixelTolerance_;\n var getResult = function () {\n if (closestVertex) {\n var vertexPixel = map.getPixelFromCoordinate(closestVertex);\n var squaredPixelDistance = squaredDistance(pixel, vertexPixel);\n if (squaredPixelDistance <= squaredPixelTolerance) {\n return {\n vertex: closestVertex,\n vertexPixel: [\n Math.round(vertexPixel[0]),\n Math.round(vertexPixel[1]),\n ],\n };\n }\n }\n return null;\n };\n if (this.vertex_) {\n for (var i = 0; i < segmentsLength; ++i) {\n var segmentData = segments[i];\n if (segmentData.feature.getGeometry().getType() !== 'Circle') {\n segmentData.segment.forEach(function (vertex) {\n var tempVertexCoord = fromUserCoordinate(vertex, projection);\n var delta = squaredDistance(projectedCoordinate, tempVertexCoord);\n if (delta < minSquaredDistance) {\n closestVertex = vertex;\n minSquaredDistance = delta;\n }\n });\n }\n }\n var result = getResult();\n if (result) {\n return result;\n }\n }\n if (this.edge_) {\n for (var i = 0; i < segmentsLength; ++i) {\n var vertex = null;\n var segmentData = segments[i];\n if (segmentData.feature.getGeometry().getType() === 'Circle') {\n var circleGeometry = segmentData.feature.getGeometry();\n var userProjection = getUserProjection();\n if (userProjection) {\n circleGeometry = circleGeometry\n .clone()\n .transform(userProjection, projection);\n }\n vertex = toUserCoordinate(closestOnCircle(projectedCoordinate, \n /** @type {import(\"../geom/Circle.js\").default} */ (circleGeometry)), projection);\n }\n else {\n var _a = segmentData.segment, segmentStart = _a[0], segmentEnd = _a[1];\n // points have only one coordinate\n if (segmentEnd) {\n tempSegment[0] = fromUserCoordinate(segmentStart, projection);\n tempSegment[1] = fromUserCoordinate(segmentEnd, projection);\n vertex = closestOnSegment(projectedCoordinate, tempSegment);\n }\n }\n if (vertex) {\n var delta = squaredDistance(projectedCoordinate, vertex);\n if (delta < minSquaredDistance) {\n closestVertex = vertex;\n minSquaredDistance = delta;\n }\n }\n }\n var result = getResult();\n if (result) {\n return result;\n }\n }\n return null;\n };\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @private\n */\n Snap.prototype.updateFeature_ = function (feature) {\n this.removeFeature(feature, false);\n this.addFeature(feature, false);\n };\n /**\n * @param {Array>} segments Segments\n * @param {import(\"../geom/Circle.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.segmentCircleGeometry_ = function (segments, geometry) {\n var projection = this.getMap().getView().getProjection();\n var circleGeometry = geometry;\n var userProjection = getUserProjection();\n if (userProjection) {\n circleGeometry = /** @type {import(\"../geom/Circle.js\").default} */ (circleGeometry.clone().transform(userProjection, projection));\n }\n var polygon = fromCircle(circleGeometry);\n if (userProjection) {\n polygon.transform(projection, userProjection);\n }\n var coordinates = polygon.getCoordinates()[0];\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n segments.push(coordinates.slice(i, i + 2));\n }\n };\n /**\n * @param {Array>} segments Segments\n * @param {import(\"../geom/GeometryCollection.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.segmentGeometryCollectionGeometry_ = function (segments, geometry) {\n var geometries = geometry.getGeometriesArray();\n for (var i = 0; i < geometries.length; ++i) {\n var segmenter = this.GEOMETRY_SEGMENTERS_[geometries[i].getType()];\n if (segmenter) {\n segmenter(segments, geometries[i]);\n }\n }\n };\n /**\n * @param {Array>} segments Segments\n * @param {import(\"../geom/LineString.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.segmentLineStringGeometry_ = function (segments, geometry) {\n var coordinates = geometry.getCoordinates();\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n segments.push(coordinates.slice(i, i + 2));\n }\n };\n /**\n * @param {Array>} segments Segments\n * @param {import(\"../geom/MultiLineString.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.segmentMultiLineStringGeometry_ = function (segments, geometry) {\n var lines = geometry.getCoordinates();\n for (var j = 0, jj = lines.length; j < jj; ++j) {\n var coordinates = lines[j];\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n segments.push(coordinates.slice(i, i + 2));\n }\n }\n };\n /**\n * @param {Array>} segments Segments\n * @param {import(\"../geom/MultiPoint.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.segmentMultiPointGeometry_ = function (segments, geometry) {\n geometry.getCoordinates().forEach(function (point) {\n segments.push([point]);\n });\n };\n /**\n * @param {Array>} segments Segments\n * @param {import(\"../geom/MultiPolygon.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.segmentMultiPolygonGeometry_ = function (segments, geometry) {\n var polygons = geometry.getCoordinates();\n for (var k = 0, kk = polygons.length; k < kk; ++k) {\n var rings = polygons[k];\n for (var j = 0, jj = rings.length; j < jj; ++j) {\n var coordinates = rings[j];\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n segments.push(coordinates.slice(i, i + 2));\n }\n }\n }\n };\n /**\n * @param {Array>} segments Segments\n * @param {import(\"../geom/Point.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.segmentPointGeometry_ = function (segments, geometry) {\n segments.push([geometry.getCoordinates()]);\n };\n /**\n * @param {Array>} segments Segments\n * @param {import(\"../geom/Polygon.js\").default} geometry Geometry.\n * @private\n */\n Snap.prototype.segmentPolygonGeometry_ = function (segments, geometry) {\n var rings = geometry.getCoordinates();\n for (var j = 0, jj = rings.length; j < jj; ++j) {\n var coordinates = rings[j];\n for (var i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n segments.push(coordinates.slice(i, i + 2));\n }\n }\n };\n return Snap;\n}(PointerInteraction));\nexport default Snap;\n//# sourceMappingURL=Snap.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/interaction/Translate\n */\nimport Collection from '../Collection.js';\nimport Event from '../events/Event.js';\nimport InteractionProperty from './Property.js';\nimport PointerInteraction from './Pointer.js';\nimport { TRUE } from '../functions.js';\nimport { always } from '../events/condition.js';\nimport { includes } from '../array.js';\n/**\n * @enum {string}\n */\nvar TranslateEventType = {\n /**\n * Triggered upon feature translation start.\n * @event TranslateEvent#translatestart\n * @api\n */\n TRANSLATESTART: 'translatestart',\n /**\n * Triggered upon feature translation.\n * @event TranslateEvent#translating\n * @api\n */\n TRANSLATING: 'translating',\n /**\n * Triggered upon feature translation end.\n * @event TranslateEvent#translateend\n * @api\n */\n TRANSLATEEND: 'translateend',\n};\n/**\n * A function that takes an {@link module:ol/Feature~Feature} or\n * {@link module:ol/render/Feature~RenderFeature} and an\n * {@link module:ol/layer/Layer~Layer} and returns `true` if the feature may be\n * translated or `false` otherwise.\n * @typedef {function(import(\"../Feature.js\").FeatureLike, import(\"../layer/Layer.js\").default):boolean} FilterFunction\n */\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled.\n * Default is {@link module:ol/events/condition.always}.\n * @property {Collection} [features] Features contained in this collection will be able to be translated together.\n * @property {Array|function(import(\"../layer/Layer.js\").default): boolean} [layers] A list of layers from which features should be\n * translated. Alternatively, a filter function can be provided. The\n * function will be called for each layer in the map and should return\n * `true` for layers that you want to be translatable. If the option is\n * absent, all visible layers will be considered translatable.\n * Not used if `features` is provided.\n * @property {FilterFunction} [filter] A function\n * that takes an {@link module:ol/Feature~Feature} and an\n * {@link module:ol/layer/Layer~Layer} and returns `true` if the feature may be\n * translated or `false` otherwise. Not used if `features` is provided.\n * @property {number} [hitTolerance=0] Hit-detection tolerance. Pixels inside the radius around the given position\n * will be checked for features.\n */\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/Translate~Translate} instances\n * are instances of this type.\n */\nvar TranslateEvent = /** @class */ (function (_super) {\n __extends(TranslateEvent, _super);\n /**\n * @param {TranslateEventType} type Type.\n * @param {Collection} features The features translated.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate The event coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} startCoordinate The original coordinates before.translation started\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n */\n function TranslateEvent(type, features, coordinate, startCoordinate, mapBrowserEvent) {\n var _this = _super.call(this, type) || this;\n /**\n * The features being translated.\n * @type {Collection}\n * @api\n */\n _this.features = features;\n /**\n * The coordinate of the drag event.\n * @const\n * @type {import(\"../coordinate.js\").Coordinate}\n * @api\n */\n _this.coordinate = coordinate;\n /**\n * The coordinate of the start position before translation started.\n * @const\n * @type {import(\"../coordinate.js\").Coordinate}\n * @api\n */\n _this.startCoordinate = startCoordinate;\n /**\n * Associated {@link module:ol/MapBrowserEvent~MapBrowserEvent}.\n * @type {import(\"../MapBrowserEvent.js\").default}\n * @api\n */\n _this.mapBrowserEvent = mapBrowserEvent;\n return _this;\n }\n return TranslateEvent;\n}(Event));\nexport { TranslateEvent };\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature &\n * import(\"../Observable\").OnSignature &\n * import(\"../Observable\").OnSignature<'translateend'|'translatestart'|'translating', TranslateEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature} TranslateOnSignature\n */\n/**\n * @classdesc\n * Interaction for translating (moving) features.\n * If you want to translate multiple features in a single action (for example,\n * the collection used by a select interaction), construct the interaction with\n * the `features` option.\n *\n * @fires TranslateEvent\n * @api\n */\nvar Translate = /** @class */ (function (_super) {\n __extends(Translate, _super);\n /**\n * @param {Options} [opt_options] Options.\n */\n function Translate(opt_options) {\n var _this = this;\n var options = opt_options ? opt_options : {};\n _this = _super.call(this, /** @type {import(\"./Pointer.js\").Options} */ (options)) || this;\n /***\n * @type {TranslateOnSignature}\n */\n _this.on;\n /***\n * @type {TranslateOnSignature}\n */\n _this.once;\n /***\n * @type {TranslateOnSignature}\n */\n _this.un;\n /**\n * The last position we translated to.\n * @type {import(\"../coordinate.js\").Coordinate}\n * @private\n */\n _this.lastCoordinate_ = null;\n /**\n * The start position before translation started.\n * @type {import(\"../coordinate.js\").Coordinate}\n * @private\n */\n _this.startCoordinate_ = null;\n /**\n * @type {Collection|null}\n * @private\n */\n _this.features_ = options.features !== undefined ? options.features : null;\n /** @type {function(import(\"../layer/Layer.js\").default): boolean} */\n var layerFilter;\n if (options.layers && !_this.features_) {\n if (typeof options.layers === 'function') {\n layerFilter = options.layers;\n }\n else {\n var layers_1 = options.layers;\n layerFilter = function (layer) {\n return includes(layers_1, layer);\n };\n }\n }\n else {\n layerFilter = TRUE;\n }\n /**\n * @private\n * @type {function(import(\"../layer/Layer.js\").default): boolean}\n */\n _this.layerFilter_ = layerFilter;\n /**\n * @private\n * @type {FilterFunction}\n */\n _this.filter_ = options.filter && !_this.features_ ? options.filter : TRUE;\n /**\n * @private\n * @type {number}\n */\n _this.hitTolerance_ = options.hitTolerance ? options.hitTolerance : 0;\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n _this.condition_ = options.condition ? options.condition : always;\n /**\n * @type {import(\"../Feature.js\").default}\n * @private\n */\n _this.lastFeature_ = null;\n _this.addChangeListener(InteractionProperty.ACTIVE, _this.handleActiveChanged_);\n return _this;\n }\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n * @return {boolean} If the event was consumed.\n */\n Translate.prototype.handleDownEvent = function (event) {\n if (!event.originalEvent || !this.condition_(event)) {\n return false;\n }\n this.lastFeature_ = this.featuresAtPixel_(event.pixel, event.map);\n if (!this.lastCoordinate_ && this.lastFeature_) {\n this.startCoordinate_ = event.coordinate;\n this.lastCoordinate_ = event.coordinate;\n this.handleMoveEvent(event);\n var features = this.features_ || new Collection([this.lastFeature_]);\n this.dispatchEvent(new TranslateEvent(TranslateEventType.TRANSLATESTART, features, event.coordinate, this.startCoordinate_, event));\n return true;\n }\n return false;\n };\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n * @return {boolean} If the event was consumed.\n */\n Translate.prototype.handleUpEvent = function (event) {\n if (this.lastCoordinate_) {\n this.lastCoordinate_ = null;\n this.handleMoveEvent(event);\n var features = this.features_ || new Collection([this.lastFeature_]);\n this.dispatchEvent(new TranslateEvent(TranslateEventType.TRANSLATEEND, features, event.coordinate, this.startCoordinate_, event));\n // cleanup\n this.startCoordinate_ = null;\n return true;\n }\n return false;\n };\n /**\n * Handle pointer drag events.\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n */\n Translate.prototype.handleDragEvent = function (event) {\n if (this.lastCoordinate_) {\n var newCoordinate = event.coordinate;\n var deltaX_1 = newCoordinate[0] - this.lastCoordinate_[0];\n var deltaY_1 = newCoordinate[1] - this.lastCoordinate_[1];\n var features = this.features_ || new Collection([this.lastFeature_]);\n features.forEach(function (feature) {\n var geom = feature.getGeometry();\n geom.translate(deltaX_1, deltaY_1);\n feature.setGeometry(geom);\n });\n this.lastCoordinate_ = newCoordinate;\n this.dispatchEvent(new TranslateEvent(TranslateEventType.TRANSLATING, features, newCoordinate, this.startCoordinate_, event));\n }\n };\n /**\n * Handle pointer move events.\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n */\n Translate.prototype.handleMoveEvent = function (event) {\n var elem = event.map.getViewport();\n // Change the cursor to grab/grabbing if hovering any of the features managed\n // by the interaction\n if (this.featuresAtPixel_(event.pixel, event.map)) {\n elem.classList.remove(this.lastCoordinate_ ? 'ol-grab' : 'ol-grabbing');\n elem.classList.add(this.lastCoordinate_ ? 'ol-grabbing' : 'ol-grab');\n }\n else {\n elem.classList.remove('ol-grab', 'ol-grabbing');\n }\n };\n /**\n * Tests to see if the given coordinates intersects any of our selected\n * features.\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel coordinate to test for intersection.\n * @param {import(\"../PluggableMap.js\").default} map Map to test the intersection on.\n * @return {import(\"../Feature.js\").default} Returns the feature found at the specified pixel\n * coordinates.\n * @private\n */\n Translate.prototype.featuresAtPixel_ = function (pixel, map) {\n return map.forEachFeatureAtPixel(pixel, function (feature, layer) {\n if (this.filter_(feature, layer)) {\n if (!this.features_ || includes(this.features_.getArray(), feature)) {\n return feature;\n }\n }\n }.bind(this), {\n layerFilter: this.layerFilter_,\n hitTolerance: this.hitTolerance_,\n });\n };\n /**\n * Returns the Hit-detection tolerance.\n * @return {number} Hit tolerance in pixels.\n * @api\n */\n Translate.prototype.getHitTolerance = function () {\n return this.hitTolerance_;\n };\n /**\n * Hit-detection tolerance. Pixels inside the radius around the given position\n * will be checked for features.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @api\n */\n Translate.prototype.setHitTolerance = function (hitTolerance) {\n this.hitTolerance_ = hitTolerance;\n };\n /**\n * Remove the interaction from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../PluggableMap.js\").default} map Map.\n */\n Translate.prototype.setMap = function (map) {\n var oldMap = this.getMap();\n _super.prototype.setMap.call(this, map);\n this.updateState_(oldMap);\n };\n /**\n * @private\n */\n Translate.prototype.handleActiveChanged_ = function () {\n this.updateState_(null);\n };\n /**\n * @param {import(\"../PluggableMap.js\").default} oldMap Old map.\n * @private\n */\n Translate.prototype.updateState_ = function (oldMap) {\n var map = this.getMap();\n var active = this.getActive();\n if (!map || !active) {\n map = map || oldMap;\n if (map) {\n var elem = map.getViewport();\n elem.classList.remove('ol-grab', 'ol-grabbing');\n }\n }\n };\n return Translate;\n}(PointerInteraction));\nexport default Translate;\n//# sourceMappingURL=Translate.js.map"],"names":[],"sourceRoot":""}