webpackJsonp([0],{ /***/ 197: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), GoogleMapsLoader = __webpack_require__(175), YandexMaps = __webpack_require__(184), SimpleYandexMap = __webpack_require__(198), SimpleGoogleMap = __webpack_require__(199), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'MapsController', pre: function pre() { this.map_options = { marker_icon: '/assets/desktop/images/map-pointer.svg', marker_size: [44, 58], marker_offset: [-22, -50], zoom: 16 }; }, create: function create() { var self = this; this.yandex_maps_buffer = []; this.google_maps_buffer = []; this.google_maps = {}; this.yandex_maps = {}; this.ymaps = null; this.gmaps = null; window.maps_controller = this; $(window).bind('yandex_maps_loaded', function () { self.yandex_maps_buffer.forEach(function (func) { func(); }); self.yandex_maps_buffer = []; }); $(window).bind('google_maps_loaded', function () { self.google_maps_buffer.forEach(function (func) { func(); }); self.google_maps_buffer = []; }); GoogleMapsLoader.KEY = 'AIzaSyB2vFxpc5M0ziaL27PAOOKPodcpJd-HnTk'; GoogleMapsLoader.LANGUAGE = 'mn'; GoogleMapsLoader.VERSION = '3.38'; GoogleMapsLoader.load(function (gmaps) { self.gmaps = gmaps; window.app.map_modules({ '.js-simple-google-map': { module: SimpleGoogleMap, options: self.map_options } }); $(window).trigger('google_maps_loaded'); }); YandexMaps.default.load().then(function (ymaps) { self.ymaps = ymaps; window.app.map_modules({ '.js-simple-yandex-map': { module: SimpleYandexMap, options: self.map_options } }); $(window).trigger('yandex_maps_loaded'); }); $(window).trigger('maps_controller_ready'); }, createSimpleYandexMap: function createSimpleYandexMap(elm, options, callback) { options = Object.assign(options || {}, this.map_options); options.element = elm; var func = function func() { var instance = new SimpleYandexMap(options); typeof callback == 'function' && callback(instance); }; this.ymaps ? func() : this.yandex_maps_buffer.push(func); }, createSimpleGoogleMap: function createSimpleGoogleMap(elm, options, callback) { options = Object.assign(options || {}, this.map_options); options.element = elm; var func = function func() { var instance = new SimpleGoogleMap(options); typeof callback == 'function' && callback(instance); }; this.gmaps ? func() : this.google_maps_buffer.push(func); } }); /***/ }), /***/ 198: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'SimpleYandexMap', pre: function pre() { this.autocreate = false; }, create: function create() { var self = this; this.map = false; this.marker = false; this.markers = {}; this.tid = this.element.data('tid'); if (this.tid) { window.maps_controller.yandex_maps[this.tid] = this; } this.autocreate = this.autocreate || parseInt(this.element.data('autocreate') || 0); this.lat = this.lat || parseFloat(this.element.data('lat')); this.lng = this.lng || parseFloat(this.element.data('lng')); var zoom = parseInt(this.element.data('zoom')); if (zoom) { this.zoom = zoom; } if (this.autocreate) { this.create_map(); } }, panTo: function panTo(lat, lng) { this.addMarker(lat, lng); this.map.panTo([lat, lng]); }, create_map: function create_map() { if (this.map) return; this.map = this.generate_map(this.lat, this.lng, this.zoom); this.addMarker(this.lat, this.lng); }, generate_map: function generate_map(lat, lng, zoom) { var map = new window.maps_controller.ymaps.Map(this.element[0], { center: [lat, lng], zoom: zoom, controls: [] }); var zoomControl = new ymaps.control.ZoomControl({ options: { size: "small", position: { left: 'auto', bottom: 40, right: 10, top: 'auto' } } }); map.controls.add(zoomControl); return map; }, addMarker: function addMarker(lat, lng) { var marker_id = lat.toString() + '_' + lng.toString(); if (typeof this.markers[marker_id] != 'undefined') return false; var marker = new window.maps_controller.ymaps.Placemark([lat, lng], {}, { iconLayout: 'default#image', iconImageHref: this.marker_icon, iconImageSize: this.marker_size, iconImageOffset: this.marker_offset }); this.map.geoObjects.add(marker); this.markers[marker_id] = marker; return marker; } }); /***/ }), /***/ 199: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'SimpleGoogleMap', pre: function pre() { this.autocreate = false; }, create: function create() { var self = this; this.map = false; this.marker = false; this.markers = {}; this.tid = this.element.data('tid'); if (this.tid) { window.maps_controller.google_maps[this.tid] = this; } this.autocreate = this.autocreate || parseInt(this.element.data('autocreate') || 0); this.lat = this.lat || parseFloat(this.element.data('lat')); this.lng = this.lng || parseFloat(this.element.data('lng')); var zoom = parseInt(this.element.data('zoom')); if (zoom) { this.zoom = zoom; } if (this.autocreate) { this.create_map(); } }, panTo: function panTo(lat, lng) { var marker = this.addMarker(lat, lng); this.map.panTo({ lat: lat, lng: lng }); }, create_map: function create_map(lat, lng) { if (this.map) return; this.map = this.generate_map(this.lat, this.lng, this.zoom); this.addMarker(this.lat, this.lng); }, generate_map: function generate_map(lat, lng, zoom) { var map = new window.maps_controller.gmaps.maps.Map(this.element[0], { center: { lat: lat, lng: lng }, zoom: zoom, disableDefaultUI: true, zoomControl: true }); return map; }, addMarker: function addMarker(lat, lng) { var marker_id = lat.toString() + '_' + lng.toString(); if (typeof this.markers[marker_id] != 'undefined') return false; var marker = new window.maps_controller.gmaps.maps.Marker({ position: { lat: lat, lng: lng }, map: this.map, icon: this.marker_icon }); this.markers[marker_id] = marker; return marker; } }); /***/ }), /***/ 200: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), Overlay = __webpack_require__(78), Slider = __webpack_require__(162), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'NewsBox', create: function create() { var self = this; this.page = 1; this.start_date = 0; this.finish_date = 0; this.category_id = false; this.busy = false; this.update_period_btn = false; this.load_more_btn = false; this.news_overlay_content = false; this.mode = this.element.data('mode'); this.url = this.element.data('url'); this.view_url = this.element.data('view-url'); this.overlay_element = $("#news-overlay"); this.overlay = new Overlay({ element: this.overlay_element, _onClose: function _onClose() { self.opened = false; } }); this.opened = false; this.news_overlay_content = this.overlay_element.find('#news-overlay-content'); this.setup_events(); this.load_more_btn = $('.js-load-more-news'); this.load_more_btn.css({ cursor: 'pointer' }).click(function () { self.load_more(); }); if (this.load_more_btn.length) { this.category_id = parseInt(this.load_more_btn.attr('category_id')); } var autoopen = document.querySelector('.js-autoopen-slug'); if (autoopen) { var autoopen_slug = autoopen.getAttribute('autoopen-slug'); if (autoopen_slug) { this.news_popup_overlay(null, autoopen_slug); } } if (window.location.hash.length) { var autoopen_slug = window.location.hash.substring(1); if (autoopen_slug) { $(window).bind('load', function () { self.news_popup_overlay(null, autoopen_slug); }); } } $(window).bind('update_calendar', function (e, calendar, start_date, finish_date) { self.set_period(start_date, finish_date); }); }, setup_events: function setup_events() { var self = this; this.element.find('.js-news-item').each(function (i, elm) { elm = $(elm); if (parseInt(elm.attr('data-events'))) { return; } var trigger_prc = parseInt(elm.data('sa-prc') || 0) / 100; window.app.sas.addElement(elm, null, trigger_prc); elm.click(function (e) { e.preventDefault(); e.stopPropagation(); self.news_popup_overlay(this); }).attr('data-events', 1); }); window.app.sas.scroll(); }, set_period: function set_period(start, finish) { this.start_date = start; this.finish_date = finish; this.page = 1; this.update(); }, gather_data: function gather_data() { return { page: this.page, start_date: this.start_date, finish_date: this.finish_date }; }, update: function update() { if (this.busy) { return; } var self = this, data = this.gather_data(); this.busy = true; $.ajax({ url: this.url, dataType: 'json', type: 'GET', data: data }).done(function (resp) { if (resp.error) { alert(resp.message); return; } if (resp.have_more) { self.load_more_btn.parent().removeClass('hidden'); } else { self.load_more_btn.parent().addClass('hidden'); } self.element.empty().html(resp.html); self.setup_events(); }).fail(function () { alert('Error updating news'); }).always(function () { self.busy = false; }); }, news_popup_overlay: function news_popup_overlay(elm, slug) { var self = this; this.news_overlay_content.empty(); var id = parseInt($(elm).attr('data-id')); slug = elm ? $(elm).attr('data-slug') : slug; if (!slug) { return; } $.ajax({ url: this.view_url.replace('#slug#', slug), dataType: 'json', type: 'GET', context: this }).done(function (data, textStatus, xhr) { if (data.error) { if (typeof window.console !== 'undefined' && typeof window.console.log === 'function') { window.console.log(data.message); } return; } self.news_overlay_content.html(data.html); self.overlay.open(function () { self.news_overlay_content.find('.js-slider').each(function (i, elm) { new Slider({ element: elm }); }); self.news_overlay_content.find('.js-close').click(function () { self.overlay.close(); }); }); self.opened = true; window.history.pushState({ section: 'news-overlay', article_id: id, article_slug: slug }, window.title, (self.mode === 'index' ? "/#" : "/news/") + slug); }).fail(function (xhr, textStatus, errorThrown) { if (typeof window.console !== 'undefined' && typeof window.console.log === 'function') { window.console.log(textStatus, errorThrown); } }).always(function () {}); }, load_more: function load_more() { this.page++; var self = this, data = this.gather_data(); $.ajax({ url: '/news.json', data: data, dataType: 'json', context: this }).done(function (resp) { if (resp.error) { alert(resp.message); return; } if (parseInt(resp.count) > 0) { self.element.append(resp.html); self.setup_events(); $(window).trigger('scroll'); } if (resp.have_more) { self.load_more_btn.parent().removeClass('hidden'); } else { self.load_more_btn.parent().addClass('hidden'); } }).fail(function (xhr, textStatus, errorThrown) { self.page--; alert(textStatus + ': ' + errorThrown); }); } }); /***/ }), /***/ 201: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), MinimalClass = __webpack_require__(1), MarkerClusterer = __webpack_require__(202), NOMUNMarker = __webpack_require__(203), InfoBubble = __webpack_require__(204), GoogleMapsLoader = __webpack_require__(175); window.openedBubbleElement = false; window.switchingBubbles = false; window.closeOpenedBubble = function () { if (window.switchingBubbles) { return; } if (window.openedBubbleElement) { window.openedBubbleElement.info_bubble.close(); window.openedBubbleElement = false; } }; window.openBubble = function (element) { window.closeOpenedBubble(); window.switchingBubbles = true; element.info_bubble.open(function () { window.switchingBubbles = false; }); window.openedBubbleElement = element; }; module.exports = MinimalClass.extend({ __className: 'InteractiveMap', create: function create() { var self = this; window.interactive_map = this; this.loading = false; this.loaded = false; this.autoload = this.element.data('autoload'); this.map_element = this.element.find('.google-map'); this.map = false; this.map_options = false; this.map_center = false; this.item = []; this.active_item = null; this.height = 0; this.inited = false; this.markers = false; this.start_time = new Date(); this.current_date = new Date($(document.body).data('current-time')); this.time_element = $('.js-interactive-map-time'); this.temperature_element = $('.js-interactive-map-temperature'); this.current_temperature = 0; $('.js-interactive-map-prev').click(function (e) { self.prev_item(e); }); $('.js-interactive-map-next').click(function (e) { self.next_item(e); }); this.shaders = $('.js-interactive-map-shader'); this.projects_modes = []; this.active_project_mode = false; $('.js-projects-mode-switcher li').each(function (i, elm) { var obj = $(elm), mode = obj.data('mode'), active = obj.hasClass('active'), item = { id: i, obj: obj, active: active, mode: mode, activate: function activate(dir) { if (this.active === dir) return; dir ? this.obj.addClass('active') : this.obj.removeClass('active'); this.active = dir; } }; if (item.active) { self.active_project_mode = item; } item.obj.click(function () { self.switch_project_mode(item); }); self.projects_modes.push(item); }); if (this.autoload) { this.preload(); } else { this.element.bind('load', function () { if (self.preload()) self.element.trigger('lazy_triggered'); }); } }, preload: function preload() { if (this.loading || this.loaded) return false; var self = this; this.loading = true; GoogleMapsLoader.KEY = 'AIzaSyB2vFxpc5M0ziaL27PAOOKPodcpJd-HnTk'; GoogleMapsLoader.LANGUAGE = this.map_lang; GoogleMapsLoader.VERSION = '3.38'; GoogleMapsLoader.load(function (google) { self.loaded = true; self.loading = false; self.initialize(); }); if (this.time_element.length) { this.timer = setInterval(function () { self.update_time(); }, 1000); } return true; }, update_time: function update_time() { var self = this, current_time = new Date(), diff = current_time.getTime() - this.start_time.getTime(), date = new Date(this.current_date.getTime() + diff); this.time_element.html(this.za(date.getHours()) + ':' + this.za(date.getMinutes())); }, switch_project_mode: function switch_project_mode(item) { if (this.active_project_mode) { $('.js-projects-map-box').removeClass(this.active_project_mode.mode); $('.js-prjects-controls').removeClass('mode-' + this.active_project_mode.mode); this.active_project_mode.activate(false); this.active_project_mode = null; } $('.js-projects-map-box').addClass(item.mode); $('.js-prjects-controls').addClass('mode-' + item.mode); item.activate(true); this.active_project_mode = item; }, initialize: function initialize() { var self = this; $.ajax({ type: 'GET', url: '/markers.json', dataType: 'json' }).done(function (resp) { if (resp.error) { alert(resp.message); return; } self.markers = resp.markers; self.draw_map_with_markers(); }).fail(function () { alert('Failed to load markers.'); }); $(window).resize(function () { self.resize(); }); window.app.add_resize(this); }, prev_item: function prev_item() { if (typeof window.sliders !== 'undefined' && typeof window.sliders.projects_photos !== 'undefined' && window.sliders.projects_photos.is_switching) { return; } var pos = this.active_item.marker.index - 1; if (pos < 0) { pos = this.item.length - 1; } this.set_item(this.item[pos]); this.map.panTo(this.active_item.marker.position); this.map.setZoom(8); }, next_item: function next_item() { if (typeof window.sliders !== 'undefined' && typeof window.sliders.projects_photos !== 'undefined' && window.sliders.projects_photos.is_switching) { return; } var pos = this.active_item.marker.index + 1; if (pos >= this.item.length) { pos = 0; } this.set_item(this.item[pos]); this.map.panTo(this.active_item.marker.position); this.map.setZoom(8); }, set_item: function set_item(item) { if (this.active_item) { this.active_item.marker.set_active(false); } this.active_item = item; this.active_item.marker.set_active(true); var self = this; var onComplete = function onComplete() { $('.js-project-coords').html(item.coords); $('.js-project-client').html(item.client); $('.js-project-work-types').html(item.work_types); self.current_date = new Date(item.current_time); self.update_time(); self.current_temperature = item.temperature ? (item.temperature < 0 ? '- ' : '+ ') + Math.abs(item.temperature) : '0'; self.temperature_element.html(self.current_temperature); }; if (!window.app.is_mobile && this.shaders.length) { this.shaders.addClass('animate').css({ transform: 'translate3d(0,0,0)' }); setTimeout(function () { onComplete(); self.shaders.css({ transform: 'translate3d(100%,0,0)' }); setTimeout(function () { self.shaders.removeClass('animate').css({ transform: 'translate3d(-100%,0,0)' }); }, 300); }, 300); } else { onComplete(); } if (typeof window.sliders !== 'undefined' && typeof window.sliders.projects_photos !== 'undefined') { window.sliders.projects_photos.switch_by_slide_id(item.id); } }, resize: function resize() {}, draw_map_with_markers: function draw_map_with_markers() { var self = this, coords = this.avg_coords(this.markers), mobile = window.app.is_mobile, desktop = !mobile; this.map_styles = __webpack_require__(205); this.map_center = new google.maps.LatLng(coords[0], coords[1]); this.map_options = { center: this.map_center, scrollwheel: false, zoom: mobile ? 2 : 3, zoomControlOptions: { position: google.maps.ControlPosition.RIGHT_TOP }, mapTypeControl: false, streetViewControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP, styles: this.map_styles }; this.map = new google.maps.Map(this.map_element[0], this.map_options); this.markerCluster = new MarkerClusterer(this.map, this.markers.map(function (markerData, i) { var marker = new NOMUNMarker({ position: { lat: parseFloat(markerData.lat), lng: parseFloat(markerData.lng) }, lat: parseFloat(markerData.lat), lng: parseFloat(markerData.lng), title: markerData.title, description: markerData.description, content: markerData.content, client: markerData.client, year: markerData.year, project_image: markerData.image, timezone: markerData.timezone, temperature: markerData.temperature, id: markerData.id, index: i, slug: markerData.slug }); self.item[i] = markerData; self.item[i].marker = marker; if (desktop) { // marker.info_bubble = new InfoBubble(marker, self.map, 'project'); google.maps.event.addListener(marker, 'click', function () { self.set_item(self.item[i]); // if (window.openedBubbleElement == marker) { // closeOpenedBubble(); // } else { // openBubble(marker); // } }); } else { google.maps.event.addListener(marker, 'click', function () { self.set_item(self.item[i]); if (typeof window.projects_list !== 'undefined') { window.projects_list.focus_project(marker.slug); } }); } return marker; }), { imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m', zoomOnClick: true, gridSize: 50, maxZoom: 7, averageCenter: true }); // google.maps.event.addListener(this.markerCluster, 'clusterclick', function (cluster) { // var zoom = self.map.getZoom(); // self.map.panTo(cluster.getCenter()); // self.map.setZoom(zoom > 11 ? 11 : zoom + 1); // // // if (window.openedBubbleElement == cluster) { // // closeOpenedBubble(); // // } else { // // cluster.info_bubble = new InfoBubble(cluster, self.map, 'cluster'); // // openBubble(cluster); // // } // }); this.set_item(this.item[0]); google.maps.event.addListener(this.map, 'click', closeOpenedBubble); google.maps.event.addListener(this.map, 'zoom_changed', closeOpenedBubble); if (!mobile) { this.markerCluster.fitMapToMarkers(); } google.maps.event.addListener(this.map, 'tilesloaded', function () { google.maps.event.clearListeners(self.map, 'tilesloaded'); self.element.trigger('loaded'); }); this.inited = true; }, avg_coords: function avg_coords(coords) { var avg_lat = 0, avg_lng = 0; for (var i = 0; i < coords.length; i++) { avg_lat += parseFloat(coords[i].lat); avg_lng += parseFloat(coords[i].lng); } avg_lat = avg_lat / coords.length; avg_lng = avg_lng / coords.length; return [avg_lat, avg_lng]; } }); /***/ }), /***/ 202: /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * @name MarkerClusterer for Google Maps v3 * @version version 1.0.1 * @author Luke Mahe * @fileoverview * The library creates and manages per-zoom-level clusters for large amounts of * markers. *
* This is a v3 implementation of the * v2 MarkerClusterer. */ /** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * A Marker Clusterer that clusters markers. * * @param {google.maps.Map} map The Google map to attach to. * @param {Array.=} opt_markers Optional markers to add to * the cluster. * @param {Object=} opt_options support the following options: * 'gridSize': (number) The grid size of a cluster in pixels. * 'maxZoom': (number) The maximum zoom level that a marker can be part of a * cluster. * 'zoomOnClick': (boolean) Whether the default behaviour of clicking on a * cluster is to zoom into it. * 'averageCenter': (boolean) Whether the center of each cluster should be * the average of all markers in the cluster. * 'minimumClusterSize': (number) The minimum number of markers to be in a * cluster before the markers are hidden and a count * is shown. * 'styles': (object) An object that has style properties: * 'url': (string) The image url. * 'height': (number) The image height. * 'width': (number) The image width. * 'anchor': (Array) The anchor position of the label text. * 'textColor': (string) The text color. * 'textSize': (number) The text size. * 'backgroundPosition': (string) The position of the backgound x, y. * @constructor * @extends google.maps.OverlayView */ function MarkerClusterer(map, opt_markers, opt_options) { // MarkerClusterer implements google.maps.OverlayView interface. We use the // extend function to extend MarkerClusterer with google.maps.OverlayView // because it might not always be available when the code is defined so we // look for it at the last possible moment. If it doesn't exist now then // there is no point going ahead :) this.extend(MarkerClusterer, google.maps.OverlayView); this.map_ = map; /** * @type {Array.} * @private */ this.markers_ = []; /** * @type {Array.} */ this.clusters_ = []; this.sizes = [53, 56, 66, 78, 90]; /** * @private */ this.styles_ = []; /** * @type {boolean} * @private */ this.ready_ = false; var options = opt_options || {}; /** * @type {number} * @private */ this.gridSize_ = options['gridSize'] || 60; /** * @private */ this.minClusterSize_ = options['minimumClusterSize'] || 2; /** * @type {?number} * @private */ this.maxZoom_ = options['maxZoom'] || null; this.styles_ = options['styles'] || []; /** * @type {string} * @private */ this.imagePath_ = options['imagePath'] || this.MARKER_CLUSTER_IMAGE_PATH_; /** * @type {string} * @private */ this.imageExtension_ = options['imageExtension'] || this.MARKER_CLUSTER_IMAGE_EXTENSION_; /** * @type {boolean} * @private */ this.zoomOnClick_ = true; if (options['zoomOnClick'] != undefined) { this.zoomOnClick_ = options['zoomOnClick']; } /** * @type {boolean} * @private */ this.averageCenter_ = false; if (options['averageCenter'] != undefined) { this.averageCenter_ = options['averageCenter']; } this.setupStyles_(); this.setMap(map); /** * @type {number} * @private */ this.prevZoom_ = this.map_.getZoom(); // Add the map event listeners var that = this; google.maps.event.addListener(this.map_, 'zoom_changed', function () { // Determines map type and prevent illegal zoom levels var zoom = that.map_.getZoom(); var minZoom = that.map_.minZoom || 0; var maxZoom = Math.min(that.map_.maxZoom || 100, that.map_.mapTypes[that.map_.getMapTypeId()].maxZoom); zoom = Math.min(Math.max(zoom, minZoom), maxZoom); if (that.prevZoom_ != zoom) { that.prevZoom_ = zoom; that.resetViewport(); } }); google.maps.event.addListener(this.map_, 'idle', function () { that.redraw(); }); // Finally, add the markers if (opt_markers && (opt_markers.length || Object.keys(opt_markers).length)) { this.addMarkers(opt_markers, false); } } /** * The marker cluster image path. * * @type {string} * @private */ MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_ = '../images/m'; /** * The marker cluster image path. * * @type {string} * @private */ MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_ = 'png'; /** * Extends a objects prototype by anothers. * * @param {Object} obj1 The object to be extended. * @param {Object} obj2 The object to extend with. * @return {Object} The new extended object. * @ignore */ MarkerClusterer.prototype.extend = function (obj1, obj2) { return function (object) { for (var property in object.prototype) { this.prototype[property] = object.prototype[property]; } return this; }.apply(obj1, [obj2]); }; /** * Implementaion of the interface method. * @ignore */ MarkerClusterer.prototype.onAdd = function () { this.setReady_(true); }; /** * Implementaion of the interface method. * @ignore */ MarkerClusterer.prototype.draw = function () {}; /** * Sets up the styles object. * * @private */ MarkerClusterer.prototype.setupStyles_ = function () { if (this.styles_.length) { return; } for (var i = 0, size; size = this.sizes[i]; i++) { this.styles_.push({ url: this.imagePath_ + (i + 1) + '.' + this.imageExtension_, height: size, width: size }); } }; /** * Fit the map to the bounds of the markers in the clusterer. */ MarkerClusterer.prototype.fitMapToMarkers = function () { var markers = this.getMarkers(); var bounds = new google.maps.LatLngBounds(); for (var i = 0, marker; marker = markers[i]; i++) { bounds.extend(marker.getPosition()); } this.map_.fitBounds(bounds); }; /** * Sets the styles. * * @param {Object} styles The style to set. */ MarkerClusterer.prototype.setStyles = function (styles) { this.styles_ = styles; }; /** * Gets the styles. * * @return {Object} The styles object. */ MarkerClusterer.prototype.getStyles = function () { return this.styles_; }; /** * Whether zoom on click is set. * * @return {boolean} True if zoomOnClick_ is set. */ MarkerClusterer.prototype.isZoomOnClick = function () { return this.zoomOnClick_; }; /** * Whether average center is set. * * @return {boolean} True if averageCenter_ is set. */ MarkerClusterer.prototype.isAverageCenter = function () { return this.averageCenter_; }; /** * Returns the array of markers in the clusterer. * * @return {Array.} The markers. */ MarkerClusterer.prototype.getMarkers = function () { return this.markers_; }; /** * Returns the number of markers in the clusterer * * @return {Number} The number of markers. */ MarkerClusterer.prototype.getTotalMarkers = function () { return this.markers_.length; }; /** * Sets the max zoom for the clusterer. * * @param {number} maxZoom The max zoom level. */ MarkerClusterer.prototype.setMaxZoom = function (maxZoom) { this.maxZoom_ = maxZoom; }; /** * Gets the max zoom for the clusterer. * * @return {number} The max zoom level. */ MarkerClusterer.prototype.getMaxZoom = function () { return this.maxZoom_; }; /** * The function for calculating the cluster icon image. * * @param {Array.} markers The markers in the clusterer. * @param {number} numStyles The number of styles available. * @return {Object} A object properties: 'text' (string) and 'index' (number). * @private */ MarkerClusterer.prototype.calculator_ = function (markers, numStyles) { var index = 0; var count = markers.length; var dv = count; while (dv !== 0) { dv = parseInt(dv / 10, 10); index++; } index = Math.min(index, numStyles); return { text: count, index: index }; }; /** * Set the calculator function. * * @param {function(Array, number)} calculator The function to set as the * calculator. The function should return a object properties: * 'text' (string) and 'index' (number). * */ MarkerClusterer.prototype.setCalculator = function (calculator) { this.calculator_ = calculator; }; /** * Get the calculator function. * * @return {function(Array, number)} the calculator function. */ MarkerClusterer.prototype.getCalculator = function () { return this.calculator_; }; /** * Add an array of markers to the clusterer. * * @param {Array.} markers The markers to add. * @param {boolean=} opt_nodraw Whether to redraw the clusters. */ MarkerClusterer.prototype.addMarkers = function (markers, opt_nodraw) { if (markers.length) { for (var i = 0, marker; marker = markers[i]; i++) { this.pushMarkerTo_(marker); } } else if (Object.keys(markers).length) { for (var marker in markers) { this.pushMarkerTo_(markers[marker]); } } if (!opt_nodraw) { this.redraw(); } }; /** * Pushes a marker to the clusterer. * * @param {google.maps.Marker} marker The marker to add. * @private */ MarkerClusterer.prototype.pushMarkerTo_ = function (marker) { marker.isAdded = false; if (marker['draggable']) { // If the marker is draggable add a listener so we update the clusters on // the drag end. var that = this; google.maps.event.addListener(marker, 'dragend', function () { marker.isAdded = false; that.repaint(); }); } this.markers_.push(marker); }; /** * Adds a marker to the clusterer and redraws if needed. * * @param {google.maps.Marker} marker The marker to add. * @param {boolean=} opt_nodraw Whether to redraw the clusters. */ MarkerClusterer.prototype.addMarker = function (marker, opt_nodraw) { this.pushMarkerTo_(marker); if (!opt_nodraw) { this.redraw(); } }; /** * Removes a marker and returns true if removed, false if not * * @param {google.maps.Marker} marker The marker to remove * @return {boolean} Whether the marker was removed or not * @private */ MarkerClusterer.prototype.removeMarker_ = function (marker) { var index = -1; if (this.markers_.indexOf) { index = this.markers_.indexOf(marker); } else { for (var i = 0, m; m = this.markers_[i]; i++) { if (m == marker) { index = i; break; } } } if (index == -1) { // Marker is not in our list of markers. return false; } marker.setMap(null); this.markers_.splice(index, 1); return true; }; /** * Remove a marker from the cluster. * * @param {google.maps.Marker} marker The marker to remove. * @param {boolean=} opt_nodraw Optional boolean to force no redraw. * @return {boolean} True if the marker was removed. */ MarkerClusterer.prototype.removeMarker = function (marker, opt_nodraw) { var removed = this.removeMarker_(marker); if (!opt_nodraw && removed) { this.resetViewport(); this.redraw(); return true; } else { return false; } }; /** * Removes an array of markers from the cluster. * * @param {Array.} markers The markers to remove. * @param {boolean=} opt_nodraw Optional boolean to force no redraw. */ MarkerClusterer.prototype.removeMarkers = function (markers, opt_nodraw) { var removed = false; for (var i = 0, marker; marker = markers[i]; i++) { var r = this.removeMarker_(marker); removed = removed || r; } if (!opt_nodraw && removed) { this.resetViewport(); this.redraw(); return true; } }; /** * Sets the clusterer's ready state. * * @param {boolean} ready The state. * @private */ MarkerClusterer.prototype.setReady_ = function (ready) { if (!this.ready_) { this.ready_ = ready; this.createClusters_(); } }; /** * Returns the number of clusters in the clusterer. * * @return {number} The number of clusters. */ MarkerClusterer.prototype.getTotalClusters = function () { return this.clusters_.length; }; /** * Returns the google map that the clusterer is associated with. * * @return {google.maps.Map} The map. */ MarkerClusterer.prototype.getMap = function () { return this.map_; }; /** * Sets the google map that the clusterer is associated with. * * @param {google.maps.Map} map The map. */ MarkerClusterer.prototype.setMap = function (map) { this.map_ = map; }; /** * Returns the size of the grid. * * @return {number} The grid size. */ MarkerClusterer.prototype.getGridSize = function () { return this.gridSize_; }; /** * Sets the size of the grid. * * @param {number} size The grid size. */ MarkerClusterer.prototype.setGridSize = function (size) { this.gridSize_ = size; }; /** * Returns the min cluster size. * * @return {number} The grid size. */ MarkerClusterer.prototype.getMinClusterSize = function () { return this.minClusterSize_; }; /** * Sets the min cluster size. * * @param {number} size The grid size. */ MarkerClusterer.prototype.setMinClusterSize = function (size) { this.minClusterSize_ = size; }; /** * Extends a bounds object by the grid size. * * @param {google.maps.LatLngBounds} bounds The bounds to extend. * @return {google.maps.LatLngBounds} The extended bounds. */ MarkerClusterer.prototype.getExtendedBounds = function (bounds) { var projection = this.getProjection(); // Turn the bounds into latlng. var tr = new google.maps.LatLng(bounds.getNorthEast().lat(), bounds.getNorthEast().lng()); var bl = new google.maps.LatLng(bounds.getSouthWest().lat(), bounds.getSouthWest().lng()); // Convert the points to pixels and the extend out by the grid size. var trPix = projection.fromLatLngToDivPixel(tr); trPix.x += this.gridSize_; trPix.y -= this.gridSize_; var blPix = projection.fromLatLngToDivPixel(bl); blPix.x -= this.gridSize_; blPix.y += this.gridSize_; // Convert the pixel points back to LatLng var ne = projection.fromDivPixelToLatLng(trPix); var sw = projection.fromDivPixelToLatLng(blPix); // Extend the bounds to contain the new bounds. bounds.extend(ne); bounds.extend(sw); return bounds; }; /** * Determins if a marker is contained in a bounds. * * @param {google.maps.Marker} marker The marker to check. * @param {google.maps.LatLngBounds} bounds The bounds to check against. * @return {boolean} True if the marker is in the bounds. * @private */ MarkerClusterer.prototype.isMarkerInBounds_ = function (marker, bounds) { return bounds.contains(marker.getPosition()); }; /** * Clears all clusters and markers from the clusterer. */ MarkerClusterer.prototype.clearMarkers = function () { this.resetViewport(true); // Set the markers a empty array. this.markers_ = []; }; /** * Clears all existing clusters and recreates them. * @param {boolean} opt_hide To also hide the marker. */ MarkerClusterer.prototype.resetViewport = function (opt_hide) { // Remove all the clusters for (var i = 0, cluster; cluster = this.clusters_[i]; i++) { cluster.remove(); } // Reset the markers to not be added and to be invisible. for (var i = 0, marker; marker = this.markers_[i]; i++) { marker.isAdded = false; if (opt_hide) { marker.setMap(null); } } this.clusters_ = []; }; /** * */ MarkerClusterer.prototype.repaint = function () { var oldClusters = this.clusters_.slice(); this.clusters_.length = 0; this.resetViewport(); this.redraw(); // Remove the old clusters. // Do it in a timeout so the other clusters have been drawn first. window.setTimeout(function () { for (var i = 0, cluster; cluster = oldClusters[i]; i++) { cluster.remove(); } }, 0); }; /** * Redraws the clusters. */ MarkerClusterer.prototype.redraw = function () { this.createClusters_(); }; /** * Calculates the distance between two latlng locations in km. * @see http://www.movable-type.co.uk/scripts/latlong.html * * @param {google.maps.LatLng} p1 The first lat lng point. * @param {google.maps.LatLng} p2 The second lat lng point. * @return {number} The distance between the two points in km. * @private */ MarkerClusterer.prototype.distanceBetweenPoints_ = function (p1, p2) { if (!p1 || !p2) { return 0; } var R = 6371; // Radius of the Earth in km var dLat = (p2.lat() - p1.lat()) * Math.PI / 180; var dLon = (p2.lng() - p1.lng()) * Math.PI / 180; var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) * Math.sin(dLon / 2) * Math.sin(dLon / 2); var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); var d = R * c; return d; }; /** * Add a marker to a cluster, or creates a new cluster. * * @param {google.maps.Marker} marker The marker to add. * @private */ MarkerClusterer.prototype.addToClosestCluster_ = function (marker) { var distance = 40000; // Some large number var clusterToAddTo = null; var pos = marker.getPosition(); for (var i = 0, cluster; cluster = this.clusters_[i]; i++) { var center = cluster.getCenter(); if (center) { var d = this.distanceBetweenPoints_(center, marker.getPosition()); if (d < distance) { distance = d; clusterToAddTo = cluster; } } } if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) { clusterToAddTo.addMarker(marker); } else { var cluster = new Cluster(this); cluster.addMarker(marker); this.clusters_.push(cluster); } }; /** * Creates the clusters. * * @private */ MarkerClusterer.prototype.createClusters_ = function () { if (!this.ready_) { return; } // Get our current map view bounds. // Create a new bounds object so we don't affect the map. var mapBounds = new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(), this.map_.getBounds().getNorthEast()); var bounds = this.getExtendedBounds(mapBounds); for (var i = 0, marker; marker = this.markers_[i]; i++) { if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) { this.addToClosestCluster_(marker); } } }; /** * A cluster that contains markers. * * @param {MarkerClusterer} markerClusterer The markerclusterer that this * cluster is associated with. * @constructor * @ignore */ function Cluster(markerClusterer) { this.markerClusterer_ = markerClusterer; this.map_ = markerClusterer.getMap(); this.gridSize_ = markerClusterer.getGridSize(); this.minClusterSize_ = markerClusterer.getMinClusterSize(); this.averageCenter_ = markerClusterer.isAverageCenter(); this.center_ = null; this.markers_ = []; this.bounds_ = null; this.clusterIcon_ = new ClusterIcon(this, markerClusterer.getStyles(), markerClusterer.getGridSize()); } /** * Determins if a marker is already added to the cluster. * * @param {google.maps.Marker} marker The marker to check. * @return {boolean} True if the marker is already added. */ Cluster.prototype.isMarkerAlreadyAdded = function (marker) { if (this.markers_.indexOf) { return this.markers_.indexOf(marker) != -1; } else { for (var i = 0, m; m = this.markers_[i]; i++) { if (m == marker) { return true; } } } return false; }; /** * Add a marker the cluster. * * @param {google.maps.Marker} marker The marker to add. * @return {boolean} True if the marker was added. */ Cluster.prototype.addMarker = function (marker) { if (this.isMarkerAlreadyAdded(marker)) { return false; } if (!this.center_) { this.center_ = marker.getPosition(); this.calculateBounds_(); } else { if (this.averageCenter_) { var l = this.markers_.length + 1; var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l; var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l; this.center_ = new google.maps.LatLng(lat, lng); this.calculateBounds_(); } } marker.isAdded = true; this.markers_.push(marker); var len = this.markers_.length; if (len < this.minClusterSize_ && marker.getMap() != this.map_) { // Min cluster size not reached so show the marker. marker.setMap(this.map_); } if (len == this.minClusterSize_) { // Hide the markers that were showing. for (var i = 0; i < len; i++) { this.markers_[i].setMap(null); } } if (len >= this.minClusterSize_) { marker.setMap(null); } this.updateIcon(); return true; }; /** * Returns the marker clusterer that the cluster is associated with. * * @return {MarkerClusterer} The associated marker clusterer. */ Cluster.prototype.getMarkerClusterer = function () { return this.markerClusterer_; }; /** * Returns the bounds of the cluster. * * @return {google.maps.LatLngBounds} the cluster bounds. */ Cluster.prototype.getBounds = function () { var bounds = new google.maps.LatLngBounds(this.center_, this.center_); var markers = this.getMarkers(); for (var i = 0, marker; marker = markers[i]; i++) { bounds.extend(marker.getPosition()); } return bounds; }; /** * Removes the cluster */ Cluster.prototype.remove = function () { this.clusterIcon_.remove(); this.markers_.length = 0; delete this.markers_; }; /** * Returns the center of the cluster. * * @return {number} The cluster center. */ Cluster.prototype.getSize = function () { return this.markers_.length; }; /** * Returns the center of the cluster. * * @return {Array.} The cluster center. */ Cluster.prototype.getMarkers = function () { return this.markers_; }; /** * Returns the center of the cluster. * * @return {google.maps.LatLng} The cluster center. */ Cluster.prototype.getCenter = function () { return this.center_; }; /** * Calculated the extended bounds of the cluster with the grid. * * @private */ Cluster.prototype.calculateBounds_ = function () { var bounds = new google.maps.LatLngBounds(this.center_, this.center_); this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds); }; /** * Determines if a marker lies in the clusters bounds. * * @param {google.maps.Marker} marker The marker to check. * @return {boolean} True if the marker lies in the bounds. */ Cluster.prototype.isMarkerInClusterBounds = function (marker) { return this.bounds_.contains(marker.getPosition()); }; /** * Returns the map that the cluster is associated with. * * @return {google.maps.Map} The map. */ Cluster.prototype.getMap = function () { return this.map_; }; /** * Updates the cluster icon */ Cluster.prototype.updateIcon = function () { var zoom = this.map_.getZoom(); var mz = this.markerClusterer_.getMaxZoom(); if (mz && zoom > mz) { // The zoom is greater than our max zoom so show all the markers in cluster. for (var i = 0, marker; marker = this.markers_[i]; i++) { marker.setMap(this.map_); } return; } if (this.markers_.length < this.minClusterSize_) { // Min cluster size not yet reached. this.clusterIcon_.hide(); return; } var numStyles = this.markerClusterer_.getStyles().length; var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles); this.clusterIcon_.setCenter(this.center_); this.clusterIcon_.setSums(sums); this.clusterIcon_.show(); }; /** * A cluster icon * * @param {Cluster} cluster The cluster to be associated with. * @param {Object} styles An object that has style properties: * 'url': (string) The image url. * 'height': (number) The image height. * 'width': (number) The image width. * 'anchor': (Array) The anchor position of the label text. * 'textColor': (string) The text color. * 'textSize': (number) The text size. * 'backgroundPosition: (string) The background postition x, y. * @param {number=} opt_padding Optional padding to apply to the cluster icon. * @constructor * @extends google.maps.OverlayView * @ignore */ function ClusterIcon(cluster, styles, opt_padding) { cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView); this.styles_ = styles; this.padding_ = opt_padding || 0; this.cluster_ = cluster; this.center_ = null; this.map_ = cluster.getMap(); this.div_ = null; this.sums_ = null; this.visible_ = false; this.setMap(this.map_); } /** * Triggers the clusterclick event and zoom's if the option is set. */ ClusterIcon.prototype.triggerClusterClick = function () { var markerClusterer = this.cluster_.getMarkerClusterer(); // Trigger the clusterclick event. google.maps.event.trigger(markerClusterer, 'clusterclick', this.cluster_); if (markerClusterer.isZoomOnClick()) { // Zoom into the cluster. this.map_.fitBounds(this.cluster_.getBounds()); } }; /** * Adding the cluster icon to the dom. * @ignore */ ClusterIcon.prototype.onAdd = function () { this.div_ = document.createElement('DIV'); this.div_.className = 'nomun_cluster'; this.div_.style.display = 'none'; this.number_div_ = document.createElement('DIV'); this.number_div_.className = 'nomun_cluster_number'; this.div_.appendChild(this.number_div_); if (this.visible_) { var pos = this.getPosFromLatLng_(this.center_); this.div_.style.cssText = this.createCss(pos); this.number_div_.innerHTML = this.sums_.text; } var panes = this.getPanes(); panes.overlayMouseTarget.appendChild(this.div_); var that = this; google.maps.event.addDomListener(this.div_, 'click', function () { that.triggerClusterClick(); }); }; /** * Returns the position to place the div dending on the latlng. * * @param {google.maps.LatLng} latlng The position in latlng. * @return {google.maps.Point} The position in pixels. * @private */ ClusterIcon.prototype.getPosFromLatLng_ = function (latlng) { var pos = this.getProjection().fromLatLngToDivPixel(latlng); pos.x -= parseInt(this.width_ / 2, 10); pos.y -= parseInt(this.height_ / 2, 10); return pos; }; /** * Draw the icon. * @ignore */ ClusterIcon.prototype.draw = function () { if (this.visible_) { var pos = this.getPosFromLatLng_(this.center_); this.div_.style.top = pos.y + 'px'; this.div_.style.left = pos.x + 'px'; } }; /** * Hide the icon. */ ClusterIcon.prototype.hide = function () { if (this.div_) { this.div_.style.display = 'none'; } this.visible_ = false; }; /** * Position and show the icon. */ ClusterIcon.prototype.show = function () { if (this.div_) { var pos = this.getPosFromLatLng_(this.center_); this.div_.style.cssText = this.createCss(pos); this.div_.style.display = ''; } this.visible_ = true; }; /** * Remove the icon from the map */ ClusterIcon.prototype.remove = function () { this.setMap(null); }; /** * Implementation of the onRemove interface. * @ignore */ ClusterIcon.prototype.onRemove = function () { if (this.div_ && this.div_.parentNode) { this.hide(); this.div_.parentNode.removeChild(this.div_); this.div_ = null; } }; /** * Set the sums of the icon. * * @param {Object} sums The sums containing: * 'text': (string) The text to display in the icon. * 'index': (number) The style index of the icon. */ ClusterIcon.prototype.setSums = function (sums) { this.sums_ = sums; this.text_ = sums.text; this.index_ = sums.index; if (this.div_) { this.div_.innerHTML = sums.text; } this.useStyle(); }; /** * Sets the icon to the the styles. */ ClusterIcon.prototype.useStyle = function () { var index = Math.max(0, this.sums_.index - 1); index = Math.min(this.styles_.length - 1, index); var style = this.styles_[index]; this.url_ = style['url']; this.height_ = style['height']; this.width_ = style['width']; this.textColor_ = style['textColor']; this.anchor_ = style['anchor']; this.textSize_ = style['textSize']; this.backgroundPosition_ = style['backgroundPosition']; }; /** * Sets the center of the icon. * * @param {google.maps.LatLng} center The latlng to set as the center. */ ClusterIcon.prototype.setCenter = function (center) { this.center_ = center; }; /** * Create the css text based on the position of the icon. * * @param {google.maps.Point} pos The position. * @return {string} The css style text. */ ClusterIcon.prototype.createCss = function (pos) { var style = []; // style.push('background-image:url(' + this.url_ + ');'); // var backgroundPosition = this.backgroundPosition_ ? this.backgroundPosition_ : '0 0'; // style.push('background-position:' + backgroundPosition + ';'); // if (typeof this.anchor_ === 'object') { // if (typeof this.anchor_[0] === 'number' && this.anchor_[0] > 0 && // this.anchor_[0] < this.height_) { // style.push('height:' + (this.height_ - this.anchor_[0]) + // 'px; padding-top:' + this.anchor_[0] + 'px;'); // } else { // style.push('height:' + this.height_ + 'px; line-height:' + this.height_ + // 'px;'); // } // if (typeof this.anchor_[1] === 'number' && this.anchor_[1] > 0 && // this.anchor_[1] < this.width_) { // style.push('width:' + (this.width_ - this.anchor_[1]) + // 'px; padding-left:' + this.anchor_[1] + 'px;'); // } else { // style.push('width:' + this.width_ + 'px; text-align:center;'); // } // } else { // style.push('height:' + this.height_ + 'px; line-height:' + // this.height_ + 'px; width:' + this.width_ + 'px; text-align:center;'); // } // var txtColor = this.textColor_ ? this.textColor_ : 'black'; // var txtSize = this.textSize_ ? this.textSize_ : 11; // style.push('cursor:pointer; top:' + pos.y + 'px; left:' + // pos.x + 'px; color:' + txtColor + '; position:absolute; font-size:' + // txtSize + 'px; font-family:Arial,sans-serif; font-weight:bold'); style.push('cursor:pointer; top:' + pos.y + 'px; left:' + pos.x + 'px;'); return style.join(''); }; module.exports = MarkerClusterer; /***/ }), /***/ 203: /***/ (function(module, exports, __webpack_require__) { "use strict"; function NOMUNMarker(opt) { this.extend(NOMUNMarker, window.google.maps.OverlayView); for (var k in opt) { this[k] = opt[k]; } this.position = new google.maps.LatLng(opt.position.lat, opt.position.lng); this.div = false; this.activated = false; } NOMUNMarker.prototype.extend = function (obj1, obj2) { return function (object) { for (var property in object.prototype) { this.prototype[property] = object.prototype[property]; } return this; }.apply(obj1, [obj2]); }; NOMUNMarker.prototype.draw = function () { var self = this, div = this.div; if (!div) { div = this.div = document.createElement('div'); div.className = 'nomun_marker' + (this.activated ? ' active' : ''); google.maps.event.addDomListener(div, "click", function (event) { google.maps.event.trigger(self, "click"); }); this.getPanes().overlayImage.appendChild(div); } var point = this.getProjection().fromLatLngToDivPixel(this.position); if (point) { div.style.left = point.x + 'px'; div.style.top = point.y + 'px'; } }; NOMUNMarker.prototype.remove = function () { if (this.div) { this.div.parentNode.removeChild(this.div); this.div = null; } }; NOMUNMarker.prototype.getPosition = function () { return this.position; }; NOMUNMarker.prototype.set_active = function (active) { this.activated = active; if (typeof this.div == 'undefined' || !this.div) { return; } this.div.className = 'nomun_marker' + (this.activated ? ' active' : ''); }; module.exports = NOMUNMarker; /***/ }), /***/ 204: /***/ (function(module, exports, __webpack_require__) { "use strict"; function InfoBubble(pin, map, mode, no_pan) { this.extend(InfoBubble, window.google.maps.OverlayView); this.refMap = map; this.mode = mode; this.no_pan = no_pan || false; this.element = false; this.arrow = false; this.content = false; this.closeBtn = false; this.cancelDraggingOnOpen = false; this.hidePinOnOpen = false; this.cluster = false; this.opened = false; switch (this.mode) { case 'cluster': this.cluster = pin; this.pos = pin.getCenter(); this.cancelDraggingOnOpen = true; break; case 'contact': this.pin = pin; this.pos = pin.getPosition(); this.hidePinOnOpen = true; break; case 'project': default: this.pin = pin; this.pos = new window.google.maps.LatLng(pin.lat, pin.lng); this.cancelDraggingOnOpen = true; break; } }; InfoBubble.prototype.extend = function (obj1, obj2) { return function (object) { for (var property in object.prototype) { this.prototype[property] = object.prototype[property]; }return this; }.apply(obj1, [obj2]); }; InfoBubble.prototype.onRemove = function () { this.element.remove(); this.element = false; }; InfoBubble.prototype.onAdd = function () { if (!this.element) { var self = this; var element = $('
').addClass('InfoBubble ' + this.mode); this.arrow = $('
').addClass('infoBubbleArrow').appendTo(element); this.content = $('
').addClass('infoBubbleCnt').appendTo(element); this.wndScroll = false; this.wnd = $('
').addClass('infoBubbleWnd').appendTo(this.content); var with_scroll = false, with_close = false; var html = '
'; switch (this.mode) { case 'cluster': var markers = this.cluster.getMarkers(); for (var i = 0; i < markers.length; i++) { html += '

' + markers[i].title + '

Описание проекта

'; } with_scroll = true; break; case 'contact': html += this.pin.address; with_close = true; break; default: html += '
' + i18n_coords + '
' + this.pin.description + '

' + i18n_customer + '
' + this.pin.client + '
'; break; } html += '
'; if (with_scroll) { html += '
'; } this.wnd.html(html); if (with_scroll) { this.wndScroll = new infoBubbleScroll(this.wnd); } switch (this.mode) { case 'project': element.click(function (e) { e.preventDefault(); e.stopPropagation(); if (typeof window.projects_list !== 'undefined') { window.projects_list.focus_project(self.pin.alias); } }); break; case 'contact': element.bind('click', function (e) { e.preventDefault(); e.stopPropagation(); self.close(); }); break; } if (with_close) { this.closeBtn = $('
').addClass('infoBubbleClose').appendTo(this.content); this.closeBtn.bind('click', function (e) { e.preventDefault(); e.stopPropagation(); self.close(); }); } this.element = element; var panes = this.getPanes(); panes.floatPane.appendChild(this.element[0]); } var new_map_center = this.pos; if (typeof this.pin !== 'undefined' && typeof this.pin.map_center === 'function') { new_map_center = this.pin.map_center(); } if (!this.no_pan) { this.map.panTo(new_map_center); } }; InfoBubble.prototype.draw = function () { this.repos(); }; InfoBubble.prototype.repos = function () { var overlayProjection = this.getProjection(), position = overlayProjection.fromLatLngToDivPixel(this.pos); // var containerPosition = overlayProjection.fromLatLngToContainerPixel(this.pos); switch (this.mode) { case 'contact': this.element.css({ left: Math.round(position.x), top: Math.round(position.y - 14), zIndex: 1000 }); break; default: this.element.css({ left: Math.round(position.x + (this.mode === 'cluster' ? 10 : 20)), top: Math.round(position.y + (this.mode === 'cluster' ? -10 : 8)), zIndex: 1000 }); break; } if (this.wndScroll) { this.wndScroll.resize(); } switch (this.mode) { case 'contact': this.content.css({ top: -Math.round(this.content.height()), left: -Math.round(this.content.width() / 2) }); break; default: this.content.css({ top: -Math.round(this.content.outerHeight(true) / 2) - 8 }); break; } }; InfoBubble.prototype.open = function (cb) { this.setMap(this.refMap); if (this.hidePinOnOpen) { if (this.pin) { this.pin.setMap(null); } else if (this.cluster) { this.cluster.clusterIcon_.hide(); } } this.open_(cb); return true; }; InfoBubble.prototype.open_ = function (cb) { var self = this, interval = setInterval(function () { if (self.element) { clearInterval(interval); interval = null; self.element.css({ display: 'block' }); self.wnd.css({ position: 'absolute' }); self.content.css({ width: Math.min(350, self.wnd.outerWidth(true)) }); self.wnd.css({ position: 'relative' }); if (self.cancelDraggingOnOpen) { self.refMap.setOptions({ draggable: false }); } self.opened = true; if (typeof cb === 'function') { cb(); } } }, 50); }; InfoBubble.prototype.close = function (cb) { var self = this, interval = setInterval(function () { if (self.element) { clearInterval(interval); self.element.css({ display: 'none' }); if (self.hidePinOnOpen) { if (self.pin) { self.pin.setMap(self.refMap); } else if (self.cluster) { self.cluster.clusterIcon_.show(); } } if (self.cancelDraggingOnOpen) { self.refMap.setOptions({ draggable: true }); } self.opened = false; self.close_(cb); } }, 50); return true; }; InfoBubble.prototype.getPosition = function () { return this.pos; }; InfoBubble.prototype.close_ = function (cb) { this.setMap(null); if (typeof cb === 'function') { cb(); } return true; }; function infoBubbleScroll(element) { this.element = element; this.maxHeight = 450; this.scrolling = false; this.scrollerHeight = 0; this.height = 0; this.contentHeight = 0; this.ypos = 0; this.maxScroll = 0; this.init(); } infoBubbleScroll.prototype.init = function () { this.scroller = this.element.find('.scroller'); this.content = this.element.find('.content'); // this.resize(); }; infoBubbleScroll.prototype.resize = function () { this.element.css({ height: 'auto' }); this.contentHeight = this.content.outerHeight(true); if (this.contentHeight > this.maxHeight) { this.element.addClass('scrolling'); this.element.css({ height: this.maxHeight }); this.height = this.maxHeight; this.maxScroll = -(this.contentHeight - this.height); if (!this.scrolling) { this.scrolling = true; this.scrollerHeight = Math.round(this.height / this.contentHeight * 100); this.scroller.css({ height: this.scrollerHeight + '%' }); var self = this; this.element.mousewheel(function (e) { e.preventDefault(); e.stopPropagation(); self.ypos += e.deltaY * 30; self.ypos = Math.max(Math.min(0, self.ypos), self.maxScroll); self.content.css({ top: self.ypos }); var scrollerTop = self.ypos / self.maxScroll * ((100 - self.scrollerHeight) / 100) * 100; self.scroller.css({ top: scrollerTop + '%' }); }); } } }; module.exports = InfoBubble; /***/ }), /***/ 205: /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = [{ stylers: [{ invert_lightness: true }] }, { featureType: "landscape.man_made", stylers: [{ saturation: -100 }, { lightness: 18 }, { visibility: "simplified" }, { gamma: 0.8 }] }, { featureType: "landscape.natural", stylers: [{ visibility: "simplified" }, { saturation: -100 }, { lightness: 18 }, { gamma: 0.8 }] }, { featureType: "road", stylers: [{ hue: "#009a67" }, { invert_lightness: false }, { lightness: -15 }] }, { featureType: "poi", stylers: [{ visibility: "off" }] }, { featureType: "transit.station", stylers: [{ invert_lightness: true }] }, { featureType: "water", stylers: [{ lightness: 15 }, { hue: "#0077ff" }, { saturation: -35 }, { gamma: 1.25 }] }]; /***/ }), /***/ 206: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'TextsSwitcher', pre: function pre() { this.duration = 600; }, create: function create() { var self = this; this.is_switching = false; this.duration = parseInt(this.element.data('duration') || this.duration); this.pos = 0; this.item = []; this.element.find('.js-item').each(function (i, elm) { var obj = $(elm), active = obj.hasClass('active'), item = { id: i, obj: obj, active: active, activate: function activate(dir) { if (this.active == dir) return; var item = this; if (dir) { this.obj.addClass('active'); } else { this.obj.addClass('inactive'); setTimeout(function () { item.obj.removeClass('active inactive'); }, self.duration); } this.active = dir; } }; if (item.active) { self.pos = item.id; } self.item.push(item); }); }, next: function next(quick, from_user) { var pos = this.pos + 1; if (pos > this.item.length - 1) { pos = 0; } this.switchto(pos, true, quick, from_user); }, prev: function prev(quick, from_user) { var pos = this.pos - 1; if (pos < 0) { pos = this.item.length - 1; } this.switchto(pos, false, quick, from_user); }, switchto: function switchto(pos, dir, quick, from_user) { if (this.pos == pos) return; if (this.is_switching) return; this.is_switching = true; from_user && this.delegate && this.delegate.element.trigger('switching_to', [this, pos, dir]); var self = this, cur = this.item[this.pos], nxt = this.item[pos]; cur.activate(false); setTimeout(function () { nxt.activate(true); setTimeout(function () { self.is_switching = false; }, self.duration); }, self.duration); this.pos = pos; } }); /***/ }), /***/ 239: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), Slider = __webpack_require__(162), TextsSwitcher = __webpack_require__(206), StaticSliceSlider = __webpack_require__(252), MapsController = __webpack_require__(197); var DialNumber = __webpack_require__(250); __webpack_require__(247); module.exports = function () { var about_dial_number = null, index_main_slider = null, numbers_slider = null; window.app.map_modules({ '#news-box': __webpack_require__(200), '.js-history': __webpack_require__(256), '#park-svg': __webpack_require__(254), '.js-projects-list': __webpack_require__(260), '.js-leaderships': __webpack_require__(207), '.js-projects-photos-slider': { module: Slider, options: { load_on_demand: true } }, '.js-about-dial-number': { module: DialNumber, callback: function callback(i) { about_dial_number = i; } }, '.js-number-slider': { module: Slider, callback: function callback(i) { numbers_slider = i; } }, '#interactive-map': __webpack_require__(201), '.js-cars': __webpack_require__(248), // '.js-stories-slider': { // module: require('../../lib/slider/Slider'), // callback: function(i){ window.stories_slider = i; } // }, // '.js-faces-slider': { // module: require('../FacesSlider'), // callback: function(i){ window.faces_slider = i; } // }, '.js-index-main-slider': { module: Slider, callback: function callback(i) { index_main_slider = i; } }, '.js-static-slice-stories-slider': { module: StaticSliceSlider, callback: function callback(i) { window.index_static_slice_stories_slider = i; window.app.sas.addElement(i.element, function () { i.show(true); }); } }, '.js-index-services-map': __webpack_require__(255), '.js-flipbook': __webpack_require__(249), '.js-index-main-texts-switcher': { module: TextsSwitcher, options: { duration: 400 }, callback: function callback(i) { window.index_main_texts_switcher = i; } }, '.js-calendar': __webpack_require__(259), '#news-box': __webpack_require__(200), '.js-contacts': __webpack_require__(208), '.js-floating-menu': __webpack_require__(251), '.js-vacancies': __webpack_require__(195), '.js-career-main-slider': { module: Slider, options: { load_on_demand: true }, callback: function callback(i) { window.career_main_slider = i; } } }); if (about_dial_number) { window.app.sas.addElement(about_dial_number.element, function (obj) { about_dial_number.dial(obj.data('number')); }, .25); if (numbers_slider) { numbers_slider.element.bind('items_switching', function (e, slider, pos, nxt, prev_pos, cur) { about_dial_number.dial(nxt.element.data('number')); }); var captions = numbers_slider.element.find('.stage2').find('.slide'); if (captions.length) { numbers_slider.element.bind('items_switching', function (e, slider, pos, nxt, prev_pos, cur) { captions.removeClass('active'); setTimeout(function () { $(captions[pos]).addClass('active'); }, 500); }); } } } $('.js-to-vacancy-list').unbind('click').click(function () { window.app.scrollTo($('section.vacancies'), 750, null, -88); }); if (index_main_slider) { index_main_slider.element.bind('items_switching', function (e, slider, pos, nxt, prev_pos, cur) { window.index_main_texts_switcher.switchto(pos, true); }); $('.js-company_video-trigger').click(function () { typeof index_main_slider != 'undefined' && index_main_slider.set_user_interacted(); }); } // window.stories_slider.element.bind('items_switching',function(e,slider,pos,nxt,prev_pos,cur){ // var moved, dir; // if( pos > prev_pos ){ // if( prev_pos == 0 && pos == slider.item.length - 1 ){ // dir = false; // moved = 1; // }else{ // dir = true; // moved = pos - prev_pos; // } // }else{ // if( pos == 0 && prev_pos == slider.item.length - 1 ){ // dir = true; // moved = 1; // }else{ // dir = false; // moved = prev_pos - pos; // } // } // window.faces_slider.switchto(dir,moved); // window.index_static_slice_stories_slider.switchto(pos,true); // }); // window.faces_slider.element.bind('switchto',function(e,slider,pos){ // window.stories_slider.switch_item(pos); // }); (function () { var index_map_box = $('.js-index-map-box'), box = index_map_box.find('.js-box'), box_width = 0, opened = false, index_map_box_timer = null, close_maps = function close_maps() { index_map_box.removeClass('active').css({ width: 0 }); window.maps_controller.yandex_maps['index-yandex-map'].element.removeClass('active'); window.maps_controller.google_maps['index-google-map'].element.removeClass('active'); index_map_box_timer = setTimeout(function () { index_map_box.addClass('hidden'); }, 600); }, clearTimer = function clearTimer() { if (index_map_box_timer) { clearTimeout(index_map_box_timer); index_map_box_timer = null; } }, close_map_btn = $('.js-close-map').click(close_maps); window.app.add_resize({ resize: function resize() { box_width = window.container_width / 2; box.css({ width: box_width }); if (opened) { index_map_box.css({ width: box_width }); } } }); $('.js-trigger-index-yandex-map').click(function () { if (typeof window.maps_controller.yandex_maps['index-yandex-map'] !== 'undefined') { close_maps(); clearTimer(); index_map_box.addClass('active').css({ width: box_width }); opened = true; window.maps_controller.yandex_maps['index-yandex-map'].create_map(); window.maps_controller.yandex_maps['index-yandex-map'].element.addClass('active'); } }); $('.js-trigger-index-google-map').click(function () { if (typeof window.maps_controller.google_maps['index-google-map'] != 'undefined') { close_maps(); clearTimer(); index_map_box.addClass('active').css({ width: box_width }); opened = true; window.maps_controller.google_maps['index-google-map'].create_map(); window.maps_controller.google_maps['index-google-map'].element.addClass('active'); } }); })(); $('.js-index-service').each(function (i, elm) { var obj = $(elm), tmr = false, mo = false, busy = false; obj.bind('mouseenter mouseleave', function (e) { switch (e.type) { case 'mouseenter': mo = true; if (busy) return; busy = true; obj.addClass('mouseenter'); setTimeout(function () { obj.removeClass('mouseleave'); busy = false; if (!mo) { obj.trigger('mouseleave'); } }, 800); break; case 'mouseleave': mo = false; if (busy) return; obj.addClass('mouseleave').removeClass('mouseenter'); setTimeout(function () { obj.removeClass('mouseleave'); busy = false; if (mo) { obj.trigger('mouseenter'); } }, 800); break; } }); }); new MapsController(); $(window).trigger('scroll'); }; /***/ }), /***/ 247: /***/ (function(module, exports, __webpack_require__) { "use strict"; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* turn.js 4.1.0 | Copyright (c) 2012 Emmanuel Garcia | turnjs.com | turnjs.com/license.txt */ (function (f) { function J(a, b, c) { if (!c[0] || "object" == _typeof(c[0])) return b.init.apply(a, c);if (b[c[0]]) return b[c[0]].apply(a, Array.prototype.slice.call(c, 1));throw q(c[0] + " is not a method or property"); }function l(a, b, c, d) { return { css: { position: "absolute", top: a, left: b, overflow: d || "hidden", zIndex: c || "auto" } }; }function S(a, b, c, d, e) { var h = 1 - e, f = h * h * h, g = e * e * e;return j(Math.round(f * a.x + 3 * e * h * h * b.x + 3 * e * e * h * c.x + g * d.x), Math.round(f * a.y + 3 * e * h * h * b.y + 3 * e * e * h * c.y + g * d.y)); }function j(a, b) { return { x: a, y: b }; }function F(a, b, c) { return z && c ? " translate3d(" + a + "px," + b + "px, 0px) " : " translate(" + a + "px, " + b + "px) "; }function G(a) { return " rotate(" + a + "deg) "; }function n(a, b) { return Object.prototype.hasOwnProperty.call(b, a); }function T() { for (var a = ["Moz", "Webkit", "Khtml", "O", "ms"], b = a.length, c = ""; b--;) { a[b] + "Transform" in document.body.style && (c = "-" + a[b].toLowerCase() + "-"); }return c; }function P(a, b, c, d, e) { var h, f = [];if ("-webkit-" == w) { for (h = 0; h < e; h++) { f.push("color-stop(" + d[h][0] + ", " + d[h][1] + ")"); }a.css({ "background-image": "-webkit-gradient(linear, " + b.x + "% " + b.y + "%," + c.x + "% " + c.y + "%, " + f.join(",") + " )" }); } else { var b = { x: b.x / 100 * a.width(), y: b.y / 100 * a.height() }, c = { x: c.x / 100 * a.width(), y: c.y / 100 * a.height() }, g = c.x - b.x;h = c.y - b.y;var i = Math.atan2(h, g), x = i - Math.PI / 2, x = Math.abs(a.width() * Math.sin(x)) + Math.abs(a.height() * Math.cos(x)), g = Math.sqrt(h * h + g * g), c = j(c.x < b.x ? a.width() : 0, c.y < b.y ? a.height() : 0), k = Math.tan(i);h = -1 / k;k = (h * c.x - c.y - k * b.x + b.y) / (h - k);c = h * k - h * c.x + c.y;b = Math.sqrt(Math.pow(k - b.x, 2) + Math.pow(c - b.y, 2));for (h = 0; h < e; h++) { f.push(" " + d[h][1] + " " + 100 * (b + g * d[h][0]) / x + "%"); }a.css({ "background-image": w + "linear-gradient(" + -i + "rad," + f.join(",") + ")" }); } }function t(a, b, c) { a = f.Event(a);b.trigger(a, c);return a.isDefaultPrevented() ? "prevented" : a.isPropagationStopped() ? "stopped" : ""; }function q(a) { function b(a) { this.name = "TurnJsError";this.message = a; }b.prototype = Error();b.prototype.constructor = b;return new b(a); }function D(a) { var b = { top: 0, left: 0 };do { b.left += a.offsetLeft, b.top += a.offsetTop; } while (a = a.offsetParent);return b; }var z, U, w = "", K = Math.PI, L = K / 2, u = "ontouchstart" in window, r = u ? { down: "touchstart", move: "touchmove", up: "touchend", over: "touchstart", out: "touchend" } : { down: "mousedown", move: "mousemove", up: "mouseup", over: "mouseover", out: "mouseout" }, p = { backward: ["bl", "tl"], forward: ["br", "tr"], all: "tl bl tr br l r".split(" ") }, V = ["single", "double"], W = ["ltr", "rtl"], X = { acceleration: !0, display: "double", duration: 600, page: 1, gradients: !0, turnCorners: "bl,br", when: null }, Y = { cornerSize: 100 }, g = { init: function init(a) { z = "WebKitCSSMatrix" in window || "MozPerspective" in document.body.style;var b; U = (b = /AppleWebkit\/([0-9\.]+)/i.exec(navigator.userAgent)) ? 534.3 < parseFloat(b[1]) : !0;w = T();var c;b = 0;var d = this.data(), e = this.children(), a = f.extend({ width: this.width(), height: this.height(), direction: this.attr("dir") || this.css("direction") || "ltr" }, X, a);d.opts = a;d.pageObjs = {};d.pages = {};d.pageWrap = {};d.pageZoom = {};d.pagePlace = {};d.pageMv = [];d.zoom = 1;d.totalPages = a.pages || 0;d.eventHandlers = { touchStart: f.proxy(g._touchStart, this), touchMove: f.proxy(g._touchMove, this), touchEnd: f.proxy(g._touchEnd, this), start: f.proxy(g._eventStart, this) };if (a.when) for (c in a.when) { n(c, a.when) && this.bind(c, a.when[c]); }this.css({ position: "relative", width: a.width, height: a.height });this.turn("display", a.display);"" !== a.direction && this.turn("direction", a.direction);z && !u && a.acceleration && this.transform(F(0, 0, !0));for (c = 0; c < e.length; c++) { "1" != f(e[c]).attr("ignore") && this.turn("addPage", e[c], ++b); }f(this).bind(r.down, d.eventHandlers.touchStart).bind("end", g._eventEnd).bind("pressed", g._eventPressed).bind("released", g._eventReleased).bind("flip", g._flip);f(this).parent().bind("start", d.eventHandlers.start);f(document).bind(r.move, d.eventHandlers.touchMove).bind(r.up, d.eventHandlers.touchEnd);this.turn("page", a.page);d.done = !0;return this; }, addPage: function addPage(a, b) { var c, d = !1, e = this.data(), h = e.totalPages + 1;if (e.destroying) return !1;if (c = /\bp([0-9]+)\b/.exec(f(a).attr("class"))) b = parseInt(c[1], 10);if (b) { if (b == h) d = !0;else { if (b > h) throw q('Page "' + b + '" cannot be inserted'); } } else b = h, d = !0;1 <= b && b <= h && (c = "double" == e.display ? b % 2 ? " odd" : " even" : "", e.done && this.turn("stop"), b in e.pageObjs && g._movePages.call(this, b, 1), d && (e.totalPages = h), e.pageObjs[b] = f(a).css({ "float": "left" }).addClass("page p" + b + c), -1 != navigator.userAgent.indexOf("MSIE 9.0") && e.pageObjs[b].hasClass("hard") && e.pageObjs[b].removeClass("hard"), g._addPage.call(this, b), g._removeFromDOM.call(this));return this; }, _addPage: function _addPage(a) { var b = this.data(), c = b.pageObjs[a];if (c) if (g._necessPage.call(this, a)) { if (!b.pageWrap[a]) { b.pageWrap[a] = f("
", { "class": "page-wrapper", page: a, css: { position: "absolute", overflow: "hidden" } });this.append(b.pageWrap[a]);b.pagePlace[a] || (b.pagePlace[a] = a, b.pageObjs[a].appendTo(b.pageWrap[a]));var d = g._pageSize.call(this, a, !0);c.css({ width: d.width, height: d.height });b.pageWrap[a].css(d); }b.pagePlace[a] == a && g._makeFlip.call(this, a); } else b.pagePlace[a] = 0, b.pageObjs[a] && b.pageObjs[a].remove(); }, hasPage: function hasPage(a) { return n(a, this.data().pageObjs); }, center: function center(a) { var b = this.data(), c = f(this).turn("size"), d = 0;b.noCenter || ("double" == b.display && (a = this.turn("view", a || b.tpage || b.page), "ltr" == b.direction ? a[0] ? a[1] || (d += c.width / 4) : d -= c.width / 4 : a[0] ? a[1] || (d -= c.width / 4) : d += c.width / 4), f(this).css({ marginLeft: d }));return this; }, destroy: function destroy() { var a = this, b = this.data(), c = "end first flip last pressed released start turning turned zooming missing".split(" ");if ("prevented" != t("destroying", this)) { b.destroying = !0;f.each(c, function (b, c) { a.unbind(c); });this.parent().unbind("start", b.eventHandlers.start);for (f(document).unbind(r.move, b.eventHandlers.touchMove).unbind(r.up, b.eventHandlers.touchEnd); 0 !== b.totalPages;) { this.turn("removePage", b.totalPages); }b.fparent && b.fparent.remove();b.shadow && b.shadow.remove();this.removeData();b = null;return this; } }, is: function is() { return "object" == _typeof(this.data().pages); }, zoom: function zoom(a) { var b = this.data();if ("number" == typeof a) { if (0.0010 > a || 100 < a) throw q(a + " is not a value for zoom");if ("prevented" == t("zooming", this, [a, b.zoom])) return this;var c = this.turn("size"), d = this.turn("view"), e = 1 / b.zoom, h = Math.round(c.width * e * a), c = Math.round(c.height * e * a);b.zoom = a;f(this).turn("stop").turn("size", h, c);b.opts.autoCenter && this.turn("center");g._updateShadow.call(this);for (a = 0; a < d.length; a++) { d[a] && b.pageZoom[d[a]] != b.zoom && (this.trigger("zoomed", [d[a], d, b.pageZoom[d[a]], b.zoom]), b.pageZoom[d[a]] = b.zoom); }return this; }return b.zoom; }, _pageSize: function _pageSize(a, b) { var c = this.data(), d = {};if ("single" == c.display) d.width = this.width(), d.height = this.height(), b && (d.top = 0, d.left = 0, d.right = "auto");else { var e = this.width() / 2, h = this.height();c.pageObjs[a].hasClass("own-size") ? (d.width = c.pageObjs[a].width(), d.height = c.pageObjs[a].height()) : (d.width = e, d.height = h);if (b) { var f = a % 2;d.top = (h - d.height) / 2;"ltr" == c.direction ? (d[f ? "right" : "left"] = e - d.width, d[f ? "left" : "right"] = "auto") : (d[f ? "left" : "right"] = e - d.width, d[f ? "right" : "left"] = "auto"); } }return d; }, _makeFlip: function _makeFlip(a) { var b = this.data();if (!b.pages[a] && b.pagePlace[a] == a) { var c = "single" == b.display, d = a % 2;b.pages[a] = b.pageObjs[a].css(g._pageSize.call(this, a)).flip({ page: a, next: d || c ? a + 1 : a - 1, turn: this }).flip("disable", b.disabled);g._setPageLoc.call(this, a);b.pageZoom[a] = b.zoom; }return b.pages[a]; }, _makeRange: function _makeRange() { var a, b;if (!(1 > this.data().totalPages)) { b = this.turn("range");for (a = b[0]; a <= b[1]; a++) { g._addPage.call(this, a); } } }, range: function range(a) { var b, c, d, e = this.data(), a = a || e.tpage || e.page || 1;d = g._view.call(this, a);if (1 > a || a > e.totalPages) throw q('"' + a + '" is not a valid page');d[1] = d[1] || d[0];1 <= d[0] && d[1] <= e.totalPages ? (a = Math.floor(2), e.totalPages - d[1] > d[0] ? (b = Math.min(d[0] - 1, a), c = 2 * a - b) : (c = Math.min(e.totalPages - d[1], a), b = 2 * a - c)) : c = b = 5;return [Math.max(1, d[0] - b), Math.min(e.totalPages, d[1] + c)]; }, _necessPage: function _necessPage(a) { if (0 === a) return !0;var b = this.turn("range");return this.data().pageObjs[a].hasClass("fixed") || a >= b[0] && a <= b[1]; }, _removeFromDOM: function _removeFromDOM() { var a, b = this.data();for (a in b.pageWrap) { n(a, b.pageWrap) && !g._necessPage.call(this, a) && g._removePageFromDOM.call(this, a); } }, _removePageFromDOM: function _removePageFromDOM(a) { var b = this.data();if (b.pages[a]) { var c = b.pages[a].data();i._moveFoldingPage.call(b.pages[a], !1);c.f && c.f.fwrapper && c.f.fwrapper.remove();b.pages[a].removeData();b.pages[a].remove(); delete b.pages[a]; }b.pageObjs[a] && b.pageObjs[a].remove();b.pageWrap[a] && (b.pageWrap[a].remove(), delete b.pageWrap[a]);g._removeMv.call(this, a);delete b.pagePlace[a];delete b.pageZoom[a]; }, removePage: function removePage(a) { var b = this.data();if ("*" == a) for (; 0 !== b.totalPages;) { this.turn("removePage", b.totalPages); } else { if (1 > a || a > b.totalPages) throw q("The page " + a + " doesn't exist");b.pageObjs[a] && (this.turn("stop"), g._removePageFromDOM.call(this, a), delete b.pageObjs[a]);g._movePages.call(this, a, -1);b.totalPages -= 1;b.page > b.totalPages ? (b.page = null, g._fitPage.call(this, b.totalPages)) : (g._makeRange.call(this), this.turn("update")); }return this; }, _movePages: function _movePages(a, b) { var c, d = this, e = this.data(), h = "single" == e.display, f = function f(a) { var c = a + b, f = c % 2, i = f ? " odd " : " even ";e.pageObjs[a] && (e.pageObjs[c] = e.pageObjs[a].removeClass("p" + a + " odd even").addClass("p" + c + i));e.pagePlace[a] && e.pageWrap[a] && (e.pagePlace[c] = c, e.pageWrap[c] = e.pageObjs[c].hasClass("fixed") ? e.pageWrap[a].attr("page", c) : e.pageWrap[a].css(g._pageSize.call(d, c, !0)).attr("page", c), e.pages[a] && (e.pages[c] = e.pages[a].flip("options", { page: c, next: h || f ? c + 1 : c - 1 })), b && (delete e.pages[a], delete e.pagePlace[a], delete e.pageZoom[a], delete e.pageObjs[a], delete e.pageWrap[a])); };if (0 < b) for (c = e.totalPages; c >= a; c--) { f(c); } else for (c = a; c <= e.totalPages; c++) { f(c); } }, display: function display(a) { var b = this.data(), c = b.display;if (void 0 === a) return c;if (-1 == f.inArray(a, V)) throw q('"' + a + '" is not a value for display');switch (a) {case "single": b.pageObjs[0] || (this.turn("stop").css({ overflow: "hidden" }), b.pageObjs[0] = f("
", { "class": "page p-temporal" }).css({ width: this.width(), height: this.height() }).appendTo(this));this.addClass("shadow");break;case "double": b.pageObjs[0] && (this.turn("stop").css({ overflow: "" }), b.pageObjs[0].remove(), delete b.pageObjs[0]), this.removeClass("shadow");}b.display = a;c && (a = this.turn("size"), g._movePages.call(this, 1, 0), this.turn("size", a.width, a.height).turn("update"));return this; }, direction: function direction(a) { var b = this.data();if (void 0 === a) return b.direction;a = a.toLowerCase(); if (-1 == f.inArray(a, W)) throw q('"' + a + '" is not a value for direction');"rtl" == a && f(this).attr("dir", "ltr").css({ direction: "ltr" });b.direction = a;b.done && this.turn("size", f(this).width(), f(this).height());return this; }, animating: function animating() { return 0 < this.data().pageMv.length; }, corner: function corner() { var a, b, c = this.data();for (b in c.pages) { if (n(b, c.pages) && (a = c.pages[b].flip("corner"))) return a; }return !1; }, data: function data() { return this.data(); }, disable: function disable(a) { var b, c = this.data(), d = this.turn("view");c.disabled = void 0 === a || !0 === a;for (b in c.pages) { n(b, c.pages) && c.pages[b].flip("disable", c.disabled ? !0 : -1 == f.inArray(parseInt(b, 10), d)); }return this; }, disabled: function disabled(a) { return void 0 === a ? !0 === this.data().disabled : this.turn("disable", a); }, size: function size(a, b) { if (void 0 === a || void 0 === b) return { width: this.width(), height: this.height() };this.turn("stop");var c, d, e = this.data();d = "double" == e.display ? a / 2 : a;this.css({ width: a, height: b });e.pageObjs[0] && e.pageObjs[0].css({ width: d, height: b });for (c in e.pageWrap) { n(c, e.pageWrap) && (d = g._pageSize.call(this, c, !0), e.pageObjs[c].css({ width: d.width, height: d.height }), e.pageWrap[c].css(d), e.pages[c] && e.pages[c].css({ width: d.width, height: d.height })); }this.turn("resize");return this; }, resize: function resize() { var a, b = this.data();b.pages[0] && (b.pageWrap[0].css({ left: -this.width() }), b.pages[0].flip("resize", !0));for (a = 1; a <= b.totalPages; a++) { b.pages[a] && b.pages[a].flip("resize", !0); }g._updateShadow.call(this);b.opts.autoCenter && this.turn("center"); }, _removeMv: function _removeMv(a) { var b, c = this.data();for (b = 0; b < c.pageMv.length; b++) { if (c.pageMv[b] == a) return c.pageMv.splice(b, 1), !0; }return !1; }, _addMv: function _addMv(a) { var b = this.data();g._removeMv.call(this, a);b.pageMv.push(a); }, _view: function _view(a) { var b = this.data(), a = a || b.page;return "double" == b.display ? a % 2 ? [a - 1, a] : [a, a + 1] : [a]; }, view: function view(a) { var b = this.data(), a = g._view.call(this, a);return "double" == b.display ? [0 < a[0] ? a[0] : 0, a[1] <= b.totalPages ? a[1] : 0] : [0 < a[0] && a[0] <= b.totalPages ? a[0] : 0]; }, stop: function stop(a, b) { if (this.turn("animating")) { var c, d, e, h = this.data();h.tpage && (h.page = h.tpage, delete h.tpage);for (c = 0; c < h.pageMv.length; c++) { h.pageMv[c] && h.pageMv[c] !== a && (e = h.pages[h.pageMv[c]], d = e.data().f.opts, e.flip("hideFoldedPage", b), b || i._moveFoldingPage.call(e, !1), d.force && (d.next = 0 === d.page % 2 ? d.page - 1 : d.page + 1, delete d.force)); } }this.turn("update");return this; }, pages: function pages(a) { var b = this.data();if (a) { if (a < b.totalPages) for (var c = b.totalPages; c > a; c--) { this.turn("removePage", c); }b.totalPages = a;g._fitPage.call(this, b.page);return this; }return b.totalPages; }, _missing: function _missing(a) { var b = this.data();if (!(1 > b.totalPages)) { for (var c = this.turn("range", a), d = [], a = c[0]; a <= c[1]; a++) { b.pageObjs[a] || d.push(a); }0 < d.length && this.trigger("missing", [d]); } }, _fitPage: function _fitPage(a) { var b = this.data(), c = this.turn("view", a);g._missing.call(this, a);if (b.pageObjs[a]) { b.page = a;this.turn("stop");for (var d = 0; d < c.length; d++) { c[d] && b.pageZoom[c[d]] != b.zoom && (this.trigger("zoomed", [c[d], c, b.pageZoom[c[d]], b.zoom]), b.pageZoom[c[d]] = b.zoom); }g._removeFromDOM.call(this);g._makeRange.call(this);g._updateShadow.call(this); this.trigger("turned", [a, c]);this.turn("update");b.opts.autoCenter && this.turn("center"); } }, _turnPage: function _turnPage(a) { var b, c, d = this.data(), e = d.pagePlace[a], h = this.turn("view"), i = this.turn("view", a);if (d.page != a) { var j = d.page;if ("prevented" == t("turning", this, [a, i])) { j == d.page && -1 != f.inArray(e, d.pageMv) && d.pages[e].flip("hideFoldedPage", !0);return; }-1 != f.inArray(1, i) && this.trigger("first");-1 != f.inArray(d.totalPages, i) && this.trigger("last"); }"single" == d.display ? (b = h[0], c = i[0]) : h[1] && a > h[1] ? (b = h[1], c = i[0]) : h[0] && a < h[0] && (b = h[0], c = i[1]);e = d.opts.turnCorners.split(",");h = d.pages[b].data().f;i = h.opts;j = h.point;g._missing.call(this, a);d.pageObjs[a] && (this.turn("stop"), d.page = a, g._makeRange.call(this), d.tpage = c, i.next != c && (i.next = c, i.force = !0), this.turn("update"), h.point = j, "hard" == h.effect ? "ltr" == d.direction ? d.pages[b].flip("turnPage", a > b ? "r" : "l") : d.pages[b].flip("turnPage", a > b ? "l" : "r") : "ltr" == d.direction ? d.pages[b].flip("turnPage", e[a > b ? 1 : 0]) : d.pages[b].flip("turnPage", e[a > b ? 0 : 1])); }, page: function page(a) { var b = this.data();if (void 0 === a) return b.page;if (!b.disabled && !b.destroying) { a = parseInt(a, 10);if (0 < a && a <= b.totalPages) return a != b.page && (!b.done || -1 != f.inArray(a, this.turn("view")) ? g._fitPage.call(this, a) : g._turnPage.call(this, a)), this;throw q("The page " + a + " does not exist"); } }, next: function next() { return this.turn("page", Math.min(this.data().totalPages, g._view.call(this, this.data().page).pop() + 1)); }, previous: function previous() { return this.turn("page", Math.max(1, g._view.call(this, this.data().page).shift() - 1)); }, peel: function peel(a, b) { var c = this.data(), d = this.turn("view"), b = void 0 === b ? !0 : !0 === b;!1 === a ? this.turn("stop", null, b) : "single" == c.display ? c.pages[c.page].flip("peel", a, b) : (d = "ltr" == c.direction ? -1 != a.indexOf("l") ? d[0] : d[1] : -1 != a.indexOf("l") ? d[1] : d[0], c.pages[d] && c.pages[d].flip("peel", a, b));return this; }, _addMotionPage: function _addMotionPage() { var a = f(this).data().f.opts, b = a.turn;b.data();g._addMv.call(b, a.page); }, _eventStart: function _eventStart(a, b, c) { var d = b.turn.data(), e = d.pageZoom[b.page];a.isDefaultPrevented() || (e && e != d.zoom && (b.turn.trigger("zoomed", [b.page, b.turn.turn("view", b.page), e, d.zoom]), d.pageZoom[b.page] = d.zoom), "single" == d.display && c && ("l" == c.charAt(1) && "ltr" == d.direction || "r" == c.charAt(1) && "rtl" == d.direction ? (b.next = b.next < b.page ? b.next : b.page - 1, b.force = !0) : b.next = b.next > b.page ? b.next : b.page + 1), g._addMotionPage.call(a.target));g._updateShadow.call(b.turn); }, _eventEnd: function _eventEnd(a, b, c) { f(a.target).data();var a = b.turn, d = a.data();if (c) { if (c = d.tpage || d.page, c == b.next || c == b.page) delete d.tpage, g._fitPage.call(a, c || b.next, !0); } else g._removeMv.call(a, b.page), g._updateShadow.call(a), a.turn("update"); }, _eventPressed: function _eventPressed(a) { var a = f(a.target).data().f, b = a.opts.turn;b.data().mouseAction = !0;b.turn("update");return a.time = new Date().getTime(); }, _eventReleased: function _eventReleased(a, b) { var c;c = f(a.target);var d = c.data().f, e = d.opts.turn, h = e.data();c = "single" == h.display ? "br" == b.corner || "tr" == b.corner ? b.x < c.width() / 2 : b.x > c.width() / 2 : 0 > b.x || b.x > c.width();if (200 > new Date().getTime() - d.time || c) a.preventDefault(), g._turnPage.call(e, d.opts.next);h.mouseAction = !1; }, _flip: function _flip(a) { a.stopPropagation(); a = f(a.target).data().f.opts;a.turn.trigger("turn", [a.next]);a.turn.data().opts.autoCenter && a.turn.turn("center", a.next); }, _touchStart: function _touchStart() { var a = this.data(), b;for (b in a.pages) { if (n(b, a.pages) && !1 === i._eventStart.apply(a.pages[b], arguments)) return !1; } }, _touchMove: function _touchMove() { var a = this.data(), b;for (b in a.pages) { n(b, a.pages) && i._eventMove.apply(a.pages[b], arguments); } }, _touchEnd: function _touchEnd() { var a = this.data(), b;for (b in a.pages) { n(b, a.pages) && i._eventEnd.apply(a.pages[b], arguments); } }, calculateZ: function calculateZ(a) { var b, c, d, e, h = this, f = this.data();b = this.turn("view");var i = b[0] || b[1], g = a.length - 1, j = { pageZ: {}, partZ: {}, pageV: {} }, k = function k(a) { a = h.turn("view", a);a[0] && (j.pageV[a[0]] = !0);a[1] && (j.pageV[a[1]] = !0); };for (b = 0; b <= g; b++) { c = a[b], d = f.pages[c].data().f.opts.next, e = f.pagePlace[c], k(c), k(d), c = f.pagePlace[d] == d ? d : c, j.pageZ[c] = f.totalPages - Math.abs(i - c), j.partZ[e] = 2 * f.totalPages - g + b; }return j; }, update: function update() { var a, b = this.data();if (this.turn("animating") && 0 !== b.pageMv[0]) { var c, d = this.turn("calculateZ", b.pageMv), e = this.turn("corner"), h = this.turn("view"), i = this.turn("view", b.tpage);for (a in b.pageWrap) { if (n(a, b.pageWrap) && (c = b.pageObjs[a].hasClass("fixed"), b.pageWrap[a].css({ display: d.pageV[a] || c ? "" : "none", zIndex: (b.pageObjs[a].hasClass("hard") ? d.partZ[a] : d.pageZ[a]) || (c ? -1 : 0) }), c = b.pages[a])) c.flip("z", d.partZ[a] || null), d.pageV[a] && c.flip("resize"), b.tpage ? c.flip("hover", !1).flip("disable", -1 == f.inArray(parseInt(a, 10), b.pageMv) && a != i[0] && a != i[1]) : c.flip("hover", !1 === e).flip("disable", a != h[0] && a != h[1]); } } else for (a in b.pageWrap) { n(a, b.pageWrap) && (d = g._setPageLoc.call(this, a), b.pages[a] && b.pages[a].flip("disable", b.disabled || 1 != d).flip("hover", !0).flip("z", null)); }return this; }, _updateShadow: function _updateShadow() { var a, b, c = this.data(), d = this.width(), e = this.height(), h = "single" == c.display ? d : d / 2;a = this.turn("view");c.shadow || (c.shadow = f("
", { "class": "shadow", css: l(0, 0, 0).css }).appendTo(this));for (var i = 0; i < c.pageMv.length && a[0] && a[1]; i++) { a = this.turn("view", c.pages[c.pageMv[i]].data().f.opts.next), b = this.turn("view", c.pageMv[i]), a[0] = a[0] && b[0], a[1] = a[1] && b[1]; }switch (a[0] ? a[1] ? 3 : "ltr" == c.direction ? 2 : 1 : "ltr" == c.direction ? 1 : 2) {case 1: c.shadow.css({ width: h, height: e, top: 0, left: h });break;case 2: c.shadow.css({ width: h, height: e, top: 0, left: 0 });break;case 3: c.shadow.css({ width: d, height: e, top: 0, left: 0 });} }, _setPageLoc: function _setPageLoc(a) { var b = this.data(), c = this.turn("view"), d = 0;if (a == c[0] || a == c[1]) d = 1;else if ("single" == b.display && a == c[0] + 1 || "double" == b.display && a == c[0] - 2 || a == c[1] + 2) d = 2;if (!this.turn("animating")) switch (d) {case 1: b.pageWrap[a].css({ zIndex: b.totalPages, display: "" });break;case 2: b.pageWrap[a].css({ zIndex: b.totalPages - 1, display: "" });break;case 0: b.pageWrap[a].css({ zIndex: 0, display: b.pageObjs[a].hasClass("fixed") ? "" : "none" });}return d; }, options: function options(a) { if (void 0 === a) return this.data().opts;var b = this.data();f.extend(b.opts, a);a.pages && this.turn("pages", a.pages);a.page && this.turn("page", a.page);a.display && this.turn("display", a.display);a.direction && this.turn("direction", a.direction);a.width && a.height && this.turn("size", a.width, a.height);if (a.when) for (var c in a.when) { n(c, a.when) && this.unbind(c).bind(c, a.when[c]); }return this; }, version: function version() { return "4.1.0"; } }, i = { init: function init(a) { this.data({ f: { disabled: !1, hover: !1, effect: this.hasClass("hard") ? "hard" : "sheet" } });this.flip("options", a);i._addPageWrapper.call(this);return this; }, setData: function setData(a) { var b = this.data();b.f = f.extend(b.f, a);return this; }, options: function options(a) { var b = this.data().f;return a ? (i.setData.call(this, { opts: f.extend({}, b.opts || Y, a) }), this) : b.opts; }, z: function z(a) { var b = this.data().f;b.opts["z-index"] = a;b.fwrapper && b.fwrapper.css({ zIndex: a || parseInt(b.parent.css("z-index"), 10) || 0 });return this; }, _cAllowed: function _cAllowed() { var a = this.data().f, b = a.opts.page, c = a.opts.turn.data(), d = b % 2;return "hard" == a.effect ? "ltr" == c.direction ? [d ? "r" : "l"] : [d ? "l" : "r"] : "single" == c.display ? 1 == b ? "ltr" == c.direction ? p.forward : p.backward : b == c.totalPages ? "ltr" == c.direction ? p.backward : p.forward : p.all : "ltr" == c.direction ? p[d ? "forward" : "backward"] : p[d ? "backward" : "forward"]; }, _cornerActivated: function _cornerActivated(a) { var b = this.data().f, c = this.width(), d = this.height(), a = { x: a.x, y: a.y, corner: "" }, e = b.opts.cornerSize;if (0 >= a.x || 0 >= a.y || a.x >= c || a.y >= d) return !1;var h = i._cAllowed.call(this);switch (b.effect) {case "hard": if (a.x > c - e) a.corner = "r";else if (a.x < e) a.corner = "l";else return !1;break;case "sheet": if (a.y < e) a.corner += "t";else if (a.y >= d - e) a.corner += "b";else return !1;if (a.x <= e) a.corner += "l";else if (a.x >= c - e) a.corner += "r";else return !1;}return !a.corner || -1 == f.inArray(a.corner, h) ? !1 : a; }, _isIArea: function _isIArea(a) { var b = this.data().f.parent.offset(), a = u && a.originalEvent ? a.originalEvent.touches[0] : a;return i._cornerActivated.call(this, { x: a.pageX - b.left, y: a.pageY - b.top }); }, _c: function _c(a, b) { b = b || 0;switch (a) {case "tl": return j(b, b);case "tr": return j(this.width() - b, b);case "bl": return j(b, this.height() - b);case "br": return j(this.width() - b, this.height() - b);case "l": return j(b, 0);case "r": return j(this.width() - b, 0);} }, _c2: function _c2(a) { switch (a) {case "tl": return j(2 * this.width(), 0);case "tr": return j(-this.width(), 0);case "bl": return j(2 * this.width(), this.height());case "br": return j(-this.width(), this.height());case "l": return j(2 * this.width(), 0);case "r": return j(-this.width(), 0);} }, _foldingPage: function _foldingPage() { var a = this.data().f;if (a) { var b = a.opts;if (b.turn) return a = b.turn.data(), "single" == a.display ? 1 < b.next || 1 < b.page ? a.pageObjs[0] : null : a.pageObjs[b.next]; } }, _backGradient: function _backGradient() { var a = this.data().f, b = a.opts.turn.data();if ((b = b.opts.gradients && ("single" == b.display || 2 != a.opts.page && a.opts.page != b.totalPages - 1)) && !a.bshadow) a.bshadow = f("
", l(0, 0, 1)).css({ position: "", width: this.width(), height: this.height() }).appendTo(a.parent); return b; }, type: function type() { return this.data().f.effect; }, resize: function resize(a) { var b = this.data().f, c = b.opts.turn.data(), d = this.width(), e = this.height();switch (b.effect) {case "hard": a && (b.wrapper.css({ width: d, height: e }), b.fpage.css({ width: d, height: e }), c.opts.gradients && (b.ashadow.css({ width: d, height: e }), b.bshadow.css({ width: d, height: e })));break;case "sheet": a && (a = Math.round(Math.sqrt(Math.pow(d, 2) + Math.pow(e, 2))), b.wrapper.css({ width: a, height: a }), b.fwrapper.css({ width: a, height: a }).children(":first-child").css({ width: d, height: e }), b.fpage.css({ width: d, height: e }), c.opts.gradients && b.ashadow.css({ width: d, height: e }), i._backGradient.call(this) && b.bshadow.css({ width: d, height: e })), b.parent.is(":visible") && (c = D(b.parent[0]), b.fwrapper.css({ top: c.top, left: c.left }), c = D(b.opts.turn[0]), b.fparent.css({ top: -c.top, left: -c.left })), this.flip("z", b.opts["z-index"]);} }, _addPageWrapper: function _addPageWrapper() { var a = this.data().f, b = a.opts.turn.data(), c = this.parent();a.parent = c;if (!a.wrapper) switch (a.effect) {case "hard": var d = {};d[w + "transform-style"] = "preserve-3d";d[w + "backface-visibility"] = "hidden";a.wrapper = f("
", l(0, 0, 2)).css(d).appendTo(c).prepend(this);a.fpage = f("
", l(0, 0, 1)).css(d).appendTo(c);b.opts.gradients && (a.ashadow = f("
", l(0, 0, 0)).hide().appendTo(c), a.bshadow = f("
", l(0, 0, 0)));break;case "sheet": var d = this.width(), e = this.height();Math.round(Math.sqrt(Math.pow(d, 2) + Math.pow(e, 2)));a.fparent = a.opts.turn.data().fparent;a.fparent || (d = f("
", { css: { "pointer-events": "none" } }).hide(), d.data().flips = 0, d.css(l(0, 0, "auto", "visible").css).appendTo(a.opts.turn), a.opts.turn.data().fparent = d, a.fparent = d);this.css({ position: "absolute", top: 0, left: 0, bottom: "auto", right: "auto" });a.wrapper = f("
", l(0, 0, this.css("z-index"))).appendTo(c).prepend(this);a.fwrapper = f("
", l(c.offset().top, c.offset().left)).hide().appendTo(a.fparent);a.fpage = f("
", l(0, 0, 0, "visible")).css({ cursor: "default" }).appendTo(a.fwrapper);b.opts.gradients && (a.ashadow = f("
", l(0, 0, 1)).appendTo(a.fpage));i.setData.call(this, a);}i.resize.call(this, !0); }, _fold: function _fold(a) { var b = this.data().f, c = b.opts.turn.data(), d = i._c.call(this, a.corner), e = this.width(), h = this.height();switch (b.effect) {case "hard": a.x = "l" == a.corner ? Math.min(Math.max(a.x, 0), 2 * e) : Math.max(Math.min(a.x, e), -e);var f, g, s, x, k, n = c.totalPages, l = b.opts["z-index"] || n, q = { overflow: "visible" }, p = d.x ? (d.x - a.x) / e : a.x / e, r = 90 * p, t = 90 > r;switch (a.corner) {case "l": x = "0% 50%";k = "100% 50%";t ? (f = 0, g = 0 < b.opts.next - 1, s = 1) : (f = "100%", g = b.opts.page + 1 < n, s = 0);break;case "r": x = "100% 50%", k = "0% 50%", r = -r, e = -e, t ? (f = 0, g = b.opts.next + 1 < n, s = 0) : (f = "-100%", g = 1 != b.opts.page, s = 1);}q[w + "perspective-origin"] = k;b.wrapper.transform("rotateY(" + r + "deg)translate3d(0px, 0px, " + (this.attr("depth") || 0) + "px)", k);b.fpage.transform("translateX(" + e + "px) rotateY(" + (180 + r) + "deg)", x);b.parent.css(q);t ? (p = -p + 1, b.wrapper.css({ zIndex: l + 1 }), b.fpage.css({ zIndex: l })) : (p -= 1, b.wrapper.css({ zIndex: l }), b.fpage.css({ zIndex: l + 1 }));c.opts.gradients && (g ? b.ashadow.css({ display: "", left: f, backgroundColor: "rgba(0,0,0," + 0.5 * p + ")" }).transform("rotateY(0deg)") : b.ashadow.hide(), b.bshadow.css({ opacity: -p + 1 }), t ? b.bshadow.parent()[0] != b.wrapper[0] && b.bshadow.appendTo(b.wrapper) : b.bshadow.parent()[0] != b.fpage[0] && b.bshadow.appendTo(b.fpage), P(b.bshadow, j(100 * s, 0), j(100 * (-s + 1), 0), [[0, "rgba(0,0,0,0.3)"], [1, "rgba(0,0,0,0)"]], 2));break;case "sheet": var u = this, H = 0, z, A, B, M, y, N, D, v = j(0, 0), Q = j(0, 0), m = j(0, 0), J = i._foldingPage.call(this);Math.tan(0);var O = c.opts.acceleration, R = b.wrapper.height(), E = "t" == a.corner.substr(0, 1), C = "l" == a.corner.substr(1, 1), I = function I() { var b = j(0, 0), f = j(0, 0);b.x = d.x ? d.x - a.x : a.x;b.y = U ? d.y ? d.y - a.y : a.y : 0;f.x = C ? e - b.x / 2 : a.x + b.x / 2;f.y = b.y / 2;var g = L - Math.atan2(b.y, b.x), k = g - Math.atan2(f.y, f.x), k = Math.max(0, Math.sin(k) * Math.sqrt(Math.pow(f.x, 2) + Math.pow(f.y, 2)));H = 180 * (g / K);m = j(k * Math.sin(g), k * Math.cos(g));if (g > L && (m.x += Math.abs(m.y * b.y / b.x), m.y = 0, Math.round(m.x * Math.tan(K - g)) < h)) return a.y = Math.sqrt(Math.pow(h, 2) + 2 * f.x * b.x), E && (a.y = h - a.y), I();g > L && (b = K - g, f = R - h / Math.sin(b), v = j(Math.round(f * Math.cos(b)), Math.round(f * Math.sin(b))), C && (v.x = -v.x), E && (v.y = -v.y));z = Math.round(m.y / Math.tan(g) + m.x);b = e - z;f = b * Math.cos(2 * g);k = b * Math.sin(2 * g);Q = j(Math.round(C ? b - f : z + f), Math.round(E ? k : h - k));c.opts.gradients && (y = b * Math.sin(g), b = i._c2.call(u, a.corner), b = Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2)) / e, D = Math.sin(L * (1 < b ? 2 - b : b)), N = Math.min(b, 1), M = 100 < y ? (y - 100) / y : 0, A = j(100 * (y * Math.sin(g) / e), 100 * (y * Math.cos(g) / h)), i._backGradient.call(u) && (B = j(100 * (1.2 * y * Math.sin(g) / e), 100 * (1.2 * y * Math.cos(g) / h)), C || (B.x = 100 - B.x), E || (B.y = 100 - B.y)));m.x = Math.round(m.x); m.y = Math.round(m.y);return !0; };f = function f(a, d, _f, g) { var k = ["0", "auto"], m = (e - R) * _f[0] / 100, l = (h - R) * _f[1] / 100, d = { left: k[d[0]], top: k[d[1]], right: k[d[2]], bottom: k[d[3]] }, k = {}, n = 90 != g && -90 != g ? C ? -1 : 1 : 0, s = _f[0] + "% " + _f[1] + "%";u.css(d).transform(G(g) + F(a.x + n, a.y, O), s);b.fpage.css(d).transform(G(g) + F(a.x + Q.x - v.x - e * _f[0] / 100, a.y + Q.y - v.y - h * _f[1] / 100, O) + G((180 / g - 2) * g), s);b.wrapper.transform(F(-a.x + m - n, -a.y + l, O) + G(-g), s);b.fwrapper.transform(F(-a.x + v.x + m, -a.y + v.y + l, O) + G(-g), s);c.opts.gradients && (_f[0] && (A.x = 100 - A.x), _f[1] && (A.y = 100 - A.y), k["box-shadow"] = "0 0 20px rgba(0,0,0," + 0.5 * D + ")", J.css(k), P(b.ashadow, j(C ? 100 : 0, E ? 0 : 100), j(A.x, A.y), [[M, "rgba(0,0,0,0)"], [0.8 * (1 - M) + M, "rgba(0,0,0," + 0.2 * N + ")"], [1, "rgba(255,255,255," + 0.2 * N + ")"]], 3, 0), i._backGradient.call(u) && P(b.bshadow, j(C ? 0 : 100, E ? 0 : 100), j(B.x, B.y), [[0.6, "rgba(0,0,0,0)"], [0.8, "rgba(0,0,0," + 0.3 * N + ")"], [1, "rgba(0,0,0,0)"]], 3)); };switch (a.corner) {case "tl": a.x = Math.max(a.x, 1);I();f(m, [1, 0, 0, 1], [100, 0], H);break;case "tr": a.x = Math.min(a.x, e - 1);I();f(j(-m.x, m.y), [0, 0, 0, 1], [0, 0], -H);break;case "bl": a.x = Math.max(a.x, 1);I();f(j(m.x, -m.y), [1, 1, 0, 0], [100, 100], -H);break;case "br": a.x = Math.min(a.x, e - 1), I(), f(j(-m.x, -m.y), [0, 1, 1, 0], [0, 100], H);}}b.point = a; }, _moveFoldingPage: function _moveFoldingPage(a) { var b = this.data().f;if (b) { var c = b.opts.turn, d = c.data(), e = d.pagePlace;a ? (d = b.opts.next, e[d] != b.opts.page && (b.folding && i._moveFoldingPage.call(this, !1), i._foldingPage.call(this).appendTo(b.fpage), e[d] = b.opts.page, b.folding = d), c.turn("update")) : b.folding && (d.pages[b.folding] ? (c = d.pages[b.folding].data().f, d.pageObjs[b.folding].appendTo(c.wrapper)) : d.pageWrap[b.folding] && d.pageObjs[b.folding].appendTo(d.pageWrap[b.folding]), b.folding in e && (e[b.folding] = b.folding), delete b.folding); } }, _showFoldedPage: function _showFoldedPage(a, b) { var c = i._foldingPage.call(this), d = this.data(), e = d.f, f = e.visible;if (c) { if (!f || !e.point || e.point.corner != a.corner) if (c = "hover" == e.status || "peel" == e.status || e.opts.turn.data().mouseAction ? a.corner : null, f = !1, "prevented" == t("start", this, [e.opts, c])) return !1;if (b) { var g = this, d = e.point && e.point.corner == a.corner ? e.point : i._c.call(this, a.corner, 1);this.animatef({ from: [d.x, d.y], to: [a.x, a.y], duration: 500, frame: function frame(b) { a.x = Math.round(b[0]);a.y = Math.round(b[1]);i._fold.call(g, a); } }); } else i._fold.call(this, a), d.effect && !d.effect.turning && this.animatef(!1);if (!f) switch (e.effect) {case "hard": e.visible = !0;i._moveFoldingPage.call(this, !0);e.fpage.show();e.opts.shadows && e.bshadow.show();break;case "sheet": e.visible = !0, e.fparent.show().data().flips++, i._moveFoldingPage.call(this, !0), e.fwrapper.show(), e.bshadow && e.bshadow.show();}return !0; }return !1; }, hide: function hide() { var a = this.data().f, b = a.opts.turn.data(), c = i._foldingPage.call(this);switch (a.effect) {case "hard": b.opts.gradients && (a.bshadowLoc = 0, a.bshadow.remove(), a.ashadow.hide());a.wrapper.transform("");a.fpage.hide();break;case "sheet": 0 === --a.fparent.data().flips && a.fparent.hide(), this.css({ left: 0, top: 0, right: "auto", bottom: "auto" }).transform(""), a.wrapper.transform(""), a.fwrapper.hide(), a.bshadow && a.bshadow.hide(), c.transform("");}a.visible = !1;return this; }, hideFoldedPage: function hideFoldedPage(a) { var b = this.data().f;if (b.point) { var c = this, d = b.point, e = function e() { b.point = null;b.status = "";c.flip("hide");c.trigger("end", [b.opts, !1]); };if (a) { var f = i._c.call(this, d.corner), a = "t" == d.corner.substr(0, 1) ? Math.min(0, d.y - f.y) / 2 : Math.max(0, d.y - f.y) / 2, g = j(d.x, d.y + a), l = j(f.x, f.y - a);this.animatef({ from: 0, to: 1, frame: function frame(a) { a = S(d, g, l, f, a);d.x = a.x;d.y = a.y;i._fold.call(c, d); }, complete: e, duration: 800, hiding: !0 }); } else this.animatef(!1), e(); } }, turnPage: function turnPage(a) { var b = this, c = this.data().f, d = c.opts.turn.data(), a = { corner: c.corner ? c.corner.corner : a || i._cAllowed.call(this)[0] }, e = c.point || i._c.call(this, a.corner, c.opts.turn ? d.opts.elevation : 0), f = i._c2.call(this, a.corner);this.trigger("flip").animatef({ from: 0, to: 1, frame: function frame(c) { c = S(e, e, f, f, c);a.x = c.x;a.y = c.y;i._showFoldedPage.call(b, a); }, complete: function complete() { b.trigger("end", [c.opts, !0]); }, duration: d.opts.duration, turning: !0 });c.corner = null; }, moving: function moving() { return "effect" in this.data(); }, isTurning: function isTurning() { return this.flip("moving") && this.data().effect.turning; }, corner: function corner() { return this.data().f.corner; }, _eventStart: function _eventStart(a) { var b = this.data().f, c = b.opts.turn;if (!b.corner && !b.disabled && !this.flip("isTurning") && b.opts.page == c.data().pagePlace[b.opts.page]) { b.corner = i._isIArea.call(this, a);if (b.corner && i._foldingPage.call(this)) return this.trigger("pressed", [b.point]), i._showFoldedPage.call(this, b.corner), !1;b.corner = null; } }, _eventMove: function _eventMove(a) { var b = this.data().f;if (!b.disabled) if (a = u ? a.originalEvent.touches : [a], b.corner) { var c = b.parent.offset();b.corner.x = a[0].pageX - c.left;b.corner.y = a[0].pageY - c.top;i._showFoldedPage.call(this, b.corner); } else if (b.hover && !this.data().effect && this.is(":visible")) if (a = i._isIArea.call(this, a[0])) { if ("sheet" == b.effect && 2 == a.corner.length || "hard" == b.effect) b.status = "hover", b = i._c.call(this, a.corner, b.opts.cornerSize / 2), a.x = b.x, a.y = b.y, i._showFoldedPage.call(this, a, !0); } else "hover" == b.status && (b.status = "", i.hideFoldedPage.call(this, !0)); }, _eventEnd: function _eventEnd() { var a = this.data().f, b = a.corner;!a.disabled && b && "prevented" != t("released", this, [a.point || b]) && i.hideFoldedPage.call(this, !0);a.corner = null; }, disable: function disable(a) { i.setData.call(this, { disabled: a });return this; }, hover: function hover(a) { i.setData.call(this, { hover: a });return this; }, peel: function peel(a, b) { var c = this.data().f;if (a) { if (-1 == f.inArray(a, p.all)) throw q("Corner " + a + " is not permitted");if (-1 != f.inArray(a, i._cAllowed.call(this))) { var d = i._c.call(this, a, c.opts.cornerSize / 2);c.status = "peel";i._showFoldedPage.call(this, { corner: a, x: d.x, y: d.y }, b); } } else c.status = "", i.hideFoldedPage.call(this, b);return this; } };window.requestAnim = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (a) { window.setTimeout(a, 1E3 / 60); };f.extend(f.fn, { flip: function flip() { return J(f(this[0]), i, arguments); }, turn: function turn() { return J(f(this[0]), g, arguments); }, transform: function transform(a, b) { var c = {};b && (c[w + "transform-origin"] = b);c[w + "transform"] = a;return this.css(c); }, animatef: function animatef(a) { var b = this.data();b.effect && b.effect.stop();if (a) { a.to.length || (a.to = [a.to]);a.from.length || (a.from = [a.from]);for (var c = [], d = a.to.length, e = !0, g = this, i = new Date().getTime(), j = function j() { if (b.effect && e) { for (var f = [], k = Math.min(a.duration, new Date().getTime() - i), l = 0; l < d; l++) { f.push(b.effect.easing(1, k, a.from[l], c[l], a.duration)); }a.frame(1 == d ? f[0] : f);k == a.duration ? (delete b.effect, g.data(b), a.complete && a.complete()) : window.requestAnim(j); } }, l = 0; l < d; l++) { c.push(a.to[l] - a.from[l]); }b.effect = f.extend({ stop: function stop() { e = !1; }, easing: function easing(a, b, c, d, e) { return d * Math.sqrt(1 - (b = b / e - 1) * b) + c; } }, a);this.data(b);j(); } else delete b.effect; } });f.isTouch = u;f.mouseEvents = r;f.cssPrefix = T;f.cssTransitionEnd = function () { var a, b = document.createElement("fakeelement"), c = { transition: "transitionend", OTransition: "oTransitionEnd", MSTransition: "transitionend", MozTransition: "transitionend", WebkitTransition: "webkitTransitionEnd" };for (a in c) { if (void 0 !== b.style[a]) return c[a]; } };f.findPos = D; })(jQuery); /***/ }), /***/ 248: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'Cars', create: function create() { var self = this; this.mode = this.element.data('mode'); this.loading = false; this.loaded = false; this.autoload = this.element.data('autoload'); this.data = []; this.cars = []; this.params = [{ width: 274, height: 224, p1: { x: 40.95, y: 186.16 }, p2: { x: 235.07, y: 74.09 } }, { width: 227, height: 214, p1: { x: 42.3, y: 177.46 }, p2: { x: 158.05, y: 110.64 } }, { width: 293, height: 282, p1: { x: 57.6, y: 260.09 }, p2: { x: 246.4, y: 151.08 } }, { width: 275, height: 220, p1: { x: 52.61, y: 183.15 }, p2: { x: 221.95, y: 85.39 } }, { width: 283, height: 179, p1: { x: 59.85, y: 169.46 }, p2: { x: 246.61, y: 61.64 } }, { width: 417, height: 291, p1: { x: 142.78, y: 266.38 }, p2: { x: 417.23, y: 107.93 } }, { width: 294, height: 259, p1: { x: 48.25, y: 221.1 }, p2: { x: 255.2, y: 101.61 } }, { width: 213, height: 388, p1: { x: 39.54, y: 353.37 }, p2: { x: 187.99, y: 267.67 } }, { width: 369, height: 174, p1: { x: 96.86, y: 173.54 }, p2: { x: 321.09, y: 44.08 } }, { width: 270, height: 247, p1: { x: 21.8, y: 202.62 }, p2: { x: 247.07, y: 72.57 } }, { width: 334, height: 212, p1: { x: 70.09, y: 184.87 }, p2: { x: 283.33, y: 61.75 } }, { width: 270, height: 201, p1: { x: 41.47, y: 174.11 }, p2: { x: 234.17, y: 62.86 } }]; this.revealed_lines = []; switch (this.mode) { case 'index': this.matrix = [{ list: [6] }, { list: [9, 10, 7], correction: { mode: ['shift-1-column', 'y-pop'] } }, { list: [4, 2, 1, 0], correction: { mode: ['shift-1-column', 'y-pop'] } }, { list: [8, 11, 3], correction: { mode: ['shift-1-column', 'y-pop'] } }, { correction: { mode: ['x-shift', 'shift-1-column', 'y-pop'] }, list: [5] }]; break; default: this.matrix = [{ list: [6] }, { list: [7, 3, 4, 10, 7], correction: { mode: ['x-minus'] } }, { list: [10, 9, 2, 1, 3], correction: { mode: ['x-minus'] } }, { list: [8, 11, 0], correction: { mode: ['x-minus', 'x-shift'] } }, { correction: { mode: ['x-minus', 'x-shift', 'x-shift'] }, list: [5] }]; break; } this.scale = 1; if (this.autoload) { this.preload(); } else { this.element.bind('load', function () { if (self.preload()) self.element.trigger('lazy_triggered'); }); } }, preload: function preload() { if (this.loading || this.loaded) return false; this.loading = true; var self = this; window.app.load_svg_sprite('/assets/common/svg/cars-' + window.app.lang + '.svg?v=9'); this.init_interval = setInterval(function () { if ($('#sprite-car-1').length) { self.loaded = true; self.loading = false; clearInterval(self.init_interval); self.init_interval = null; self.create_cars(); } }, 100); return true; }, create_cars: function create_cars() { var i, j; for (i = 0; i < this.matrix.length; i++) { for (j = 0; j < this.matrix[i].list.length; j++) { this.matrix[i].list[j] = new Car({ id: this.matrix[i].list[j], delegate: this }); } } window.app.add_resize(this); }, resize: function resize() { this.scale = window.container_width / 1132; var self = this, linesDistance = 300 * this.scale, endpoint, firstCarParams = this.params[this.matrix[0].list[0].id]; var topOffset = window.container_width / 8, leftOffset = (window.container_width / 4 * 1.5 - firstCarParams.width * this.scale) / 2, lineStartX = leftOffset, lineStartY = topOffset, containerHeight = 0; for (var i = 0; i < this.matrix.length; i++) { endpoint = { x: leftOffset, y: topOffset + linesDistance * i }; for (var j = 0; j < this.matrix[i].list.length; j++) { var last_car_in_line = j == this.matrix[i].list.length - 1, car = this.matrix[i].list[j], params = this.params[car.id], x = endpoint.x, y = endpoint.y; if (typeof this.revealed_lines[i] == 'undefined') { this.revealed_lines[i] = false; } if (!this.revealed_lines[i] && last_car_in_line) { (function (last_car, line_number) { window.app.sas.addElement(last_car.element, function () { self.revealed_lines[line_number] = true; self.matrix[line_number].list.map(function (car_item, i) { setTimeout(function () { car_item.element.removeClass('sa-remove-1'); }, i * 150); }); }, .1); })(car, i); } if (j) { x += Math.cos(-30 * Math.PI / 180) * 100 - params.p1.x * this.scale; y += Math.sin(-30 * Math.PI / 180) * 100 - params.p1.y * this.scale; } else { if (typeof this.matrix[i].correction != 'undefined') { var correction = this.matrix[i].correction; for (var mode_id in correction.mode) { switch (correction.mode[mode_id]) { case 'x-minus': var x_minus_shift = Math.round((window.app.ww - window.container_width) / 2) - (window.app.ww > 1550 ? Math.round((window.app.ww - 1550) / 2) : 0); x -= x_minus_shift; y += x_minus_shift * Math.sin(30 * Math.PI / 180); break; case 'x-shift': y = y - linesDistance; x += linesDistance * Math.cos(30 * Math.PI / 180) / Math.cos(60 * Math.PI / 180); break; case 'shift-1-column': x += window.container_width / 4; break; case 'y-pop': y -= window.app.ww / 8; break; } } } y -= params.p1.y * this.scale + params.p1.x * this.scale * Math.tan(30 * Math.PI / 180); } car.element.css({ width: params.width * this.scale, height: params.height * this.scale, left: x, top: y }); if (!this.revealed_lines[i]) { car.element.addClass('sa-remove-1').removeClass('hidden'); } endpoint = { x: x + params.p2.x * this.scale, y: y + params.p2.y * this.scale }; containerHeight = Math.max(containerHeight, endpoint.y + params.height * this.scale); } } $('.js-equipment-container').css({ height: Math.round(containerHeight) }); } }); var Car = MinimalClass.extend({ create: function create() { this.element = $('
').addClass('car hidden').append(this.xlink('sprite-car-' + (this.id + 1))).appendTo(this.delegate.element); } }); /***/ }), /***/ 249: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'Flipbook', create: function create() { var self = this; this.element.turn({ elevation: 50, gradients: true, autoCenter: false }); this.element.turn('page', 2); $('.js-flipbook-prev').click(function () { self.prev(); }); $('.js-flipbook-next').click(function () { self.next(); }); window.app.add_resize(this); }, prev: function prev() { this.element.turn("previous"); }, next: function next() { this.element.turn("next"); }, resize: function resize(ww, wh) { this.width = this.element[0].parentNode.getBoundingClientRect().width; this.height = Math.round(this.width / 2); this.element.css({ height: this.height }); this.element.turn("size", this.width, this.height); } }); /***/ }), /***/ 252: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), StaticSlice = __webpack_require__(253), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'StaticSliceSlider', create: function create() { var self = this; this.repos_mode = this.element.data('repos-mode'); this.exclude_from_events = !!parseInt(this.element.data('exclude-from-events')); this.pos = 0; this.item = []; this.element.find('.slide').each(function (i, elm) { self.item.push(new StaticSliceSliderItem({ element: elm, repos_mode: self.repos_mode, delegate: self })); }); window.app.add_resize(this); }, resize: function resize() { var offset = this.delegate.element.offset().top; this.item.forEach(function (slide) { slide.resize(offset); }); }, next: function next(quick, from_user) { var pos = this.pos + 1; if (pos > this.item.length - 1) { pos = 0; } this.switchto(pos, true, quick, from_user); }, prev: function prev(quick, from_user) { var pos = this.pos - 1; if (pos < 0) { pos = this.item.length - 1; } this.switchto(pos, false, quick, from_user); }, show: function show() { this.item[this.pos].show(false); }, hide: function hide() { this.item[this.pos].hide(false); }, switchto: function switchto(pos, dir, quick, from_user) { if (this.pos == pos) return; if (this.is_switching) return; this.is_switching = true; from_user && this.delegate && this.delegate.element.trigger('switching_to', [this, pos, dir]); var self = this, cur = this.item[this.pos], nxt = this.item[pos]; nxt.show(true); cur.hide(); setTimeout(function () { self.is_switching = false; }, 600); this.pos = pos; } }); var StaticSliceSliderItem = MinimalClass.extend({ __className: 'StaticSliceSliderItem', pre: function pre() { this.repos_mode = null; }, create: function create() { var self = this; this.ww = 0; this.wh = 0; this.slice = []; this.element.find('.js-static-slice').each(function (i, elm) { self.slice.push(new StaticSlice({ element: elm, repos_mode: self.repos_mode, delegate: self })); }); }, resize: function resize(offset) { var rect = this.element[0].getBoundingClientRect(); this.ww = rect.width; this.wh = rect.height; this.slice.forEach(function (slice) { slice.resize(rect.width, rect.height, offset); }); }, show: function show(quick) { var self = this; this.element.addClass('visible'); this.slice.forEach(function (slice) { slice.toggle(true, quick); }); setTimeout(function () { self.element.removeClass('visible').addClass('active'); }, 600); }, hide: function hide(quick) { var self = this; this.element.addClass('visible'); this.slice.forEach(function (slice) { slice.toggle(false, quick); }); setTimeout(function () { self.element.removeClass('visible active'); }, 600); } }); /***/ }), /***/ 253: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'StaticSlice', create: function create() { var self = this; this.mode = this.element.data('mode') || 'wh'; this.is_loaded = false; this.aspect = 1; this.src = this.element.data('src'); this.load(); this.debug = parseInt(this.element.data('debug') || 0); this.state = true; this.bgw = 0; this.bgh = 0; this.opened = false; this.current_rect = null; }, load: function load() { if (this.is_loaded) { return this.setup(); } var self = this; if (this.src) { this.img = $(''); this.img.appendTo(window.LZ).bind('load error', function (e) { self.loaded(e.type); }).attr('src', this.src); } }, loaded: function loaded(type) { this.is_loaded = true; switch (type) { case 'load': this.image_width = this.img ? this.img[0].width || 0 : 0; this.image_height = this.img ? this.img[0].height || 0 : 0; this.aspect = this.image_width / this.image_height; this.setup(); break; default: this.setup(); break; } }, setup: function setup() { this.element.css({ backgroundImage: 'url(' + this.src + ')' }); this.resize(); this.toggle(this.opened, true); }, toggle: function toggle(dir, quick) { var self = this, pos, rect = { top: 0, left: 0, width: this.off_width, height: this.off_height }; if (dir) {} else { switch (this.mode) { case 'w': rect.width = 0; break; case '-w': rect.left = rect.width; rect.width = 0; break; case 'h': rect.height = 0; break; case '-h': rect.top = rect.height; rect.height = 0; break; case 'wh': case 'hw': default: rect.width = 0; rect.height = 0; break; } } pos = this.calcPositionForRect(rect); quick ? this.element.removeClass('animated') : this.element.addClass('animated'); this.current_rect = rect; this.element.css({ top: rect.top, left: rect.left, width: rect.width, height: rect.height, backgroundPosition: pos.left + 'px ' + pos.top + 'px' }); if (dir) { var onComplete = function onComplete() { self.element.css({ width: '', height: '' }); self.element.unbind(self.transitionEndEventName()); }; if (quick) { onComplete(); } else { self.element.bind(self.transitionEndEventName(), onComplete); } } this.opened = dir; }, calcPositionForRect: function calcPositionForRect(rect, ww, wh, offset) { if (typeof offset == 'undefined') offset = 0; ww = ww || this.delegate.ww; wh = wh || this.delegate.wh; var left = Math.round((ww - this.bgw) / 2), top = Math.round((wh - this.bgh) / 2); switch (this.repos_mode) { case 'self': top -= rect.top; left -= rect.left; break; default: left -= rect.left; top -= rect.top - offset; break; } return { top: top, left: left }; }, resize: function resize(ww, wh, offset) { if (typeof offset == 'undefined') offset = 0; this.element.removeClass('animated').css({ width: '', height: '' }); ww = ww || this.delegate.ww; wh = wh || this.delegate.wh; var rect = this.element[0].getBoundingClientRect(); this.bgw = ww; this.bgh = this.bgw / this.aspect; if (this.bgh < wh) { this.bgh = wh; this.bgw = this.bgh * this.aspect; } this.off_width = this.element.width(); this.off_height = this.element.height(); var pos = this.calcPositionForRect(rect, ww, wh, offset); this.element.css({ backgroundSize: this.bgw + 'px ' + this.bgh + 'px', backgroundPosition: pos.left + 'px ' + pos.top + 'px' }); } }); /***/ }), /***/ 254: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), SVG = __webpack_require__(173), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'ParkSVG', create: function create() { this.draw = SVG(this.element[0]); this.height = 0; this.line1 = null; this.line1_points = null; this.line2 = null; this.line2_points = null; this.line3 = null; this.line3_points = null; this.line4 = null; this.line4_points = null; this.polyline = null; window.app.add_resize(this); }, resize: function resize() { if (this.polyline) { this.polyline.remove(); } if (this.line1) { this.line1.remove(); } if (this.line2) { this.line2.remove(); } if (this.line3) { this.line3.remove(); } if (this.line4) { this.line4.remove(); } var container_width = this.element.parent().find('.container').width(), column_width = container_width / 4, padding = (window.app.ww - container_width) / 2; var first_column_y = padding * Math.sin(36 * Math.PI / 180), first_peak_y = (padding + column_width) * Math.sin(36 * Math.PI / 180); this.points = []; var i, x = 0, y = 0, miny = 0, maxy = 0; this.points.push([x, y]); x = padding + column_width; y -= first_peak_y; miny = Math.min(miny, y); maxy = Math.max(maxy, y); this.points.push([x, y]); x += column_width; y -= column_width * Math.sin(-30 * Math.PI / 180); miny = Math.min(miny, y); maxy = Math.max(maxy, y); this.points.push([x, y]); x += column_width * 2; y -= column_width * 2 * Math.sin(36 * Math.PI / 180); miny = Math.min(miny, y); maxy = Math.max(maxy, y); this.points.push([x, y]); x = window.app.ww; y -= padding * Math.sin(-48 * Math.PI / 180); miny = Math.min(miny, y); maxy = Math.max(maxy, y); this.points.push([x, y]); y = maxy; this.points.push([x, y]); this.points.push([x, y + 5]); maxy += 5; x = 0; this.points.push([x, y + 5]); this.points.push([x, y]); if (maxy < 0) { y = 0; this.points.push([x, y]); } x = this.points[1][0]; y = this.points[1][1]; this.line1_points = [[x, y]]; x += column_width * 3; y -= column_width * 3 * Math.sin(36 * Math.PI / 180); this.line1_points.push([x, y]); miny = Math.min(miny, y); var offset = this.points[1][1]; this.height = maxy - miny; for (i = 0; i < this.points.length; i++) { this.points[i][1] += this.height - maxy; } for (i = 0; i < this.line1_points.length; i++) { this.line1_points[i][1] += this.height - maxy; } x = this.points[3][0]; y = this.points[3][1]; this.line2_points = [[x, y]]; x = window.app.ww; y -= padding * Math.sin(36 * Math.PI / 180); this.line2_points.push([x, y]); this.element.parent().find('.section-title').css({ paddingTop: 0, paddingBottom: 0 }); var padding_length = this.height - 5 - this.element.parent().find('.section-title').outerHeight(true), padding_top = Math.round((padding_length - first_peak_y) / 2), padding_bottom = padding_length - padding_top; this.element.parent().find('.section-title').css({ paddingTop: padding_top, paddingBottom: padding_bottom }); this.element.css({ height: this.height }); var stats_numbers = this.element.parent().find('.js-park-numbers'); stats_numbers.css({ top: this.points[1][1] - stats_numbers.height() / 2, left: Math.round(padding + column_width * 2 - 60) }); this.polyline = this.draw.polyline(this.points).fill('#009a67'); this.line1 = this.draw.polyline(this.line1_points).stroke({ width: 1, color: '#333333', opacity: 0.08 }).fill('none'); this.line2 = this.draw.polyline(this.line2_points).stroke({ width: 1, color: '#333333', opacity: 0.08 }).fill('none'); this.line3 = this.draw.line(padding, this.height, padding, this.height - first_column_y).stroke({ width: 1, color: '#333333', opacity: 0.08 }); this.line4 = this.draw.line(padding + column_width, this.height, padding + column_width, this.height - first_peak_y).stroke({ width: 1, color: '#333333', opacity: 0.08 }); } }); /***/ }), /***/ 255: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'IndexServicesMap', create: function create() { var self = this; // this.map_width = 2881; // this.map_height = 2691; this.is_mobile = window.app.mobile_detect.mobile(); this.map_width = 1440; this.map_height = 1067; this.loading = false; this.loaded = false; this.container = this.element.find('.js-container'); this.map = this.element.find('.js-services-map'); this.src = '/assets/desktop/images/map-2.png'; this.opened_marker = false; this.markers = []; this.element.find('.js-service-map-marker').each(function (i, elm) { var obj = $(elm), id = obj.data('id'), item = { id: id, obj: obj, opened: false, popup: self.element.find('.js-services-map-popup[data-id=' + id + ']'), toggle: function toggle(dir) { if (typeof dir == 'undefined') dir = !this.opened; if (dir) { if (self.opened_marker) { self.opened_marker.toggle(false); self.opened_marker = null; } this.set_optimal_position(); this.popup.fadeIn(500); obj.removeClass('pulse').addClass('opened'); self.opened_marker = this; } else { if (self.opened_marker == this) { self.opened_marker = null; } this.popup.fadeOut(500); obj.removeClass('opened').addClass('pulse'); } this.opened = dir; }, set_optimal_position: function set_optimal_position() { this.popup.css({ display: 'block' }).removeClass('pinned-bottom pinned-top pinned-left pinned-right'); var width = this.popup.outerWidth(true), height = this.popup.outerHeight(true), marker_rect = this.obj[0].getBoundingClientRect(), ss_top = marker_rect.top - 110 < height, ss_left = marker_rect.left + marker_rect.width / 2 - width / 2 < 20; if (ss_top) { this.popup.addClass('pinned-top'); } else { this.popup.addClass('pinned-bottom'); } this.popup.css({ display: '' }); } }; if (self.is_mobile) { obj.bind('touchstart', function (e) { item.toggle(); }); } else { obj.bind('mouseenter mouseleave', function (e) { switch (e.type) { case 'mouseenter': item.toggle(true); break; case 'mouseleave': item.toggle(false); break; } }); } self.markers[id] = item; }); if (this.is_mobile) { this.element.find('img.map-image').bind('touchstart', function (e) { if (self.opened_marker) { self.opened_marker.toggle(); } }); } this.element.bind('load', function () { if (self.preload()) self.element.trigger('lazy_triggered'); }); window.app.add_resize(this); this.start_pulse(); }, start_pulse: function start_pulse() { for (var i = 0; i < this.markers.length; i++) { (function (marker, index) { setTimeout(function () { marker.obj.addClass('pulse'); }, 200 * index); })(this.markers[i], i); } }, preload: function preload() { if (this.loading || this.loaded) return false; this.loading = true; var self = this; this.img = this.element.find('img.map-image'); this.img.bind('load error', function (e) { self.map_loaded(e); }).attr('src', this.src); return true; }, map_loaded: function map_loaded(e) { this.loaded = true; this.loading = false; }, resize: function resize(ww, wh) { var map_height = Math.round(ww / this.map_width * this.map_height), map_top = ww >= 1920 ? 0 : Math.round(Math.min(1, Math.abs(1 - (ww - 1000) / 920)) * 200), container_height = map_height + map_top; this.map.css({ top: map_top, height: map_height }); this.element.css({ height: container_height }); this.container.css({ height: container_height }); } }); /***/ }), /***/ 207: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), Overlay = __webpack_require__(78), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'Leaderhips', create: function create() { var self = this; this.url = this.element.data('url'); this.busy = false; this.items = {}; this.element.find('.js-leadership').each(function (i, elm) { var obj = $(elm), id = obj.data('id'), item = { id: id, obj: obj, overlay: null, loaded: false, open: function open() { if (this.loaded) { return this.overlay.open(); } self.load(id); } }; obj.click(function () { item.open(); }); self.items[id] = item; }); }, load: function load(id) { var self = this; if (this.busy) return; var item = this.items[id]; $.ajax({ url: this.url, type: 'GET', dataType: 'json', content: this, data: { id: id }, beforeSend: function beforeSend() { self.busy = true; } }).done(function (resp) { if (resp.error) { self.log(resp.message); return; } var element = $(resp.html).appendTo(document.body); item.overlay = new Overlay({ element: element }); item.loaded = true; item.open(); }).fail(function () {}).always(function () { self.busy = false; }); } }); /***/ }), /***/ 240: /***/ (function(module, exports, __webpack_require__) { "use strict"; var DialNumber = __webpack_require__(250); var Slider = __webpack_require__(162); __webpack_require__(247); module.exports = function () { var about_dial_number = null, numbers_slider = null; window.app.map_modules({ '.js-history': __webpack_require__(256), '.js-flipbook': __webpack_require__(249), '.js-leaderships': __webpack_require__(207), '.js-structure': __webpack_require__(258), '.js-about-dial-number': { module: DialNumber, callback: function callback(i) { about_dial_number = i; } }, '.js-number-slider': { module: Slider, callback: function callback(i) { numbers_slider = i; } } }); if (about_dial_number) { window.app.sas.addElement(about_dial_number.element, function (obj) { about_dial_number.dial(obj.data('number')); }, .25); if (numbers_slider) { numbers_slider.element.bind('items_switching', function (e, slider, pos, nxt, prev_pos, cur) { about_dial_number.dial(nxt.element.data('number')); }); var captions = numbers_slider.element.find('.stage2').find('.slide'); if (captions.length) { numbers_slider.element.bind('items_switching', function (e, slider, pos, nxt, prev_pos, cur) { captions.removeClass('active'); setTimeout(function () { $(captions[pos]).addClass('active'); }, 500); }); } } } $(window).trigger('scroll'); }; /***/ }), /***/ 250: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), MinimalClass = __webpack_require__(1); window.dialnumbers = {}; module.exports = MinimalClass.extend({ __className: 'DialNumber', create: function create() { var self = this; this.tid = this.element.data('tid'); if (this.tid) { window.dialnumbers[this.tid] = this; } this.cell = []; this.element.find('.cell').each(function (i, elm) { var obj = $(elm), box = obj.find('ul'), cell = { obj: obj, box: box, pos: 0, current_num: 0, char_height: 0, init: function init() { this.box.find('li').remove(); this.box.append($('
  • ').html(this.current_num)); }, resize: function resize() { this.char_height = this.box.outerHeight(true) / 11; this.box.stop().css({ top: -(this.pos * this.char_height) }); }, regenerate: function regenerate(start, finish) { this.box.find('li').remove(); this.box.append($('
  • ').html(start)); var i, num, nums = []; nums.push(start); nums.push(finish); for (var i = 0; i < 9; i++) { do { num = Math.ceil(Math.random() * 9); } while (num == start || num == finish); this.box.append($('
  • ').html(num)); nums.push(num); } this.box.append($('
  • ').html(finish)); this.resize(); for (i = 0; i < 10; i++) { if (!self.in_array(i, nums)) { this.box.append($('
  • ').html(i)); } } }, dial: function dial(num) { this.regenerate(this.current_num, num); this.box.stop().animate({ top: -(this.char_height * 10) }, 1500); this.current_num = num; } }; cell.init(); self.cell.push(cell); }); }, dial: function dial(number) { var self = this; number.toString().split('').forEach(function (number, i) { self.cell[i].dial(parseInt(number)); }); } }); /***/ }), /***/ 256: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), SVG = __webpack_require__(173), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'History', create: function create() { var self = this; this.path = false; this.map_modules({ '.js-history-path-svg': { module: __webpack_require__(257), callback: function callback(i) { self.path = i; } } }); this.rows = $('.js-history-row'); this.icon_boxes = this.rows.find('.js-icon-box'); window.app.add_resize(this); }, resize: function resize(ww, wh) { var row_max_height = 0; this.rows.css({ height: 'auto' }); this.rows.each(function (i, elm) { row_max_height = Math.max(row_max_height, $(elm).outerHeight(true)); }); this.rows.css({ height: Math.round(row_max_height) }); var icon_box_max_height = 0; this.icon_boxes.css({ height: 'auto' }); this.icon_boxes.each(function (i, elm) { icon_box_max_height = Math.max(icon_box_max_height, $(elm).outerHeight(true)); }); this.icon_boxes.css({ height: Math.round(icon_box_max_height) }); if (this.path) { this.path.element.css({ top: icon_box_max_height + 12 }); this.path.lines = this.rows.length - 1; this.path.line_height = row_max_height; this.path.resize(ww, wh); } } }); /***/ }), /***/ 257: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), SVG = __webpack_require__(173), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'HistoryPathSVG', pre: function pre() { this.lines = 4; this.line_height = 100; this.line1 = null; this.line2 = null; this.line3 = null; this.line4 = null; }, create: function create() { this.draw = SVG(this.element[0]); this.animated = false; this.animating = false; this.path = null; this.path_white = null; this.arrow = null; this.should_resize = false; var self = this; window.app.add_scroll(this); }, dist: function dist(x1, x2, y1, y2) { return Math.sqrt((x2 -= x1) * x2 + (y2 -= y1) * y2); }, scroll: function scroll() { if (this.animated) return; if (!this.path_white) return; var rect = this.element[0].getBoundingClientRect(); var prc = 0, total = window.innerHeight + rect.height; if (rect.top > window.innerHeight) prc = 0;else if (rect.top < -rect.height) prc = 1;else prc = 1 - (rect.top + rect.height) / total; if (prc > 0.1) { this.animate(); } }, animate: function animate() { var self = this; this.animated = true; this.animating = true; this.path_white.animate(3000).stroke({ 'dashoffset': -this.path_length }).queue(function () { self.arrow.animate(300).attr({ opacity: 1 }); self.animating = false; if (self.should_resize) { self.should_resize = false; self.resize(); } }); }, resize: function resize() { if (this.animating) return; if (this.path) { this.path.remove(); } if (this.path_white) { this.path_white.remove(); } if (this.arrow) { this.arrow.remove(); } if (this.line1) { this.line1.remove(); } if (this.line2) { this.line2.remove(); } if (this.line3) { this.line3.remove(); } if (this.line4) { this.line4.remove(); } var width = this.element.width(), height = this.element.height(); var stroke_width = 2, xpad = stroke_width / 2, ypad = stroke_width / 2, radius = this.line_height / 2, left = this.line_height / 2 + xpad * 2, right = width - this.line_height / 2 - xpad * 2; this.commands = ['M' + xpad + ',' + ypad]; for (var i = 0; i < this.lines; i++) { if (i % 2) { this.commands.push('H' + left); this.commands.push('A' + radius + ' ' + radius + ' 0 0 0 ' + left + ' ' + (this.line_height * (i + 1) + ypad)); } else { this.commands.push('H' + right); this.commands.push('A' + radius + ' ' + radius + ' 0 0 1 ' + right + ' ' + (this.line_height * (i + 1) + ypad)); } } if (this.lines % 2) { this.commands.push('H' + xpad); } else { this.commands.push('H' + (width - xpad)); } var lines_height = this.line_height * this.lines; var lines_offset = radius - Math.sqrt(Math.pow(radius, 2) - Math.pow(left - width / 8, 2)); this.line1 = this.draw.line(width / 8, 0, width / 8, lines_height - lines_offset).stroke({ width: 1, color: '#333333', opacity: 0.08 }); this.line2 = this.draw.line(width / 8 * 3, 0, width / 8 * 3, lines_height).stroke({ width: 1, color: '#333333', opacity: 0.08 }); this.line3 = this.draw.line(width / 8 * 5, 0, width / 8 * 5, lines_height).stroke({ width: 1, color: '#333333', opacity: 0.08 }); this.line4 = this.draw.line(width / 8 * 7, lines_offset, width / 8 * 7, lines_height).stroke({ width: 1, color: '#333333', opacity: 0.08 }); this.path = this.draw.path(this.commands.join('')).stroke({ width: stroke_width, color: '#02a56f', dasharray: '20 10', opacity: 1 }).fill('none'); if (!this.animated) { this.path_white = this.draw.path(this.commands.join('')).stroke({ width: stroke_width + 1, color: '#ffffff' }).fill('none'); } this.path_length = this.path_white.length(); this.path_white.stroke({ 'dasharray': this.path_length + ' ' + this.path_length, 'dashoffset': 0 }); var arrow_height = this.line_height * this.lines + stroke_width / 2; this.arrow = this.draw.polyline([[width - 20, arrow_height - 6], [width, arrow_height], [width - 20, arrow_height + 6]]).attr({ opacity: this.animated ? 1 : 0 }).fill('#02a56f'); } }); /***/ }), /***/ 258: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'Structure', create: function create() { var self = this; this.box = this.element.find('.js-structure-box'); this.rect = null; this.logos = {}; this.map_modules({ 'div.detra': { module: StructureBox1, callback: function callback(i) { self.logos.detra = i; } }, 'div.agrp': { module: StructureBox1, options: { flip: 1 }, callback: function callback(i) { self.logos.agrp = i; } }, 'div.hgrp': { module: StructureBox2, callback: function callback(i) { self.logos.hgrp = i; } }, 'div.bgrp': { module: StructureBox2, options: { hflip: 1 }, callback: function callback(i) { self.logos.bgrp = i; } }, 'div.logistic': { module: StructureBox2, options: { vflip: 1 }, callback: function callback(i) { self.logos.logistic = i; } }, 'div.bvr': { module: StructureBox2, options: { hflip: 1, vflip: 1 }, callback: function callback(i) { self.logos.bvr = i; } } }); this.box.bind('mousemove', function (e) { self.onMouse(e); }); window.app.add_resize(this); }, onMouse: function onMouse(e) { switch (e.type) { case 'mousemove': var x = e.pageX - this.rect.left, y = e.pageY - this.rect.top, col_width = window.container_width / 4, col_height = this.rect.height / 3, on_left = x < col_width, on_right = x > col_width * 3, on_top = y < col_height, on_bottom = y > col_height * 2, aspect = col_width / col_height, on_side = false; if (on_left || on_right) { if (on_left) { x = col_width - x; if (on_top) { y = col_height - y; on_side = x / aspect > y; } else if (on_bottom) { y = y - col_height * 2; on_side = x / aspect > y; } else { on_side = true; } } else { x = x - col_width * 3; if (on_top) { y = col_height - y; on_side = x / aspect > y; } else if (on_bottom) { y = y - col_height * 2; on_side = x / aspect > y; } else { on_side = true; } } } if (on_left && on_side) { this.logos.detra.element.addClass('ztop'); this.logos.hgrp.element.removeClass('ztop'); this.logos.logistic.element.removeClass('ztop'); } else { this.logos.detra.element.removeClass('ztop'); this.logos.hgrp.element.addClass('ztop'); this.logos.logistic.element.addClass('ztop'); } if (on_right && on_side) { this.logos.agrp.element.addClass('ztop'); this.logos.bgrp.element.removeClass('ztop'); this.logos.bvr.element.removeClass('ztop'); } else { this.logos.agrp.element.removeClass('ztop'); this.logos.bgrp.element.addClass('ztop'); this.logos.bvr.element.addClass('ztop'); } break; } }, resize: function resize() { for (var k in this.logos) { this.logos[k].resize(); } var rect = this.box[0].getBoundingClientRect(); this.rect = { top: rect.top + window.app.scrollTop, left: rect.left, width: rect.width, height: rect.height }; } }); var StructureBox1 = MinimalClass.extend({ __className: 'StructureBox1', create: function create() { var self = this; this.draw = SVG(this.element[0]); this.polyline = false; this.points = false; }, resize: function resize() { if (this.polyline) { this.polyline.remove(); } var rect = this.element[0].getBoundingClientRect(); if (this.flip) { this.points = [[rect.width, 1], [0, rect.height / 3 + 1], [0, rect.height / 3 * 2 - 1], [rect.width, rect.height - 1]]; } else { this.points = [[0, 1], [rect.width, rect.height / 3 + 1], [rect.width, rect.height / 3 * 2 - 1], [0, rect.height - 1]]; } this.polyline = this.draw.polyline(this.points); } }); var StructureBox2 = MinimalClass.extend({ __className: 'StructureBox2', create: function create() { var self = this; this.draw = SVG(this.element[0]); this.polyline = false; this.points = false; }, resize: function resize() { if (this.polyline) { this.polyline.remove(); } var rect = this.element[0].getBoundingClientRect(); if (this.hflip) { this.points = [[rect.width, 0], [0, 0], [0, rect.height], [rect.width / 2, rect.height]]; if (this.vflip) { this.points = [[rect.width, rect.height], [0, rect.height], [0, 0], [rect.width / 2, 0]]; } } else { if (this.vflip) { this.points = [[0, rect.height], [rect.width / 2, 0], [rect.width, 0], [rect.width, rect.height]]; } else { this.points = [[1, 0], [rect.width, 0], [rect.width, rect.height], [rect.width / 2 + 1, rect.height]]; } } this.polyline = this.draw.polyline(this.points); } }); /***/ }), /***/ 195: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), SVG = __webpack_require__(173), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'Vacancies', create: function create() { var self = this; this.map_modules({ '.js-vacancy': Vacancy }); } }); var Vacancy = MinimalClass.extend({ __className: 'Vacancy', create: function create() { var self = this; this.opened = false; this.title = this.element.find('.js-title'); this.header = this.element.find('.js-toggle-vacancy').click(function () { self.toggle(); }); this.body_box = this.element.find('.vacancy-body-box'); this.body = this.body_box.find('.vacancy-body'); this.element.find('.js-trigger-resume-overlay').click(function (e) { $('.js-overlay-vacancy-title').html(self.title.html()); window.overlays.resume.open(); }); }, toggle: function toggle() { if (this.opened) { this.element.removeClass('opened'); this.body_box.animate({ height: 0 }); } else { this.element.addClass('opened'); this.body_box.animate({ height: this.body.outerHeight(true) }); } this.opened = !this.opened; } }); /***/ }), /***/ 244: /***/ (function(module, exports, __webpack_require__) { "use strict"; var Slider = __webpack_require__(162); module.exports = function () { window.app.map_modules({ '.js-vacancies': __webpack_require__(195), '.js-career-main-slider': { module: Slider, options: { load_on_demand: true }, callback: function callback(i) { window.career_main_slider = i; } } }); $('.js-to-vacancy-list').unbind('click').click(function () { window.app.scrollTo($('section.vacancies'), 750, null, -88); }); $(window).trigger('scroll'); }; /***/ }), /***/ 208: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'Contacts', create: function create() { var self = this; this.times = []; this.start_time = new Date(); $('.js-office-time').each(function (i, elm) { var obj = $(elm), item = { id: i, obj: obj, time: new Date(obj.data('time')) }; self.times.push(item); }); this.interval = setInterval(function () { self.updateTime(); }, 1000); this.contact = {}; this.element.find('.js-contact-box').each(function (i, elm) { var obj = $(elm), tid = obj.data('menu-anchor'), item = { id: i, obj: obj, tid: tid, google_map: null, yandex_map: null, show_google_map_btn: i ? obj.find('.js-trigger-google-map') : $('.js-trigger-google-map-big'), show_yandex_map_btn: i ? obj.find('.js-trigger-yandex-map') : $('.js-trigger-yandex-map-big'), close_map_btn: obj.find('.js-close-map'), show_google_map: function show_google_map() { this.close_maps(); this.google_map.create_map(); this.show_google_map_btn.addClass('active'); this.google_map.element.addClass('active'); this.close_map_btn.addClass('active'); }, show_yandex_map: function show_yandex_map() { this.close_maps(); this.yandex_map.create_map(); this.show_yandex_map_btn.addClass('active'); this.yandex_map.element.addClass('active'); this.close_map_btn.addClass('active'); }, close_maps: function close_maps() { this.show_google_map_btn.removeClass('active'); this.show_yandex_map_btn.removeClass('active'); this.google_map.element.removeClass('active'); this.yandex_map.element.removeClass('active'); this.close_map_btn.removeClass('active'); } }; item.show_google_map_btn.click(function () { item.show_google_map(); }); item.show_yandex_map_btn.click(function () { item.show_yandex_map(); }); item.close_map_btn.click(function () { item.close_maps(); }); self.contact[tid] = item; }); if (typeof window.maps_controller != 'undefined') { this.create_maps(); } else { $(window).bind('maps_controller_ready', function () { self.create_maps(); }); } $('.js-contact-form-trigger').click(function () { window.app.scrollTo($('section.contact-form'), 750, false, -140); }); }, updateTime: function updateTime() { var self = this, current_time = new Date(), diff = current_time.getTime() - this.start_time.getTime(); this.times.forEach(function (item) { var date = new Date(item.time.getTime() + diff); item.obj.html(self.za(date.getHours()) + ':' + self.za(date.getMinutes()) + ':' + self.za(date.getSeconds())); }); }, create_maps: function create_maps() { var self = this; for (var tid in this.contact) { // console.log(tid); (function (contact) { contact.obj.find('.js-google-map').each(function (i, elm) { window.maps_controller.createSimpleGoogleMap($(elm), { autocreate: false }, function (instance) { contact.google_map = instance; }); }); contact.obj.find('.js-yandex-map').each(function (i, elm) { window.maps_controller.createSimpleYandexMap($(elm), { autocreate: false }, function (instance) { contact.yandex_map = instance; }); }); })(this.contact[tid]); } } }); /***/ }), /***/ 246: /***/ (function(module, exports, __webpack_require__) { "use strict"; var MapsController = __webpack_require__(197); module.exports = function () { window.app.map_modules({ '.js-contacts': __webpack_require__(208), '.js-floating-menu': __webpack_require__(251) }); $('.js-scroll-to-trigger').each(function (i, elm) { var obj = $(elm), anchor = obj.data('anchor'), object = $('[data-menu-anchor=' + anchor + ']'); obj.click(function () { if (anchor == 'moscow') { window.app.scrollTo($(document.body), 750, null, 0); } else { window.app.scrollTo(object, 750, null, -110); } }); }); new MapsController(); $(window).trigger('scroll'); }; /***/ }), /***/ 251: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'FloatingMenu', create: function create() { var self = this; this.box_top = 0; this.box_height = 0; this.height = 0; this.fixed = false; this.box = this.element.parent(); this.active_item = null; this.items = []; this.element.find('li').each(function (i, elm) { var obj = $(elm), anchor = obj.data('anchor'), item = { id: i, obj: obj, start: 0, finish: 0, anchor: anchor, object: $('[data-menu-anchor=' + anchor + ']'), active: false, activate: function activate(dir) { dir ? this.obj.addClass('active') : this.obj.removeClass('active'); this.active = dir; } }; item.obj.click(function (e) { if (anchor == 'moscow') { window.app.scrollTo($(document.body), 750, null, 0); } else { window.app.scrollTo(item.object, 750, null, -110); } }); self.items.push(item); }); window.app.add_resize(this); window.app.add_scroll(this); }, resize: function resize(ww, wh) { this.box_top = this.box.offset().top; this.box_height = this.box.outerHeight(true); if (this.fixed) { this.element.removeClass('fixed'); } this.element.css({ width: '' }); this.width = this.element.outerWidth(true); this.height = this.element.outerHeight(true); if (this.fixed) { this.element.addClass('fixed'); } this.element.css({ width: this.width }); for (var i = 0, count = this.items.length; i < count; i++) { this.items[i].start = this.items[i].object.offset().top; this.items[i].finish = this.items[i].start + this.items[i].object.outerHeight(true); } this.fix_start = this.box_top - 110; this.fix_stop = Math.min(this.fix_start + (this.box_height - this.height), this.items[this.items.length - 1].start - 110); this.scroll(window.app.scrollTop); }, scroll: function scroll(scrollTop) { if (window.contentFixed) return; var fixed = scrollTop > this.fix_start && scrollTop < this.fix_stop; if (this.fixed != fixed) { if (fixed) { this.element.addClass('fixed').css({ transform: '' }); } else { this.element.removeClass('fixed'); if (scrollTop <= this.fix_start) { this.element.css({ transform: '' }); } else { this.element.css({ transform: 'translateY(' + (this.fix_stop - this.fix_start) + 'px)' }); } } this.fixed = fixed; } // var top = Math.min(Math.max(0,scrollTop - this.box_top),this.box_height - this.height); // this.element.css({ transform: 'translate3d(0,' + top + 'px,0)' }) this.update_active_item(scrollTop); }, update_active_item: function update_active_item(scrollTop) { var item, active_item = false; scrollTop += window.app.wh / 2; for (var i = 0, count = this.items.length; i < count; i++) { if (scrollTop > this.items[i].start) { active_item = this.items[i]; } else { break; } } if (active_item) { if (this.active_item && this.active_item != active_item) { this.active_item.activate(false); this.active_item = null; } active_item.activate(true); this.active_item = active_item; } else if (this.active_item) { this.active_item.activate(false); this.active_item = null; } } }); /***/ }), /***/ 245: /***/ (function(module, exports, __webpack_require__) { "use strict"; var DialNumber = __webpack_require__(250); module.exports = function () { var evolution_dial_number = null; window.app.map_modules({ '#equipment-svg': __webpack_require__(262), '.js-cars': __webpack_require__(248), '.js-equipment-dial-number': { module: DialNumber, callback: function callback(i) { evolution_dial_number = i; } } }); window.app.sas.addElement(evolution_dial_number.element, function (obj) { evolution_dial_number.dial(obj.data('number')); }, .25); $(window).trigger('scroll'); }; /***/ }), /***/ 262: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), SVG = __webpack_require__(173), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'ParkSVG', create: function create() { this.draw = SVG(this.element[0]); this.height = 0; this.line1 = null; this.line1_points = null; this.line2 = null; this.line2_points = null; this.line3 = null; this.line3_points = null; this.line4 = null; this.line4_points = null; this.polyline = null; window.app.add_resize(this); }, resize: function resize() { if (this.polyline) { this.polyline.remove(); } if (this.line1) { this.line1.remove(); } if (this.line2) { this.line2.remove(); } if (this.line3) { this.line3.remove(); } if (this.line4) { this.line4.remove(); } var container_width = this.element.parent().find('.container').width(), column_width = container_width / 4, padding = (window.app.ww - container_width) / 2; this.points = []; var i, x = 0, y = 0, miny = 0, maxy = 0; this.points.push([x, y]); x = padding + column_width + 1; y -= (padding + column_width) * Math.sin(36 * Math.PI / 180); miny = Math.min(miny, y); maxy = Math.max(maxy, y); this.points.push([x, y]); x += column_width; y -= column_width * Math.sin(-30 * Math.PI / 180); miny = Math.min(miny, y); maxy = Math.max(maxy, y); this.points.push([x, y]); x += column_width * 2; y -= column_width * 2 * Math.sin(36 * Math.PI / 180); miny = Math.min(miny, y); maxy = Math.max(maxy, y); this.points.push([x, y]); x = window.app.ww; y -= padding * Math.sin(-48 * Math.PI / 180); miny = Math.min(miny, y); maxy = Math.max(maxy, y); this.points.push([x, y]); y = maxy; this.points.push([x, y]); x = 0; this.points.push([x, y]); if (maxy < 0) { y = 0; this.points.push([x, y]); } x = this.points[1][0]; y = this.points[1][1]; miny = Math.min(miny, y); this.height = maxy - miny; for (i = 0; i < this.points.length; i++) { this.points[i][1] += this.height - maxy + padding * Math.sin(36 * Math.PI / 180); } this.line1_points = [this.points[1], [this.points[1][0], this.height]]; this.line2_points = [this.points[2], [this.points[2][0], this.height]]; this.line3_points = [[this.points[2][0] + column_width, this.points[2][1] - column_width * Math.sin(36 * Math.PI / 180)], [this.points[2][0] + column_width, this.height]]; this.line4_points = [this.points[3], [this.points[3][0], this.height]]; this.element.css({ height: this.height }); this.polyline = this.draw.polyline(this.points).fill('#ffffff'); this.line1 = this.draw.polyline(this.line1_points).stroke({ width: 1, color: '#333333', opacity: 0.08 }).fill('none'); this.line2 = this.draw.polyline(this.line2_points).stroke({ width: 1, color: '#333333', opacity: 0.08 }).fill('none'); this.line3 = this.draw.polyline(this.line3_points).stroke({ width: 1, color: '#333333', opacity: 0.08 }).fill('none'); this.line4 = this.draw.polyline(this.line4_points).stroke({ width: 1, color: '#333333', opacity: 0.08 }).fill('none'); } }); /***/ }), /***/ 242: /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function () { window.app.map_modules({ '.js-calendar': __webpack_require__(259), '#news-box': __webpack_require__(200) }); $(window).trigger('scroll'); }; /***/ }), /***/ 259: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'Calendar', create: function create() { var self = this; this.current_year = new Date().getFullYear(); this.min_year = 2011; this.max_year = parseInt(this.current_year); this.first_date = 0; this.last_date = 0; this.calendar = this.element.find('.calendar'); this.year_span = this.element.find('.js-year'); this.toggler = this.element.find('.js-toggle').click(function () { self.toggle(); }); this.calendar_span = this.element.find('.js-calendar-span'); this.calendar_span_default = this.calendar_span.html(); this.clear_filter = this.element.find('.js-clear-calendar'); this.fill_calendar = this.element.find('.js-fill-calendar'); this.opened = false; this.inited = false; this.mouse_over = false; this.element.bind('mouseenter mouseleave', function (e) { self.mouse_over = e.type == 'mouseenter'; }); $(window).click(function () { if (!self.mouse_over) { self.toggle(false); } }); this.prev = this.element.find('.js-prev').click(function () { if (self.current_year - 1 >= self.min_year) { self.current_year--; self.update_year(); } }); this.next = this.element.find('.js-next').click(function () { if (self.current_year + 1 <= self.max_year) { self.current_year++; self.update_year(); } }); this.months_text = []; this.months = this.element.find('.month'); this.months.each(function (i, elm) { elm = $(elm); self.months_text.push(elm.text()); elm.click(function () { self.month_click(elm); }); }); this.update_disabled = false; this.clear_filter.click(function (e) { e.preventDefault(); e.stopPropagation(); self.last_date = self.first_date = 0; self.update_month_classes(); self.update(true); self.toggle(false); }); this.fill_calendar.click(function (e) { e.preventDefault(); e.stopPropagation(); self.toggle(); }); this.update_year(); }, toggle: function toggle(dir) { var self = this; if (typeof dir == 'undefined') { dir = !this.opened; } else if (this.opened == dir) { return; } if (dir) { this.element.addClass('open'); this.calendar.slideDown(); this.opened = dir; } else { this.calendar.slideUp(); setTimeout(function () { self.element.removeClass('open'); }, 300); this.opened = dir; } }, month_click: function month_click(month_element) { var date = parseInt(this.current_year + '' + month_element.data('num')); if (!month_element.hasClass('selected')) { if (this.first_date && date < this.first_date) { this.first_date = date; } else if (this.first_date && this.last_date && date > this.last_date) { this.last_date = date; } else if (this.last_date && date < this.last_date) { this.last_date = date; } else if (!this.first_date) { this.first_date = date; } else if (!this.last_date) { this.last_date = date; } } else { if (date == this.last_date) { this.last_date = 0; } else if (date == this.first_date) { this.first_date = this.last_date; this.last_date = 0; } } this.update_month_classes(); }, update_month_classes: function update_month_classes() { var self = this, start_year = 0, start_month = 0, finish_year = 0, finish_month = 0, string = ''; this.months.each(function (i, element) { var num = i + 1, cur_date = parseInt(self.current_year + (num < 10 ? '0' + num : num).toString()), element = $(element).removeClass('selected period'); if (cur_date == self.first_date || cur_date == self.last_date) { element.addClass('selected'); } else if (self.last_date && cur_date > self.first_date && cur_date < self.last_date) { element.addClass('period'); } }); if (this.first_date) { start_year = this.first_date.toString().substr(0, 4); start_month = this.first_date.toString().substr(4, 2); // start_month = parseInt(this.first_date.toString().substr(4,2)); // start_month = this.months_text[start_month-1]; string = start_month + '.' + start_year; } if (this.last_date) { finish_year = this.last_date.toString().substr(0, 4); finish_month = this.last_date.toString().substr(4, 2); // finish_month = parseInt(this.last_date.toString().substr(4,2)); // finish_month = this.months_text[finish_month-1]; string += ' – ' + finish_month + '.' + finish_year; } this.first_date || this.last_date ? this.element.addClass('could-clear') : this.element.removeClass('could-clear'); if (this.first_date) { // this.update_disabled = false; this.update(); } else { // this.update_disabled = true; if (this.inited) { this.update(); } else { this.inited = true; } } this.calendar_span.empty().append(string.length ? string : this.calendar_span_default); }, update_year: function update_year() { this.current_year + 1 > this.max_year ? this.next.addClass('disabled') : this.next.removeClass('disabled'); this.current_year - 1 < this.min_year ? this.prev.addClass('disabled') : this.prev.removeClass('disabled'); this.year_span.text(this.current_year); this.update_month_classes(); }, update: function update(force) { if (force || !this.update_disabled) { // this.toggle(false); $(window).trigger('update_calendar', [this, this.first_date, this.last_date]); } } }); /***/ }), /***/ 260: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), ForceSelect = __webpack_require__(174), ProjectsListItem = __webpack_require__(261), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'ProjectsList', create: function create() { var self = this; this.items = []; this.element.find('.js-project-item').each(function (i, elm) { self.items.push(new ProjectsListItem({ element: elm })); }); this.clear_filter_btn = $('.js-clear-projects-filter').click(function () { self.clear_filters(); }); this.select_client = null; $('.js-select-client').each(function (i, elm) { self.select_client = new ForceSelect({ element: elm, delegate: self, onChange: function onChange() { self.filter(); } }); }); this.select_work_type = null; $('.js-select-work-type').each(function (i, elm) { self.select_work_type = new ForceSelect({ element: elm, delegate: self, onChange: function onChange() { self.filter(); } }); }); }, filter: function filter() { var client = parseInt(this.select_client.value), work_type = parseInt(this.select_work_type.value); if (client || work_type) { this.element.addClass('filtered'); this.clear_filter_btn.addClass('visible'); } else { this.element.removeClass('filtered'); this.clear_filter_btn.removeClass('visible'); } this.items.forEach(function (project) { project.filter(client, work_type); }); $(window).trigger('scroll'); }, clear_filters: function clear_filters() { this.select_client.set_value(0); this.select_work_type.set_value(0); this.filter(); }, focus_project: function focus_project(alias) { var item = false; for (var i = 0; i < this.items.length; i++) { if (this.items[i].alias === alias) { item = this.items[i]; break; } } if (!item || this.focused_item === item) { return; } this.filter_by_status(0); if (this.focused_item) { this.focused_item.focus(false); } this.focused_item = item.focus(true); $('html, body').animate({ scrollTop: item.element.offset().top - 100 }); } }); /***/ }), /***/ 261: /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(0), MinimalClass = __webpack_require__(1); module.exports = MinimalClass.extend({ __className: 'ProjectsListItem', create: function create() { var self = this; this.id = parseInt(this.element.data('id')); this.slug = this.element.data('slug'); this.status = this.element.data('status') || 0; this.active = true; this.number = this.element.find('.js-num'); this.clients = this.element.data('clients').toString().split(','); this.work_types = this.element.data('work-types').toString().split(','); this.focused = false; this.mouseover = false; this.onMouse = function (e) { self.mouseover = e.type == 'mouseenter'; }; }, filter: function filter(client, work_type) { var show = (!client || this.in_array(client, this.clients)) && (!work_type || this.in_array(work_type, this.work_types)); show ? this.show() : this.hide(); }, show: function show(number) { number = parseInt(number); this.number.html(number < 10 ? '0' + number : number); if (!this.active) { this.element.removeClass('hidden'); this.active = true; } return this; }, hide: function hide() { if (this.active) { this.element.addClass('hidden'); this.active = false; } return this; }, focus: function focus(dir) { if (this.focused == dir) { return; } dir ? this.element.addClass('focused') : this.element.removeClass('focused'); if (dir) { this.element.bind('mouseenter mouseleave', this.onMouse); } else { this.element.unbind('mouseenter mouseleave', this.onMouse); } this.focused = dir; return this; } }); /***/ }), /***/ 241: /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function () { window.app.map_modules({ '.js-floating-menu': __webpack_require__(251) }); $(window).trigger('scroll'); }; /***/ }) });