Commit e3c683d1 authored by Simon's avatar Simon

in progress

parent a1ef9b46
......@@ -3,15 +3,21 @@
"presets": [
[
"@babel/preset-env", {
// "modules": false,
"targets": {
"node": "current",
// "ie": 11,
// "browsers": "last 5 versions"
// "chrome": 66,
// "firefox": 60,
"ie": 11,
},
// "useBuiltIns": "usage",
// "useBuiltIns": "entry"
}
]
],
"plugins": ["@babel/plugin-syntax-dynamic-import", "@babel/plugin-transform-arrow-functions"]
"plugins": [
// ["@babel/plugin-transform-runtime",
// {
// "regenerator": true
// }
// ],
"@babel/plugin-syntax-dynamic-import", "@babel/plugin-transform-arrow-functions"]
}
......@@ -19,7 +19,7 @@ eval("module.exports = function(originalModule) {\n\tif (!originalModule.webpack
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _vendor_awesomplete__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../vendor/awesomplete */ \"./wp-content/themes/biuro/js/vendor/awesomplete.js\");\n\nconst city = document.getElementById('search-city');\n\nif (city) {\n const cityBox = new _vendor_awesomplete__WEBPACK_IMPORTED_MODULE_0__[\"default\"](city, {\n minChars: 0,\n maxItems: 1000,\n sort: false\n });\n city.addEventListener('focus', function () {\n cityBox.evaluate();\n });\n}\n\nconst query = document.getElementById('search-query');\n\nif (query) {\n const queryBox = new _vendor_awesomplete__WEBPACK_IMPORTED_MODULE_0__[\"default\"](query, {\n minChars: 0,\n maxItems: 1000,\n sort: false\n });\n query.addEventListener('focus', function () {\n queryBox.evaluate();\n });\n}\n\nconst search = document.getElementById('search');\n\nif (search) {\n search.addEventListener('submit', function (e) {\n if (!city.value && !query.value) {\n city.focus();\n e.preventDefault();\n }\n }, false);\n}\n\nconst node = document.getElementById('form-city');\nconst cityID = document.getElementById('form-city-id');\n\nif (node) {\n const nodeBox = new _vendor_awesomplete__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node, {\n minChars: 0,\n maxItems: 1000,\n sort: false,\n replace: function (suggestion) {\n this.input.value = suggestion.label;\n\n if (cityID) {\n cityID.value = suggestion.value;\n }\n }\n });\n node.addEventListener('focus', function () {\n nodeBox.evaluate();\n });\n}\n\n//# sourceURL=webpack:///./wp-content/themes/biuro/js/components/autocomplete.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _vendor_awesomplete__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../vendor/awesomplete */ \"./wp-content/themes/biuro/js/vendor/awesomplete.js\");\n\nvar city = document.getElementById('search-city');\n\nif (city) {\n var cityBox = new _vendor_awesomplete__WEBPACK_IMPORTED_MODULE_0__[\"default\"](city, {\n minChars: 0,\n maxItems: 1000,\n sort: false\n });\n city.addEventListener('focus', function () {\n cityBox.evaluate();\n });\n}\n\nvar query = document.getElementById('search-query');\n\nif (query) {\n var queryBox = new _vendor_awesomplete__WEBPACK_IMPORTED_MODULE_0__[\"default\"](query, {\n minChars: 0,\n maxItems: 1000,\n sort: false\n });\n query.addEventListener('focus', function () {\n queryBox.evaluate();\n });\n}\n\nvar search = document.getElementById('search');\n\nif (search) {\n search.addEventListener('submit', function (e) {\n if (!city.value && !query.value) {\n city.focus();\n e.preventDefault();\n }\n }, false);\n}\n\nvar node = document.getElementById('form-city');\nvar cityID = document.getElementById('form-city-id');\n\nif (node) {\n var nodeBox = new _vendor_awesomplete__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node, {\n minChars: 0,\n maxItems: 1000,\n sort: false,\n replace: function replace(suggestion) {\n this.input.value = suggestion.label;\n\n if (cityID) {\n cityID.value = suggestion.value;\n }\n }\n });\n node.addEventListener('focus', function () {\n nodeBox.evaluate();\n });\n}\n\n//# sourceURL=webpack:///./wp-content/themes/biuro/js/components/autocomplete.js?");
/***/ }),
......@@ -31,7 +31,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ven
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(module) {/**\n * Simple, lightweight, usable local autocomplete library for modern browsers\n * Because there weren’t enough autocomplete scripts in the world? Because I’m completely insane and have NIH syndrome? Probably both. :P\n * @author Lea Verou http://leaverou.github.io/awesomplete\n * MIT license\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ((function () {\n var _ = function (input, o) {\n var me = this; // Keep track of number of instances for unique IDs\n\n _.count = (_.count || 0) + 1;\n this.count = _.count; // Setup\n\n this.isOpened = false;\n this.input = $(input);\n this.input.setAttribute(\"autocomplete\", \"off\");\n this.input.setAttribute(\"aria-expanded\", \"false\");\n this.input.setAttribute(\"aria-owns\", \"awesomplete_list_\" + this.count);\n this.input.setAttribute(\"role\", \"combobox\"); // store constructor options in case we need to distinguish\n // between default and customized behavior later on\n\n this.options = o = o || {};\n configure(this, {\n minChars: 2,\n maxItems: 10,\n autoFirst: false,\n data: _.DATA,\n filter: _.FILTER_CONTAINS,\n sort: o.sort === false ? false : _.SORT_BYLENGTH,\n container: _.CONTAINER,\n item: _.ITEM,\n replace: _.REPLACE,\n tabSelect: false\n }, o);\n this.index = -1; // Create necessary elements\n\n this.container = this.container(input);\n this.ul = $.create(\"ul\", {\n hidden: \"hidden\",\n role: \"listbox\",\n id: \"awesomplete_list_\" + this.count,\n inside: this.container\n });\n this.status = $.create(\"span\", {\n className: \"visually-hidden\",\n role: \"status\",\n \"aria-live\": \"assertive\",\n \"aria-atomic\": true,\n inside: this.container,\n textContent: this.minChars != 0 ? \"Type \" + this.minChars + \" or more characters for results.\" : \"Begin typing for results.\"\n }); // Bind events\n\n this._events = {\n input: {\n \"input\": this.evaluate.bind(this),\n \"blur\": this.close.bind(this, {\n reason: \"blur\"\n }),\n \"keydown\": function (evt) {\n var c = evt.keyCode; // If the dropdown `ul` is in view, then act on keydown for the following keys:\n // Enter / Esc / Up / Down\n\n if (me.opened) {\n if (c === 13 && me.selected) {\n // Enter\n evt.preventDefault();\n me.select();\n } else if (c === 9 && me.selected && me.tabSelect) {\n me.select();\n } else if (c === 27) {\n // Esc\n me.close({\n reason: \"esc\"\n });\n } else if (c === 38 || c === 40) {\n // Down/Up arrow\n evt.preventDefault();\n me[c === 38 ? \"previous\" : \"next\"]();\n }\n }\n }\n },\n form: {\n \"submit\": this.close.bind(this, {\n reason: \"submit\"\n })\n },\n ul: {\n // Prevent the default mousedowm, which ensures the input is not blurred.\n // The actual selection will happen on click. This also ensures dragging the\n // cursor away from the list item will cancel the selection\n \"mousedown\": function (evt) {\n evt.preventDefault();\n },\n // The click event is fired even if the corresponding mousedown event has called preventDefault\n \"click\": function (evt) {\n var li = evt.target;\n\n if (li !== this) {\n while (li && !/li/i.test(li.nodeName)) {\n li = li.parentNode;\n }\n\n if (li && evt.button === 0) {\n // Only select on left click\n evt.preventDefault();\n me.select(li, evt.target);\n }\n }\n }\n }\n };\n $.bind(this.input, this._events.input);\n $.bind(this.input.form, this._events.form);\n $.bind(this.ul, this._events.ul);\n\n if (this.input.hasAttribute(\"list\")) {\n this.list = \"#\" + this.input.getAttribute(\"list\");\n this.input.removeAttribute(\"list\");\n } else {\n this.list = this.input.getAttribute(\"data-list\") || o.list || [];\n }\n\n _.all.push(this);\n };\n\n _.prototype = {\n set list(list) {\n if (Array.isArray(list)) {\n this._list = list;\n } else if (typeof list === \"string\" && list.indexOf(\",\") > -1) {\n this._list = list.split(/\\s*,\\s*/);\n } else {\n // Element or CSS selector\n list = $(list);\n\n if (list && list.children) {\n var items = [];\n slice.apply(list.children).forEach(function (el) {\n if (!el.disabled) {\n var text = el.textContent.trim();\n var value = el.value || text;\n var label = el.label || text;\n\n if (value !== \"\") {\n items.push({\n label: label,\n value: value\n });\n }\n }\n });\n this._list = items;\n }\n }\n\n if (document.activeElement === this.input) {\n this.evaluate();\n }\n },\n\n get selected() {\n return this.index > -1;\n },\n\n get opened() {\n return this.isOpened;\n },\n\n close: function (o) {\n if (!this.opened) {\n return;\n }\n\n this.input.setAttribute(\"aria-expanded\", \"false\");\n this.ul.setAttribute(\"hidden\", \"\");\n this.isOpened = false;\n this.index = -1;\n this.status.setAttribute(\"hidden\", \"\");\n $.fire(this.input, \"awesomplete-close\", o || {});\n },\n open: function () {\n this.input.setAttribute(\"aria-expanded\", \"true\");\n this.ul.removeAttribute(\"hidden\");\n this.isOpened = true;\n this.status.removeAttribute(\"hidden\");\n\n if (this.autoFirst && this.index === -1) {\n this.goto(0);\n }\n\n $.fire(this.input, \"awesomplete-open\");\n },\n destroy: function () {\n //remove events from the input and its form\n $.unbind(this.input, this._events.input);\n $.unbind(this.input.form, this._events.form); // cleanup container if it was created by Awesomplete but leave it alone otherwise\n\n if (!this.options.container) {\n //move the input out of the awesomplete container and remove the container and its children\n var parentNode = this.container.parentNode;\n parentNode.insertBefore(this.input, this.container);\n parentNode.removeChild(this.container);\n } //remove autocomplete and aria-autocomplete attributes\n\n\n this.input.removeAttribute(\"autocomplete\");\n this.input.removeAttribute(\"aria-autocomplete\"); //remove this awesomeplete instance from the global array of instances\n\n var indexOfAwesomplete = _.all.indexOf(this);\n\n if (indexOfAwesomplete !== -1) {\n _.all.splice(indexOfAwesomplete, 1);\n }\n },\n next: function () {\n var count = this.ul.children.length;\n this.goto(this.index < count - 1 ? this.index + 1 : count ? 0 : -1);\n },\n previous: function () {\n var count = this.ul.children.length;\n var pos = this.index - 1;\n this.goto(this.selected && pos !== -1 ? pos : count - 1);\n },\n // Should not be used, highlights specific item without any checks!\n goto: function (i) {\n var lis = this.ul.children;\n\n if (this.selected) {\n lis[this.index].setAttribute(\"aria-selected\", \"false\");\n }\n\n this.index = i;\n\n if (i > -1 && lis.length > 0) {\n lis[i].setAttribute(\"aria-selected\", \"true\");\n this.status.textContent = lis[i].textContent + \", list item \" + (i + 1) + \" of \" + lis.length;\n this.input.setAttribute(\"aria-activedescendant\", this.ul.id + \"_item_\" + this.index); // scroll to highlighted element in case parent's height is fixed\n\n this.ul.scrollTop = lis[i].offsetTop - this.ul.clientHeight + lis[i].clientHeight;\n $.fire(this.input, \"awesomplete-highlight\", {\n text: this.suggestions[this.index]\n });\n }\n },\n select: function (selected, origin) {\n if (selected) {\n this.index = $.siblingIndex(selected);\n } else {\n selected = this.ul.children[this.index];\n }\n\n if (selected) {\n var suggestion = this.suggestions[this.index];\n var allowed = $.fire(this.input, \"awesomplete-select\", {\n text: suggestion,\n origin: origin || selected\n });\n\n if (allowed) {\n this.replace(suggestion);\n this.close({\n reason: \"select\"\n });\n $.fire(this.input, \"awesomplete-selectcomplete\", {\n text: suggestion\n });\n }\n }\n },\n evaluate: function () {\n var me = this;\n var value = this.input.value;\n\n if (value.length >= this.minChars && this._list && this._list.length > 0) {\n this.index = -1; // Populate list with options that match\n\n this.ul.innerHTML = \"\";\n this.suggestions = this._list.map(function (item) {\n return new Suggestion(me.data(item, value));\n }).filter(function (item) {\n return me.filter(item, value);\n });\n\n if (this.sort !== false) {\n this.suggestions = this.suggestions.sort(this.sort);\n }\n\n this.suggestions = this.suggestions.slice(0, this.maxItems);\n this.suggestions.forEach(function (text, index) {\n me.ul.appendChild(me.item(text, value, index));\n });\n\n if (this.ul.children.length === 0) {\n this.status.textContent = \"No results found\";\n this.close({\n reason: \"nomatches\"\n });\n } else {\n this.open();\n this.status.textContent = this.ul.children.length + \" results found\";\n }\n } else {\n this.close({\n reason: \"nomatches\"\n });\n this.status.textContent = \"No results found\";\n }\n }\n }; // Static methods/properties\n\n _.all = [];\n\n _.FILTER_CONTAINS = function (text, input) {\n return RegExp($.regExpEscape(input.trim()), \"i\").test(text);\n };\n\n _.FILTER_STARTSWITH = function (text, input) {\n return RegExp(\"^\" + $.regExpEscape(input.trim()), \"i\").test(text);\n };\n\n _.SORT_BYLENGTH = function (a, b) {\n if (a.length !== b.length) {\n return a.length - b.length;\n }\n\n return a < b ? -1 : 1;\n };\n\n _.CONTAINER = function (input) {\n return $.create(\"div\", {\n className: \"awesomplete\",\n around: input\n });\n };\n\n _.ITEM = function (text, input, item_id) {\n var html = input.trim() === \"\" ? text : text.replace(RegExp($.regExpEscape(input.trim()), \"gi\"), \"<mark>$&</mark>\");\n return $.create(\"li\", {\n innerHTML: html,\n \"role\": \"option\",\n \"aria-selected\": \"false\",\n \"id\": \"awesomplete_list_\" + this.count + \"_item_\" + item_id\n });\n };\n\n _.REPLACE = function (text) {\n this.input.value = text.value;\n };\n\n _.DATA = function (item\n /*, input*/\n ) {\n return item;\n }; // Private functions\n\n\n function Suggestion(data) {\n var o = Array.isArray(data) ? {\n label: data[0],\n value: data[1]\n } : typeof data === \"object\" && \"label\" in data && \"value\" in data ? data : {\n label: data,\n value: data\n };\n this.label = o.label || o.value;\n this.value = o.value;\n }\n\n Object.defineProperty(Suggestion.prototype = Object.create(String.prototype), \"length\", {\n get: function () {\n return this.label.length;\n }\n });\n\n Suggestion.prototype.toString = Suggestion.prototype.valueOf = function () {\n return \"\" + this.label;\n };\n\n function configure(instance, properties, o) {\n for (var i in properties) {\n var initial = properties[i],\n attrValue = instance.input.getAttribute(\"data-\" + i.toLowerCase());\n\n if (typeof initial === \"number\") {\n instance[i] = parseInt(attrValue);\n } else if (initial === false) {\n // Boolean options must be false by default anyway\n instance[i] = attrValue !== null;\n } else if (initial instanceof Function) {\n instance[i] = null;\n } else {\n instance[i] = attrValue;\n }\n\n if (!instance[i] && instance[i] !== 0) {\n instance[i] = i in o ? o[i] : initial;\n }\n }\n } // Helpers\n\n\n var slice = Array.prototype.slice;\n\n function $(expr, con) {\n return typeof expr === \"string\" ? (con || document).querySelector(expr) : expr || null;\n }\n\n function $$(expr, con) {\n return slice.call((con || document).querySelectorAll(expr));\n }\n\n $.create = function (tag, o) {\n var element = document.createElement(tag);\n\n for (var i in o) {\n var val = o[i];\n\n if (i === \"inside\") {\n $(val).appendChild(element);\n } else if (i === \"around\") {\n var ref = $(val);\n ref.parentNode.insertBefore(element, ref);\n element.appendChild(ref);\n\n if (ref.getAttribute(\"autofocus\") != null) {\n ref.focus();\n }\n } else if (i in element) {\n element[i] = val;\n } else {\n element.setAttribute(i, val);\n }\n }\n\n return element;\n };\n\n $.bind = function (element, o) {\n if (element) {\n for (var event in o) {\n var callback = o[event];\n event.split(/\\s+/).forEach(function (event) {\n element.addEventListener(event, callback);\n });\n }\n }\n };\n\n $.unbind = function (element, o) {\n if (element) {\n for (var event in o) {\n var callback = o[event];\n event.split(/\\s+/).forEach(function (event) {\n element.removeEventListener(event, callback);\n });\n }\n }\n };\n\n $.fire = function (target, type, properties) {\n var evt = document.createEvent(\"HTMLEvents\");\n evt.initEvent(type, true, true);\n\n for (var j in properties) {\n evt[j] = properties[j];\n }\n\n return target.dispatchEvent(evt);\n };\n\n $.regExpEscape = function (s) {\n return s.replace(/[-\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\");\n };\n\n $.siblingIndex = function (el) {\n /* eslint-disable no-cond-assign */\n for (var i = 0; el = el.previousElementSibling; i++);\n\n return i;\n }; // Initialization\n\n\n function init() {\n $$(\"input.awesomplete\").forEach(function (input) {\n new _(input);\n });\n } // Make sure to export Awesomplete on self when in a browser\n\n\n if (typeof self !== \"undefined\") {\n self.Awesomplete = _;\n } // Are we in a browser? Check for Document constructor\n\n\n if (typeof Document !== \"undefined\") {\n // DOM already loaded?\n if (document.readyState !== \"loading\") {\n init();\n } else {\n // Wait for it\n document.addEventListener(\"DOMContentLoaded\", init);\n }\n }\n\n _.$ = $;\n _.$$ = $$; // Expose Awesomplete as a CJS module\n\n if ( true && module.exports) {\n module.exports = _;\n }\n\n return _;\n})());\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../node_modules/webpack/buildin/harmony-module.js */ \"./node_modules/webpack/buildin/harmony-module.js\")(module)))\n\n//# sourceURL=webpack:///./wp-content/themes/biuro/js/vendor/awesomplete.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(module) {function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/**\n * Simple, lightweight, usable local autocomplete library for modern browsers\n * Because there weren’t enough autocomplete scripts in the world? Because I’m completely insane and have NIH syndrome? Probably both. :P\n * @author Lea Verou http://leaverou.github.io/awesomplete\n * MIT license\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ((function () {\n var _ = function _(input, o) {\n var me = this; // Keep track of number of instances for unique IDs\n\n _.count = (_.count || 0) + 1;\n this.count = _.count; // Setup\n\n this.isOpened = false;\n this.input = $(input);\n this.input.setAttribute(\"autocomplete\", \"off\");\n this.input.setAttribute(\"aria-expanded\", \"false\");\n this.input.setAttribute(\"aria-owns\", \"awesomplete_list_\" + this.count);\n this.input.setAttribute(\"role\", \"combobox\"); // store constructor options in case we need to distinguish\n // between default and customized behavior later on\n\n this.options = o = o || {};\n configure(this, {\n minChars: 2,\n maxItems: 10,\n autoFirst: false,\n data: _.DATA,\n filter: _.FILTER_CONTAINS,\n sort: o.sort === false ? false : _.SORT_BYLENGTH,\n container: _.CONTAINER,\n item: _.ITEM,\n replace: _.REPLACE,\n tabSelect: false\n }, o);\n this.index = -1; // Create necessary elements\n\n this.container = this.container(input);\n this.ul = $.create(\"ul\", {\n hidden: \"hidden\",\n role: \"listbox\",\n id: \"awesomplete_list_\" + this.count,\n inside: this.container\n });\n this.status = $.create(\"span\", {\n className: \"visually-hidden\",\n role: \"status\",\n \"aria-live\": \"assertive\",\n \"aria-atomic\": true,\n inside: this.container,\n textContent: this.minChars != 0 ? \"Type \" + this.minChars + \" or more characters for results.\" : \"Begin typing for results.\"\n }); // Bind events\n\n this._events = {\n input: {\n \"input\": this.evaluate.bind(this),\n \"blur\": this.close.bind(this, {\n reason: \"blur\"\n }),\n \"keydown\": function keydown(evt) {\n var c = evt.keyCode; // If the dropdown `ul` is in view, then act on keydown for the following keys:\n // Enter / Esc / Up / Down\n\n if (me.opened) {\n if (c === 13 && me.selected) {\n // Enter\n evt.preventDefault();\n me.select();\n } else if (c === 9 && me.selected && me.tabSelect) {\n me.select();\n } else if (c === 27) {\n // Esc\n me.close({\n reason: \"esc\"\n });\n } else if (c === 38 || c === 40) {\n // Down/Up arrow\n evt.preventDefault();\n me[c === 38 ? \"previous\" : \"next\"]();\n }\n }\n }\n },\n form: {\n \"submit\": this.close.bind(this, {\n reason: \"submit\"\n })\n },\n ul: {\n // Prevent the default mousedowm, which ensures the input is not blurred.\n // The actual selection will happen on click. This also ensures dragging the\n // cursor away from the list item will cancel the selection\n \"mousedown\": function mousedown(evt) {\n evt.preventDefault();\n },\n // The click event is fired even if the corresponding mousedown event has called preventDefault\n \"click\": function click(evt) {\n var li = evt.target;\n\n if (li !== this) {\n while (li && !/li/i.test(li.nodeName)) {\n li = li.parentNode;\n }\n\n if (li && evt.button === 0) {\n // Only select on left click\n evt.preventDefault();\n me.select(li, evt.target);\n }\n }\n }\n }\n };\n $.bind(this.input, this._events.input);\n $.bind(this.input.form, this._events.form);\n $.bind(this.ul, this._events.ul);\n\n if (this.input.hasAttribute(\"list\")) {\n this.list = \"#\" + this.input.getAttribute(\"list\");\n this.input.removeAttribute(\"list\");\n } else {\n this.list = this.input.getAttribute(\"data-list\") || o.list || [];\n }\n\n _.all.push(this);\n };\n\n _.prototype = {\n set list(list) {\n if (Array.isArray(list)) {\n this._list = list;\n } else if (typeof list === \"string\" && list.indexOf(\",\") > -1) {\n this._list = list.split(/\\s*,\\s*/);\n } else {\n // Element or CSS selector\n list = $(list);\n\n if (list && list.children) {\n var items = [];\n slice.apply(list.children).forEach(function (el) {\n if (!el.disabled) {\n var text = el.textContent.trim();\n var value = el.value || text;\n var label = el.label || text;\n\n if (value !== \"\") {\n items.push({\n label: label,\n value: value\n });\n }\n }\n });\n this._list = items;\n }\n }\n\n if (document.activeElement === this.input) {\n this.evaluate();\n }\n },\n\n get selected() {\n return this.index > -1;\n },\n\n get opened() {\n return this.isOpened;\n },\n\n close: function close(o) {\n if (!this.opened) {\n return;\n }\n\n this.input.setAttribute(\"aria-expanded\", \"false\");\n this.ul.setAttribute(\"hidden\", \"\");\n this.isOpened = false;\n this.index = -1;\n this.status.setAttribute(\"hidden\", \"\");\n $.fire(this.input, \"awesomplete-close\", o || {});\n },\n open: function open() {\n this.input.setAttribute(\"aria-expanded\", \"true\");\n this.ul.removeAttribute(\"hidden\");\n this.isOpened = true;\n this.status.removeAttribute(\"hidden\");\n\n if (this.autoFirst && this.index === -1) {\n this.goto(0);\n }\n\n $.fire(this.input, \"awesomplete-open\");\n },\n destroy: function destroy() {\n //remove events from the input and its form\n $.unbind(this.input, this._events.input);\n $.unbind(this.input.form, this._events.form); // cleanup container if it was created by Awesomplete but leave it alone otherwise\n\n if (!this.options.container) {\n //move the input out of the awesomplete container and remove the container and its children\n var parentNode = this.container.parentNode;\n parentNode.insertBefore(this.input, this.container);\n parentNode.removeChild(this.container);\n } //remove autocomplete and aria-autocomplete attributes\n\n\n this.input.removeAttribute(\"autocomplete\");\n this.input.removeAttribute(\"aria-autocomplete\"); //remove this awesomeplete instance from the global array of instances\n\n var indexOfAwesomplete = _.all.indexOf(this);\n\n if (indexOfAwesomplete !== -1) {\n _.all.splice(indexOfAwesomplete, 1);\n }\n },\n next: function next() {\n var count = this.ul.children.length;\n this.goto(this.index < count - 1 ? this.index + 1 : count ? 0 : -1);\n },\n previous: function previous() {\n var count = this.ul.children.length;\n var pos = this.index - 1;\n this.goto(this.selected && pos !== -1 ? pos : count - 1);\n },\n // Should not be used, highlights specific item without any checks!\n goto: function goto(i) {\n var lis = this.ul.children;\n\n if (this.selected) {\n lis[this.index].setAttribute(\"aria-selected\", \"false\");\n }\n\n this.index = i;\n\n if (i > -1 && lis.length > 0) {\n lis[i].setAttribute(\"aria-selected\", \"true\");\n this.status.textContent = lis[i].textContent + \", list item \" + (i + 1) + \" of \" + lis.length;\n this.input.setAttribute(\"aria-activedescendant\", this.ul.id + \"_item_\" + this.index); // scroll to highlighted element in case parent's height is fixed\n\n this.ul.scrollTop = lis[i].offsetTop - this.ul.clientHeight + lis[i].clientHeight;\n $.fire(this.input, \"awesomplete-highlight\", {\n text: this.suggestions[this.index]\n });\n }\n },\n select: function select(selected, origin) {\n if (selected) {\n this.index = $.siblingIndex(selected);\n } else {\n selected = this.ul.children[this.index];\n }\n\n if (selected) {\n var suggestion = this.suggestions[this.index];\n var allowed = $.fire(this.input, \"awesomplete-select\", {\n text: suggestion,\n origin: origin || selected\n });\n\n if (allowed) {\n this.replace(suggestion);\n this.close({\n reason: \"select\"\n });\n $.fire(this.input, \"awesomplete-selectcomplete\", {\n text: suggestion\n });\n }\n }\n },\n evaluate: function evaluate() {\n var me = this;\n var value = this.input.value;\n\n if (value.length >= this.minChars && this._list && this._list.length > 0) {\n this.index = -1; // Populate list with options that match\n\n this.ul.innerHTML = \"\";\n this.suggestions = this._list.map(function (item) {\n return new Suggestion(me.data(item, value));\n }).filter(function (item) {\n return me.filter(item, value);\n });\n\n if (this.sort !== false) {\n this.suggestions = this.suggestions.sort(this.sort);\n }\n\n this.suggestions = this.suggestions.slice(0, this.maxItems);\n this.suggestions.forEach(function (text, index) {\n me.ul.appendChild(me.item(text, value, index));\n });\n\n if (this.ul.children.length === 0) {\n this.status.textContent = \"No results found\";\n this.close({\n reason: \"nomatches\"\n });\n } else {\n this.open();\n this.status.textContent = this.ul.children.length + \" results found\";\n }\n } else {\n this.close({\n reason: \"nomatches\"\n });\n this.status.textContent = \"No results found\";\n }\n }\n }; // Static methods/properties\n\n _.all = [];\n\n _.FILTER_CONTAINS = function (text, input) {\n return RegExp($.regExpEscape(input.trim()), \"i\").test(text);\n };\n\n _.FILTER_STARTSWITH = function (text, input) {\n return RegExp(\"^\" + $.regExpEscape(input.trim()), \"i\").test(text);\n };\n\n _.SORT_BYLENGTH = function (a, b) {\n if (a.length !== b.length) {\n return a.length - b.length;\n }\n\n return a < b ? -1 : 1;\n };\n\n _.CONTAINER = function (input) {\n return $.create(\"div\", {\n className: \"awesomplete\",\n around: input\n });\n };\n\n _.ITEM = function (text, input, item_id) {\n var html = input.trim() === \"\" ? text : text.replace(RegExp($.regExpEscape(input.trim()), \"gi\"), \"<mark>$&</mark>\");\n return $.create(\"li\", {\n innerHTML: html,\n \"role\": \"option\",\n \"aria-selected\": \"false\",\n \"id\": \"awesomplete_list_\" + this.count + \"_item_\" + item_id\n });\n };\n\n _.REPLACE = function (text) {\n this.input.value = text.value;\n };\n\n _.DATA = function (item\n /*, input*/\n ) {\n return item;\n }; // Private functions\n\n\n function Suggestion(data) {\n var o = Array.isArray(data) ? {\n label: data[0],\n value: data[1]\n } : _typeof(data) === \"object\" && \"label\" in data && \"value\" in data ? data : {\n label: data,\n value: data\n };\n this.label = o.label || o.value;\n this.value = o.value;\n }\n\n Object.defineProperty(Suggestion.prototype = Object.create(String.prototype), \"length\", {\n get: function get() {\n return this.label.length;\n }\n });\n\n Suggestion.prototype.toString = Suggestion.prototype.valueOf = function () {\n return \"\" + this.label;\n };\n\n function configure(instance, properties, o) {\n for (var i in properties) {\n var initial = properties[i],\n attrValue = instance.input.getAttribute(\"data-\" + i.toLowerCase());\n\n if (typeof initial === \"number\") {\n instance[i] = parseInt(attrValue);\n } else if (initial === false) {\n // Boolean options must be false by default anyway\n instance[i] = attrValue !== null;\n } else if (initial instanceof Function) {\n instance[i] = null;\n } else {\n instance[i] = attrValue;\n }\n\n if (!instance[i] && instance[i] !== 0) {\n instance[i] = i in o ? o[i] : initial;\n }\n }\n } // Helpers\n\n\n var slice = Array.prototype.slice;\n\n function $(expr, con) {\n return typeof expr === \"string\" ? (con || document).querySelector(expr) : expr || null;\n }\n\n function $$(expr, con) {\n return slice.call((con || document).querySelectorAll(expr));\n }\n\n $.create = function (tag, o) {\n var element = document.createElement(tag);\n\n for (var i in o) {\n var val = o[i];\n\n if (i === \"inside\") {\n $(val).appendChild(element);\n } else if (i === \"around\") {\n var ref = $(val);\n ref.parentNode.insertBefore(element, ref);\n element.appendChild(ref);\n\n if (ref.getAttribute(\"autofocus\") != null) {\n ref.focus();\n }\n } else if (i in element) {\n element[i] = val;\n } else {\n element.setAttribute(i, val);\n }\n }\n\n return element;\n };\n\n $.bind = function (element, o) {\n if (element) {\n for (var event in o) {\n var callback = o[event];\n event.split(/\\s+/).forEach(function (event) {\n element.addEventListener(event, callback);\n });\n }\n }\n };\n\n $.unbind = function (element, o) {\n if (element) {\n for (var event in o) {\n var callback = o[event];\n event.split(/\\s+/).forEach(function (event) {\n element.removeEventListener(event, callback);\n });\n }\n }\n };\n\n $.fire = function (target, type, properties) {\n var evt = document.createEvent(\"HTMLEvents\");\n evt.initEvent(type, true, true);\n\n for (var j in properties) {\n evt[j] = properties[j];\n }\n\n return target.dispatchEvent(evt);\n };\n\n $.regExpEscape = function (s) {\n return s.replace(/[-\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\");\n };\n\n $.siblingIndex = function (el) {\n /* eslint-disable no-cond-assign */\n for (var i = 0; el = el.previousElementSibling; i++) {\n ;\n }\n\n return i;\n }; // Initialization\n\n\n function init() {\n $$(\"input.awesomplete\").forEach(function (input) {\n new _(input);\n });\n } // Make sure to export Awesomplete on self when in a browser\n\n\n if (typeof self !== \"undefined\") {\n self.Awesomplete = _;\n } // Are we in a browser? Check for Document constructor\n\n\n if (typeof Document !== \"undefined\") {\n // DOM already loaded?\n if (document.readyState !== \"loading\") {\n init();\n } else {\n // Wait for it\n document.addEventListener(\"DOMContentLoaded\", init);\n }\n }\n\n _.$ = $;\n _.$$ = $$; // Expose Awesomplete as a CJS module\n\n if (( false ? undefined : _typeof(module)) === \"object\" && module.exports) {\n module.exports = _;\n }\n\n return _;\n})());\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../node_modules/webpack/buildin/harmony-module.js */ \"./node_modules/webpack/buildin/harmony-module.js\")(module)))\n\n//# sourceURL=webpack:///./wp-content/themes/biuro/js/vendor/awesomplete.js?");
/***/ })
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -92,7 +92,7 @@
/******/
/******/ var hotApplyOnUpdate = true;
/******/ // eslint-disable-next-line no-unused-vars
/******/ var hotCurrentHash = "e05280b17f10d1a2a4f2";
/******/ var hotCurrentHash = "214137349e0a674ddf0f";
/******/ var hotRequestTimeout = 10000;
/******/ var hotCurrentModuleData = {};
/******/ var hotCurrentChildModule;
......@@ -1097,7 +1097,7 @@ eval("var logLevel = \"info\";\n\nfunction dummy() {}\n\nfunction shouldLog(leve
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("// https://github.com/webpack/webpack/issues/8656#issuecomment-456001556\nif (window.NodeList && !NodeList.prototype.forEach) {\n NodeList.prototype.forEach = Array.prototype.forEach;\n}\n\n(function (global) {\n const container = document.getElementById('cookie-warning');\n const btnAgree = document.getElementById('cookie-agree');\n const btnClose = document.getElementById('cookie-close');\n const agreed = useLS() ? localStorage.getItem('biuro-agree') : false;\n\n function useLS() {\n var mod = 'a';\n\n try {\n localStorage.setItem(mod, mod);\n localStorage.removeItem(mod);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n if (!container || !btnAgree || !btnClose || agreed) {\n return;\n }\n\n container.style.display = 'block';\n btnAgree.addEventListener('click', function () {\n if (useLS()) {\n localStorage.setItem('biuro-agree', 'true');\n }\n\n container.style.display = 'none';\n });\n btnClose.addEventListener('click', function () {\n container.style.display = 'none';\n });\n})(window);\n\nif (true) {\n module.hot.accept();\n}\n\n(function (global) {\n const node = document.getElementById('js-map--divisions');\n\n if (!node) {\n return;\n }\n\n fetch('/wp-json/api/v1/divisions?langID=' + node.dataset.id).then(function (t) {\n return t.json();\n }).then(function (data) {\n initDivisionsMap(node, data);\n });\n})(window);\n\n(function (global) {\n const node = document.querySelector('.c-nav--lang');\n\n if (!node) {\n return;\n }\n\n node.addEventListener('click', function (e) {\n e.currentTarget.classList.toggle('c-nav--lang--is-open');\n });\n})(window);\n\n(function (global) {\n const node = document.getElementById('js-map--regions');\n\n if (!node) {\n return;\n }\n\n initRegionsMap(node);\n})(window);\n\n(function (global) {\n document.querySelectorAll('.js-toggle--nav').forEach(function (node) {\n node.addEventListener('click', function (e) {\n e.preventDefault();\n document.body.classList.toggle('is-nav--open');\n });\n });\n document.querySelectorAll('.js-toggle--aside').forEach(function (node) {\n node.addEventListener('click', function (e) {\n e.preventDefault();\n document.body.classList.toggle('is-aside--open');\n });\n });\n})(window);\n\nconst mapStyles = [{\n featureType: 'all',\n elementType: 'all',\n stylers: [{\n 'saturation': -92\n }, {\n 'lightness': -8\n }, {\n 'hue': '#0000ff'\n }]\n}, {\n 'featureType': 'water',\n elementType: 'all',\n 'stylers': [{\n 'saturation': -95\n }, {\n 'lightness': -25\n }, {\n 'hue': '#0000ff'\n }]\n}];\nvar info;\n\nfunction setMarkers(map, positions, focus) {\n var bounds = new window.google.maps.LatLngBounds();\n\n for (var i = 0; i < positions.length; i++) {\n const position = positions[i];\n const pos = new window.google.maps.LatLng(position.lat, position.lng);\n var marker = new window.google.maps.Marker({\n position: pos,\n map: map,\n icon: '/wp-content/themes/biuro/i/ico--map-pin.svg',\n title: position.title || ''\n });\n\n if (info) {\n info.close();\n }\n\n bounds.extend(pos);\n\n if (position.content) {\n marker['content'] = position.content;\n window.google.maps.event.addListener(marker, 'click', function () {\n info = new window.google.maps.InfoWindow({\n content: this.content\n });\n info.open(map, this);\n });\n }\n\n if (focus) {\n if (window.innerWidth < 960) {\n window.scrollTo(0, 0);\n }\n\n new google.maps.event.trigger(marker, 'click');\n }\n }\n\n map.fitBounds(bounds);\n}\n\nfunction initRegionsMap(node) {\n if (!window.google) {\n setTimeout(function () {\n initRegionsMap(node);\n }, 250);\n return;\n }\n\n const map = new window.google.maps.Map(node, {\n mapTypeIds: [window.google.maps.MapTypeId.ROADMAP, window.google.maps.MapTypeId.HYBRID, 'biuro']\n });\n map.mapTypes.set('biuro', new window.google.maps.StyledMapType(mapStyles, {\n name: 'Biuro'\n }));\n map.setMapTypeId('biuro');\n window.google.maps.event.addListenerOnce(map, 'bounds_changed', function () {\n if (this.getZoom() > 15) {\n this.setZoom(14);\n }\n });\n const regions = [{\n title: 'Vilnius',\n lat: 54.687157,\n lng: 25.279652\n }, {\n title: 'Rīga',\n lat: 56.946285,\n lng: 24.105078\n }, {\n title: 'Tallinn',\n lat: 59.436962,\n lng: 24.753574\n }];\n setMarkers(map, regions);\n}\n\nfunction initDivisionsMap(node, data) {\n if (!window.google) {\n setTimeout(function () {\n initDivisionsMap(node, data);\n }, 250);\n return;\n }\n\n const map = new window.google.maps.Map(node, {\n mapTypeIds: [window.google.maps.MapTypeId.ROADMAP, window.google.maps.MapTypeId.HYBRID, 'biuro']\n });\n map.mapTypes.set('biuro', new window.google.maps.StyledMapType(mapStyles, {\n name: 'Biuro'\n }));\n map.setMapTypeId('biuro');\n window.google.maps.event.addListenerOnce(map, 'bounds_changed', function () {\n if (this.getZoom() > 15) {\n this.setZoom(14);\n }\n });\n let divisions = [];\n Object.keys(data).forEach(function (key) {\n const division = data[key];\n\n if (key.substr(0, 4) === 'city') {\n divisions = divisions.concat(division);\n }\n });\n document.querySelectorAll('.js-division').forEach(function (node) {\n node.addEventListener('click', function () {\n const ID = node && node.dataset.id ? node.dataset.id : '';\n\n if (data[ID]) {\n setMarkers(map, data[ID].filter(function (d) {\n return d.lat && d.lng;\n }), true);\n } else {\n setMarkers(map, divisions.filter(function (d) {\n return d.lat && d.lng;\n }));\n }\n });\n });\n setMarkers(map, divisions.filter(function (d) {\n return d.lat && d.lng;\n }));\n}\n\ndocument.querySelectorAll('.js-toggle--services').forEach(function (node) {\n node.addEventListener('click', function () {\n node.parentNode.classList.toggle('c-services--is-open');\n });\n});\ndocument.querySelectorAll('.js-toggle--sections').forEach(function (node) {\n node.addEventListener('click', function () {\n const parent = node.parentNode;\n\n if (parent.classList.contains('c-sections--is-open')) {\n parent.classList.toggle('c-sections--is-open');\n } else {\n document.querySelectorAll('.c-sections--is-open').forEach(function (node) {\n node.classList.remove('c-sections--is-open');\n });\n parent.classList.toggle('c-sections--is-open');\n }\n });\n});\ndocument.querySelectorAll('.js-expand-jobs-section').forEach(function (node) {\n node.addEventListener('click', function (e) {\n e.preventDefault();\n node.parentNode.classList.remove('c-jobs-section--is-closed');\n node.remove();\n });\n});\n\nconst initiatePositionForm = function () {\n const button = document.querySelector('[name=\"s\"][value=\"1\"]');\n\n if (button) {\n button.click();\n return;\n }\n\n const input = document.querySelector('[name=\"name\"]');\n\n if (input) {\n input.focus();\n }\n};\n\nif (document.querySelector('.js-inititate-position-form')) {\n document.querySelector('.js-inititate-position-form').addEventListener('click', initiatePositionForm);\n}\n\nif (document.querySelector('.js-focus-form')) {\n document.querySelector('.js-focus-form').addEventListener('click', function () {\n const input = document.querySelector('.c-form input:first-of-type');\n\n if (input) {\n input.focus();\n }\n });\n}\n\nif (document.querySelector('.js-modal--close')) {\n document.querySelector('.js-modal--close').addEventListener('click', function () {\n const modal = document.querySelector('.c-modal');\n\n if (modal) {\n modal.remove();\n }\n\n const node = document.querySelector('.c-form [autofocus]');\n\n if (node) {\n node.focus();\n }\n });\n}\n\nfunction fallbackCopyTextToClipboard(text) {\n var textArea = document.createElement('textarea');\n textArea.value = text;\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n\n try {\n var successful = document.execCommand('copy');\n var msg = successful ? 'successful' : 'unsuccessful';\n console.log('Fallback: Copying text command was ' + msg);\n } catch (err) {\n console.error('Fallback: Oops, unable to copy', err);\n }\n\n document.body.removeChild(textArea);\n}\n\nfunction copyTextToClipboard(text) {\n if (!navigator.clipboard) {\n fallbackCopyTextToClipboard(text);\n return;\n }\n\n navigator.clipboard.writeText(text).then(function () {}, function (err) {\n console.error('Async: Could not copy text: ', err);\n });\n}\n\nif (document.querySelector('.js-copy-to-clipboard')) {\n document.querySelector('.js-copy-to-clipboard').addEventListener('click', function (e) {\n e.preventDefault();\n copyTextToClipboard(window.location);\n });\n}\n\n(function (global) {\n const node = document.querySelector('.c-form [autofocus]');\n\n if (node) {\n node.focus();\n }\n\n if (location.hash) {\n const error = document.querySelector('.c-form--input-wrap--error input') || document.querySelector('.c-form--checkbox--error');\n\n if (error) {\n error.focus();\n return;\n }\n\n const input = document.querySelector('.c-form [name=\"name\"]');\n\n if (input) {\n input.focus();\n }\n }\n})(window);\n\n(function (global) {\n document.querySelectorAll('.gtm-share-click').forEach(function (node) {\n node.addEventListener('click', function (e) {\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n 'event': 'shareClick',\n 'shareLabel': node.dataset.label || ''\n });\n });\n });\n})(window);\n\nasync function autocomplete() {\n await __webpack_require__.e(/*! import() | autocomplete */ \"autocomplete\").then(__webpack_require__.bind(null, /*! ./components/autocomplete */ \"./wp-content/themes/biuro/js/components/autocomplete.js\"));\n}\n\nif (document.getElementById('search-city') || document.getElementById('search-query') || document.getElementById('form-city')) {\n autocomplete();\n}\n\nasync function feedbacks() {\n await __webpack_require__.e(/*! import() | feedbacks */ \"feedbacks\").then(__webpack_require__.bind(null, /*! ./components/feedbacks */ \"./wp-content/themes/biuro/js/components/feedbacks.js\"));\n}\n\n;\n\nif (document.querySelectorAll('.c-feedbacks--inner').length) {\n feedbacks();\n}\n\n//# sourceURL=webpack:///./wp-content/themes/biuro/js/main.js?");
eval("function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\n// https://github.com/webpack/webpack/issues/8656#issuecomment-456001556\nif (window.NodeList && !NodeList.prototype.forEach) {\n NodeList.prototype.forEach = Array.prototype.forEach;\n}\n\n(function (global) {\n var container = document.getElementById('cookie-warning');\n var btnAgree = document.getElementById('cookie-agree');\n var btnClose = document.getElementById('cookie-close');\n var agreed = useLS() ? localStorage.getItem('biuro-agree') : false;\n\n function useLS() {\n var mod = 'a';\n\n try {\n localStorage.setItem(mod, mod);\n localStorage.removeItem(mod);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n if (!container || !btnAgree || !btnClose || agreed) {\n return;\n }\n\n container.style.display = 'block';\n btnAgree.addEventListener('click', function () {\n if (useLS()) {\n localStorage.setItem('biuro-agree', 'true');\n }\n\n container.style.display = 'none';\n });\n btnClose.addEventListener('click', function () {\n container.style.display = 'none';\n });\n})(window);\n\nif (true) {\n module.hot.accept();\n}\n\n(function (global) {\n var node = document.getElementById('js-map--divisions');\n\n if (!node) {\n return;\n }\n\n fetch('/wp-json/api/v1/divisions?langID=' + node.dataset.id).then(function (t) {\n return t.json();\n }).then(function (data) {\n initDivisionsMap(node, data);\n });\n})(window);\n\n(function (global) {\n var node = document.querySelector('.c-nav--lang');\n\n if (!node) {\n return;\n }\n\n node.addEventListener('click', function (e) {\n e.currentTarget.classList.toggle('c-nav--lang--is-open');\n });\n})(window);\n\n(function (global) {\n var node = document.getElementById('js-map--regions');\n\n if (!node) {\n return;\n }\n\n initRegionsMap(node);\n})(window);\n\n(function (global) {\n document.querySelectorAll('.js-toggle--nav').forEach(function (node) {\n node.addEventListener('click', function (e) {\n e.preventDefault();\n document.body.classList.toggle('is-nav--open');\n });\n });\n document.querySelectorAll('.js-toggle--aside').forEach(function (node) {\n node.addEventListener('click', function (e) {\n e.preventDefault();\n document.body.classList.toggle('is-aside--open');\n });\n });\n})(window);\n\nvar mapStyles = [{\n featureType: 'all',\n elementType: 'all',\n stylers: [{\n 'saturation': -92\n }, {\n 'lightness': -8\n }, {\n 'hue': '#0000ff'\n }]\n}, {\n 'featureType': 'water',\n elementType: 'all',\n 'stylers': [{\n 'saturation': -95\n }, {\n 'lightness': -25\n }, {\n 'hue': '#0000ff'\n }]\n}];\nvar info;\n\nfunction setMarkers(map, positions, focus) {\n var bounds = new window.google.maps.LatLngBounds();\n\n for (var i = 0; i < positions.length; i++) {\n var position = positions[i];\n var pos = new window.google.maps.LatLng(position.lat, position.lng);\n var marker = new window.google.maps.Marker({\n position: pos,\n map: map,\n icon: '/wp-content/themes/biuro/i/ico--map-pin.svg',\n title: position.title || ''\n });\n\n if (info) {\n info.close();\n }\n\n bounds.extend(pos);\n\n if (position.content) {\n marker['content'] = position.content;\n window.google.maps.event.addListener(marker, 'click', function () {\n info = new window.google.maps.InfoWindow({\n content: this.content\n });\n info.open(map, this);\n });\n }\n\n if (focus) {\n if (window.innerWidth < 960) {\n window.scrollTo(0, 0);\n }\n\n new google.maps.event.trigger(marker, 'click');\n }\n }\n\n map.fitBounds(bounds);\n}\n\nfunction initRegionsMap(node) {\n if (!window.google) {\n setTimeout(function () {\n initRegionsMap(node);\n }, 250);\n return;\n }\n\n var map = new window.google.maps.Map(node, {\n mapTypeIds: [window.google.maps.MapTypeId.ROADMAP, window.google.maps.MapTypeId.HYBRID, 'biuro']\n });\n map.mapTypes.set('biuro', new window.google.maps.StyledMapType(mapStyles, {\n name: 'Biuro'\n }));\n map.setMapTypeId('biuro');\n window.google.maps.event.addListenerOnce(map, 'bounds_changed', function () {\n if (this.getZoom() > 15) {\n this.setZoom(14);\n }\n });\n var regions = [{\n title: 'Vilnius',\n lat: 54.687157,\n lng: 25.279652\n }, {\n title: 'Rīga',\n lat: 56.946285,\n lng: 24.105078\n }, {\n title: 'Tallinn',\n lat: 59.436962,\n lng: 24.753574\n }];\n setMarkers(map, regions);\n}\n\nfunction initDivisionsMap(node, data) {\n if (!window.google) {\n setTimeout(function () {\n initDivisionsMap(node, data);\n }, 250);\n return;\n }\n\n var map = new window.google.maps.Map(node, {\n mapTypeIds: [window.google.maps.MapTypeId.ROADMAP, window.google.maps.MapTypeId.HYBRID, 'biuro']\n });\n map.mapTypes.set('biuro', new window.google.maps.StyledMapType(mapStyles, {\n name: 'Biuro'\n }));\n map.setMapTypeId('biuro');\n window.google.maps.event.addListenerOnce(map, 'bounds_changed', function () {\n if (this.getZoom() > 15) {\n this.setZoom(14);\n }\n });\n var divisions = [];\n Object.keys(data).forEach(function (key) {\n var division = data[key];\n\n if (key.substr(0, 4) === 'city') {\n divisions = divisions.concat(division);\n }\n });\n document.querySelectorAll('.js-division').forEach(function (node) {\n node.addEventListener('click', function () {\n var ID = node && node.dataset.id ? node.dataset.id : '';\n\n if (data[ID]) {\n setMarkers(map, data[ID].filter(function (d) {\n return d.lat && d.lng;\n }), true);\n } else {\n setMarkers(map, divisions.filter(function (d) {\n return d.lat && d.lng;\n }));\n }\n });\n });\n setMarkers(map, divisions.filter(function (d) {\n return d.lat && d.lng;\n }));\n}\n\ndocument.querySelectorAll('.js-toggle--services').forEach(function (node) {\n node.addEventListener('click', function () {\n node.parentNode.classList.toggle('c-services--is-open');\n });\n});\ndocument.querySelectorAll('.js-toggle--sections').forEach(function (node) {\n node.addEventListener('click', function () {\n var parent = node.parentNode;\n\n if (parent.classList.contains('c-sections--is-open')) {\n parent.classList.toggle('c-sections--is-open');\n } else {\n document.querySelectorAll('.c-sections--is-open').forEach(function (node) {\n node.classList.remove('c-sections--is-open');\n });\n parent.classList.toggle('c-sections--is-open');\n }\n });\n});\ndocument.querySelectorAll('.js-expand-jobs-section').forEach(function (node) {\n node.addEventListener('click', function (e) {\n e.preventDefault();\n node.parentNode.classList.remove('c-jobs-section--is-closed');\n node.remove();\n });\n});\n\nvar initiatePositionForm = function initiatePositionForm() {\n var button = document.querySelector('[name=\"s\"][value=\"1\"]');\n\n if (button) {\n button.click();\n return;\n }\n\n var input = document.querySelector('[name=\"name\"]');\n\n if (input) {\n input.focus();\n }\n};\n\nif (document.querySelector('.js-inititate-position-form')) {\n document.querySelector('.js-inititate-position-form').addEventListener('click', initiatePositionForm);\n}\n\nif (document.querySelector('.js-focus-form')) {\n document.querySelector('.js-focus-form').addEventListener('click', function () {\n var input = document.querySelector('.c-form input:first-of-type');\n\n if (input) {\n input.focus();\n }\n });\n}\n\nif (document.querySelector('.js-modal--close')) {\n document.querySelector('.js-modal--close').addEventListener('click', function () {\n var modal = document.querySelector('.c-modal');\n\n if (modal) {\n modal.remove();\n }\n\n var node = document.querySelector('.c-form [autofocus]');\n\n if (node) {\n node.focus();\n }\n });\n}\n\nfunction fallbackCopyTextToClipboard(text) {\n var textArea = document.createElement('textarea');\n textArea.value = text;\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n\n try {\n var successful = document.execCommand('copy');\n var msg = successful ? 'successful' : 'unsuccessful';\n console.log('Fallback: Copying text command was ' + msg);\n } catch (err) {\n console.error('Fallback: Oops, unable to copy', err);\n }\n\n document.body.removeChild(textArea);\n}\n\nfunction copyTextToClipboard(text) {\n if (!navigator.clipboard) {\n fallbackCopyTextToClipboard(text);\n return;\n }\n\n navigator.clipboard.writeText(text).then(function () {}, function (err) {\n console.error('Async: Could not copy text: ', err);\n });\n}\n\nif (document.querySelector('.js-copy-to-clipboard')) {\n document.querySelector('.js-copy-to-clipboard').addEventListener('click', function (e) {\n e.preventDefault();\n copyTextToClipboard(window.location);\n });\n}\n\n(function (global) {\n var node = document.querySelector('.c-form [autofocus]');\n\n if (node) {\n node.focus();\n }\n\n if (location.hash) {\n var error = document.querySelector('.c-form--input-wrap--error input') || document.querySelector('.c-form--checkbox--error');\n\n if (error) {\n error.focus();\n return;\n }\n\n var input = document.querySelector('.c-form [name=\"name\"]');\n\n if (input) {\n input.focus();\n }\n }\n})(window);\n\n(function (global) {\n document.querySelectorAll('.gtm-share-click').forEach(function (node) {\n node.addEventListener('click', function (e) {\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n 'event': 'shareClick',\n 'shareLabel': node.dataset.label || ''\n });\n });\n });\n})(window);\n\nfunction autocomplete() {\n return _autocomplete.apply(this, arguments);\n}\n\nfunction _autocomplete() {\n _autocomplete = _asyncToGenerator(\n /*#__PURE__*/\n regeneratorRuntime.mark(function _callee() {\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return __webpack_require__.e(/*! import() | autocomplete */ \"autocomplete\").then(__webpack_require__.bind(null, /*! ./components/autocomplete */ \"./wp-content/themes/biuro/js/components/autocomplete.js\"));\n\n case 2:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _autocomplete.apply(this, arguments);\n}\n\nif (document.getElementById('search-city') || document.getElementById('search-query') || document.getElementById('form-city')) {\n autocomplete();\n}\n\nfunction feedbacks() {\n return _feedbacks.apply(this, arguments);\n}\n\nfunction _feedbacks() {\n _feedbacks = _asyncToGenerator(\n /*#__PURE__*/\n regeneratorRuntime.mark(function _callee2() {\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return __webpack_require__.e(/*! import() | feedbacks */ \"feedbacks\").then(__webpack_require__.bind(null, /*! ./components/feedbacks */ \"./wp-content/themes/biuro/js/components/feedbacks.js\"));\n\n case 2:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n return _feedbacks.apply(this, arguments);\n}\n\n;\n\nif (document.querySelectorAll('.c-feedbacks--inner').length) {\n feedbacks();\n}\n\n//# sourceURL=webpack:///./wp-content/themes/biuro/js/main.js?");
/***/ }),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment