{"version":3,"sources":["app/main.js","vendor/iscroll.js","vendor/jquery.easing.1.3.js","vendor/jquery.hoverIntent.js","vendor/jquery.tiny-pubsub.js","vendor/jquery.ui.touch-punch.min.js","vendor/latlong.js","vendor/markerclusterer.js","widgets/jquery.msv.articleList.js","widgets/jquery.msv.breadcrumbs.js","widgets/jquery.msv.carousel.js","widgets/jquery.msv.cookieConsent.js","widgets/jquery.msv.datalist.js","widgets/jquery.msv.daterange.js","widgets/jquery.msv.dropdown.js","widgets/jquery.msv.dropdownSearch.js","widgets/jquery.msv.dynamicForm.js","widgets/jquery.msv.formpanel.js","widgets/jquery.msv.googlemap.js","widgets/jquery.msv.menu.js","widgets/jquery.msv.modal.js","widgets/jquery.msv.radiobutton.js","widgets/jquery.msv.ripplefx.js","widgets/jquery.msv.scrollup.js","widgets/jquery.msv.share.js","widgets/jquery.msv.simulator.js","widgets/jquery.msv.slideinSidebar.js","widgets/jquery.msv.sticky.js","widgets/jquery.msv.stickyCta.js","widgets/jquery.msv.table.js","widgets/jquery.msv.tabspanel.js","widgets/jquery.msv.uploadFile.js"],"names":[],"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;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC1nEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC5MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACp9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxoDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC/LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC52BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9jBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"bec.app.min.js","sourcesContent":["window.BEC = (function($, ns) {\n\t\"use strict\";\n\n\t/*\n\t PubSub Events\n\t 'OPEN_MOBILE_MENU'\n\t 'CLOSE_MOBILE_MENU'\n\t 'OPEN_SEARCH'\n\t 'CLOSE_SEARCH'\n\t */\n\n\t$(function() {\n\n\t\t/* fix for viewport units in ios */\n\t\twindow.viewportUnitsBuggyfill.init();\n\n\t\t/* dom fixes, no need to create an accordion widget */\n\t\t$(\".accordion-numbered\").each(function(i) {\n\t\t\t$(this).find(\".accordion-section\").each(function(i, el) {\n\t\t\t\t$(el).prepend(\"\" + (i + 1) + \"\");\n\t\t\t});\n\t\t});\n\n\t\t/* global events, no need to create an fullscreen widget */\n\t\t$(\".fullscreen__arrow\").click(function() {\n\t\t\t$('html, body').animate({\n\t\t\t\tscrollTop: $(\".fullscreen\").height()\n\t\t\t}, 800);\n\t\t});\n\n\t\t/* Extend string : to First char Upper case */\n\t\tString.prototype.toFirstUpper = function() {\n\t\t\treturn this.charAt(0).toUpperCase() + this.slice(1);\n\t\t}\n\n\t\t/* form value Helper */\n\t\t$.getFieldFormValue = function(form, fieldName) {\n\t\t\tif (!form || !fieldName)\n\t\t\t\treturn null;\n\n\t\t\tvar retValue = null;\n\t\t\t$(form).serializeArray().forEach(function(f) {\n\t\t\t\tif (f.name == fieldName)\n\t\t\t\t\tretValue = f.value;\n\t\t\t})\n\n\t\t\treturn retValue;\n\t\t}\n\n\t\t/* widgets */\n\t\t$(\".js-accordion\").accordion({\n\t\t\theightStyle: \"content\",\n\t\t\ticons: null,\n\t\t\tcollapsible: true\n\t\t});\n\t\t$(\".js-share\").share();\n\t\t$(\".js-carousel\").carousel();\n\t\t$(\".js-modal\").modal();\n\t\t$(\".js-tab\").tabspanel();\n\t\t$(\".scrollup\").scrollup();\n\t\t$(\".js-table\").tableResponsive();\n\t\t$(\".sticky-container\").sticky();\n\t\t$(\".sticky-cta\").stickyCta();\n\t\t$(\".map\").googlemap();\n\t\t$(\".breadcrumbs\").breadcrumbs();\n\t\t$(\".js-datalist\").datalist();\n\t\t$(\".menu\").menu();\n\t\t$(\".js-form-simulator\").simulator();\n\t\t$(\".js-form\").formpanel();\n\t\t$(\".js-ripple-btn\").ripplefx();\n\t\t$(\".js-list\").articleList();\n\t\t$(\".js-daterange\").dateRange();\n\t\t$(\".js-dropdown\").dropdown();\n\t\t$(\".js-dropdown-search\").dropdownSearch();\n\t\t$(\".js-radio\").radiobutton();\n\t\t$(\".js-dynamicForm\").dynamicForm();\n\t\t$(\".js-upload\").uploadFile();\n\t\t$('.js-cookie-consent').cookieConsent();\n\t\t$('.js-mask-date-time').mask('00/00/0000 00:00');\n\t\t$('.js-mask-date').mask('00/00/0000');\n\t\t$('.js-mask-date-range').mask('00/00/0000 - 00/00/0000', {\n\t\t\tclearIfNotMatch: true\n\t\t});\n\t\t$('.sidebar').slideinSidebar();\n\n\t});\n\n\treturn ns;\n\n}(window.jQuery, window.BEC || {}));","/*! iScroll v5.2.0-snapshot ~ (c) 2008-2017 Matteo Spinelli ~ http://cubiq.org/license */\n(function (window, document, Math) {\nvar rAF = window.requestAnimationFrame\t||\n\twindow.webkitRequestAnimationFrame\t||\n\twindow.mozRequestAnimationFrame\t\t||\n\twindow.oRequestAnimationFrame\t\t||\n\twindow.msRequestAnimationFrame\t\t||\n\tfunction (callback) { window.setTimeout(callback, 1000 / 60); };\n\nvar utils = (function () {\n\tvar me = {};\n\n\tvar _elementStyle = document.createElement('div').style;\n\tvar _vendor = (function () {\n\t\tvar vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'],\n\t\t\ttransform,\n\t\t\ti = 0,\n\t\t\tl = vendors.length;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\ttransform = vendors[i] + 'ransform';\n\t\t\tif ( transform in _elementStyle ) return vendors[i].substr(0, vendors[i].length-1);\n\t\t}\n\n\t\treturn false;\n\t})();\n\n\tfunction _prefixStyle (style) {\n\t\tif ( _vendor === false ) return false;\n\t\tif ( _vendor === '' ) return style;\n\t\treturn _vendor + style.charAt(0).toUpperCase() + style.substr(1);\n\t}\n\n\tme.getTime = Date.now || function getTime () { return new Date().getTime(); };\n\n\tme.extend = function (target, obj) {\n\t\tfor ( var i in obj ) {\n\t\t\ttarget[i] = obj[i];\n\t\t}\n\t};\n\n\tme.addEvent = function (el, type, fn, capture) {\n\t\tel.addEventListener(type, fn, !!capture);\n\t};\n\n\tme.removeEvent = function (el, type, fn, capture) {\n\t\tel.removeEventListener(type, fn, !!capture);\n\t};\n\n\tme.prefixPointerEvent = function (pointerEvent) {\n\t\treturn window.MSPointerEvent ?\n\t\t\t'MSPointer' + pointerEvent.charAt(7).toUpperCase() + pointerEvent.substr(8):\n\t\t\tpointerEvent;\n\t};\n\n\tme.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) {\n\t\tvar distance = current - start,\n\t\t\tspeed = Math.abs(distance) / time,\n\t\t\tdestination,\n\t\t\tduration;\n\n\t\tdeceleration = deceleration === undefined ? 0.0006 : deceleration;\n\n\t\tdestination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 );\n\t\tduration = speed / deceleration;\n\n\t\tif ( destination < lowerMargin ) {\n\t\t\tdestination = wrapperSize ? lowerMargin - ( wrapperSize / 2.5 * ( speed / 8 ) ) : lowerMargin;\n\t\t\tdistance = Math.abs(destination - current);\n\t\t\tduration = distance / speed;\n\t\t} else if ( destination > 0 ) {\n\t\t\tdestination = wrapperSize ? wrapperSize / 2.5 * ( speed / 8 ) : 0;\n\t\t\tdistance = Math.abs(current) + destination;\n\t\t\tduration = distance / speed;\n\t\t}\n\n\t\treturn {\n\t\t\tdestination: Math.round(destination),\n\t\t\tduration: duration\n\t\t};\n\t};\n\n\tvar _transform = _prefixStyle('transform');\n\n\tme.extend(me, {\n\t\thasTransform: _transform !== false,\n\t\thasPerspective: _prefixStyle('perspective') in _elementStyle,\n\t\thasTouch: 'ontouchstart' in window,\n\t\thasPointer: !!(window.PointerEvent || window.MSPointerEvent), // IE10 is prefixed\n\t\thasTransition: _prefixStyle('transition') in _elementStyle\n\t});\n\n\t/*\n\tThis should find all Android browsers lower than build 535.19 (both stock browser and webview)\n\t- galaxy S2 is ok\n - 2.3.6 : `AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1`\n - 4.0.4 : `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n - galaxy S3 is badAndroid (stock brower, webview)\n `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n - galaxy S4 is badAndroid (stock brower, webview)\n `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n - galaxy S5 is OK\n `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n - galaxy S6 is OK\n `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n */\n\tme.isBadAndroid = (function() {\n\t\tvar appVersion = window.navigator.appVersion;\n\t\t// Android browser is not a chrome browser.\n\t\tif (/Android/.test(appVersion) && !(/Chrome\\/\\d/.test(appVersion))) {\n\t\t\tvar safariVersion = appVersion.match(/Safari\\/(\\d+.\\d)/);\n\t\t\tif(safariVersion && typeof safariVersion === \"object\" && safariVersion.length >= 2) {\n\t\t\t\treturn parseFloat(safariVersion[1]) < 535.19;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t})();\n\n\tme.extend(me.style = {}, {\n\t\ttransform: _transform,\n\t\ttransitionTimingFunction: _prefixStyle('transitionTimingFunction'),\n\t\ttransitionDuration: _prefixStyle('transitionDuration'),\n\t\ttransitionDelay: _prefixStyle('transitionDelay'),\n\t\ttransformOrigin: _prefixStyle('transformOrigin'),\n\t\ttouchAction: _prefixStyle('touchAction')\n\t});\n\n\tme.hasClass = function (e, c) {\n\t\tvar re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\");\n\t\treturn re.test(e.className);\n\t};\n\n\tme.addClass = function (e, c) {\n\t\tif ( me.hasClass(e, c) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar newclass = e.className.split(' ');\n\t\tnewclass.push(c);\n\t\te.className = newclass.join(' ');\n\t};\n\n\tme.removeClass = function (e, c) {\n\t\tif ( !me.hasClass(e, c) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\", 'g');\n\t\te.className = e.className.replace(re, ' ');\n\t};\n\n\tme.offset = function (el) {\n\t\tvar left = -el.offsetLeft,\n\t\t\ttop = -el.offsetTop;\n\n\t\t// jshint -W084\n\t\twhile (el = el.offsetParent) {\n\t\t\tleft -= el.offsetLeft;\n\t\t\ttop -= el.offsetTop;\n\t\t}\n\t\t// jshint +W084\n\n\t\treturn {\n\t\t\tleft: left,\n\t\t\ttop: top\n\t\t};\n\t};\n\n\tme.preventDefaultException = function (el, exceptions) {\n\t\tfor ( var i in exceptions ) {\n\t\t\tif ( exceptions[i].test(el[i]) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t};\n\n\tme.extend(me.eventType = {}, {\n\t\ttouchstart: 1,\n\t\ttouchmove: 1,\n\t\ttouchend: 1,\n\n\t\tmousedown: 2,\n\t\tmousemove: 2,\n\t\tmouseup: 2,\n\n\t\tpointerdown: 3,\n\t\tpointermove: 3,\n\t\tpointerup: 3,\n\n\t\tMSPointerDown: 3,\n\t\tMSPointerMove: 3,\n\t\tMSPointerUp: 3\n\t});\n\n\tme.extend(me.ease = {}, {\n\t\tquadratic: {\n\t\t\tstyle: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',\n\t\t\tfn: function (k) {\n\t\t\t\treturn k * ( 2 - k );\n\t\t\t}\n\t\t},\n\t\tcircular: {\n\t\t\tstyle: 'cubic-bezier(0.1, 0.57, 0.1, 1)',\t// Not properly \"circular\" but this looks better, it should be (0.075, 0.82, 0.165, 1)\n\t\t\tfn: function (k) {\n\t\t\t\treturn Math.sqrt( 1 - ( --k * k ) );\n\t\t\t}\n\t\t},\n\t\tback: {\n\t\t\tstyle: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',\n\t\t\tfn: function (k) {\n\t\t\t\tvar b = 4;\n\t\t\t\treturn ( k = k - 1 ) * k * ( ( b + 1 ) * k + b ) + 1;\n\t\t\t}\n\t\t},\n\t\tbounce: {\n\t\t\tstyle: '',\n\t\t\tfn: function (k) {\n\t\t\t\tif ( ( k /= 1 ) < ( 1 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * k * k;\n\t\t\t\t} else if ( k < ( 2 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75;\n\t\t\t\t} else if ( k < ( 2.5 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375;\n\t\t\t\t} else {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\telastic: {\n\t\t\tstyle: '',\n\t\t\tfn: function (k) {\n\t\t\t\tvar f = 0.22,\n\t\t\t\t\te = 0.4;\n\n\t\t\t\tif ( k === 0 ) { return 0; }\n\t\t\t\tif ( k == 1 ) { return 1; }\n\n\t\t\t\treturn ( e * Math.pow( 2, - 10 * k ) * Math.sin( ( k - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 );\n\t\t\t}\n\t\t}\n\t});\n\n\tme.tap = function (e, eventName) {\n\t\tvar ev = document.createEvent('Event');\n\t\tev.initEvent(eventName, true, true);\n\t\tev.pageX = e.pageX;\n\t\tev.pageY = e.pageY;\n\t\te.target.dispatchEvent(ev);\n\t};\n\n\tme.click = function (e) {\n\t\tvar target = e.target,\n\t\t\tev;\n\n\t\tif ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) {\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent\n\t\t\t// initMouseEvent is deprecated.\n\t\t\tev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');\n\t\t\tev.initEvent('click', true, true);\n\t\t\tev.view = e.view || window;\n\t\t\tev.detail = 1;\n\t\t\tev.screenX = target.screenX || 0;\n\t\t\tev.screenY = target.screenY || 0;\n\t\t\tev.clientX = target.clientX || 0;\n\t\t\tev.clientY = target.clientY || 0;\n\t\t\tev.ctrlKey = !!e.ctrlKey;\n\t\t\tev.altKey = !!e.altKey;\n\t\t\tev.shiftKey = !!e.shiftKey;\n\t\t\tev.metaKey = !!e.metaKey;\n\t\t\tev.button = 0;\n\t\t\tev.relatedTarget = null;\n\t\t\tev._constructed = true;\n\t\t\ttarget.dispatchEvent(ev);\n\t\t}\n\t};\n\n\tme.getTouchAction = function(eventPassthrough, addPinch) {\n\t\tvar touchAction = 'none';\n\t\tif ( eventPassthrough === 'vertical' ) {\n\t\t\ttouchAction = 'pan-y';\n\t\t} else if (eventPassthrough === 'horizontal' ) {\n\t\t\ttouchAction = 'pan-x';\n\t\t}\n\t\tif (addPinch && touchAction != 'none') {\n\t\t\t// add pinch-zoom support if the browser supports it, but if not (eg. Chrome <55) do nothing\n\t\t\ttouchAction += ' pinch-zoom';\n\t\t}\n\t\treturn touchAction;\n\t};\n\n\tme.getRect = function(el) {\n\t\tif (el instanceof SVGElement) {\n\t\t\tvar rect = el.getBoundingClientRect();\n\t\t\treturn {\n\t\t\t\ttop : rect.top,\n\t\t\t\tleft : rect.left,\n\t\t\t\twidth : rect.width,\n\t\t\t\theight : rect.height\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\ttop : el.offsetTop,\n\t\t\t\tleft : el.offsetLeft,\n\t\t\t\twidth : el.offsetWidth,\n\t\t\t\theight : el.offsetHeight\n\t\t\t};\n\t\t}\n\t};\n\n\treturn me;\n})();\nfunction IScroll (el, options) {\n\tthis.wrapper = typeof el == 'string' ? document.querySelector(el) : el;\n\tthis.scroller = this.wrapper.children[0];\n\tthis.scrollerStyle = this.scroller.style;\t\t// cache style for better performance\n\n\tthis.options = {\n\n\t\tresizeScrollbars: true,\n\n\t\tmouseWheelSpeed: 20,\n\n\t\tsnapThreshold: 0.334,\n\n// INSERT POINT: OPTIONS\n\t\tdisablePointer : !utils.hasPointer,\n\t\tdisableTouch : utils.hasPointer || !utils.hasTouch,\n\t\tdisableMouse : utils.hasPointer || utils.hasTouch,\n\t\tstartX: 0,\n\t\tstartY: 0,\n\t\tscrollY: true,\n\t\tdirectionLockThreshold: 5,\n\t\tmomentum: true,\n\n\t\tbounce: true,\n\t\tbounceTime: 600,\n\t\tbounceEasing: '',\n\n\t\tpreventDefault: true,\n\t\tpreventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ },\n\n\t\tHWCompositing: true,\n\t\tuseTransition: true,\n\t\tuseTransform: true,\n\t\tbindToWrapper: typeof window.onmousedown === \"undefined\"\n\t};\n\n\tfor ( var i in options ) {\n\t\tthis.options[i] = options[i];\n\t}\n\n\t// Normalize options\n\tthis.translateZ = this.options.HWCompositing && utils.hasPerspective ? ' translateZ(0)' : '';\n\n\tthis.options.useTransition = utils.hasTransition && this.options.useTransition;\n\tthis.options.useTransform = utils.hasTransform && this.options.useTransform;\n\n\tthis.options.eventPassthrough = this.options.eventPassthrough === true ? 'vertical' : this.options.eventPassthrough;\n\tthis.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault;\n\n\t// If you want eventPassthrough I have to lock one of the axes\n\tthis.options.scrollY = this.options.eventPassthrough == 'vertical' ? false : this.options.scrollY;\n\tthis.options.scrollX = this.options.eventPassthrough == 'horizontal' ? false : this.options.scrollX;\n\n\t// With eventPassthrough we also need lockDirection mechanism\n\tthis.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough;\n\tthis.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold;\n\n\tthis.options.bounceEasing = typeof this.options.bounceEasing == 'string' ? utils.ease[this.options.bounceEasing] || utils.ease.circular : this.options.bounceEasing;\n\n\tthis.options.resizePolling = this.options.resizePolling === undefined ? 60 : this.options.resizePolling;\n\n\tif ( this.options.tap === true ) {\n\t\tthis.options.tap = 'tap';\n\t}\n\n\t// https://github.com/cubiq/iscroll/issues/1029\n\tif (!this.options.useTransition && !this.options.useTransform) {\n\t\tif(!(/relative|absolute/i).test(this.scrollerStyle.position)) {\n\t\t\tthis.scrollerStyle.position = \"relative\";\n\t\t}\n\t}\n\n\tif ( this.options.shrinkScrollbars == 'scale' ) {\n\t\tthis.options.useTransition = false;\n\t}\n\n\tthis.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1;\n\n// INSERT POINT: NORMALIZATION\n\n\t// Some defaults\n\tthis.x = 0;\n\tthis.y = 0;\n\tthis.directionX = 0;\n\tthis.directionY = 0;\n\tthis._events = {};\n\n// INSERT POINT: DEFAULTS\n\n\tthis._init();\n\tthis.refresh();\n\n\tthis.scrollTo(this.options.startX, this.options.startY);\n\tthis.enable();\n}\n\nIScroll.prototype = {\n\tversion: '5.2.0-snapshot',\n\n\t_init: function () {\n\t\tthis._initEvents();\n\n\t\tif ( this.options.scrollbars || this.options.indicators ) {\n\t\t\tthis._initIndicators();\n\t\t}\n\n\t\tif ( this.options.mouseWheel ) {\n\t\t\tthis._initWheel();\n\t\t}\n\n\t\tif ( this.options.snap ) {\n\t\t\tthis._initSnap();\n\t\t}\n\n\t\tif ( this.options.keyBindings ) {\n\t\t\tthis._initKeys();\n\t\t}\n\n// INSERT POINT: _init\n\n\t},\n\n\tdestroy: function () {\n\t\tthis._initEvents(true);\n\t\tclearTimeout(this.resizeTimeout);\n \t\tthis.resizeTimeout = null;\n\t\tthis._execEvent('destroy');\n\t},\n\n\t_transitionEnd: function (e) {\n\t\tif ( e.target != this.scroller || !this.isInTransition ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._transitionTime();\n\t\tif ( !this.resetPosition(this.options.bounceTime) ) {\n\t\t\tthis.isInTransition = false;\n\t\t\tthis._execEvent('scrollEnd');\n\t\t}\n\t},\n\n\t_start: function (e) {\n\t\t// React to left mouse button only\n\t\tif ( utils.eventType[e.type] != 1 ) {\n\t\t // for button property\n\t\t // http://unixpapa.com/js/mouse.html\n\t\t var button;\n\t if (!e.which) {\n\t /* IE case */\n\t button = (e.button < 2) ? 0 :\n\t ((e.button == 4) ? 1 : 2);\n\t } else {\n\t /* All others */\n\t button = e.button;\n\t }\n\t\t\tif ( button !== 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif ( !this.enabled || (this.initiated && utils.eventType[e.type] !== this.initiated) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point = e.touches ? e.touches[0] : e,\n\t\t\tpos;\n\n\t\tthis.initiated\t= utils.eventType[e.type];\n\t\tthis.moved\t\t= false;\n\t\tthis.distX\t\t= 0;\n\t\tthis.distY\t\t= 0;\n\t\tthis.directionX = 0;\n\t\tthis.directionY = 0;\n\t\tthis.directionLocked = 0;\n\n\t\tthis.startTime = utils.getTime();\n\n\t\tif ( this.options.useTransition && this.isInTransition ) {\n\t\t\tthis._transitionTime();\n\t\t\tthis.isInTransition = false;\n\t\t\tpos = this.getComputedPosition();\n\t\t\tthis._translate(Math.round(pos.x), Math.round(pos.y));\n\t\t\tthis._execEvent('scrollEnd');\n\t\t} else if ( !this.options.useTransition && this.isAnimating ) {\n\t\t\tthis.isAnimating = false;\n\t\t\tthis._execEvent('scrollEnd');\n\t\t}\n\n\t\tthis.startX = this.x;\n\t\tthis.startY = this.y;\n\t\tthis.absStartX = this.x;\n\t\tthis.absStartY = this.y;\n\t\tthis.pointX = point.pageX;\n\t\tthis.pointY = point.pageY;\n\n\t\tthis._execEvent('beforeScrollStart');\n\t},\n\n\t_move: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault ) {\t// increases performance on Android? TODO: check!\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point\t\t= e.touches ? e.touches[0] : e,\n\t\t\tdeltaX\t\t= point.pageX - this.pointX,\n\t\t\tdeltaY\t\t= point.pageY - this.pointY,\n\t\t\ttimestamp\t= utils.getTime(),\n\t\t\tnewX, newY,\n\t\t\tabsDistX, absDistY;\n\n\t\tthis.pointX\t\t= point.pageX;\n\t\tthis.pointY\t\t= point.pageY;\n\n\t\tthis.distX\t\t+= deltaX;\n\t\tthis.distY\t\t+= deltaY;\n\t\tabsDistX\t\t= Math.abs(this.distX);\n\t\tabsDistY\t\t= Math.abs(this.distY);\n\n\t\t// We need to move at least 10 pixels for the scrolling to initiate\n\t\tif ( timestamp - this.endTime > 300 && (absDistX < 10 && absDistY < 10) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If you are scrolling in one direction lock the other\n\t\tif ( !this.directionLocked && !this.options.freeScroll ) {\n\t\t\tif ( absDistX > absDistY + this.options.directionLockThreshold ) {\n\t\t\t\tthis.directionLocked = 'h';\t\t// lock horizontally\n\t\t\t} else if ( absDistY >= absDistX + this.options.directionLockThreshold ) {\n\t\t\t\tthis.directionLocked = 'v';\t\t// lock vertically\n\t\t\t} else {\n\t\t\t\tthis.directionLocked = 'n';\t\t// no lock\n\t\t\t}\n\t\t}\n\n\t\tif ( this.directionLocked == 'h' ) {\n\t\t\tif ( this.options.eventPassthrough == 'vertical' ) {\n\t\t\t\te.preventDefault();\n\t\t\t} else if ( this.options.eventPassthrough == 'horizontal' ) {\n\t\t\t\tthis.initiated = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdeltaY = 0;\n\t\t} else if ( this.directionLocked == 'v' ) {\n\t\t\tif ( this.options.eventPassthrough == 'horizontal' ) {\n\t\t\t\te.preventDefault();\n\t\t\t} else if ( this.options.eventPassthrough == 'vertical' ) {\n\t\t\t\tthis.initiated = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdeltaX = 0;\n\t\t}\n\n\t\tdeltaX = this.hasHorizontalScroll ? deltaX : 0;\n\t\tdeltaY = this.hasVerticalScroll ? deltaY : 0;\n\n\t\tnewX = this.x + deltaX;\n\t\tnewY = this.y + deltaY;\n\n\t\t// Slow down if outside of the boundaries\n\t\tif ( newX > 0 || newX < this.maxScrollX ) {\n\t\t\tnewX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX;\n\t\t}\n\t\tif ( newY > 0 || newY < this.maxScrollY ) {\n\t\t\tnewY = this.options.bounce ? this.y + deltaY / 3 : newY > 0 ? 0 : this.maxScrollY;\n\t\t}\n\n\t\tthis.directionX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0;\n\t\tthis.directionY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0;\n\n\t\tif ( !this.moved ) {\n\t\t\tthis._execEvent('scrollStart');\n\t\t}\n\n\t\tthis.moved = true;\n\n\t\tthis._translate(newX, newY);\n\n/* REPLACE START: _move */\n\n\t\tif ( timestamp - this.startTime > 300 ) {\n\t\t\tthis.startTime = timestamp;\n\t\t\tthis.startX = this.x;\n\t\t\tthis.startY = this.y;\n\t\t}\n\n/* REPLACE END: _move */\n\n\t},\n\n\t_end: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point = e.changedTouches ? e.changedTouches[0] : e,\n\t\t\tmomentumX,\n\t\t\tmomentumY,\n\t\t\tduration = utils.getTime() - this.startTime,\n\t\t\tnewX = Math.round(this.x),\n\t\t\tnewY = Math.round(this.y),\n\t\t\tdistanceX = Math.abs(newX - this.startX),\n\t\t\tdistanceY = Math.abs(newY - this.startY),\n\t\t\ttime = 0,\n\t\t\teasing = '';\n\n\t\tthis.isInTransition = 0;\n\t\tthis.initiated = 0;\n\t\tthis.endTime = utils.getTime();\n\n\t\t// reset if we are outside of the boundaries\n\t\tif ( this.resetPosition(this.options.bounceTime) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY);\t// ensures that the last position is rounded\n\n\t\t// we scrolled less than 10 pixels\n\t\tif ( !this.moved ) {\n\t\t\tif ( this.options.tap ) {\n\t\t\t\tutils.tap(e, this.options.tap);\n\t\t\t}\n\n\t\t\tif ( this.options.click ) {\n\t\t\t\tutils.click(e);\n\t\t\t}\n\n\t\t\tthis._execEvent('scrollCancel');\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this._events.flick && duration < 200 && distanceX < 100 && distanceY < 100 ) {\n\t\t\tthis._execEvent('flick');\n\t\t\treturn;\n\t\t}\n\n\t\t// start momentum animation if needed\n\t\tif ( this.options.momentum && duration < 300 ) {\n\t\t\tmomentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 };\n\t\t\tmomentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { destination: newY, duration: 0 };\n\t\t\tnewX = momentumX.destination;\n\t\t\tnewY = momentumY.destination;\n\t\t\ttime = Math.max(momentumX.duration, momentumY.duration);\n\t\t\tthis.isInTransition = 1;\n\t\t}\n\n\n\t\tif ( this.options.snap ) {\n\t\t\tvar snap = this._nearestSnap(newX, newY);\n\t\t\tthis.currentPage = snap;\n\t\t\ttime = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(newX - snap.x), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(newY - snap.y), 1000)\n\t\t\t\t\t), 300);\n\t\t\tnewX = snap.x;\n\t\t\tnewY = snap.y;\n\n\t\t\tthis.directionX = 0;\n\t\t\tthis.directionY = 0;\n\t\t\teasing = this.options.bounceEasing;\n\t\t}\n\n// INSERT POINT: _end\n\n\t\tif ( newX != this.x || newY != this.y ) {\n\t\t\t// change easing function when scroller goes out of the boundaries\n\t\t\tif ( newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY ) {\n\t\t\t\teasing = utils.ease.quadratic;\n\t\t\t}\n\n\t\t\tthis.scrollTo(newX, newY, time, easing);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._execEvent('scrollEnd');\n\t},\n\n\t_resize: function () {\n\t\tvar that = this;\n\n\t\tclearTimeout(this.resizeTimeout);\n\n\t\tthis.resizeTimeout = setTimeout(function () {\n\t\t\tthat.refresh();\n\t\t}, this.options.resizePolling);\n\t},\n\n\tresetPosition: function (time) {\n\t\tvar x = this.x,\n\t\t\ty = this.y;\n\n\t\ttime = time || 0;\n\n\t\tif ( !this.hasHorizontalScroll || this.x > 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( this.x < this.maxScrollX ) {\n\t\t\tx = this.maxScrollX;\n\t\t}\n\n\t\tif ( !this.hasVerticalScroll || this.y > 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( this.y < this.maxScrollY ) {\n\t\t\ty = this.maxScrollY;\n\t\t}\n\n\t\tif ( x == this.x && y == this.y ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.scrollTo(x, y, time, this.options.bounceEasing);\n\n\t\treturn true;\n\t},\n\n\tdisable: function () {\n\t\tthis.enabled = false;\n\t},\n\n\tenable: function () {\n\t\tthis.enabled = true;\n\t},\n\n\trefresh: function () {\n\t\tutils.getRect(this.wrapper);\t\t// Force reflow\n\n\t\tthis.wrapperWidth\t= this.wrapper.clientWidth;\n\t\tthis.wrapperHeight\t= this.wrapper.clientHeight;\n\n\t\tvar rect = utils.getRect(this.scroller);\n/* REPLACE START: refresh */\n\n\t\tthis.scrollerWidth\t= rect.width;\n\t\tthis.scrollerHeight\t= rect.height;\n\n\t\tthis.maxScrollX\t\t= this.wrapperWidth - this.scrollerWidth;\n\t\tthis.maxScrollY\t\t= this.wrapperHeight - this.scrollerHeight;\n\n/* REPLACE END: refresh */\n\n\t\tthis.hasHorizontalScroll\t= this.options.scrollX && this.maxScrollX < 0;\n\t\tthis.hasVerticalScroll\t\t= this.options.scrollY && this.maxScrollY < 0;\n\t\t\n\t\tif ( !this.hasHorizontalScroll ) {\n\t\t\tthis.maxScrollX = 0;\n\t\t\tthis.scrollerWidth = this.wrapperWidth;\n\t\t}\n\n\t\tif ( !this.hasVerticalScroll ) {\n\t\t\tthis.maxScrollY = 0;\n\t\t\tthis.scrollerHeight = this.wrapperHeight;\n\t\t}\n\n\t\tthis.endTime = 0;\n\t\tthis.directionX = 0;\n\t\tthis.directionY = 0;\n\t\t\n\t\tif(utils.hasPointer && !this.options.disablePointer) {\n\t\t\t// The wrapper should have `touchAction` property for using pointerEvent.\n\t\t\tthis.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, true);\n\n\t\t\t// case. not support 'pinch-zoom'\n\t\t\t// https://github.com/cubiq/iscroll/issues/1118#issuecomment-270057583\n\t\t\tif (!this.wrapper.style[utils.style.touchAction]) {\n\t\t\t\tthis.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, false);\n\t\t\t}\n\t\t}\n\t\tthis.wrapperOffset = utils.offset(this.wrapper);\n\n\t\tthis._execEvent('refresh');\n\n\t\tthis.resetPosition();\n\n// INSERT POINT: _refresh\n\n\t},\t\n\n\ton: function (type, fn) {\n\t\tif ( !this._events[type] ) {\n\t\t\tthis._events[type] = [];\n\t\t}\n\n\t\tthis._events[type].push(fn);\n\t},\n\n\toff: function (type, fn) {\n\t\tif ( !this._events[type] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar index = this._events[type].indexOf(fn);\n\n\t\tif ( index > -1 ) {\n\t\t\tthis._events[type].splice(index, 1);\n\t\t}\n\t},\n\n\t_execEvent: function (type) {\n\t\tif ( !this._events[type] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar i = 0,\n\t\t\tl = this._events[type].length;\n\n\t\tif ( !l ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tthis._events[type][i].apply(this, [].slice.call(arguments, 1));\n\t\t}\n\t},\n\n\tscrollBy: function (x, y, time, easing) {\n\t\tx = this.x + x;\n\t\ty = this.y + y;\n\t\ttime = time || 0;\n\n\t\tthis.scrollTo(x, y, time, easing);\n\t},\n\n\tscrollTo: function (x, y, time, easing) {\n\t\teasing = easing || utils.ease.circular;\n\n\t\tthis.isInTransition = this.options.useTransition && time > 0;\n\t\tvar transitionType = this.options.useTransition && easing.style;\n\t\tif ( !time || transitionType ) {\n\t\t\t\tif(transitionType) {\n\t\t\t\t\tthis._transitionTimingFunction(easing.style);\n\t\t\t\t\tthis._transitionTime(time);\n\t\t\t\t}\n\t\t\tthis._translate(x, y);\n\t\t} else {\n\t\t\tthis._animate(x, y, time, easing.fn);\n\t\t}\n\t},\n\n\tscrollToElement: function (el, time, offsetX, offsetY, easing) {\n\t\tel = el.nodeType ? el : this.scroller.querySelector(el);\n\n\t\tif ( !el ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar pos = utils.offset(el);\n\n\t\tpos.left -= this.wrapperOffset.left;\n\t\tpos.top -= this.wrapperOffset.top;\n\n\t\t// if offsetX/Y are true we center the element to the screen\n\t\tvar elRect = utils.getRect(el);\n\t\tvar wrapperRect = utils.getRect(this.wrapper);\n\t\tif ( offsetX === true ) {\n\t\t\toffsetX = Math.round(elRect.width / 2 - wrapperRect.width / 2);\n\t\t}\n\t\tif ( offsetY === true ) {\n\t\t\toffsetY = Math.round(elRect.height / 2 - wrapperRect.height / 2);\n\t\t}\n\n\t\tpos.left -= offsetX || 0;\n\t\tpos.top -= offsetY || 0;\n\n\t\tpos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left;\n\t\tpos.top = pos.top > 0 ? 0 : pos.top < this.maxScrollY ? this.maxScrollY : pos.top;\n\n\t\ttime = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(this.x-pos.left), Math.abs(this.y-pos.top)) : time;\n\n\t\tthis.scrollTo(pos.left, pos.top, time, easing);\n\t},\n\n\t_transitionTime: function (time) {\n\t\tif (!this.options.useTransition) {\n\t\t\treturn;\n\t\t}\n\t\ttime = time || 0;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollerStyle[durationProp] = time + 'ms';\n\n\t\tif ( !time && utils.isBadAndroid ) {\n\t\t\tthis.scrollerStyle[durationProp] = '0.0001ms';\n\t\t\t// remove 0.0001ms\n\t\t\tvar self = this;\n\t\t\trAF(function() {\n\t\t\t\tif(self.scrollerStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.scrollerStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\n\t\tif ( this.indicators ) {\n\t\t\tfor ( var i = this.indicators.length; i--; ) {\n\t\t\t\tthis.indicators[i].transitionTime(time);\n\t\t\t}\n\t\t}\n\n\n// INSERT POINT: _transitionTime\n\n\t},\n\n\t_transitionTimingFunction: function (easing) {\n\t\tthis.scrollerStyle[utils.style.transitionTimingFunction] = easing;\n\n\n\t\tif ( this.indicators ) {\n\t\t\tfor ( var i = this.indicators.length; i--; ) {\n\t\t\t\tthis.indicators[i].transitionTimingFunction(easing);\n\t\t\t}\n\t\t}\n\n\n// INSERT POINT: _transitionTimingFunction\n\n\t},\n\n\t_translate: function (x, y) {\n\t\tif ( this.options.useTransform ) {\n\n/* REPLACE START: _translate */\n\n\t\t\tthis.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ;\n\n/* REPLACE END: _translate */\n\n\t\t} else {\n\t\t\tx = Math.round(x);\n\t\t\ty = Math.round(y);\n\t\t\tthis.scrollerStyle.left = x + 'px';\n\t\t\tthis.scrollerStyle.top = y + 'px';\n\t\t}\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\n\tif ( this.indicators ) {\n\t\tfor ( var i = this.indicators.length; i--; ) {\n\t\t\tthis.indicators[i].updatePosition();\n\t\t}\n\t}\n\n\n// INSERT POINT: _translate\n\n\t},\n\n\t_initEvents: function (remove) {\n\t\tvar eventType = remove ? utils.removeEvent : utils.addEvent,\n\t\t\ttarget = this.options.bindToWrapper ? this.wrapper : window;\n\n\t\teventType(window, 'orientationchange', this);\n\t\teventType(window, 'resize', this);\n\n\t\tif ( this.options.click ) {\n\t\t\teventType(this.wrapper, 'click', this, true);\n\t\t}\n\n\t\tif ( !this.options.disableMouse ) {\n\t\t\teventType(this.wrapper, 'mousedown', this);\n\t\t\teventType(target, 'mousemove', this);\n\t\t\teventType(target, 'mousecancel', this);\n\t\t\teventType(target, 'mouseup', this);\n\t\t}\n\n\t\tif ( utils.hasPointer && !this.options.disablePointer ) {\n\t\t\teventType(this.wrapper, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointermove'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointercancel'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointerup'), this);\n\t\t}\n\n\t\tif ( utils.hasTouch && !this.options.disableTouch ) {\n\t\t\teventType(this.wrapper, 'touchstart', this);\n\t\t\teventType(target, 'touchmove', this);\n\t\t\teventType(target, 'touchcancel', this);\n\t\t\teventType(target, 'touchend', this);\n\t\t}\n\n\t\teventType(this.scroller, 'transitionend', this);\n\t\teventType(this.scroller, 'webkitTransitionEnd', this);\n\t\teventType(this.scroller, 'oTransitionEnd', this);\n\t\teventType(this.scroller, 'MSTransitionEnd', this);\n\t},\n\n\tgetComputedPosition: function () {\n\t\tvar matrix = window.getComputedStyle(this.scroller, null),\n\t\t\tx, y;\n\n\t\tif ( this.options.useTransform ) {\n\t\t\tmatrix = matrix[utils.style.transform].split(')')[0].split(', ');\n\t\t\tx = +(matrix[12] || matrix[4]);\n\t\t\ty = +(matrix[13] || matrix[5]);\n\t\t} else {\n\t\t\tx = +matrix.left.replace(/[^-\\d.]/g, '');\n\t\t\ty = +matrix.top.replace(/[^-\\d.]/g, '');\n\t\t}\n\n\t\treturn { x: x, y: y };\n\t},\n\t_initIndicators: function () {\n\t\tvar interactive = this.options.interactiveScrollbars,\n\t\t\tcustomStyle = typeof this.options.scrollbars != 'string',\n\t\t\tindicators = [],\n\t\t\tindicator;\n\n\t\tvar that = this;\n\n\t\tthis.indicators = [];\n\n\t\tif ( this.options.scrollbars ) {\n\t\t\t// Vertical scrollbar\n\t\t\tif ( this.options.scrollY ) {\n\t\t\t\tindicator = {\n\t\t\t\t\tel: createDefaultScrollbar('v', interactive, this.options.scrollbars),\n\t\t\t\t\tinteractive: interactive,\n\t\t\t\t\tdefaultScrollbars: true,\n\t\t\t\t\tcustomStyle: customStyle,\n\t\t\t\t\tresize: this.options.resizeScrollbars,\n\t\t\t\t\tshrink: this.options.shrinkScrollbars,\n\t\t\t\t\tfade: this.options.fadeScrollbars,\n\t\t\t\t\tlistenX: false\n\t\t\t\t};\n\n\t\t\t\tthis.wrapper.appendChild(indicator.el);\n\t\t\t\tindicators.push(indicator);\n\t\t\t}\n\n\t\t\t// Horizontal scrollbar\n\t\t\tif ( this.options.scrollX ) {\n\t\t\t\tindicator = {\n\t\t\t\t\tel: createDefaultScrollbar('h', interactive, this.options.scrollbars),\n\t\t\t\t\tinteractive: interactive,\n\t\t\t\t\tdefaultScrollbars: true,\n\t\t\t\t\tcustomStyle: customStyle,\n\t\t\t\t\tresize: this.options.resizeScrollbars,\n\t\t\t\t\tshrink: this.options.shrinkScrollbars,\n\t\t\t\t\tfade: this.options.fadeScrollbars,\n\t\t\t\t\tlistenY: false\n\t\t\t\t};\n\n\t\t\t\tthis.wrapper.appendChild(indicator.el);\n\t\t\t\tindicators.push(indicator);\n\t\t\t}\n\t\t}\n\n\t\tif ( this.options.indicators ) {\n\t\t\t// TODO: check concat compatibility\n\t\t\tindicators = indicators.concat(this.options.indicators);\n\t\t}\n\n\t\tfor ( var i = indicators.length; i--; ) {\n\t\t\tthis.indicators.push( new Indicator(this, indicators[i]) );\n\t\t}\n\n\t\t// TODO: check if we can use array.map (wide compatibility and performance issues)\n\t\tfunction _indicatorsMap (fn) {\n\t\t\tif (that.indicators) {\n\t\t\t\tfor ( var i = that.indicators.length; i--; ) {\n\t\t\t\t\tfn.call(that.indicators[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( this.options.fadeScrollbars ) {\n\t\t\tthis.on('scrollEnd', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.on('scrollCancel', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.on('scrollStart', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade(1);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.on('beforeScrollStart', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade(1, true);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\n\t\tthis.on('refresh', function () {\n\t\t\t_indicatorsMap(function () {\n\t\t\t\tthis.refresh();\n\t\t\t});\n\t\t});\n\n\t\tthis.on('destroy', function () {\n\t\t\t_indicatorsMap(function () {\n\t\t\t\tthis.destroy();\n\t\t\t});\n\n\t\t\tdelete this.indicators;\n\t\t});\n\t},\n\n\t_initWheel: function () {\n\t\tutils.addEvent(this.wrapper, 'wheel', this);\n\t\tutils.addEvent(this.wrapper, 'mousewheel', this);\n\t\tutils.addEvent(this.wrapper, 'DOMMouseScroll', this);\n\n\t\tthis.on('destroy', function () {\n\t\t\tclearTimeout(this.wheelTimeout);\n\t\t\tthis.wheelTimeout = null;\n\t\t\tutils.removeEvent(this.wrapper, 'wheel', this);\n\t\t\tutils.removeEvent(this.wrapper, 'mousewheel', this);\n\t\t\tutils.removeEvent(this.wrapper, 'DOMMouseScroll', this);\n\t\t});\n\t},\n\n\t_wheel: function (e) {\n\t\tif ( !this.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\tvar wheelDeltaX, wheelDeltaY,\n\t\t\tnewX, newY,\n\t\t\tthat = this;\n\n\t\tif ( this.wheelTimeout === undefined ) {\n\t\t\tthat._execEvent('scrollStart');\n\t\t}\n\n\t\t// Execute the scrollEnd event after 400ms the wheel stopped scrolling\n\t\tclearTimeout(this.wheelTimeout);\n\t\tthis.wheelTimeout = setTimeout(function () {\n\t\t\tif(!that.options.snap) {\n\t\t\t\tthat._execEvent('scrollEnd');\n\t\t\t}\n\t\t\tthat.wheelTimeout = undefined;\n\t\t}, 400);\n\n\t\tif ( 'deltaX' in e ) {\n\t\t\tif (e.deltaMode === 1) {\n\t\t\t\twheelDeltaX = -e.deltaX * this.options.mouseWheelSpeed;\n\t\t\t\twheelDeltaY = -e.deltaY * this.options.mouseWheelSpeed;\n\t\t\t} else {\n\t\t\t\twheelDeltaX = -e.deltaX;\n\t\t\t\twheelDeltaY = -e.deltaY;\n\t\t\t}\n\t\t} else if ( 'wheelDeltaX' in e ) {\n\t\t\twheelDeltaX = e.wheelDeltaX / 120 * this.options.mouseWheelSpeed;\n\t\t\twheelDeltaY = e.wheelDeltaY / 120 * this.options.mouseWheelSpeed;\n\t\t} else if ( 'wheelDelta' in e ) {\n\t\t\twheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * this.options.mouseWheelSpeed;\n\t\t} else if ( 'detail' in e ) {\n\t\t\twheelDeltaX = wheelDeltaY = -e.detail / 3 * this.options.mouseWheelSpeed;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\twheelDeltaX *= this.options.invertWheelDirection;\n\t\twheelDeltaY *= this.options.invertWheelDirection;\n\n\t\tif ( !this.hasVerticalScroll ) {\n\t\t\twheelDeltaX = wheelDeltaY;\n\t\t\twheelDeltaY = 0;\n\t\t}\n\n\t\tif ( this.options.snap ) {\n\t\t\tnewX = this.currentPage.pageX;\n\t\t\tnewY = this.currentPage.pageY;\n\n\t\t\tif ( wheelDeltaX > 0 ) {\n\t\t\t\tnewX--;\n\t\t\t} else if ( wheelDeltaX < 0 ) {\n\t\t\t\tnewX++;\n\t\t\t}\n\n\t\t\tif ( wheelDeltaY > 0 ) {\n\t\t\t\tnewY--;\n\t\t\t} else if ( wheelDeltaY < 0 ) {\n\t\t\t\tnewY++;\n\t\t\t}\n\n\t\t\tthis.goToPage(newX, newY);\n\n\t\t\treturn;\n\t\t}\n\n\t\tnewX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0);\n\t\tnewY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0);\n\n\t\tthis.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0;\n\t\tthis.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0;\n\n\t\tif ( newX > 0 ) {\n\t\t\tnewX = 0;\n\t\t} else if ( newX < this.maxScrollX ) {\n\t\t\tnewX = this.maxScrollX;\n\t\t}\n\n\t\tif ( newY > 0 ) {\n\t\t\tnewY = 0;\n\t\t} else if ( newY < this.maxScrollY ) {\n\t\t\tnewY = this.maxScrollY;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY, 0);\n\n// INSERT POINT: _wheel\n\t},\n\n\t_initSnap: function () {\n\t\tthis.currentPage = {};\n\n\t\tif ( typeof this.options.snap == 'string' ) {\n\t\t\tthis.options.snap = this.scroller.querySelectorAll(this.options.snap);\n\t\t}\n\n\t\tthis.on('refresh', function () {\n\t\t\tvar i = 0, l,\n\t\t\t\tm = 0, n,\n\t\t\t\tcx, cy,\n\t\t\t\tx = 0, y,\n\t\t\t\tstepX = this.options.snapStepX || this.wrapperWidth,\n\t\t\t\tstepY = this.options.snapStepY || this.wrapperHeight,\n\t\t\t\tel,\n\t\t\t\trect;\n\n\t\t\tthis.pages = [];\n\n\t\t\tif ( !this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( this.options.snap === true ) {\n\t\t\t\tcx = Math.round( stepX / 2 );\n\t\t\t\tcy = Math.round( stepY / 2 );\n\n\t\t\t\twhile ( x > -this.scrollerWidth ) {\n\t\t\t\t\tthis.pages[i] = [];\n\t\t\t\t\tl = 0;\n\t\t\t\t\ty = 0;\n\n\t\t\t\t\twhile ( y > -this.scrollerHeight ) {\n\t\t\t\t\t\tthis.pages[i][l] = {\n\t\t\t\t\t\t\tx: Math.max(x, this.maxScrollX),\n\t\t\t\t\t\t\ty: Math.max(y, this.maxScrollY),\n\t\t\t\t\t\t\twidth: stepX,\n\t\t\t\t\t\t\theight: stepY,\n\t\t\t\t\t\t\tcx: x - cx,\n\t\t\t\t\t\t\tcy: y - cy\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\ty -= stepY;\n\t\t\t\t\t\tl++;\n\t\t\t\t\t}\n\n\t\t\t\t\tx -= stepX;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tel = this.options.snap;\n\t\t\t\tl = el.length;\n\t\t\t\tn = -1;\n\n\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\trect = utils.getRect(el[i]);\n\t\t\t\t\tif ( i === 0 || rect.left <= utils.getRect(el[i-1]).left ) {\n\t\t\t\t\t\tm = 0;\n\t\t\t\t\t\tn++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !this.pages[m] ) {\n\t\t\t\t\t\tthis.pages[m] = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tx = Math.max(-rect.left, this.maxScrollX);\n\t\t\t\t\ty = Math.max(-rect.top, this.maxScrollY);\n\t\t\t\t\tcx = x - Math.round(rect.width / 2);\n\t\t\t\t\tcy = y - Math.round(rect.height / 2);\n\n\t\t\t\t\tthis.pages[m][n] = {\n\t\t\t\t\t\tx: x,\n\t\t\t\t\t\ty: y,\n\t\t\t\t\t\twidth: rect.width,\n\t\t\t\t\t\theight: rect.height,\n\t\t\t\t\t\tcx: cx,\n\t\t\t\t\t\tcy: cy\n\t\t\t\t\t};\n\n\t\t\t\t\tif ( x > this.maxScrollX ) {\n\t\t\t\t\t\tm++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.goToPage(this.currentPage.pageX || 0, this.currentPage.pageY || 0, 0);\n\n\t\t\t// Update snap threshold if needed\n\t\t\tif ( this.options.snapThreshold % 1 === 0 ) {\n\t\t\t\tthis.snapThresholdX = this.options.snapThreshold;\n\t\t\t\tthis.snapThresholdY = this.options.snapThreshold;\n\t\t\t} else {\n\t\t\t\tthis.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * this.options.snapThreshold);\n\t\t\t\tthis.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * this.options.snapThreshold);\n\t\t\t}\n\t\t});\n\n\t\tthis.on('flick', function () {\n\t\t\tvar time = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(this.x - this.startX), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(this.y - this.startY), 1000)\n\t\t\t\t\t), 300);\n\n\t\t\tthis.goToPage(\n\t\t\t\tthis.currentPage.pageX + this.directionX,\n\t\t\t\tthis.currentPage.pageY + this.directionY,\n\t\t\t\ttime\n\t\t\t);\n\t\t});\n\t},\n\n\t_nearestSnap: function (x, y) {\n\t\tif ( !this.pages.length ) {\n\t\t\treturn { x: 0, y: 0, pageX: 0, pageY: 0 };\n\t\t}\n\n\t\tvar i = 0,\n\t\t\tl = this.pages.length,\n\t\t\tm = 0;\n\n\t\t// Check if we exceeded the snap threshold\n\t\tif ( Math.abs(x - this.absStartX) < this.snapThresholdX &&\n\t\t\tMath.abs(y - this.absStartY) < this.snapThresholdY ) {\n\t\t\treturn this.currentPage;\n\t\t}\n\n\t\tif ( x > 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( x < this.maxScrollX ) {\n\t\t\tx = this.maxScrollX;\n\t\t}\n\n\t\tif ( y > 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( y < this.maxScrollY ) {\n\t\t\ty = this.maxScrollY;\n\t\t}\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tif ( x >= this.pages[i][0].cx ) {\n\t\t\t\tx = this.pages[i][0].x;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tl = this.pages[i].length;\n\n\t\tfor ( ; m < l; m++ ) {\n\t\t\tif ( y >= this.pages[0][m].cy ) {\n\t\t\t\ty = this.pages[0][m].y;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( i == this.currentPage.pageX ) {\n\t\t\ti += this.directionX;\n\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = 0;\n\t\t\t} else if ( i >= this.pages.length ) {\n\t\t\t\ti = this.pages.length - 1;\n\t\t\t}\n\n\t\t\tx = this.pages[i][0].x;\n\t\t}\n\n\t\tif ( m == this.currentPage.pageY ) {\n\t\t\tm += this.directionY;\n\n\t\t\tif ( m < 0 ) {\n\t\t\t\tm = 0;\n\t\t\t} else if ( m >= this.pages[0].length ) {\n\t\t\t\tm = this.pages[0].length - 1;\n\t\t\t}\n\n\t\t\ty = this.pages[0][m].y;\n\t\t}\n\n\t\treturn {\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t\tpageX: i,\n\t\t\tpageY: m\n\t\t};\n\t},\n\n\tgoToPage: function (x, y, time, easing) {\n\t\teasing = easing || this.options.bounceEasing;\n\n\t\tif ( x >= this.pages.length ) {\n\t\t\tx = this.pages.length - 1;\n\t\t} else if ( x < 0 ) {\n\t\t\tx = 0;\n\t\t}\n\n\t\tif ( y >= this.pages[x].length ) {\n\t\t\ty = this.pages[x].length - 1;\n\t\t} else if ( y < 0 ) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tvar posX = this.pages[x][y].x,\n\t\t\tposY = this.pages[x][y].y;\n\n\t\ttime = time === undefined ? this.options.snapSpeed || Math.max(\n\t\t\tMath.max(\n\t\t\t\tMath.min(Math.abs(posX - this.x), 1000),\n\t\t\t\tMath.min(Math.abs(posY - this.y), 1000)\n\t\t\t), 300) : time;\n\n\t\tthis.currentPage = {\n\t\t\tx: posX,\n\t\t\ty: posY,\n\t\t\tpageX: x,\n\t\t\tpageY: y\n\t\t};\n\n\t\tthis.scrollTo(posX, posY, time, easing);\n\t},\n\n\tnext: function (time, easing) {\n\t\tvar x = this.currentPage.pageX,\n\t\t\ty = this.currentPage.pageY;\n\n\t\tx++;\n\n\t\tif ( x >= this.pages.length && this.hasVerticalScroll ) {\n\t\t\tx = 0;\n\t\t\ty++;\n\t\t}\n\n\t\tthis.goToPage(x, y, time, easing);\n\t},\n\n\tprev: function (time, easing) {\n\t\tvar x = this.currentPage.pageX,\n\t\t\ty = this.currentPage.pageY;\n\n\t\tx--;\n\n\t\tif ( x < 0 && this.hasVerticalScroll ) {\n\t\t\tx = 0;\n\t\t\ty--;\n\t\t}\n\n\t\tthis.goToPage(x, y, time, easing);\n\t},\n\n\t_initKeys: function (e) {\n\t\t// default key bindings\n\t\tvar keys = {\n\t\t\tpageUp: 33,\n\t\t\tpageDown: 34,\n\t\t\tend: 35,\n\t\t\thome: 36,\n\t\t\tleft: 37,\n\t\t\tup: 38,\n\t\t\tright: 39,\n\t\t\tdown: 40\n\t\t};\n\t\tvar i;\n\n\t\t// if you give me characters I give you keycode\n\t\tif ( typeof this.options.keyBindings == 'object' ) {\n\t\t\tfor ( i in this.options.keyBindings ) {\n\t\t\t\tif ( typeof this.options.keyBindings[i] == 'string' ) {\n\t\t\t\t\tthis.options.keyBindings[i] = this.options.keyBindings[i].toUpperCase().charCodeAt(0);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.options.keyBindings = {};\n\t\t}\n\n\t\tfor ( i in keys ) {\n\t\t\tthis.options.keyBindings[i] = this.options.keyBindings[i] || keys[i];\n\t\t}\n\n\t\tutils.addEvent(window, 'keydown', this);\n\n\t\tthis.on('destroy', function () {\n\t\t\tutils.removeEvent(window, 'keydown', this);\n\t\t});\n\t},\n\n\t_key: function (e) {\n\t\tif ( !this.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar snap = this.options.snap,\t// we are using this alot, better to cache it\n\t\t\tnewX = snap ? this.currentPage.pageX : this.x,\n\t\t\tnewY = snap ? this.currentPage.pageY : this.y,\n\t\t\tnow = utils.getTime(),\n\t\t\tprevTime = this.keyTime || 0,\n\t\t\tacceleration = 0.250,\n\t\t\tpos;\n\n\t\tif ( this.options.useTransition && this.isInTransition ) {\n\t\t\tpos = this.getComputedPosition();\n\n\t\t\tthis._translate(Math.round(pos.x), Math.round(pos.y));\n\t\t\tthis.isInTransition = false;\n\t\t}\n\n\t\tthis.keyAcceleration = now - prevTime < 200 ? Math.min(this.keyAcceleration + acceleration, 50) : 0;\n\n\t\tswitch ( e.keyCode ) {\n\t\t\tcase this.options.keyBindings.pageUp:\n\t\t\t\tif ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {\n\t\t\t\t\tnewX += snap ? 1 : this.wrapperWidth;\n\t\t\t\t} else {\n\t\t\t\t\tnewY += snap ? 1 : this.wrapperHeight;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.pageDown:\n\t\t\t\tif ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {\n\t\t\t\t\tnewX -= snap ? 1 : this.wrapperWidth;\n\t\t\t\t} else {\n\t\t\t\t\tnewY -= snap ? 1 : this.wrapperHeight;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.end:\n\t\t\t\tnewX = snap ? this.pages.length-1 : this.maxScrollX;\n\t\t\t\tnewY = snap ? this.pages[0].length-1 : this.maxScrollY;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.home:\n\t\t\t\tnewX = 0;\n\t\t\t\tnewY = 0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.left:\n\t\t\t\tnewX += snap ? -1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.up:\n\t\t\t\tnewY += snap ? 1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.right:\n\t\t\t\tnewX -= snap ? -1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.down:\n\t\t\t\tnewY -= snap ? 1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\tif ( snap ) {\n\t\t\tthis.goToPage(newX, newY);\n\t\t\treturn;\n\t\t}\n\n\t\tif ( newX > 0 ) {\n\t\t\tnewX = 0;\n\t\t\tthis.keyAcceleration = 0;\n\t\t} else if ( newX < this.maxScrollX ) {\n\t\t\tnewX = this.maxScrollX;\n\t\t\tthis.keyAcceleration = 0;\n\t\t}\n\n\t\tif ( newY > 0 ) {\n\t\t\tnewY = 0;\n\t\t\tthis.keyAcceleration = 0;\n\t\t} else if ( newY < this.maxScrollY ) {\n\t\t\tnewY = this.maxScrollY;\n\t\t\tthis.keyAcceleration = 0;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY, 0);\n\n\t\tthis.keyTime = now;\n\t},\n\n\t_animate: function (destX, destY, duration, easingFn) {\n\t\tvar that = this,\n\t\t\tstartX = this.x,\n\t\t\tstartY = this.y,\n\t\t\tstartTime = utils.getTime(),\n\t\t\tdestTime = startTime + duration;\n\n\t\tfunction step () {\n\t\t\tvar now = utils.getTime(),\n\t\t\t\tnewX, newY,\n\t\t\t\teasing;\n\n\t\t\tif ( now >= destTime ) {\n\t\t\t\tthat.isAnimating = false;\n\t\t\t\tthat._translate(destX, destY);\n\n\t\t\t\tif ( !that.resetPosition(that.options.bounceTime) ) {\n\t\t\t\t\tthat._execEvent('scrollEnd');\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnow = ( now - startTime ) / duration;\n\t\t\teasing = easingFn(now);\n\t\t\tnewX = ( destX - startX ) * easing + startX;\n\t\t\tnewY = ( destY - startY ) * easing + startY;\n\t\t\tthat._translate(newX, newY);\n\n\t\t\tif ( that.isAnimating ) {\n\t\t\t\trAF(step);\n\t\t\t}\n\t\t}\n\n\t\tthis.isAnimating = true;\n\t\tstep();\n\t},\n\thandleEvent: function (e) {\n\t\tswitch ( e.type ) {\n\t\t\tcase 'touchstart':\n\t\t\tcase 'pointerdown':\n\t\t\tcase 'MSPointerDown':\n\t\t\tcase 'mousedown':\n\t\t\t\tthis._start(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchmove':\n\t\t\tcase 'pointermove':\n\t\t\tcase 'MSPointerMove':\n\t\t\tcase 'mousemove':\n\t\t\t\tthis._move(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchend':\n\t\t\tcase 'pointerup':\n\t\t\tcase 'MSPointerUp':\n\t\t\tcase 'mouseup':\n\t\t\tcase 'touchcancel':\n\t\t\tcase 'pointercancel':\n\t\t\tcase 'MSPointerCancel':\n\t\t\tcase 'mousecancel':\n\t\t\t\tthis._end(e);\n\t\t\t\tbreak;\n\t\t\tcase 'orientationchange':\n\t\t\tcase 'resize':\n\t\t\t\tthis._resize();\n\t\t\t\tbreak;\n\t\t\tcase 'transitionend':\n\t\t\tcase 'webkitTransitionEnd':\n\t\t\tcase 'oTransitionEnd':\n\t\t\tcase 'MSTransitionEnd':\n\t\t\t\tthis._transitionEnd(e);\n\t\t\t\tbreak;\n\t\t\tcase 'wheel':\n\t\t\tcase 'DOMMouseScroll':\n\t\t\tcase 'mousewheel':\n\t\t\t\tthis._wheel(e);\n\t\t\t\tbreak;\n\t\t\tcase 'keydown':\n\t\t\t\tthis._key(e);\n\t\t\t\tbreak;\n\t\t\tcase 'click':\n\t\t\t\tif ( this.enabled && !e._constructed ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n};\nfunction createDefaultScrollbar (direction, interactive, type) {\n\tvar scrollbar = document.createElement('div'),\n\t\tindicator = document.createElement('div');\n\n\tif ( type === true ) {\n\t\tscrollbar.style.cssText = 'position:absolute;z-index:9999';\n\t\tindicator.style.cssText = '-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px';\n\t}\n\n\tindicator.className = 'iScrollIndicator';\n\n\tif ( direction == 'h' ) {\n\t\tif ( type === true ) {\n\t\t\tscrollbar.style.cssText += ';height:7px;left:2px;right:2px;bottom:0';\n\t\t\tindicator.style.height = '100%';\n\t\t}\n\t\tscrollbar.className = 'iScrollHorizontalScrollbar';\n\t} else {\n\t\tif ( type === true ) {\n\t\t\tscrollbar.style.cssText += ';width:7px;bottom:2px;top:2px;right:1px';\n\t\t\tindicator.style.width = '100%';\n\t\t}\n\t\tscrollbar.className = 'iScrollVerticalScrollbar';\n\t}\n\n\tscrollbar.style.cssText += ';overflow:hidden';\n\n\tif ( !interactive ) {\n\t\tscrollbar.style.pointerEvents = 'none';\n\t}\n\n\tscrollbar.appendChild(indicator);\n\n\treturn scrollbar;\n}\n\nfunction Indicator (scroller, options) {\n\tthis.wrapper = typeof options.el == 'string' ? document.querySelector(options.el) : options.el;\n\tthis.wrapperStyle = this.wrapper.style;\n\tthis.indicator = this.wrapper.children[0];\n\tthis.indicatorStyle = this.indicator.style;\n\tthis.scroller = scroller;\n\n\tthis.options = {\n\t\tlistenX: true,\n\t\tlistenY: true,\n\t\tinteractive: false,\n\t\tresize: true,\n\t\tdefaultScrollbars: false,\n\t\tshrink: false,\n\t\tfade: false,\n\t\tspeedRatioX: 0,\n\t\tspeedRatioY: 0\n\t};\n\n\tfor ( var i in options ) {\n\t\tthis.options[i] = options[i];\n\t}\n\n\tthis.sizeRatioX = 1;\n\tthis.sizeRatioY = 1;\n\tthis.maxPosX = 0;\n\tthis.maxPosY = 0;\n\n\tif ( this.options.interactive ) {\n\t\tif ( !this.options.disableTouch ) {\n\t\t\tutils.addEvent(this.indicator, 'touchstart', this);\n\t\t\tutils.addEvent(window, 'touchend', this);\n\t\t}\n\t\tif ( !this.options.disablePointer ) {\n\t\t\tutils.addEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\tutils.addEvent(window, utils.prefixPointerEvent('pointerup'), this);\n\t\t}\n\t\tif ( !this.options.disableMouse ) {\n\t\t\tutils.addEvent(this.indicator, 'mousedown', this);\n\t\t\tutils.addEvent(window, 'mouseup', this);\n\t\t}\n\t}\n\n\tif ( this.options.fade ) {\n\t\tthis.wrapperStyle[utils.style.transform] = this.scroller.translateZ;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\t\tthis.wrapperStyle[durationProp] = utils.isBadAndroid ? '0.0001ms' : '0ms';\n\t\t// remove 0.0001ms\n\t\tvar self = this;\n\t\tif(utils.isBadAndroid) {\n\t\t\trAF(function() {\n\t\t\t\tif(self.wrapperStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.wrapperStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tthis.wrapperStyle.opacity = '0';\n\t}\n}\n\nIndicator.prototype = {\n\thandleEvent: function (e) {\n\t\tswitch ( e.type ) {\n\t\t\tcase 'touchstart':\n\t\t\tcase 'pointerdown':\n\t\t\tcase 'MSPointerDown':\n\t\t\tcase 'mousedown':\n\t\t\t\tthis._start(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchmove':\n\t\t\tcase 'pointermove':\n\t\t\tcase 'MSPointerMove':\n\t\t\tcase 'mousemove':\n\t\t\t\tthis._move(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchend':\n\t\t\tcase 'pointerup':\n\t\t\tcase 'MSPointerUp':\n\t\t\tcase 'mouseup':\n\t\t\tcase 'touchcancel':\n\t\t\tcase 'pointercancel':\n\t\t\tcase 'MSPointerCancel':\n\t\t\tcase 'mousecancel':\n\t\t\t\tthis._end(e);\n\t\t\t\tbreak;\n\t\t}\n\t},\n\n\tdestroy: function () {\n\t\tif ( this.options.fadeScrollbars ) {\n\t\t\tclearTimeout(this.fadeTimeout);\n\t\t\tthis.fadeTimeout = null;\n\t\t}\n\t\tif ( this.options.interactive ) {\n\t\t\tutils.removeEvent(this.indicator, 'touchstart', this);\n\t\t\tutils.removeEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\tutils.removeEvent(this.indicator, 'mousedown', this);\n\n\t\t\tutils.removeEvent(window, 'touchmove', this);\n\t\t\tutils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);\n\t\t\tutils.removeEvent(window, 'mousemove', this);\n\n\t\t\tutils.removeEvent(window, 'touchend', this);\n\t\t\tutils.removeEvent(window, utils.prefixPointerEvent('pointerup'), this);\n\t\t\tutils.removeEvent(window, 'mouseup', this);\n\t\t}\n\n\t\tif ( this.options.defaultScrollbars && this.wrapper.parentNode ) {\n\t\t\tthis.wrapper.parentNode.removeChild(this.wrapper);\n\t\t}\n\t},\n\n\t_start: function (e) {\n\t\tvar point = e.touches ? e.touches[0] : e;\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tthis.transitionTime();\n\n\t\tthis.initiated = true;\n\t\tthis.moved = false;\n\t\tthis.lastPointX\t= point.pageX;\n\t\tthis.lastPointY\t= point.pageY;\n\n\t\tthis.startTime\t= utils.getTime();\n\n\t\tif ( !this.options.disableTouch ) {\n\t\t\tutils.addEvent(window, 'touchmove', this);\n\t\t}\n\t\tif ( !this.options.disablePointer ) {\n\t\t\tutils.addEvent(window, utils.prefixPointerEvent('pointermove'), this);\n\t\t}\n\t\tif ( !this.options.disableMouse ) {\n\t\t\tutils.addEvent(window, 'mousemove', this);\n\t\t}\n\n\t\tthis.scroller._execEvent('beforeScrollStart');\n\t},\n\n\t_move: function (e) {\n\t\tvar point = e.touches ? e.touches[0] : e,\n\t\t\tdeltaX, deltaY,\n\t\t\tnewX, newY,\n\t\t\ttimestamp = utils.getTime();\n\n\t\tif ( !this.moved ) {\n\t\t\tthis.scroller._execEvent('scrollStart');\n\t\t}\n\n\t\tthis.moved = true;\n\n\t\tdeltaX = point.pageX - this.lastPointX;\n\t\tthis.lastPointX = point.pageX;\n\n\t\tdeltaY = point.pageY - this.lastPointY;\n\t\tthis.lastPointY = point.pageY;\n\n\t\tnewX = this.x + deltaX;\n\t\tnewY = this.y + deltaY;\n\n\t\tthis._pos(newX, newY);\n\n// INSERT POINT: indicator._move\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t},\n\n\t_end: function (e) {\n\t\tif ( !this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.initiated = false;\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tutils.removeEvent(window, 'touchmove', this);\n\t\tutils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);\n\t\tutils.removeEvent(window, 'mousemove', this);\n\n\t\tif ( this.scroller.options.snap ) {\n\t\t\tvar snap = this.scroller._nearestSnap(this.scroller.x, this.scroller.y);\n\n\t\t\tvar time = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(this.scroller.x - snap.x), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(this.scroller.y - snap.y), 1000)\n\t\t\t\t\t), 300);\n\n\t\t\tif ( this.scroller.x != snap.x || this.scroller.y != snap.y ) {\n\t\t\t\tthis.scroller.directionX = 0;\n\t\t\t\tthis.scroller.directionY = 0;\n\t\t\t\tthis.scroller.currentPage = snap;\n\t\t\t\tthis.scroller.scrollTo(snap.x, snap.y, time, this.scroller.options.bounceEasing);\n\t\t\t}\n\t\t}\n\n\t\tif ( this.moved ) {\n\t\t\tthis.scroller._execEvent('scrollEnd');\n\t\t}\n\t},\n\n\ttransitionTime: function (time) {\n\t\ttime = time || 0;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.indicatorStyle[durationProp] = time + 'ms';\n\n\t\tif ( !time && utils.isBadAndroid ) {\n\t\t\tthis.indicatorStyle[durationProp] = '0.0001ms';\n\t\t\t// remove 0.0001ms\n\t\t\tvar self = this;\n\t\t\trAF(function() {\n\t\t\t\tif(self.indicatorStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.indicatorStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t},\n\n\ttransitionTimingFunction: function (easing) {\n\t\tthis.indicatorStyle[utils.style.transitionTimingFunction] = easing;\n\t},\n\n\trefresh: function () {\n\t\tthis.transitionTime();\n\n\t\tif ( this.options.listenX && !this.options.listenY ) {\n\t\t\tthis.indicatorStyle.display = this.scroller.hasHorizontalScroll ? 'block' : 'none';\n\t\t} else if ( this.options.listenY && !this.options.listenX ) {\n\t\t\tthis.indicatorStyle.display = this.scroller.hasVerticalScroll ? 'block' : 'none';\n\t\t} else {\n\t\t\tthis.indicatorStyle.display = this.scroller.hasHorizontalScroll || this.scroller.hasVerticalScroll ? 'block' : 'none';\n\t\t}\n\n\t\tif ( this.scroller.hasHorizontalScroll && this.scroller.hasVerticalScroll ) {\n\t\t\tutils.addClass(this.wrapper, 'iScrollBothScrollbars');\n\t\t\tutils.removeClass(this.wrapper, 'iScrollLoneScrollbar');\n\n\t\t\tif ( this.options.defaultScrollbars && this.options.customStyle ) {\n\t\t\t\tif ( this.options.listenX ) {\n\t\t\t\t\tthis.wrapper.style.right = '8px';\n\t\t\t\t} else {\n\t\t\t\t\tthis.wrapper.style.bottom = '8px';\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tutils.removeClass(this.wrapper, 'iScrollBothScrollbars');\n\t\t\tutils.addClass(this.wrapper, 'iScrollLoneScrollbar');\n\n\t\t\tif ( this.options.defaultScrollbars && this.options.customStyle ) {\n\t\t\t\tif ( this.options.listenX ) {\n\t\t\t\t\tthis.wrapper.style.right = '2px';\n\t\t\t\t} else {\n\t\t\t\t\tthis.wrapper.style.bottom = '2px';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tutils.getRect(this.wrapper);\t// force refresh\n\n\t\tif ( this.options.listenX ) {\n\t\t\tthis.wrapperWidth = this.wrapper.clientWidth;\n\t\t\tif ( this.options.resize ) {\n\t\t\t\tthis.indicatorWidth = Math.max(Math.round(this.wrapperWidth * this.wrapperWidth / (this.scroller.scrollerWidth || this.wrapperWidth || 1)), 8);\n\t\t\t\tthis.indicatorStyle.width = this.indicatorWidth + 'px';\n\t\t\t} else {\n\t\t\t\tthis.indicatorWidth = this.indicator.clientWidth;\n\t\t\t}\n\n\t\t\tthis.maxPosX = this.wrapperWidth - this.indicatorWidth;\n\n\t\t\tif ( this.options.shrink == 'clip' ) {\n\t\t\t\tthis.minBoundaryX = -this.indicatorWidth + 8;\n\t\t\t\tthis.maxBoundaryX = this.wrapperWidth - 8;\n\t\t\t} else {\n\t\t\t\tthis.minBoundaryX = 0;\n\t\t\t\tthis.maxBoundaryX = this.maxPosX;\n\t\t\t}\n\n\t\t\tthis.sizeRatioX = this.options.speedRatioX || (this.scroller.maxScrollX && (this.maxPosX / this.scroller.maxScrollX));\n\t\t}\n\n\t\tif ( this.options.listenY ) {\n\t\t\tthis.wrapperHeight = this.wrapper.clientHeight;\n\t\t\tif ( this.options.resize ) {\n\t\t\t\tthis.indicatorHeight = Math.max(Math.round(this.wrapperHeight * this.wrapperHeight / (this.scroller.scrollerHeight || this.wrapperHeight || 1)), 8);\n\t\t\t\tthis.indicatorStyle.height = this.indicatorHeight + 'px';\n\t\t\t} else {\n\t\t\t\tthis.indicatorHeight = this.indicator.clientHeight;\n\t\t\t}\n\n\t\t\tthis.maxPosY = this.wrapperHeight - this.indicatorHeight;\n\n\t\t\tif ( this.options.shrink == 'clip' ) {\n\t\t\t\tthis.minBoundaryY = -this.indicatorHeight + 8;\n\t\t\t\tthis.maxBoundaryY = this.wrapperHeight - 8;\n\t\t\t} else {\n\t\t\t\tthis.minBoundaryY = 0;\n\t\t\t\tthis.maxBoundaryY = this.maxPosY;\n\t\t\t}\n\n\t\t\tthis.maxPosY = this.wrapperHeight - this.indicatorHeight;\n\t\t\tthis.sizeRatioY = this.options.speedRatioY || (this.scroller.maxScrollY && (this.maxPosY / this.scroller.maxScrollY));\n\t\t}\n\n\t\tthis.updatePosition();\n\t},\n\n\tupdatePosition: function () {\n\t\tvar x = this.options.listenX && Math.round(this.sizeRatioX * this.scroller.x) || 0,\n\t\t\ty = this.options.listenY && Math.round(this.sizeRatioY * this.scroller.y) || 0;\n\n\t\tif ( !this.options.ignoreBoundaries ) {\n\t\t\tif ( x < this.minBoundaryX ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.width = Math.max(this.indicatorWidth + x, 8);\n\t\t\t\t\tthis.indicatorStyle.width = this.width + 'px';\n\t\t\t\t}\n\t\t\t\tx = this.minBoundaryX;\n\t\t\t} else if ( x > this.maxBoundaryX ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.width = Math.max(this.indicatorWidth - (x - this.maxPosX), 8);\n\t\t\t\t\tthis.indicatorStyle.width = this.width + 'px';\n\t\t\t\t\tx = this.maxPosX + this.indicatorWidth - this.width;\n\t\t\t\t} else {\n\t\t\t\t\tx = this.maxBoundaryX;\n\t\t\t\t}\n\t\t\t} else if ( this.options.shrink == 'scale' && this.width != this.indicatorWidth ) {\n\t\t\t\tthis.width = this.indicatorWidth;\n\t\t\t\tthis.indicatorStyle.width = this.width + 'px';\n\t\t\t}\n\n\t\t\tif ( y < this.minBoundaryY ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.height = Math.max(this.indicatorHeight + y * 3, 8);\n\t\t\t\t\tthis.indicatorStyle.height = this.height + 'px';\n\t\t\t\t}\n\t\t\t\ty = this.minBoundaryY;\n\t\t\t} else if ( y > this.maxBoundaryY ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.height = Math.max(this.indicatorHeight - (y - this.maxPosY) * 3, 8);\n\t\t\t\t\tthis.indicatorStyle.height = this.height + 'px';\n\t\t\t\t\ty = this.maxPosY + this.indicatorHeight - this.height;\n\t\t\t\t} else {\n\t\t\t\t\ty = this.maxBoundaryY;\n\t\t\t\t}\n\t\t\t} else if ( this.options.shrink == 'scale' && this.height != this.indicatorHeight ) {\n\t\t\t\tthis.height = this.indicatorHeight;\n\t\t\t\tthis.indicatorStyle.height = this.height + 'px';\n\t\t\t}\n\t\t}\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t\tif ( this.scroller.options.useTransform ) {\n\t\t\tthis.indicatorStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.scroller.translateZ;\n\t\t} else {\n\t\t\tthis.indicatorStyle.left = x + 'px';\n\t\t\tthis.indicatorStyle.top = y + 'px';\n\t\t}\n\t},\n\n\t_pos: function (x, y) {\n\t\tif ( x < 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( x > this.maxPosX ) {\n\t\t\tx = this.maxPosX;\n\t\t}\n\n\t\tif ( y < 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( y > this.maxPosY ) {\n\t\t\ty = this.maxPosY;\n\t\t}\n\n\t\tx = this.options.listenX ? Math.round(x / this.sizeRatioX) : this.scroller.x;\n\t\ty = this.options.listenY ? Math.round(y / this.sizeRatioY) : this.scroller.y;\n\n\t\tthis.scroller.scrollTo(x, y);\n\t},\n\n\tfade: function (val, hold) {\n\t\tif ( hold && !this.visible ) {\n\t\t\treturn;\n\t\t}\n\n\t\tclearTimeout(this.fadeTimeout);\n\t\tthis.fadeTimeout = null;\n\n\t\tvar time = val ? 250 : 500,\n\t\t\tdelay = val ? 0 : 300;\n\n\t\tval = val ? '1' : '0';\n\n\t\tthis.wrapperStyle[utils.style.transitionDuration] = time + 'ms';\n\n\t\tthis.fadeTimeout = setTimeout((function (val) {\n\t\t\tthis.wrapperStyle.opacity = val;\n\t\t\tthis.visible = +val;\n\t\t}).bind(this, val), delay);\n\t}\n};\n\nIScroll.utils = utils;\n\nif ( typeof module != 'undefined' && module.exports ) {\n\tmodule.exports = IScroll;\n} else if ( typeof define == 'function' && define.amd ) {\n define( function () { return IScroll; } );\n} else {\n\twindow.IScroll = IScroll;\n}\n\n})(window, document, Math);\n","/*\n * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/\n *\n * Uses the built in easing capabilities added In jQuery 1.1\n * to offer multiple easing options\n *\n * TERMS OF USE - jQuery Easing\n * \n * Open source under the BSD License. \n * \n * Copyright © 2008 George McGinley Smith\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms, with or without modification, \n * are permitted provided that the following conditions are met:\n * \n * Redistributions of source code must retain the above copyright notice, this list of \n * conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright notice, this list \n * of conditions and the following disclaimer in the documentation and/or other materials \n * provided with the distribution.\n * \n * Neither the name of the author nor the names of contributors may be used to endorse \n * or promote products derived from this software without specific prior written permission.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY \n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED \n * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED \n * OF THE POSSIBILITY OF SUCH DAMAGE. \n *\n*/\n\n// t: current time, b: begInnIng value, c: change In value, d: duration\njQuery.easing['jswing'] = jQuery.easing['swing'];\n\njQuery.extend( jQuery.easing,\n{\n\tdef: 'easeOutQuad',\n\tswing: function (x, t, b, c, d) {\n\t\t//alert(jQuery.easing.default);\n\t\treturn jQuery.easing[jQuery.easing.def](x, t, b, c, d);\n\t},\n\teaseInQuad: function (x, t, b, c, d) {\n\t\treturn c*(t/=d)*t + b;\n\t},\n\teaseOutQuad: function (x, t, b, c, d) {\n\t\treturn -c *(t/=d)*(t-2) + b;\n\t},\n\teaseInOutQuad: function (x, t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return c/2*t*t + b;\n\t\treturn -c/2 * ((--t)*(t-2) - 1) + b;\n\t},\n\teaseInCubic: function (x, t, b, c, d) {\n\t\treturn c*(t/=d)*t*t + b;\n\t},\n\teaseOutCubic: function (x, t, b, c, d) {\n\t\treturn c*((t=t/d-1)*t*t + 1) + b;\n\t},\n\teaseInOutCubic: function (x, t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return c/2*t*t*t + b;\n\t\treturn c/2*((t-=2)*t*t + 2) + b;\n\t},\n\teaseInQuart: function (x, t, b, c, d) {\n\t\treturn c*(t/=d)*t*t*t + b;\n\t},\n\teaseOutQuart: function (x, t, b, c, d) {\n\t\treturn -c * ((t=t/d-1)*t*t*t - 1) + b;\n\t},\n\teaseInOutQuart: function (x, t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return c/2*t*t*t*t + b;\n\t\treturn -c/2 * ((t-=2)*t*t*t - 2) + b;\n\t},\n\teaseInQuint: function (x, t, b, c, d) {\n\t\treturn c*(t/=d)*t*t*t*t + b;\n\t},\n\teaseOutQuint: function (x, t, b, c, d) {\n\t\treturn c*((t=t/d-1)*t*t*t*t + 1) + b;\n\t},\n\teaseInOutQuint: function (x, t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;\n\t\treturn c/2*((t-=2)*t*t*t*t + 2) + b;\n\t},\n\teaseInSine: function (x, t, b, c, d) {\n\t\treturn -c * Math.cos(t/d * (Math.PI/2)) + c + b;\n\t},\n\teaseOutSine: function (x, t, b, c, d) {\n\t\treturn c * Math.sin(t/d * (Math.PI/2)) + b;\n\t},\n\teaseInOutSine: function (x, t, b, c, d) {\n\t\treturn -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;\n\t},\n\teaseInExpo: function (x, t, b, c, d) {\n\t\treturn (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;\n\t},\n\teaseOutExpo: function (x, t, b, c, d) {\n\t\treturn (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;\n\t},\n\teaseInOutExpo: function (x, t, b, c, d) {\n\t\tif (t==0) return b;\n\t\tif (t==d) return b+c;\n\t\tif ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;\n\t\treturn c/2 * (-Math.pow(2, -10 * --t) + 2) + b;\n\t},\n\teaseInCirc: function (x, t, b, c, d) {\n\t\treturn -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;\n\t},\n\teaseOutCirc: function (x, t, b, c, d) {\n\t\treturn c * Math.sqrt(1 - (t=t/d-1)*t) + b;\n\t},\n\teaseInOutCirc: function (x, t, b, c, d) {\n\t\tif ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;\n\t\treturn c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;\n\t},\n\teaseInElastic: function (x, t, b, c, d) {\n\t\tvar s=1.70158;var p=0;var a=c;\n\t\tif (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;\n\t\tif (a < Math.abs(c)) { a=c; var s=p/4; }\n\t\telse var s = p/(2*Math.PI) * Math.asin (c/a);\n\t\treturn -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;\n\t},\n\teaseOutElastic: function (x, t, b, c, d) {\n\t\tvar s=1.70158;var p=0;var a=c;\n\t\tif (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;\n\t\tif (a < Math.abs(c)) { a=c; var s=p/4; }\n\t\telse var s = p/(2*Math.PI) * Math.asin (c/a);\n\t\treturn a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;\n\t},\n\teaseInOutElastic: function (x, t, b, c, d) {\n\t\tvar s=1.70158;var p=0;var a=c;\n\t\tif (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);\n\t\tif (a < Math.abs(c)) { a=c; var s=p/4; }\n\t\telse var s = p/(2*Math.PI) * Math.asin (c/a);\n\t\tif (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;\n\t\treturn a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;\n\t},\n\teaseInBack: function (x, t, b, c, d, s) {\n\t\tif (s == undefined) s = 1.70158;\n\t\treturn c*(t/=d)*t*((s+1)*t - s) + b;\n\t},\n\teaseOutBack: function (x, t, b, c, d, s) {\n\t\tif (s == undefined) s = 1.70158;\n\t\treturn c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;\n\t},\n\teaseInOutBack: function (x, t, b, c, d, s) {\n\t\tif (s == undefined) s = 1.70158; \n\t\tif ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;\n\t\treturn c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;\n\t},\n\teaseInBounce: function (x, t, b, c, d) {\n\t\treturn c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;\n\t},\n\teaseOutBounce: function (x, t, b, c, d) {\n\t\tif ((t/=d) < (1/2.75)) {\n\t\t\treturn c*(7.5625*t*t) + b;\n\t\t} else if (t < (2/2.75)) {\n\t\t\treturn c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;\n\t\t} else if (t < (2.5/2.75)) {\n\t\t\treturn c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;\n\t\t} else {\n\t\t\treturn c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;\n\t\t}\n\t},\n\teaseInOutBounce: function (x, t, b, c, d) {\n\t\tif (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;\n\t\treturn jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;\n\t}\n});\n\n/*\n *\n * TERMS OF USE - EASING EQUATIONS\n * \n * Open source under the BSD License. \n * \n * Copyright © 2001 Robert Penner\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms, with or without modification, \n * are permitted provided that the following conditions are met:\n * \n * Redistributions of source code must retain the above copyright notice, this list of \n * conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright notice, this list \n * of conditions and the following disclaimer in the documentation and/or other materials \n * provided with the distribution.\n * \n * Neither the name of the author nor the names of contributors may be used to endorse \n * or promote products derived from this software without specific prior written permission.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY \n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED \n * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED \n * OF THE POSSIBILITY OF SUCH DAMAGE. \n *\n */","/*!\n * hoverIntent v1.8.1 // 2014.08.11 // jQuery v1.9.1+\n * http://briancherne.github.io/jquery-hoverIntent/\n *\n * You may use hoverIntent under the terms of the MIT license. Basically that\n * means you are free to use hoverIntent as long as this header is left intact.\n * Copyright 2007, 2014 Brian Cherne\n */\n\n/* hoverIntent is similar to jQuery's built-in \"hover\" method except that\n * instead of firing the handlerIn function immediately, hoverIntent checks\n * to see if the user's mouse has slowed down (beneath the sensitivity\n * threshold) before firing the event. The handlerOut function is only\n * called after a matching handlerIn.\n *\n * // basic usage ... just like .hover()\n * .hoverIntent( handlerIn, handlerOut )\n * .hoverIntent( handlerInOut )\n *\n * // basic usage ... with event delegation!\n * .hoverIntent( handlerIn, handlerOut, selector )\n * .hoverIntent( handlerInOut, selector )\n *\n * // using a basic configuration object\n * .hoverIntent( config )\n *\n * @param handlerIn function OR configuration object\n * @param handlerOut function OR selector for delegation OR undefined\n * @param selector selector OR undefined\n * @author Brian Cherne \n */\n\n(function(factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n define(['jquery'], factory);\n } else if (jQuery && !jQuery.fn.hoverIntent) {\n factory(jQuery);\n }\n})(function($) {\n 'use strict';\n\n // default configuration values\n var _cfg = {\n interval: 100,\n sensitivity: 6,\n timeout: 0\n };\n\n // counter used to generate an ID for each instance\n var INSTANCE_COUNT = 0;\n\n // current X and Y position of mouse, updated during mousemove tracking (shared across instances)\n var cX, cY;\n\n // saves the current pointer position coordinates based on the given mousemove event\n var track = function(ev) {\n cX = ev.pageX;\n cY = ev.pageY;\n };\n\n // compares current and previous mouse positions\n var compare = function(ev,$el,s,cfg) {\n // compare mouse positions to see if pointer has slowed enough to trigger `over` function\n if ( Math.sqrt( (s.pX-cX)*(s.pX-cX) + (s.pY-cY)*(s.pY-cY) ) < cfg.sensitivity ) {\n $el.off(s.event,track);\n delete s.timeoutId;\n // set hoverIntent state as active for this element (permits `out` handler to trigger)\n s.isActive = true;\n // overwrite old mouseenter event coordinates with most recent pointer position\n ev.pageX = cX; ev.pageY = cY;\n // clear coordinate data from state object\n delete s.pX; delete s.pY;\n return cfg.over.apply($el[0],[ev]);\n } else {\n // set previous coordinates for next comparison\n s.pX = cX; s.pY = cY;\n // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)\n s.timeoutId = setTimeout( function(){compare(ev, $el, s, cfg);} , cfg.interval );\n }\n };\n\n // triggers given `out` function at configured `timeout` after a mouseleave and clears state\n var delay = function(ev,$el,s,out) {\n delete $el.data('hoverIntent')[s.id];\n return out.apply($el[0],[ev]);\n };\n\n $.fn.hoverIntent = function(handlerIn,handlerOut,selector) {\n // instance ID, used as a key to store and retrieve state information on an element\n var instanceId = INSTANCE_COUNT++;\n\n // extend the default configuration and parse parameters\n var cfg = $.extend({}, _cfg);\n if ( $.isPlainObject(handlerIn) ) {\n cfg = $.extend(cfg, handlerIn);\n if ( !$.isFunction(cfg.out) ) {\n cfg.out = cfg.over;\n }\n } else if ( $.isFunction(handlerOut) ) {\n cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );\n } else {\n cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );\n }\n\n // A private function for handling mouse 'hovering'\n var handleHover = function(e) {\n // cloned event to pass to handlers (copy required for event object to be passed in IE)\n var ev = $.extend({},e);\n\n // the current target of the mouse event, wrapped in a jQuery object\n var $el = $(this);\n\n // read hoverIntent data from element (or initialize if not present)\n var hoverIntentData = $el.data('hoverIntent');\n if (!hoverIntentData) { $el.data('hoverIntent', (hoverIntentData = {})); }\n\n // read per-instance state from element (or initialize if not present)\n var state = hoverIntentData[instanceId];\n if (!state) { hoverIntentData[instanceId] = state = { id: instanceId }; }\n\n // state properties:\n // id = instance ID, used to clean up data\n // timeoutId = timeout ID, reused for tracking mouse position and delaying \"out\" handler\n // isActive = plugin state, true after `over` is called just until `out` is called\n // pX, pY = previously-measured pointer coordinates, updated at each polling interval\n // event = string representing the namespaced event used for mouse tracking\n\n // clear any existing timeout\n if (state.timeoutId) { state.timeoutId = clearTimeout(state.timeoutId); }\n\n // namespaced event used to register and unregister mousemove tracking\n var mousemove = state.event = 'mousemove.hoverIntent.hoverIntent'+instanceId;\n\n // handle the event, based on its type\n if (e.type === 'mouseenter') {\n // do nothing if already active\n if (state.isActive) { return; }\n // set \"previous\" X and Y position based on initial entry point\n state.pX = ev.pageX; state.pY = ev.pageY;\n // update \"current\" X and Y position based on mousemove\n $el.off(mousemove,track).on(mousemove,track);\n // start polling interval (self-calling timeout) to compare mouse coordinates over time\n state.timeoutId = setTimeout( function(){compare(ev,$el,state,cfg);} , cfg.interval );\n } else { // \"mouseleave\"\n // do nothing if not already active\n if (!state.isActive) { return; }\n // unbind expensive mousemove event\n $el.off(mousemove,track);\n // if hoverIntent state is true, then call the mouseOut function after the specified delay\n state.timeoutId = setTimeout( function(){delay(ev,$el,state,cfg.out);} , cfg.timeout );\n }\n };\n\n // listen for mouseenter and mouseleave\n return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector);\n };\n});\n","(function ($) {\n\tvar o = $({});\n\t$.subscribe = function () {\n\t\to.on.apply(o, arguments);\n\t};\n\t$.unsubscribe = function () {\n\t\to.off.apply(o, arguments);\n\t};\n\t$.publish = function () {\n\t\to.trigger.apply(o, arguments);\n\t};\n}(jQuery));","/*!\n * jQuery UI Touch Punch 0.2.3\n *\n * Copyright 2011–2014, Dave Furfero\n * Dual licensed under the MIT or GPL Version 2 licenses.\n *\n * Depends:\n * jquery.ui.widget.js\n * jquery.ui.mouse.js\n */\n!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent(\"MouseEvents\");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch=\"ontouchend\"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,\"mouseover\"),f(a,\"mousemove\"),f(a,\"mousedown\"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,\"mousemove\"))},b._touchEnd=function(a){e&&(f(a,\"mouseup\"),f(a,\"mouseout\"),this._touchMoved||f(a,\"click\"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,\"_touchStart\"),touchmove:a.proxy(b,\"_touchMove\"),touchend:a.proxy(b,\"_touchEnd\")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,\"_touchStart\"),touchmove:a.proxy(b,\"_touchMove\"),touchend:a.proxy(b,\"_touchEnd\")}),d.call(b)}}}(jQuery);","/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\n/* Latitude/longitude spherical geodesy tools (c) Chris Veness 2002-2016 */\n/* MIT Licence */\n/* www.movable-type.co.uk/scripts/latlong.html */\n/* www.movable-type.co.uk/scripts/geodesy/docs/module-latlon-spherical.html */\n/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\n\n'use strict';\nif (typeof module != 'undefined' && module.exports) var Dms = require('./dms'); // ≡ import Dms from 'dms.js'\n\n\n/**\n * Library of geodesy functions for operations on a spherical earth model.\n *\n * @module latlon-spherical\n * @requires dms\n */\n\n\n/**\n * Creates a LatLon point on the earth's surface at the specified latitude / longitude.\n *\n * @constructor\n * @param {number} lat - Latitude in degrees.\n * @param {number} lon - Longitude in degrees.\n *\n * @example\n * var p1 = new LatLon(52.205, 0.119);\n */\nfunction LatLon(lat, lon) {\n\t// allow instantiation without 'new'\n\tif (!(this instanceof LatLon)) return new LatLon(lat, lon);\n\n\tthis.lat = Number(lat);\n\tthis.lon = Number(lon);\n}\n\n\n/**\n * Returns the distance from ‘this’ point to destination point (using haversine formula).\n *\n * @param {LatLon} point - Latitude/longitude of destination point.\n * @param {number} [radius=6371e3] - (Mean) radius of earth (defaults to radius in metres).\n * @returns {number} Distance between this point and destination point, in same units as radius.\n *\n * @example\n * var p1 = new LatLon(52.205, 0.119);\n * var p2 = new LatLon(48.857, 2.351);\n * var d = p1.distanceTo(p2); // 404.3 km\n */\nLatLon.prototype.distanceTo = function (point, radius) {\n\tif (!(point instanceof LatLon)) throw new TypeError('point is not LatLon object');\n\tradius = (radius === undefined) ? 6371e3 : Number(radius);\n\n\tvar R = radius;\n\tvar φ1 = this.lat.toRadians(), λ1 = this.lon.toRadians();\n\tvar φ2 = point.lat.toRadians(), λ2 = point.lon.toRadians();\n\tvar Δφ = φ2 - φ1;\n\tvar Δλ = λ2 - λ1;\n\n\tvar a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2)\n\t\t\t+ Math.cos(φ1) * Math.cos(φ2)\n\t\t\t* Math.sin(Δλ / 2) * Math.sin(Δλ / 2);\n\tvar c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\tvar d = R * c;\n\n\treturn d;\n};\n\n\n/**\n * Returns the (initial) bearing from ‘this’ point to destination point.\n *\n * @param {LatLon} point - Latitude/longitude of destination point.\n * @returns {number} Initial bearing in degrees from north.\n *\n * @example\n * var p1 = new LatLon(52.205, 0.119);\n * var p2 = new LatLon(48.857, 2.351);\n * var b1 = p1.bearingTo(p2); // 156.2°\n */\nLatLon.prototype.bearingTo = function (point) {\n\tif (!(point instanceof LatLon)) throw new TypeError('point is not LatLon object');\n\n\tvar φ1 = this.lat.toRadians(), φ2 = point.lat.toRadians();\n\tvar Δλ = (point.lon - this.lon).toRadians();\n\n\t// see http://mathforum.org/library/drmath/view/55417.html\n\tvar y = Math.sin(Δλ) * Math.cos(φ2);\n\tvar x = Math.cos(φ1) * Math.sin(φ2) -\n\t\t\tMath.sin(φ1) * Math.cos(φ2) * Math.cos(Δλ);\n\tvar θ = Math.atan2(y, x);\n\n\treturn (θ.toDegrees() + 360) % 360;\n};\n\n\n/**\n * Returns final bearing arriving at destination destination point from ‘this’ point; the final bearing\n * will differ from the initial bearing by varying degrees according to distance and latitude.\n *\n * @param {LatLon} point - Latitude/longitude of destination point.\n * @returns {number} Final bearing in degrees from north.\n *\n * @example\n * var p1 = new LatLon(52.205, 0.119);\n * var p2 = new LatLon(48.857, 2.351);\n * var b2 = p1.finalBearingTo(p2); // 157.9°\n */\nLatLon.prototype.finalBearingTo = function (point) {\n\tif (!(point instanceof LatLon)) throw new TypeError('point is not LatLon object');\n\n\t// get initial bearing from destination point to this point & reverse it by adding 180°\n\treturn ( point.bearingTo(this) + 180 ) % 360;\n};\n\n\n/**\n * Returns the midpoint between ‘this’ point and the supplied point.\n *\n * @param {LatLon} point - Latitude/longitude of destination point.\n * @returns {LatLon} Midpoint between this point and the supplied point.\n *\n * @example\n * var p1 = new LatLon(52.205, 0.119);\n * var p2 = new LatLon(48.857, 2.351);\n * var pMid = p1.midpointTo(p2); // 50.5363°N, 001.2746°E\n */\nLatLon.prototype.midpointTo = function (point) {\n\tif (!(point instanceof LatLon)) throw new TypeError('point is not LatLon object');\n\n\t// φm = atan2( sinφ1 + sinφ2, √( (cosφ1 + cosφ2⋅cosΔλ) ⋅ (cosφ1 + cosφ2⋅cosΔλ) ) + cos²φ2⋅sin²Δλ )\n\t// λm = λ1 + atan2(cosφ2⋅sinΔλ, cosφ1 + cosφ2⋅cosΔλ)\n\t// see http://mathforum.org/library/drmath/view/51822.html for derivation\n\n\tvar φ1 = this.lat.toRadians(), λ1 = this.lon.toRadians();\n\tvar φ2 = point.lat.toRadians();\n\tvar Δλ = (point.lon - this.lon).toRadians();\n\n\tvar Bx = Math.cos(φ2) * Math.cos(Δλ);\n\tvar By = Math.cos(φ2) * Math.sin(Δλ);\n\n\tvar x = Math.sqrt((Math.cos(φ1) + Bx) * (Math.cos(φ1) + Bx) + By * By);\n\tvar y = Math.sin(φ1) + Math.sin(φ2);\n\tvar φ3 = Math.atan2(y, x);\n\n\tvar λ3 = λ1 + Math.atan2(By, Math.cos(φ1) + Bx);\n\n\treturn new LatLon(φ3.toDegrees(), (λ3.toDegrees() + 540) % 360 - 180); // normalise to −180..+180°\n};\n\n\n/**\n * Returns the point at given fraction between ‘this’ point and specified point.\n *\n * @param {LatLon} point - Latitude/longitude of destination point.\n * @param {number} fraction - Fraction between the two points (0 = this point, 1 = specified point).\n * @returns {LatLon} Intermediate point between this point and destination point.\n *\n * @example\n * let p1 = new LatLon(52.205, 0.119);\n * let p2 = new LatLon(48.857, 2.351);\n * let pMid = p1.intermediatePointTo(p2, 0.25); // 51.3721°N, 000.7073°E\n */\nLatLon.prototype.intermediatePointTo = function (point, fraction) {\n\tif (!(point instanceof LatLon)) throw new TypeError('point is not LatLon object');\n\n\tvar φ1 = this.lat.toRadians(), λ1 = this.lon.toRadians();\n\tvar φ2 = point.lat.toRadians(), λ2 = point.lon.toRadians();\n\tvar sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), sinλ1 = Math.sin(λ1), cosλ1 = Math.cos(λ1);\n\tvar sinφ2 = Math.sin(φ2), cosφ2 = Math.cos(φ2), sinλ2 = Math.sin(λ2), cosλ2 = Math.cos(λ2);\n\n\t// distance between points\n\tvar Δφ = φ2 - φ1;\n\tvar Δλ = λ2 - λ1;\n\tvar a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2)\n\t\t\t+ Math.cos(φ1) * Math.cos(φ2) * Math.sin(Δλ / 2) * Math.sin(Δλ / 2);\n\tvar δ = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\n\tvar A = Math.sin((1 - fraction) * δ) / Math.sin(δ);\n\tvar B = Math.sin(fraction * δ) / Math.sin(δ);\n\n\tvar x = A * cosφ1 * cosλ1 + B * cosφ2 * cosλ2;\n\tvar y = A * cosφ1 * sinλ1 + B * cosφ2 * sinλ2;\n\tvar z = A * sinφ1 + B * sinφ2;\n\n\tvar φ3 = Math.atan2(z, Math.sqrt(x * x + y * y));\n\tvar λ3 = Math.atan2(y, x);\n\n\treturn new LatLon(φ3.toDegrees(), (λ3.toDegrees() + 540) % 360 - 180); // normalise lon to −180..+180°\n};\n\n\n/**\n * Returns the destination point from ‘this’ point having travelled the given distance on the\n * given initial bearing (bearing normally varies around path followed).\n *\n * @param {number} distance - Distance travelled, in same units as earth radius (default: metres).\n * @param {number} bearing - Initial bearing in degrees from north.\n * @param {number} [radius=6371e3] - (Mean) radius of earth (defaults to radius in metres).\n * @returns {LatLon} Destination point.\n *\n * @example\n * var p1 = new LatLon(51.4778, -0.0015);\n * var p2 = p1.destinationPoint(7794, 300.7); // 51.5135°N, 000.0983°W\n */\nLatLon.prototype.destinationPoint = function (distance, bearing, radius) {\n\tradius = (radius === undefined) ? 6371e3 : Number(radius);\n\n\t// sinφ2 = sinφ1⋅cosδ + cosφ1⋅sinδ⋅cosθ\n\t// tanΔλ = sinθ⋅sinδ⋅cosφ1 / cosδ−sinφ1⋅sinφ2\n\t// see http://williams.best.vwh.net/avform.htm#LL\n\n\tvar δ = Number(distance) / radius; // angular distance in radians\n\tvar θ = Number(bearing).toRadians();\n\n\tvar φ1 = this.lat.toRadians();\n\tvar λ1 = this.lon.toRadians();\n\n\tvar sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1);\n\tvar sinδ = Math.sin(δ), cosδ = Math.cos(δ);\n\tvar sinθ = Math.sin(θ), cosθ = Math.cos(θ);\n\n\tvar sinφ2 = sinφ1 * cosδ + cosφ1 * sinδ * cosθ;\n\tvar φ2 = Math.asin(sinφ2);\n\tvar y = sinθ * sinδ * cosφ1;\n\tvar x = cosδ - sinφ1 * sinφ2;\n\tvar λ2 = λ1 + Math.atan2(y, x);\n\n\treturn new LatLon(φ2.toDegrees(), (λ2.toDegrees() + 540) % 360 - 180); // normalise to −180..+180°\n};\n\n\n/**\n * Returns the point of intersection of two paths defined by point and bearing.\n *\n * @param {LatLon} p1 - First point.\n * @param {number} brng1 - Initial bearing from first point.\n * @param {LatLon} p2 - Second point.\n * @param {number} brng2 - Initial bearing from second point.\n * @returns {LatLon|null} Destination point (null if no unique intersection defined).\n *\n * @example\n * var p1 = LatLon(51.8853, 0.2545), brng1 = 108.547;\n * var p2 = LatLon(49.0034, 2.5735), brng2 = 32.435;\n * var pInt = LatLon.intersection(p1, brng1, p2, brng2); // 50.9078°N, 004.5084°E\n */\nLatLon.intersection = function (p1, brng1, p2, brng2) {\n\tif (!(p1 instanceof LatLon)) throw new TypeError('p1 is not LatLon object');\n\tif (!(p2 instanceof LatLon)) throw new TypeError('p2 is not LatLon object');\n\n\t// see http://williams.best.vwh.net/avform.htm#Intersection\n\n\tvar φ1 = p1.lat.toRadians(), λ1 = p1.lon.toRadians();\n\tvar φ2 = p2.lat.toRadians(), λ2 = p2.lon.toRadians();\n\tvar θ13 = Number(brng1).toRadians(), θ23 = Number(brng2).toRadians();\n\tvar Δφ = φ2 - φ1, Δλ = λ2 - λ1;\n\n\tvar δ12 = 2 * Math.asin(Math.sqrt(Math.sin(Δφ / 2) * Math.sin(Δφ / 2)\n\t\t\t\t\t+ Math.cos(φ1) * Math.cos(φ2) * Math.sin(Δλ / 2) * Math.sin(Δλ / 2)));\n\tif (δ12 == 0) return null;\n\n\t// initial/final bearings between points\n\tvar θa = Math.acos(( Math.sin(φ2) - Math.sin(φ1) * Math.cos(δ12) ) / ( Math.sin(δ12) * Math.cos(φ1) ));\n\tif (isNaN(θa)) θa = 0; // protect against rounding\n\tvar θb = Math.acos(( Math.sin(φ1) - Math.sin(φ2) * Math.cos(δ12) ) / ( Math.sin(δ12) * Math.cos(φ2) ));\n\n\tvar θ12 = Math.sin(λ2 - λ1) > 0 ? θa : 2 * Math.PI - θa;\n\tvar θ21 = Math.sin(λ2 - λ1) > 0 ? 2 * Math.PI - θb : θb;\n\n\tvar α1 = (θ13 - θ12 + Math.PI) % (2 * Math.PI) - Math.PI; // angle 2-1-3\n\tvar α2 = (θ21 - θ23 + Math.PI) % (2 * Math.PI) - Math.PI; // angle 1-2-3\n\n\tif (Math.sin(α1) == 0 && Math.sin(α2) == 0) return null; // infinite intersections\n\tif (Math.sin(α1) * Math.sin(α2) < 0) return null; // ambiguous intersection\n\n\t//α1 = Math.abs(α1);\n\t//α2 = Math.abs(α2);\n\t// ... Ed Williams takes abs of α1/α2, but seems to break calculation?\n\n\tvar α3 = Math.acos(-Math.cos(α1) * Math.cos(α2) + Math.sin(α1) * Math.sin(α2) * Math.cos(δ12));\n\tvar δ13 = Math.atan2(Math.sin(δ12) * Math.sin(α1) * Math.sin(α2), Math.cos(α2) + Math.cos(α1) * Math.cos(α3));\n\tvar φ3 = Math.asin(Math.sin(φ1) * Math.cos(δ13) + Math.cos(φ1) * Math.sin(δ13) * Math.cos(θ13));\n\tvar Δλ13 = Math.atan2(Math.sin(θ13) * Math.sin(δ13) * Math.cos(φ1), Math.cos(δ13) - Math.sin(φ1) * Math.sin(φ3));\n\tvar λ3 = λ1 + Δλ13;\n\n\treturn new LatLon(φ3.toDegrees(), (λ3.toDegrees() + 540) % 360 - 180); // normalise to −180..+180°\n};\n\n\n/**\n * Returns (signed) distance from ‘this’ point to great circle defined by start-point and end-point.\n *\n * @param {LatLon} pathStart - Start point of great circle path.\n * @param {LatLon} pathEnd - End point of great circle path.\n * @param {number} [radius=6371e3] - (Mean) radius of earth (defaults to radius in metres).\n * @returns {number} Distance to great circle (-ve if to left, +ve if to right of path).\n *\n * @example\n * var pCurrent = new LatLon(53.2611, -0.7972);\n * var p1 = new LatLon(53.3206, -1.7297);\n * var p2 = new LatLon(53.1887, 0.1334);\n * var d = pCurrent.crossTrackDistanceTo(p1, p2); // -307.5 m\n */\nLatLon.prototype.crossTrackDistanceTo = function (pathStart, pathEnd, radius) {\n\tif (!(pathStart instanceof LatLon)) throw new TypeError('pathStart is not LatLon object');\n\tif (!(pathEnd instanceof LatLon)) throw new TypeError('pathEnd is not LatLon object');\n\tradius = (radius === undefined) ? 6371e3 : Number(radius);\n\n\tvar δ13 = pathStart.distanceTo(this, radius) / radius;\n\tvar θ13 = pathStart.bearingTo(this).toRadians();\n\tvar θ12 = pathStart.bearingTo(pathEnd).toRadians();\n\n\tvar dxt = Math.asin(Math.sin(δ13) * Math.sin(θ13 - θ12)) * radius;\n\n\treturn dxt;\n};\n\n\n/**\n * Returns maximum latitude reached when travelling on a great circle on given bearing from this\n * point ('Clairaut's formula'). Negate the result for the minimum latitude (in the Southern\n * hemisphere).\n *\n * The maximum latitude is independent of longitude; it will be the same for all points on a given\n * latitude.\n *\n * @param {number} bearing - Initial bearing.\n * @param {number} latitude - Starting latitude.\n */\nLatLon.prototype.maxLatitude = function (bearing) {\n\tvar θ = Number(bearing).toRadians();\n\n\tvar φ = this.lat.toRadians();\n\n\tvar φMax = Math.acos(Math.abs(Math.sin(θ) * Math.cos(φ)));\n\n\treturn φMax.toDegrees();\n};\n\n\n/**\n * Returns the pair of meridians at which a great circle defined by two points crosses the given\n * latitude. If the great circle doesn't reach the given latitude, null is returned.\n *\n * @param {LatLon} point1 - First point defining great circle.\n * @param {LatLon} point2 - Second point defining great circle.\n * @param {number} latitude - Latitude crossings are to be determined for.\n * @returns {Object|null} Object containing { lon1, lon2 } or null if given latitude not reached.\n */\nLatLon.crossingParallels = function (point1, point2, latitude) {\n\tvar φ = Number(latitude).toRadians();\n\n\tvar φ1 = point1.lat.toRadians();\n\tvar λ1 = point1.lon.toRadians();\n\tvar φ2 = point2.lat.toRadians();\n\tvar λ2 = point2.lon.toRadians();\n\n\tvar Δλ = λ2 - λ1;\n\n\tvar x = Math.sin(φ1) * Math.cos(φ2) * Math.cos(φ) * Math.sin(Δλ);\n\tvar y = Math.sin(φ1) * Math.cos(φ2) * Math.cos(φ) * Math.cos(Δλ) - Math.cos(φ1) * Math.sin(φ2) * Math.cos(φ);\n\tvar z = Math.cos(φ1) * Math.cos(φ2) * Math.sin(φ) * Math.sin(Δλ);\n\n\tif (z * z > x * x + y * y) return null; // great circle doesn't reach latitude\n\n\tvar λm = Math.atan2(-y, x); // longitude at max latitude\n\tvar Δλi = Math.acos(z / Math.sqrt(x * x + y * y)); // Δλ from λm to intersection points\n\n\tvar λi1 = λ1 + λm - Δλi;\n\tvar λi2 = λ1 + λm + Δλi;\n\n\treturn {lon1: (λi1.toDegrees() + 540) % 360 - 180, lon2: (λi2.toDegrees() + 540) % 360 - 180}; // normalise to −180..+180°\n};\n\n\n/* Rhumb - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\n\n/**\n * Returns the distance travelling from ‘this’ point to destination point along a rhumb line.\n *\n * @param {LatLon} point - Latitude/longitude of destination point.\n * @param {number} [radius=6371e3] - (Mean) radius of earth (defaults to radius in metres).\n * @returns {number} Distance in km between this point and destination point (same units as radius).\n *\n * @example\n * var p1 = new LatLon(51.127, 1.338);\n * var p2 = new LatLon(50.964, 1.853);\n * var d = p1.distanceTo(p2); // 40.31 km\n */\nLatLon.prototype.rhumbDistanceTo = function (point, radius) {\n\tif (!(point instanceof LatLon)) throw new TypeError('point is not LatLon object');\n\tradius = (radius === undefined) ? 6371e3 : Number(radius);\n\n\t// see http://williams.best.vwh.net/avform.htm#Rhumb\n\n\tvar R = radius;\n\tvar φ1 = this.lat.toRadians(), φ2 = point.lat.toRadians();\n\tvar Δφ = φ2 - φ1;\n\tvar Δλ = Math.abs(point.lon - this.lon).toRadians();\n\t// if dLon over 180° take shorter rhumb line across the anti-meridian:\n\tif (Math.abs(Δλ) > Math.PI) Δλ = Δλ > 0 ? -(2 * Math.PI - Δλ) : (2 * Math.PI + Δλ);\n\n\t// on Mercator projection, longitude distances shrink by latitude; q is the 'stretch factor'\n\t// q becomes ill-conditioned along E-W line (0/0); use empirical tolerance to avoid it\n\tvar Δψ = Math.log(Math.tan(φ2 / 2 + Math.PI / 4) / Math.tan(φ1 / 2 + Math.PI / 4));\n\tvar q = Math.abs(Δψ) > 10e-12 ? Δφ / Δψ : Math.cos(φ1);\n\n\t// distance is pythagoras on 'stretched' Mercator projection\n\tvar δ = Math.sqrt(Δφ * Δφ + q * q * Δλ * Δλ); // angular distance in radians\n\tvar dist = δ * R;\n\n\treturn dist;\n};\n\n\n/**\n * Returns the bearing from ‘this’ point to destination point along a rhumb line.\n *\n * @param {LatLon} point - Latitude/longitude of destination point.\n * @returns {number} Bearing in degrees from north.\n *\n * @example\n * var p1 = new LatLon(51.127, 1.338);\n * var p2 = new LatLon(50.964, 1.853);\n * var d = p1.rhumbBearingTo(p2); // 116.7 m\n */\nLatLon.prototype.rhumbBearingTo = function (point) {\n\tif (!(point instanceof LatLon)) throw new TypeError('point is not LatLon object');\n\n\tvar φ1 = this.lat.toRadians(), φ2 = point.lat.toRadians();\n\tvar Δλ = (point.lon - this.lon).toRadians();\n\t// if dLon over 180° take shorter rhumb line across the anti-meridian:\n\tif (Math.abs(Δλ) > Math.PI) Δλ = Δλ > 0 ? -(2 * Math.PI - Δλ) : (2 * Math.PI + Δλ);\n\n\tvar Δψ = Math.log(Math.tan(φ2 / 2 + Math.PI / 4) / Math.tan(φ1 / 2 + Math.PI / 4));\n\n\tvar θ = Math.atan2(Δλ, Δψ);\n\n\treturn (θ.toDegrees() + 360) % 360;\n};\n\n\n/**\n * Returns the destination point having travelled along a rhumb line from ‘this’ point the given\n * distance on the given bearing.\n *\n * @param {number} distance - Distance travelled, in same units as earth radius (default: metres).\n * @param {number} bearing - Bearing in degrees from north.\n * @param {number} [radius=6371e3] - (Mean) radius of earth (defaults to radius in metres).\n * @returns {LatLon} Destination point.\n *\n * @example\n * var p1 = new LatLon(51.127, 1.338);\n * var p2 = p1.rhumbDestinationPoint(40300, 116.7); // 50.9642°N, 001.8530°E\n */\nLatLon.prototype.rhumbDestinationPoint = function (distance, bearing, radius) {\n\tradius = (radius === undefined) ? 6371e3 : Number(radius);\n\n\tvar δ = Number(distance) / radius; // angular distance in radians\n\tvar φ1 = this.lat.toRadians(), λ1 = this.lon.toRadians();\n\tvar θ = Number(bearing).toRadians();\n\n\tvar Δφ = δ * Math.cos(θ);\n\tvar φ2 = φ1 + Δφ;\n\n\t// check for some daft bugger going past the pole, normalise latitude if so\n\tif (Math.abs(φ2) > Math.PI / 2) φ2 = φ2 > 0 ? Math.PI - φ2 : -Math.PI - φ2;\n\n\tvar Δψ = Math.log(Math.tan(φ2 / 2 + Math.PI / 4) / Math.tan(φ1 / 2 + Math.PI / 4));\n\tvar q = Math.abs(Δψ) > 10e-12 ? Δφ / Δψ : Math.cos(φ1); // E-W course becomes ill-conditioned with 0/0\n\n\tvar Δλ = δ * Math.sin(θ) / q;\n\tvar λ2 = λ1 + Δλ;\n\n\treturn new LatLon(φ2.toDegrees(), (λ2.toDegrees() + 540) % 360 - 180); // normalise to −180..+180°\n};\n\n\n/**\n * Returns the loxodromic midpoint (along a rhumb line) between ‘this’ point and second point.\n *\n * @param {LatLon} point - Latitude/longitude of second point.\n * @returns {LatLon} Midpoint between this point and second point.\n *\n * @example\n * var p1 = new LatLon(51.127, 1.338);\n * var p2 = new LatLon(50.964, 1.853);\n * var pMid = p1.rhumbMidpointTo(p2); // 51.0455°N, 001.5957°E\n */\nLatLon.prototype.rhumbMidpointTo = function (point) {\n\tif (!(point instanceof LatLon)) throw new TypeError('point is not LatLon object');\n\n\t// http://mathforum.org/kb/message.jspa?messageID=148837\n\n\tvar φ1 = this.lat.toRadians(), λ1 = this.lon.toRadians();\n\tvar φ2 = point.lat.toRadians(), λ2 = point.lon.toRadians();\n\n\tif (Math.abs(λ2 - λ1) > Math.PI) λ1 += 2 * Math.PI; // crossing anti-meridian\n\n\tvar φ3 = (φ1 + φ2) / 2;\n\tvar f1 = Math.tan(Math.PI / 4 + φ1 / 2);\n\tvar f2 = Math.tan(Math.PI / 4 + φ2 / 2);\n\tvar f3 = Math.tan(Math.PI / 4 + φ3 / 2);\n\tvar λ3 = ( (λ2 - λ1) * Math.log(f3) + λ1 * Math.log(f2) - λ2 * Math.log(f1) ) / Math.log(f2 / f1);\n\n\tif (!isFinite(λ3)) λ3 = (λ1 + λ2) / 2; // parallel of latitude\n\n\tvar p = LatLon(φ3.toDegrees(), (λ3.toDegrees() + 540) % 360 - 180); // normalise to −180..+180°\n\n\treturn p;\n};\n\n\n/* Area - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\n\n\n/**\n * Calculates the area of a spherical polygon where the sides of the polygon are great circle\n * arcs joining the vertices.\n *\n * @param {LatLon[]} polygon - Array of points defining vertices of the polygon\n * @param {number} [radius=6371e3] - (Mean) radius of earth (defaults to radius in metres).\n * @returns {number} The area of the polygon, in the same units as radius.\n *\n * @example\n * var polygon = [new LatLon(0,0), new LatLon(1,0), new LatLon(0,1)];\n * var area = LatLon.areaOf(polygon); // 6.18e9 m²\n */\nLatLon.areaOf = function (polygon, radius) {\n\t// uses method due to Karney: osgeo-org.1560.x6.nabble.com/Area-of-a-spherical-polygon-td3841625.html;\n\t// for each edge of the polygon, tan(E/2) = tan(Δλ/2)·(tan(φ1/2) + tan(φ2/2)) / (1 + tan(φ1/2)·tan(φ2/2))\n\t// where E is the spherical excess of the trapezium obtained by extending the edge to the equator\n\n\tvar R = (radius === undefined) ? 6371e3 : Number(radius);\n\n\t// close polygon so that last point equals first point\n\tvar closed = polygon[0].equals(polygon[polygon.length - 1]);\n\tif (!closed) polygon.push(polygon[0]);\n\n\tvar nVertices = polygon.length - 1;\n\n\tvar S = 0; // spherical excess in steradians\n\tfor (var v = 0; v < nVertices; v++) {\n\t\tvar φ1 = polygon[v].lat.toRadians();\n\t\tvar φ2 = polygon[v + 1].lat.toRadians();\n\t\tvar Δλ = (polygon[v + 1].lon - polygon[v].lon).toRadians();\n\t\tvar E = 2 * Math.atan2(Math.tan(Δλ / 2) * (Math.tan(φ1 / 2) + Math.tan(φ2 / 2)), 1 + Math.tan(φ1 / 2) * Math.tan(φ2 / 2));\n\t\tS += E;\n\t}\n\n\tif (isPoleEnclosedBy(polygon)) S = Math.abs(S) - 2 * Math.PI;\n\n\tvar A = Math.abs(S * R * R); // area in units of R\n\n\tif (!closed) polygon.pop(); // restore polygon to pristine condition\n\n\treturn A;\n\n\t// returns whether polygon encloses pole: sum of course deltas around pole is 0° rather than\n\t// normal ±360°: blog.element84.com/determining-if-a-spherical-polygon-contains-a-pole.html\n\tfunction isPoleEnclosedBy(polygon) {\n\t\t// TODO: any better test than this?\n\t\tvar ΣΔ = 0;\n\t\tvar prevBrng = polygon[0].bearingTo(polygon[1]);\n\t\tfor (var v = 0; v < polygon.length - 1; v++) {\n\t\t\tvar initBrng = polygon[v].bearingTo(polygon[v + 1]);\n\t\t\tvar finalBrng = polygon[v].finalBearingTo(polygon[v + 1]);\n\t\t\tΣΔ += (initBrng - prevBrng + 540) % 360 - 180;\n\t\t\tΣΔ += (finalBrng - initBrng + 540) % 360 - 180;\n\t\t\tprevBrng = finalBrng;\n\t\t}\n\t\tvar initBrng = polygon[0].bearingTo(polygon[1]);\n\t\tΣΔ += (initBrng - prevBrng + 540) % 360 - 180;\n\t\tvar enclosed = Math.abs(ΣΔ) < 90; // 0°-ish\n\t\treturn enclosed;\n\t}\n};\n\n\n/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\n\n\n/**\n * Checks if another point is equal to ‘this’ point.\n *\n * @param {LatLon} point - Point to be compared against this point.\n * @returns {bool} True if points are identical.\n *\n * @example\n * var p1 = new LatLon(52.205, 0.119);\n * var p2 = new LatLon(52.205, 0.119);\n * var equal = p1.equals(p2); // true\n */\nLatLon.prototype.equals = function (point) {\n\tif (!(point instanceof LatLon)) throw new TypeError('point is not LatLon object');\n\n\tif (this.lat != point.lat) return false;\n\tif (this.lon != point.lon) return false;\n\n\treturn true;\n};\n\n\n/**\n * Returns a string representation of ‘this’ point, formatted as degrees, degrees+minutes, or\n * degrees+minutes+seconds.\n *\n * @param {string} [format=dms] - Format point as 'd', 'dm', 'dms'.\n * @param {number} [dp=0|2|4] - Number of decimal places to use - default 0 for dms, 2 for dm, 4 for d.\n * @returns {string} Comma-separated latitude/longitude.\n */\nLatLon.prototype.toString = function (format, dp) {\n\treturn Dms.toLat(this.lat, format, dp) + ', ' + Dms.toLon(this.lon, format, dp);\n};\n\n\n/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\n\n/** Extend Number object with method to convert numeric degrees to radians */\nif (Number.prototype.toRadians === undefined) {\n\tNumber.prototype.toRadians = function () {\n\t\treturn this * Math.PI / 180;\n\t};\n}\n\n/** Extend Number object with method to convert radians to numeric (signed) degrees */\nif (Number.prototype.toDegrees === undefined) {\n\tNumber.prototype.toDegrees = function () {\n\t\treturn this * 180 / Math.PI;\n\t};\n}\n\n/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\nif (typeof module != 'undefined' && module.exports) module.exports = LatLon; // ≡ export default LatLon\n/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\n/* Geodesy representation conversion functions (c) Chris Veness 2002-2016 */\n/* MIT Licence */\n/* www.movable-type.co.uk/scripts/latlong.html */\n/* www.movable-type.co.uk/scripts/geodesy/docs/module-dms.html */\n/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\n\n'use strict';\n/* eslint no-irregular-whitespace: [2, { skipComments: true }] */\n\n\n/**\n * Latitude/longitude points may be represented as decimal degrees, or subdivided into sexagesimal\n * minutes and seconds.\n *\n * @module dms\n */\n\n\n/**\n * Functions for parsing and representing degrees / minutes / seconds.\n * @class Dms\n */\nvar Dms = {};\n\n// note Unicode Degree = U+00B0. Prime = U+2032, Double prime = U+2033\n\n\n/**\n * Parses string representing degrees/minutes/seconds into numeric degrees.\n *\n * This is very flexible on formats, allowing signed decimal degrees, or deg-min-sec optionally\n * suffixed by compass direction (NSEW). A variety of separators are accepted (eg 3° 37′ 09″W).\n * Seconds and minutes may be omitted.\n *\n * @param {string|number} dmsStr - Degrees or deg/min/sec in variety of formats.\n * @returns {number} Degrees as decimal number.\n *\n * @example\n * var lat = Dms.parseDMS('51° 28′ 40.12″ N');\n * var lon = Dms.parseDMS('000° 00′ 05.31″ W');\n * var p1 = new LatLon(lat, lon); // 51.4778°N, 000.0015°W\n */\nDms.parseDMS = function (dmsStr) {\n\t// check for signed decimal degrees without NSEW, if so return it directly\n\tif (typeof dmsStr == 'number' && isFinite(dmsStr)) return Number(dmsStr);\n\n\t// strip off any sign or compass dir'n & split out separate d/m/s\n\tvar dms = String(dmsStr).trim().replace(/^-/, '').replace(/[NSEW]$/i, '').split(/[^0-9.,]+/);\n\tif (dms[dms.length - 1] == '') dms.splice(dms.length - 1); // from trailing symbol\n\n\tif (dms == '') return NaN;\n\n\t// and convert to decimal degrees...\n\tvar deg;\n\tswitch (dms.length) {\n\t\tcase 3: // interpret 3-part result as d/m/s\n\t\t\tdeg = dms[0] / 1 + dms[1] / 60 + dms[2] / 3600;\n\t\t\tbreak;\n\t\tcase 2: // interpret 2-part result as d/m\n\t\t\tdeg = dms[0] / 1 + dms[1] / 60;\n\t\t\tbreak;\n\t\tcase 1: // just d (possibly decimal) or non-separated dddmmss\n\t\t\tdeg = dms[0];\n\t\t\t// check for fixed-width unseparated format eg 0033709W\n\t\t\t//if (/[NS]/i.test(dmsStr)) deg = '0' + deg; // - normalise N/S to 3-digit degrees\n\t\t\t//if (/[0-9]{7}/.test(deg)) deg = deg.slice(0,3)/1 + deg.slice(3,5)/60 + deg.slice(5)/3600;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn NaN;\n\t}\n\tif (/^-|[WS]$/i.test(dmsStr.trim())) deg = -deg; // take '-', west and south as -ve\n\n\treturn Number(deg);\n};\n\n\n/**\n * Separator character to be used to separate degrees, minutes, seconds, and cardinal directions.\n *\n * Set to '\\u202f' (narrow no-break space) for improved formatting.\n *\n * @example\n * var p = new LatLon(51.2, 0.33); // 51°12′00.0″N, 000°19′48.0″E\n * Dms.separator = '\\u202f'; // narrow no-break space\n * var pʹ = new LatLon(51.2, 0.33); // 51° 12′ 00.0″ N, 000° 19′ 48.0″ E\n */\nDms.separator = '';\n\n\n/**\n * Converts decimal degrees to deg/min/sec format\n * - degree, prime, double-prime symbols are added, but sign is discarded, though no compass\n * direction is added.\n *\n * @private\n * @param {number} deg - Degrees to be formatted as specified.\n * @param {string} [format=dms] - Return value as 'd', 'dm', 'dms' for deg, deg+min, deg+min+sec.\n * @param {number} [dp=0|2|4] - Number of decimal places to use – default 0 for dms, 2 for dm, 4 for d.\n * @returns {string} Degrees formatted as deg/min/secs according to specified format.\n */\nDms.toDMS = function (deg, format, dp) {\n\tif (isNaN(deg)) return null; // give up here if we can't make a number from deg\n\n\t// default values\n\tif (format === undefined) format = 'dms';\n\tif (dp === undefined) {\n\t\tswitch (format) {\n\t\t\tcase 'd':\n\t\t\tcase 'deg':\n\t\t\t\tdp = 4;\n\t\t\t\tbreak;\n\t\t\tcase 'dm':\n\t\t\tcase 'deg+min':\n\t\t\t\tdp = 2;\n\t\t\t\tbreak;\n\t\t\tcase 'dms':\n\t\t\tcase 'deg+min+sec':\n\t\t\t\tdp = 0;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tformat = 'dms';\n\t\t\t\tdp = 0; // be forgiving on invalid format\n\t\t}\n\t}\n\n\tdeg = Math.abs(deg); // (unsigned result ready for appending compass dir'n)\n\n\tvar dms, d, m, s;\n\tswitch (format) {\n\t\tdefault: // invalid format spec!\n\t\tcase 'd':\n\t\tcase 'deg':\n\t\t\td = deg.toFixed(dp); // round degrees\n\t\t\tif (d < 100) d = '0' + d; // pad with leading zeros\n\t\t\tif (d < 10) d = '0' + d;\n\t\t\tdms = d + '°';\n\t\t\tbreak;\n\t\tcase 'dm':\n\t\tcase 'deg+min':\n\t\t\tvar min = (deg * 60).toFixed(dp); // convert degrees to minutes & round\n\t\t\td = Math.floor(min / 60); // get component deg/min\n\t\t\tm = (min % 60).toFixed(dp); // pad with trailing zeros\n\t\t\tif (d < 100) d = '0' + d; // pad with leading zeros\n\t\t\tif (d < 10) d = '0' + d;\n\t\t\tif (m < 10) m = '0' + m;\n\t\t\tdms = d + '°' + Dms.separator + m + '′';\n\t\t\tbreak;\n\t\tcase 'dms':\n\t\tcase 'deg+min+sec':\n\t\t\tvar sec = (deg * 3600).toFixed(dp); // convert degrees to seconds & round\n\t\t\td = Math.floor(sec / 3600); // get component deg/min/sec\n\t\t\tm = Math.floor(sec / 60) % 60;\n\t\t\ts = (sec % 60).toFixed(dp); // pad with trailing zeros\n\t\t\tif (d < 100) d = '0' + d; // pad with leading zeros\n\t\t\tif (d < 10) d = '0' + d;\n\t\t\tif (m < 10) m = '0' + m;\n\t\t\tif (s < 10) s = '0' + s;\n\t\t\tdms = d + '°' + Dms.separator + m + '′' + Dms.separator + s + '″';\n\t\t\tbreak;\n\t}\n\n\treturn dms;\n};\n\n\n/**\n * Converts numeric degrees to deg/min/sec latitude (2-digit degrees, suffixed with N/S).\n *\n * @param {number} deg - Degrees to be formatted as specified.\n * @param {string} [format=dms] - Return value as 'd', 'dm', 'dms' for deg, deg+min, deg+min+sec.\n * @param {number} [dp=0|2|4] - Number of decimal places to use – default 0 for dms, 2 for dm, 4 for d.\n * @returns {string} Degrees formatted as deg/min/secs according to specified format.\n */\nDms.toLat = function (deg, format, dp) {\n\tvar lat = Dms.toDMS(deg, format, dp);\n\treturn lat === null ? '–' : lat.slice(1) + Dms.separator + (deg < 0 ? 'S' : 'N'); // knock off initial '0' for lat!\n};\n\n\n/**\n * Convert numeric degrees to deg/min/sec longitude (3-digit degrees, suffixed with E/W)\n *\n * @param {number} deg - Degrees to be formatted as specified.\n * @param {string} [format=dms] - Return value as 'd', 'dm', 'dms' for deg, deg+min, deg+min+sec.\n * @param {number} [dp=0|2|4] - Number of decimal places to use – default 0 for dms, 2 for dm, 4 for d.\n * @returns {string} Degrees formatted as deg/min/secs according to specified format.\n */\nDms.toLon = function (deg, format, dp) {\n\tvar lon = Dms.toDMS(deg, format, dp);\n\treturn lon === null ? '–' : lon + Dms.separator + (deg < 0 ? 'W' : 'E');\n};\n\n\n/**\n * Converts numeric degrees to deg/min/sec as a bearing (0°..360°)\n *\n * @param {number} deg - Degrees to be formatted as specified.\n * @param {string} [format=dms] - Return value as 'd', 'dm', 'dms' for deg, deg+min, deg+min+sec.\n * @param {number} [dp=0|2|4] - Number of decimal places to use – default 0 for dms, 2 for dm, 4 for d.\n * @returns {string} Degrees formatted as deg/min/secs according to specified format.\n */\nDms.toBrng = function (deg, format, dp) {\n\tdeg = (Number(deg) + 360) % 360; // normalise -ve values to 180°..360°\n\tvar brng = Dms.toDMS(deg, format, dp);\n\treturn brng === null ? '–' : brng.replace('360', '0'); // just in case rounding took us up to 360°!\n};\n\n\n/**\n * Returns compass point (to given precision) for supplied bearing.\n *\n * @param {number} bearing - Bearing in degrees from north.\n * @param {number} [precision=3] - Precision (1:cardinal / 2:intercardinal / 3:secondary-intercardinal).\n * @returns {string} Compass point for supplied bearing.\n *\n * @example\n * var point = Dms.compassPoint(24); // point = 'NNE'\n * var point = Dms.compassPoint(24, 1); // point = 'N'\n */\nDms.compassPoint = function (bearing, precision) {\n\tif (precision === undefined) precision = 3;\n\t// note precision = max length of compass point; it could be extended to 4 for quarter-winds\n\t// (eg NEbN), but I think they are little used\n\n\tbearing = ((bearing % 360) + 360) % 360; // normalise to 0..360\n\n\tvar point;\n\n\tswitch (precision) {\n\t\tcase 1: // 4 compass points\n\t\t\tswitch (Math.round(bearing * 4 / 360) % 4) {\n\t\t\t\tcase 0:\n\t\t\t\t\tpoint = 'N';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tpoint = 'E';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tpoint = 'S';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tpoint = 'W';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 2: // 8 compass points\n\t\t\tswitch (Math.round(bearing * 8 / 360) % 8) {\n\t\t\t\tcase 0:\n\t\t\t\t\tpoint = 'N';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tpoint = 'NE';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tpoint = 'E';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tpoint = 'SE';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tpoint = 'S';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tpoint = 'SW';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tpoint = 'W';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\tpoint = 'NW';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 3: // 16 compass points\n\t\t\tswitch (Math.round(bearing * 16 / 360) % 16) {\n\t\t\t\tcase 0:\n\t\t\t\t\tpoint = 'N';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tpoint = 'NNE';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tpoint = 'NE';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tpoint = 'ENE';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tpoint = 'E';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tpoint = 'ESE';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tpoint = 'SE';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\tpoint = 'SSE';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\tpoint = 'S';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\t\tpoint = 'SSW';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 10:\n\t\t\t\t\tpoint = 'SW';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\t\tpoint = 'WSW';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\t\tpoint = 'W';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 13:\n\t\t\t\t\tpoint = 'WNW';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 14:\n\t\t\t\t\tpoint = 'NW';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 15:\n\t\t\t\t\tpoint = 'NNW';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new RangeError('Precision must be between 1 and 3');\n\t}\n\n\treturn point;\n};\n\n\n/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\n\n/** Polyfill String.trim for old browsers\n * (q.v. blog.stevenlevithan.com/archives/faster-trim-javascript) */\nif (String.prototype.trim === undefined) {\n\tString.prototype.trim = function () {\n\t\treturn String(this).replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n\t};\n}\n\n/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\nif (typeof module != 'undefined' && module.exports) module.exports = Dms; // ≡ export default Dms","/**\n * @name MarkerClustererPlus for Google Maps V3\n * @version 2.1.1 [November 4, 2013]\n * @author Gary Little\n * @fileoverview\n * The library creates and manages per-zoom-level clusters for large amounts of markers.\n *

\n * This is an enhanced V3 implementation of the\n * V2 MarkerClusterer by Xiaoxi Wu. It is based on the\n * V3 MarkerClusterer port by Luke Mahe. MarkerClustererPlus was created by Gary Little.\n *

\n * v2.0 release: MarkerClustererPlus v2.0 is backward compatible with MarkerClusterer v1.0. It\n * adds support for the ignoreHidden, title, batchSizeIE,\n * and calculator properties as well as support for four more events. It also allows\n * greater control over the styling of the text that appears on the cluster marker. The\n * documentation has been significantly improved and the overall code has been simplified and\n * polished. Very large numbers of markers can now be managed without causing Javascript timeout\n * errors on Internet Explorer. Note that the name of the clusterclick event has been\n * deprecated. The new name is click, so please change your application code now.\n */\n\n/**\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * @name ClusterIconStyle\n * @class This class represents the object for values in the styles array passed\n * to the {@link MarkerClusterer} constructor. The element in this array that is used to\n * style the cluster icon is determined by calling the calculator function.\n *\n * @property {string} url The URL of the cluster icon image file. Required.\n * @property {number} height The display height (in pixels) of the cluster icon. Required.\n * @property {number} width The display width (in pixels) of the cluster icon. Required.\n * @property {Array} [anchorText] The position (in pixels) from the center of the cluster icon to\n * where the text label is to be centered and drawn. The format is [yoffset, xoffset]\n * where yoffset increases as you go down from center and xoffset\n * increases to the right of center. The default is [0, 0].\n * @property {Array} [anchorIcon] The anchor position (in pixels) of the cluster icon. This is the\n * spot on the cluster icon that is to be aligned with the cluster position. The format is\n * [yoffset, xoffset] where yoffset increases as you go down and\n * xoffset increases to the right of the top-left corner of the icon. The default\n * anchor position is the center of the cluster icon.\n * @property {string} [textColor=\"black\"] The color of the label text shown on the\n * cluster icon.\n * @property {number} [textSize=11] The size (in pixels) of the label text shown on the\n * cluster icon.\n * @property {string} [textDecoration=\"none\"] The value of the CSS text-decoration\n * property for the label text shown on the cluster icon.\n * @property {string} [fontWeight=\"bold\"] The value of the CSS font-weight\n * property for the label text shown on the cluster icon.\n * @property {string} [fontStyle=\"normal\"] The value of the CSS font-style\n * property for the label text shown on the cluster icon.\n * @property {string} [fontFamily=\"Arial,sans-serif\"] The value of the CSS font-family\n * property for the label text shown on the cluster icon.\n * @property {string} [backgroundPosition=\"0 0\"] The position of the cluster icon image\n * within the image defined by url. The format is \"xpos ypos\"\n * (the same format as for the CSS background-position property). You must set\n * this property appropriately when the image defined by url represents a sprite\n * containing multiple images. Note that the position must be specified in px units.\n */\n/**\n * @name ClusterIconInfo\n * @class This class is an object containing general information about a cluster icon. This is\n * the object that a calculator function returns.\n *\n * @property {string} text The text of the label to be shown on the cluster icon.\n * @property {number} index The index plus 1 of the element in the styles\n * array to be used to style the cluster icon.\n * @property {string} title The tooltip to display when the mouse moves over the cluster icon.\n * If this value is undefined or \"\", title is set to the\n * value of the title property passed to the MarkerClusterer.\n */\n/**\n * A cluster icon.\n *\n * @constructor\n * @extends google.maps.OverlayView\n * @param {Cluster} cluster The cluster with which the icon is to be associated.\n * @param {Array} [styles] An array of {@link ClusterIconStyle} defining the cluster icons\n * to use for various cluster sizes.\n * @private\n */\nfunction ClusterIcon(cluster, styles) {\n cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView);\n\n this.cluster_ = cluster;\n this.className_ = cluster.getMarkerClusterer().getClusterClass();\n this.styles_ = styles;\n this.center_ = null;\n this.div_ = null;\n this.sums_ = null;\n this.visible_ = false;\n\n this.setMap(cluster.getMap()); // Note: this causes onAdd to be called\n}\n\n\n/**\n * Adds the icon to the DOM.\n */\nClusterIcon.prototype.onAdd = function() {\n var cClusterIcon = this;\n var cMouseDownInCluster;\n var cDraggingMapByCluster;\n\n this.div_ = document.createElement(\"div\");\n this.div_.className = this.className_;\n if (this.visible_) {\n this.show();\n }\n\n this.getPanes().overlayMouseTarget.appendChild(this.div_);\n\n // Fix for Issue 157\n this.boundsChangedListener_ = google.maps.event.addListener(this.getMap(), \"bounds_changed\", function() {\n cDraggingMapByCluster = cMouseDownInCluster;\n });\n\n google.maps.event.addDomListener(this.div_, \"mousedown\", function() {\n cMouseDownInCluster = true;\n cDraggingMapByCluster = false;\n });\n\n google.maps.event.addDomListener(this.div_, \"click\", function(e) {\n cMouseDownInCluster = false;\n if (!cDraggingMapByCluster) {\n var theBounds;\n var mz;\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when a cluster marker is clicked.\n * @name MarkerClusterer#click\n * @param {Cluster} c The cluster that was clicked.\n * @event\n */\n google.maps.event.trigger(mc, \"click\", cClusterIcon.cluster_);\n google.maps.event.trigger(mc, \"clusterclick\", cClusterIcon.cluster_); // deprecated name\n\n // The default click handler follows. Disable it by setting\n // the zoomOnClick property to false.\n if (mc.getZoomOnClick()) {\n // Zoom into the cluster.\n mz = mc.getMaxZoom();\n theBounds = cClusterIcon.cluster_.getBounds();\n mc.getMap().fitBounds(theBounds);\n // There is a fix for Issue 170 here:\n setTimeout(function() {\n mc.getMap().fitBounds(theBounds);\n // Don't zoom beyond the max zoom level\n if (mz !== null && (mc.getMap().getZoom() > mz)) {\n mc.getMap().setZoom(mz + 1);\n }\n }, 100);\n }\n\n // Prevent event propagation to the map:\n e.cancelBubble = true;\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n }\n });\n\n google.maps.event.addDomListener(this.div_, \"mouseover\", function() {\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when the mouse moves over a cluster marker.\n * @name MarkerClusterer#mouseover\n * @param {Cluster} c The cluster that the mouse moved over.\n * @event\n */\n google.maps.event.trigger(mc, \"mouseover\", cClusterIcon.cluster_);\n });\n\n google.maps.event.addDomListener(this.div_, \"mouseout\", function() {\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when the mouse moves out of a cluster marker.\n * @name MarkerClusterer#mouseout\n * @param {Cluster} c The cluster that the mouse moved out of.\n * @event\n */\n google.maps.event.trigger(mc, \"mouseout\", cClusterIcon.cluster_);\n });\n};\n\n\n/**\n * Removes the icon from the DOM.\n */\nClusterIcon.prototype.onRemove = function() {\n if (this.div_ && this.div_.parentNode) {\n this.hide();\n google.maps.event.removeListener(this.boundsChangedListener_);\n google.maps.event.clearInstanceListeners(this.div_);\n this.div_.parentNode.removeChild(this.div_);\n this.div_ = null;\n }\n};\n\n\n/**\n * Draws the icon.\n */\nClusterIcon.prototype.draw = function() {\n if (this.visible_) {\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.top = pos.y + \"px\";\n this.div_.style.left = pos.x + \"px\";\n }\n};\n\n\n/**\n * Hides the icon.\n */\nClusterIcon.prototype.hide = function() {\n if (this.div_) {\n this.div_.style.display = \"none\";\n }\n this.visible_ = false;\n};\n\n\n/**\n * Positions and shows the icon.\n */\nClusterIcon.prototype.show = function() {\n if (this.div_) {\n var img = \"\";\n // NOTE: values must be specified in px units\n var bp = this.backgroundPosition_.split(\" \");\n var spriteH = parseInt(bp[0].trim(), 10);\n var spriteV = parseInt(bp[1].trim(), 10);\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.cssText = this.createCss(pos);\n img = \"\";\n this.div_.innerHTML = img + \"

\" + (this.cluster_.hideLabel_ ? ' ' : this.sums_.text) + \"
\";\n if (typeof this.sums_.title === \"undefined\" || this.sums_.title === \"\") {\n this.div_.title = this.cluster_.getMarkerClusterer().getTitle();\n } else {\n this.div_.title = this.sums_.title;\n }\n this.div_.style.display = \"\";\n }\n this.visible_ = true;\n};\n\n\n/**\n * Sets the icon styles to the appropriate element in the styles array.\n *\n * @param {ClusterIconInfo} sums The icon label text and styles index.\n */\nClusterIcon.prototype.useStyle = function(sums) {\n this.sums_ = sums;\n var index = Math.max(0, sums.index - 1);\n index = Math.min(this.styles_.length - 1, index);\n var style = this.styles_[index];\n this.url_ = style.url;\n this.height_ = style.height;\n this.width_ = style.width;\n this.anchorText_ = style.anchorText || [0, 0];\n this.anchorIcon_ = style.anchorIcon || [parseInt(this.height_ / 2, 10), parseInt(this.width_ / 2, 10)];\n this.textColor_ = style.textColor || \"black\";\n this.textSize_ = style.textSize || 11;\n this.textDecoration_ = style.textDecoration || \"none\";\n this.fontWeight_ = style.fontWeight || \"bold\";\n this.fontStyle_ = style.fontStyle || \"normal\";\n this.fontFamily_ = style.fontFamily || \"Arial,sans-serif\";\n this.backgroundPosition_ = style.backgroundPosition || \"0 0\";\n};\n\n\n/**\n * Sets the position at which to center the icon.\n *\n * @param {google.maps.LatLng} center The latlng to set as the center.\n */\nClusterIcon.prototype.setCenter = function(center) {\n this.center_ = center;\n};\n\n\n/**\n * Creates the cssText style parameter based on the position of the icon.\n *\n * @param {google.maps.Point} pos The position of the icon.\n * @return {string} The CSS style text.\n */\nClusterIcon.prototype.createCss = function(pos) {\n var style = [];\n style.push(\"cursor: pointer;\");\n style.push(\"position: absolute; top: \" + pos.y + \"px; left: \" + pos.x + \"px;\");\n style.push(\"width: \" + this.width_ + \"px; height: \" + this.height_ + \"px;\");\n return style.join(\"\");\n};\n\n\n/**\n * Returns the position at which to place the DIV depending on the latlng.\n *\n * @param {google.maps.LatLng} latlng The position in latlng.\n * @return {google.maps.Point} The position in pixels.\n */\nClusterIcon.prototype.getPosFromLatLng_ = function(latlng) {\n var pos = this.getProjection().fromLatLngToDivPixel(latlng);\n pos.x -= this.anchorIcon_[1];\n pos.y -= this.anchorIcon_[0];\n pos.x = parseInt(pos.x, 10);\n pos.y = parseInt(pos.y, 10);\n return pos;\n};\n\n\n/**\n * Creates a single cluster that manages a group of proximate markers.\n * Used internally, do not call this constructor directly.\n * @constructor\n * @param {MarkerClusterer} mc The MarkerClusterer object with which this\n * cluster is associated.\n */\nfunction Cluster(mc) {\n this.markerClusterer_ = mc;\n this.map_ = mc.getMap();\n this.gridSize_ = mc.getGridSize();\n this.minClusterSize_ = mc.getMinimumClusterSize();\n this.averageCenter_ = mc.getAverageCenter();\n this.hideLabel_ = mc.getHideLabel();\n this.markers_ = [];\n this.center_ = null;\n this.bounds_ = null;\n this.clusterIcon_ = new ClusterIcon(this, mc.getStyles());\n}\n\n\n/**\n * Returns the number of markers managed by the cluster. You can call this from\n * a click, mouseover, or mouseout event handler\n * for the MarkerClusterer object.\n *\n * @return {number} The number of markers in the cluster.\n */\nCluster.prototype.getSize = function() {\n return this.markers_.length;\n};\n\n\n/**\n * Returns the array of markers managed by the cluster. You can call this from\n * a click, mouseover, or mouseout event handler\n * for the MarkerClusterer object.\n *\n * @return {Array} The array of markers in the cluster.\n */\nCluster.prototype.getMarkers = function() {\n return this.markers_;\n};\n\n\n/**\n * Returns the center of the cluster. You can call this from\n * a click, mouseover, or mouseout event handler\n * for the MarkerClusterer object.\n *\n * @return {google.maps.LatLng} The center of the cluster.\n */\nCluster.prototype.getCenter = function() {\n return this.center_;\n};\n\n\n/**\n * Returns the map with which the cluster is associated.\n *\n * @return {google.maps.Map} The map.\n * @ignore\n */\nCluster.prototype.getMap = function() {\n return this.map_;\n};\n\n\n/**\n * Returns the MarkerClusterer object with which the cluster is associated.\n *\n * @return {MarkerClusterer} The associated marker clusterer.\n * @ignore\n */\nCluster.prototype.getMarkerClusterer = function() {\n return this.markerClusterer_;\n};\n\n\n/**\n * Returns the bounds of the cluster.\n *\n * @return {google.maps.LatLngBounds} the cluster bounds.\n * @ignore\n */\nCluster.prototype.getBounds = function() {\n var i;\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n var markers = this.getMarkers();\n for (i = 0; i < markers.length; i++) {\n bounds.extend(markers[i].getPosition());\n }\n return bounds;\n};\n\n\n/**\n * Removes the cluster from the map.\n *\n * @ignore\n */\nCluster.prototype.remove = function() {\n this.clusterIcon_.setMap(null);\n this.markers_ = [];\n delete this.markers_;\n};\n\n\n/**\n * Adds a marker to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to be added.\n * @return {boolean} True if the marker was added.\n * @ignore\n */\nCluster.prototype.addMarker = function(marker) {\n var i;\n var mCount;\n var mz;\n\n if (this.isMarkerAlreadyAdded_(marker)) {\n return false;\n }\n\n if (!this.center_) {\n this.center_ = marker.getPosition();\n this.calculateBounds_();\n } else {\n if (this.averageCenter_) {\n var l = this.markers_.length + 1;\n var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l;\n var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;\n this.center_ = new google.maps.LatLng(lat, lng);\n this.calculateBounds_();\n }\n }\n\n marker.isAdded = true;\n this.markers_.push(marker);\n\n mCount = this.markers_.length;\n mz = this.markerClusterer_.getMaxZoom();\n if (mz !== null && this.map_.getZoom() > mz) {\n // Zoomed in past max zoom, so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount < this.minClusterSize_) {\n // Min cluster size not reached so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount === this.minClusterSize_) {\n // Hide the markers that were showing.\n for (i = 0; i < mCount; i++) {\n this.markers_[i].setMap(null);\n }\n } else {\n marker.setMap(null);\n }\n\n return true;\n};\n\n\n/**\n * Determines if a marker lies within the cluster's bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker lies in the bounds.\n * @ignore\n */\nCluster.prototype.isMarkerInClusterBounds = function(marker) {\n return this.bounds_.contains(marker.getPosition());\n};\n\n\n/**\n * Calculates the extended bounds of the cluster with the grid.\n */\nCluster.prototype.calculateBounds_ = function() {\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds);\n};\n\n\n/**\n * Updates the cluster icon.\n */\nCluster.prototype.updateIcon_ = function() {\n var mCount = this.markers_.length;\n var mz = this.markerClusterer_.getMaxZoom();\n\n if (mz !== null && this.map_.getZoom() > mz) {\n this.clusterIcon_.hide();\n return;\n }\n\n if (mCount < this.minClusterSize_) {\n // Min cluster size not yet reached.\n this.clusterIcon_.hide();\n return;\n }\n\n var numStyles = this.markerClusterer_.getStyles().length;\n var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles);\n this.clusterIcon_.setCenter(this.center_);\n this.clusterIcon_.useStyle(sums);\n this.clusterIcon_.show();\n};\n\n\n/**\n * Determines if a marker has already been added to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker has already been added.\n */\nCluster.prototype.isMarkerAlreadyAdded_ = function(marker) {\n for (var i = 0, n = this.markers_.length; i < n; i++) {\n if (marker === this.markers_[i]) {\n return true;\n }\n }\n return false;\n};\n\n\n/**\n * @name MarkerClustererOptions\n * @class This class represents the optional parameter passed to\n * the {@link MarkerClusterer} constructor.\n * @property {number} [gridSize=60] The grid size of a cluster in pixels. The grid is a square.\n * @property {number} [maxZoom=null] The maximum zoom level at which clustering is enabled or\n * null if clustering is to be enabled at all zoom levels.\n * @property {boolean} [zoomOnClick=true] Whether to zoom the map when a cluster marker is\n * clicked. You may want to set this to false if you have installed a handler\n * for the click event and it deals with zooming on its own.\n * @property {boolean} [averageCenter=false] Whether the position of a cluster marker should be\n * the average position of all markers in the cluster. If set to false, the\n * cluster marker is positioned at the location of the first marker added to the cluster.\n * @property {number} [minimumClusterSize=2] The minimum number of markers needed in a cluster\n * before the markers are hidden and a cluster marker appears.\n * @property {boolean} [ignoreHidden=false] Whether to ignore hidden markers in clusters. You\n * may want to set this to true to ensure that hidden markers are not included\n * in the marker count that appears on a cluster marker (this count is the value of the\n * text property of the result returned by the default calculator).\n * If set to true and you change the visibility of a marker being clustered, be\n * sure to also call MarkerClusterer.repaint().\n * @property {string} [title=\"\"] The tooltip to display when the mouse moves over a cluster\n * marker. (Alternatively, you can use a custom calculator function to specify a\n * different tooltip for each cluster marker.)\n * @property {function} [calculator=MarkerClusterer.CALCULATOR] The function used to determine\n * the text to be displayed on a cluster marker and the index indicating which style to use\n * for the cluster marker. The input parameters for the function are (1) the array of markers\n * represented by a cluster marker and (2) the number of cluster icon styles. It returns a\n * {@link ClusterIconInfo} object. The default calculator returns a\n * text property which is the number of markers in the cluster and an\n * index property which is one higher than the lowest integer such that\n * 10^i exceeds the number of markers in the cluster, or the size of the styles\n * array, whichever is less. The styles array element used has an index of\n * index minus 1. For example, the default calculator returns a\n * text value of \"125\" and an index of 3\n * for a cluster icon representing 125 markers so the element used in the styles\n * array is 2. A calculator may also return a title\n * property that contains the text of the tooltip to be used for the cluster marker. If\n * title is not defined, the tooltip is set to the value of the title\n * property for the MarkerClusterer.\n * @property {string} [clusterClass=\"cluster\"] The name of the CSS class defining general styles\n * for the cluster markers. Use this class to define CSS styles that are not set up by the code\n * that processes the styles array.\n * @property {Array} [styles] An array of {@link ClusterIconStyle} elements defining the styles\n * of the cluster markers to be used. The element to be used to style a given cluster marker\n * is determined by the function defined by the calculator property.\n * The default is an array of {@link ClusterIconStyle} elements whose properties are derived\n * from the values for imagePath, imageExtension, and\n * imageSizes.\n * @property {boolean} [enableRetinaIcons=false] Whether to allow the use of cluster icons that\n * have sizes that are some multiple (typically double) of their actual display size. Icons such\n * as these look better when viewed on high-resolution monitors such as Apple's Retina displays.\n * Note: if this property is true, sprites cannot be used as cluster icons.\n * @property {number} [batchSize=MarkerClusterer.BATCH_SIZE] Set this property to the\n * number of markers to be processed in a single batch when using a browser other than\n * Internet Explorer (for Internet Explorer, use the batchSizeIE property instead).\n * @property {number} [batchSizeIE=MarkerClusterer.BATCH_SIZE_IE] When Internet Explorer is\n * being used, markers are processed in several batches with a small delay inserted between\n * each batch in an attempt to avoid Javascript timeout errors. Set this property to the\n * number of markers to be processed in a single batch; select as high a number as you can\n * without causing a timeout error in the browser. This number might need to be as low as 100\n * if 15,000 markers are being managed, for example.\n * @property {string} [imagePath=MarkerClusterer.IMAGE_PATH]\n * The full URL of the root name of the group of image files to use for cluster icons.\n * The complete file name is of the form imagePathn.imageExtension\n * where n is the image file number (1, 2, etc.).\n * @property {string} [imageExtension=MarkerClusterer.IMAGE_EXTENSION]\n * The extension name for the cluster icon image files (e.g., \"png\" or\n * \"jpg\").\n * @property {Array} [imageSizes=MarkerClusterer.IMAGE_SIZES]\n * An array of numbers containing the widths of the group of\n * imagePathn.imageExtension image files.\n * (The images are assumed to be square.)\n */\n/**\n * Creates a MarkerClusterer object with the options specified in {@link MarkerClustererOptions}.\n * @constructor\n * @extends google.maps.OverlayView\n * @param {google.maps.Map} map The Google map to attach to.\n * @param {Array.} [opt_markers] The markers to be added to the cluster.\n * @param {MarkerClustererOptions} [opt_options] The optional parameters.\n */\nfunction MarkerClusterer(map, opt_markers, opt_options) {\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\n // extend function to extend MarkerClusterer with google.maps.OverlayView\n // because it might not always be available when the code is defined so we\n // look for it at the last possible moment. If it doesn't exist now then\n // there is no point going ahead :)\n this.extend(MarkerClusterer, google.maps.OverlayView);\n\n opt_markers = opt_markers || [];\n opt_options = opt_options || {};\n\n this.markers_ = [];\n this.clusters_ = [];\n this.listeners_ = [];\n this.activeMap_ = null;\n this.ready_ = false;\n\n this.gridSize_ = opt_options.gridSize || 60;\n this.minClusterSize_ = opt_options.minimumClusterSize || 2;\n this.maxZoom_ = opt_options.maxZoom || null;\n this.styles_ = opt_options.styles || [];\n this.title_ = opt_options.title || \"\";\n this.zoomOnClick_ = true;\n if (opt_options.zoomOnClick !== undefined) {\n this.zoomOnClick_ = opt_options.zoomOnClick;\n }\n this.averageCenter_ = false;\n if (opt_options.averageCenter !== undefined) {\n this.averageCenter_ = opt_options.averageCenter;\n }\n this.ignoreHidden_ = false;\n if (opt_options.ignoreHidden !== undefined) {\n this.ignoreHidden_ = opt_options.ignoreHidden;\n }\n this.enableRetinaIcons_ = false;\n if (opt_options.enableRetinaIcons !== undefined) {\n this.enableRetinaIcons_ = opt_options.enableRetinaIcons;\n }\n this.hideLabel_ = false;\n if (opt_options.hideLabel !== undefined) {\n this.hideLabel_ = opt_options.hideLabel;\n }\n this.imagePath_ = opt_options.imagePath || MarkerClusterer.IMAGE_PATH;\n this.imageExtension_ = opt_options.imageExtension || MarkerClusterer.IMAGE_EXTENSION;\n this.imageSizes_ = opt_options.imageSizes || MarkerClusterer.IMAGE_SIZES;\n this.calculator_ = opt_options.calculator || MarkerClusterer.CALCULATOR;\n this.batchSize_ = opt_options.batchSize || MarkerClusterer.BATCH_SIZE;\n this.batchSizeIE_ = opt_options.batchSizeIE || MarkerClusterer.BATCH_SIZE_IE;\n this.clusterClass_ = opt_options.clusterClass || \"cluster\";\n\n if (navigator.userAgent.toLowerCase().indexOf(\"msie\") !== -1) {\n // Try to avoid IE timeout when processing a huge number of markers:\n this.batchSize_ = this.batchSizeIE_;\n }\n\n this.setupStyles_();\n\n this.addMarkers(opt_markers, true);\n this.setMap(map); // Note: this causes onAdd to be called\n}\n\n\n/**\n * Implementation of the onAdd interface method.\n * @ignore\n */\nMarkerClusterer.prototype.onAdd = function() {\n var cMarkerClusterer = this;\n\n this.activeMap_ = this.getMap();\n this.ready_ = true;\n\n this.repaint();\n\n // Add the map event listeners\n this.listeners_ = [\n google.maps.event.addListener(this.getMap(), \"zoom_changed\", function() {\n cMarkerClusterer.resetViewport_(false);\n // Workaround for this Google bug: when map is at level 0 and \"-\" of\n // zoom slider is clicked, a \"zoom_changed\" event is fired even though\n // the map doesn't zoom out any further. In this situation, no \"idle\"\n // event is triggered so the cluster markers that have been removed\n // do not get redrawn. Same goes for a zoom in at maxZoom.\n if (this.getZoom() === (this.get(\"minZoom\") || 0) || this.getZoom() === this.get(\"maxZoom\")) {\n google.maps.event.trigger(this, \"idle\");\n }\n }),\n google.maps.event.addListener(this.getMap(), \"idle\", function() {\n cMarkerClusterer.redraw_();\n })\n ];\n};\n\n\n/**\n * Implementation of the onRemove interface method.\n * Removes map event listeners and all cluster icons from the DOM.\n * All managed markers are also put back on the map.\n * @ignore\n */\nMarkerClusterer.prototype.onRemove = function() {\n var i;\n\n // Put all the managed markers back on the map:\n for (i = 0; i < this.markers_.length; i++) {\n if (this.markers_[i].getMap() !== this.activeMap_) {\n this.markers_[i].setMap(this.activeMap_);\n }\n }\n\n // Remove all clusters:\n for (i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].remove();\n }\n this.clusters_ = [];\n\n // Remove map event listeners:\n for (i = 0; i < this.listeners_.length; i++) {\n google.maps.event.removeListener(this.listeners_[i]);\n }\n this.listeners_ = [];\n\n this.activeMap_ = null;\n this.ready_ = false;\n};\n\n\n/**\n * Implementation of the draw interface method.\n * @ignore\n */\nMarkerClusterer.prototype.draw = function() {};\n\n\n/**\n * Sets up the styles object.\n */\nMarkerClusterer.prototype.setupStyles_ = function() {\n var i, size;\n if (this.styles_.length > 0) {\n return;\n }\n\n for (i = 0; i < this.imageSizes_.length; i++) {\n size = this.imageSizes_[i];\n this.styles_.push({\n url: this.imagePath_ + (i + 1) + \".\" + this.imageExtension_,\n height: size,\n width: size\n });\n }\n};\n\n\n/**\n * Fits the map to the bounds of the markers managed by the clusterer.\n */\nMarkerClusterer.prototype.fitMapToMarkers = function() {\n var i;\n var markers = this.getMarkers();\n var bounds = new google.maps.LatLngBounds();\n for (i = 0; i < markers.length; i++) {\n bounds.extend(markers[i].getPosition());\n }\n\n this.getMap().fitBounds(bounds);\n};\n\n\n/**\n * Returns the value of the gridSize property.\n *\n * @return {number} The grid size.\n */\nMarkerClusterer.prototype.getGridSize = function() {\n return this.gridSize_;\n};\n\n\n/**\n * Sets the value of the gridSize property.\n *\n * @param {number} gridSize The grid size.\n */\nMarkerClusterer.prototype.setGridSize = function(gridSize) {\n this.gridSize_ = gridSize;\n};\n\n\n/**\n * Returns the value of the minimumClusterSize property.\n *\n * @return {number} The minimum cluster size.\n */\nMarkerClusterer.prototype.getMinimumClusterSize = function() {\n return this.minClusterSize_;\n};\n\n/**\n * Sets the value of the minimumClusterSize property.\n *\n * @param {number} minimumClusterSize The minimum cluster size.\n */\nMarkerClusterer.prototype.setMinimumClusterSize = function(minimumClusterSize) {\n this.minClusterSize_ = minimumClusterSize;\n};\n\n\n/**\n * Returns the value of the maxZoom property.\n *\n * @return {number} The maximum zoom level.\n */\nMarkerClusterer.prototype.getMaxZoom = function() {\n return this.maxZoom_;\n};\n\n\n/**\n * Sets the value of the maxZoom property.\n *\n * @param {number} maxZoom The maximum zoom level.\n */\nMarkerClusterer.prototype.setMaxZoom = function(maxZoom) {\n this.maxZoom_ = maxZoom;\n};\n\n\n/**\n * Returns the value of the styles property.\n *\n * @return {Array} The array of styles defining the cluster markers to be used.\n */\nMarkerClusterer.prototype.getStyles = function() {\n return this.styles_;\n};\n\n\n/**\n * Sets the value of the styles property.\n *\n * @param {Array.} styles The array of styles to use.\n */\nMarkerClusterer.prototype.setStyles = function(styles) {\n this.styles_ = styles;\n};\n\n\n/**\n * Returns the value of the title property.\n *\n * @return {string} The content of the title text.\n */\nMarkerClusterer.prototype.getTitle = function() {\n return this.title_;\n};\n\n\n/**\n * Sets the value of the title property.\n *\n * @param {string} title The value of the title property.\n */\nMarkerClusterer.prototype.setTitle = function(title) {\n this.title_ = title;\n};\n\n\n/**\n * Returns the value of the zoomOnClick property.\n *\n * @return {boolean} True if zoomOnClick property is set.\n */\nMarkerClusterer.prototype.getZoomOnClick = function() {\n return this.zoomOnClick_;\n};\n\n\n/**\n * Sets the value of the zoomOnClick property.\n *\n * @param {boolean} zoomOnClick The value of the zoomOnClick property.\n */\nMarkerClusterer.prototype.setZoomOnClick = function(zoomOnClick) {\n this.zoomOnClick_ = zoomOnClick;\n};\n\n\n/**\n * Returns the value of the averageCenter property.\n *\n * @return {boolean} True if averageCenter property is set.\n */\nMarkerClusterer.prototype.getAverageCenter = function() {\n return this.averageCenter_;\n};\n\n\n/**\n * Sets the value of the averageCenter property.\n *\n * @param {boolean} averageCenter The value of the averageCenter property.\n */\nMarkerClusterer.prototype.setAverageCenter = function(averageCenter) {\n this.averageCenter_ = averageCenter;\n};\n\n\n/**\n * Returns the value of the ignoreHidden property.\n *\n * @return {boolean} True if ignoreHidden property is set.\n */\nMarkerClusterer.prototype.getIgnoreHidden = function() {\n return this.ignoreHidden_;\n};\n\n\n/**\n * Sets the value of the ignoreHidden property.\n *\n * @param {boolean} ignoreHidden The value of the ignoreHidden property.\n */\nMarkerClusterer.prototype.setIgnoreHidden = function(ignoreHidden) {\n this.ignoreHidden_ = ignoreHidden;\n};\n\n\n/**\n * Returns the value of the enableRetinaIcons property.\n *\n * @return {boolean} True if enableRetinaIcons property is set.\n */\nMarkerClusterer.prototype.getEnableRetinaIcons = function() {\n return this.enableRetinaIcons_;\n};\n\n\n/**\n * Sets the value of the enableRetinaIcons property.\n *\n * @param {boolean} enableRetinaIcons The value of the enableRetinaIcons property.\n */\nMarkerClusterer.prototype.setEnableRetinaIcons = function(enableRetinaIcons) {\n this.enableRetinaIcons_ = enableRetinaIcons;\n};\n\n\n/**\n * Returns the value of the imageExtension property.\n *\n * @return {string} The value of the imageExtension property.\n */\nMarkerClusterer.prototype.getImageExtension = function() {\n return this.imageExtension_;\n};\n\n\n/**\n * Sets the value of the imageExtension property.\n *\n * @param {string} imageExtension The value of the imageExtension property.\n */\nMarkerClusterer.prototype.setImageExtension = function(imageExtension) {\n this.imageExtension_ = imageExtension;\n};\n\n\n/**\n * Returns the value of the imagePath property.\n *\n * @return {string} The value of the imagePath property.\n */\nMarkerClusterer.prototype.getImagePath = function() {\n return this.imagePath_;\n};\n\n\n/**\n * Sets the value of the imagePath property.\n *\n * @param {string} imagePath The value of the imagePath property.\n */\nMarkerClusterer.prototype.setImagePath = function(imagePath) {\n this.imagePath_ = imagePath;\n};\n\n\n/**\n * Returns the value of the imageSizes property.\n *\n * @return {Array} The value of the imageSizes property.\n */\nMarkerClusterer.prototype.getImageSizes = function() {\n return this.imageSizes_;\n};\n\n\n/**\n * Sets the value of the imageSizes property.\n *\n * @param {Array} imageSizes The value of the imageSizes property.\n */\nMarkerClusterer.prototype.setImageSizes = function(imageSizes) {\n this.imageSizes_ = imageSizes;\n};\n\n\n/**\n * Returns the value of the calculator property.\n *\n * @return {function} the value of the calculator property.\n */\nMarkerClusterer.prototype.getCalculator = function() {\n return this.calculator_;\n};\n\n\n/**\n * Sets the value of the calculator property.\n *\n * @param {function(Array., number)} calculator The value\n * of the calculator property.\n */\nMarkerClusterer.prototype.setCalculator = function(calculator) {\n this.calculator_ = calculator;\n};\n\n/**\n * Sets the value of the hideLabel property.\n *\n * @param {boolean} printable The value of the hideLabel property.\n */\nMarkerClusterer.prototype.setHideLabel = function(hideLabel) {\n this.hideLabel_ = hideLabel;\n};\n\n/**\n * Returns the value of the hideLabel property.\n *\n * @return {boolean} the value of the hideLabel property.\n */\nMarkerClusterer.prototype.getHideLabel = function() {\n return this.hideLabel_;\n};\n\n/**\n * Returns the value of the batchSizeIE property.\n *\n * @return {number} the value of the batchSizeIE property.\n */\nMarkerClusterer.prototype.getBatchSizeIE = function() {\n return this.batchSizeIE_;\n};\n\n\n/**\n * Sets the value of the batchSizeIE property.\n *\n * @param {number} batchSizeIE The value of the batchSizeIE property.\n */\nMarkerClusterer.prototype.setBatchSizeIE = function(batchSizeIE) {\n this.batchSizeIE_ = batchSizeIE;\n};\n\n\n/**\n * Returns the value of the clusterClass property.\n *\n * @return {string} the value of the clusterClass property.\n */\nMarkerClusterer.prototype.getClusterClass = function() {\n return this.clusterClass_;\n};\n\n\n/**\n * Sets the value of the clusterClass property.\n *\n * @param {string} clusterClass The value of the clusterClass property.\n */\nMarkerClusterer.prototype.setClusterClass = function(clusterClass) {\n this.clusterClass_ = clusterClass;\n};\n\n\n/**\n * Returns the array of markers managed by the clusterer.\n *\n * @return {Array} The array of markers managed by the clusterer.\n */\nMarkerClusterer.prototype.getMarkers = function() {\n return this.markers_;\n};\n\n\n/**\n * Returns the number of markers managed by the clusterer.\n *\n * @return {number} The number of markers.\n */\nMarkerClusterer.prototype.getTotalMarkers = function() {\n return this.markers_.length;\n};\n\n\n/**\n * Returns the current array of clusters formed by the clusterer.\n *\n * @return {Array} The array of clusters formed by the clusterer.\n */\nMarkerClusterer.prototype.getClusters = function() {\n return this.clusters_;\n};\n\n\n/**\n * Returns the number of clusters formed by the clusterer.\n *\n * @return {number} The number of clusters formed by the clusterer.\n */\nMarkerClusterer.prototype.getTotalClusters = function() {\n return this.clusters_.length;\n};\n\n\n/**\n * Adds a marker to the clusterer. The clusters are redrawn unless\n * opt_nodraw is set to true.\n *\n * @param {google.maps.Marker} marker The marker to add.\n * @param {boolean} [opt_nodraw] Set to true to prevent redrawing.\n */\nMarkerClusterer.prototype.addMarker = function(marker, opt_nodraw) {\n this.pushMarkerTo_(marker);\n if (!opt_nodraw) {\n this.redraw_();\n }\n};\n\n\n/**\n * Adds an array of markers to the clusterer. The clusters are redrawn unless\n * opt_nodraw is set to true.\n *\n * @param {Array.} markers The markers to add.\n * @param {boolean} [opt_nodraw] Set to true to prevent redrawing.\n */\nMarkerClusterer.prototype.addMarkers = function(markers, opt_nodraw) {\n var key;\n for (key in markers) {\n if (markers.hasOwnProperty(key)) {\n this.pushMarkerTo_(markers[key]);\n }\n }\n if (!opt_nodraw) {\n this.redraw_();\n }\n};\n\n\n/**\n * Pushes a marker to the clusterer.\n *\n * @param {google.maps.Marker} marker The marker to add.\n */\nMarkerClusterer.prototype.pushMarkerTo_ = function(marker) {\n // If the marker is draggable add a listener so we can update the clusters on the dragend:\n if (marker.getDraggable()) {\n var cMarkerClusterer = this;\n google.maps.event.addListener(marker, \"dragend\", function() {\n if (cMarkerClusterer.ready_) {\n this.isAdded = false;\n cMarkerClusterer.repaint();\n }\n });\n }\n marker.isAdded = false;\n this.markers_.push(marker);\n};\n\n\n/**\n * Removes a marker from the cluster and map. The clusters are redrawn unless\n * opt_nodraw is set to true. Returns true if the\n * marker was removed from the clusterer.\n *\n * @param {google.maps.Marker} marker The marker to remove.\n * @param {boolean} [opt_nodraw] Set to true to prevent redrawing.\n * @param {boolean} [opt_noMapRemove] Set to true to prevent removal from map but still removing from cluster management\n * @return {boolean} True if the marker was removed from the clusterer.\n */\nMarkerClusterer.prototype.removeMarker = function(marker, opt_nodraw, opt_noMapRemove) {\n var removeFromMap = true && !opt_noMapRemove;\n var removed = this.removeMarker_(marker, removeFromMap);\n\n if (!opt_nodraw && removed) {\n this.repaint();\n }\n\n return removed;\n};\n\n\n/**\n * Removes an array of markers from the cluster and map. The clusters are redrawn unless\n * opt_nodraw is set to true. Returns true if markers\n * were removed from the clusterer.\n *\n * @param {Array.} markers The markers to remove.\n * @param {boolean} [opt_nodraw] Set to true to prevent redrawing.\n * @param {boolean} [opt_noMapRemove] Set to true to prevent removal from map but still removing from cluster management\n * @return {boolean} True if markers were removed from the clusterer.\n */\nMarkerClusterer.prototype.removeMarkers = function(markers, opt_nodraw, opt_noMapRemove) {\n var i, r;\n var removed = false;\n var removeFromMap = true && !opt_noMapRemove;\n\n for (i = 0; i < markers.length; i++) {\n r = this.removeMarker_(markers[i], removeFromMap);\n removed = removed || r;\n }\n\n if (!opt_nodraw && removed) {\n this.repaint();\n }\n\n return removed;\n};\n\n\n/**\n * Removes a marker and returns true if removed, false if not.\n *\n * @param {google.maps.Marker} marker The marker to remove\n * @param {boolean} removeFromMap set to true to explicitly remove from map as well as cluster manangement\n * @return {boolean} Whether the marker was removed or not\n */\nMarkerClusterer.prototype.removeMarker_ = function(marker, removeFromMap) {\n var i;\n var index = -1;\n if (this.markers_.indexOf) {\n index = this.markers_.indexOf(marker);\n } else {\n for (i = 0; i < this.markers_.length; i++) {\n if (marker === this.markers_[i]) {\n index = i;\n break;\n }\n }\n }\n\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false;\n }\n\n if (removeFromMap) {\n marker.setMap(null);\n }\n\n this.markers_.splice(index, 1); // Remove the marker from the list of managed markers\n return true;\n};\n\n\n/**\n * Removes all clusters and markers from the map and also removes all markers\n * managed by the clusterer.\n */\nMarkerClusterer.prototype.clearMarkers = function() {\n this.resetViewport_(true);\n this.markers_ = [];\n};\n\n\n/**\n * Recalculates and redraws all the marker clusters from scratch.\n * Call this after changing any properties.\n */\nMarkerClusterer.prototype.repaint = function() {\n var oldClusters = this.clusters_.slice();\n this.clusters_ = [];\n this.resetViewport_(false);\n this.redraw_();\n\n // Remove the old clusters.\n // Do it in a timeout to prevent blinking effect.\n setTimeout(function() {\n var i;\n for (i = 0; i < oldClusters.length; i++) {\n oldClusters[i].remove();\n }\n }, 0);\n};\n\n\n/**\n * Returns the current bounds extended by the grid size.\n *\n * @param {google.maps.LatLngBounds} bounds The bounds to extend.\n * @return {google.maps.LatLngBounds} The extended bounds.\n * @ignore\n */\nMarkerClusterer.prototype.getExtendedBounds = function(bounds) {\n var projection = this.getProjection();\n\n // Turn the bounds into latlng.\n var tr = new google.maps.LatLng(bounds.getNorthEast().lat(),\n bounds.getNorthEast().lng());\n var bl = new google.maps.LatLng(bounds.getSouthWest().lat(),\n bounds.getSouthWest().lng());\n\n // Convert the points to pixels and the extend out by the grid size.\n var trPix = projection.fromLatLngToDivPixel(tr);\n trPix.x += this.gridSize_;\n trPix.y -= this.gridSize_;\n\n var blPix = projection.fromLatLngToDivPixel(bl);\n blPix.x -= this.gridSize_;\n blPix.y += this.gridSize_;\n\n // Convert the pixel points back to LatLng\n var ne = projection.fromDivPixelToLatLng(trPix);\n var sw = projection.fromDivPixelToLatLng(blPix);\n\n // Extend the bounds to contain the new bounds.\n bounds.extend(ne);\n bounds.extend(sw);\n\n return bounds;\n};\n\n\n/**\n * Redraws all the clusters.\n */\nMarkerClusterer.prototype.redraw_ = function() {\n this.createClusters_(0);\n};\n\n\n/**\n * Removes all clusters from the map. The markers are also removed from the map\n * if opt_hide is set to true.\n *\n * @param {boolean} [opt_hide] Set to true to also remove the markers\n * from the map.\n */\nMarkerClusterer.prototype.resetViewport_ = function(opt_hide) {\n var i, marker;\n // Remove all the clusters\n for (i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].remove();\n }\n this.clusters_ = [];\n\n // Reset the markers to not be added and to be removed from the map.\n for (i = 0; i < this.markers_.length; i++) {\n marker = this.markers_[i];\n marker.isAdded = false;\n if (opt_hide) {\n marker.setMap(null);\n }\n }\n};\n\n\n/**\n * Calculates the distance between two latlng locations in km.\n *\n * @param {google.maps.LatLng} p1 The first lat lng point.\n * @param {google.maps.LatLng} p2 The second lat lng point.\n * @return {number} The distance between the two points in km.\n * @see http://www.movable-type.co.uk/scripts/latlong.html\n */\nMarkerClusterer.prototype.distanceBetweenPoints_ = function(p1, p2) {\n var R = 6371; // Radius of the Earth in km\n var dLat = (p2.lat() - p1.lat()) * Math.PI / 180;\n var dLon = (p2.lng() - p1.lng()) * Math.PI / 180;\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) *\n Math.sin(dLon / 2) * Math.sin(dLon / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n var d = R * c;\n return d;\n};\n\n\n/**\n * Determines if a marker is contained in a bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @param {google.maps.LatLngBounds} bounds The bounds to check against.\n * @return {boolean} True if the marker is in the bounds.\n */\nMarkerClusterer.prototype.isMarkerInBounds_ = function(marker, bounds) {\n return bounds.contains(marker.getPosition());\n};\n\n\n/**\n * Adds a marker to a cluster, or creates a new cluster.\n *\n * @param {google.maps.Marker} marker The marker to add.\n */\nMarkerClusterer.prototype.addToClosestCluster_ = function(marker) {\n var i, d, cluster, center;\n var distance = 40000; // Some large number\n var clusterToAddTo = null;\n for (i = 0; i < this.clusters_.length; i++) {\n cluster = this.clusters_[i];\n center = cluster.getCenter();\n if (center) {\n d = this.distanceBetweenPoints_(center, marker.getPosition());\n if (d < distance) {\n distance = d;\n clusterToAddTo = cluster;\n }\n }\n }\n\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\n clusterToAddTo.addMarker(marker);\n } else {\n cluster = new Cluster(this);\n cluster.addMarker(marker);\n this.clusters_.push(cluster);\n }\n};\n\n\n/**\n * Creates the clusters. This is done in batches to avoid timeout errors\n * in some browsers when there is a huge number of markers.\n *\n * @param {number} iFirst The index of the first marker in the batch of\n * markers to be added to clusters.\n */\nMarkerClusterer.prototype.createClusters_ = function(iFirst) {\n var i, marker;\n var mapBounds;\n var cMarkerClusterer = this;\n if (!this.ready_) {\n return;\n }\n\n // Cancel previous batch processing if we're working on the first batch:\n if (iFirst === 0) {\n /**\n * This event is fired when the MarkerClusterer begins\n * clustering markers.\n * @name MarkerClusterer#clusteringbegin\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, \"clusteringbegin\", this);\n\n if (typeof this.timerRefStatic !== \"undefined\") {\n clearTimeout(this.timerRefStatic);\n delete this.timerRefStatic;\n }\n }\n\n // Get our current map view bounds.\n // Create a new bounds object so we don't affect the map.\n //\n // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:\n if (this.getMap().getZoom() > 3) {\n mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),\n this.getMap().getBounds().getNorthEast());\n } else {\n mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));\n }\n var bounds = this.getExtendedBounds(mapBounds);\n\n var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length);\n\n for (i = iFirst; i < iLast; i++) {\n marker = this.markers_[i];\n if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {\n if (!this.ignoreHidden_ || (this.ignoreHidden_ && marker.getVisible())) {\n this.addToClosestCluster_(marker);\n }\n }\n }\n\n if (iLast < this.markers_.length) {\n this.timerRefStatic = setTimeout(function() {\n cMarkerClusterer.createClusters_(iLast);\n }, 0);\n } else {\n delete this.timerRefStatic;\n\n /**\n * This event is fired when the MarkerClusterer stops\n * clustering markers.\n * @name MarkerClusterer#clusteringend\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, \"clusteringend\", this);\n\n for (i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].updateIcon_();\n }\n }\n};\n\n\n/**\n * Extends an object's prototype by another's.\n *\n * @param {Object} obj1 The object to be extended.\n * @param {Object} obj2 The object to extend with.\n * @return {Object} The new extended object.\n * @ignore\n */\nMarkerClusterer.prototype.extend = function(obj1, obj2) {\n return (function(object) {\n var property;\n for (property in object.prototype) {\n this.prototype[property] = object.prototype[property];\n }\n return this;\n }).apply(obj1, [obj2]);\n};\n\n\n/**\n * The default function for determining the label text and style\n * for a cluster icon.\n *\n * @param {Array.} markers The array of markers represented by the cluster.\n * @param {number} numStyles The number of marker styles available.\n * @return {ClusterIconInfo} The information resource for the cluster.\n * @constant\n * @ignore\n */\nMarkerClusterer.CALCULATOR = function(markers, numStyles) {\n var index = 0;\n var title = \"\";\n var count = markers.length.toString();\n\n var dv = count;\n while (dv !== 0) {\n dv = parseInt(dv / 10, 10);\n index++;\n }\n\n index = Math.min(index, numStyles);\n return {\n text: count,\n index: index,\n title: title\n };\n};\n\n\n/**\n * The number of markers to process in one batch.\n *\n * @type {number}\n * @constant\n */\nMarkerClusterer.BATCH_SIZE = 2000;\n\n\n/**\n * The number of markers to process in one batch (IE only).\n *\n * @type {number}\n * @constant\n */\nMarkerClusterer.BATCH_SIZE_IE = 500;\n\n\n/**\n * The default root name for the marker cluster images.\n *\n * @type {string}\n * @constant\n */\nMarkerClusterer.IMAGE_PATH = \"//cdn.rawgit.com/mahnunchik/markerclustererplus/master/images/m\";\n\n\n/**\n * The default extension name for the marker cluster images.\n *\n * @type {string}\n * @constant\n */\nMarkerClusterer.IMAGE_EXTENSION = \"png\";\n\n\n/**\n * The default array of sizes for the marker cluster images.\n *\n * @type {Array.}\n * @constant\n */\nMarkerClusterer.IMAGE_SIZES = [53, 56, 66, 78, 90];\n\nif (typeof String.prototype.trim !== 'function') {\n /**\n * IE hack since trim() doesn't exist in all browsers\n * @return {string} The string with removed whitespace\n */\n String.prototype.trim = function() {\n return this.replace(/^\\s+|\\s+$/g, '');\n };\n}\n","(function($) {\n\t'use strict';\n\t$.widget('msv.articleList', {\n\t\tvars: {},\n\t\tel: {},\n\t\t_create: function() {\n\t\t\t//---------- define vars and elements -----------------------------\n\t\t\tthis.el.filtersForm = this.element.find('.js-filter-form');\n\t\t\tthis.el.listContainer = this.element.find('.js-container');\n\t\t\tthis.el.loadMore = this.element.find('.js-load-more');\n\n\t\t\tthis.vars.endpoint = this.element.data('endpoint');\n\t\t\tthis.vars.start = this.element.data('start');\n\t\t\tthis.vars.contentId = this.element.data('content-id');\n\t\t\tthis.vars.pageSize = this.element.data('pagesize') ? this.element.data('pagesize') : 10;\n\t\t\tthis.vars.isLoading = false;\n\t\t},\n\t\t_init: function() {\n\t\t\tvar self = this;\n\t\t\t//---------- define events ---------------------------------\n\t\t\tself.el.filtersForm.off('change').change(function() {\n\t\t\t\tself.vars.start = 0;\n\t\t\t\t$(self.el.main).data('start', self.vars.start);\n\t\t\t\tself.el.listContainer.html(null);\n\t\t\t\tself.loadContainer();\n\t\t\t});\n\n\n\t\t\tself.el.loadMore.off('click').click(function() {\n\t\t\t\tself.loadContainer();\n\t\t\t});\n\t\t},\n\t\t_destroy: function() {},\n\t\tloadContainer: function() {\n\t\t\tvar self = this;\n\n\t\t\t//prevent to load when it is already loading\n\t\t\tif (self.vars.isLoading)\n\t\t\t\treturn;\n\n\t\t\tvar params = self.el.filtersForm.serialize();\n\t\t\tparams += '&start=' + self.vars.start;\n\t\t\tparams += '&pageSize=' + self.vars.pageSize;\n\t\t\tif (self.vars.contentId)\n\t\t\t\tparams += '&contentId=' + self.vars.contentId;\n\n\t\t\t//add loading state to button\n\t\t\tself.el.loadMore.attr('disabled', true).addClass('btn-loading');\n\t\t\tself.el.loadMore.append(\"\");\n\t\t\tself.vars.isLoading = true;\n\t\t\t//ajax request\n\t\t\t$.get(self.vars.endpoint, params, function(data, m, e) {\n\t\t\t\tself.vars.isLoading = false;\n\n\t\t\t\tif (self.vars.start == 0)\n\t\t\t\t\tself.el.listContainer.html(data);\n\t\t\t\telse\n\t\t\t\t\tself.el.listContainer.append(data);\n\n\t\t\t\tself.el.loadMore.removeClass('loading');\n\t\t\t\tif (e.status == 200) {\n\t\t\t\t\tself.el.loadMore.hide();\n\t\t\t\t}\n\t\t\t\telse if (e.status == 202) {\n\t\t\t\t\tself.el.loadMore.show();\n\t\t\t\t\tself.vars.start += self.vars.pageSize;\n\t\t\t\t\t$(self.element).data('start', self.vars.start);\n\t\t\t\t}\n\n\t\t\t\t//remove loading state from button \n\t\t\t\tself.el.loadMore.attr('disabled', false).removeClass('btn-loading');\n\t\t\t\tself.el.loadMore.find(\".btn-loading-spinner\").remove();\n\t\t\t});\n\t\t}\n\t});\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.breadcrumbs', {\n\n\t\tvars: {\n\t\t\ttimer: 0,\n\t\t\toffset: null\n\t\t},\n\t\tel: {\n\t\t\tpreviousElement: null,\n\t\t},\n\n\t\tgetOffset: function() {\n\t\t\tvar self = this;\n\t\t\tvar currentScroll = $(window).scrollTop();\n\t\t\tvar menuHeight = $('.menu').height();\n\t\t\tvar menuDouble = $('.menu__double');\n\t\t\tvar menuDoubleHeight = $('.menu__double').height();\n\t\t\tvar heroHeight = self.el.previousElement.height();\n\t\t\tif (menuDouble.length) {\n\t\t\t\treturn currentScroll > heroHeight + menuHeight + menuDoubleHeight ? menuHeight + menuDoubleHeight : heroHeight + menuHeight + menuDoubleHeight;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn currentScroll > heroHeight + menuHeight ? menuHeight : heroHeight + menuHeight;\n\t\t\t}\n\n\t\t},\n\n\t\t_create: function() {\n\t\t\tvar self = this;\n\t\t\tself.el.previousElement = $(this.element.data('previous-element'));\n\t\t},\n\t\t_init: function() {\n\t\t\tvar self = this;\n\t\t\t$(window).on('scroll', function() {\n\t\t\t\tself.vars.timer = setTimeout(function() {\n\n\t\t\t\t\tif ($(window).scrollTop() >= self.getOffset())\n\t\t\t\t\t\tself.element.addClass('fixed').css('top', self.getOffset())\n\t\t\t\t\telse\n\t\t\t\t\t\tself.element.removeClass('fixed').removeAttr('style')\n\n\t\t\t\t}, 100)\n\t\t\t})\n\t\t}\n\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.carousel', {\n\n\t\toptions: {},\n\n\t\t_create: function() {\n\t\t\tvar self = this,\n\t\t\t\tvideoElement = this.element.find('.hero--video'),\n\t\t\t\tsettingsElement = this.element.data('settings'),\n\t\t\t\tslideAmount = this.element.find(\"> div\").length;\n\n\t\t\t/**/\n\n\t\t\tif (slideAmount > 1) {\n\t\t\t\tif (settingsElement) {\n\t\t\t\t\tself.settings = JSON.parse($(settingsElement).text());\n\t\t\t\t}\n\n\t\t\t\tif (self.settings.identifier == \"eventos\") {\n\n\t\t\t\t\tif (window.innerWidth > 960) {\n\n\t\t\t\t\t\tthis.element.owlCarousel(self.settings);\n\n\t\t\t\t\t}\n\t\t\t\t\t$(window).resize(function() {\n\n\t\t\t\t\t\tself._handleCarousel();\n\t\t\t\t\t});\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (videoElement.length) {\n\t\t\t\t\t\tif (window.innerWidth > 960) {\n\t\t\t\t\t\t\tthis.element.owlCarousel(self.settings)\n\t\t\t\t\t\t\t\t.on('translate.owl.carousel', function() {\n\t\t\t\t\t\t\t\t\tvideoElement.find('video').each(function() {\n\t\t\t\t\t\t\t\t\t\t$(this).get(0).pause();\n\t\t\t\t\t\t\t\t\t\t!$(this).get(0).muted ? $(this).get(0).muted = true : '';\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.on('translated.owl.carousel', function() {\n\t\t\t\t\t\t\t\t\tvideoElement.parent('.active').find('video').get(0).play();\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tvideoElement.each(function() {\n\t\t\t\t\t\t\t\tvar src = $(this).data('video');\n\t\t\t\t\t\t\t\tif (typeof src !== typeof undefined && src !== false) {\n\t\t\t\t\t\t\t\t\t$(this).prepend('')\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tvideoElement.parent('.active').find('video').attr({ 'autoplay': true, 'loop': true })\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.element.owlCarousel(self.settings);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t_handleCarousel: function() {\n\t\t\tvar self = this;\n\n\t\t\tif (window.innerWidth < 960) {\n\t\t\t\tself.element.trigger('destroy.owl.carousel');\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\tself.element.owlCarousel(self.settings);\n\n\t\t\t}\n\t\t}\n\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\t$.widget('msv.cookieConsent', {\n\t\tel: {},\n\t\toptions: {},\n\t\t_create: function() {\n\t\t\tvar self = this;\n\t\t\tthis.options = {\n\t\t\t\t\"palette\": {\n\t\t\t\t\t\"popup\": {\n\t\t\t\t\t\t\"background\": \"#00B1D7\",\n\t\t\t\t\t\t\"text\": \"#fff\"\n\t\t\t\t\t},\n\t\t\t\t\t\"button\": {\n\t\t\t\t\t\t\"background\": \"transparent\",\n\t\t\t\t\t\t\"text\": \"#fff\",\n\t\t\t\t\t\t\"border\": \"#fff\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"content\": {\n\t\t\t\t\t\"message\": this.element.data(\"consent-message\"),\n\t\t\t\t\t\"dismiss\": this.element.data(\"consent-dismiss\"),\n\t\t\t\t\t\"link\": this.element.data(\"consent-link\"),\n\t\t\t\t\t\"href\": this.element.data(\"consent-href\")\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t_init: function() {\n\t\t\tvar self = this;\n\t\t\twindow.addEventListener(\"load\", function() {\n\t\t\t\twindow.cookieconsent.initialise(self.options)\n\t\t\t});\n\t\t}\n\t});\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.datalist', {\n\t\tvars: {},\n\t\toptions: {\n\t\t\tlimit: 4,\n\t\t\twrapper: '.form-datalist',\n\t\t\ttextField: '.form-item-text',\n\t\t\toptionsList: '.form-datalist__options',\n\t\t\tpointer: '.form-datalist__pointer'\n\t\t},\n\n\t\t_create: function() {\n\t\t\tvar self = this;\n\t\t\tthis.options.wrapper = this.element;\n\t\t\tthis.options.textField = this.options.wrapper.find(this.options.textField);\n\t\t\tthis.options.optionsList = this.options.wrapper.find(this.options.optionsList);\n\t\t\tthis.options.pointer = this.options.wrapper.find(this.options.pointer);\n\t\t\tthis.buttonViewAll = this.element.parent().parent().find('.js-btn-view-all');\n\t\t\tthis.vars.enableScroll = self.element.data('enable-scroll');\n\n\t\t\tif (self.vars.enableScroll)\n\t\t\t\tthis.options.optionsList.css({ 'overflow-y': 'auto', 'max-height': '300px' });\n\n\t\t\tthis.options.textField.click(function(e) {\n\t\t\t\tvar result = self.filterBy($(e.target).val());\n\t\t\t\tself.populateLocations(result);\n\t\t\t\tself.open();\n\t\t\t});\n\t\t\tthis.options.textField.keyup(function(e) {\n\t\t\t\t//console.log('text keyup');\n\t\t\t\tvar result = self.filterBy(self.options.textField.val());\n\t\t\t\tself.populateLocations(result);\n\t\t\t\tself.open();\n\t\t\t});\n\t\t\tthis.options.textField.blur(function(e) {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tself.close();\n\t\t\t\t}, 200);\n\t\t\t});\n\t\t\tthis.options.pointer.mouseup(function() {\n\t\t\t\tif (self.options.wrapper.hasClass(\"opened\")) {\n\t\t\t\t\tself.close();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar result = self.filterBy(self.options.textField.val());\n\t\t\t\t\tself.populateLocations(result);\n\t\t\t\t\tself.open();\n\t\t\t\t}\n\t\t\t});\n\t\t\t$(window).resize(function() {\n\t\t\t\tself.redraw();\n\t\t\t});\n\t\t},\n\n\t\topen: function() {\n\t\t\tthis.options.wrapper.addClass(\"opened\");\n\t\t\tthis.redraw();\n\t\t\tthis.options.textField.focus();\n\t\t},\n\n\t\tclose: function() {\n\t\t\tthis.options.textField.val('');\n\t\t\tthis.options.wrapper.removeClass(\"opened\");\n\t\t},\n\n\t\tredraw: function() {\n\t\t\t//console.log('redraw');\n\t\t\tthis.options.optionsList.width(this.options.textField.width() + 2);\n\t\t},\n\n\t\tfilterBy: function(inserted) {\n\t\t\t//console.log(\"filterby: \", inserted);\n\t\t\tvar temp = [];\n\t\t\tif (inserted) {\n\t\t\t\t$.each(BEC.locations, function(index, value) {\n\t\t\t\t\tif (BEC.locations[index].name.toLowerCase().indexOf(inserted.toLowerCase()) > -1) {\n\t\t\t\t\t\ttemp.push(BEC.locations[index]);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttemp = BEC.locations;\n\t\t\t}\n\t\t\treturn temp;\n\t\t},\n\n\t\tpopulateLocations: function(list) {\n\t\t\tvar self = this;\n\t\t\tthis.options.optionsList.empty();\n\t\t\tif (!list || list.length === 0) {\n\t\t\t\tthis.options.optionsList.append(\"No results.\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$.each(list, function(index, value) {\n\t\t\t\t\tvar option = $(\"\" + value.name + \"\");\n\t\t\t\t\toption.click(self, function(e) {\n\t\t\t\t\t\tvar mapElementId = $(e.data.element).data('bind-map');\n\t\t\t\t\t\tif (mapElementId)\n\t\t\t\t\t\t\t$(mapElementId).googlemap('focusMarkerById', value.id);\n\t\t\t\t\t});\n\t\t\t\t\tself.options.optionsList.append(option);\n\t\t\t\t\tif (!self.vars.enableScroll && index >= self.options.limit) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (!self.vars.enableScroll && list.length > this.options.limit) {\n\t\t\t\t\tself.options.optionsList.append(\"Total of \" + list.length + \" results found.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.dateRange', {\n\n\t\toptions: {\n\t\t\tmediumAndUp: window.matchMedia('(min-width: 960px)')\n\t\t},\n\n\t\t_init: function() {\n\n\t\t\tthis._events()\n\t\t\tthis._showDates()\n\t\t},\n\n\t\t_events: function() {\n\t\t\tvar self = this;\n\n\t\t\t//input daterange\n\t\t\tthis.element.daterangepicker({\n\t\t\t\tautoUpdateInput: false,\n\t\t\t\tstartDate: moment(),\n\t\t\t\tminDate: moment(),\n\t\t\t\tautoApply: true,\n\t\t\t\topens: self.options.mediumAndUp.matches ? 'right' : 'center',\n\t\t\t\tlocale: {\n\t\t\t\t\t'format': 'MM/DD/YYYY',\n\t\t\t\t\t'daysOfWeek': self.element.parent().data('days'),\n\t\t\t\t\t\"monthNames\": self.element.parent().data('months')\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t_showDates: function() {\n\t\t\tthis.element.on('apply.daterangepicker', function(_, picker) {\n\t\t\t\t$(this).val(picker.startDate.format('MM/DD/YYYY') + ' - ' + picker.endDate.format('MM/DD/YYYY'));\n\t\t\t});\n\t\t}\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\t$.widget('msv.dropdown', {\n\t\toptions: {\n\t\t\tlimit: 6,\n\t\t\ttext: '.form-item-text',\n\t\t\toptionsList: '.form-datalist__options',\n\t\t\tpointer: '.form-datalist__pointer',\n\t\t\tinput: 'input[type=hidden]',\n\t\t\tremoveBtn: '',\n\t\t\tremoveBtnClass: '.remove-it'\n\t\t},\n\t\tvars: {},\n\t\tel: {},\n\t\t_create: function() {\n\t\t\t//---------- define vars and elements -----------------------------\n\t\t\tvar self = this;\n\t\t\tself.vars = {};\n\t\t\tself.vars.required = self.element.data('required');\n\t\t\tself.vars.fieldName = self.element.data('name');\n\t\t\tself.vars.defaultText = self.element.find(self.options.text).val();\n\t\t\tself.vars.enableScroll = self.element.data('enable-scroll');\n\t\t},\n\t\t_init: function() {\n\t\t\tvar self = this;\n\n\t\t\tself.element.find(self.options.text).click(function(e) {\n\t\t\t\tself.populate();\n\t\t\t\tself.open();\n\t\t\t});\n\t\t\tself.element.find(self.options.text).blur(function(e) {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tself.close();\n\t\t\t\t}, 200);\n\t\t\t});\n\t\t\tself.element.find(self.options.pointer).mouseup(function() {\n\t\t\t\tif (self.element.hasClass(\"opened\")) {\n\t\t\t\t\tself.close();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself.populate();\n\t\t\t\t\tself.open();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tself.element.find(self.options.optionsList).on('click', function(item) {\n\t\t\t\tif (self.element.find(self.options.optionsList)[0] == item.target)\n\t\t\t\t\treturn false;\n\n\t\t\t\tself.updateValue(item);\n\n\t\t\t\tself.close();\n\t\t\t});\n\n\t\t\t$(window).resize(function() {\n\t\t\t\tself.redraw();\n\t\t\t});\n\n\t\t\tif (self.vars.enableScroll) {\n\t\t\t\tself.element.find(self.options.optionsList)\n\t\t\t\t\t.css({ 'overflow-y': 'auto', 'max-height': '300px' });\n\t\t\t}\n\t\t},\n\t\tupdateValue: function(selectedOption) {\n\t\t\tvar self = this;\n\t\t\tvar inputHidden = self.element.find('input[type=hidden]');\n\t\t\tvar inputText = self.element.find('input[type=text]');\n\t\t\tvar selectedValue = selectedOption ? selectedOption == 'reset' ? null : $(selectedOption.target).data('value') : inputHidden.val();\n\t\t\tvar selectedText = selectedOption ? selectedOption == 'reset' ? null : $(selectedOption.target).text() : inputText.val();\n\t\t\tvar selectedLimit = selectedOption ? selectedOption == 'reset' ? null : $(selectedOption.target).data(\"limit\") !== 'undefined' ? $(selectedOption.target).data('limit') : '' : '';\n\n\t\t\tif (selectedLimit)\n\t\t\t\t$('.js-atendees').attr('max', selectedLimit)\n\n\t\t\tinputText.val(selectedText).attr('data-value', selectedValue);\n\t\t\tinputHidden.val(selectedValue).trigger('change');\n\n\t\t\tif (inputHidden.val()) {\n\t\t\t\tself.element.find('.btn-remove-it').remove();\n\t\t\t\tself.element.addClass('has-value');\n\t\t\t\tself.vars.btnRemove = $(self.options.removeBtn).off('click').click(function() {\n\t\t\t\t\tinputHidden.val(null).trigger('change');\n\t\t\t\t\tinputText.val(null);\n\t\t\t\t\tself.updateValue('reset');\n\t\t\t\t});\n\n\t\t\t\tself.element.append(self.vars.btnRemove);\n\n\t\t\t\tinputHidden.valid();\n\t\t\t\tinputText.valid();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tself.element.removeClass('has-value');\n\t\t\t\tself.element.find('.btn-remove-it').remove();\n\t\t\t}\n\t\t},\n\t\t_destroy: function() {},\n\t\topen: function() {\n\t\t\tvar self = this;\n\t\t\tself.element.addClass(\"opened\");\n\t\t\tself.redraw();\n\t\t\tself.element.find(self.options.text).focus();\n\t\t},\n\n\t\tclose: function() {\n\t\t\tvar self = this;\n\t\t\tself.element.removeClass(\"opened\");\n\t\t},\n\n\t\tredraw: function() {\n\t\t\tvar self = this;\n\t\t\t//console.log('redraw');\n\t\t\tself.element.find(self.options.optionsList).width(self.element.find(self.options.text).width() + 2);\n\t\t},\n\t\tpopulate: function() {\n\t\t\tvar self = this;\n\t\t\tself.element.find(self.options.optionsList).empty();\n\n\t\t\t//------------------- hide-option-if algorithm ---------------\n\t\t\tvar hideOptionIf = self.element.data('hide-option-if');\n\t\t\tvar optionValue = null;\n\t\t\tvar hideOption = false;\n\t\t\tif (hideOptionIf) {\n\t\t\t\t//{\"complaint\":{\"userType\":\"is-not-customer\"}}\n\t\t\t\toptionValue = Object.keys(hideOptionIf) && Object.keys(hideOptionIf).length > 0 ? Object.keys(hideOptionIf)[0] : null; //complaint\n\t\t\t\tvar condition = optionValue ? hideOptionIf[optionValue] : null;\n\t\t\t\tvar inputControllerName = condition && Object.keys(condition) && Object.keys(condition).length > 0 ? Object.keys(condition)[0] : null; //userType\n\t\t\t\t//$('[name=' + inputControllerName + ']').change(function () {\n\t\t\t\t// console.log(this);\n\t\t\t\t//});\n\t\t\t\tvar inputControllerTargetValue = condition ? condition[inputControllerName] : null; //is-not-customer\n\t\t\t\tvar inputControllerValue = $.getFieldFormValue(self.element.closest('form'), inputControllerName); //(currentValue)\n\n\t\t\t\thideOption = inputControllerTargetValue == inputControllerValue;\n\t\t\t}\n\t\t\tself.updateValue();\n\t\t\t//----------------------------------------------------------------\n\n\t\t\t$.each(self.element.data('json'), function(index, item) {\n\t\t\t\tif (!(hideOption && item.value == optionValue)) { //hide-option-if algorithm : CONDITION\n\t\t\t\t\t//self.reset();\n\t\t\t\t\tvar option = $('
' + item.text + \"
\");\n\t\t\t\t\toption.click(self, function(e) {\n\t\t\t\t\t\tvar mapElementId = $(e.data.element).data('bind-map');\n\t\t\t\t\t\tif (mapElementId)\n\t\t\t\t\t\t\t$(mapElementId).googlemap('focusMarkerById', item.value);\n\t\t\t\t\t});\n\t\t\t\t\tself.element.find(self.options.optionsList).append(option);\n\t\t\t\t}\n\t\t\t});\n\n\t\t},\n\t\treset: function() {\n\t\t\tvar self = this;\n\t\t\tself.element.find(self.options.input).val('').trigger('change');\n\t\t\tself.updateValue();\n\t\t\tself.element.find(self.options.text).val(self.vars.defaultText);\n\t\t}\n\t});\n})(jQuery);","(function($) {\n\t'use strict';\n\t$.widget('msv.dropdownSearch', {\n\t\toptions: {\n\t\t\tlimit: 6,\n\t\t\ttextField: '.form-item-text',\n\t\t\toptionsList: '.form-datalist__options',\n\t\t\tpointer: '.form-datalist__pointer',\n\t\t\tinput: 'input[type=hidden]',\n\t\t\tremoveBtn: '',\n\t\t\tremoveBtnClass: '.remove-it'\n\t\t},\n\t\tvars: {},\n\t\tel: {},\n\t\t_create: function() {\n\t\t\t//---------- define vars and elements -----------------------------\n\t\t\tvar self = this;\n\t\t\tself.vars = {};\n\t\t\tself.vars.dataSource = self.element.data('json'); //example: [{\"value\":1,\"text\":\"one\"},{\"value\":2,\"text\":\"two\"}]\n\t\t\tself.vars.fieldName = self.element.data('name');\n\t\t\tself.vars.required = self.element.data('required');\n\t\t\tself.vars.filteredDataSource = self.vars.dataSource;\n\t\t\tself.vars.enableScroll = self.element.data('enable-scroll');\n\t\t},\n\t\t_init: function() {\n\t\t\tvar self = this;\n\t\t\tvar textField = self.element.find(self.options.textField);\n\t\t\ttextField.click(function(e) {\n\t\t\t\tself.filterBy($(e.target).val());\n\t\t\t\tself.populate();\n\t\t\t\tself.open();\n\t\t\t});\n\t\t\ttextField.keydown(function(e) {\n\t\t\t\tif (e.keyCode == 9 && self.vars.filteredDataSource.length == 1) {\n\t\t\t\t\ttextField.val(self.vars.filteredDataSource[0].text);\n\t\t\t\t\tself.element.find(self.options.input).val(self.vars.filteredDataSource[0].value);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\ttextField.keyup(function(e) {\n\t\t\t\t//console.log('text keyup');\n\t\t\t\tself.filterBy(textField.val());\n\t\t\t\tself.populate();\n\t\t\t\tself.open();\n\t\t\t});\n\t\t\ttextField.blur(function(e) {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tself.close();\n\t\t\t\t}, 200);\n\t\t\t});\n\t\t\tself.element.find(self.options.pointer).mouseup(function() {\n\t\t\t\tif (self.element.hasClass(\"opened\")) {\n\t\t\t\t\tself.close();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself.filterBy(textField.val());\n\t\t\t\t\tself.populate();\n\t\t\t\t\tself.open();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tself.element.find(self.options.optionsList).off('click').on('click', function(item) {\n\t\t\t\tif (self.element.find(self.options.optionsList)[0] == item.target)\n\t\t\t\t\treturn false;\n\n\t\t\t\tself.updateValue(item);\n\t\t\t});\n\n\t\t\t$(window).resize(function() {\n\t\t\t\tself.redraw();\n\t\t\t});\n\n\t\t\tif (self.vars.enableScroll) {\n\t\t\t\tself.element.find(self.options.optionsList)\n\t\t\t\t\t.css({ 'overflow-y': 'auto', 'max-height': '300px' });\n\t\t\t}\n\t\t},\n\t\tupdateValue: function(selectedOption) {\n\t\t\tvar self = this;\n\t\t\tvar inputHidden = self.element.find(self.options.input);\n\t\t\tvar textField = self.element.find(self.options.textField);\n\t\t\tif (typeof(selectedOption) != 'undefined') {\n\t\t\t\ttextField.val($(selectedOption.target).text());\n\t\t\t\tinputHidden.val($(selectedOption.target).data('value')).trigger('change');\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttextField.val(null);\n\t\t\t\tinputHidden.val(null).trigger('change');\n\t\t\t}\n\n\t\t\tif (inputHidden.val()) {\n\t\t\t\tself.element.find('.btn-remove-it').remove();\n\t\t\t\tself.element.addClass('has-value');\n\t\t\t\tself.vars.btnRemove = $(self.options.removeBtn).off('click').click(function() {\n\t\t\t\t\tself.updateValue();\n\t\t\t\t});\n\t\t\t\tself.element.append(self.vars.btnRemove);\n\n\t\t\t\tinputHidden.valid();\n\t\t\t\tinputText.valid();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tself.element.removeClass('has-value');\n\t\t\t\tself.element.find('.btn-remove-it').remove();\n\t\t\t}\n\t\t},\n\t\t_destroy: function() {},\n\t\topen: function() {\n\t\t\tvar self = this;\n\t\t\tself.element.addClass(\"opened\");\n\t\t\tself.redraw();\n\t\t\tself.element.find(self.options.textField).focus();\n\t\t},\n\n\t\tclose: function() {\n\t\t\tvar self = this;\n\t\t\tself.element.removeClass(\"opened\");\n\n\t\t\tvar textExists = false;\n\t\t\tself.vars.filteredDataSource.forEach(function(item) {\n\n\t\t\t\tif (item.text == self.element.find(self.options.textField).val()) {\n\t\t\t\t\ttextExists = true;\n\t\t\t\t\tif (self.element.find(self.options.textField).valid)\n\t\t\t\t\t\tself.element.find(self.options.textField).valid();\n\t\t\t\t}\n\n\n\t\t\t});\n\n\t\t\tif (!textExists) {\n\t\t\t\tself.element.find(self.options.textField).val('');\n\t\t\t\tself.element.find(self.options.input).val('');\n\t\t\t}\n\t\t},\n\n\t\tredraw: function() {\n\t\t\tvar self = this;\n\t\t\tself.element.find(self.options.optionsList).width(self.element.find(self.options.textField).width() + 2);\n\t\t},\n\t\tpopulate: function() {\n\t\t\tvar self = this;\n\t\t\tself.element.find(self.options.optionsList).empty();\n\t\t\tif (!self.vars.filteredDataSource || self.vars.filteredDataSource.length === 0) {\n\t\t\t\tself.element.find(self.options.optionsList).append(\"Sem resultados.\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$.each(self.vars.filteredDataSource, function(index, item) {\n\t\t\t\t\tvar option = $('
' + item.text + \"
\");\n\t\t\t\t\toption.click(self, function(e) {\n\t\t\t\t\t\tvar mapElementId = $(e.data.element).data('bind-map');\n\t\t\t\t\t\tif (mapElementId)\n\t\t\t\t\t\t\t$(mapElementId).googlemap('focusMarkerById', item.value);\n\t\t\t\t\t});\n\t\t\t\t\tself.element.find(self.options.optionsList).append(option);\n\t\t\t\t\tif (!self.vars.enableScroll) {\n\t\t\t\t\t\tif (index >= self.options.limit) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif (!self.vars.enableScroll) {\n\t\t\t\t\tif (self.vars.filteredDataSource.length > self.options.limit) {\n\t\t\t\t\t\tself.element.find(self.options.optionsList).append(\"Total de \" + self.vars.filteredDataSource.length + \" resultados encontrados.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tself.element.find(self.options.input).addClass('has-value');\n\t\t},\n\t\tfilterBy: function(inserted) {\n\t\t\tvar self = this;\n\t\t\tself.vars.dataSource = self.element.data('json');\n\t\t\t// console.log(\"filterby: \", inserted);\n\t\t\tself.vars.filteredDataSource = [];\n\t\t\tif (inserted) {\n\t\t\t\t$.each(self.vars.dataSource, function(index) {\n\t\t\t\t\tif (self.vars.dataSource[index].text.toLowerCase().indexOf(inserted.toLowerCase()) > -1) {\n\t\t\t\t\t\tself.vars.filteredDataSource.push(self.vars.dataSource[index]);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tself.vars.filteredDataSource = self.vars.dataSource;\n\t\t\t}\n\t\t},\n\t\treset: function() {\n\t\t\tthis.element.find(self.options.textField).val('');\n\t\t\tthis.element.find(self.options.input).val('');\n\t\t\tthis.filterBy('');\n\t\t}\n\t});\n})(jQuery);","(function($) {\n\t'use strict';\n\t$.widget('msv.dynamicForm', {\n\t\tel: {},\n\t\t_create: function() {\n\t\t\tvar self = this;\n\t\t\tself.vars = {};\n\t\t\tself.vars.htmlToClone = self.element[0].innerHTML;\n\t\t},\n\t\t_init: function() {\n\t\t\tvar self = this;\n\t\t\tself.el.addButton = self.element.find('.js-button-add');\n\n\t\t\tself.el.addButton\n\t\t\t\t.off('click')\n\t\t\t\t.click(function(e) {\n\n\t\t\t\t\tvar currentRowHtml = $(e.target).parent();\n\t\t\t\t\tvar newRemoveButton = $('');\n\n\t\t\t\t\tnewRemoveButton.off('click').click(function(e) {\n\t\t\t\t\t\tcurrentRowHtml.remove();\n\t\t\t\t\t});\n\n\t\t\t\t\tvar newRow = $(self.vars.htmlToClone);\n\t\t\t\t\tnewRow.find(\".js-dropdown\").dropdown();\n\t\t\t\t\tnewRow.find(\".js-dropdown-search\").dropdownSearch();\n\t\t\t\t\t$(this).before(newRemoveButton); //add remove button before add button;\n\t\t\t\t\tself.element.append(newRow);\n\t\t\t\t\tself.element.dynamicForm();\n\t\t\t\t\te.target.remove(); //remove add button \n\t\t\t\t});\n\t\t},\n\t\t_destroy: function() {}\n\t});\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.formpanel', {\n\n\t\toptions: {},\n\t\tresetForm: function() {\n\t\t\tvar self = this;\n\t\t\tself.element.find('input:not([type=radio]):not([type=checkbox]):not(.js-formid)').val(''); //remove all from inputs\n\t\t\tself.element.find('input[type=radio],input[type=checkbox]').prop('checked', false); //uncheck all radiobuttons\n\t\t\tself.element.find('textarea').val(''); //remove all from inputs\n\t\t\tself.element.find('.js-dynamicForm:not(:last)').remove(); // remove all dynamic forms\n\t\t\tself.element.find('.js-upload span').text('') //clean span file\n\t\t\tself.element.find('.js-dropdown').dropdown('reset'); //\n\t\t\tif (grecaptcha)\n\t\t\t\tgrecaptcha.reset()\n\t\t},\n\t\t_create: function() {\n\t\t\tvar self = this;\n\t\t\tthis.validator = null;\n\t\t\tthis._events();\n\t\t\tself.validator = self.element.validate({\n\t\t\t\tignore: [],\n\t\t\t\terrorPlacement: function(error, element) {\n\t\t\t\t\tif (element.attr(\"type\") === \"checkbox\") {\n\t\t\t\t\t\t$(element).closest('.checkbox-wrap').append($('

').append(error));\n\t\t\t\t\t}\n\t\t\t\t\telse if (element.attr(\"type\") === \"radio\") {\n\t\t\t\t\t\t$(element).closest('.radio-btns-group').append($('

').append(error));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\terror.insertAfter(element);\n\t\t\t\t\t}\n\t\t\t\t\tvar formItem = $(element).closest(\".form-item\");\n\t\t\t\t\tformItem.addClass(\"not-valid\");\n\t\t\t\t\tformItem.find(\".btn\").addClass(\"btn-red\");\n\t\t\t\t},\n\t\t\t\tsuccess: function(el) {\n\t\t\t\t\t//self.validator.hideErrors();\n\t\t\t\t\tel.closest('form.js-form').find('button.js-submit').removeClass('btn-red');\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.element.on('submit', function(e) {\n\t\t\t\t// console.log(\"submitting form...\");\n\t\t\t\tself.element.find('button.btn').attr('disabled', true).addClass('btn-loading');\n\t\t\t\tself.element.find('.btn-loading').append(\"\");\n\t\t\t\te.preventDefault();\n\t\t\t\t// self.validator = self.element.validate();\n\t\t\t\tvar isValid = self.element.valid();\n\t\t\t\tif (!isValid) {\n\t\t\t\t\tself.element.find('button.btn').attr('disabled', false).addClass('btn-red').removeClass('btn-loading');\n\t\t\t\t\tself.element.find(\".btn-loading-spinner\").remove();\n\t\t\t\t\t// console.log(\"form not valid... exit here\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar parameters = self.element.data('id') ? \"&idproduct=\" + self.element.data('id') : '';\n\n\t\t\t\tvar allFields = self.element.serialize() + parameters;\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\tcrossDomain: true,\n\t\t\t\t\turl: self.element.data(\"endpoint\"),\n\t\t\t\t\tdata: allFields,\n\t\t\t\t\theaders: { 'g-captcha-value': self.element.find('input[type=hidden][name=captcha]').val() }\n\t\t\t\t}).done(function(data, textStatus, jqXHR) {\n\t\t\t\t\tself.element.find('button.btn').removeClass('btn-loading');\n\t\t\t\t\tself.element.find(\".btn-loading-spinner\").remove();\n\t\t\t\t\t// console.log(textStatus, jqXHR);\n\t\t\t\t\tif (jqXHR.status === 200) {\n\t\t\t\t\t\tself.element.find('.form-success-message').html(self.element.data('msg-success')).show();\n\t\t\t\t\t\tself.element.closest('.modal').find('.modal__content').hide();\n\t\t\t\t\t\tself.element.closest('.modal').find('.form-success-message').show();\n\t\t\t\t\t\tself.element.find('button.btn').addClass('btn-green');\n\t\t\t\t\t\t//newsletter\n\t\t\t\t\t\tself.element.parent('.newsletter__field').find('input').hide();\n\t\t\t\t\t\tself.element.parent('.newsletter__field').find('.form-success-message').addClass('show');\n\n\t\t\t\t\t\tself.resetForm();\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\tself.element.find('.form-success-message').html('').hide();\n\t\t\t\t\t\t\tself.element.find('button.btn').attr('disabled', false).removeClass('btn-green');\n\t\t\t\t\t\t\tself.element.closest('.modal').find('.form-success-message').hide();\n\t\t\t\t\t\t\tself.element.closest('.modal').find('.modal__content').show();\n\t\t\t\t\t\t\t//newsletter\n\t\t\t\t\t\t\tself.element.parent('.newsletter__field').find('input').show();\n\t\t\t\t\t\t\tself.element.parent('.newsletter__field').find('.form-success-message').removeClass('show');\n\t\t\t\t\t\t}, 10000);\n\t\t\t\t\t\t// console.log(\"Done: all OK\");\n\t\t\t\t\t}\n\t\t\t\t}).fail(function(jqXHR) {\n\t\t\t\t\tconsole.log(jqXHR);\n\t\t\t\t\tself.element.find('button.btn').attr('disabled', false).addClass('btn-red').removeClass('btn-loading');\n\t\t\t\t\tself.element.find(\".btn-loading-spinner\").remove();\n\t\t\t\t\tself.validator.showErrors(BEC.translate(jqXHR.responseJSON));\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tself.element.find('.js-form-block .js-next')\n\t\t\t\t.off('click')\n\t\t\t\t.on('click', function(e) {\n\t\t\t\t\tvar el = self.element.find(e.target).hide();\n\t\t\t\t\tvar id = el.data('next-form-id');\n\t\t\t\t\tvar partialForm = self.element.find('[data-id=' + id + ']');\n\n\t\t\t\t\t//get previous partial form list\n\t\t\t\t\tvar previousPartialFormList = self.element.find('[data-id]').filter(function() { return $(this).data('id') < id });\n\t\t\t\t\t//Get current and previous partial forms status\n\t\t\t\t\tvar partialFormIsValid = true;\n\t\t\t\t\tpreviousPartialFormList.each(\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t$(this).find('input,textarea').each(function() {\n\t\t\t\t\t\t\t\tif (!$(this).valid())\n\t\t\t\t\t\t\t\t\tpartialFormIsValid = false;\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\tif (!partialFormIsValid) {\n\t\t\t\t\t\tel.show();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tpartialForm.fadeIn();\n\t\t\t\t\t$('html, body').animate({ scrollTop: partialForm.offset().top - 150 }, 500)\n\t\t\t\t});\n\n\t\t\t$.validator.addMethod('fullname', function(value) {\n\t\t\t\treturn /^([^0-9]*)$/.test(value);\n\t\t\t});\n\n\t\t\t$.validator.addMethod('terms', function(value, element) {\n\t\t\t\treturn typeof(value) != 'undefined' && value.toString().toLowerCase() == \"true\";\n\t\t\t}, 'Para avançar tem de aceitar os Termos de Utilização');\n\n\t\t\t$(\"input[type=tel]\").on('keypress', function(e) {\n\t\t\t\tvar k = e.keyCode || e.charCode;\n\t\t\t\tvar c = e.charCode;\n\t\t\t\tvar isArrow = (c == 0 && k >= 37 && k <= 40);\n\t\t\t\tvar isSpecial = ((k == 8) || (k == 9) || (k == 127)) || isArrow || (k == 13); // backspace, tab, delete, enter\n\t\t\t\tvar isOK = ((k >= 48 && k <= 57) || k == 43); // numbers and +\n\t\t\t\treturn isOK || isSpecial;\n\t\t\t});\n\t\t},\n\n\t\t_events: function() {\n\t\t\tvar self = this;\n\t\t\tthis._on({\n\t\t\t\t\"click .btn-red\": function(e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t$(e.currentTarget).removeClass(\"btn-red\").removeClass('btn-loading');\n\t\t\t\t\tself.validator.resetForm();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tself.element.find('[data-hide-if]').each(function() {\n\t\t\t\tvar el = $(this);\n\t\t\t\t//var formData = new FormData(self.element[0]);\n\t\t\t\tvar rules = el.data('hide-if');\n\t\t\t\tObject.keys(rules).forEach(function(elementName) {\n\t\t\t\t\tvar sourceElement = self.element.find('input[name=' + elementName + ']');\n\t\t\t\t\tvar values = [];\n\t\t\t\t\tif (Array.isArray(rules[elementName]))\n\t\t\t\t\t\tvalues = rules[elementName];\n\t\t\t\t\telse\n\t\t\t\t\t\tvalues.push(rules[elementName]);\n\n\n\t\t\t\t\tfunction sourceElementAvailability() {\n\t\t\t\t\t\tvar hide = false;\n\t\t\t\t\t\tel.show();\n\t\t\t\t\t\tel.attr('disabled', false);\n\t\t\t\t\t\tel.find('input,select,textarea').attr('disabled', false);\n\n\t\t\t\t\t\tvalues.forEach(function(val) {\n\t\t\t\t\t\t\tif (!sourceElement.val() || sourceElement.val() == val)\n\t\t\t\t\t\t\t\thide = true;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tif (hide) {\n\t\t\t\t\t\t\tel.hide();\n\t\t\t\t\t\t\tel.attr('disabled', true);\n\t\t\t\t\t\t\tel.find('input,select,textarea').attr('disabled', true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tel.show();\n\t\t\t\t\t\t\tel.attr('disabled', false);\n\t\t\t\t\t\t\tel.find('input,select,textarea').attr('disabled', false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tsourceElementAvailability();\n\t\t\t\t\tsourceElement.change(sourceElementAvailability);\n\t\t\t\t});\n\t\t\t})\n\n\t\t\t//$($('[data-required-if]')[0]).data('required-if').contains('complaint')\n\t\t\tself.element.find('[data-required-if]').each(function() {\n\t\t\t\tvar el = $(this);\n\t\t\t\tvar rules = el.data('required-if'); //{\"motive\":[\"complaint\",\"denouncment\"]}\n\t\t\t\tObject.keys(rules).forEach(function(elementName) {\n\t\t\t\t\tvar sourceElement = self.element.find('input[name=' + elementName + ']');\n\n\t\t\t\t\tfunction updateRequired() {\n\t\t\t\t\t\tvar values = [];\n\n\t\t\t\t\t\tif (Array.isArray(rules[elementName]))\n\t\t\t\t\t\t\tvalues = rules[elementName];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tvalues.push(rules[elementName]);\n\n\t\t\t\t\t\tvar isRequired = values.includes(sourceElement.val());\n\n\t\t\t\t\t\tvar element = null;\n\t\t\t\t\t\tif (el.is('input,textarea,select'))\n\t\t\t\t\t\t\telement = el;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\telement = el.find('input,textarea,select');\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (element) {\n\t\t\t\t\t\t\t\tif (isRequired) {\n\t\t\t\t\t\t\t\t\telement.attr('required', true);\n\t\t\t\t\t\t\t\t\telement.rules('add', { required: true });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\telement.attr('required', false);\n\t\t\t\t\t\t\t\t\telement.rules('remove', 'required');\n\t\t\t\t\t\t\t\t\telement.valid();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (e) {\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//el.attr('data-rule-required', isRequired).attr('aria-required', isRequired);\n\t\t\t\t\t\t//el.find('input').attr('data-rule-required', isRequired).attr('aria-required', isRequired);\n\t\t\t\t\t}\n\n\t\t\t\t\tupdateRequired();\n\t\t\t\t\tsourceElement.change(updateRequired);\n\t\t\t\t});\n\n\t\t\t});\n\t\t}\n\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.googlemap', {\n\n\t\toptions: {\n\t\t\tmarkerMyLocation: \"/assets/images/my-location.png\",\n\t\t\tmarkerNewSearch: \"/assets/images/new-search.png\",\n\t\t\tstyles: [\n\t\t\t\t{ \"featureType\": \"water\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#e9e9e9\" }, { \"lightness\": 17 }] }, {\n\t\t\t\t\t\"featureType\": \"landscape\",\n\t\t\t\t\t\"elementType\": \"geometry\",\n\t\t\t\t\t\"stylers\": [{ \"color\": \"#f5f5f5\" }, { \"lightness\": 20 }]\n\t\t\t\t}, { \"featureType\": \"road.highway\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 17 }] }, {\n\t\t\t\t\t\"featureType\": \"road.highway\",\n\t\t\t\t\t\"elementType\": \"geometry.stroke\",\n\t\t\t\t\t\"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 29 }, { \"weight\": 0.2 }]\n\t\t\t\t}, { \"featureType\": \"road.arterial\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 18 }] }, {\n\t\t\t\t\t\"featureType\": \"road.local\",\n\t\t\t\t\t\"elementType\": \"geometry\",\n\t\t\t\t\t\"stylers\": [{ \"color\": \"#ffffff\" }, { \"lightness\": 16 }]\n\t\t\t\t}, { \"featureType\": \"poi\", \"elementType\": \"geometry\", \"stylers\": [{ \"color\": \"#f5f5f5\" }, { \"lightness\": 21 }] }, {\n\t\t\t\t\t\"featureType\": \"poi.park\",\n\t\t\t\t\t\"elementType\": \"geometry\",\n\t\t\t\t\t\"stylers\": [{ \"color\": \"#dedede\" }, { \"lightness\": 21 }]\n\t\t\t\t}, { \"elementType\": \"labels.text.stroke\", \"stylers\": [{ \"visibility\": \"on\" }, { \"color\": \"#ffffff\" }, { \"lightness\": 16 }] }, {\n\t\t\t\t\t\"elementType\": \"labels.text.fill\",\n\t\t\t\t\t\"stylers\": [{ \"saturation\": 36 }, { \"color\": \"#333333\" }, { \"lightness\": 40 }]\n\t\t\t\t}, { \"elementType\": \"labels.icon\", \"stylers\": [{ \"visibility\": \"off\" }] }, {\n\t\t\t\t\t\"featureType\": \"transit\",\n\t\t\t\t\t\"elementType\": \"geometry\",\n\t\t\t\t\t\"stylers\": [{ \"color\": \"#f2f2f2\" }, { \"lightness\": 19 }]\n\t\t\t\t}, { \"featureType\": \"administrative\", \"elementType\": \"geometry.fill\", \"stylers\": [{ \"color\": \"#fefefe\" }, { \"lightness\": 20 }] }, {\n\t\t\t\t\t\"featureType\": \"administrative\",\n\t\t\t\t\t\"elementType\": \"geometry.stroke\",\n\t\t\t\t\t\"stylers\": [{ \"color\": \"#fefefe\" }, { \"lightness\": 17 }, { \"weight\": 1.2 }]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\n\t\t_create: function() {\n\t\t\tthis.getMyLocation();\n\t\t},\n\t\tfocusMarkerById: function(id) {\n\t\t\tvar self = this;\n\t\t\tself.markers.forEach(function(marker) {\n\t\t\t\tif (id == marker.id) {\n\t\t\t\t\tgoogle.maps.event.trigger(marker, 'click');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tfitBounds: function() {\n\t\t\tvar self = this;\n\n\t\t\tvar bounds = new google.maps.LatLngBounds();\n\t\t\tfor (var i = 0; i < self.markers.length; i++) {\n\t\t\t\tbounds.extend(self.markers[i].getPosition());\n\t\t\t}\n\n\t\t\tself.map.fitBounds(bounds);\n\t\t},\n\t\tgetMyLocation: function() {\n\t\t\tvar self = this;\n\n\t\t\t//Default Position : Luanda\n\t\t\tself.myposition = {\n\t\t\t\tlat: -8.8535258,\n\t\t\t\tlng: 13.2140645\n\t\t\t};\n\n\t\t\tif (navigator.geolocation) {\n\t\t\t\tnavigator.geolocation.getCurrentPosition(function(position) {\n\t\t\t\t\t// console.log(position);\n\t\t\t\t\tself.myposition = {\n\t\t\t\t\t\tlat: position.coords.latitude,\n\t\t\t\t\t\tlng: position.coords.longitude\n\t\t\t\t\t};\n\t\t\t\t\tself.getAllAgencies();\n\t\t\t\t}, function(e) {\n\n\t\t\t\t\tself.getAllAgencies();\n\t\t\t\t\t// console.log('Browser has GeoLocation but something is missing...');\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// console.log('Something is missing...');\n\t\t\t}\n\n\t\t\t//if (BEC.context && BEC.context == \"ondeestamos\") {\n\t\t\tself.getAllAgencies();\n\t\t\tself.getAllLocations();\n\t\t\tself.getAllAgenciesTypes();\n\t\t\tself.mobileEvents();\n\t\t\tif (BEC.context && BEC.context == \"ondeestamos\")\n\t\t\t\tself.targetToCenterEvent();\n\n\t\t\t//};\n\t\t},\n\n\t\tgetAllAgencies: function(lat, lng) {\n\t\t\tvar self = this;\n\t\t\tvar endpoint = $(self.element).data('agencies');\n\t\t\t$.getJSON(endpoint, self.myposition, function(incoming) {\n\t\t\t\tself.options.allPoints = incoming;\n\t\t\t\tBEC.locations = incoming;\n\t\t\t\tself.locations = incoming;\n\t\t\t\tself.drawMap(self.options.allPoints);\n\t\t\t\tif (BEC.context && BEC.context == \"ondeestamos\") {\n\t\t\t\t\tself.addList(self.options.allPoints);\n\t\t\t\t\tself.searchInputEvents(self.options.allPoints);\n\t\t\t\t}\n\t\t\t\tvar myLatLon = new LatLon(self.myposition.lat, self.myposition.lng);\n\t\t\t\t$.each(self.locations, function(index, value) {\n\t\t\t\t\tvar locationLatLon = new LatLon(value.coords.lat, value.coords.lng);\n\t\t\t\t\tself.locations[index].distance = Math.round(myLatLon.distanceTo(locationLatLon));\n\t\t\t\t});\n\t\t\t\tself.locations = _.sortBy(self.locations, ['distance']);\n\t\t\t});\n\t\t},\n\n\t\tgetAllLocations: function() {\n\t\t\tvar self = this;\n\t\t\tvar endpoint = $(self.element).data('locations');\n\t\t\t$.getJSON(endpoint, function(incoming) {\n\t\t\t\tself.options.allLocations = incoming;\n\t\t\t\tif (self.options.allAgenciesTypes) {\n\t\t\t\t\tself.loadSelects();\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\tgetAllAgenciesTypes: function() {\n\t\t\tvar self = this;\n\t\t\tvar endpoint = $(self.element).data('agencies-tags');\n\t\t\t$.getJSON(endpoint, function(incoming) {\n\t\t\t\tself.options.allAgenciesTypes = incoming;\n\t\t\t\tif (self.options.allLocations) {\n\t\t\t\t\tself.loadSelects();\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\tdrawMap: function() {\n\t\t\tvar self = this;\n\n\t\t\tself.map = new google.maps.Map(document.getElementById('map__canvas'), {\n\t\t\t\tzoom: 13,\n\t\t\t\tcenter: self.myposition,\n\t\t\t\tstyles: this.options.styles,\n\t\t\t});\n\n\t\t\tself.iconMyLocation = {\n\t\t\t\turl: this.options.markerMyLocation,\n\t\t\t\tsize: new google.maps.Size(70, 70),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(35, 35)\n\t\t\t};\n\n\t\t\tself.iconNewSearch = {\n\t\t\t\turl: this.options.markerNewSearch,\n\t\t\t\tsize: new google.maps.Size(100, 100),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(50, 50)\n\t\t\t};\n\n\t\t\tself.iconMarkerAgency = {\n\t\t\t\turl: BEC.markerAgency,\n\t\t\t\tsize: new google.maps.Size(50, 70),\n\t\t\t\torigin: new google.maps.Point(0, 0),\n\t\t\t\tanchor: new google.maps.Point(30, 30)\n\t\t\t};\n\n\t\t\tself.markers = [];\n\t\t\tself.globalwindow = null;\n\t\t\tself.globalwindowMylocation = null;\n\n\t\t\tif (self.myposition) self.myLocationEvents();\n\n\t\t\tself.addMarkers();\n\t\t\tself.addClusters();\n\n\t\t\tself.map.addListener('click', function() {\n\t\t\t\tif (self.globalwindow) {\n\t\t\t\t\tself.globalwindow.close();\n\t\t\t\t}\n\t\t\t\tif (self.globalwindowMylocation) {\n\t\t\t\t\tself.globalwindowMylocation.close();\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t\tgoogle.maps.event.addListener(self.map, 'click', function(args) {\n\t\t\t\tvar closestMarker = { marker: null, distance: null };\n\n\t\t\t\tself.markers.forEach(function(marker) {\n\t\t\t\t\tvar distance = google.maps.geometry.spherical.computeDistanceBetween(marker.position, args.latLng);\n\t\t\t\t\tif (!closestMarker.marker || closestMarker.distance > distance) {\n\t\t\t\t\t\tclosestMarker.distance = distance;\n\t\t\t\t\t\tclosestMarker.marker = marker;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\tvar getClicableDistance = function(z) {\n\t\t\t\t\tvar mapClickableDistance = { 5: 132000, 8: 16000, 11: 2300, 14: 600, 19: 12 };\n\n\t\t\t\t\tvar maxKey = 5;\n\t\t\t\t\tfor (var k in mapClickableDistance) {\n\t\t\t\t\t\tk = parseInt(k);\n\t\t\t\t\t\tif (k <= z && maxKey <= k)\n\t\t\t\t\t\t\tmaxKey = k;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn mapClickableDistance[maxKey];\n\t\t\t\t}\n\n\t\t\t\tif (closestMarker.marker && closestMarker.distance < getClicableDistance(closestMarker.marker.map.zoom))\n\t\t\t\t\tgoogle.maps.event.trigger(closestMarker.marker, 'click');\n\t\t\t});\n\t\t},\n\n\t\tmyLocationEvents: function() {\n\t\t\tvar self = this;\n\n\t\t\t//customized infowindow mylocation\n\t\t\tvar contentMyLocation = '
' + BEC.dictionary[\"you-are-here\"] + '
';\n\n\t\t\tvar infowindowMyLocation = new google.maps.InfoWindow({\n\t\t\t\tcontent: contentMyLocation,\n\t\t\t\tmaxWidth: 350\n\t\t\t});\n\n\t\t\tgoogle.maps.event.addListener(infowindowMyLocation, 'domready', function() {\n\n\t\t\t\tvar iwOuter = $('.gm-style-iw');\n\t\t\t\tvar iwOuterChild = iwOuter.children(':first');\n\t\t\t\tvar iwBackground = iwOuter.prev();\n\t\t\t\tvar iwScroll = $('.info-window-container');\n\n\n\t\t\t\tiwOuter.parent().parent().css({ left: '0px' });\n\t\t\t\tiwOuter.parent().addClass('parent_infowindow-mylocation');\n\t\t\t\tiwOuterChild.css('overflow', 'inherit');\n\t\t\t\tiwScroll.css({ 'overflow': 'auto', 'max-height': '250px' });\n\t\t\t\tiwBackground.children(':nth-child(2)').css({ 'display': 'none' });\n\t\t\t\tiwBackground.children(':nth-child(4)').css({ 'display': 'none' });\n\t\t\t\tiwBackground.css({ 'z-index': '4', 'position': 'relative', 'height': '100%' });\n\t\t\t\tiwBackground.children(':nth-child(1)').attr('style', function(i, s) {\n\t\t\t\t\treturn s + 'display: none !important;'\n\t\t\t\t});\n\n\t\t\t\tiwBackground.children(':nth-child(3)').addClass('tooltip-gm-mylocation');\n\t\t\t\tiwBackground.children(':nth-child(3)').find('div').children().css({ 'display': 'none' });\n\t\t\t\tvar iwCloseBtn = iwOuter.next();\n\t\t\t\tiwCloseBtn.css('display', 'none');\n\t\t\t});\n\n\t\t\t//marker my location events\n\n\t\t\tself.markerMyLocation = new google.maps.Marker({\n\t\t\t\tposition: self.myposition,\n\t\t\t\tmap: self.map,\n\t\t\t\ticon: self.iconMyLocation\n\t\t\t});\n\n\t\t\tgoogle.maps.event.addListener(self.markerMyLocation, 'click', function() {\n\t\t\t\tif (self.globalwindow) {\n\t\t\t\t\tself.globalwindow.close();\n\t\t\t\t}\n\n\t\t\t\tinfowindowMyLocation.open(self.map, self.markerMyLocation);\n\t\t\t\tself.map.setZoom(14);\n\n\t\t\t\tself.map.panTo(self.markerMyLocation.getPosition());\n\t\t\t\tself.globalwindowMylocation = infowindowMyLocation;\n\n\t\t\t});\n\n\t\t\t//open infowindow my location\n\t\t\tgoogle.maps.event.trigger(self.markerMyLocation, 'click');\n\n\t\t},\n\n\t\taddMarkers: function() {\n\t\t\tvar self = this;\n\n\t\t\t$.each(this.options.allPoints, function(i, el) {\n\n\t\t\t\t//markers infowindow content\n\n\t\t\t\tvar centroEmpresasTag = \"\";\n\t\t\t\tvar centroPrivateTag = \"\";\n\t\t\t\tvar balcaoTag = \"\";\n\t\t\t\tvar btnCta = \"\";\n\t\t\t\tvar _tags = \"\";\n\n\t\t\t\tfor (var j = 0; j < el.tags.length; j++) {\n\n\t\t\t\t\t_tags += \"
\" + el.tagObjects[j].name + \"
\"\n\t\t\t\t}\n\n\t\t\t\tif (BEC.context && BEC.context == \"ondeestamos\") {\n\t\t\t\t\tbtnCta = ''\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tbtnCta = ''; //'
Saiba mais
'\n\t\t\t\t}\n\n\t\t\t\tvar content = '
' + _tags + '
' +\n\t\t\t\t\t'
' +\n\t\t\t\t\t'
' + el.name + '
' +\n\t\t\t\t\t'
Horário: ' + el.schedule + '
' +\n\t\t\t\t\t'
' + el.address + '
' +\n\t\t\t\t\t'Tel.: ' + el.phone + '/ Móvel: ' + el.cellphone + '' +\n\t\t\t\t\t'
Fax: ' + el.fax + '
' + btnCta +\n\t\t\t\t\t'
';\n\n\t\t\t\t//set infowindow \n\n\t\t\t\tvar infowindow = new google.maps.InfoWindow({\n\t\t\t\t\tcontent: content,\n\t\t\t\t\tmaxWidth: 350\n\n\t\t\t\t});\n\n\t\t\t\t// set / reset default styles infowindow\n\n\t\t\t\tgoogle.maps.event.addListener(infowindow, 'domready', function() {\n\n\t\t\t\t\tvar iwOuter = $('.gm-style-iw');\n\t\t\t\t\tvar iwOuterChild = iwOuter.children(':first');\n\t\t\t\t\tvar iwBackground = iwOuter.prev();\n\t\t\t\t\tvar iwScroll = $('.info-window-container');\n\n\t\t\t\t\tiwOuter.parent().parent().css({ left: '0px' });\n\t\t\t\t\tiwOuter.parent().addClass('parent_infowindow');\n\t\t\t\t\tiwOuterChild.css('overflow', 'inherit');\n\t\t\t\t\tiwScroll.css({ 'overflow': 'auto', 'max-height': '250px' });\n\t\t\t\t\tiwBackground.children(':nth-child(2)').css({ 'display': 'none' });\n\t\t\t\t\tiwBackground.children(':nth-child(4)').css({ 'display': 'none' });\n\t\t\t\t\tiwBackground.css({ 'z-index': '4', 'position': 'relative', 'height': '100%' });\n\t\t\t\t\tiwBackground.children(':nth-child(1)').attr('style', function(i, s) {\n\t\t\t\t\t\treturn s + 'display: none !important;'\n\t\t\t\t\t});\n\t\t\t\t\tiwBackground.children(':nth-child(3)').addClass('tooltip-gm');\n\t\t\t\t\t/* iwBackground.children(':nth-child(3)').attr('style', function(i, s) {\n\t\t\t\t\t return s + 'bottom:-46px; background-image: url(\"/assets/images/tooltip.png\"); width:25px; height:20px; margin-left:12px; top: initial;'\n\n\t\t\t\t\t });*/\n\t\t\t\t\tiwBackground.children(':nth-child(3)').find('div').children().css({ 'display': 'none' });\n\t\t\t\t\tvar iwCloseBtn = iwOuter.next();\n\t\t\t\t\tiwCloseBtn.addClass('map__icon-cross');\n\t\t\t\t\tiwCloseBtn.find('img').css('display', 'none');\n\t\t\t\t\t$('.info-window-container__tag-container').click(function() {\n\t\t\t\t\t\tinfowindow.close();\n\t\t\t\t\t});\n\t\t\t\t\tiwCloseBtn.click(function() {\n\t\t\t\t\t\tinfowindow.close();\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\t//set Markers\n\n\t\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\t\tposition: self.options.allPoints[i].coords,\n\t\t\t\t\tmap: self.map,\n\t\t\t\t\ticon: self.iconMarkerAgency\n\t\t\t\t});\n\n\t\t\t\tmarker.setValues({ type: \"point\", id: el.id });\n\n\t\t\t\tgoogle.maps.event.addListener(marker, 'click', function() {\n\t\t\t\t\tif (self.globalwindow) {\n\t\t\t\t\t\tself.globalwindow.close();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (self.globalwindowMylocation) {\n\t\t\t\t\t\tself.globalwindowMylocation.close();\n\t\t\t\t\t}\n\n\t\t\t\t\tinfowindow.close();\n\n\t\t\t\t\tinfowindow.open(self.map, marker);\n\t\t\t\t\tself.map.setZoom(14);\n\n\t\t\t\t\tself.map.panTo(marker.getPosition());\n\t\t\t\t\tself.globalwindow = infowindow;\n\n\t\t\t\t});\n\n\t\t\t\tself.markers.push(marker);\n\t\t\t});\n\t\t},\n\n\t\taddClusters: function() {\n\t\t\tvar self = this;\n\n\t\t\tself.mcOptions = {\n\t\t\t\tgridSize: 50,\n\t\t\t\tmaxZoom: 15,\n\t\t\t\tstyles: [{\n\t\t\t\t\tanchorText: [-8, 0],\n\t\t\t\t\twidth: 44,\n\t\t\t\t\theight: 62,\n\t\t\t\t\turl: '/assets/images/agency_cluster.png',\n\t\t\t\t\ttextColor: '#632d81',\n\t\t\t\t\ttextSize: 14\n\t\t\t\t}]\n\t\t\t};\n\n\t\t\tself.markerCluster = new MarkerClusterer(self.map, self.markers, self.mcOptions);\n\t\t\tself.markerCluster.setIgnoreHidden(true);\n\t\t},\n\n\t\taddList: function() {\n\t\t\tvar self = this;\n\t\t\tvar listContainer = $('.map-full__search__container');\n\t\t\tvar listContainerParent = $('.map__search');\n\t\t\tvar btnToggleList = $('.btn-lista');\n\n\n\t\t\tlistContainer.empty();\n\n\t\t\t$.each(this.options.allPoints, function(i, el) {\n\t\t\t\tvar listItem = \"\";\n\t\t\t\tvar _tags = \"\";\n\t\t\t\tvar btnCta = \"\";\n\n\t\t\t\tfor (var j = 0; j < el.tags.length; j++) {\n\t\t\t\t\tif (el.tagObjects)\n\t\t\t\t\t\t_tags += \"
\" + el.tagObjects[j].name + \"
\"\n\t\t\t\t\t// console.log(_tags)\n\t\t\t\t}\n\t\t\t\tif (BEC.context && BEC.context == \"ondeestamos\") {\n\t\t\t\t\tbtnCta = ''\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tbtnCta = ''; //'
Saiba mais
'\n\t\t\t\t}\n\n\t\t\t\tlistItem = $(\"
\" + _tags + \"
\" + el.name + \"
Horário: \" + el.schedule + \"
\" + el.address + \"
Tel.: \" + el.phone + \"/ Móvel: \" + el.cellphone + \"
Fax: \" + el.fax + \"
\" + btnCta + \"
\");\n\n\t\t\t\tlistItem.click(function() {\n\n\t\t\t\t\tlistContainerParent.removeClass('opened');\n\t\t\t\t\tbtnToggleList.find('span').html('Ver em lista');\n\n\n\t\t\t\t\tfor (var j = 0; j < self.options.allPoints.length; j++) {\n\t\t\t\t\t\tif (self.markers[j].id == el.id) {\n\t\t\t\t\t\t\tgoogle.maps.event.trigger(self.markers[j], 'click');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t});\n\n\t\t\t\tlistContainer.append(listItem);\n\n\t\t\t\tif (i == self.options.allPoints.length - 3) {\n\t\t\t\t\tself.myScroll = new IScroll('.map__search', {\n\t\t\t\t\t\tmouseWheel: true,\n\t\t\t\t\t\tscrollbars: false\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\n\n\n\t\t},\n\n\t\tloadSelects: function() {\n\t\t\tvar self = this;\n\n\n\t\t\t//setup locations Select\n\t\t\tvar locationsSelectContainer = $('.map-full__filters-container__menu__select.location');\n\t\t\tself.locationsSelectTrigger = $('.map-full__filters-container__menu__item.location');\n\n\t\t\tvar allLocationsItem = $('.form-datalist-item.all-locations');\n\t\t\tallLocationsItem.click(function() {\n\t\t\t\tvar _this = $(this);\n\t\t\t\tself.locationsSelectTrigger.find('span').html(self.locationsSelectTrigger.find('span').data('name'));\n\t\t\t\tself.locationsSelectTrigger.find('span').data('id', _this.data('id'));\n\n\t\t\t\tif (window.innerWidth > 960) {\n\t\t\t\t\tself.filterLists(\"\", \"tag=\" + self.agenciesSelectTrigger.find('span').data('id'));\n\n\t\t\t\t}\n\n\t\t\t\tself.locationsSelectTrigger.removeClass('opened');\n\t\t\t\tlocationsSelectContainer.removeClass('opened');\n\t\t\t});\n\n\n\t\t\t$.each(this.options.allLocations, function(i, el) {\n\n\t\t\t\tvar selectItem = $(\"
\" + el.name + \"
\");\n\n\t\t\t\tselectItem.click(function() {\n\n\t\t\t\t\tself.locationsSelectTrigger.find('span').html(el.name);\n\t\t\t\t\tself.locationsSelectTrigger.find('span').data('id', el.id);\n\n\t\t\t\t\tif (window.innerWidth > 960) {\n\t\t\t\t\t\tself.filterLists(\"location=\" + el.id, \"&tag=\" + self.agenciesSelectTrigger.find('span').data('id'));\n\t\t\t\t\t\tif (i == self.options.allLocations.length - 1) {\n\t\t\t\t\t\t\tself.myScroll = new IScroll('.map-full__filters-container__menu__select.location', {\n\t\t\t\t\t\t\t\tmouseWheel: true,\n\t\t\t\t\t\t\t\tscrollbars: false\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tself.locationsSelectTrigger.removeClass('opened');\n\t\t\t\t\tlocationsSelectContainer.removeClass('opened');\n\t\t\t\t});\n\n\t\t\t\tlocationsSelectContainer.find('.form-datalist__options').append(selectItem);\n\t\t\t});\n\n\t\t\tself.locationsSelectTrigger.click(function() {\n\t\t\t\tself.locationsSelectTrigger.toggleClass('opened');\n\t\t\t\tlocationsSelectContainer.toggleClass('opened');\n\t\t\t\tagenciesSelectContainer.removeClass('opened');\n\t\t\t\tself.agenciesSelectTrigger.removeClass('opened');\n\n\t\t\t});\n\n\t\t\t//setup agencies Select\n\t\t\tvar agenciesSelectContainer = $('.map-full__filters-container__menu__select.agencies');\n\t\t\tself.agenciesSelectTrigger = $('.map-full__filters-container__menu__item.agencies');\n\n\t\t\tvar allAgenciesItem = $('.form-datalist-item.all-agencies');\n\t\t\tallAgenciesItem.click(function() {\n\t\t\t\tvar _this = $(this);\n\t\t\t\tself.agenciesSelectTrigger.find('span').html(self.agenciesSelectTrigger.find('span').data('name'));\n\t\t\t\tself.agenciesSelectTrigger.find('span').data('id', _this.data('id'));\n\n\t\t\t\tif (window.innerWidth > 960) {\n\t\t\t\t\tself.filterLists(\"location=\" + self.locationsSelectTrigger.find('span').data('id'), \"\");\n\t\t\t\t}\n\n\t\t\t\tself.agenciesSelectTrigger.removeClass('opened');\n\t\t\t\tagenciesSelectContainer.removeClass('opened');\n\t\t\t});\n\n\t\t\t$.each(this.options.allAgenciesTypes, function(i, el) {\n\n\t\t\t\tvar selectItem = $(\"
\" + el.name + \"
\");\n\n\n\t\t\t\tselectItem.click(function() {\n\n\t\t\t\t\tself.agenciesSelectTrigger.find('span').html(el.name);\n\t\t\t\t\tself.agenciesSelectTrigger.find('span').data('id', el.id);\n\n\t\t\t\t\tif (window.innerWidth > 960) {\n\t\t\t\t\t\tself.filterLists(\"location=\" + self.locationsSelectTrigger.find('span').data('id'), \"&tag=\" + el.id);\n\t\t\t\t\t}\n\n\t\t\t\t\tself.agenciesSelectTrigger.removeClass('opened');\n\t\t\t\t\tagenciesSelectContainer.removeClass('opened');\n\t\t\t\t});\n\n\n\t\t\t\tagenciesSelectContainer.find('.form-datalist__options').append(selectItem);\n\t\t\t});\n\n\t\t\tself.agenciesSelectTrigger.click(function() {\n\t\t\t\tself.agenciesSelectTrigger.toggleClass('opened');\n\t\t\t\tagenciesSelectContainer.toggleClass('opened');\n\t\t\t\tlocationsSelectContainer.removeClass('opened');\n\t\t\t\tself.locationsSelectTrigger.removeClass('opened');\n\n\t\t\t});\n\t\t},\n\n\t\trefreshListScroll: function() {\n\t\t\tvar self = this;\n\t\t\tsetTimeout(function() {\n\t\t\t\tself.myScroll.refresh();\n\n\t\t\t}, 300);\n\t\t},\n\n\n\t\tfilterLists: function(filter, secondFilter) {\n\n\t\t\t// console.log(filter, secondFilter)\n\t\t\tvar self = this;\n\t\t\tvar listContainer = $('.map-full__search__container');\n\t\t\tvar allItems = listContainer.find('.map-full__search__container__item');\n\n\t\t\tallItems.removeClass('hide');\n\n\t\t\tvar filterCoordinates = '';\n\t\t\tif (self.myposition && self.myposition.lng && self.myposition.lat)\n\t\t\t\tfilterCoordinates = '&lat=' + self.myposition.lat + '&lng=' + self.myposition.lng;\n\t\t\tvar endpoint = $(self.element).data('agencies') + \"?\" + filter + secondFilter + filterCoordinates;\n\n\t\t\t$.getJSON(endpoint, function(incoming) {\n\t\t\t\tself.options.allPoints = incoming;\n\t\t\t\tBEC.locations = incoming;\n\t\t\t\tself.locations = incoming;\n\t\t\t\tself.drawMap(self.options.allPoints);\n\t\t\t\tif (BEC.context && BEC.context == \"ondeestamos\") {\n\t\t\t\t\tself.addList(self.options.allPoints);\n\t\t\t\t\tself.searchInputEvents(self.options.allPoints);\n\t\t\t\t}\n\t\t\t\tvar myLatLon = new LatLon(self.myposition.lat, self.myposition.lng);\n\t\t\t\t$.each(self.locations, function(index, value) {\n\t\t\t\t\tvar locationLatLon = new LatLon(value.coords.lat, value.coords.lng);\n\t\t\t\t\tself.locations[index].distance = Math.round(myLatLon.distanceTo(locationLatLon));\n\t\t\t\t});\n\t\t\t\tself.locations = _.sortBy(self.locations, ['distance']);\n\t\t\t});\n\n\t\t\tself.selectedFirstFilter = filter;\n\t\t\tself.selectedSecondFilter = secondFilter;\n\n\t\t\tself.refreshListScroll();\n\t\t},\n\n\t\ttargetToCenterEvent: function() {\n\t\t\tvar btnTarget = $('.target-icon');\n\t\t\tvar self = this;\n\t\t\tbtnTarget.click(function() {\n\t\t\t\tself.map.panTo(self.myposition);\n\t\t\t\tgoogle.maps.event.trigger(self.markerMyLocation, 'click');\n\t\t\t\tif (self.filtersMobileContainer) {\n\t\t\t\t\tself.filtersMobileContainer.removeClass('opened');\n\t\t\t\t}\n\t\t\t});\n\n\n\t\t},\n\n\t\tsearchInputEvents: function() {\n\t\t\tvar self = this;\n\t\t\tvar input = document.getElementById('search-map-input');\n\t\t\tvar inputMobile = document.getElementById('search-map-input_mobile');\n\t\t\tvar newMarker;\n\n\t\t\tvar autocomplete = new google.maps.places.Autocomplete(input, {\n\t\t\t\ttypes: ['geocode'],\n\t\t\t\tstrictBounds: true\n\t\t\t});\n\n\t\t\tvar autocompleteMobile = new google.maps.places.Autocomplete(inputMobile, {\n\t\t\t\ttypes: ['geocode'],\n\t\t\t\tstrictBounds: true\n\t\t\t});\n\n\t\t\tautocomplete.bindTo('bounds', self.map);\n\t\t\tautocompleteMobile.bindTo('bounds', self.map);\n\n\n\t\t\tautocomplete.addListener('place_changed', function() {\n\t\t\t\tif (newMarker) {\n\t\t\t\t\tnewMarker.setVisible(false);\n\t\t\t\t\tnewMarker.setMap(null);\n\t\t\t\t\tif (self.globalwindow) {\n\t\t\t\t\t\tself.globalwindow.close();\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tvar place = autocomplete.getPlace();\n\n\n\t\t\t\tif (!place.geometry) {\n\n\t\t\t\t\t// window.alert(\"No details available for input: '\" + place.name + \"'\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar newPosition = place.geometry.location;\n\n\t\t\t\tnewMarker = new google.maps.Marker({\n\t\t\t\t\tposition: newPosition,\n\t\t\t\t\tmap: self.map,\n\t\t\t\t\ticon: self.iconNewSearch\n\t\t\t\t});\n\n\t\t\t\tself.agenciesSelectTrigger.find('span').html(self.agenciesSelectTrigger.find('span').data('name'));\n\t\t\t\tself.agenciesSelectTrigger.find('span').data('id', \"\");\n\t\t\t\tself.locationsSelectTrigger.find('span').html(self.locationsSelectTrigger.find('span').data('name'));\n\t\t\t\tself.locationsSelectTrigger.find('span').data('id', \"\");\n\n\n\t\t\t\tself.filterLists(\"\", \"\");\n\n\n\t\t\t\tvar myLatLon = new LatLon(place.geometry.location.lat(), place.geometry.location.lng());\n\t\t\t\t$.each(self.locations, function(index, value) {\n\t\t\t\t\tvar locationLatLon = new LatLon(value.coords.lat, value.coords.lng);\n\t\t\t\t\tself.locations[index].distance = Math.round(myLatLon.distanceTo(locationLatLon));\n\t\t\t\t});\n\t\t\t\tvar closestLocation = _.sortBy(self.locations, ['distance']);\n\t\t\t\tself.options.allPoints = _.sortBy(self.locations, ['distance']);\n\n\t\t\t\tself.addList(self.options.allPoints);\n\n\n\t\t\t\tvar indexOfClosestLocation = closestLocation[0].id;\n\n\n\t\t\t\tgoogle.maps.event.trigger(self.markers[indexOfClosestLocation - 1], 'click');\n\n\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tif (place.geometry.viewport) {\n\t\t\t\t\t\tself.map.fitBounds(place.geometry.viewport);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tself.map.setCenter(place.geometry.location);\n\t\t\t\t\t\tself.map.setZoom(17);\n\t\t\t\t\t}\n\t\t\t\t}, 800)\n\n\n\t\t\t});\n\n\n\t\t\tautocompleteMobile.addListener('place_changed', function() {\n\n\t\t\t\tif (newMarker) {\n\t\t\t\t\tnewMarker.setVisible(false);\n\t\t\t\t\tnewMarker.setMap(null);\n\t\t\t\t};\n\n\t\t\t\tif (self.globalwindow) {\n\t\t\t\t\tself.globalwindow.close();\n\t\t\t\t}\n\n\t\t\t\tvar place = autocompleteMobile.getPlace();\n\t\t\t\tif (!place.geometry) {\n\n\t\t\t\t\twindow.alert(\"No details available for input: '\" + place.name + \"'\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (place.geometry.viewport) {\n\t\t\t\t\tself.map.fitBounds(place.geometry.viewport);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself.map.setCenter(place.geometry.location);\n\t\t\t\t\tself.map.setZoom(17);\n\t\t\t\t}\n\n\t\t\t\tvar newPosition = place.geometry.location;\n\n\t\t\t\tnewMarker = new google.maps.Marker({\n\t\t\t\t\tposition: newPosition,\n\t\t\t\t\tmap: self.map,\n\t\t\t\t\ticon: self.iconNewSearch\n\t\t\t\t});\n\n\t\t\t\tif (self.filtersMobileContainer) {\n\t\t\t\t\tself.filtersMobileContainer.removeClass('opened');\n\t\t\t\t}\n\n\n\t\t\t\tif ($('.map__search').hasClass('opened')) {\n\n\t\t\t\t\t$('.map__search').removeClass('opened')\n\t\t\t\t\t$('.btn-lista').find('span').html('Ver em lista');\n\n\t\t\t\t\tself.refreshListScroll();\n\t\t\t\t}\n\n\n\t\t\t\tself.agenciesSelectTrigger.find('span').html(self.agenciesSelectTrigger.find('span').data('name'));\n\t\t\t\tself.agenciesSelectTrigger.find('span').data('id', \"\");\n\t\t\t\tself.locationsSelectTrigger.find('span').html(self.locationsSelectTrigger.find('span').data('name'));\n\t\t\t\tself.locationsSelectTrigger.find('span').data('id', \"\");\n\n\n\t\t\t\tself.filterLists(\"\", \"\");\n\n\n\t\t\t\tvar myLatLon = new LatLon(place.geometry.location.lat(), place.geometry.location.lng());\n\t\t\t\t$.each(self.locations, function(index, value) {\n\t\t\t\t\tvar locationLatLon = new LatLon(value.coords.lat, value.coords.lng);\n\t\t\t\t\tself.locations[index].distance = Math.round(myLatLon.distanceTo(locationLatLon));\n\t\t\t\t});\n\t\t\t\tvar closestLocation = _.sortBy(self.locations, ['distance']);\n\t\t\t\tself.options.allPoints = _.sortBy(self.locations, ['distance']);\n\n\t\t\t\tself.addList(self.options.allPoints);\n\n\t\t\t\tvar indexOfClosestLocation = closestLocation[0].id;\n\n\t\t\t\tgoogle.maps.event.trigger(self.markers[indexOfClosestLocation - 1], 'click');\n\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tif (place.geometry.viewport) {\n\t\t\t\t\t\tself.map.fitBounds(place.geometry.viewport);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tself.map.setCenter(place.geometry.location);\n\t\t\t\t\t\tself.map.setZoom(17);\n\t\t\t\t\t}\n\t\t\t\t}, 800)\n\t\t\t});\n\n\t\t},\n\n\t\tmobileEvents: function() {\n\n\t\t\tvar self = this;\n\t\t\t//list events\n\t\t\tvar btnToggleList = $('.btn-lista');\n\t\t\tvar listContainer = $('.map__search');\n\n\t\t\tbtnToggleList.click(function() {\n\t\t\t\tlistContainer.toggleClass('opened');\n\t\t\t\tif (listContainer.hasClass('opened')) {\n\t\t\t\t\tbtnToggleList.find('span').html('Ver no mapa');\n\n\t\t\t\t\tself.refreshListScroll();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tbtnToggleList.find('span').html('Ver em lista');\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t//Filters events\n\t\t\tvar btnToggleFilters = $('.map-full__filters-container .map-full__filters-container__mobile-placeholder');\n\t\t\tself.filtersMobileContainer = $('.map-full__filters-container__mobile-modal');\n\t\t\tvar btnCancel = '
Cancelar
';\n\t\t\tvar btnApplyFilters = '
Aplicar Filtros
';\n\n\n\t\t\t$('.map-full__filters-container').clone().appendTo(self.filtersMobileContainer);\n\n\t\t\tvar btnToggleFiltersOpened = self.filtersMobileContainer.find('.map-full__filters-container__mobile-placeholder');\n\n\t\t\t$(\"#search-map-input\").attr('id', 'search-map-input_mobile');\n\n\t\t\tself.filtersMobileContainer.append(btnCancel);\n\t\t\tself.filtersMobileContainer.append(btnApplyFilters);\n\n\n\t\t\tbtnCancel = self.filtersMobileContainer.find('.btn-cancel');\n\t\t\tbtnApplyFilters = self.filtersMobileContainer.find('.btn-apply');\n\n\n\t\t\tbtnToggleFilters.click(function() {\n\t\t\t\tself.filtersMobileContainer.addClass('opened');\n\t\t\t});\n\n\t\t\tbtnToggleFiltersOpened.click(function() {\n\t\t\t\tself.filtersMobileContainer.removeClass('opened');\n\t\t\t});\n\n\n\t\t\tbtnCancel.click(function() {\n\t\t\t\tself.filtersMobileContainer.removeClass('opened');\n\n\t\t\t\tself.locationsSelectTrigger.find('span').html(self.selectedFirstFilter);\n\t\t\t\tself.agenciesSelectTrigger.find('span').html(self.selectedSecondFilter)\n\t\t\t});\n\n\t\t\tbtnApplyFilters.click(function() {\n\t\t\t\tself.filtersMobileContainer.removeClass('opened');\n\t\t\t\tself.filterLists(\"location=\" + self.locationsSelectTrigger.find('span').html(), \"&tag=\" + self.agenciesSelectTrigger.find('span').html());\n\t\t\t});\n\n\t\t}\n\n\n\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.menu', {\n\n\t\toptions: {\n\t\t\tmenuType: null,\n\t\t\tmobileMenuWidth: null,\n\t\t\tmobileMenuOffset: 50,\n\t\t\tcurrentDesktopLevel1: null,\n\t\t\tcurrentMobileLevel2: null,\n\t\t\tcurrentScroll: 0,\n\t\t\tanimateSpeed: 800,\n\t\t\tdefaultOption: null,\n\t\t\tmobileItemsLeftPosition: [],\n\t\t\tsearchTimeout: null,\n\t\t\tel: {}\n\t\t},\n\n\t\t_create: function() {\n\t\t\t$.fx.speeds._default = 300;\n\t\t\tvar self = this;\n\t\t\t/**/\n\t\t\tthis.options.el.body = $(\"body\");\n\t\t\tthis.options.el.menu = $(\".menu\");\n\t\t\tthis.options.el.menuDouble = $(\".menu__double\");\n\t\t\tthis.options.el.logo = $(\".menu__logo\");\n\t\t\tthis.options.el.level1 = $(\".menu__level1\");\n\t\t\tthis.options.el.level1Options = $(\".menu__level1__options\");\n\t\t\tthis.options.el.level2 = $(\".menu__level2\");\n\t\t\tthis.options.el.level2Holder = $(\".menu__level2__holder\");\n\t\t\tthis.options.el.level2Options = $(\".menu__level2__options\");\n\t\t\tthis.options.el.level3 = $(\".menu__level3\");\n\t\t\tthis.options.el.level3Holder = $(\".menu__level3__holder\");\n\t\t\tthis.options.el.level3Links = $(\".menu__level3__links\");\n\t\t\tthis.options.el.level3Options = $(\".menu__level3__options\");\n\t\t\tthis.options.el.mobileContainer = $(\".menu__mobile__container\");\n\t\t\tthis.options.el.magnifier = $(\".icon-magnifier\");\n\t\t\tthis.options.el.searchBar = $(\".menu__level2__searchbar\");\n\t\t\tthis.options.el.searchField = $(\"#search\");\n\t\t\tthis.options.el.searchLabel = $(\".menu__level3__search-label\");\n\t\t\tthis.options.el.burguer = $(\".icon-burguer\");\n\t\t\tthis.options.defaultOption = $(\".menu__level1__options\").data('default-position');\n\t\t\tthis.options.el.btnDropdown = $('.menu__form__toggle-list');\n\t\t\tthis.options.el.dropdownList = $('.js-menu-list');\n\t\t\tthis.options.el.formNet = $('.menu__form__container');\n\t\t\t/**/\n\t\t\tthis._setMenuType();\n\t\t\tthis._checkScroll();\n\t\t\tthis._commonEvents();\n\t\t\tthis._toggleList();\n\t\t\tthis._formNet();\n\t\t\t$(window).resize(function() {\n\t\t\t\tself._setMenuType();\n\t\t\t});\n\t\t\t$(window).scroll(function() {\n\t\t\t\tself._checkScroll();\n\t\t\t\tif (self.options.el.body.hasClass('goingDown')) {\n\t\t\t\t\tself.options.el.dropdownList.hide()\n\t\t\t\t\tself.options.el.btnDropdown.removeClass('open')\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis._mobileEventsInit();\n\t\t\t//console.log('create');\n\t\t},\n\n\t\t_commonEvents: function() {\n\t\t\tvar self = this;\n\t\t\tthis.options.el.magnifier.click(function() {\n\t\t\t\tif ($(this).hasClass(\"cross\")) {\n\t\t\t\t\t$('body').removeClass('searchOpened');\n\t\t\t\t\tself._closeSearchBar(self.options.menuType);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself._openSearchBar(self.options.menuType);\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t_desktopEvents: function() {\n\t\t\t//console.log(\"_desktopEvents\");\n\t\t\tvar self = this;\n\t\t\t/**/\n\t\t\tthis.options.el.level1Options.on(\"click\", \"span\", function(e) {\n\t\t\t\tvar position = $(e.currentTarget).index() + 1;\n\t\t\t\tself._setDesktopMenuLevel1(position, true);\n\n\t\t\t\tvar href = $(e.currentTarget).data(\"href\");\n\t\t\t\tif (href && href != window.location.pathname)\n\t\t\t\t\twindow.location.href = href;\n\t\t\t});\n\t\t\t/**/\n\t\t\tthis.options.el.level2Holder.find(\"li a\").hoverIntent(function(e) {\n\t\t\t\tvar me = $(e.currentTarget);\n\t\t\t\tvar myLevel1 = me.closest(\".menu__level2__options\").index();\n\t\t\t\tvar myLevel2 = me.closest(\"li\").index();\n\t\t\t\tself._showDesktopMenuLevel2(myLevel1 + 1, myLevel2 + 1);\n\t\t\t}, function() {}, {\n\t\t\t\tinterval: 300\n\t\t\t});\n\t\t\t/**/\n\t\t\tthis.options.el.level2Holder.hoverIntent(function() {}, function() {\n\t\t\t\tself._handleMenuMouseLeave(\"level2holder\");\n\t\t\t});\n\t\t\t/**/\n\t\t\tthis.options.el.level3.hover(function() {\n\t\t\t\t$(this).addClass(\"hovered\");\n\t\t\t}, function() {\n\t\t\t\t$(this).removeClass(\"hovered\");\n\t\t\t});\n\t\t\t/**/\n\t\t\tthis.options.el.menu.hoverIntent(function() {}, function() {\n\t\t\t\tself._handleMenuMouseLeave(\"menu\");\n\t\t\t});\n\t\t\t/**/\n\t\t\tthis.options.el.searchField.on(\"keyup\", function() {\n\t\t\t\tclearTimeout(self.options.searchTimeout);\n\t\t\t\tself.options.searchTimeout = setTimeout(self._doSearch.bind(self), 600);\n\t\t\t})\n\t\t},\n\n\t\t_closeMenuDouble: function() {\n\t\t\t$(\".menu__double\").removeClass(\"card-opened net-opened\");\n\t\t\t$(\".menu__double__body\").fadeOut();\n\t\t},\n\n\t\t_mobileEvents: function() {\n\t\t\t//console.log(\"_mobileEvents\");\n\t\t\tvar self = this;\n\n\t\t\tthis.options.el.searchField.on(\"keyup\", function() {\n\t\t\t\t$('body').addClass('searchOpened');\n\t\t\t\tclearTimeout(self.options.searchTimeout);\n\t\t\t\tself.options.searchTimeout = setTimeout(self._doSearch.bind(self), 600);\n\t\t\t});\n\n\t\t\t$(\".menu__double__card\").click(function() {\n\t\t\t\tif ($(\".menu__double\").hasClass(\"card-opened\")) {\n\t\t\t\t\tself._closeMenuDouble();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$(\".menu__double\").removeClass(\"net-opened\").addClass(\"card-opened\");\n\t\t\t\t\t$(\".menu__double__body-net\").hide();\n\t\t\t\t\t$(\".menu__double__body-card\").show();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t$(\".menu__double__net\").click(function() {\n\t\t\t\tif ($(\".menu__double\").hasClass(\"net-opened\")) {\n\t\t\t\t\tself._closeMenuDouble();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$(\".menu__double\").removeClass(\"card-opened\").addClass(\"net-opened\");\n\t\t\t\t\t$(\".menu__double__body-card\").hide();\n\t\t\t\t\t$(\".menu__double__body-net\").show();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.options.el.burguer.click(function() {\n\t\t\t\tself._openMobileMenu();\n\t\t\t});\n\n\t\t\t$(\".close-mobile-menu\").click(function() {\n\t\t\t\tself._closeMobileMenu();\n\t\t\t});\n\t\t\t/**/\n\n\t\t\tthis.options.el.level1Options.on(\"click\", \"span\", function(e) {\n\t\t\t\tvar level1 = $(e.currentTarget).index() + 1;\n\t\t\t\tself._openMobileMenuLevel1(level1);\n\t\t\t\t//console.log('level1Options:click');\n\t\t\t});\n\t\t\t/**/\n\t\t\tthis.options.el.level1Options.draggable({\n\t\t\t\taxis: \"x\",\n\t\t\t\tstart: function(event, ui) {\n\t\t\t\t\tself.options.el.level1Options.stop();\n\t\t\t\t\tself.options.mobileItemsLeftPosition = [];\n\t\t\t\t\t$(\".menu__level1__options.ui-draggable\").find(\"> span\").each(function() {\n\t\t\t\t\t\tvar left = parseInt($(this).position().left);\n\t\t\t\t\t\tself.options.mobileItemsLeftPosition.push(left);\n\t\t\t\t\t});\n\t\t\t\t\tself.options.mobileMenuWidth = self.options.el.level1Options.width();\n\t\t\t\t},\n\t\t\t\tdrag: function(event, ui) {\n\t\t\t\t\t//console.log(ui.position);\n\t\t\t\t\tvar rightLimit = -self.options.mobileMenuWidth + 100;\n\t\t\t\t\tif (ui.position.left < rightLimit) {\n\t\t\t\t\t\tui.position.left = rightLimit\n\t\t\t\t\t}\n\t\t\t\t\tif (ui.position.left > self.options.mobileMenuOffset) {\n\t\t\t\t\t\tui.position.left = self.options.mobileMenuOffset\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tstop: function(event, ui) {\n\t\t\t\t\tvar realMenuLeft = Math.abs(ui.position.left - 50);\n\t\t\t\t\tvar droppedIndex = self.options.mobileItemsLeftPosition.findIndex(function(value) {\n\t\t\t\t\t\treturn (value + 30) >= realMenuLeft;\n\t\t\t\t\t});\n\t\t\t\t\tself._openMobileMenuLevel1(droppedIndex + 1);\n\t\t\t\t\t// \tif (ui.position.left > self.options.mobileMenuOffset) {\n\t\t\t\t\t// \t\t$(\".menu__level1__options\").animate({\n\t\t\t\t\t// \t\t\tleft: self.options.mobileMenuOffset\n\t\t\t\t\t// \t\t}, self.options.animateSpeed)\n\t\t\t\t\t// \t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t},\n\n\t\t_mobileEventsInit: function() {\n\t\t\tvar self = this;\n\t\t\t/**/\n\t\t\tthis.options.el.mobileContainer.on(\"click\", \".inline-list.level2 > li > a\", function(e) {\n\t\t\t\te.preventDefault();\n\t\t\t\t//console.log('mobileContainer:click');\n\t\t\t\tvar level1 = self.options.el.level1Options.find(\"span.active\").index() + 1;\n\t\t\t\tvar level2 = $(e.currentTarget).closest(\"li\").index() + 1;\n\n\t\t\t\tif ($(e.currentTarget).parent().hasClass('active')) {\n\t\t\t\t\tself.options.el.mobileContainer.find(\".active\").removeClass(\"active\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself.options.el.mobileContainer.find(\".active\").removeClass(\"active\");\n\t\t\t\t\t$(e.currentTarget).closest(\"li\").addClass('active').index() + 1;\n\t\t\t\t}\n\n\t\t\t\tvar whereTo = $(e.currentTarget).closest(\"li\");\n\n\t\t\t\tself._openMobileMenuLevel2(level1, level2, whereTo);\n\n\t\t\t\tif (!$(e.currentTarget).hasClass('hasSubOptions')) {\n\t\t\t\t\tvar href = $(e.currentTarget).attr('href');\n\t\t\t\t\tif (href)\n\t\t\t\t\t\twindow.location.href = href;\n\t\t\t\t}\n\t\t\t\telse if ($(this).attr('href') && self.options && $(this).attr('href') != 'javascript:void(0)') {\n\t\t\t\t\tself.options.targetHref = $(this).attr('href');\n\t\t\t\t\t//console.log(\"options.targetHref = \" + self.options.targetHref);\n\t\t\t\t}\n\t\t\t});\n\n\t\t},\n\n\t\t_setMenuType: function() {\n\t\t\t//console.log(\"_setMenuType\", window.innerWidth);\n\t\t\tvar self = this;\n\t\t\tif (window.innerWidth < 960) {\n\t\t\t\tif (this.options.menuType !== \"mobile\") {\n\t\t\t\t\t$(\"body\").removeClass(\"menuDesktop desktopScrolling \").addClass(\"menuMobile\");\n\t\t\t\t\tthis.options.menuType = \"mobile\";\n\t\t\t\t\tthis._clearAllEvents();\n\t\t\t\t\tthis._mobileEvents();\n\t\t\t\t\tthis._checkScroll();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar active = this.options.el.level1Options.find(\"span.active\");\n\t\t\t\tif (active.length === 0) {\n\t\t\t\t\t// setTimeout(function () {\n\t\t\t\t\t// \tself.options.el.level1Options.find(\"span\").eq(self.options.defaultOption - 1).trigger(\"click\");\n\t\t\t\t\t// }, 300);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//active.trigger(\"click\");\n\t\t\t\t\tthis._setDesktopMenuLevel1(self.options.defaultOption);\n\t\t\t\t}\n\t\t\t\tif (this.options.menuType !== \"desktop\") {\n\t\t\t\t\t$(\"body\").removeClass(\"menuMobile mobileScrolling\").addClass(\"menuDesktop\");\n\t\t\t\t\tthis.options.menuType = \"desktop\";\n\t\t\t\t\tthis._clearAllEvents();\n\t\t\t\t\tthis._desktopEvents();\n\t\t\t\t\tthis._checkScroll();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t_checkScroll: function() {\n\t\t\tvar scrollPage = $(window).scrollTop();\n\t\t\tif (this.options.currentScroll > scrollPage) {\n\t\t\t\t$(\"body\").removeClass(\"goingDown\").addClass(\"goingUp\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$(\"body\").removeClass(\"goingUp\").addClass(\"goingDown\");\n\t\t\t}\n\t\t\tif (scrollPage > 50) {\n\t\t\t\tif (this.options.el.body.hasClass(\"menuDesktop\")) {\n\t\t\t\t\tthis.options.el.body.addClass(\"desktopScrolling\");\n\t\t\t\t}\n\t\t\t\telse if ($(\"body\").hasClass(\"menuMobile\")) {\n\t\t\t\t\t//this.options.el.body.addClass(\"mobileScrolling\");\n\t\t\t\t\t//this._closeMenuDouble();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tthis.options.currentScroll = scrollPage;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$(\"body\").removeClass(\"mobileScrolling desktopScrolling\");\n\t\t\t}\n\t\t},\n\n\t\t_setDesktopMenuLevel1: function(position, isFromClick) {\n\t\t\t//console.log(\"_setDesktopMenuLevel1\", position);\n\t\t\tthis.options.el.level1Options.find(\"span\").removeClass(\"active\").eq(position - 1).addClass(\"active\");\n\t\t\tvar markerLeft = this.options.el.level1Options.find(\"span.active\").position().left;\n\t\t\tvar markerWidth = this.options.el.level1Options.find(\"span.active\").outerWidth();\n\t\t\tthis.options.el.level3.fadeOut();\n\t\t\tvar animationTime = isFromClick ? .4 : 0;\n\t\t\tTweenMax.to(\".marker\", animationTime, {\n\t\t\t\tleft: markerLeft,\n\t\t\t\twidth: markerWidth,\n\t\t\t\tease: Power1.easeInOut\n\t\t\t});\n\t\t\tif (position !== this.currentDesktopLevel1) {\n\t\t\t\tthis.currentDesktopLevel1 = position;\n\t\t\t\tthis.options.el.level2Holder.find(\".menu__level2__options\").hide(0).eq(position - 1).fadeIn(300);\n\t\t\t}\n\t\t\tthis._closeSearchBar(this.options.menuType);\n\t\t},\n\n\t\t_openMobileMenuLevel1: function(position) {\n\t\t\t// var currentLevel1 = this.options.el.level1Options.find(\"span.active\").index() + 1;\n\t\t\t// if (position !== currentLevel1 || this.options.el.mobileContainer.text() === '') {\n\t\t\t//console.log(\"_openMobileMenuLevel1\", position);\n\t\t\tthis.options.el.level1Options.find(\"span\").removeClass(\"active\").eq(position - 1).addClass(\"active\");\n\t\t\tvar activeLeftPosition = this.options.el.level1Options.find(\"span.active\").position().left;\n\t\t\tvar nextOptions = $(\".menu__level2__holder\").find(\".menu__level2__options\").eq(position - 1).find(\"ul.inline-list\").clone().addClass(\"level2\");\n\t\t\tthis.options.el.mobileContainer.empty().append(nextOptions);\n\t\t\t$(\".menu__level1__options\").stop().animate({\n\t\t\t\tleft: -activeLeftPosition + this.options.mobileMenuOffset\n\t\t\t}, this.options.animateSpeed, \"easeOutQuad\");\n\n\t\t\tthis.options.targetHref = this.options.el.level1Options.find(\"span.active\").data('href');\n\t\t\t//console.log(\"options.targetHref = \" + this.options.targetHref);\n\t\t},\n\n\t\t_showDesktopMenuLevel2: function(level1, level2) {\n\t\t\t//console.log('_showDesktopMenuLevel2', level1, level2);\n\t\t\tthis.options.el.level3Options.hide(0);\n\t\t\tvar level2Items = this.options.el.level3Options.filter(\"[data-level1='\" + level1 + \"'][data-level2='\" + level2 + \"']\");\n\t\t\tthis.options.el.level2.addClass(\"filled\");\n\t\t\tif (level2Items.length === 0) {\n\t\t\t\tthis.options.el.level3.fadeOut();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.options.el.level3.fadeIn();\n\t\t\t\tlevel2Items.fadeIn();\n\t\t\t}\n\t\t\tthis.options.el.level2Options.find(\"li:not([data-current-page=true])\").removeClass(\"active\");\n\t\t\tthis.options.el.level2Options.eq(level1 - 1).find(\"li\").eq(level2 - 1).addClass(\"active\");\n\t\t\t//get selected level3 options\n\t\t\tvar level3Options = this.options.el.level3Holder.find('[data-level1=' + level1 + '][data-level2=' + level2 + ']');\n\t\t\t//get length familyLinks and its span\n\t\t\tvar familyLinks = level3Options.find('.menu__level3__links__family').length;\n\t\t\tvar familyLinksSpan = level3Options.find('.menu__level3__links__family > span').length;\n\t\t\tvar familyLinksSpanSiblings = level3Options.find('.menu__level3__links__family .menu__level3__links__title').siblings().length;\n\t\t\t//get heigth of family links + some height\n\t\t\tvar countFamilyLinks = familyLinks * 60;\n\t\t\t//get heigth of options\n\t\t\tvar countAllOptions = familyLinksSpan * 30;\n\t\t\t//calculate size to level 3 menu\n\t\t\tvar size = (countFamilyLinks + countAllOptions) / 2;\n\t\t\tif (level3Options.find('.menu__level3__image').length > 0) //add 200px if level3menu has image\n\t\t\t\tsize += 200;\n\t\t\tif (familyLinksSpanSiblings > 7 && level3Options.find('.menu__level3__image').length == 0)\n\t\t\t\tsize += 200;\n\t\t\t//console.log(familyLinksSpanSiblings);\t\n\t\t\t// $('.menu__level3__links__family').each(function(){\n\t\t\t// var familyLinksSpanSiblings = $(this).find('span:not(.menu__level3__links__title)').length;\n\t\t\t// if (familyLinksSpanSiblings>8){\n\t\t\t// size += 100;\n\t\t\t// console.log(familyLinksSpanSiblings);\t\n\t\t\t// }\n\t\t\t// });\t\t\t\n\n\t\t\t//set max-height\n\t\t\tthis.options.el.level3Links.css(\"max-height\", size);\n\t\t},\n\n\t\t_openMobileMenuLevel2: function(level1, level2, whereTo) {\n\n\t\t\tvar newMobileLevel = \"'\" + level1 + level2 + \"'\";\n\n\t\t\tthis.options.el.mobileContainer.find(\".menu__level3__links\").remove();\n\n\t\t\tif (this.options.currentMobileLevel2 != newMobileLevel) {\n\t\t\t\tvar level2Links = this.options.el.level3Options.filter(\"[data-level1='\" + level1 + \"'][data-level2='\" + level2 + \"']\").find(\".menu__level3__links\").clone();\n\t\t\t\tlevel2Links.appendTo(whereTo);\n\t\t\t\tthis.options.currentMobileLevel2 = newMobileLevel;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.options.currentMobileLevel2 = null;\n\t\t\t}\n\t\t},\n\n\t\t_closeDesktopMenu: function() {\n\t\t\tthis.options.el.level2Options.find(\"li:not([data-current-page=true])\").removeClass(\"active\");\n\t\t\tthis.options.el.level3.fadeOut();\n\t\t\tthis.options.el.level2.removeClass(\"filled\");\n\t\t},\n\n\t\t_openMobileMenu: function() {\n\t\t\tthis.options.currentScroll = $(document).scrollTop();\n\t\t\twindow.scrollTo(0, 0);\n\t\t\t$(\"body\").addClass(\"menuMobileOpened\");\n\t\t\tif (this.options.el.level1Options.find(\"span.active\").length === 0 || this.options.el.mobileContainer.text() === '') {\n\t\t\t\tthis.options.el.level1Options.find(\"span\").eq(this.options.defaultOption - 1).trigger(\"click\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar activeLeftPosition = this.options.el.level1Options.find(\"span.active\").position().left;\n\t\t\t\tthis.options.el.level1Options.animate({\n\t\t\t\t\tleft: -activeLeftPosition + this.options.mobileMenuOffset\n\t\t\t\t}, this.options.animateSpeed);\n\t\t\t}\n\t\t\t$.publish(\"OPEN_MOBILE_MENU\");\n\t\t},\n\n\t\t_closeMobileMenu: function() {\n\t\t\tthis.options.el.level1Options.css({\n\t\t\t\t\"left\": \"auto\"\n\t\t\t});\n\t\t\t$(\"body\").removeClass(\"menuMobileOpened\");\n\t\t\twindow.scrollTo(0, this.options.currentScroll);\n\t\t\t$.publish(\"CLOSE_MOBILE_MENU\");\n\t\t\t//console.log('_closeMobileMenu');\n\n\t\t\tif (this.options.targetHref && window.location.pathname != this.options.targetHref)\n\t\t\t\twindow.location.href = this.options.targetHref;\n\t\t},\n\n\t\t_clearAllEvents: function() {\n\n\t\t\tthis.options.el.level1Options.unbind(\"click\");\n\t\t\tthis.options.el.level2Holder.find(\"li a\").unbind(\"mouseenter mouseleave\");\n\t\t\tthis.options.el.level2Holder.unbind(\"mouseenter mouseleave\");\n\t\t\tthis.options.el.level3.unbind(\"mouseenter mouseleave\");\n\t\t\tthis.options.el.menu.unbind(\"mouseenter mouseleave\");\n\t\t\tthis.options.currentMobileLevel2 = null;\n\t\t\t$(\".menu__double__card\").unbind(\"click\");\n\t\t\t$(\".menu__double__net\").unbind(\"click\");\n\t\t\tthis.options.el.burguer.unbind(\"click\");\n\t\t\t$(\".close-mobile-menu\").unbind(\"click\");\n\t\t\tif (this.options.el.level1Options.draggable(\"instance\")) {\n\t\t\t\tthis.options.el.level1Options.draggable(\"destroy\");\n\t\t\t}\n\t\t\t//resize in case the search was open\n\t\t\tif (this.options.el.magnifier.hasClass(\"cross\")) {\n\t\t\t\tthis._openSearchBar(this.options.menuType);\n\t\t\t}\n\t\t},\n\n\t\t_openSearchBar: function(type) {\n\t\t\t//console.log(\"_openSearchBar\", type);\n\t\t\tthis.options.el.magnifier.addClass(\"cross\");\n\t\t\tthis.options.el.searchBar.show();\n\t\t\tif (type === \"desktop\") {\n\t\t\t\tthis._closeDesktopMenu();\n\t\t\t\tthis.options.el.logo.show();\n\t\t\t\tthis.options.el.level2Holder.hide();\n\t\t\t\tif (!this.options.el.body.hasClass(\"desktopScrolling\")) {\n\t\t\t\t\tthis.options.el.level2.addClass(\"filled\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.options.el.logo.hide();\n\t\t\t\tthis.options.el.burguer.hide();\n\t\t\t}\n\t\t\tthis.options.el.searchField.val('').focus();\n\t\t\t$.publish(\"OPEN_SEARCH\");\n\t\t},\n\n\t\t_closeSearchBar: function(type) {\n\t\t\t//console.log(\"_closeSearchBar\", type);\n\t\t\tthis.options.el.magnifier.removeClass(\"cross\");\n\t\t\tthis.options.el.searchBar.hide();\n\t\t\tthis.options.el.level3.hide().removeClass(\"results\");\n\t\t\tif (type === \"desktop\") {\n\t\t\t\tthis.options.el.level2Holder.show();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.options.el.logo.show();\n\t\t\t\tthis.options.el.burguer.show();\n\t\t\t}\n\t\t\t$.publish(\"CLOSE_SEARCH\");\n\t\t},\n\n\t\t_handleMenuMouseLeave: function(trigger) {\n\t\t\t//console.log(\"_handleMenuMouseLeave\", trigger);\n\t\t\tif (this.options.el.level3.hasClass(\"hovered\")) {\n\t\t\t\t//moved out but level 3 is visible\n\t\t\t}\n\t\t\telse if (this.options.el.magnifier.hasClass(\"cross\")) {\n\t\t\t\t//the search bar is open\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._closeDesktopMenu();\n\t\t\t}\n\t\t},\n\n\t\t_doSearch: function() {\n\t\t\tvar self = this;\n\t\t\tvar query = this.options.el.searchField.val();\n\t\t\t//console.log(\"#### _doSearch : \", this.options.el.searchField.val());\n\t\t\tthis.options.el.level2Holder.hide();\n\t\t\tif (query === \"\") {\n\t\t\t\tthis.options.el.level3.fadeOut().removeClass(\"results\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype: \"GET\",\n\t\t\t\t\turl: this.element.data(\"endpoint\"),\n\t\t\t\t\tdata: 'q=' + query\n\t\t\t\t}).done(function(data, textStatus, jqXHR) {\n\t\t\t\t\tself._populateSearch(query, data);\n\t\t\t\t}).fail(function(data, textStatus, jqXHR) {\n\t\t\t\t\tself._populateSearch(query);\n\t\t\t\t\t//console.log(\"Fail:\", textStatus, jqXHR);\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\t_populateSearch: function(query, data) {\n\t\t\tthis.options.el.level3.addClass(\"results\").fadeIn();\n\t\t\tthis.options.el.searchLabel.find(\"strong\").text(query);\n\t\t\t$(\".menu__level3__search-results\").empty();\n\t\t\t$(data).each(function(index, obj) {\n\t\t\t\t//var sentence = obj.string.replace(query, \"\" + query + \"\");\n\t\t\t\t$(\".menu__level3__search-results\").append(\"

\" + obj.String + \"

\")\n\t\t\t});\n\t\t},\n\n\t\tdump: function() {\n\t\t\t//console.log(this.options);\n\t\t},\n\n\t\t_toggleList: function() {\n\t\t\tvar self = this;\n\t\t\tthis.options.el.btnDropdown.on('click', function() {\n\t\t\t\t$(this).toggleClass('open')\n\t\t\t\tself.options.el.dropdownList.slideToggle()\n\t\t\t})\n\t\t},\n\n\t\t_formNet: function() {\n\t\t\tvar self = this;\n\t\t\t//change forms display accordind to select value\n\t\t\tthis.options.el.formNet.find('.menu__form__select select').each(function() {\n\t\t\t\t$(this).on('change', function() {\n\t\t\t\t\tvar select = $(this)\n\t\t\t\t\tvar form = $(this).closest('form')\n\t\t\t\t\tif (select.val() === form.attr('id')) {\n\t\t\t\t\t\tform.addClass('active')\n\t\t\t\t\t\tform.siblings().removeClass('active')\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tform.removeClass('active')\n\t\t\t\t\t\tform.siblings().addClass('active')\n\t\t\t\t\t\tform.siblings().find('input').val('')\n\t\t\t\t\t\tform.siblings().find('select').val(select.val())\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t\t\tthis.options.el.formNet.on('focus', 'input, select', function() {\n\t\t\t\tself.options.el.formNet.addClass('focused')\n\t\t\t})\n\t\t\tthis.options.el.formNet.on('focus', 'input, select', function() {\n\t\t\t\tself.options.el.formNet.addClass('focused')\n\t\t\t})\n\t\t\tthis.options.el.formNet.on('blur', 'input, select', function() {\n\t\t\t\tself.options.el.formNet.removeClass('focused')\n\t\t\t})\n\t\t}\n\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.modal', {\n\t\t_create: function() {\n\t\t\tthis.modalOptions = {\n\t\t\t\titems: {},\n\t\t\t\tcloseBtnInside: true,\n\t\t\t\ttype: 'inline',\n\t\t\t\tremovalDelay: 500,\n\t\t\t\tmainClass: 'mfp-zoom-in'\n\t\t\t};\n\t\t\tthis.options = {\n\t\t\t\tautoOpen: {\n\t\t\t\t\tid: null,\n\t\t\t\t\texpires: 365,\n\t\t\t\t\tmaxViewsPerUser: 1\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tvar self = this;\n\t\t\tif (this.element.data('auto-id')) {\n\t\t\t\tthis.options.autoOpen.id = this.element.data('auto-id');\n\t\t\t\tthis.modalOptions.items.src = this.element;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.modalOptions.items.src = this.element.attr(\"href\");\n\t\t\t}\n\n\t\t\tif (this.element.data('auto-expires')) {\n\t\t\t\tthis.options.autoOpen.expires = this.element.data('auto-expires');\n\t\t\t}\n\t\t\tif (this.element.data('auto-max-views')) {\n\t\t\t\tthis.options.autoOpen.maxViewsPerUser = this.element.data('auto-max-views');\n\t\t\t}\n\n\t\t\tif ($(this.element).data(\"modal\")) {\n\t\t\t\tthis.modalOptions.closeOnBgClick = false;\n\t\t\t}\n\n\t\t\tif ($(this.element).data('video')) {\n\t\t\t\tthis.modalOptions.mainClass = 'mfp-video mfp-zoom-in';\n\t\t\t\tthis.modalOptions.closeBtnInside = false;\n\n\t\t\t}\n\n\t\t\tif ($(this.element).data(\"modalAnimation\")) {\n\t\t\t\tthis.modalOptions.mainClass = $(this.element).data(\"modalAnimation\");\n\t\t\t}\n\n\t\t\t//only defines open event if it is not an autoopen modal\n\t\t\tif (!this.options.autoOpen.id) {\n\t\t\t\tthis._on({\n\t\t\t\t\t'click': function(e) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t$.magnificPopup.open(self.modalOptions);\n\t\t\t\t\t\tvar container = $.magnificPopup.instance;\n\t\t\t\t\t\tif (container.content.attr('id') === 'modal-video') {\n\t\t\t\t\t\t\tvar video = $(container.content)\n\t\t\t\t\t\t\tvideo.find('.modal__video video')[0].currentTime = 0;\n\t\t\t\t\t\t\tvideo.find('.modal__video video')[0].play()\n\n\t\t\t\t\t\t\tcontainer.wrap.find('.mfp-close').on('click', function() {\n\t\t\t\t\t\t\t\tvideo.find('.modal__video video')[0].pause()\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t_init: function() {\n\n\t\t\t//---- Auto Open Process ----\n\t\t\tif (this.options.autoOpen.id) {\n\t\t\t\tvar cookieId = 'auto-open-modal-' + this.options.autoOpen.id;\n\t\t\t\tvar sessionCookieId = 'auto-open-modal-session-' + this.options.autoOpen.id;\n\t\t\t\tvar startdateCookieId = 'auto-open-modal-startdate-' + this.options.autoOpen.id;\n\t\t\t\tvar startdate = $('#modal-startpage').data('startdate');\n\n\t\t\t\t//If there is new startdate, all cookies will be removed, and reset startdatecookie\n\t\t\t\tif ($.cookie(startdateCookieId) != startdate) {\n\t\t\t\t\t$.removeCookie(sessionCookieId);\n\t\t\t\t\t$.removeCookie(cookieId);\n\t\t\t\t\t$.cookie(startdateCookieId, startdate);\n\t\t\t\t}\n\n\t\t\t\t// popup wasn't opened in this session\n\t\t\t\tif (!$.cookie(sessionCookieId)) {\n\t\t\t\t\t//set as sessionOpened\n\t\t\t\t\t$.cookie(sessionCookieId, true);\n\n\t\t\t\t\t//get current user views\n\t\t\t\t\tvar userCountViews = $.cookie(cookieId);\n\t\t\t\t\tif (!userCountViews)\n\t\t\t\t\t\tuserCountViews = 0;\n\n\t\t\t\t\tif (userCountViews < this.options.autoOpen.maxViewsPerUser) {\n\t\t\t\t\t\t//increment cookie user views counter\n\t\t\t\t\t\t$.cookie(cookieId, ++userCountViews, { expires: this.options.autoOpen.expires }); //increment cookie user views counter\n\n\t\t\t\t\t\t//open modal\n\t\t\t\t\t\t$.magnificPopup.open(this.modalOptions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n})(jQuery);","(function($) {\n\t'use strict';\n\t$.widget('msv.radiobutton', {\n\t\tvars: {}, //[{\"value\":1,\"text\":\"1\"},{\"value\":2,\"text\":\"2\"},{\"value\":3,\"text\":\"3\"},{\"value\":4,\"text\":\"4\"},{\"value\":5,\"text\":\"5\"}]\n\t\tel: {},\n\t\t_create: function() {\n\t\t\tvar self = this;\n\t\t\tself.vars.labelText = self.element.data('label');\n\t\t\tself.vars.dataSource = self.element.data('json');\n\t\t\tself.vars.nameAttr = self.element.data('name');\n\t\t},\n\t\t_init: function() {\n\t\t\tvar self = this;\n\t\t\tvar inputName = self.vars.nameAttr ? \" name='\" + self.vars.nameAttr + \"'\" : \"\";\n\t\t\tself.el.input = $('');\n\t\t\tthis.element.html('');\n\t\t\tthis.element.append(self.el.input);\n\t\t\tself.element.append('
' + self.vars.labelText + '
');\n\t\t\tself.vars.dataSource.forEach(function(d) {\n\t\t\t\tself.element.append('
' + d.text + '
');\n\t\t\t});\n\n\t\t\tself.element.find('.js-radio-item')\n\t\t\t\t.off('click')\n\t\t\t\t.click(function(e) {\n\t\t\t\t\tself.element.find('input[type=hidden]').val($(e.target).data('value'));\n\t\t\t\t\tself.element.find('.js-radio-item').removeClass('selected');\n\t\t\t\t\t$(e.target).addClass('selected');\n\t\t\t\t});\n\t\t\t$(window).resize(function() {\n\t\t\t\tself.redraw();\n\t\t\t});\n\t\t},\n\t\t_destroy: function() {},\n\t\tredraw: function() {\n\t\t\tvar self = this;\n\t\t\t//console.log('redraw');\n\t\t\t//self.element.width(self.element.width() + 2);\n\t\t}\n\t});\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.ripplefx', {\n\n\t\toptions: {\n\t\t\tduration: .75\n\t\t},\n\n\t\t_create: function() {\n\t\t\tvar self = this;\n\n\n\t\t\tvar button = self.element;\n\t\t\tvar rippleElement = '';\n\t\t\tbutton.append(rippleElement);\n\n\t\t\tthis.options.ripple = self.element.find('.js-ripple');\n\n\n\t\t\tbutton.click(function(event) {\n\t\t\t\tself._rippleAnimation(event, self.options.duration);\n\t\t\t});\n\n\t\t},\n\n\t\t_rippleAnimation: function(event, timing) {\n\t\t\t// console.log(event)\n\t\t\tvar tl = new TimelineMax();\n\t\t\tvar x = event.offsetX,\n\t\t\t\ty = event.offsetY,\n\t\t\t\tw = event.target.offsetWidth,\n\t\t\t\th = event.target.offsetHeight,\n\t\t\t\toffsetX = Math.abs((w / 2) - x),\n\t\t\t\toffsetY = Math.abs((h / 2) - y),\n\t\t\t\tdeltaX = (w / 2) + offsetX,\n\t\t\t\tdeltaY = (h / 2) + offsetY,\n\t\t\t\tscale_ratio = Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n\n\t\t\ttl.fromTo(this.options.ripple, timing, {\n\t\t\t\tx: x,\n\t\t\t\ty: y,\n\t\t\t\ttransformOrigin: '50% 50%',\n\t\t\t\tscale: 0,\n\t\t\t\topacity: 1,\n\t\t\t\tease: Linear.easeIn\n\t\t\t}, {\n\t\t\t\tscale: scale_ratio,\n\t\t\t\topacity: 0\n\t\t\t});\n\t\t\t// console.log(this.options.ripple)\n\n\t\t\treturn tl;\n\t\t}\n\n\n\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.scrollup', {\n\n\t\toptions: {},\n\n\t\t_create: function() {\n\t\t\t$(\".scrollup\").click(function() {\n\t\t\t\t$('html, body').animate({\n\t\t\t\t\tscrollTop: 0\n\t\t\t\t}, 800);\n\t\t\t});\n\t\t}\n\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.share', {\n\n\t\toptions: {\n\t\t\tel: {},\n\t\t\tfacebook: 'https://www.facebook.com/sharer/sharer.php?u=',\n\t\t\tlinkedin: 'https://www.linkedin.com/shareArticle?mini=true&url=',\n\t\t\tgoogleplus: 'https://plus.google.com/share?url=',\n\t\t\twhatsapp: 'whatsapp://send?text=',\n\t\t\ttwitter: 'https://twitter.com/home?status=',\n\t\t\tyoutube: 'https://www.youtube.com/channel/UC6D0t4ecpz7D0RcJaUovkcA'\n\t\t},\n\n\t\t_create: function() {\n\t\t\tvar self = this;\n\t\t\t/**/\n\t\t\tthis.options.el.share = $(\".share\");\n\t\t\tthis.options.el.shareProviders = $(\".share__providers\");\n\t\t\t/**/\n\t\t\tvar type = this.options[this.element.data(\"social\")];\n\t\t\tvar url = encodeURIComponent(window.location.href);\n\t\t\tvar shareUrl = type + url;\n\t\t\t/**/\n\t\t\tthis._on({\n\t\t\t\t'click': function(evt) {\n\t\t\t\t\tevt.preventDefault();\n\t\t\t\t\tself._popupCenter(shareUrl);\n\t\t\t\t}\n\t\t\t});\n\t\t\t// this.options.el.share.hover(function () {\n\t\t\t// \tself.options.el.shareProviders.fadeIn();\n\t\t\t// }, function () {\n\t\t\t// \tself.options.el.shareProviders.fadeOut();\n\t\t\t// })\n\t\t},\n\n\t\t_popupCenter: function(url) {\n\t\t\tvar w = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 600;\n\t\t\tvar h = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 400;\n\t\t\tvar dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : screen.left,\n\t\t\t\tdualScreenTop = window.screenTop !== undefined ? window.screenTop : screen.top,\n\t\t\t\twidth = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width,\n\t\t\t\theight = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height,\n\t\t\t\tleft = width / 2 - w / 2 + dualScreenLeft,\n\t\t\t\ttop = height / 2 - h / 2 + dualScreenTop,\n\t\t\t\tnewWindow = window.open(url, 'Share', \"scrollbars=yes, width=\".concat(w, \", height=\").concat(h, \", top=\").concat(top, \", left=\").concat(left)); // Puts focus on the newWindow \n\t\t\n\t\t\twindow.focus ? newWindow.focus() : '';\n\t\t}\n\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.simulator', {\n\n\t\tel: {\n\t\t\tsimulatorItem: $('.js-simulator'),\n\t\t\tsimulatorTotal: $('.js-simulator-total')\n\t\t},\n\n\t\t_init: function() {\n\t\t\tthis._events()\n\t\t},\n\n\t\t_events: function() {\n\t\t\tvar self = this;\n\n\t\t\tthis.el.simulatorItem.not('[type=radio]').on('input', function() {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tself._getData()\n\t\t\t\t}, 300)\n\t\t\t})\n\n\t\t\tthis.element.find('.form-datalist__options').on('click', function() {\n\t\t\t\tself._getData()\n\t\t\t});\n\n\t\t\tthis.element.find('[type=radio]').on('change', function() {\n\t\t\t\tif ($(this).prop(\"checked\"))\n\t\t\t\t\tself._getData()\n\t\t\t})\n\t\t},\n\n\t\t_getData: function() {\n\t\t\tvar self = this;\n\n\t\t\t$.ajax({\n\t\t\t\ttype: 'GET',\n\t\t\t\turl: self.element.data('endpoint'),\n\t\t\t\tdataType: 'json',\n\t\t\t\tcontentType: 'application/json',\n\t\t\t\tbeforeSend: function() {\n\t\t\t\t\tself.element.find('button.btn').attr('disabled', true).addClass('btn-loading');\n\t\t\t\t\tself.element.find('.btn-loading').append(\"\");\n\t\t\t\t},\n\t\t\t}).done(function(data, textStatus, jqXHR) {\n\t\t\t\tself.element.find('button.btn').removeClass('btn-loading');\n\t\t\t\tself.element.find(\".btn-loading-spinner\").remove();\n\t\t\t\tif (jqXHR.status === 200) {\n\n\t\t\t\t\tvar simulatorTotal =\n\t\t\t\t\t\t(self.element.find(\"[name=simulatorProductType]\").val().length ? +self.element.find(\"[name=simulatorProductType]\").attr('data-value') : 0) +\n\t\t\t\t\t\t(self.element.find(\"[name=simulatorInitialFee]\").val().length ? +self.element.find(\"[name=simulatorInitialFee]\").val() : 0) +\n\t\t\t\t\t\t(self.element.find(\"[name=days]:checked\").length ? +$(\"[name=days]:checked\").val() : 0)\n\n\t\t\t\t\tself.el.simulatorTotal.find('span span').html(simulatorTotal)\n\t\t\t\t}\n\t\t\t}).fail(function() {\n\t\t\t\tself.element.find('button.btn').attr('disabled', false).addClass('btn-red').removeClass('btn-loading');\n\t\t\t\tself.element.find(\".btn-loading-spinner\").remove();\n\t\t\t})\n\t\t}\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.slideinSidebar', {\n\t\tvars: {\n\t\t\tdesktopDown: window.matchMedia('(min-width: 1024px)')\n\t\t},\n\n\t\t_create: function() {\n\t\t\tvar sidebar = $('.sidebar')\n\t\t\tif (this.vars.desktopDown.matches) {\n\t\t\t\tsidebar.hover(function() {\n\t\t\t\t\t$(this).addClass('open')\n\t\t\t\t}, function() {\n\t\t\t\t\t$(this).removeClass('open')\n\t\t\t\t})\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsidebar.on('click', function() {\n\t\t\t\t\t$(this).toggleClass('open');\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.sticky', {\n\n\t\toptions: {\n\t\t\tel: {}\n\t\t},\n\n\t\t_create: function() {\n\t\t\tvar self = this;\n\t\t\t/**/\n\t\t\tthis.options.el.aside = $(\".aside\");\n\t\t\tthis.options.el.shield = $(\".aside .shield\");\n\t\t\tthis.options.el.asideBody = $(\".aside__body\");\n\t\t\tthis.options.el.asideTrigger = $(\".aside__trigger\");\n\t\t\t/**/\n\t\t\tthis._events();\n\t\t\tthis._calculate();\n\t\t\t$(window).on('scroll', function() {\n\t\t\t\tself._calculate();\n\t\t\t});\n\t\t\t$(window).on('resize', function() {\n\t\t\t\tself._calculate();\n\t\t\t});\n\t\t},\n\n\t\t_events: function() {\n\t\t\tvar self = this;\n\t\t\tthis.options.el.shield.click(function() {\n\t\t\t\tself._mobileClose();\n\t\t\t});\n\t\t\tthis.options.el.asideTrigger.click(function() {\n\t\t\t\tif ($(this).hasClass(\"opened\")) {\n\t\t\t\t\tself._mobileClose();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself._mobileOpen();\n\t\t\t\t}\n\t\t\t});\n\t\t\t$.subscribe(\"OPEN_MOBILE_MENU\", function() {\n\t\t\t\tself._mobileClose();\n\t\t\t\tself._mobileHide();\n\t\t\t});\n\t\t\t$.subscribe(\"CLOSE_MOBILE_MENU\", function() {\n\t\t\t\tself._mobileShow();\n\t\t\t});\n\t\t\t$.subscribe(\"OPEN_SEARCH\", function() {\n\t\t\t\tself._mobileClose();\n\t\t\t});\n\t\t},\n\n\t\t_calculate: function() {\n\t\t\tvar $floatingPanel = $(\"aside.aside\");\n\t\t\tvar $floatingPanelBody = $floatingPanel.find(\".aside__body\");\n\t\t\tvar $pageHeader = $(\".hero\");\n\t\t\tvar $stickyContainer = $(\".sticky-container\");\n\t\t\tvar $stickyContent = $stickyContainer.closest(\".row\");\n\t\t\tthis.options.asideHeight = $floatingPanel.height();\n\t\t\tthis.options.asideBodyHeight = $floatingPanelBody.height();\n\t\t\tif (window.innerWidth >= 960) {\n\t\t\t\tvar windowTop = $(window).scrollTop();\n\t\t\t\tvar stickyContentTop = $stickyContent.offset().top;\n\t\t\t\tvar stickyPoint = stickyContentTop + $stickyContent.height() - this.options.asideHeight - 350; //for padding purposes\n\t\t\t\t// console.log('aside:' + windowTop, stickyPoint, $pageHeader.height() + 100);\n\n\n\t\t\t\tif (windowTop <= $pageHeader.height() - 100) {\n\t\t\t\t\t$floatingPanel.css({\n\t\t\t\t\t\tposition: \"static\",\n\t\t\t\t\t\ttop: \"auto\",\n\t\t\t\t\t\tright: \"auto\",\n\t\t\t\t\t\tbottom: \"auto\",\n\t\t\t\t\t\tleft: \"auto\",\n\t\t\t\t\t\twidth: \"auto\",\n\t\t\t\t\t\tmarginTop: -230\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (windowTop <= stickyPoint) {\n\t\t\t\t\t\t$floatingPanel.css({\n\t\t\t\t\t\t\tposition: \"fixed\",\n\t\t\t\t\t\t\ttop: 130,\n\t\t\t\t\t\t\tright: \"auto\",\n\t\t\t\t\t\t\tbottom: \"auto\",\n\t\t\t\t\t\t\tleft: \"auto\",\n\t\t\t\t\t\t\twidth: $stickyContainer.width(),\n\t\t\t\t\t\t\tmarginTop: 0\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (windowTop >= 2000 && windowTop <= 4400) {\n\t\t\t\t\t\t\t$floatingPanel.css({\n\t\t\t\t\t\t\t\tposition: \"fixed\",\n\t\t\t\t\t\t\t\ttop: 130,\n\t\t\t\t\t\t\t\tright: \"auto\",\n\t\t\t\t\t\t\t\tbottom: \"auto\",\n\t\t\t\t\t\t\t\tleft: \"auto\",\n\t\t\t\t\t\t\t\twidth: $stickyContainer.width(),\n\t\t\t\t\t\t\t\tmarginTop: 0\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$floatingPanel.css({\n\t\t\t\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t\t\t\ttop: stickyPoint - this.options.asideHeight - 250,\n\t\t\t\t\t\t\t\tright: \"auto\",\n\t\t\t\t\t\t\t\tbottom: \"auto\",\n\t\t\t\t\t\t\t\tleft: \"auto\",\n\t\t\t\t\t\t\t\twidth: $stickyContainer.width(),\n\t\t\t\t\t\t\t\tmarginTop: 0\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$(\".aside__trigger\").removeClass(\"opened\");\n\t\t\t\t$(\".aside\").removeClass(\"hasShield\");\n\t\t\t\t$floatingPanel.css({\n\t\t\t\t\tposition: \"fixed\",\n\t\t\t\t\ttop: \"auto\",\n\t\t\t\t\tright: \"auto\",\n\t\t\t\t\tbottom: \"0\",\n\t\t\t\t\tleft: \"0\",\n\t\t\t\t\twidth: \"100%\"\n\t\t\t\t});\n\t\t\t\t$floatingPanelBody.css({\n\t\t\t\t\tbottom: -this.options.asideBodyHeight - this.options.asideHeight\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\t_mobileOpen: function() {\n\t\t\tthis.options.el.asideBody.animate({\n\t\t\t\tbottom: this.options.asideHeight\n\t\t\t}, 300);\n\t\t\tthis.options.el.asideTrigger.addClass(\"opened\");\n\t\t\tthis.options.el.aside.addClass(\"hasShield\");\n\t\t},\n\n\t\t_mobileClose: function() {\n\t\t\tthis.options.el.asideBody.animate({\n\t\t\t\tbottom: -this.options.asideBodyHeight - this.options.asideHeight\n\t\t\t}, 300);\n\t\t\tthis.options.el.asideTrigger.removeClass(\"opened\");\n\t\t\tthis.options.el.aside.removeClass(\"hasShield\");\n\t\t},\n\n\t\t_mobileHide: function() {\n\t\t\tthis.options.el.aside.hide();\n\t\t},\n\n\t\t_mobileShow: function() {\n\t\t\tthis.options.el.aside.show();\n\t\t}\n\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.stickyCta', {\n\t\tvars: {\n\t\t\tactivateStickyCta: $('.js-show-sticky-cta'),\n\t\t\thideStickyCta: $('.js-close-sticky-cta'),\n\t\t\tstickyCta: $('.sticky-cta')\n\t\t},\n\n\t\t_create: function() {\n\t\t\tvar self = this;\n\t\t\t$(window).on('scroll', function() {\n\t\t\t\tself._events()\n\t\t\t})\n\n\t\t\t$(window).on('resize', function() {\n\t\t\t\tself._events();\n\t\t\t});\n\n\t\t},\n\n\t\t_events: function() {\n\t\t\tvar self = this;\n\t\t\tvar triggerCta = $(this.vars.activateStickyCta).innerHeight() + $(this.vars.activateStickyCta).offset().top;\n\t\t\tvar hideCta = $(this.vars.hideStickyCta).offset().top;\n\n\t\t\tif ($(window).scrollTop() > triggerCta && $(window).scrollTop() < (hideCta - window.innerHeight)) {\n\t\t\t\tself.vars.stickyCta.addClass('show')\n\t\t\t}\n\t\t\telse {\n\t\t\t\tself.vars.stickyCta.removeClass('show')\n\t\t\t}\n\t\t}\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.tableResponsive', {\n\n\t\toptions: {\n\t\t\tlargeAndUp: window.matchMedia('(min-width: 1024px)')\n\t\t},\n\n\t\t_init: function() {\n\t\t\tvar self = this;\n\n\t\t\tthis._events();\n\t\t\t!this.options.largeAndUp.addListener(function() {\n\t\t\t\t!self.options.largeAndUp.matches ?\n\t\t\t\t\tself._events() :\n\t\t\t\t\t$('.table-responsive__head-mobile').remove()\n\t\t\t})\n\t\t},\n\n\t\t_events: function() {\n\n\t\t\tif (!this.options.largeAndUp.matches) {\n\n\t\t\t\tthis.element.find('tbody>tr>td').each(function(_, el) {\n\t\t\t\t\t$(el).prepend(function() {\n\t\t\t\t\t\treturn \"
\".concat($(el).closest('.table-responsive').find('th:not(:first)').eq($(el).index() - 1).text(), \"
\");\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\n\t$.widget('msv.tabspanel', {\n\n\t\toptions: {\n\t\t\tduration: .6\n\t\t},\n\n\t\t_create: function() {\n\t\t\tvar self = this;\n\t\t\tthis.options.myfilet = this.element.find(\"span.filet\");\n\t\t\tthis.element.tabs({\n\t\t\t\tshow: true,\n\t\t\t\tbeforeActivate: function(_, ui) {\n\t\t\t\t\tvar newone = $(ui.newTab);\n\t\t\t\t\tTweenMax.to(self.options.myfilet, self.options.duration, {\n\t\t\t\t\t\tleft: newone.position().left,\n\t\t\t\t\t\twidth: newone.width(),\n\t\t\t\t\t\tease: Power4.easeOut\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tcreate: function() {\n\t\t\t\t\tvar amount = self.element.find(\".small-slider__tab-item\").length;\n\t\t\t\t\tself.options.myfilet.css({\n\t\t\t\t\t\twidth: (1 / amount) * 100 + '%'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t$(window).on('resize', function() {\n\t\t\t\tif (self.element.is(\":visible\")) {\n\t\t\t\t\tself._redraw();\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t_redraw: function() {\n\t\t\tvar selectedIndex = this.element.find(\".ui-tab.ui-tabs-active.ui-state-active\").index();\n\t\t\tvar width = this.element.find(\".small-slider__tab-item\").eq(selectedIndex).width();\n\t\t\tvar left = this.element.find(\".small-slider__tab-item\").eq(selectedIndex).position().left;\n\t\t\tthis.options.myfilet.css({ width: width, left: left });\n\t\t}\n\n\n\t});\n\n})(jQuery);","(function($) {\n\t'use strict';\n\t$.widget('msv.uploadFile', {\n\t\tvars: {},\n\t\tel: {},\n\t\t_create: function() {\n\t\t\tvar self = this;\n\t\t\tself.vars.labelText = self.element.data('label');\n\t\t\tself.vars.nameAttr = self.element.data('name');\n\t\t\tself.vars.endpoint = self.element.data('endpoint');\n\t\t\tself.vars.ruleRequired = self.element.data('rule-required');\n\t\t},\n\t\t_init: function() {\n\t\t\tvar self = this;\n\t\t\tvar inputName = self.vars.nameAttr ? \" name='\" + self.vars.nameAttr + \"'\" : \"\";\n\t\t\tself.el.uploadButton = $('' + self.vars.labelText + '');\n\t\t\tvar requiredStr = self.vars.ruleRequired ? \"data-rule-required=\\\"true\\\"\" : \"\";\n\t\t\tself.el.input = $('');\n\t\t\tself.el.inputHidden = $('')\n\t\t\tself.el.spanFileName = $('');\n\t\t\tself.element.html(self.el.uploadButton);\n\t\t\tself.element.append(self.el.input);\n\t\t\tself.element.append(self.el.spanFileName);\n\t\t\tself.element.append(self.el.inputHidden);\n\n\n\t\t\tself.el.uploadButton.off('click').click(function() {\n\t\t\t\tself.el.input.trigger('click');\n\t\t\t});\n\n\t\t\tself.el.input.change(function() {\n\t\t\t\t//--- Create data to ajax\n\t\t\t\tvar file = this.files[0];\n\t\t\t\tvar data = new FormData();\n\t\t\t\tdata.append(file.name, file);\n\n\t\t\t\t//--- Loading Button\n\t\t\t\tself.el.uploadButton.attr('disabled', true).addClass('btn-loading');\n\t\t\t\tself.el.uploadButton.append(\"\");\n\n\t\t\t\t//--- Reset input\n\t\t\t\tself.el.spanFileName.html('');\n\t\t\t\tself.el.inputHidden.val('');\n\n\t\t\t\t//--- ajax request\n\t\t\t\tvar ajaxRequest = $.ajax({\n\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\turl: self.vars.endpoint,\n\t\t\t\t\tcontentType: false,\n\t\t\t\t\tprocessData: false,\n\t\t\t\t\tdata: data,\n\t\t\t\t\tsuccess: function(response) {\n\t\t\t\t\t\tself.el.uploadButton.attr('disabled', false).removeClass('btn-loading');\n\t\t\t\t\t\tself.el.uploadButton.find(\".btn-loading-spinner\").remove();\n\t\t\t\t\t\tself.el.inputHidden.val(response);\n\t\t\t\t\t\tself.el.spanFileName.html(self.el.input.val().split('\\\\').pop())\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t\t_destroy: function() {\n\n\t\t}\n\t});\n})(jQuery);"]}