\\x3c!--\\x3e\\x3c!-- 1) {\r\n\t\t\t\tattributes = extend({\r\n\t\t\t\t\tpath: '/'\r\n\t\t\t\t}, api.defaults, attributes);\r\n\r\n\t\t\t\tif (typeof attributes.expires === 'number') {\r\n\t\t\t\t\tvar expires = new Date();\r\n\t\t\t\t\texpires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);\r\n\t\t\t\t\tattributes.expires = expires;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\r\n\t\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tresult = JSON.stringify(value);\r\n\t\t\t\t\tif (/^[\\{\\[]/.test(result)) {\r\n\t\t\t\t\t\tvalue = result;\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e) {}\r\n\r\n\t\t\t\tif (!converter.write) {\r\n\t\t\t\t\tvalue = encodeURIComponent(String(value))\r\n\t\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvalue = converter.write(value, key);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkey = encodeURIComponent(String(key));\r\n\t\t\t\tkey = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);\r\n\t\t\t\tkey = key.replace(/[\\(\\)]/g, escape);\r\n\r\n\t\t\t\tvar stringifiedAttributes = '';\r\n\r\n\t\t\t\tfor (var attributeName in attributes) {\r\n\t\t\t\t\tif (!attributes[attributeName]) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstringifiedAttributes += '; ' + attributeName;\r\n\t\t\t\t\tif (attributes[attributeName] === true) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName];\r\n\t\t\t\t}\r\n\t\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\r\n\t\t\t}\r\n\r\n\t\t\t// Read\r\n\r\n\t\t\tif (!key) {\r\n\t\t\t\tresult = {};\r\n\t\t\t}\r\n\r\n\t\t\t// To prevent the for loop in the first place assign an empty array\r\n\t\t\t// in case there are no cookies at all. Also prevents odd result when\r\n\t\t\t// calling \"get()\"\r\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\r\n\t\t\tvar rdecode = /(%[0-9A-Z]{2})+/g;\r\n\t\t\tvar i = 0;\r\n\r\n\t\t\tfor (; i < cookies.length; i++) {\r\n\t\t\t\tvar parts = cookies[i].split('=');\r\n\t\t\t\tvar cookie = parts.slice(1).join('=');\r\n\r\n\t\t\t\tif (!this.json && cookie.charAt(0) === '\"') {\r\n\t\t\t\t\tcookie = cookie.slice(1, -1);\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tvar name = parts[0].replace(rdecode, decodeURIComponent);\r\n\t\t\t\t\tcookie = converter.read ?\r\n\t\t\t\t\t\tconverter.read(cookie, name) : converter(cookie, name) ||\r\n\t\t\t\t\t\tcookie.replace(rdecode, decodeURIComponent);\r\n\r\n\t\t\t\t\tif (this.json) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\r\n\t\t\t\t\t\t} catch (e) {}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (key === name) {\r\n\t\t\t\t\t\tresult = cookie;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (!key) {\r\n\t\t\t\t\t\tresult[name] = cookie;\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e) {}\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t}\r\n\r\n\t\tapi.set = api;\r\n\t\tapi.get = function (key) {\r\n\t\t\treturn api.call(api, key);\r\n\t\t};\r\n\t\tapi.getJSON = function () {\r\n\t\t\treturn api.apply({\r\n\t\t\t\tjson: true\r\n\t\t\t}, [].slice.call(arguments));\r\n\t\t};\r\n\t\tapi.defaults = {};\r\n\r\n\t\tapi.remove = function (key, attributes) {\r\n\t\t\tapi(key, '', extend(attributes, {\r\n\t\t\t\texpires: -1\r\n\t\t\t}));\r\n\t\t};\r\n\r\n\t\tapi.withConverter = init;\r\n\r\n\t\treturn api;\r\n\t}\r\n\r\n\treturn init(function () {});\r\n}));","module.exports = function(originalModule) {\n\tif (!originalModule.webpackPolyfill) {\n\t\tvar module = Object.create(originalModule);\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"exports\", {\n\t\t\tenumerable: true\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar floor = Math.floor;\nvar charAt = uncurryThis(''.charAt);\nvar replace = uncurryThis(''.replace);\nvar stringSlice = uncurryThis(''.slice);\nvar SUBSTITUTION_SYMBOLS = /\\$([$&'`]|\\d{1,2}|<[^>]*>)/g;\nvar SUBSTITUTION_SYMBOLS_NO_NAMED = /\\$([$&'`]|\\d{1,2})/g;\n\n// `GetSubstitution` abstract operation\n// https://tc39.es/ecma262/#sec-getsubstitution\nmodule.exports = function (matched, str, position, captures, namedCaptures, replacement) {\n var tailPos = position + matched.length;\n var m = captures.length;\n var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;\n if (namedCaptures !== undefined) {\n namedCaptures = toObject(namedCaptures);\n symbols = SUBSTITUTION_SYMBOLS;\n }\n return replace(replacement, symbols, function (match, ch) {\n var capture;\n switch (charAt(ch, 0)) {\n case '$': return '$';\n case '&': return matched;\n case '`': return stringSlice(str, 0, position);\n case \"'\": return stringSlice(str, tailPos);\n case '<':\n capture = namedCaptures[stringSlice(ch, 1, -1)];\n break;\n default: // \\d\\d?\n var n = +ch;\n if (n === 0) return match;\n if (n > m) {\n var f = floor(n / 10);\n if (f === 0) return match;\n if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);\n return match;\n }\n capture = captures[n - 1];\n }\n return capture === undefined ? '' : capture;\n });\n};\n","/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n","'use strict';\nvar $ = require('../internals/export');\nvar $trim = require('../internals/string-trim').trim;\nvar forcedStringTrimMethod = require('../internals/string-trim-forced');\n\n// `String.prototype.trim` method\n// https://tc39.es/ecma262/#sec-string.prototype.trim\n$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {\n trim: function trim() {\n return $trim(this);\n }\n});\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar toString = require('../internals/to-string');\nvar whitespaces = require('../internals/whitespaces');\n\nvar replace = uncurryThis(''.replace);\nvar whitespace = '[' + whitespaces + ']';\nvar ltrim = RegExp('^' + whitespace + whitespace + '*');\nvar rtrim = RegExp(whitespace + whitespace + '*$');\n\n// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation\nvar createMethod = function (TYPE) {\n return function ($this) {\n var string = toString(requireObjectCoercible($this));\n if (TYPE & 1) string = replace(string, ltrim, '');\n if (TYPE & 2) string = replace(string, rtrim, '');\n return string;\n };\n};\n\nmodule.exports = {\n // `String.prototype.{ trimLeft, trimStart }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimstart\n start: createMethod(1),\n // `String.prototype.{ trimRight, trimEnd }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimend\n end: createMethod(2),\n // `String.prototype.trim` method\n // https://tc39.es/ecma262/#sec-string.prototype.trim\n trim: createMethod(3)\n};\n","var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER;\nvar fails = require('../internals/fails');\nvar whitespaces = require('../internals/whitespaces');\n\nvar non = '\\u200B\\u0085\\u180E';\n\n// check that a method works with the correct list\n// of whitespaces and has a correct name\nmodule.exports = function (METHOD_NAME) {\n return fails(function () {\n return !!whitespaces[METHOD_NAME]()\n || non[METHOD_NAME]() !== non\n || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);\n });\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar flattenIntoArray = require('../internals/flatten-into-array');\nvar aCallable = require('../internals/a-callable');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\n// `Array.prototype.flatMap` method\n// https://tc39.es/ecma262/#sec-array.prototype.flatmap\n$({ target: 'Array', proto: true }, {\n flatMap: function flatMap(callbackfn /* , thisArg */) {\n var O = toObject(this);\n var sourceLen = lengthOfArrayLike(O);\n var A;\n aCallable(callbackfn);\n A = arraySpeciesCreate(O, 0);\n A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return A;\n }\n});\n","'use strict';\nvar global = require('../internals/global');\nvar isArray = require('../internals/is-array');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar bind = require('../internals/function-bind-context');\n\nvar TypeError = global.TypeError;\n\n// `FlattenIntoArray` abstract operation\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? bind(mapper, thisArg) : false;\n var element, elementLen;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n if (depth > 0 && isArray(element)) {\n elementLen = lengthOfArrayLike(element);\n targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;\n } else {\n if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length');\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n};\n\nmodule.exports = flattenIntoArray;\n","// this method was added to unscopables after implementation\n// in popular engines, so it's moved to a separate module\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('flatMap');\n","'use strict';\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar toString = require('../internals/to-string');\nvar fails = require('../internals/fails');\nvar internalSort = require('../internals/array-sort');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar FF = require('../internals/engine-ff-version');\nvar IE_OR_EDGE = require('../internals/engine-is-ie-or-edge');\nvar V8 = require('../internals/engine-v8-version');\nvar WEBKIT = require('../internals/engine-webkit-version');\n\nvar test = [];\nvar un$Sort = uncurryThis(test.sort);\nvar push = uncurryThis(test.push);\n\n// IE8-\nvar FAILS_ON_UNDEFINED = fails(function () {\n test.sort(undefined);\n});\n// V8 bug\nvar FAILS_ON_NULL = fails(function () {\n test.sort(null);\n});\n// Old WebKit\nvar STRICT_METHOD = arrayMethodIsStrict('sort');\n\nvar STABLE_SORT = !fails(function () {\n // feature detection can be too slow, so check engines versions\n if (V8) return V8 < 70;\n if (FF && FF > 3) return;\n if (IE_OR_EDGE) return true;\n if (WEBKIT) return WEBKIT < 603;\n\n var result = '';\n var code, chr, value, index;\n\n // generate an array with more 512 elements (Chakra and old V8 fails only in this case)\n for (code = 65; code < 76; code++) {\n chr = String.fromCharCode(code);\n\n switch (code) {\n case 66: case 69: case 70: case 72: value = 3; break;\n case 68: case 71: value = 4; break;\n default: value = 2;\n }\n\n for (index = 0; index < 47; index++) {\n test.push({ k: chr + index, v: value });\n }\n }\n\n test.sort(function (a, b) { return b.v - a.v; });\n\n for (index = 0; index < test.length; index++) {\n chr = test[index].k.charAt(0);\n if (result.charAt(result.length - 1) !== chr) result += chr;\n }\n\n return result !== 'DGBEFHACIJK';\n});\n\nvar FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;\n\nvar getSortCompare = function (comparefn) {\n return function (x, y) {\n if (y === undefined) return -1;\n if (x === undefined) return 1;\n if (comparefn !== undefined) return +comparefn(x, y) || 0;\n return toString(x) > toString(y) ? 1 : -1;\n };\n};\n\n// `Array.prototype.sort` method\n// https://tc39.es/ecma262/#sec-array.prototype.sort\n$({ target: 'Array', proto: true, forced: FORCED }, {\n sort: function sort(comparefn) {\n if (comparefn !== undefined) aCallable(comparefn);\n\n var array = toObject(this);\n\n if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);\n\n var items = [];\n var arrayLength = lengthOfArrayLike(array);\n var itemsLength, index;\n\n for (index = 0; index < arrayLength; index++) {\n if (index in array) push(items, array[index]);\n }\n\n internalSort(items, getSortCompare(comparefn));\n\n itemsLength = items.length;\n index = 0;\n\n while (index < itemsLength) array[index] = items[index++];\n while (index < arrayLength) delete array[index++];\n\n return array;\n }\n});\n","var arraySlice = require('../internals/array-slice');\n\nvar floor = Math.floor;\n\nvar mergeSort = function (array, comparefn) {\n var length = array.length;\n var middle = floor(length / 2);\n return length < 8 ? insertionSort(array, comparefn) : merge(\n array,\n mergeSort(arraySlice(array, 0, middle), comparefn),\n mergeSort(arraySlice(array, middle), comparefn),\n comparefn\n );\n};\n\nvar insertionSort = function (array, comparefn) {\n var length = array.length;\n var i = 1;\n var element, j;\n\n while (i < length) {\n j = i;\n element = array[i];\n while (j && comparefn(array[j - 1], element) > 0) {\n array[j] = array[--j];\n }\n if (j !== i++) array[j] = element;\n } return array;\n};\n\nvar merge = function (array, left, right, comparefn) {\n var llength = left.length;\n var rlength = right.length;\n var lindex = 0;\n var rindex = 0;\n\n while (lindex < llength || rindex < rlength) {\n array[lindex + rindex] = (lindex < llength && rindex < rlength)\n ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]\n : lindex < llength ? left[lindex++] : right[rindex++];\n } return array;\n};\n\nmodule.exports = mergeSort;\n","var userAgent = require('../internals/engine-user-agent');\n\nvar firefox = userAgent.match(/firefox\\/(\\d+)/i);\n\nmodule.exports = !!firefox && +firefox[1];\n","var UA = require('../internals/engine-user-agent');\n\nmodule.exports = /MSIE|Trident/.test(UA);\n","var userAgent = require('../internals/engine-user-agent');\n\nvar webkit = userAgent.match(/AppleWebKit\\/(\\d+)\\./);\n\nmodule.exports = !!webkit && +webkit[1];\n","'use strict';\nvar $ = require('../internals/export');\nvar $includes = require('../internals/array-includes').includes;\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// `Array.prototype.includes` method\n// https://tc39.es/ecma262/#sec-array.prototype.includes\n$({ target: 'Array', proto: true }, {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('includes');\n","'use strict';\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar notARegExp = require('../internals/not-a-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar toString = require('../internals/to-string');\nvar correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');\n\nvar stringIndexOf = uncurryThis(''.indexOf);\n\n// `String.prototype.includes` method\n// https://tc39.es/ecma262/#sec-string.prototype.includes\n$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~stringIndexOf(\n toString(requireObjectCoercible(this)),\n toString(notARegExp(searchString)),\n arguments.length > 1 ? arguments[1] : undefined\n );\n }\n});\n","var global = require('../internals/global');\nvar isRegExp = require('../internals/is-regexp');\n\nvar TypeError = global.TypeError;\n\nmodule.exports = function (it) {\n if (isRegExp(it)) {\n throw TypeError(\"The method doesn't accept regular expressions\");\n } return it;\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\nmodule.exports = function (METHOD_NAME) {\n var regexp = /./;\n try {\n '/./'[METHOD_NAME](regexp);\n } catch (error1) {\n try {\n regexp[MATCH] = false;\n return '/./'[METHOD_NAME](regexp);\n } catch (error2) { /* empty */ }\n } return false;\n};\n","function createShareButtons (pageUrl) {\r\n document.querySelector('.share_button_facebook').addEventListener('click', () => {\r\n const url = 'https://www.facebook.com/sharer.php?u=' + pageUrl\r\n socialWindow(url)\r\n })\r\n\r\n document.querySelector('.share_button_twitter').addEventListener('click', () => {\r\n const url = 'https://twitter.com/intent/tweet?url=' + pageUrl\r\n socialWindow(url)\r\n })\r\n\r\n document.querySelector('.share_button_linkedin').addEventListener('click', () => {\r\n const url = 'https://www.linkedin.com/sharing/share-offsite/?url=' + pageUrl\r\n socialWindow(url)\r\n })\r\n}\r\n\r\nfunction setupTwitterLikes () {\r\n document.querySelector('.icon__twitter-like').addEventListener('click', (e) => {\r\n e.preventDefault()\r\n const url = e.target.closest('a').getAttribute('href')\r\n socialWindow(url)\r\n })\r\n}\r\n\r\nfunction setupTwitterComments () {\r\n document.querySelector('.icon__twitter-comment').addEventListener('click', (e) => {\r\n e.preventDefault()\r\n const url = e.target.closest('a').getAttribute('href')\r\n socialWindow(url)\r\n })\r\n}\r\n\r\nfunction setupTwitterRetweets () {\r\n document.querySelector('.icon__twitter-retweet').addEventListener('click', (e) => {\r\n e.preventDefault()\r\n const url = e.target.closest('a').getAttribute('href')\r\n socialWindow(url)\r\n })\r\n}\r\n\r\nfunction socialWindow (url) {\r\n var left = (window.innerWidth - 570) / 2\r\n var top = (window.innerHeight - 570) / 2\r\n var params = 'menubar=no,toolbar=no,status=no,width=570,height=570,top=' + top + ',left=' + left\r\n window.open(url, 'NewWindow', params)\r\n}\r\n\r\nif (document.querySelector('[class^=share_button]') !== null) {\r\n createShareButtons(encodeURIComponent(window.location.href))\r\n}\r\n\r\nif (document.querySelector('[class^=icon__twitter-]') !== null) {\r\n setupTwitterComments()\r\n setupTwitterRetweets()\r\n setupTwitterLikes()\r\n}\r\n","/* eslint-env browser */\r\n\r\nLazyLoad(document.querySelectorAll('.lazy'))\r\n\r\nexport function LazyLoad (images) {\r\n let lazyloadCount = images.length\r\n\r\n const imageObserver = new IntersectionObserver(entries => {\r\n entries.forEach(entry => {\r\n if (entry.isIntersecting) {\r\n var image = entry.target\r\n loadImage(image)\r\n imageObserver.unobserve(image)\r\n lazyloadCount--\r\n\r\n if (lazyloadCount <= 0) {\r\n imageObserver.disconnect()\r\n }\r\n }\r\n })\r\n }, { rootMargin: '400px' })\r\n\r\n images.forEach(image => imageObserver.observe(image))\r\n}\r\n\r\nexport function loadImage (elem) {\r\n if (elem.hasAttribute('data-bg-img')) {\r\n elem.style.backgroundImage = `url(${elem.getAttribute('data-bg-img')})`\r\n } else if (elem.hasAttribute('data-img')) {\r\n if (elem.hasAttribute('data-srcset')) {\r\n elem.srcset = `${elem.getAttribute('data-srcset')}`\r\n }\r\n elem.src = `${elem.getAttribute('data-img')}`\r\n }\r\n\r\n elem.classList.remove('lazy')\r\n}\r\n","import { version } from '../../package.json'\r\n\r\nexport function equalStr (str1, str2) {\r\n return str1.toLowerCase() === str2.toLowerCase()\r\n}\r\n\r\nexport function insertCss (filename, doc) {\r\n const tag = doc.createElement('link')\r\n const port = window.location.port ? `:${window.location.port}` : ''\r\n tag.type = 'text/css'\r\n tag.rel = 'stylesheet'\r\n tag.href = `//${document.domain}${port}/dist/${filename}.min.css?version=${version}`\r\n\r\n doc.head.appendChild(tag)\r\n}\r\n\r\nexport function insertScriptTag (src, async = false, defer = false, integrity = null, crossorigin = null) {\r\n const tag = document.createElement('script')\r\n tag.setAttribute('src', src)\r\n if (async) tag.setAttribute('async', '')\r\n if (defer) tag.setAttribute('defer', '')\r\n if (integrity) tag.setAttribute('integrity', integrity)\r\n if (crossorigin) tag.setAttribute('crossorigin', crossorigin)\r\n document.body.appendChild(tag)\r\n}\r\n\r\nexport function ready (fn) {\r\n if (document.readyState !== 'loading') {\r\n fn()\r\n } else {\r\n document.addEventListener('DOMContentLoaded', fn)\r\n }\r\n}\r\n\r\nexport function isInViewport (elem) {\r\n const bounding = elem.getBoundingClientRect()\r\n\r\n return (\r\n bounding.top >= 0 &&\r\n bounding.left >= 0 &&\r\n bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\r\n bounding.right <= (window.innerWidth || document.documentElement.clientWidth)\r\n )\r\n}\r\n\r\nexport function equalizeHeight (elements, condition = () => true) {\r\n elements.forEach(e => { e.style.removeProperty('height') })\r\n if (condition(elements)) {\r\n const tallest = Math.max(...elements.map(e => e.clientHeight))\r\n elements.forEach(e => { e.style.height = tallest + 'px' })\r\n }\r\n}\r\n\r\nexport function scrollTo (elem, offset = 0, event = null) {\r\n event && event.preventDefault()\r\n if (!isInViewport(elem)) {\r\n const y = elem.getBoundingClientRect().top + window.pageYOffset + offset\r\n window.scrollTo({ top: y, behavior: 'smooth' })\r\n }\r\n}\r\n","/* global $ */\r\nimport { loadImage } from '../../plugins/lazyload'\r\n\r\nfunction jsSlider () {\r\n const jsSlider = {\r\n sliderClass: 'js-slider',\r\n slideClass: 'js-slider__slide',\r\n controlsClass: 'js-slider__controls-full-width',\r\n controlClass: 'js-slider__control',\r\n playControlClass: 'js-slider__play',\r\n playIconClass: 'icon icon__play',\r\n pauseControlClass: 'js-slider__pause',\r\n pauseIconClass: 'icon icon__pause',\r\n slider: null,\r\n sliderAnimTypeAttributeName: 'data-js-slider-animation-type',\r\n sliderAnimType: 'fade', // valid values are : 'fade', 'directional'\r\n sliderAnimClasses: { left: 'fade', right: 'fade' },\r\n slides: null,\r\n slidesCount: 0,\r\n sliderTimeout: null,\r\n revealTimeout: null,\r\n hideTimeout: null,\r\n hideTimeout2: null,\r\n rebindControlsTimeout: null,\r\n animTime: 1000, // must be >= to css transition time\r\n sliderAutoSpeed: 5000,\r\n currentActiveIndex: 0,\r\n\r\n init: function () {\r\n this.slider = document.querySelector('.' + this.sliderClass)\r\n\r\n if (!this.validSlider()) {\r\n return\r\n }\r\n\r\n this.slides = this.slider.querySelectorAll('.' + this.slideClass)\r\n this.slidesCount = this.slides.length\r\n\r\n if (this.slidesCount >= 2) {\r\n this.setAnimStyle()\r\n this.setSlides()\r\n this.preloadImages()\r\n this.setSlidesHeight()\r\n this.bindSliderListeners()\r\n this.createControls()\r\n this.bindResize()\r\n this.startAutoSlide(this.sliderAutoSpeed)\r\n }\r\n },\r\n\r\n validSlider: function () {\r\n if (this.slider == null || typeof this.slider === 'undefined') {\r\n return false\r\n } else {\r\n return true\r\n }\r\n },\r\n\r\n bindSliderListeners: function () {\r\n const self = this\r\n\r\n // When the focus enters the slider, suspend the animation\r\n this.slider.addEventListener('focusin', function () {\r\n self.stopAutoSlide()\r\n })\r\n },\r\n\r\n setSlides: function () {\r\n $(this.slides).attr('aria-hidden', true)\r\n this.slides[0].classList.add('active')\r\n this.slides[0].setAttribute('aria-hidden', false)\r\n this.currentActiveIndex = 0\r\n },\r\n\r\n setSlidesHeight: function () {\r\n // get highest slide and set this height to all slides\r\n\r\n let highest = 0\r\n let slideHeight = 0\r\n\r\n for (let i = 0; i < this.slidesCount; i++) {\r\n // reset to auto to get raw height value\r\n\r\n $(this.slides[i]).height('auto')\r\n slideHeight = $(this.slides[i]).height()\r\n highest = slideHeight < highest ? highest : slideHeight\r\n }\r\n $(this.slides).height(highest + 'px')\r\n },\r\n\r\n bindResize: function () {\r\n // must set slides height at resize\r\n\r\n window.addEventListener('resize', function () {\r\n jsSlider.setSlidesHeight()\r\n })\r\n },\r\n\r\n setAnimStyle: function () {\r\n const sliderAnimValue = this.slider.getAttribute(this.sliderAnimTypeAttributeName)\r\n\r\n if (sliderAnimValue == null || sliderAnimValue === 'fade') {\r\n return\r\n }\r\n\r\n if (sliderAnimValue === 'directional') {\r\n this.sliderAnimType = 'directional'\r\n this.sliderAnimClasses.left = 'left'\r\n this.sliderAnimClasses.right = 'right'\r\n }\r\n },\r\n\r\n createControls: function () {\r\n // create elements\r\n const controlsContainer = document.createElement('fieldset')\r\n const playControl = document.createElement('button')\r\n const playIcon = document.createElement('span')\r\n const pauseControl = document.createElement('button')\r\n const pauseIcon = document.createElement('span')\r\n\r\n // fieldset container\r\n controlsContainer.setAttribute('class', this.controlsClass)\r\n controlsContainer.setAttribute('aria-controls', 'carousel')\r\n controlsContainer.setAttribute('aria-label', 'Contrôles du carrousel')\r\n\r\n // play button\r\n playControl.setAttribute('class', this.playControlClass)\r\n playControl.setAttribute('aria-label', 'Activer le défilement automatique du carrousel')\r\n playIcon.setAttribute('class', this.playIconClass)\r\n playIcon.setAttribute('aria-hidden', 'true')\r\n playControl.appendChild(playIcon)\r\n controlsContainer.appendChild(playControl)\r\n\r\n // pause button\r\n pauseControl.setAttribute('class', this.pauseControlClass)\r\n pauseControl.setAttribute('aria-label', 'Désactiver le défilement automatique du carrousel')\r\n pauseIcon.setAttribute('class', this.pauseIconClass)\r\n pauseIcon.setAttribute('aria-hidden', 'true')\r\n pauseControl.appendChild(pauseIcon)\r\n controlsContainer.appendChild(pauseControl)\r\n\r\n // direct slide access buttons\r\n for (let i = 0; i < this.slidesCount; i++) {\r\n const newControl = document.createElement('button')\r\n newControl.setAttribute('class', this.controlClass)\r\n newControl.setAttribute('data-index', i)\r\n newControl.setAttribute('aria-label', 'Diapositive ' + (i + 1) + ' de ' + this.slidesCount)\r\n controlsContainer.appendChild(newControl)\r\n }\r\n\r\n // append all controls to slider\r\n this.slider.appendChild(controlsContainer)\r\n\r\n this.bindPlayPause()\r\n this.bindControls()\r\n this.updateControls()\r\n },\r\n\r\n bindPlayPause: function () {\r\n const self = this\r\n\r\n // bind play control\r\n $('.' + this.playControlClass).on('click', function () {\r\n self.stopAutoSlide()\r\n self.startAutoSlide(500)\r\n })\r\n\r\n // bind pause control\r\n $('.' + this.pauseControlClass).on('click', function () {\r\n self.stopAutoSlide()\r\n })\r\n },\r\n\r\n bindControls: function () {\r\n const self = this\r\n\r\n // bind direct slide access controls\r\n $('.' + this.controlClass).on('click', function () {\r\n const newIndex = parseInt(this.getAttribute('data-index'))\r\n let direction = ''\r\n\r\n // do nothing if click on current index\r\n if (newIndex === self.currentActiveIndex) {\r\n return\r\n }\r\n\r\n // stop autoslide\r\n self.stopAutoSlide()\r\n\r\n // unbind controls temporarily\r\n self.unbindControls()\r\n\r\n // determine direction\r\n direction = newIndex > self.currentActiveIndex ? self.sliderAnimClasses.right : self.sliderAnimClasses.left\r\n\r\n self.hideSlide(self.currentActiveIndex, direction)\r\n self.revealSlide(newIndex, direction)\r\n self.currentActiveIndex = newIndex\r\n self.updateControls()\r\n self.updateAriaAttributes()\r\n self.updateFocus()\r\n })\r\n },\r\n\r\n unbindControls: function () {\r\n // unbind controls when slider is in transition to prevent 2 animation from occuring at same time\r\n const self = this\r\n\r\n $('.' + this.controlClass).off('click')\r\n\r\n // rebind controls after transition is over\r\n this.rebindControlsTimeout = setTimeout(function () {\r\n self.bindControls()\r\n }, this.animTime)\r\n },\r\n\r\n updateControls: function () {\r\n // visually update controls style\r\n const controlClass = this.controlClass\r\n const index = this.currentActiveIndex\r\n const newActiveControl = this.slider.querySelector('.' + controlClass + '[data-index=\"' + index + '\"]')\r\n $('.' + controlClass).removeClass('active')\r\n newActiveControl.classList.add('active')\r\n },\r\n\r\n updateAriaAttributes: function () {\r\n // update all slides aria-hidden attributes\r\n $(this.slides).attr('aria-hidden', true)\r\n this.slides[this.currentActiveIndex].setAttribute('aria-hidden', false)\r\n },\r\n\r\n updateFocus: function () {\r\n // set focus on slide content (this function is intended to be called after using a slider control)\r\n const target = this.slides[this.currentActiveIndex]\r\n target.setAttribute('tabindex', '-1')\r\n target.focus()\r\n },\r\n\r\n revealSlide: function (index, direction) {\r\n const self = this\r\n\r\n // prepare elem for animation\r\n this.slides[index].classList.add('fadein')\r\n this.slides[index].classList.add(direction)\r\n const image = this.slides[index].querySelector('.lazy-slide')\r\n if (image !== undefined && image !== null) {\r\n loadImage(image)\r\n }\r\n\r\n // quick delay to prevent display:block canceling animation\r\n self.revealTimeout = setTimeout(function () {\r\n // add class that launch animation\r\n self.slides[index].classList.add('active')\r\n\r\n // remove preparation classes\r\n self.slides[index].classList.remove('fadein')\r\n self.slides[index].classList.remove(direction)\r\n }, 45)\r\n },\r\n\r\n hideSlide: function (index, direction) {\r\n const self = this\r\n\r\n // must always add and remove 'active' classes at the same time\r\n this.hideTimeout = setTimeout(function () {\r\n // the classes that launch animation\r\n self.slides[index].classList.add('fadeout')\r\n self.slides[index].classList.add(direction)\r\n self.slides[index].classList.remove('active')\r\n }, 50)\r\n\r\n // remove when animation is over\r\n this.hideTimeout2 = setTimeout(function () {\r\n self.slides[index].classList.remove('fadeout')\r\n self.slides[index].classList.remove(direction)\r\n }, self.animTime)\r\n },\r\n\r\n startAutoSlide: function (speed) {\r\n const self = this\r\n this.sliderTimeout = setTimeout(function () {\r\n // unbind controls temporarily\r\n self.unbindControls()\r\n\r\n const newIndex = self.currentActiveIndex === self.slidesCount - 1 ? 0 : parseInt(self.currentActiveIndex) + 1\r\n self.hideSlide(self.currentActiveIndex, self.sliderAnimClasses.right)\r\n self.revealSlide(newIndex, self.sliderAnimClasses.right)\r\n self.currentActiveIndex = newIndex\r\n self.updateControls()\r\n self.updateAriaAttributes()\r\n\r\n // recall itself\r\n self.startAutoSlide(self.sliderAutoSpeed)\r\n }, speed, self)\r\n },\r\n\r\n stopAutoSlide: function () {\r\n clearTimeout(this.sliderTimeout)\r\n },\r\n\r\n preloadImages: function () {\r\n let timespan = 1\r\n let i = 0\r\n\r\n while (i <= this.slidesCount - 1) {\r\n const image = this.slides[i].querySelector('.lazy-slide')\r\n setTimeout(function () {\r\n if (image !== undefined && image !== null) {\r\n loadImage(image)\r\n }\r\n }, timespan)\r\n timespan += 1500\r\n ++i\r\n }\r\n }\r\n }\r\n\r\n jsSlider.init()\r\n}\r\n\r\njsSlider()\r\n\r\nfunction jsSlider2 () {\r\n const jsSlider2 = {\r\n sliderClass: 'js-slider2',\r\n slideClass: 'js-slider2__slide',\r\n controlsClass: 'js-slider2__controls',\r\n controlClass: 'js-slider2__control',\r\n playControlClass: 'js-slider2__play',\r\n playIconClass: 'icon icon__play',\r\n pauseControlClass: 'js-slider2__pause',\r\n pauseIconClass: 'icon icon__pause',\r\n slider: null,\r\n sliderAnimTypeAttributeName: 'data-js-slider-animation-type',\r\n sliderAnimType: 'fade', // valid values are : 'fade', 'directional'\r\n sliderAnimClasses: { left: 'fade', right: 'fade' },\r\n slides: null,\r\n slidesCount: 0,\r\n sliderTimeout: null,\r\n revealTimeout: null,\r\n hideTimeout: null,\r\n hideTimeout2: null,\r\n rebindControlsTimeout: null,\r\n animTime: 1000, // must be >= to css transition time\r\n sliderAutoSpeed: 5000,\r\n currentActiveIndex: 0,\r\n\r\n init: function () {\r\n this.slider = document.querySelector('.' + this.sliderClass)\r\n\r\n if (!this.validSlider()) {\r\n return\r\n }\r\n\r\n this.slides = this.slider.querySelectorAll('.' + this.slideClass)\r\n this.slidesCount = this.slides.length\r\n\r\n if (this.slidesCount >= 2) {\r\n this.setAnimStyle()\r\n this.setSlides()\r\n this.preloadImages()\r\n this.setSlidesHeight()\r\n this.bindSliderListeners()\r\n this.createControls()\r\n this.bindResize()\r\n this.startAutoSlide(this.sliderAutoSpeed)\r\n }\r\n },\r\n\r\n validSlider: function () {\r\n if (this.slider == null || typeof this.slider === 'undefined') {\r\n return false\r\n } else {\r\n return true\r\n }\r\n },\r\n\r\n bindSliderListeners: function () {\r\n const self = this\r\n\r\n // When the focus enters the slider, suspend the animation\r\n this.slider.addEventListener('focusin', function () {\r\n self.stopAutoSlide()\r\n })\r\n },\r\n\r\n setSlides: function () {\r\n $(this.slides).attr('aria-hidden', true)\r\n this.slides[0].classList.add('active')\r\n this.slides[0].setAttribute('aria-hidden', false)\r\n this.currentActiveIndex = 0\r\n },\r\n\r\n setSlidesHeight: function () {\r\n // get highest slide and set this height to all slides\r\n\r\n let highest = 0\r\n let slideHeight = 0\r\n\r\n for (let i = 0; i < this.slidesCount; i++) {\r\n // reset to auto to get raw height value\r\n\r\n $(this.slides[i]).height('auto')\r\n slideHeight = $(this.slides[i]).height()\r\n highest = slideHeight < highest ? highest : slideHeight\r\n }\r\n $(this.slides).height(highest + 'px')\r\n },\r\n\r\n bindResize: function () {\r\n // must set slides height at resize\r\n\r\n window.addEventListener('resize', function () {\r\n jsSlider2.setSlidesHeight()\r\n })\r\n },\r\n\r\n setAnimStyle: function () {\r\n const sliderAnimValue = this.slider.getAttribute(this.sliderAnimTypeAttributeName)\r\n\r\n if (sliderAnimValue == null || sliderAnimValue === 'fade') {\r\n return\r\n }\r\n\r\n if (sliderAnimValue === 'directional') {\r\n this.sliderAnimType = 'directional'\r\n this.sliderAnimClasses.left = 'left'\r\n this.sliderAnimClasses.right = 'right'\r\n }\r\n },\r\n\r\n createControls: function () {\r\n // create elements\r\n const controlsContainer = document.createElement('fieldset')\r\n const playControl = document.createElement('button')\r\n const playIcon = document.createElement('span')\r\n const pauseControl = document.createElement('button')\r\n const pauseIcon = document.createElement('span')\r\n\r\n // fieldset container\r\n controlsContainer.setAttribute('class', this.controlsClass)\r\n controlsContainer.setAttribute('aria-controls', 'carousel')\r\n controlsContainer.setAttribute('aria-label', 'Contrôles du caroussel')\r\n\r\n // play button\r\n playControl.setAttribute('class', this.playControlClass)\r\n playControl.setAttribute('aria-label', 'Activer le défilement automatique du caroussel')\r\n playIcon.setAttribute('class', this.playIconClass)\r\n playIcon.setAttribute('aria-hidden', 'true')\r\n playControl.appendChild(playIcon)\r\n controlsContainer.appendChild(playControl)\r\n\r\n // pause button\r\n pauseControl.setAttribute('class', this.pauseControlClass)\r\n pauseControl.setAttribute('aria-label', 'Désactiver le défilement automatique du caroussel')\r\n pauseIcon.setAttribute('class', this.pauseIconClass)\r\n pauseIcon.setAttribute('aria-hidden', 'true')\r\n pauseControl.appendChild(pauseIcon)\r\n controlsContainer.appendChild(pauseControl)\r\n\r\n // direct slide access buttons\r\n for (let i = 0; i < this.slidesCount; i++) {\r\n const newControl = document.createElement('button')\r\n newControl.setAttribute('class', this.controlClass)\r\n newControl.setAttribute('data-index', i)\r\n newControl.setAttribute('aria-label', 'Diapositive ' + (i + 1) + ' de ' + this.slidesCount)\r\n controlsContainer.appendChild(newControl)\r\n }\r\n\r\n // append all controls to slider\r\n this.slider.appendChild(controlsContainer)\r\n\r\n this.bindPlayPause()\r\n this.bindControls()\r\n this.updateControls()\r\n },\r\n\r\n bindPlayPause: function () {\r\n const self = this\r\n\r\n // bind play control\r\n $('.' + this.playControlClass).on('click', function () {\r\n self.stopAutoSlide()\r\n self.startAutoSlide(500)\r\n })\r\n\r\n // bind pause control\r\n $('.' + this.pauseControlClass).on('click', function () {\r\n self.stopAutoSlide()\r\n })\r\n },\r\n\r\n bindControls: function () {\r\n const self = this\r\n\r\n // bind direct slide access controls\r\n $('.' + this.controlClass).on('click', function () {\r\n const newIndex = parseInt(this.getAttribute('data-index'))\r\n let direction = ''\r\n\r\n // do nothing if click on current index\r\n if (newIndex === self.currentActiveIndex) {\r\n return\r\n }\r\n\r\n // stop autoslide\r\n self.stopAutoSlide()\r\n\r\n // unbind controls temporarily\r\n self.unbindControls()\r\n\r\n // determine direction\r\n direction = newIndex > self.currentActiveIndex ? self.sliderAnimClasses.right : self.sliderAnimClasses.left\r\n\r\n self.hideSlide(self.currentActiveIndex, direction)\r\n self.revealSlide(newIndex, direction)\r\n self.currentActiveIndex = newIndex\r\n self.updateControls()\r\n self.updateAriaAttributes()\r\n self.updateFocus()\r\n })\r\n },\r\n\r\n unbindControls: function () {\r\n // unbind controls when slider is in transition to prevent 2 animation from occuring at same time\r\n const self = this\r\n\r\n $('.' + this.controlClass).off('click')\r\n\r\n // rebind controls after transition is over\r\n this.rebindControlsTimeout = setTimeout(function () {\r\n self.bindControls()\r\n }, this.animTime)\r\n },\r\n\r\n updateControls: function () {\r\n // visually update controls style\r\n const controlClass = this.controlClass\r\n const index = this.currentActiveIndex\r\n const newActiveControl = this.slider.querySelector('.' + controlClass + '[data-index=\"' + index + '\"]')\r\n $('.' + controlClass).removeClass('active')\r\n newActiveControl.classList.add('active')\r\n },\r\n\r\n updateAriaAttributes: function () {\r\n // update all slides aria-hidden attributes\r\n $(this.slides).attr('aria-hidden', true)\r\n this.slides[this.currentActiveIndex].setAttribute('aria-hidden', false)\r\n },\r\n\r\n updateFocus: function () {\r\n // set focus on slide content (this function is intended to be called after using a slider control)\r\n const target = this.slides[this.currentActiveIndex]\r\n target.setAttribute('tabindex', '-1')\r\n target.focus()\r\n },\r\n\r\n revealSlide: function (index, direction) {\r\n const self = this\r\n\r\n // prepare elem for animation\r\n this.slides[index].classList.add('fadein')\r\n this.slides[index].classList.add(direction)\r\n const image = this.slides[index].querySelector('.lazy-slide')\r\n if (image !== undefined && image !== null) {\r\n loadImage(image)\r\n }\r\n\r\n // quick delay to prevent display:block canceling animation\r\n self.revealTimeout = setTimeout(function () {\r\n // add class that launch animation\r\n self.slides[index].classList.add('active')\r\n\r\n // remove preparation classes\r\n self.slides[index].classList.remove('fadein')\r\n self.slides[index].classList.remove(direction)\r\n }, 45)\r\n },\r\n\r\n hideSlide: function (index, direction) {\r\n const self = this\r\n\r\n // must always add and remove 'active' classes at the same time\r\n this.hideTimeout = setTimeout(function () {\r\n // the classes that launch animation\r\n self.slides[index].classList.add('fadeout')\r\n self.slides[index].classList.add(direction)\r\n self.slides[index].classList.remove('active')\r\n }, 50)\r\n\r\n // remove when animation is over\r\n this.hideTimeout2 = setTimeout(function () {\r\n self.slides[index].classList.remove('fadeout')\r\n self.slides[index].classList.remove(direction)\r\n }, self.animTime)\r\n },\r\n\r\n startAutoSlide: function (speed) {\r\n const self = this\r\n this.sliderTimeout = setTimeout(function () {\r\n // unbind controls temporarily\r\n self.unbindControls()\r\n\r\n const newIndex = self.currentActiveIndex === self.slidesCount - 1 ? 0 : parseInt(self.currentActiveIndex) + 1\r\n self.hideSlide(self.currentActiveIndex, self.sliderAnimClasses.right)\r\n self.revealSlide(newIndex, self.sliderAnimClasses.right)\r\n self.currentActiveIndex = newIndex\r\n self.updateControls()\r\n self.updateAriaAttributes()\r\n\r\n // recall itself\r\n self.startAutoSlide(self.sliderAutoSpeed)\r\n }, speed, self)\r\n },\r\n\r\n stopAutoSlide: function () {\r\n clearTimeout(this.sliderTimeout)\r\n },\r\n\r\n preloadImages: function () {\r\n let timespan = 1\r\n let i = 0\r\n\r\n while (i <= this.slidesCount - 1) {\r\n const image = this.slides[i].querySelector('.lazy-slide')\r\n setTimeout(function () {\r\n if (image !== undefined && image !== null) {\r\n loadImage(image)\r\n }\r\n }, timespan)\r\n timespan += 1500\r\n ++i\r\n }\r\n }\r\n }\r\n\r\n jsSlider2.init()\r\n}\r\n\r\njsSlider2()","/* global $ */\r\n\r\n// Resize page elements on various events\r\n$(window).resize(function () {\r\n resizePageElems()\r\n resetElemsOnResize()\r\n})\r\n\r\nresizePageElems()\r\n\r\nexport function resizePageElems () {\r\n const windowWidth = $(window).width()\r\n const windowHeight = $(window).height()\r\n const smallSize = 700\r\n const mediumSize = 1000\r\n\r\n // Reduce the height of the main menu if to fit the viewport if not enough room\r\n const $menuWrapper = $('.hidden-menu__levels-wrapper')\r\n\r\n if (windowHeight < 800) {\r\n let heightToTakeOff = 50\r\n if (windowWidth < mediumSize) {\r\n heightToTakeOff = 50\r\n }\r\n $menuWrapper.css('height', windowHeight - heightToTakeOff - $('header').height())\r\n } else {\r\n $menuWrapper.css('height', 550)\r\n }\r\n\r\n // Program navigation same height as the program identification when medium and up\r\n const $topRightSide = $('#top-separated-right')\r\n $topRightSide.css('padding', 20)\r\n if (windowWidth > smallSize) {\r\n const leftSideHeight = $('#top-separated-left').height()\r\n const rightSideHeight = $topRightSide.height()\r\n\r\n if (rightSideHeight < leftSideHeight - 40) {\r\n const newPadding = (leftSideHeight - rightSideHeight) / 2\r\n $topRightSide.css('padding-top', newPadding)\r\n $topRightSide.css('padding-bottom', newPadding)\r\n }\r\n }\r\n\r\n // Previously in enquire.js\r\n if (windowWidth >= mediumSize) {\r\n $('#additional-content').prepend($('#top-additional-content'))\r\n // $(\"#main-content\").addClass(\"sync-height\");\r\n // $(\"#additional-content\").addClass(\"sync-height\");\r\n } else {\r\n $('#main-content').prepend($('#top-additional-content'))\r\n }\r\n\r\n $('.footer-navs .section-name').off('click')\r\n if (windowWidth < smallSize) {\r\n /* Show childs on mobile version */\r\n /* Show childs on mobile version */\r\n $('.footer-navs .section-name').on('click', function () {\r\n $(this).parents('nav').find('ul').slideToggle()\r\n })\r\n } else {\r\n $('.footer-navs nav ul').show()\r\n }\r\n}\r\n\r\nexport function resetElemsOnResize () {\r\n const windowWidth = $(window).width()\r\n const mediumSize = 1000\r\n\r\n if (windowWidth >= mediumSize) {\r\n $('.hidden-menu__level-3').css('left', '0%')\r\n $('.hidden-menu__level-4').css('left', '33.33%')\r\n $('.hidden-menu__level-3, .hidden-menu__level-4').hide()\r\n $('.hidden-menu').hide()\r\n $('body').css('overflow', 'inherit')\r\n $('.header__sub-meta-nav').hide()\r\n $('.main-nav .icon__close').addClass('icon__chevron--down').removeClass('icon__close')\r\n }\r\n}\r\n","/* global $ */\r\nimport { equalStr } from './cegep.utils'\r\nimport { resizePageElems } from './cegep.resize'\r\n\r\n// Défilement pour les ancres\r\nfunction scrollToAnchor (elem, speed) {\r\n const menuHeight = 70\r\n const targetHash = elem.attr('href')\r\n const targetName = targetHash.slice(1)\r\n const attributes = ['name', 'id'] // Compatibilité des 2 méthodes d'ancres\r\n\r\n for (let i = 0; i < attributes.length; i++) {\r\n $('[' + attributes[i] + ']').each(\r\n function () {\r\n if (equalStr($(this).attr(attributes[i]), targetName)) {\r\n $('html,body').animate({\r\n scrollTop: $(this).offset().top - menuHeight\r\n }, speed)\r\n fixIEscroll(targetHash)\r\n }\r\n })\r\n }\r\n}\r\n\r\n// Clic sur un onglet ou ancre\r\n$('a[href^=\"#\"]:not(.open-program-type):not([class^=\"show-\"]):not(.main-nav__top-level-link )').click(function (e) {\r\n e.preventDefault()\r\n window.location.hash = e.target.getAttribute('href').split('?')[0].slice(1)\r\n\r\n if (!$(this).hasClass('js-tab-trigger')) { // pas un onglet\r\n scrollToAnchor($(this), 600)\r\n }\r\n\r\n hideFromAnchor()\r\n resizePageElems()\r\n})\r\n\r\n// Masquer des éléments qui ont une classe identique à l'ancre dans l'URL\r\nfunction hideFromAnchor () {\r\n if (window.location.hash.length > 0) {\r\n const hash = window.location.hash.split('?')[0]\r\n $('.' + hash.slice(1)).each(function () {\r\n if (this.classList.value !== 'footer') {\r\n $(this).hide()\r\n }\r\n })\r\n }\r\n}\r\n\r\n(function () {\r\n hideFromAnchor()\r\n})()\r\n\r\n// CLEAR MAIN-MENU ON HASH NAV\r\n\r\n// Bugfix IE8 - IE10 (Repositionnement automatique après l'execution de tous les scripts)\r\nfunction fixIEscroll (hash) {\r\n if ($(window).scrollTop() === 0) {\r\n if (document.location.hash) {\r\n window.location = hash\r\n }\r\n }\r\n}\r\n\r\ndocument.onreadystatechange = function () {\r\n // Afficher la timeline dans les StaticPagesWithTabs\r\n $('.cd-horizontal-timeline').css('display', '')\r\n\r\n // Repositionner le scroll lors de hash requests\r\n if (window.location.hash) {\r\n if (document.readyState === 'complete') {\r\n const menuHeight = $('#main-nav').height()\r\n const hash = window.location.hash.split('?')[0]\r\n\r\n // Onglets\r\n $(window).on('load', function () {\r\n let foundHashMatch = false\r\n\r\n $('button[role=\"tab\"]').each(function () {\r\n if (equalStr('#' + $(this).attr('aria-controls'), hash)) {\r\n foundHashMatch = true\r\n fixIEscroll(hash)\r\n const yOffset = $(this).parent().offset().top - menuHeight\r\n $('html, body').animate({ scrollTop: yOffset }, 300)\r\n return false\r\n }\r\n })\r\n\r\n if (!foundHashMatch) {\r\n $('a[href^=\"#\"]').each(function () {\r\n if (equalStr($(this).attr('href'), hash)) {\r\n scrollToAnchor($(this), 0)\r\n }\r\n })\r\n }\r\n })\r\n\r\n // Liste de programmes\r\n $('h2[id^=\"sessions\"], h2[id^=\"diplomes\"], h2[id^=\"attestations\"], h2[id^=\"cours\"], h2[id^=\"reconnaissance\"], .program-type h3[id], .program-type h4[id]').each(\r\n function () {\r\n if (equalStr($(this).attr('id'), hash.substring(1))) {\r\n fixIEscroll(hash)\r\n const yOffset = $(this).parent().offset().top - menuHeight\r\n $(window).scrollTop(yOffset)\r\n }\r\n })\r\n\r\n hideFromAnchor()\r\n }\r\n }\r\n}\r\n\r\n// Afficher la timeline lors de navigation par onglets\r\n$('button[role=\"tab\"]').click(function () {\r\n $('.cd-horizontal-timeline').css('display', '')\r\n})\r\n","/* eslint-disable no-unused-expressions */\r\n/* globals $ */\r\n\r\n//\r\n// GOOGLE\r\n//\r\n\r\nexport function addGoogleTagManager (trackingCode) {\r\n (function (w, d, s, l, i) {\r\n w[l] = w[l] || []; w[l].push({\r\n 'gtm.start':\r\n new Date().getTime(),\r\n event: 'gtm.js'\r\n })\r\n const f = d.getElementsByTagName(s)[0]\r\n const j = d.createElement(s)\r\n const dl = l !== 'dataLayer' ? '&l=' + l : ''\r\n j.async = true\r\n j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl\r\n f.parentNode.insertBefore(j, f)\r\n })(window, document, 'script', 'dataLayer', trackingCode)\r\n}\r\n\r\nexport function trackForm (id, category, action, label) {\r\n const form = document.getElementById(id)\r\n form.addEventListener('submit', e => {\r\n e.preventDefault()\r\n\r\n if (!$(form).valid()) {\r\n return\r\n }\r\n\r\n const updatedLabel = typeof (label) === 'function' ? label() : label\r\n\r\n form.querySelector('[type=submit]').disabled = true\r\n pushEvent('form_tracking', category, action, updatedLabel)\r\n form.submit()\r\n })\r\n}\r\n\r\nexport function trackEventFromSelector (container, selector, category, action, label) {\r\n container.querySelectorAll(selector).forEach((elem) =>\r\n trackEvent('click', elem, category, action, label)\r\n )\r\n}\r\n\r\nexport function trackEvent (eventType, elem, category, action, label, isOnce = false) {\r\n elem.addEventListener(eventType,\r\n e => typeof (label) === 'function'\r\n ? pushEvent('custom_tracking', category, action, label(e))\r\n : pushEvent('custom_tracking', category, action, label),\r\n { once: isOnce })\r\n}\r\n\r\nfunction pushEvent (name, category, action, label) {\r\n if(window.dataLayer) {\r\n window.dataLayer.push({\r\n event: name,\r\n event_category: category,\r\n event_action: action,\r\n event_label: label\r\n })\r\n }\r\n}\r\n","/* global initCookieConsent Cookies */\r\n\r\nimport 'vanilla-cookieconsent'\r\nimport '../../plugins/js-cookie'\r\nimport { addGoogleTagManager } from '../../main/cegep.analytics'\r\n\r\nconst cc = initCookieConsent()\r\n\r\ncc.run({\r\n current_lang: 'fr',\r\n onAccept: () => addOrRemoveCookies(cc),\r\n onChange: () => refreshCookies(cc),\r\n languages: {\r\n en: {\r\n consent_modal: {\r\n title: 'Ce site web utilise des cookies',\r\n description: \"Ce site utilise des cookies pour am\\u00e9liorer votre exp\\u00e9rience et optimiser le fonctionnement du site. Vous pouvez accepter ces cookies en cliquant sur ' Autoriser tous les cookies ', cliquer sur ' Param\\u00e9trer les cookies ' pour g\\u00e9rer vos pr\\u00e9f\\u00e9rences de cookies.\",\r\n primary_btn: {\r\n text: 'Autoriser tous les cookies',\r\n role: 'accept_all' // 'accept_selected' or 'accept_all'\r\n },\r\n secondary_btn: {\r\n text: 'Param\\u00e9trer les cookies',\r\n role: 'settings' // 'settings' or 'accept_necessary'\r\n }\r\n },\r\n settings_modal: {\r\n title: 'Param\\u00e9trer les cookies',\r\n save_settings_btn: 'Sauvegarder param\\u00e8tre',\r\n accept_all_btn: 'Tout accepter',\r\n close_btn_label: 'Fermer',\r\n blocks: [\r\n {\r\n title: 'Utilisation des cookies',\r\n description: ''\r\n }, {\r\n title: 'Cookies strictement n\\u00e9cessaire',\r\n description: 'Ces cookies sont n\\u00e9cessaires au bon fonctionnement du site.',\r\n toggle: {\r\n value: 'necessary_cookies',\r\n enabled: true,\r\n readonly: true\r\n }\r\n }, {\r\n title: 'Cookies fonctionnels',\r\n description: \"Ces cookies nous permettent de d\\u00e9terminer l'historique des pages visit\\u00e9es\",\r\n toggle: {\r\n value: 'historique_cookies',\r\n enabled: true,\r\n readonly: false\r\n }\r\n },\r\n {\r\n title: 'Google Analytics',\r\n description: \"Ce cookie nous permet d'utiliser Google Analytics\",\r\n toggle: {\r\n value: 'analytics_cookies',\r\n enabled: true,\r\n readonly: false\r\n }\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n})\r\n\r\nfunction addOrRemoveCookies (cc) {\r\n if (cc.allowedCategory('historique_cookies')) {\r\n setHistoryCookie()\r\n } else {\r\n deleteHistoryCookie()\r\n }\r\n\r\n if (cc.allowedCategory('analytics_cookies')) {\r\n addGoogleTagManager(window.gtmTrackingCode)\r\n } else {\r\n deleteAnaltyicsCookies()\r\n }\r\n}\r\n\r\nfunction refreshCookies (cc) {\r\n if (cc.allowedCategory('historique_cookies')) {\r\n if (Cookies.get('history') === undefined) {\r\n setHistoryCookie()\r\n }\r\n } else {\r\n deleteHistoryCookie()\r\n }\r\n\r\n if (cc.allowedCategory('analytics_cookies')) {\r\n if (Cookies.get('_ga') === undefined) {\r\n addGoogleTagManager(window.gtmTrackingCode)\r\n }\r\n } else {\r\n deleteAnaltyicsCookies()\r\n }\r\n}\r\n\r\nfunction setHistoryCookie () {\r\n const nodeId = document.head.querySelector('meta[name=id]').content\r\n const historyVal = Cookies.get('history')\r\n const newHistory = historyVal === undefined ? nodeId : `${historyVal},${nodeId}`\r\n Cookies.set('history', newHistory, { sameSite: 'strict', secure: true })\r\n}\r\n\r\nfunction deleteHistoryCookie () {\r\n Cookies.remove('history', { path: '/' })\r\n}\r\n\r\nfunction deleteAnaltyicsCookies () {\r\n const analyticsCookies = ['_fbp', '_ga', '_gid']\r\n analyticsCookies.forEach(c => Cookies.remove(c, { path: '/' }))\r\n}\r\n","/* globals $ history */\r\n\r\n/*\r\n * manage expandable lists history state in URL\r\n * TODO : merge this function in the _manage expandable lists state_ function below this one\r\n */\r\n(function () {\r\n if ($('.js-expandable-button').length > 0) {\r\n var windowLocation = window.location.toString()\r\n var hashPosition = windowLocation.indexOf('#')\r\n\r\n if (hashPosition !== -1) {\r\n $(window).on(\"load\", function () {\r\n var programType = (windowLocation.substring(hashPosition)).split('?')[0]\r\n var parentTabPanel = $(programType).closest('[role=\"tabpanel\"]')\r\n var parentTabPanelId = ''\r\n var parentListItems = $(programType).parents('.expandable-list__item')\r\n\r\n if ($(programType).closest('.js-expandable-button').length > 0) {\r\n // Open parent tabpanel if necessary\r\n if (parentTabPanel.length > 0) {\r\n parentTabPanelId = parentTabPanel.attr('id')\r\n $('button[aria-controls=\"' + parentTabPanelId + '\"]').trigger('click')\r\n }\r\n\r\n // Open parent expandable-list if necessary\r\n if (parentListItems.length > 1) {\r\n $(parentListItems[1]).children('.js-expandable-button').trigger('click')\r\n setTimeout(function () {\r\n $(programType).closest('.js-expandable-button').trigger('click')\r\n }, 500)\r\n } else {\r\n // Open current expandable-list\r\n $(programType).closest('.js-expandable-button').trigger('click')\r\n }\r\n }\r\n })\r\n }\r\n\r\n $('.js-expandable-button').click(function () {\r\n var programTitle = $(this).find('.expandable-list__item-title').attr('id')\r\n\r\n var newLocation = windowLocation\r\n\r\n if (newLocation.indexOf('#') != -1) {\r\n newLocation = newLocation.substring(0, newLocation.indexOf('#'))\r\n }\r\n\r\n if ($(this).next('.program-type-inside, .course-type-inside').css('display') === 'none') {\r\n history.replaceState({ path: this.path }, '', newLocation + '#' + programTitle)\r\n } else {\r\n history.replaceState({ path: this.path }, '', newLocation)\r\n }\r\n })\r\n }\r\n})();\r\n\r\n/*\r\n * manage expandable lists state\r\n */\r\n(function () {\r\n var expandableButtons = document.querySelectorAll('.js-expandable-button')\r\n\r\n if (expandableButtons.lenth <= 0) {\r\n return\r\n }\r\n\r\n for (var i = 0; i < expandableButtons.length; i++) {\r\n expandableButtons[i].addEventListener('click', function (event) {\r\n var trigger = event.currentTarget\r\n var targetId = trigger.getAttribute('aria-controls')\r\n var targetEl = document.getElementById(targetId)\r\n var parent = trigger.parentNode\r\n\r\n if (targetEl == null || typeof targetEl === 'undefined') {\r\n return\r\n }\r\n\r\n if (targetEl.classList.contains('expanded')) {\r\n trigger.classList.remove('active')\r\n trigger.setAttribute('aria-expanded', 'false')\r\n $(targetEl).slideUp().removeClass('expanded')\r\n\r\n if (parent.classList.contains('expandable-list__subitem')) {\r\n parent.classList.remove('expanded')\r\n }\r\n } else {\r\n trigger.classList.add('active')\r\n trigger.setAttribute('aria-expanded', 'true')\r\n $(targetEl).slideDown().addClass('expanded')\r\n\r\n if (parent.classList.contains('expandable-list__subitem')) {\r\n parent.classList.add('expanded')\r\n }\r\n }\r\n })\r\n }\r\n})();\r\n\r\n/*\r\n * manage expandable lists close buttons\r\n */\r\n(function () {\r\n var expandableCloseButtons = document.querySelectorAll('.js-close-expandable-list')\r\n\r\n if (expandableCloseButtons.length <= 0) {\r\n return\r\n }\r\n\r\n for (var i = 0; i < expandableCloseButtons.length; i++) {\r\n expandableCloseButtons[i].addEventListener('click', function (event) {\r\n var trigger = event.currentTarget\r\n var targetId = trigger.getAttribute('data-close')\r\n var targetEl = document.getElementById(targetId)\r\n var targetButton = document.querySelector('[aria-controls=\"' + targetId + '\"]')\r\n\r\n if (targetEl == null || typeof targetEl === 'undefined' ||\r\n targetButton == null || typeof targetButton === 'undefined') {\r\n return\r\n }\r\n\r\n targetButton.classList.remove('active')\r\n targetButton.setAttribute('aria-expanded', 'false')\r\n $(targetEl).slideUp().removeClass('expanded')\r\n })\r\n }\r\n})()\r\n","/* global $ */\r\nconst windowWidth = $(window).width()\r\nconst largeSize = 1280\r\n\r\n// Scroll to program search\r\n$('#scroll-program-search').click(function (e) {\r\n e.preventDefault()\r\n const whereTo = $('#program-search').offset().top\r\n $('html, body').animate({\r\n scrollTop: whereTo\r\n }, 400)\r\n})\r\n\r\n// Programs Filtering\r\n$('#full-search-form input[type=checkbox]').change(function () {\r\n if ($(this).is(':checked')) {\r\n $(this).parent().addClass('selected')\r\n } else {\r\n $(this).parent().removeClass('selected')\r\n }\r\n})\r\n\r\n$('#program-search input[type=submit]').click(function (e) {\r\n e.preventDefault()\r\n showProgramsBasedOnFiltering()\r\n})\r\n\r\nfunction showProgramsBasedOnFiltering () {\r\n const programsHolder = $('#program-types')\r\n\r\n programsHolder.find('.program').removeClass('expandable-list__subitem--filtered-out')\r\n programsHolder.find('.course').removeClass('expandable-list__subitem--filtered-out')\r\n\r\n $('#full-search-form input[type=checkbox].int-check:checked').each(function () {\r\n programsHolder.find('.program').not('.int-' + $(this).val()).addClass('expandable-list__subitem--filtered-out')\r\n programsHolder.find('.course').not('.int-' + $(this).val()).addClass('expandable-list__subitem--filtered-out')\r\n })\r\n\r\n $('#full-search-form input[type=checkbox].part-check:checked').each(function () {\r\n programsHolder.find('.program').not('.part-' + $(this).val()).addClass('expandable-list__subitem--filtered-out')\r\n programsHolder.find('.course').not('.part-' + $(this).val()).addClass('expandable-list__subitem--filtered-out')\r\n })\r\n\r\n const selectedCampus = $('#full-search-form #location').val()\r\n if (selectedCampus !== '' && selectedCampus !== '0') {\r\n programsHolder.find('.program').not('.campus-' + selectedCampus).addClass('expandable-list__subitem--filtered-out')\r\n programsHolder.find('.course').not('.campus-' + selectedCampus).addClass('expandable-list__subitem--filtered-out')\r\n }\r\n\r\n const selectedPeriod = $('#full-search-form #period').val()\r\n if (selectedPeriod !== '' && selectedPeriod !== '0') {\r\n programsHolder.find('.program').not('.period-' + selectedPeriod).addClass('expandable-list__subitem--filtered-out')\r\n programsHolder.find('.course').not('.period-' + selectedPeriod).addClass('expandable-list__subitem--filtered-out')\r\n }\r\n\r\n $(programsHolder.find('.program-type')).each(function () {\r\n const nbChildrenPrograms = $(this).find('.program:not(\\'.expandable-list__subitem--filtered-out\\')').length\r\n const nbChildrenCourses = $(this).find('.course:not(\\'.expandable-list__subitem--filtered-out\\')').length\r\n\r\n $(this).find('.js-program-total-nb').html(nbChildrenPrograms + nbChildrenCourses)\r\n })\r\n\r\n $(programsHolder.find('.program-type-category')).each(function () {\r\n const nbChildrenPrograms = $(this).find('.program:not(\\'.expandable-list__subitem--filtered-out\\')').length\r\n const nbChildrenCourses = $(this).find('.course:not(\\'.expandable-list__subitem--filtered-out\\')').length\r\n\r\n $(this).find('.js-program-total-nb').html(nbChildrenPrograms + nbChildrenCourses)\r\n })\r\n\r\n $(programsHolder.find('.metadomain-title')).each(function () {\r\n const nbChildrenPrograms = $(this).next('.expandable-list').find('.program:not(\\'.expandable-list__subitem--filtered-out\\')').length\r\n const nbChildrenCourses = $(this).next('.expandable-list').find('.course:not(\\'.expandable-list__subitem--filtered-out\\')').length\r\n\r\n $(this).find('.js-program-total-nb').html(nbChildrenPrograms + nbChildrenCourses)\r\n })\r\n\r\n if (windowWidth < largeSize) {\r\n const scrollTo = $('#main-content').position().top\r\n $('html, body').animate({\r\n scrollTop: scrollTo\r\n })\r\n }\r\n}\r\n\r\n// Shows and hides the course info from a course\r\n$('.open-course-infos').click(function () {\r\n $(this).parents('.session-course').find('.course-infos').slideToggle()\r\n $(this).parents('.session-course').toggleClass('course-open')\r\n $('.course-infos').each(function () {\r\n $(this).css('padding-left', $(this).parent().find('.course-identification').position().left - 30)\r\n })\r\n return false\r\n})\r\n\r\n// Course ponderation legend\r\n\r\n// Single Trigger for Programs Page\r\n$('.course-ponderation-trigger-single').hover(function () {\r\n const courseLeft = $(this).position().left + $(this).width() - 20\r\n const courseTop = $(this).position().top - 20\r\n\r\n $('#ponderation-holder').css('top', courseTop)\r\n $('#ponderation-holder').css('left', courseLeft)\r\n $('#ponderation-holder').show()\r\n}, function () {\r\n $('#ponderation-holder').hide()\r\n})\r\n\r\n// Related Triger for Courses in macro\r\n$('.course-ponderation-trigger').hover(function () {\r\n const elem = $(this).parents('.session-courses').find('.ponderation-holder')\r\n const courseLeft = $(this).position().left + $(this).width() - 20\r\n const courseTop = $(this).position().top - 20\r\n\r\n elem.css('top', courseTop)\r\n elem.css('left', courseLeft)\r\n elem.show()\r\n}, function () {\r\n const elem = $(this).parents('.session-courses').find('.ponderation-holder')\r\n elem.hide()\r\n})\r\n","/* global HTMLElement */\r\n\r\nfunction addMobileTableData () {\r\n const tables = document.querySelectorAll('table')\r\n if (tables.length <= 0) return\r\n\r\n const cellsToModify = []\r\n\r\n tables.forEach(t => generateHeaderDataFromTable(t, cellsToModify))\r\n\r\n cellsToModify.forEach(td => td.headers === null\r\n ? td.element !== null && td.element.classList.add('hide-for-xsmall')\r\n : td.element.setAttribute('data-mobile', td.headers))\r\n}\r\n\r\nfunction generateHeaderDataFromTable (table, cellsToModify) {\r\n const rows = [...table.querySelectorAll('tr')]\r\n const tableWidth = foldColSpan([...rows[0].children])\r\n const colHeaders = getColumnHeaders(rows, tableWidth)\r\n const rowHeaders = getRowHeaders(rows)\r\n const irregularHeaders = getIrregularHeaders(rows)\r\n const cells = [...table.querySelectorAll('td')]\r\n\r\n cells.forEach(c => cellsToModify.push(\r\n addHeaderDataToCell(c, tableWidth, irregularHeaders, colHeaders, rowHeaders))\r\n )\r\n}\r\n\r\nfunction addHeaderDataToCell (cell, tableWidth, irregularHeaders, columnHeaders, rowHeaders) {\r\n if (cell.innerText.trim() === '') return { element: cell, headers: null }\r\n\r\n const relatedIdHeaders = getRelatedIdHeaders(cell, irregularHeaders)\r\n const relatedColHeaders = relatedIdHeaders.length > 0 ? [] : getRelatedColumnHeaders(cell, columnHeaders, tableWidth)\r\n const relatedRowHeaders = relatedIdHeaders.length > 0 ? [] : getRelatedRowHeaders(cell, rowHeaders)\r\n const relatedHeaders = relatedIdHeaders.concat(relatedColHeaders).concat(relatedRowHeaders)\r\n\r\n if (relatedHeaders.length > 0) {\r\n const flatenedHeaders = (relatedHeaders.map(h => h.innerText)).join(' ')\r\n if (flatenedHeaders.length > 0) return { element: cell, headers: flatenedHeaders }\r\n }\r\n\r\n return { element: null, headers: null }\r\n}\r\n\r\nfunction getColumnHeaders (rows, tableWidth) {\r\n const columnHeaders = rows.filter(r => {\r\n const siblings = [...r.children]\r\n const siblingsWithoutFirst = siblings.slice(1, siblings.length)\r\n\r\n return foldColSpan(siblings) === tableWidth &&\r\n siblingsWithoutFirst.every(x => x.tagName === 'TH')\r\n })\r\n\r\n return columnHeaders <= 0\r\n ? []\r\n : columnHeaders.flatMap(r => [...r.children].filter(h =>\r\n h.getAttribute('scope') !== 'colgroup' &&\r\n h.innerText.replace(' ', '').trim() !== ''))\r\n}\r\n\r\nfunction getRelatedColumnHeaders (cell, columnHeaders, tableWidth) {\r\n const cellColIndex = cell.colIndex(tableWidth)\r\n return columnHeaders.filter(h => {\r\n const headerColIndex = h.colIndex(tableWidth)\r\n return headerColIndex === cellColIndex ||\r\n headerColIndex + parseInt(h.getAttribute('colspan')) - 1 === cellColIndex\r\n })\r\n}\r\n\r\nfunction getRowHeaders (rows) {\r\n return [...rows.filter(r =>\r\n r.firstElementChild.tagName === 'TH' &&\r\n r.children.length > 1 &&\r\n r.querySelectorAll('th').length === 1)]\r\n .flatMap(rh => rh.querySelector('th'))\r\n}\r\n\r\nfunction getRelatedRowHeaders (cell, rowHeaders) {\r\n return rowHeaders.filter(h =>\r\n h.parentElement === cell.parentElement ||\r\n (cell.parentElement.querySelector('th') === null && findPreviousMergedRowElement(cell) === h))\r\n}\r\n\r\nfunction getIrregularHeaders (rows) {\r\n return rows.flatMap(r => [...r.querySelectorAll('th[id]')]).filter(h => h !== null)\r\n}\r\n\r\nfunction getRelatedIdHeaders (cell, headers) {\r\n const cellHeaders = cell.getAttribute('headers') !== null &&\r\n cell.getAttribute('headers').split(' ')\r\n return headers\r\n .filter(h => cellHeaders && cellHeaders.includes(h.id))\r\n .sort((a, b) => cellHeaders.indexOf(a.id) > cellHeaders.indexOf(b.id) ? 1 : -1)\r\n}\r\n\r\nfunction foldColSpan (arr) {\r\n return arr.reduce((acc, n) => n.getAttribute('colspan') === null\r\n ? acc + 1\r\n : acc + parseInt(n.getAttribute('colspan')), 0)\r\n}\r\n\r\nfunction foldRowSpan (arr) {\r\n return arr.reduce((acc, n) => n.getAttribute('rowspan') === null\r\n ? acc + 1\r\n : acc + parseInt(n.getAttribute('rowspan')), 0)\r\n}\r\n\r\nfunction findPreviousMergedRowElement (cell) {\r\n const mergedRow = cell.parentElement.previousSiblings().find(e => e.querySelector('[rowspan]'))\r\n return mergedRow && mergedRow.querySelector('[rowspan]')\r\n}\r\n\r\nHTMLElement.prototype.getRowOffset = function () {\r\n const mergedCell = findPreviousMergedRowElement(this)\r\n return mergedCell !== null\r\n ? parseInt(mergedCell.getAttribute('rowspan'))\r\n : 0\r\n}\r\n\r\nHTMLElement.prototype.getColOffset = function () {\r\n const previousParentSiblings = this.parentElement.previousSiblings()\r\n return previousParentSiblings.reduce((acc, e) => e.querySelector('[rowspan]') !== null ? acc + 1 : acc, 0)\r\n}\r\n\r\nHTMLElement.prototype.rowIndex = function () {\r\n return foldRowSpan(this.parentElement.previousSiblings()) + 1\r\n}\r\n\r\nHTMLElement.prototype.colIndex = function (tableWidth = 0) {\r\n const offset = foldColSpan([...this.parentElement.children]) < tableWidth\r\n ? this.getColOffset()\r\n : 0\r\n\r\n return foldColSpan(this.previousSiblings()) + offset + 1\r\n}\r\n\r\nHTMLElement.prototype.previousSiblings = function () {\r\n const siblings = [...this.parentElement.children]\r\n const elementIndex = siblings.indexOf(this)\r\n return siblings.slice(0, elementIndex)\r\n}\r\n\r\naddMobileTableData()\r\n// debug.getExecTime(addMobileTableData)\r\n","/*! jQuery UI - v1.10.3 - 2013-07-09\r\n* http://jqueryui.com\r\n* Includes: jquery.ui.effect.js\r\n* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */\r\n\r\n(function(t,e){var i=\"ui-effects-\";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||\"rgba\";return h?(o=s[l](h),s[c[l].cache]=o[c[l].cache],n=s._rgba=o._rgba,!1):e}),n.length?(\"0,0,0,0\"===n.join()&&t.extend(n,a.transparent),s):a[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var a,o=\"backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor\",r=/^([\\-+])=\\s*(\\d+\\.?\\d*)/,h=[{re:/rgba?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*(?:,\\s*(\\d?(?:\\.\\d+)?)\\s*)?\\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\\(\\s*(\\d+(?:\\.\\d+)?)\\%\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*(?:,\\s*(\\d?(?:\\.\\d+)?)\\s*)?\\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\\(\\s*(\\d+(?:\\.\\d+)?)\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*(?:,\\s*(\\d?(?:\\.\\d+)?)\\s*)?\\)/,space:\"hsla\",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:\"byte\"},green:{idx:1,type:\"byte\"},blue:{idx:2,type:\"byte\"}}},hsla:{props:{hue:{idx:0,type:\"degrees\"},saturation:{idx:1,type:\"percent\"},lightness:{idx:2,type:\"percent\"}}}},u={\"byte\":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t(\"\")[0],f=t.each;p.style.cssText=\"background-color:rgba(1,1,1,.5)\",d.rgba=p.style.backgroundColor.indexOf(\"rgba\")>-1,f(c,function(t,e){e.cache=\"_\"+t,e.props.alpha={idx:3,type:\"percent\",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,o,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(o),o=e);var u=this,d=t.type(n),p=this._rgba=[];return o!==e&&(n=[n,o,r,h],d=\"array\"),\"string\"===d?this.parse(s(n)||a._default):\"array\"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):\"object\"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var a=s.cache;f(s.props,function(t,e){if(!u[a]&&s.to){if(\"alpha\"===t||null==n[t])return;u[a]=s.to(u._rgba)}u[a][e.idx]=i(n[t],e,!0)}),u[a]&&0>t.inArray(null,u[a].slice(0,3))&&(u[a][3]=1,s.from&&(u._rgba=s.from(u[a])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),a=c[n],o=0===this.alpha()?l(\"transparent\"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(t,n){var a=n.idx,o=r[a],l=s[a],c=u[n.type]||{};null!==l&&(null===o?h[a]=l:(c.mod&&(l-o>c.mod/2?o+=c.mod:o-l>c.mod/2&&(o-=c.mod)),h[a]=i((l-o)*e+o,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e=\"rgba(\",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e=\"rgb(\"),e+i.join()+\")\"},toHslaString:function(){var e=\"hsla(\",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+\"%\"),t});return 1===i[3]&&(i.pop(),e=\"hsl(\"),e+i.join()+\")\"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),\"#\"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?\"0\"+t:t}).join(\"\")},toString:function(){return 0===this._rgba[3]?\"transparent\":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],a=t[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,e+1/3)),Math.round(255*n(r,o,e)),Math.round(255*n(r,o,e-1/3)),a]},f(c,function(s,n){var a=n.props,o=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===e)return this[o].slice();var n,r=t.type(s),u=\"array\"===r||\"object\"===r?s:arguments,d=this[o].slice();return f(a,function(t,e){var s=u[\"object\"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[o]=d,n):l(d)},f(a,function(e,i){l.fn[e]||(l.fn[e]=function(n){var a,o=t.type(n),h=\"alpha\"===e?this._hsla?\"hsla\":\"rgba\":s,l=this[h](),c=l[i.idx];return\"undefined\"===o?c:(\"function\"===o&&(n=n.call(this,c),o=t.type(n)),null==n&&i.empty?this:(\"string\"===o&&(a=r.exec(n),a&&(n=c+parseFloat(a[2])*(\"+\"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(\" \");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var a,o,r=\"\";if(\"transparent\"!==n&&(\"string\"!==t.type(n)||(a=s(n)))){if(n=l(a||n),!d.rgba&&1!==n._rgba[3]){for(o=\"backgroundColor\"===i?e.parentNode:e;(\"\"===r||\"transparent\"===r)&&o&&o.style;)try{r=t.css(o,\"backgroundColor\"),o=o.parentNode}catch(h){}n=n.blend(r&&\"transparent\"!==r?r:\"_default\")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(o),t.cssHooks.borderColor={expand:function(t){var e={};return f([\"Top\",\"Right\",\"Bottom\",\"Left\"],function(i,s){e[\"border\"+s+\"Color\"]=t}),e}},a=t.Color.names={aqua:\"#00ffff\",black:\"#000000\",blue:\"#0000ff\",fuchsia:\"#ff00ff\",gray:\"#808080\",green:\"#008000\",lime:\"#00ff00\",maroon:\"#800000\",navy:\"#000080\",olive:\"#808000\",purple:\"#800080\",red:\"#ff0000\",silver:\"#c0c0c0\",teal:\"#008080\",white:\"#ffffff\",yellow:\"#ffff00\",transparent:[null,null,null,0],_default:\"#ffffff\"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],\"string\"==typeof n[i]&&(a[t.camelCase(i)]=n[i]);else for(i in n)\"string\"==typeof n[i]&&(a[i]=n[i]);return a}function s(e,i){var s,n,o={};for(s in i)n=i[s],e[s]!==n&&(a[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var n=[\"add\",\"remove\",\"toggle\"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each([\"borderLeftStyle\",\"borderRightStyle\",\"borderBottomStyle\",\"borderTopStyle\"],function(e,i){t.fx.step[i]=function(t){(\"none\"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,a,o,r){var h=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr(\"class\")||\"\",l=h.children?o.find(\"*\").addBack():o;l=l.map(function(){var e=t(this);return{el:e,start:i(this)}}),a=function(){t.each(n,function(t,i){e[i]&&o[i+\"Class\"](e[i])})},a(),l=l.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),o.attr(\"class\",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,\"\")})}),h.complete.call(o[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,a){return s?t.effects.animateClass.call(this,{add:i},s,n,a):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,a){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,a):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,a,o,r){return\"boolean\"==typeof n||n===e?a?t.effects.animateClass.call(this,n?{add:s}:{remove:s},a,o,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,a,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),(\"number\"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:\"number\"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||\"number\"==typeof e||t.fx.speeds[e]?!0:\"string\"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:\"object\"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:\"1.10.3\",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,a;for(a=0;s.length>a;a++)null!==s[a]&&(n=t.data(i+s[a]),n===e&&(n=\"\"),t.css(s[a],n))},setMode:function(t,e){return\"toggle\"===e&&(e=t.is(\":hidden\")?\"show\":\"hide\"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case\"top\":i=0;break;case\"middle\":i=.5;break;case\"bottom\":i=1;break;default:i=t[0]/e.height}switch(t[1]){case\"left\":s=0;break;case\"center\":s=.5;break;case\"right\":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(\".ui-effects-wrapper\"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),\"float\":e.css(\"float\")},s=t(\"
\").addClass(\"ui-effects-wrapper\").css({fontSize:\"100%\",background:\"transparent\",border:\"none\",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),\"static\"===e.css(\"position\")?(s.css({position:\"relative\"}),e.css({position:\"relative\"})):(t.extend(i,{position:e.css(\"position\"),zIndex:e.css(\"z-index\")}),t.each([\"top\",\"left\",\"bottom\",\"right\"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]=\"auto\")}),e.css({position:\"relative\",top:0,left:0,right:\"auto\",bottom:\"auto\"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(\".ui-effects-wrapper\")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(a)&&a.call(n[0]),t.isFunction(e)&&e()}var n=t(this),a=i.complete,r=i.mode;(n.is(\":hidden\")?\"hide\"===r:\"show\"===r)?(n[r](),s()):o.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,a=i.queue,o=t.effects.effect[i.effect];return t.fx.off||!o?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a===!1?this.each(e):this.queue(a||\"fx\",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode=\"show\",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode=\"hide\",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||\"boolean\"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode=\"toggle\",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each([\"em\",\"px\",\"%\",\"pt\"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each([\"Quad\",\"Cubic\",\"Quart\",\"Quint\",\"Expo\"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing[\"easeIn\"+e]=i,t.easing[\"easeOut\"+e]=function(t){return 1-i(1-t)},t.easing[\"easeInOut\"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()})(jQuery);","/* global $ */\r\n\r\n// Resize page elements on various events\r\n$(window).resize(function () {\r\n resizePageElems()\r\n resetElemsOnResize()\r\n})\r\n\r\nresizePageElems()\r\n\r\nexport function resizePageElems () {\r\n const windowWidth = $(window).width()\r\n const windowHeight = $(window).height()\r\n const smallSize = 700\r\n const mediumSize = 1000\r\n\r\n // Reduce the height of the main menu if to fit the viewport if not enough room\r\n const $menuWrapper = $('.hidden-menu__levels-wrapper')\r\n\r\n if (windowHeight < 800) {\r\n let heightToTakeOff = 50\r\n if (windowWidth < mediumSize) {\r\n heightToTakeOff = 50\r\n }\r\n $menuWrapper.css('height', windowHeight - heightToTakeOff - $('header').height())\r\n } else {\r\n $menuWrapper.css('height', 550)\r\n }\r\n\r\n // Program navigation same height as the program identification when medium and up\r\n const $topRightSide = $('#top-separated-right')\r\n $topRightSide.css('padding', 20)\r\n if (windowWidth > smallSize) {\r\n const leftSideHeight = $('#top-separated-left').height()\r\n const rightSideHeight = $topRightSide.height()\r\n\r\n if (rightSideHeight < leftSideHeight - 40) {\r\n const newPadding = (leftSideHeight - rightSideHeight) / 2\r\n $topRightSide.css('padding-top', newPadding)\r\n $topRightSide.css('padding-bottom', newPadding)\r\n }\r\n }\r\n\r\n // Previously in enquire.js\r\n if (windowWidth >= mediumSize) {\r\n $('#additional-content').prepend($('#top-additional-content'))\r\n // $(\"#main-content\").addClass(\"sync-height\");\r\n // $(\"#additional-content\").addClass(\"sync-height\");\r\n } else {\r\n $('#main-content').prepend($('#top-additional-content'))\r\n }\r\n\r\n $('.footer-navs .section-name').off('click')\r\n if (windowWidth < smallSize) {\r\n /* Show childs on mobile version */\r\n /* Show childs on mobile version */\r\n $('.footer-navs .section-name').on('click', function () {\r\n $(this).parents('nav').find('ul').slideToggle()\r\n })\r\n } else {\r\n $('.footer-navs nav ul').show()\r\n }\r\n}\r\n\r\nexport function resetElemsOnResize () {\r\n const windowWidth = $(window).width()\r\n const mediumSize = 1000\r\n\r\n if (windowWidth >= mediumSize) {\r\n $('.hidden-menu__level-3').css('left', '0%')\r\n $('.hidden-menu__level-4').css('left', '33.33%')\r\n $('.hidden-menu__level-3, .hidden-menu__level-4').hide()\r\n $('.hidden-menu').hide()\r\n $('body').css('overflow', 'inherit')\r\n $('.header__sub-meta-nav').hide()\r\n $('.main-nav .icon__close').addClass('icon__chevron--down').removeClass('icon__close')\r\n }\r\n}\r\n","/* global $ */\r\nimport { resetElemsOnResize } from './cegep.resize'\r\n\r\nconst smallSize = 700\r\nconst mediumSize = 982\r\n\r\nbindEscapeKey()\r\n\r\n// Append hidden menus in complete main nav\r\nconst $hiddenMenus = $('#hidden-menus-holder').html()\r\n$('#main-nav').after($hiddenMenus)\r\n$('#hidden-menus-holder').remove()\r\n\r\n// Show sub level navs\r\n$('.js-open-main-nav').click(function () {\r\n openMainNav()\r\n return false\r\n})\r\n\r\n$('.js-show-level-2').click(function () {\r\n let theme = $(this).parent().attr('data-theme')\r\n const spaceIndex = theme.indexOf(' ')\r\n\r\n if (spaceIndex !== -1) {\r\n theme = theme.substring(0, spaceIndex)\r\n }\r\n\r\n if ($(window).width() >= mediumSize) {\r\n showLevel2($('.international-hidden-menu--' + theme), '.international-hidden--menu')\r\n\r\n closeAllFlyouts()\r\n\r\n const $activeMenu = this\r\n\r\n $('.js-show-level-2').each(function (e, elem) {\r\n if ($activeMenu === elem && $(this).find('.icon__chevron--down').length) {\r\n $(this).find('.icon__chevron--down').addClass('icon__close')\r\n $(this).find('.icon__chevron--down').removeClass('icon__chevron--down')\r\n $(this).closest('.main-nav__elem').addClass('active')\r\n } else {\r\n $(this).find('.icon__close').addClass('icon__chevron--down')\r\n $(this).find('.icon__close').removeClass('icon__close')\r\n $(this).closest('.main-nav__elem').removeClass('active')\r\n }\r\n })\r\n } else {\r\n showLevel2($('.hidden-menu--' + theme), '.hidden-menu')\r\n }\r\n\r\n return false\r\n})\r\n\r\n// Show sub meta nav\r\n$('.with-submenu').click(function (e) {\r\n e.preventDefault()\r\n const buttonHtml = $(this).html()\r\n $('.header__sub-meta-nav').each(function () {\r\n if ($(this).parent().find('a:first').html() !== buttonHtml && $(this).css('display') !== 'none') {\r\n $(this).parent().find('a:first').removeClass('submenu-opened')\r\n $(this).hide()\r\n }\r\n })\r\n if ($(this).parent().find('.header__sub-meta-nav').css('display') === 'none') {\r\n $(this).addClass('submenu-opened')\r\n if ($(window).width() >= smallSize && $(window).width() < mediumSize && $('.logo .show-for-large-up').css('display') === 'none') {\r\n $('.logo').hide()\r\n }\r\n $(this).parent().find('.header__sub-meta-nav').fadeIn(300)\r\n } else {\r\n $(this).removeClass('submenu-opened')\r\n $(this).parent().find('.header__sub-meta-nav').fadeOut(300)\r\n setTimeout(function () {\r\n $('.logo').show()\r\n }, 150)\r\n }\r\n\r\n return false\r\n})\r\n\r\n// Menu does not close when it is clicked\r\n$('.hidden-menu').click(function (e) {\r\n e.stopPropagation()\r\n})\r\n\r\n$('.hidden-menu__level-2 .js-back-menu-link').click(function () {\r\n goBackMenu($(this), 2)\r\n return false\r\n})\r\n\r\nfunction openMainNav () {\r\n const $navButton = $('.js-open-main-nav')\r\n const $mainNav = $('.main-nav')\r\n\r\n $('body').off('click')\r\n $navButton.off('click')\r\n $navButton.addClass('js-close-main-nav')\r\n\r\n if (!$('.active2').length) {\r\n $mainNav.css('left', -$(window).width())\r\n $mainNav.show()\r\n $mainNav.animate({\r\n left: 0\r\n }, 300)\r\n }\r\n\r\n if ($('#hidden-menus').find('.active-panel').length) {\r\n $('#hidden-menus')\r\n .find('.active-panel')\r\n .each(function () {\r\n showLevel2($(this).closest('.hidden-menu'), '.hidden-menu')\r\n })\r\n } else if ($('#hidden-menus').find('.active2').length) {\r\n showLevel2($($('#hidden-menus').find('.active2').closest('.hidden-menu', '.hidden-menu')))\r\n }\r\n\r\n $navButton.click(function () {\r\n closeMainNav()\r\n return false\r\n })\r\n}\r\n\r\nexport function closeMainNav () {\r\n const $navButton = $('.js-open-main-nav')\r\n const $mainNav = $('.main-nav')\r\n\r\n $navButton.unbind('click')\r\n $navButton.removeClass('js-close-main-nav')\r\n\r\n $('.hidden-menu').each(function () {\r\n if ($(this).css('display') !== 'none') {\r\n if ($(window).width() >= mediumSize) {\r\n $(this).slideToggle(300, 'easeOutQuart')\r\n } else {\r\n $(this).animate({\r\n left: '100%'\r\n }, 300, 'easeOutQuart', $(this).hide())\r\n }\r\n\r\n $(this).css('display', 'none')\r\n }\r\n })\r\n\r\n $mainNav.animate({\r\n left: -$(window).width()\r\n }, 300, function () {\r\n $mainNav.hide()\r\n })\r\n\r\n $navButton.click(function () {\r\n openMainNav()\r\n return false\r\n })\r\n}\r\n\r\nfunction goBackMenu ($backBtn, level) {\r\n const $menu = $backBtn.parent().parent().parent()\r\n let $elementToClose = $menu\r\n const $mainNav = $('.main-nav')\r\n let leftClose = '0'\r\n const closeTimer = 0\r\n let themeName = ''\r\n let $focusTarget = null\r\n\r\n $mainNav.css('left', 0)\r\n $mainNav.show()\r\n\r\n // Change variables based on level\r\n if (level === 2) {\r\n $elementToClose = $menu.closest('.hidden-menu')\r\n themeName = $menu.closest('.hidden-menu').attr('id')\r\n $focusTarget = $('.main-nav__elem[data-theme=\"' + themeName + '\"] .js-show-level-2')\r\n }\r\n\r\n // Change the leftClose value for small size, regardless of level\r\n if ($(window).width() < mediumSize) {\r\n leftClose = '100%'\r\n }\r\n\r\n // if level2 and >= mediumWidth, use same pattern as when using the close icon\r\n if (level === 2 && $(window).width() >= mediumSize) {\r\n showLevel2($('.hidden-menu--' + themeName))\r\n\r\n $('.main-nav .icon__close').each(function () {\r\n $(this).addClass('icon__chevron--down')\r\n $(this).removeClass('icon__close')\r\n $(this).closest('.main-nav__elem').removeClass('active')\r\n })\r\n } else if (level === 2) {\r\n setTimeout(function () {\r\n $menu.removeClass('active-panel')\r\n $elementToClose.animate({ left: leftClose }, 300, function () {\r\n $elementToClose.hide()\r\n })\r\n }, closeTimer)\r\n } else {\r\n setTimeout(function () {\r\n $menu.removeClass('active-panel')\r\n const $toClose = $elementToClose.parent().parent().parent()\r\n $toClose.animate({ left: leftClose }, 300, function () {\r\n $(this).hide()\r\n })\r\n }, closeTimer)\r\n }\r\n\r\n // set focus manually to previous button\r\n $focusTarget[0].focus()\r\n}\r\n\r\nfunction showLevel2 ($menuToShow, $selector) {\r\n let timer = 0\r\n const timer2 = 0\r\n\r\n $('body').off('click')\r\n\r\n setTimeout(function () {\r\n // Close any open level 2 menu\r\n $($selector).each(function () {\r\n if ($(this).css('display') !== 'none') {\r\n if ($(window).width() >= mediumSize) {\r\n $(this).slideToggle(300, 'easeOutQuart')\r\n } else {\r\n $(this).animate({\r\n left: '100%'\r\n }, 300, 'easeOutQuart', $(this).hide())\r\n }\r\n timer = 500\r\n } else if ($(this).css('display') !== 'none' && $(this).attr('id') === $menuToShow.attr('id')) {\r\n $('.close-level-2-menu').removeClass('close-level-2-menu')\r\n }\r\n })\r\n\r\n setTimeout(function () {\r\n // Open the desired menu\r\n if ($(window).width() >= mediumSize) {\r\n if ($menuToShow.css('display') === 'none') {\r\n $menuToShow.slideDown(300, 'easeInQuart')\r\n $menuToShow[0].setAttribute('tabindex', '-1')\r\n $menuToShow[0].focus()\r\n } else {\r\n $menuToShow.slideUp(300, 'easeInQuart')\r\n }\r\n } else {\r\n $menuToShow.css('left', '100%')\r\n $menuToShow.show()\r\n $menuToShow.animate({\r\n left: '0%'\r\n }, 300, 'easeInQuart')\r\n $menuToShow.find('.js-back-menu-link button')[0].focus()\r\n }\r\n }, timer)\r\n }, timer2)\r\n\r\n // Close menu on page click\r\n $('body').click(function () {\r\n if ($(window).width() < mediumSize) {\r\n closeMainNav()\r\n } else {\r\n closeAllFlyouts()\r\n }\r\n\r\n $($selector).each(function () {\r\n if ($(this).css('display') !== 'none' && $(this).attr('id') === $menuToShow.attr('id')) {\r\n if ($(window).width() >= smallSize) {\r\n $(this).slideToggle(300, 'easeOutQuart')\r\n } else {\r\n $(this).animate({\r\n left: '100%'\r\n }, 300, 'easeOutQuart', $(this).hide())\r\n }\r\n timer = 500\r\n }\r\n })\r\n $('.icon__close').each(function () {\r\n $(this).addClass('icon__chevron--down')\r\n $(this).removeClass('icon__close')\r\n $(this).closest('.main-nav__elem').removeClass('active')\r\n })\r\n $('.js-show-level-2').each(function () {\r\n $(this).children().find('.icon__close').addClass('icon__chevron--down')\r\n $(this).children().find('.icon__chevron--down').removeClass('icon__close')\r\n $(this).closest('.main-nav__elem').addClass('active')\r\n })\r\n })\r\n}\r\n\r\nfunction bindEscapeKey () {\r\n const mediumSize = 1000\r\n\r\n $(document).keyup(function (e) {\r\n if (e.keyCode === 27) {\r\n if ($(window).width() < mediumSize) {\r\n closeMainNav()\r\n if ($('#main-nav').css('display') === 'block') {\r\n $('.js-open-main-nav')[0].focus()\r\n }\r\n } else {\r\n $('.hidden-menu').each(function () {\r\n if ($(this).css('display') === 'block') {\r\n const themeName = $(this).attr('id')\r\n const $focusTarget = $('.main-nav__elem[data-theme=\"' + themeName + '\"] .js-show-level-2')\r\n $focusTarget[0].focus()\r\n return false\r\n }\r\n })\r\n resetElemsOnResize()\r\n }\r\n }\r\n })\r\n}\r\n\r\nfunction closeAllFlyouts () {\r\n $('.international-hidden-menu').each(function (i) {\r\n $(this).slideUp(300, 'easeInQuart')\r\n })\r\n}\r\n\r\n// Fermer le menu de page lors du clic sur un bouton\r\nconst landingNavBtn = document.querySelectorAll('.page-nav .main-nav__top-level-link')\r\nlandingNavBtn.forEach(btn => btn.addEventListener('click', closeMainNav))\r\n","/* global $ */\r\n// form-styling\r\n\r\n// select elements tweaks\r\nconst $selectElements = $('select')\r\n\r\nif ($selectElements.length > 0) {\r\n $selectElements.wrap('')\r\n $selectElements.after('')\r\n}\r\n\r\n// checkbox and radio elements tweaks\r\nconst $labels = $('input[type=checkbox]~label, input[type=radio]~label')\r\n\r\nif ($labels.length > 0) {\r\n $labels.wrapInner('')\r\n}\r\n\r\nexport function toggleIfChecked (checkbox, elem) {\r\n if (checkbox.checked) {\r\n elem.classList.remove('hide')\r\n } else {\r\n elem.classList.add('hide')\r\n }\r\n}\r\n\r\nexport function toggleIfRbSelected (elemId, options) {\r\n const elem = document.getElementById(elemId)\r\n\r\n if (options.true.checked) {\r\n elem.classList.add('hide')\r\n } else if (options.false.checked) {\r\n elem.classList.remove('hide')\r\n }\r\n}\r\n\r\nexport function setupBoolRbs (elemId, optionTrueId, optionFalseId, func = toggleIfRbSelected, args = []) {\r\n const options = {\r\n true: document.getElementById(optionTrueId),\r\n false: document.getElementById(optionFalseId)\r\n }\r\n\r\n for (const option in options) {\r\n options[option].addEventListener('change', () => func(elemId, options, ...args))\r\n }\r\n\r\n func(elemId, options, ...args)\r\n return options\r\n}\r\n\r\nexport function saveCheckboxValuesToTextfield (checkboxes, textField) {\r\n textField.value = checkboxes\r\n .filter(cb => cb.checked)\r\n .map(cb => cb.value)\r\n .join(', ')\r\n}\r\n","/* global $ */\r\nimport './plugins/lazyload'\r\nimport './main/cegep.anchors'\r\nimport './international/main/spk.slider'\r\nimport './international/main/cegep.cookieconsent'\r\nimport './main/spk.expandable'\r\nimport './main/cegep.trainings'\r\nimport './main/cegep.responsive-tables'\r\nimport './plugins/share'\r\nimport './plugins/jquery-ui-1.10.3.custom.min'\r\nimport './international/main/cegep.menu'\r\nimport './international/main/cegep.resize'\r\nimport './main/cegep.forms'\r\n\r\n// Adds a class to html for mobile and non-mobile\r\nif (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {\r\n $('html').addClass('mobile')\r\n} else {\r\n $('html').addClass('non-mobile')\r\n}\r\n"],"sourceRoot":""}