{"version":3,"file":"bvi.js","sources":["../../node_modules/regenerator-runtime/runtime.js","../../src/js/util/index.js","../../src/js/util/cookie.js","../../src/js/i18n.js","../../src/js/bvi.js","../../src/js/index.umd.js"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","/**\n * --------------------------------------------------------------------------\n * Button visually impaired (v1.0.0): util/index.js\n * Licensed under MIT (https://github.com/veks/button-visually-impaired-javascript/blob/master/LICENSE.md)\n * --------------------------------------------------------------------------\n */\n\n(function (arr) {\n arr.forEach(function (item) {\n if (item.hasOwnProperty('prepend')) {\n return\n }\n Object.defineProperty(item, 'prepend', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: function prepend () {\n var argArr = Array.prototype.slice.call(arguments),\n docFrag = document.createDocumentFragment()\n\n argArr.forEach(function (argItem) {\n var isNode = argItem instanceof Node\n docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)))\n })\n\n this.insertBefore(docFrag, this.firstChild)\n },\n })\n })\n})([Element.prototype, Document.prototype, DocumentFragment.prototype])\n\nif (window.NodeList && !NodeList.prototype.forEach) {\n NodeList.prototype.forEach = Array.prototype.forEach\n}\n\nif (window.HTMLCollection && !HTMLCollection.prototype.forEach) {\n HTMLCollection.prototype.forEach = Array.prototype.forEach\n}\n\nconst toType = obj => {\n if (obj === null || obj === undefined) {\n return `${obj}`\n }\n\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase()\n}\n\nconst isElement = obj => {\n if (!obj || typeof obj !== 'object') {\n return false\n }\n\n return typeof obj.nodeType !== 'undefined'\n}\n\nconst checkConfig = (config, configTypes, configOptions) => {\n Object.keys(configTypes).forEach(key => {\n const expectedTypes = configTypes[key]\n const value = config[key]\n const valueType = value && isElement(value) ? 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new TypeError(\n `Bvi console: Опция \"${key}\" предоставленный тип \"${valueType}\", ожидаемый тип \"${expectedTypes}\".`,\n )\n }\n })\n\n Object.keys(configOptions).forEach(key => {\n const expectedOptions = configOptions[key]\n const value = config[key]\n\n if (!new RegExp(expectedOptions).test(value)) {\n throw new TypeError(\n `Bvi console: Опция \"${key}\" параметр \"${value}\", ожидаемый параметр \"${expectedOptions}\".`,\n )\n }\n })\n}\n\nconst plural = (number, text = ['пиксель', 'пекселя', 'пикселей']) => {\n if (number % 10 === 1 && number % 100 !== 11) {\n return `${number} ${text[0]}`\n } else if (number % 10 >= 2 && number % 10 <= 4 && (number % 100 < 10 || number % 100 >= 20)) {\n return `${number} ${text[1]}`\n } else {\n return `${number} ${text[2]}`\n }\n}\n\nconst stringToBoolean = string => {\n switch (string) {\n case 'on':\n case 'true':\n case '1':\n return true\n default:\n return false\n }\n}\n\nconst wrapInner = (parent, wrapper, className) => {\n if (typeof wrapper === 'string') {\n wrapper = document.createElement(wrapper)\n }\n\n parent.appendChild(wrapper).className = className\n\n while (parent.firstChild !== wrapper) {\n wrapper.appendChild(parent.firstChild)\n }\n}\n\nconst unwrap = wrapper => {\n let docFrag = document.createDocumentFragment()\n\n if (!wrapper) return\n\n while (wrapper.firstChild) {\n let child = wrapper.removeChild(wrapper.firstChild)\n docFrag.appendChild(child)\n }\n\n wrapper.parentNode.replaceChild(docFrag, wrapper)\n}\n\nconst getObject = (object, callback) => {\n Object.keys(object).forEach(key => {\n if (typeof callback === 'function') {\n callback(key)\n }\n })\n}\n\nconst getArray = (array, callback) => {\n Array.from(array).forEach(key => {\n if (typeof callback === 'function') {\n callback(key)\n }\n })\n}\n\nconst inArray = (needle, haystack) => {\n let length = haystack.length\n\n for (let i = 0; i < length; i++) {\n if (haystack[i] === needle) {\n return true\n }\n }\n\n return false\n}\n\nconst synth = () => window.speechSynthesis\n\nconst synthSupportBrowser = () => {\n return 'speechSynthesis' in window\n}\n\nexport {\n plural,\n checkConfig,\n stringToBoolean,\n wrapInner,\n unwrap,\n getObject,\n getArray,\n synth,\n synthSupportBrowser,\n inArray,\n}\n","/**\n * --------------------------------------------------------------------------\n * Button visually impaired (v1.0.0): util/cookie.js\n * Licensed under MIT (https://github.com/veks/button-visually-impaired-javascript/blob/master/LICENSE.md)\n * --------------------------------------------------------------------------\n */\n\nconst setCookie = function (name = '', value = '') {\n let now = new Date();\n let time = now.getTime();\n time += 24 * 60 * 60 * 1000;\n now.setTime(time);\n document.cookie = `bvi_${name}=${value};path=/;expires=${now.toUTCString()};domain=${location.host}`;\n};\n\nconst getCookie = function (name = '') {\n name = `bvi_${name}=`;\n let decodedCookie = decodeURIComponent(document.cookie);\n let cookies = decodedCookie.split(';');\n\n for (let i = 0; i < cookies.length; i++) {\n let cookie = cookies[i].trim();\n\n if (cookie.indexOf(name) !== -1) {\n return cookie.substring(name.length, cookie.length);\n }\n }\n};\n\nconst removeCookie = function (name = '') {\n document.cookie = `bvi_${name}=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain=${location.host}`;\n};\n\nexport {\n setCookie,\n getCookie,\n removeCookie,\n};\n","/**\n * --------------------------------------------------------------------------\n * Button visually impaired (v1.0.0): i18n.js\n * Licensed under MIT (https://github.com/veks/button-visually-impaired-javascript/blob/master/LICENSE.md)\n * --------------------------------------------------------------------------\n */\n\nconst lang = {\n 'ru-RU': {\n 'text': {\n 'fontSize': 'Размер шрифта',\n 'siteColors': 'Цвета сайта',\n 'images': 'Изображения',\n 'speech': 'Синтез речи',\n 'settings': 'Настройки',\n 'regularVersionOfTheSite': 'Обычная версия сайта',\n 'letterSpacing': 'Межбуквенное расстояние',\n 'normal': 'Стандартный',\n 'average': 'Средний',\n 'big': 'Большой',\n 'lineHeight': 'Межстрочный интервал',\n 'font': 'Шрифт',\n 'arial': 'Без засечек',\n 'times': 'С засечками',\n 'builtElements': 'Встроенные элементы (Видео, карты и тд.)',\n 'on': 'Включить',\n 'off': 'Выключить',\n 'reset': 'Сбросить настройки',\n 'plural_0': 'пиксель',\n 'plural_1': 'пекселя',\n 'plural_2': 'пикселей',\n },\n 'voice': {\n 'fontSizePlus': 'Размер шрифта увели́чен',\n 'fontSizeMinus': 'Размер шрифта уме́ньшен',\n 'siteColorBlackOnWhite': 'Цвет сайта черным по белому',\n 'siteColorWhiteOnBlack': 'Цвет сайта белым по черному',\n 'siteColorDarkBlueOnBlue': 'Цвет сайта тёмно-синим по голубому',\n 'siteColorBeigeBrown': 'Цвет сайта кори́чневым по бе́жевому',\n 'siteColorGreenOnDarkBrown': 'Цвет сайта зеленым по тёмно-коричневому',\n 'imagesOn': 'Изображения включены',\n 'imagesOFF': 'Изображения выключены',\n 'imagesGrayscale': 'Изображения чёрно-белые',\n 'speechOn': 'Синтез речи включён',\n 'speechOff': 'Синтез речи вы́ключен',\n 'lineHeightNormal': 'Межстрочный интервал стандартный',\n 'lineHeightAverage': 'Межстрочный интервал средний',\n 'lineHeightBig': 'Межстрочный интервал большой',\n 'LetterSpacingNormal': 'Интервал между буквами стандартный',\n 'LetterSpacingAverage': 'Интервал между буквами средний',\n 'LetterSpacingBig': 'Интервал между буквами большой',\n 'fontArial': 'Шрифт без засечек',\n 'fontTimes': 'Шрифт с засечками',\n 'builtElementsOn': 'Встроенные элементы включены',\n 'builtElementsOFF': 'Встроенные элементы выключены',\n 'resetSettings': 'Установлены настройки по умолча́нию',\n 'panelShow': 'Панель открыта',\n 'panelHide': 'Панель скрыта',\n 'panelOn': 'Версия сайта для слабови́дящий',\n 'panelOff': 'Обычная версия сайта',\n }\n },\n 'en-US': {\n 'text': {\n 'fontSize': 'Font size',\n 'siteColors': 'Site colors',\n 'images': 'Images',\n 'speech': 'Speech synthesis',\n 'settings': 'Settings',\n 'regularVersionOfTheSite': 'Regular version Of The site',\n 'letterSpacing': 'Letter spacing',\n 'normal': 'Single',\n 'average': 'One and a half',\n 'big': 'Double',\n 'lineHeight': 'Line spacing',\n 'font':'Font',\n 'arial': 'Sans Serif - Arial',\n 'times': 'Serif - Times New Roman',\n 'builtElements': 'Include inline elements (Videos, maps, etc.)',\n 'on': 'Enable',\n 'off': 'Disabled',\n 'reset': 'Reset settings',\n 'plural_0': 'pixel',\n 'plural_1': 'pixels',\n 'plural_2': 'pixels',\n },\n 'voice': {\n 'fontSizePlus': 'Font size increased',\n 'fontSizeMinus': 'Font size reduced',\n 'siteColorBlackOnWhite': 'Site color black on white',\n 'siteColorWhiteOnBlack': 'Site color white on black',\n 'siteColorDarkBlueOnBlue': 'Site color dark blue on cyan',\n 'siteColorBeigeBrown': 'SiteColorBeigeBrown',\n 'siteColorGreenOnDarkBrown': 'Site color green on dark brown',\n 'imagesOn': 'Images enable',\n 'imagesOFF': 'Images disabled',\n 'imagesGrayscale': 'Images gray scale',\n 'speechOn': 'Synthesis speech enable',\n 'speechOff': 'Synthesis speech disabled',\n 'lineHeightNormal': 'Line spacing single',\n 'lineHeightAverage': 'Line spacing one and a half',\n 'lineHeightBig': 'Line spacing double',\n 'LetterSpacingNormal': 'Letter spacing single',\n 'LetterSpacingAverage': 'Letter spacing one and a half',\n 'LetterSpacingBig': 'Letter spacing letter double',\n 'fontArial': 'Sans Serif - Arial',\n 'fontTimes': 'Serif - Times New Roman',\n 'builtElementsOn': 'Include inline elements are enabled',\n 'builtElementsOFF': 'Include inline elements are disabled',\n 'resetSettings': 'Default settings have been set',\n 'panelShow': 'Panel show',\n 'panelHide': 'Panel hide',\n 'panelOn': 'Site version for visually impaired',\n 'panelOff': 'Regular version of the site',\n }\n }\n}\n\nclass I18n {\n constructor(options) {\n this._config = options\n }\n\n t(key) {\n return lang[this._config.lang]['text'][key]\n }\n\n v(key) {\n return lang[this._config.lang]['voice'][key]\n }\n}\n\nexport default I18n\n","/**\n * --------------------------------------------------------------------------\n * Button visually impaired (v1.0.0): bvi.js\n * Licensed under MIT (https://github.com/veks/button-visually-impaired-javascript/blob/master/LICENSE.md)\n * --------------------------------------------------------------------------\n */\n\nimport {\n checkConfig,\n stringToBoolean,\n wrapInner,\n unwrap,\n getObject,\n getArray,\n synth,\n} from './util'\n\nimport {\n setCookie,\n getCookie,\n removeCookie,\n} from './util/cookie'\nimport I18n from './i18n'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst Default = {\n target: '.bvi-open',\n fontSize: 16,\n theme: 'white',\n images: 'grayscale',\n letterSpacing: 'normal',\n lineHeight: 'normal',\n speech: true,\n fontFamily: 'arial',\n builtElements: false,\n panelFixed: true,\n panelHide: false,\n reload: false,\n lang: 'ru-RU',\n}\n\nconst DefaultType = {\n target: 'string',\n fontSize: 'number',\n theme: 'string',\n images: '(string|boolean)',\n letterSpacing: 'string',\n lineHeight: 'string',\n speech: 'boolean',\n fontFamily: 'string',\n builtElements: 'boolean',\n panelFixed: 'boolean',\n panelHide: 'boolean',\n reload: 'boolean',\n lang: 'string',\n}\n\nconst DefaultOptions = {\n target: '',\n fontSize: '(^[1-9]$|^[1-3][0-9]?$|^39$)',\n theme: '(white|black|blue|brown|green)',\n images: '(true|false|grayscale)',\n letterSpacing: '(normal|average|big)',\n lineHeight: '(normal|average|big)',\n speech: '(true|false)',\n fontFamily: '(arial|times)',\n builtElements: '(true|false)',\n panelFixed: '(true|false)',\n panelHide: '(true|false)',\n reload: '(true|false)',\n lang: '(ru-RU|en-US)',\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\nclass Bvi {\n constructor(options) {\n this._config = this._getConfig(options)\n this._elements = document.querySelectorAll(this._config.target)\n this._i18n = new I18n({\n lang: this._config.lang\n })\n\n this._addEventListeners()\n this._init()\n\n console.log('Bvi console: ready Button visually impaired v1.0.0')\n }\n\n // Private\n\n _init() {\n getObject(this._config, key => {\n if (typeof getCookie(key) === 'undefined') {\n removeCookie('panelActive')\n }\n })\n\n if (stringToBoolean(getCookie('panelActive'))) {\n this._set()\n this._getPanel()\n this._addEventListenersPanel()\n this._images()\n this._speechPlayer()\n\n if ('speechSynthesis' in window && stringToBoolean(getCookie('speech'))) {\n\n setInterval(() => {\n if (synth().pending === false) {\n let play = document.querySelectorAll('.bvi-speech-play')\n let pause = document.querySelectorAll('.bvi-speech-pause')\n let resume = document.querySelectorAll('.bvi-speech-resume')\n let stop = document.querySelectorAll('.bvi-speech-stop')\n const el = (elements, callback) => {\n elements.forEach(element => {\n return callback(element)\n })\n }\n\n el(play, element => element.classList.remove('disabled'))\n el(pause, element => element.classList.add('disabled'))\n el(resume, element => element.classList.add('disabled'))\n el(stop, element => element.classList.add('disabled'))\n }\n }, 1000)\n }\n\n } else {\n this._remove()\n }\n }\n\n _addEventListeners() {\n if (!this._elements) {\n return false\n }\n\n this._elements.forEach(element => {\n element.addEventListener('click', event => {\n event.preventDefault()\n\n getObject(this._config, key => setCookie(key, this._config[key]))\n setCookie('panelActive', true)\n\n this._init()\n this._speech(`${this._i18n.v('panelOn')}`)\n })\n })\n\n }\n\n _addEventListenersPanel() {\n const elements = {\n fontSizeMinus: document.querySelector('.bvi-fontSize-minus'),\n fontSizePlus: document.querySelector('.bvi-fontSize-plus'),\n themeWhite: document.querySelector('.bvi-theme-white'),\n themeBlack: document.querySelector('.bvi-theme-black'),\n themeBlue: document.querySelector('.bvi-theme-blue'),\n themeBrown: document.querySelector('.bvi-theme-brown'),\n themeGreen: document.querySelector('.bvi-theme-green'),\n imagesOn: document.querySelector('.bvi-images-on'),\n imagesOff: document.querySelector('.bvi-images-off'),\n imagesGrayscale: document.querySelector('.bvi-images-grayscale'),\n speechOn: document.querySelector('.bvi-speech-on'),\n speechOff: document.querySelector('.bvi-speech-off'),\n lineHeightNormal: document.querySelector('.bvi-line-height-normal'),\n lineHeightAverage: document.querySelector('.bvi-line-height-average'),\n lineHeightBig: document.querySelector('.bvi-line-height-big'),\n letterSpacingNormal: document.querySelector('.bvi-letter-spacing-normal'),\n letterSpacingAverage: document.querySelector('.bvi-letter-spacing-average'),\n letterSpacingBig: document.querySelector('.bvi-letter-spacing-big'),\n fontFamilyArial: document.querySelector('.bvi-font-family-arial'),\n fontFamilyTimes: document.querySelector('.bvi-font-family-times'),\n builtElementsOn: document.querySelector('.bvi-built-elements-on'),\n builtElementsOff: document.querySelector('.bvi-built-elements-off'),\n reset: document.querySelector('.bvi-reset'),\n links: document.querySelectorAll('.bvi-link'),\n modal: document.querySelector('.bvi-modal')\n }\n\n const activeLink = element => {\n for (let sibling of element.parentNode.children) {\n sibling.classList.remove('active')\n }\n\n element.classList.add('active')\n }\n\n const click = (element, callback) => {\n element.addEventListener('click', event => {\n event.preventDefault()\n\n if (typeof callback === 'function') {\n callback(event)\n }\n })\n }\n\n const activeAll = () => {\n let links = document.querySelectorAll('.bvi-link')\n\n links.forEach(link => {\n link.classList.remove('active')\n })\n\n getObject(this._config, key => {\n if (key === 'theme') {\n let value = getCookie(key)\n document.querySelector(`.bvi-theme-${value}`).classList.add('active')\n }\n\n if (key === 'images') {\n let value = getCookie(key) === 'grayscale' ? 'grayscale' : stringToBoolean(getCookie(key)) ? 'on' : 'off'\n\n document.querySelector(`.bvi-images-${value}`).classList.add('active')\n }\n\n if (key === 'speech') {\n let value = stringToBoolean(getCookie(key)) ? 'on' : 'off'\n\n document.querySelector(`.bvi-speech-${value}`).classList.add('active')\n }\n\n if (key === 'lineHeight') {\n let value = getCookie(key)\n\n document.querySelector(`.bvi-line-height-${value}`).classList.add('active')\n }\n\n if (key === 'letterSpacing') {\n let value = getCookie(key)\n\n document.querySelector(`.bvi-letter-spacing-${value}`).classList.add('active')\n }\n\n if (key === 'fontFamily') {\n let value = getCookie(key)\n\n document.querySelector(`.bvi-font-family-${value}`).classList.add('active')\n }\n\n if (key === 'builtElements') {\n let value = stringToBoolean(getCookie(key)) ? 'on' : 'off'\n\n document.querySelector(`.bvi-built-elements-${value}`).classList.add('active')\n }\n })\n }\n\n activeAll()\n\n // Font size\n click(elements.fontSizeMinus, () => {\n let size = parseFloat(getCookie('fontSize')) - 1\n\n if (size !== 0) {\n this._setAttrDataBviBody('fontSize', size)\n setCookie('fontSize', size)\n this._speech(`${this._i18n.v('fontSizeMinus')}`)\n activeLink(elements.fontSizeMinus)\n }\n })\n\n click(elements.fontSizePlus, () => {\n let size = parseFloat(getCookie('fontSize')) + 1\n\n if (size !== 40) {\n this._setAttrDataBviBody('fontSize', size)\n setCookie('fontSize', size)\n this._speech(`${this._i18n.v('fontSizePlus')}`)\n activeLink(elements.fontSizePlus)\n }\n })\n\n // Theme\n click(elements.themeWhite, () => {\n this._setAttrDataBviBody('theme', 'white')\n setCookie('theme', 'white')\n this._speech(`${this._i18n.v('siteColorBlackOnWhite')}`)\n activeLink(elements.themeWhite)\n })\n\n click(elements.themeBlack, () => {\n this._setAttrDataBviBody('theme', 'black')\n setCookie('theme', 'black')\n this._speech(`${this._i18n.v('siteColorWhiteOnBlack')}`)\n activeLink(elements.themeBlack)\n })\n\n click(elements.themeBlue, () => {\n this._setAttrDataBviBody('theme', 'blue')\n setCookie('theme', 'blue')\n this._speech(`${this._i18n.v('siteColorDarkBlueOnBlue')}`)\n activeLink(elements.themeBlue)\n })\n\n click(elements.themeBrown, () => {\n this._setAttrDataBviBody('theme', 'brown')\n setCookie('theme', 'brown')\n this._speech(`${this._i18n.v('siteColorBeigeBrown')}`)\n activeLink(elements.themeBrown)\n })\n\n click(elements.themeGreen, () => {\n this._setAttrDataBviBody('theme', 'green')\n setCookie('theme', 'green')\n this._speech(`${this._i18n.v('siteColorGreenOnDarkBrown')}`)\n activeLink(elements.themeGreen)\n })\n\n // Images\n click(elements.imagesOn, () => {\n this._setAttrDataBviBody('images', 'true')\n setCookie('images', 'true')\n this._speech(`${this._i18n.v('imagesOn')}`)\n activeLink(elements.imagesOn)\n })\n\n click(elements.imagesOff, () => {\n this._setAttrDataBviBody('images', 'false')\n setCookie('images', 'false')\n this._speech(`${this._i18n.v('imagesOFF')}`)\n activeLink(elements.imagesOff)\n })\n\n click(elements.imagesGrayscale, () => {\n this._setAttrDataBviBody('images', 'grayscale')\n setCookie('images', 'grayscale')\n this._speech(`${this._i18n.v('imagesGrayscale')}`)\n activeLink(elements.imagesGrayscale)\n })\n\n // Speech\n click(elements.speechOn, () => {\n this._setAttrDataBviBody('speech', 'true')\n setCookie('speech', 'true')\n this._speech(`${this._i18n.v('speechOn')}`)\n activeLink(elements.speechOn)\n this._speechPlayer()\n })\n\n click(elements.speechOff, () => {\n this._speech(`${this._i18n.v('speechOff')}`)\n this._setAttrDataBviBody('speech', 'false')\n setCookie('speech', 'false')\n activeLink(elements.speechOff)\n this._speechPlayer()\n })\n\n // Line height\n click(elements.lineHeightNormal, () => {\n this._setAttrDataBviBody('lineHeight', 'normal')\n setCookie('lineHeight', 'normal')\n this._speech(`${this._i18n.v('lineHeightNormal')}`)\n activeLink(elements.lineHeightNormal)\n })\n\n click(elements.lineHeightAverage, () => {\n this._setAttrDataBviBody('lineHeight', 'average')\n setCookie('lineHeight', 'average')\n this._speech(`${this._i18n.v('lineHeightAverage')}`)\n activeLink(elements.lineHeightAverage)\n })\n\n click(elements.lineHeightBig, () => {\n this._setAttrDataBviBody('lineHeight', 'big')\n setCookie('lineHeight', 'big')\n this._speech(`${this._i18n.v('lineHeightBig')}`)\n activeLink(elements.lineHeightBig)\n })\n\n // Letter spacing\n click(elements.letterSpacingNormal, () => {\n this._setAttrDataBviBody('letterSpacing', 'normal')\n setCookie('letterSpacing', 'normal')\n this._speech(`${this._i18n.v('LetterSpacingNormal')}`)\n activeLink(elements.letterSpacingNormal)\n })\n\n click(elements.letterSpacingAverage, () => {\n this._setAttrDataBviBody('letterSpacing', 'average')\n setCookie('letterSpacing', 'average')\n this._speech(`${this._i18n.v('LetterSpacingAverage')}`)\n activeLink(elements.letterSpacingAverage)\n })\n\n click(elements.letterSpacingBig, () => {\n this._setAttrDataBviBody('letterSpacing', 'big')\n setCookie('letterSpacing', 'big')\n this._speech(`${this._i18n.v('LetterSpacingBig')}`)\n activeLink(elements.letterSpacingBig)\n })\n\n // Font family\n click(elements.fontFamilyArial, () => {\n this._setAttrDataBviBody('fontFamily', 'arial')\n setCookie('fontFamily', 'arial')\n this._speech(`${this._i18n.v('fontArial')}`)\n activeLink(elements.fontFamilyArial)\n })\n\n click(elements.fontFamilyTimes, () => {\n this._setAttrDataBviBody('fontFamily', 'times')\n setCookie('fontFamily', 'times')\n this._speech(`${this._i18n.v('fontTimes')}`)\n activeLink(elements.fontFamilyTimes)\n })\n\n // Built elements\n click(elements.builtElementsOn, () => {\n this._setAttrDataBviBody('builtElements', 'true')\n setCookie('builtElements', 'true')\n this._speech(`${this._i18n.v('builtElementsOn')}`)\n activeLink(elements.builtElementsOn)\n })\n\n click(elements.builtElementsOff, () => {\n this._setAttrDataBviBody('builtElements', 'false')\n setCookie('builtElements', 'false')\n this._speech(`${this._i18n.v('builtElementsOFF')}`)\n activeLink(elements.builtElementsOff)\n })\n\n // Reset\n click(elements.reset, () => {\n this._speech(`${this._i18n.v('resetSettings')}`)\n getObject(this._config, key => {\n this._setAttrDataBviBody(key, this._config[key])\n setCookie(key, this._config[key])\n activeAll()\n })\n })\n\n getArray(elements.links, element => {\n click(element, event => {\n let target = event.target.getAttribute('data-bvi')\n\n if (target === 'close') {\n this._setAttrDataBviBody('panelActive', 'false')\n setCookie('panelActive', 'false')\n this._init()\n }\n\n if (target === 'modal') {\n document.body.style.overflow = 'hidden'\n document.body.classList.add('bvi-noscroll')\n elements.modal.classList.toggle('show')\n }\n\n if (target === 'modal-close') {\n document.body.classList.remove('bvi-noscroll')\n document.body.style.overflow = ''\n elements.modal.classList.remove('show')\n }\n\n if (target === 'panel-hide') {\n document.querySelector('.bvi-panel').classList.add('bvi-panel-hide')\n document.querySelector('.bvi-link-fixed-top').classList.remove('bvi-hide')\n document.querySelector('.bvi-link-fixed-top').classList.add('bvi-show')\n setCookie('panelHide', 'true')\n this._speech(`${this._i18n.v('panelHide')}`)\n }\n\n if (target === 'panel-show') {\n document.querySelector('.bvi-link-fixed-top').classList.remove('bvi-show')\n document.querySelector('.bvi-link-fixed-top').classList.add('bvi-hide')\n document.querySelector('.bvi-panel').classList.remove('bvi-panel-hide')\n setCookie('panelHide', 'false')\n this._speech(`${this._i18n.v('panelShow')}`)\n }\n })\n })\n\n click(elements.modal, event => {\n if (event.target.contains(elements.modal)) {\n document.body.classList.remove('bvi-noscroll')\n document.body.style.overflow = ''\n elements.modal.classList.remove('show')\n }\n })\n }\n\n _getPanel() {\n const scroll = () => {\n let scroll = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop\n\n if (stringToBoolean(getCookie('panelFixed'))) {\n if (scroll > 200) {\n document.querySelector('.bvi-panel').classList.add('bvi-fixed-top')\n } else {\n document.querySelector('.bvi-panel').classList.remove('bvi-fixed-top')\n }\n }\n }\n\n let panelHide = stringToBoolean(getCookie('panelHide')) ? ' bvi-panel-hide' : ''\n let linkHide = !stringToBoolean(getCookie('panelHide')) ? ' bvi-hide' : 'bvi-show'\n let html = `\n