vgapp 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,15 @@ import BaseModule from "../../base-module";
|
|
|
2
2
|
import {Manipulator} from "../../../utils/js/dom/manipulator";
|
|
3
3
|
import EventHandler from "../../../utils/js/dom/event";
|
|
4
4
|
import VGModal from "../../vgmodal/js/vgmodal";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
execute,
|
|
7
|
+
isObject,
|
|
8
|
+
isVisible,
|
|
9
|
+
makeRandomString,
|
|
10
|
+
mergeDeepObject,
|
|
11
|
+
noop,
|
|
12
|
+
normalizeData
|
|
13
|
+
} from "../../../utils/js/functions";
|
|
6
14
|
import Selectors from "../../../utils/js/dom/selectors";
|
|
7
15
|
import VGCollapse from "../../vgcollapse/js/vgcollapse";
|
|
8
16
|
import {getSVG} from "../../module-fn";
|
|
@@ -41,7 +49,8 @@ class VGFormSender extends BaseModule {
|
|
|
41
49
|
},
|
|
42
50
|
alert: {
|
|
43
51
|
enabled: true,
|
|
44
|
-
type: 'modal'
|
|
52
|
+
type: 'modal',
|
|
53
|
+
errors: true,
|
|
45
54
|
},
|
|
46
55
|
ajax: {
|
|
47
56
|
route: '',
|
|
@@ -82,7 +91,9 @@ class VGFormSender extends BaseModule {
|
|
|
82
91
|
this._element.classList.add(this._params.classes.general);
|
|
83
92
|
|
|
84
93
|
[... Selectors.findAll('input, textarea, select', this._element)].forEach((el) => {
|
|
85
|
-
el
|
|
94
|
+
if (isVisible(el)) {
|
|
95
|
+
el.parentElement.classList.add(this._params.classes.content)
|
|
96
|
+
}
|
|
86
97
|
});
|
|
87
98
|
|
|
88
99
|
if (this._params.validate) {
|
|
@@ -367,17 +378,17 @@ class VGFormSender extends BaseModule {
|
|
|
367
378
|
if (typeof response !== 'string') {
|
|
368
379
|
if (!('view' in response)) {
|
|
369
380
|
if ('title' in response) title = response.title;
|
|
370
|
-
if (status === 'error' && data.code !== 200) {
|
|
381
|
+
if (status === 'error' && data.code !== 200 && this._params.alert.errors) {
|
|
371
382
|
code = ' ' + data.text + ' (' + data.code + ')';
|
|
372
383
|
}
|
|
373
384
|
|
|
374
|
-
txt += '<h4 class="vg-alert-content--title">' + title + code + '</h4>';
|
|
385
|
+
if (title) txt += '<h4 class="vg-alert-content--title">' + title + code + '</h4>';
|
|
375
386
|
|
|
376
387
|
if ('message' in response) {
|
|
377
388
|
txt += '<div class="vg-alert-content--message">' + response.message + '</div>'
|
|
378
389
|
}
|
|
379
390
|
|
|
380
|
-
if ('errors' in response) {
|
|
391
|
+
if ('errors' in response && this._params.alert.errors) {
|
|
381
392
|
let errors = normalizeData(response.errors) || null;
|
|
382
393
|
if (isObject(errors)) {
|
|
383
394
|
for (const error in errors) {
|
package/build/vgapp.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see vgapp.js.LICENSE.txt */
|
|
2
|
-
var vg;(()=>{"use strict";var e={d:(t,s)=>{for(var a in s)e.o(s,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:s[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function s(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}e.r(t),e.d(t,{VGAlert:()=>Cs,VGCollapse:()=>ye,VGDropdown:()=>et,VGFormSender:()=>It,VGLawCookie:()=>es,VGModal:()=>xt,VGNav:()=>He,VGRollup:()=>zt,VGSelect:()=>ys,VGSidebar:()=>le,VGToast:()=>Bs});const a=e=>!!n(e)&&void 0!==e.nodeType,i=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"));function n(e){return e&&"object"==typeof e}function r(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function o(...e){const t=e=>e&&"object"==typeof e;return e.reduce(((e,s)=>(Object.keys(s).forEach((a=>{const i=e[a],n=s[a];Array.isArray(i)&&Array.isArray(n)?e[a]=i.concat(...n):t(i)&&t(n)?e[a]=o(i,n):e[a]=n})),e)),{})}function l(e,t=[],s=e){return"function"==typeof e?e(...t):s}const d="transitionend",c=e=>{e.offsetHeight},m=()=>{};function h(e=7){let t="";let s=0;for(;s<e;)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random())),s+=1;return t}const p=()=>"rtl"===document.documentElement.dir,u=e=>{let t=e.getAttribute("data-vg-target");if(!t||"#"===t){let s=e.getAttribute("href");if(!s||!s.includes("#")&&!s.startsWith("."))return null;s.includes("#")&&!s.startsWith("#")&&(s=`#${s.split("#")[1]}`),t=s&&"#"!==s?s.trim():null}return t?t.split(",").map((e=>(e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,((e,t)=>`#${CSS.escape(t)}`))),e))(e))).join(","):null},g={find:(e,t=document.documentElement)=>a(e)?e:Element.prototype.querySelector.call(t,e),findAll:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),getSelectorFromElement(e){const t=u(e);return t&&g.find(t)?t:null},getElementFromSelector(e){const t=u(e);return t?g.find(t):null},getMultipleElementsFromSelector(e){const t=u(e);return t?g.findAll(t):[]},prev:e=>e.previousElementSibling||null},_=g,f=new Map,v={set(e,t,s){f.has(e)||f.set(e,new Map);const a=f.get(e);a.has(t)||0===a.size?a.set(t,s):console.error(`VGApp не допускает более одного экземпляра для каждого элемента. Связанный экземпляр: ${Array.from(a.keys())[0]}.`)},get:(e,t)=>f.has(e)&&f.get(e).get(t)||null,remove(e,t){if(!f.has(e))return;const s=f.get(e);s.delete(t),0===s.size&&f.delete(e)}},b={get(e,t="data",s=!0){if(!e)return{};if("data"===t){let t=["data-vg-toggle","data-vg-target","data-vg-dismiss"],a={},i=[].filter.call(e.attributes,(function(e){return/^data-/.test(e.name)}));return i.length&&i.forEach((function(e){let i=e.name;t.includes(i)||(s&&(i=i.slice(5)),a[i]=r(e.value))})),a}return"all"===t?e.getAttributeNames().reduce(((t,s)=>({...t,[s]:e.getAttribute(s)})),{}):e.getAttribute(t)},has:(e,t)=>e.hasAttribute(t),set(e,t,s){a(e)&&t&&e.setAttribute(t,s)},remove(e,t){a(e)&&t&&e.removeAttribute(t)},hide(e){e.style.display="none"},show(e,t="block"){e.style.display=t}},w=class{constructor(e,t=null){this._params=this.merge(e,t)}get(){return this._params}fromElement(e){return a(e)?b.get(e):{}}merge(e,t){let s=o(e,this.fromElement(t));for(let e in s)if(-1!==e.indexOf("-")){let t=e.split("-"),a=r(s[e]);t[0]in s&&t[1]in s[t[0]]&&(s[t[0]][t[1]]=a),delete s[e]}return"params"in s&&(s=o(s,s.params),delete s.params),s}},y=/[^.]*(?=\..*)\.|.*/,k=/\..*/,L=/::\d+$/,x={};let E=1;const A={mouseenter:"mouseover",mouseleave:"mouseout"},C=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","submit","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","popstate","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function T(e,t){return t&&`${t}::${E++}`||e.uidEvent||E++}function S(e){const t=T(e);return e.uidEvent=t,x[t]=x[t]||{},x[t]}function M(e,t,s=null){return Object.values(e).find((e=>e.callable===t&&e.delegationSelector===s))}function O(e,t,s){const a="string"==typeof t,i=a?s:t||s;let n=(r=(r=e).replace(k,""),A[r]||r);var r;return C.has(n)||(n=e),[a,i,n]}function $(e,t,s,a,i){if("string"!=typeof t||!e)return;let[n,r,o]=O(t,s,a);if(t in A){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};r=e(r)}const l=S(e),d=l[o]||(l[o]={}),c=M(d,r,n?s:null);if(c)return void(c.oneOff=c.oneOff&&i);const m=T(r,t.replace(y,"")),h=n?function(e,t,s){return function a(i){const n=e.querySelectorAll(t);for(let{target:r}=i;r&&r!==this;r=r.parentNode)for(const o of n)if(o===r)return I(i,{delegateTarget:r}),a.oneOff&&N.off(e,i.type,t,s),s.apply(r,[i])}}(e,s,r):function(e,t){return function s(a){return I(a,{delegateTarget:e}),s.oneOff&&N.off(e,a.type,t),t.apply(e,[a])}}(e,r);h.delegationSelector=n?s:null,h.callable=r,h.oneOff=i,h.uidEvent=m,d[m]=h,e.addEventListener(o,h,n)}function P(e,t,s,a,i){const n=M(t[s],a,i);n&&(e.removeEventListener(s,n,Boolean(i)),delete t[s][n.uidEvent])}function j(e,t,s,a){const i=t[s]||{};for(const[n,r]of Object.entries(i))n.includes(a)&&P(e,t,s,r.callable,r.delegationSelector)}function I(e,t={}){for(const[s,a]of Object.entries(t))try{e[s]=a}catch{Object.defineProperty(e,s,{configurable:!0,get:()=>a})}return e}const N={on(e,t,s,a){$(e,t,s,a,!1)},one(e,t,s,a){$(e,t,s,a,!0)},off(e,t,s,a){if("string"!=typeof t||!e)return;const[i,n,r]=O(t,s,a),o=r!==t,l=S(e),d=l[r]||{},c=t.startsWith(".");if(void 0===n){if(c)for(const s of Object.keys(l))j(e,l,s,t.slice(1));for(const[s,a]of Object.entries(d)){const i=s.replace(L,"");o&&!t.includes(i)||P(e,l,r,a.callable,a.delegationSelector)}}else{if(!Object.keys(d).length)return;P(e,l,r,n,i?s:null)}},trigger(e,t,s){if("string"!=typeof t||!e)return null;const a=I(new Event(t,{bubbles:!0,cancelable:!0}),s);return e.dispatchEvent(a),a}},H=N,q=e=>({error:'<svg viewBox="0 0 87 87" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="ui-success" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-2" transform="translate(2.000000, 2.000000)"><circle id="Oval-2" stroke="rgba(252, 191, 191, .5)" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><circle class="ui-error-circle" stroke="#F74444" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><path class="ui-error-line1" d="M22.244224,22 L60.4279902,60.1837662" id="Line" stroke="#F74444" stroke-width="3" stroke-linecap="square"></path><path class="ui-error-line2" d="M60.755776,21 L23.244224,59.8443492" id="Line" stroke="#F74444" stroke-width="3" stroke-linecap="square"></path></g></g></svg>',success:'<svg viewBox="0 0 87 87" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="ui-error" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-3" transform="translate(2.000000, 2.000000)"><circle id="Oval-2" stroke="rgba(117, 183, 152, 0.4)" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><circle class="ui-success-circle" id="Oval-2" stroke="#A5DC86" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><polyline class="ui-success-path" id="Path-2" stroke="#A5DC86" stroke-width="4" points="19 38.8036813 31.1020744 54.8046875 63.299221 28"></polyline></g></g></svg>',waiting:'<svg viewBox="0 0 87 87" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="ui-waiting" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-3" transform="translate(2.000000, 2.000000)"><circle id="Oval-2" stroke="rgba(255, 218, 106, 0.4)" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><circle class="ui-waiting-circle" id="Oval-2" stroke="#ffda6a" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><path class="ui-waiting-line1" d="M43 63C54.598 63 64 53.598 64 42C64 30.402 54.598 21 43 21C31.402 21 22 30.402 22 42C22 53.598 31.402 63 43 63Z" stroke-width="3" stroke="#ffda6a" stroke-linecap="round" stroke-linejoin="round"/><path class="ui-waiting-line2" d="M40.6667 32.6641V44.3307H52.3334" stroke="#ffda6a" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></g></g></svg>',dots:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-three-dots-vertical" viewBox="0 0 16 16"><path d="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/></svg>',cross:'<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 224.512 224.512" xml:space="preserve"><g><polygon points="224.507,6.997 217.521,0 112.256,105.258 6.998,0 0.005,6.997 105.263,112.254 0.005,217.512 6.998,224.512 112.256,119.24 217.521,224.512 224.507,217.512 119.249,112.254 "/></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g></svg>'}[e]??{}),D=(e,t="hide")=>{const s=`click.dismiss.${e.EVENT_KEY}`,a=e.NAME;H.on(document,s,`[data-vg-dismiss="${a}"]`,(function(s){if(["A","AREA"].includes(this.tagName)&&s.preventDefault(),i(this))return;const n=_.getSelectorFromElement(this)||this.closest(`.vg-${a}`);e.getOrCreateInstance(n)[t]()}))},B={x:function(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;let e,t=["MSXML2.XmlHttp.6.0","MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"];for(let s=0;s<t.length;s++)try{e=new ActiveXObject(t[s]);break}catch(e){}return e},send:function(e,t,s,a,i){void 0===i&&(i=!0);let n=B.x();n.open(s,e,i),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.onreadystatechange=function(){4===n.readyState&&(200===n.status?t("success",{text:n.statusText,response:n.responseText,code:n.status}):t("error",{text:n.statusText,response:n.responseText,code:n.status}))},n.send(a)},get:function(e,t,a,i){let n=[];if(!s(t))for(let e of t)n.push(encodeURIComponent(e[0])+"="+encodeURIComponent(e[1]));B.send(e+(n.length?"?"+n.join("&"):""),a,"GET",null,i)},post:function(e,t,s,a){B.send(e,s,"POST",t,a)}},F=class{constructor(e,t,s={}){this._params=o({enable:!1,in:"animate__backInUp",out:"animate__backOutUp",delay:0},s),this.classes={animated:"animate__animated"},this._params.enable&&a(e)&&(this._element=e,this._name_key=t,this._element.classList.contains(this.classes.animated)||this._element.classList.add(this.classes.animated),this._triggers())}_triggers(){H.on(this._element,this._name_key+".show",(()=>{this._element.classList.remove(this._params.out),this._element.classList.add(this._params.in)})),H.on(this._element,this._name_key+".hide",(()=>{this._element.classList.remove(this._params.in),this._element.classList.add(this._params.out)})),H.on(this._element,this._name_key+".hidden",(()=>{this._element.classList.remove(this._params.out)}))}},R=class{constructor(e){if(e){if(this._element=_.find(e),!this._element)throw new Error("Товарищ! Первый параметр не должен быть пустым!");this._params={},v.set(this._element,this.constructor.NAME_KEY,this)}}_getParams(e,t){return new w(t,e).get()}dispose(){v.remove(this._element,this.constructor.NAME_KEY),H.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_route(e){const t=this;let s=null;const a=e=>{s&&(s.innerHTML=e)};t._params.hasOwnProperty("ajax")&&t._params.ajax.route&&(!1 in t._params.ajax&&(t._params.ajax.method="get"),"target"in t._params.ajax&&t._params.ajax.target&&(s=_.find(t._params.ajax.target)),"loader"in t._params.ajax&&t._params.ajax.loader&&a('<div class="vg-loader"></div>'),B[t._params.ajax.method](t._params.ajax.route,t._params.ajax.data||{},(function(t,s){a(s.response),l(e,[t,s])})))}_dismissElement(){let e=q("cross"),t=this._element.querySelector(".vg-btn-close");t&&(t.querySelector("svg")||t.insertAdjacentHTML("beforeend",e))}_queueCallback(e,t,s=!0,a){!function(e,t,s=!0,a){if(!s)return void l(e);const i=a||(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:s}=window.getComputedStyle(e);const a=Number.parseFloat(t),i=Number.parseFloat(s);return a||i?(t=t.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(s))):0})(t)+5;let n=!1;const r=({target:s})=>{s===t&&(n=!0,t.removeEventListener(d,r),l(e))};t.addEventListener(d,r),setTimeout((()=>{n||(e=>{e.dispatchEvent(new Event(d))})(t)}),i)}(e,t,s,a)}_animation(e,t,s={}){new F(e,t,s)}static getInstance(e){return v.get(_.find(e),this.NAME_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,s(t)?{}:t)}static get DATA_KEY(){return`vg.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}},z=class{static append(){document.body.style.paddingRight=function(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}()+"px",document.body.style.overflow="hidden"}static destroy(){document.body.style.overflow="",document.body.style.paddingRight="",b.get(document.body,"style")||b.remove(document.body,"style")}},Y="vg-backdrop",X="fade";class K{static show(e){K._append(),l(e)}static hide(e){K._destroy(),l(e)}static _append(){if(_.find("."+Y))return!1;let e=document.createElement("div");e.classList.add(Y),document.body.append(e),setTimeout((()=>{e.classList.add(X)}),50),H.on(e,"mousedown.vg.backdrop",(()=>{K.hide(),z.destroy()}))}static _destroy(){let e=_.find("."+Y);e&&(e.classList.remove(X),setTimeout((()=>{e.remove()}),500))}}const V=K,W="vg.sidebar",G="show",U="vg-sidebar-open",J=`${W}.hide`,Z=`${W}.hidden`,Q=`${W}.show`,ee=`${W}.shown`,te=`${W}.loaded`,se=`keydown.dismiss.${W}`,ae=`hidePrevented.${W}`,ie=`click.${W}.data.api`,ne=`popstate.${W}.data.api`,re=`DOMContentLoaded.${W}.data.api`;class oe extends R{constructor(e,t={}){super(e,t),this._params=this._getParams(e,o({backdrop:!0,overflow:!0,keyboard:!0,hash:!1,animation:{enable:!1,in:"animate__rollIn",out:"animate__rollOut",delay:800},ajax:{route:"",target:"",method:"get",loader:!1}},t)),this._addEventListeners(),this._dismissElement(),this._params.animation.delay=this._params.animation.enable?this._params.animation.delay:0,this._animation(this._element,oe.NAME_KEY,this._params.animation)}static get NAME(){return"sidebar"}static get NAME_KEY(){return W}toggle(e){return this._isShown()?this.hide():this.show(e)}show(e){const t=this;i(t._element)||(e&&(t._params=t._getParams(e,t._params)),t._route((function(e,s){H.trigger(t._element,te,{stats:e,data:s})})),H.trigger(t._element,Q,{relatedTarget:e}).defaultPrevented||(t._params.backdrop&&V.show(),t._params.overflow&&z.append(),this._params.hash&&(window.history.pushState(null,"vg-sidebar-open","#"+this._element.id),H.on(window,ne,(()=>{this.hide()}))),t._element.classList.add(G),document.body.classList.add(U),t._queueCallback((()=>{H.on(_.find(".vg-backdrop"),"mousedown.vg.backdrop",(function(){t.hide()})),H.trigger(t._element,ee,{relatedTarget:e})}),t._element,!0,50)))}hide(){const e=this;i(e._element)||H.trigger(this._element,J).defaultPrevented||setTimeout((()=>{e._element.setAttribute("aria-expanded",!1),e._element.classList.remove(G),this._queueCallback((()=>{e._params.backdrop&&V.hide((function(){e._params.overflow&&z.destroy()})),e._params.overflow&&z.destroy(),e._params.hash&&history.pushState("",document.title,window.location.pathname+window.location.search),document.body.classList.remove(U),H.trigger(this._element,Z)}),this._element,!0)}),this._params.animation.delay)}dispose(){super.dispose()}_isShown(){return this._element.classList.contains(G)}_addEventListeners(){H.on(document,se,(e=>{"Escape"===e.key&&(this._params.keyboard?this.hide():H.trigger(this._element,ae))}))}}D(oe),H.on(document,ie,'[data-vg-toggle="sidebar"]',(function(e){const t=_.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),i(this))return;this.setAttribute("aria-expanded",!0),H.one(t,Z,(()=>{this.setAttribute("aria-expanded",!1)}));const s=_.find(".vg-sidebar.show");s&&s!==t&&oe.getInstance(s).hide(),oe.getOrCreateInstance(t).toggle(this)})),H.on(document,re,(function(){let e=window.location.hash.slice(1);if(e){let t=_.find("#"+e);if(t&&t.classList.contains("vg-sidebar")){if(i(t))return;oe.getOrCreateInstance(t).toggle()}}}));const le=oe,de="vg.collapse",ce="show",me="vg-collapse",he="vg-collapsing",pe=`:scope .${me} .${me}`,ue='[data-vg-toggle="collapse"]',ge=`${de}.hide`,_e=`${de}.hidden`,fe=`${de}.show`,ve=`${de}.shown`,be=`click.${de}.data.api`;class we extends R{constructor(e,t={}){super(e,t),this._params=this._getParams(e,o({toggle:!0,parent:null,ajax:{route:"",target:"",method:"get",loader:!1}},t)),this._isTransitioning=!1,this._triggerArray=[];const s=_.findAll(ue);for(const e of s){const t=_.getSelectorFromElement(e),s=_.findAll(t).filter((e=>e===this._element));null!==t&&s.length&&this._triggerArray.push(e)}this._initializeChildren(),this._params.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._params.toggle&&this.toggle()}static get NAME(){return"collapse"}static get NAME_KEY(){return de}toggle(e){return this._isShown()?this.hide():this.show(e)}show(){const e=this;if(e._isTransitioning||e._isShown())return;let t=[];if(!(e._params.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((e=>e!==this._element)).map((e=>we.getOrCreateInstance(e,{toggle:!1})))),t.length&&t[0]._isTransitioning||H.trigger(e._element,fe).defaultPrevented)){for(const e of t)e.hide();e._element.classList.remove(me),e._element.classList.add(he),e._element.style.height=0,e._addAriaAndCollapsedClass(e._triggerArray,!0),e._isTransitioning=!0,e._route(),e._queueCallback((()=>{e._isTransitioning=!1,e._element.classList.remove(he),e._element.classList.add(me,ce),e._element.style.height="",H.trigger(e._element,ve)}),e._element,!0),e._element.style.height=`${e._element.scrollHeight}px`}}hide(){const e=this;if(!e._isTransitioning&&e._isShown()&&!H.trigger(e._element,ge).defaultPrevented){e._element.style.height=`${this._element.getBoundingClientRect().height}px`,c(e._element),e._element.classList.add(he),e._element.classList.remove(me,ce);for(const t of e._triggerArray){const s=_.getElementFromSelector(t);s&&!e._isShown(s)&&e._addAriaAndCollapsedClass([t],!1)}e._isTransitioning=!0,e._element.style.height="",e._queueCallback((()=>{e._isTransitioning=!1,e._element.classList.remove(he),e._element.classList.add(me),H.trigger(e._element,_e)}),e._element,!0)}}dispose(){super.dispose()}_isShown(e=this._element){return e.classList.contains(ce)}_addAriaAndCollapsedClass(e,t){if(e.length)for(const s of e)this._changeStateButton(s,t)}_initializeChildren(){if(!this._params.parent)return;const e=this._getFirstLevelChildren(ue);for(const t of e){const e=_.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=_.find(pe,this._params.parent);return _.find(e,this._params.parent).filter((e=>!t.includes(e)))}_changeStateButton(e,t){e.classList.toggle("vg-collapsed",!t),e.setAttribute("aria-expanded",t),e.innerHTML=b.get(e,`data-${t?"hide":"show"}-text`)||e.innerHTML}}H.on(document,be,ue,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault(),_.getMultipleElementsFromSelector(this).forEach((function(e){we.getOrCreateInstance(e,{toggle:!1}).toggle()}))}));const ye=we,ke=class{constructor(){this.breakpoints={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400,xxxl:1600}}static check(e){return(new this).define(e)}static checkMobileOrTablet(){let e=!1;var t;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.slice(0,4)))&&(e=!0),e}define(e){let t=window.innerWidth,s=this._checkResponsiveClass(e),a=this.breakpoints,i=Object.keys(a).find((e=>a[e]===s)),n=Object.keys(a),r=n.indexOf(i);return t>=a[n[r+1]]}_checkResponsiveClass(e){let t=e._element,s=e._params,a=0;return a=t.classList.contains(s.classes.XXXL)?this.breakpoints.xxxl:t.classList.contains(s.classes.XXL)?this.breakpoints.xxl:t.classList.contains(s.classes.XL)?this.breakpoints.xl:t.classList.contains(s.classes.LG)?this.breakpoints.lg:t.classList.contains(s.classes.MD)?this.breakpoints.md:t.classList.contains(s.classes.SM)?this.breakpoints.sm:(t.classList.contains(s.classes.XS),this.breakpoints.xs),a}},Le="vg.nav",xe="show",Ee="fade",Ae="active",Ce=`${Le}.hide`,Te=`${Le}.hidden`,Se=`${Le}.show`,Me=`${Le}.shown`,Oe=`mouseover.${Le}.data.api`,$e=`mouseout.${Le}.data.api`,Pe=`click.${Le}.data.api`,je=`keyup.${Le}.data.api`,Ie=`resize.${Le}.data.api`;class Ne extends R{constructor(e,t={}){super(e),this._params=this._getParams(e,o({breakpoint:!1,placement:"horizontal",classes:{hamburgerActive:"vg-nav-hamburger-active",hamburgerAlways:"vg-nav-hamburger-always",hamburger:"vg-nav-hamburger",container:"vg-nav-container",wrapper:"vg-nav-wrapper",active:"vg-nav-active",expand:"vg-nav-expand",cloned:"vg-nav-cloned",hover:"vg-nav-hover",flip:"vg-nav-flip",XXXL:"vg-nav-xxxl",XXL:"vg-nav-xxl",XL:"vg-nav-xl",LG:"vg-nav-lg",MD:"vg-nav-md",SM:"vg-nav-sm",XS:"vg-nav-xs"},expand:!0,hover:!1,position:!0,collapse:!0,toggle:'<span class="default"></span>',hamburger:{enable:!0,always:!1,title:"",body:null},callback:m,animation:!0,timeoutAnimation:300,ajax:{route:"",target:"",method:"get"}},t)),this._navigation=null,this.navigation="."+this._params.classes.wrapper,this.movedLinks=[],this.$links=_.findAll("."+this._params.classes.wrapper+" > li",this.navigation),!1===this._params.animation&&(this._params.timeoutAnimation=10)}static get NAME(){return"nav"}static get NAME_KEY(){return Le}get navigation(){return this._navigation}set navigation(e){let t=_.find(e,this._element);t&&(this._navigation=t)}build(){if(!this.navigation)return;let e=this._params;if(this._element.classList.add(e.classes.container),this._element.classList.add("vg-nav-"+e.placement),e.breakpoint||(e.expand=!1),e.hamburger.always?this._element.classList.add(e.classes.hamburgerAlways):e.breakpoint&&e.expand?!1!==e.breakpoint&&this._element.classList.add("vg-nav-"+e.breakpoint):this._element.classList.add(e.classes.expand),e.hover&&(this._element.classList.add(e.classes.hover),ke.checkMobileOrTablet()&&this._element.classList.remove(e.classes.hover)),e.expand&&!e.hamburger.body&&null===_.find("."+e.classes.hamburger,this._element)){let t="",s='<span class="'+e.classes.hamburger+'--lines"><span></span><span></span><span></span></span>';e.hamburger.title&&(t='<span class="'+e.classes.hamburger+'--title">'+e.hamburger.title+"</span>"),null!==e.hamburger.body&&(s=e.hamburger.body),this._element.insertAdjacentHTML("afterbegin",'<a href="#sidebar-nav" class="'+e.classes.hamburger+'" data-vg-toggle="sidebar">'+t+s+"</a>")}if(e.toggle){let t=[..._.findAll(".dropdown-mega > a, .dropdown > a",this._element)],s='<span class="toggle">'+e.toggle+"</span>";t.length&&t.forEach((function(e){e.querySelector(".toggle")||e.closest(".dots")||(e.setAttribute("aria-expanded","false"),e.insertAdjacentHTML("beforeend",s))}))}e.collapse&&ke.check(this)&&"vertical"!==e.placement&&function(e){let t=e.navigation.clientWidth,s=0,a=_.find(".dots",e.navigation),i=q("dots");if(e.$links.length){if(a)s=a.clientWidth;else{let t=_.find("a",e.$links[0]),a=getComputedStyle(t);s=r(a.paddingLeft.slice(0,-2))+r(a.paddingRight.slice(0,-2))+16}for(let i of e.$links)s+=i.getBoundingClientRect().width,t<s?(e.movedLinks.push(i),i.remove()):e.movedLinks.length&&(a?e.navigation.insertBefore(e.movedLinks[0],a):e.navigation.appendChild(e.movedLinks[0]),e.movedLinks.splice(0,1));e.movedLinks.length?a||e.navigation.insertAdjacentHTML("beforeend",'<li class="dropdown dots"><a href="#" aria-expanded="false">'+i+"</a></li>"):a&&a.remove();let n=e.navigation.querySelector(".dots");if(n&&e.movedLinks.length){let t=n.querySelector("ul");if(t)for(let s of e.movedLinks)t.prepend(s);else{let t=document.createElement("ul");t.classList.add("dropdown-content"),t.classList.add("right");for(let s of e.movedLinks)t.prepend(s);n.appendChild(t)}}}}(this),"afterInit"in this._params.callback&&l(this._params.callback.afterInit,[this])}show(e){let t=e.relatedTarget;if(!t||i(t))return;if(t.closest(".dropdown-content")||t.classList.add("first"),H.trigger(t,Se,{relatedTarget:e}).defaultPrevented)return;let s=_.find(".dropdown-content",t),a=t.firstElementChild;a&&a.setAttribute("aria-expanded","true"),s.classList.add(xe),t.classList.add(Ae),function(e){let{width:t,right:s}=e.getBoundingClientRect(),a=window.innerWidth-s-t;e.classList.remove("right"),e.classList.remove("left");let i=e.closest("li").querySelectorAll("ul");if(a>t)for(const e of i)e.classList.add("left");else for(const e of i)e.classList.add("right")}(s),this._queueCallback((()=>{s.classList.add(Ee),H.trigger(t,Me,e)}),s,!0,50)}hide(e){const t=this;if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))H.off(e,"mouseover",m);let s=e.relatedTarget;if("elm"in e&&e.elm&&(s=e.elm),s){if(H.trigger(s,Ce).defaultPrevented)return;s.classList.remove(Ae),s.classList.contains("first")&&s.classList.remove("first"),[..._.findAll("."+xe,s)].forEach((function(s,a){s.classList.remove(Ee);let i=s.closest(".dropdown");i.classList.contains(Ae)&&i.classList.remove(Ae);let n=s.previousElementSibling;if(n&&n.setAttribute("aria-expanded","false"),0===a){const a=()=>{s.classList.remove(xe),H.trigger(s,Te,e)};t._queueCallback(a,s,!0,500)}}))}}static init(e,t={}){const s=Ne.getOrCreateInstance(e,t);s.build();let n=_.findAll(".dropdown",s._navigation);s._params.hover?[...n].forEach((function(e){let t=null;H.on(e,Oe,(function(e){if(t)return;Ne.hideOpenDrops(e);let a=e.target.closest(".dropdown");if(!a)return;if(!s.navigation.contains(a))return;t=a;let i={relatedTarget:a};s.show(i)})),H.on(e,$e,(function(e){if(!t)return;let a=e.relatedTarget.closest(".dropdown"),i=t;for(;a;){if(a===t)return;a=a.parentNode}t=null,s.hide({relatedTarget:a,elm:i})}))})):(H.on(document,je,Ne.clearDrops),H.on(document,Pe,Ne.clearDrops),H.on(document,Pe,".vg-nav a",(function(e){if(!b.has(this,"aria-expanded"))return;"click"in s._params.callback&&l(s._params.callback.click,[this]),e.preventDefault();let t=this.closest(".vg-nav"),n=t.querySelector(".first"),r=this.closest(".dropdown");if(r&&(!i(r)||function(e){if(!a(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),s=e.closest("details:not([open])");if(!s)return t;if(s!==e){const t=e.closest("summary");if(t&&t.parentNode!==s)return!1;if(null===t)return!1}return t}(r))){if(n&&this.closest(".first")){if(r.classList.contains("active"))return void s.hide({relatedTarget:r})}else[..._.findAll(".active",t)].forEach((function(e){e&&e!==r&&s.hide({relatedTarget:e})}));s.show({relatedTarget:r})}})));const r=document.getElementById("sidebar-nav");let o=s._element.querySelector("."+s._params.classes.hamburger);r&&o&&(r.addEventListener("vg.sidebar.show",(function(){o.classList.add(s._params.classes.hamburgerActive)})),r.addEventListener("vg.sidebar.hide",(function(){o.classList.remove(s._params.classes.hamburgerActive)})))}static clearDrops(e){2===e.button||"keyup"===e.type&&"Tab"!==e.key||Ne.hideOpenDrops(e)}static hideOpenDrops(e){const t=_.findAll(".dropdown:not(.disabled):not(:disabled).active");for(const s of t){const t=Ne.getInstance(s.closest(".vg-nav"));if(!t)continue;if(e.target.closest(".first"))return;const a={relatedTarget:s};"click"===e.type&&(a.clickEvent=e),t.hide(a)}}}H.on(window,Ie,(function(){_.find(".vg-nav")&&Ne.getOrCreateInstance(".vg-nav",{}).build()}));const He=Ne,qe=class{constructor(e={}){this.params=o({element:null,drop:null},e)}_getPlacement(){const e=this,t=e=>{let s=e.parentNode,a=getComputedStyle(s).overflow;return"BODY"===s.tagName?null:"visible"!==a?s:void t(s)};let s,a,i=!1,n=e.params.drop.getBoundingClientRect(),o=e.params.element.getBoundingClientRect();if(t(e.params.element))i=!0,s=n.top,a=n.left;else{let t=getComputedStyle(e.params.drop);s=r(t.top.slice(0,-2)),a=r(t.left.slice(0,-2))}return n.left+n.width>window.innerWidth&&(a=o.width-n.width),{isFixed:i,top:s,left:a}}},De="vg.dropdown",Be="show",Fe="fade",Re="vg-dropdown-content",ze='[data-vg-toggle="dropdown"]',Ye=`${De}.hide`,Xe=`${De}.hidden`,Ke=`${De}.show`,Ve=`${De}.shown`,We=`keyup.${De}.data.api`,Ge=`keydown.${De}.data.api`,Ue=`click.${De}.data.api`,Je=`mouseover.${De}.data.api`,Ze=`mouseout.${De}.data.api`;class Qe extends R{constructor(e,t){super(e,t);let s={offset:[0,2],backdrop:!1,overflow:!1,keyboard:!1,placement:"bottom",timeoutAnimation:350,hover:!1,ajax:{route:"",target:"",method:"get",loader:!1},animation:{enable:!1,in:"animate__flipInY",out:"animate__flipOutY",delay:800}};"offset"in t&&Array.isArray(t.offset)&&(s.offset=t.offset),this._params=this._getParams(e,o(s,t));const a=_.getElementFromSelector(this._element);this._parent=this._element.parentNode,this._drop=a||_.find("."+Re,this._parent),this._isPlacement=!1,this._params.animation.delay=this._params.animation.enable?this._params.animation.delay:0,this._animation(this._drop,Qe.NAME_KEY,this._params.animation)}static get NAME(){return"dropdown"}static get NAME_KEY(){return De}toggle(){return this._isShown()?this.hide():this.show()}show(){if(i(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!H.trigger(this._element,Ke,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))H.on(e,"mouseover",m);this._route(),this._element.setAttribute("aria-expanded",!0),this._element.classList.add(Be),this._drop.classList.add(Be),this._setPlacement(),this._params.backdrop&&!this._params.hover&&V.show(),this._params.overflow&&(z.append(),document.body.classList.add("dropdown-open")),this._queueCallback((()=>{this._drop.classList.add(Fe),H.trigger(this._element,Ve,e)}),this._drop,!0,50)}}hide(){if(i(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){return super.dispose()}_isShown(){return this._element.classList.contains(Be)}_completeHide(e){if(!H.trigger(this._element,Ye,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))H.off(e,"mouseover",m);if(this._drop.classList.remove(Fe),this._element.classList.remove(Be),this._element.setAttribute("aria-expanded","false"),this._params.backdrop&&!this._params.hover){const e=this;V.hide((function(){e._params.overflow&&z.destroy()}))}this._params.overflow&&(z.destroy(),document.body.classList.remove("dropdown-open")),setTimeout((()=>{this._queueCallback((()=>{this._drop.classList.remove(Be),H.trigger(this._element,Xe,e)}),this._parent,!0,10)}),this._params.animation.delay)}}_setPlacement(){const e=this;if(!e._isPlacement){let t=new qe({element:this._parent,drop:this._drop})._getPlacement();t.isFixed&&(e._drop.style.position="fixed",e._drop.style.transform="translateY(-20%)"),e._drop.style.left=t.left+"px",e._drop.style.top=t.top+"px"}e._params.offset&&(e._drop.style.paddingTop=e._params.offset[1]+"px",e._drop.style.paddingRight=e._params.offset[0]+"px"),e._isPlacement=!0}static init(e,t={}){const s=Qe.getOrCreateInstance(e,t);if(s._params.hover){let e=null;H.on(s._parent,Je,(function(t){if(e)return;Qe.hideOpenToggles(t);let a=t.target.closest(".vg-dropdown");a&&s._parent.contains(a)&&(e=a,s.show())})),H.on(s._parent,Ze,(function(t){if(!e)return;let a=t.relatedTarget;for(;a;){if(a===e)return;a=a.parentNode}e=null,s._completeHide({relatedTarget:s._element})}))}else H.on(document,We,ze,Qe.keydownHandler),H.on(document,Ge,"."+Re,Qe.keydownHandler),H.on(document,We,Qe.clearDrops),H.on(document,Ue,Qe.clearDrops),H.on(e,Ue,(function(e){e.preventDefault(),s.toggle()}))}static hideOpenToggles(e){const t=_.findAll('[data-vg-toggle="dropdown"]:not(.disabled):not(:disabled).show');for(const s of t){const t=Qe.getInstance(s);if(!t)continue;if(e.target.closest("."+Re)===t._drop)return;if(e.composedPath().includes(t._element))continue;const a={relatedTarget:t._element};"click"===e.type&&(a.clickEvent=e),t._completeHide(a)}}static keydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),s="Escape"===e.key,a=["ArrowUp","ArrowDown"].includes(e.key);if(!a&&!s)return;if(t&&!s)return;e.preventDefault();const i=this.matches(ze)?this:_.find(ze,e.delegateTarget.parentNode),n=Qe.getOrCreateInstance(i);if(a)return e.stopPropagation(),void n.show();n._isShown()&&(e.stopPropagation(),n.hide(),i.focus())}static clearDrops(e){2===e.button||"keyup"===e.type&&"Tab"!==e.key||Qe.hideOpenToggles(e)}}const et=Qe,tt=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",st=".sticky-top",at="padding-right",it="margin-right",nt=class{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,at,(t=>t+e)),this._setElementAttributes(tt,at,(t=>t+e)),this._setElementAttributes(st,it,(t=>t-e))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,at),this._resetElementAttributes(tt,at),this._resetElementAttributes(st,it)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,s){const a=this.getWidth();this._applyManipulationCallback(e,(e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+a)return;this._saveInitialAttribute(e,t);const i=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${s(Number.parseFloat(i))}px`)}))}_saveInitialAttribute(e,t){const s=e.style.getPropertyValue(t);s&&b.get(e,t,s)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,(e=>{const s=b.get(e,t);null!==s?(b.remove(e,t),e.style.setProperty(t,s)):e.style.removeProperty(t)}))}_applyManipulationCallback(e,t){if(a(e))t(e);else for(const s of _.findAll(e,this._element))t(s)}},rt="vg.modal",ot="vg-modal-open",lt="show",dt="vg-modal-static",ct=`${rt}.hide`,mt=`${rt}.hidden`,ht=`${rt}.show`,pt=`${rt}.shown`,ut=`${rt}.resize`,gt=`${rt}.loaded`,_t=`keydown.dismiss.${rt}`,ft=`hidePrevented.${rt}`,vt=`click.${rt}.data.api`,bt=`mousedown.dismiss${rt}`,wt=`click.dismiss${rt}`,yt=`DOMContentLoaded.${rt}.data.api`,kt=`popstate.${rt}.data.api`;class Lt extends R{constructor(e,t={}){super(e,t),this._params=this._getParams(e,o({backdrop:!0,focus:!0,keyboard:!0,fields:[],hash:!1,ajax:{route:"",target:"",method:"get",loader:!1},animation:{enable:!1,in:"animate__rollIn",out:"animate__rollOut",delay:800},classes:{general:"vg-modal",dialog:"vg-modal-dialog",content:"vg-modal-content",header:"vg-modal-header",title:"vg-modal-title",body:"vg-modal-body",footer:"vg-modal-footer"}},t)),this._button=null,this._dialog=_.find(".vg-modal-dialog",this._element),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new nt,this._addEventListeners(),this._dismissElement(),this._params.animation.delay=this._params.animation.enable?this._params.animation.delay:0,this._animation(this._element,Lt.NAME_KEY,this._params.animation)}static get NAME(){return"modal"}static get NAME_KEY(){return rt}static init(e,t,s){Lt.build(e,t,s)}static build(e,t,s){if("string"!=typeof e)return;let a=document.createElement("div");a.classList.add("vg-modal","fade"),a.id=e;let i=document.createElement("div");i.classList.add("vg-modal-dialog");let n=document.createElement("div");n.classList.add("vg-modal-content");let r=document.createElement("button");b.set(r,"type","button"),b.set(r,"data-vg-dismiss","modal"),b.set(r,"data-vg-target","#"+e),b.set(r,"aria-label","close"),r.classList.add("vg-btn-close"),n.append(r);let o=document.createElement("div");o.classList.add("vg-modal-body"),n.append(o),i.append(n),a.append(i),document.body.append(a),l(s,[Lt.getOrCreateInstance(a,t)])}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){const t=this;i(t._element)||(this._params=this._getParams(e,this._params),t._route((function(e,s){H.trigger(t._element,gt,{stats:e,data:s})})),H.trigger(this._element,ht,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._params.hash&&(window.history.pushState(null,"vg-sidebar-open","#"+this._element.id),H.on(window,kt,(()=>{this.hide()}))),this._scrollBar.hide(),document.body.classList.add(ot),this._addFieldsInModal(e),this._adjustDialog(),V.show((()=>this._showElement(e)))))}hide(e=[]){this._isShown&&!this._isTransitioning&&(H.trigger(this._element,ct).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,setTimeout((()=>{this._element.classList.remove(lt),this._queueCallback((()=>this._hideModal(e)),this._element,this._isAnimatedFade())}),this._params.animation.delay)))}_hideModal(e){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,e.length||(this._params.hash&&history.pushState("",document.title,window.location.pathname+window.location.search),V.hide((()=>{document.body.classList.remove(ot),this._resetAdjustments(),this._scrollBar.reset(),H.trigger(this._element,mt)})))}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=_.find(".vg-modal-body",this._dialog);t&&(t.scrollTop=0),c(this._element),this._element.classList.add(lt),this._queueCallback((()=>{this._isTransitioning=!1,H.trigger(this._element,pt,{relatedTarget:e})}),this._dialog,this._isAnimatedFade())}_isAnimatedFade(){return this._element.classList.contains("fade")}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),s=t>0;if(s&&!e){const e=p()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!s&&e){const e=p()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}_addEventListeners(){H.on(this._element,_t,(e=>{"Escape"===e.key&&(this._params.keyboard?this.hide():this._triggerBackdropTransition())})),H.on(window,ut,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),H.on(this._element,bt,(e=>{H.one(this._element,wt,(t=>{this._element===e.target&&this._element===t.target&&("static"!==this._params.backdrop?this._params.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_triggerBackdropTransition(){if(H.trigger(this._element,ft).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(dt)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(dt),this._queueCallback((()=>{this._element.classList.remove(dt),this._queueCallback((()=>{this._element.style.overflowY=t}),this._dialog)}),this._dialog))}_addFieldsInModal(e){this._params=this._getParams(e,this._params),this._params.fields.length&&this._params.fields.forEach((e=>{if(!1 in e&&!1 in e)return;let t=_.findAll("[data-"+e.name+"]",this._element);if(t.length)for(const s of t)switch(s.tagName){case"INPUT":s.value=e.value;break;case"IMG":b.set(s,"src",e.value);break;default:s.innerHTML=e.value}}))}}D(Lt),H.on(document,vt,'[data-vg-toggle="modal"]',(function(e){const t=_.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),H.one(t,ht,(e=>{e.defaultPrevented}));const s=_.find(".vg-modal.show");s&&Lt.getInstance(s).hide([s]),Lt.getOrCreateInstance(t).toggle(this)})),H.on(document,yt,(function(){let e=window.location.hash.slice(1);if(e){let t=_.find("#"+e);if(t&&t.classList.contains("vg-modal")){if(i(t))return;Lt.getOrCreateInstance(t).toggle()}}}));const xt=Lt,Et=[{type:"collapse",template:""},{type:"modal",template:'<div class="vg-modal"></div>'},{type:"pass-open",template:'<span data-vg-toggle="vgpass" class="[[classes]]" title="Показать / Скрыть" data-bs-toggle="tooltip"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M288 80c-65.2 0-118.8 29.6-159.9 67.7C89.6 183.5 63 226 49.4 256c13.6 30 40.2 72.5 78.6 108.3C169.2 402.4 222.8 432 288 432s118.8-29.6 159.9-67.7C486.4 328.5 513 286 526.6 256c-13.6-30-40.2-72.5-78.6-108.3C406.8 109.6 353.2 80 288 80zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1c3.3 7.9 3.3 16.7 0 24.6c-14.9 35.7-46.2 87.7-93 131.1C433.5 443.2 368.8 480 288 480s-145.5-36.8-192.6-80.6C48.6 356 17.3 304 2.5 268.3c-3.3-7.9-3.3-16.7 0-24.6C17.3 208 48.6 156 95.4 112.6zM288 336c44.2 0 80-35.8 80-80s-35.8-80-80-80c-.7 0-1.3 0-2 0c1.3 5.1 2 10.5 2 16c0 35.3-28.7 64-64 64c-5.5 0-10.9-.7-16-2c0 .7 0 1.3 0 2c0 44.2 35.8 80 80 80zm0-208a128 128 0 1 1 0 256 128 128 0 1 1 0-256z"/></svg></span>'},{type:"pass-close",template:'<span data-vg-toggle="vgpass" class="[[classes]]" title="Показать / Скрыть" data-bs-toggle="tooltip"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--\x3e<path d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zm151 118.3C226 97.7 269.5 80 320 80c65.2 0 118.8 29.6 159.9 67.7C518.4 183.5 545 226 558.6 256c-12.6 28-36.6 66.8-70.9 100.9l-53.8-42.2c9.1-17.6 14.2-37.5 14.2-58.7c0-70.7-57.3-128-128-128c-32.2 0-61.7 11.9-84.2 31.5l-46.1-36.1zM394.9 284.2l-81.5-63.9c4.2-8.5 6.6-18.2 6.6-28.3c0-5.5-.7-10.9-2-16c.7 0 1.3 0 2 0c44.2 0 80 35.8 80 80c0 9.9-1.8 19.4-5.1 28.2zm9.4 130.3C378.8 425.4 350.7 432 320 432c-65.2 0-118.8-29.6-159.9-67.7C121.6 328.5 95 286 81.4 256c8.3-18.4 21.5-41.5 39.4-64.8L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5l-41.9-33zM192 256c0 70.7 57.3 128 128 128c13.3 0 26.1-2 38.2-5.8L302 334c-23.5-5.4-43.1-21.2-53.7-42.3l-56.1-44.2c-.2 2.8-.3 5.6-.3 8.5z"/></svg></span>'}],At=class{constructor(e,t={}){if(!e)throw new Error("Element is required");this._element=e,this._params=o({insert:"afterend",classes:[]},t),this.templateBuild=null}render(e,t){let s=this.toHTML(e,t);"afterend"===this._params.insert&&this._element.insertAdjacentHTML("afterend",s)}toHTML(e=0,t){let s="";for(const e of Et)e.type===this._params.template&&(s=e.template);if(s)return s=s.replace("[[classes]]",this._params.classes.join(" ")),l(t,[this._element,this._params,s]),s}setContent(){}},Ct="vg.hideshowpass",Tt="show",St=`click.${Ct}.data.api`;class Mt extends R{constructor(e,t={}){super(e,t),this._params=this._getParams(e,o({},t))}static get NAME(){return"hideshowpass"}static get NAME_KEY(){return Ct}toggle(e){return this._isShown()?this.hide(e):this.show(e)}show(e){e&&(this._params=this._getParams(e,this._params)),this._element.classList.add(Tt),e.remove(),this.build(!0),b.set(this._element,"type","text")}hide(e){this._element.classList.remove(Tt),e.remove(),this.build(!1),b.set(this._element,"type","password")}_isShown(){return this._element.classList.contains(Tt)}static init(e,t){Mt.getOrCreateInstance(e,t).build(!1)}build(e=!1){this._params.template=e?"pass-open":"pass-close",new At(this._element,this._params).render()}}H.on(document,St,'[data-vg-toggle="vgpass"]',(function(e){const t=_.prev(this);t&&(["A","AREA"].includes(this.tagName)&&e.preventDefault(),i(this)||(this.setAttribute("aria-expanded",!0),Mt.getOrCreateInstance(t).toggle(this)))}));const Ot=Mt,$t="vg.fs",Pt=`submit.${$t}.data.api`;class jt extends R{constructor(e,t={}){super(e,t),this._params=this._getParams(e,o({redirect:"",validate:!1,submit:!1,fields:[],timeout:50,pass:{enabled:!0,template:"pass-open",classes:["vg-form-sender--hide-show-pass"],insert:"afterend"},alert:{enabled:!0,type:"modal"},ajax:{route:"",target:"",method:"get"},classes:{general:"vg-form-sender",alertCollapse:"vg-form-sender-collapse",alertModal:"vg-form-sender-modal",validation:"needs-validation",wasValidate:"was-validated",content:"vg-form-sender--content"},callback:{afterInit:m}},t)),this._params.ajax.route=b.get(this._element,"action").toLowerCase(),this._params.ajax.method=b.get(this._element,"method").toLowerCase(),this._button=_.find('[type="submit"]',this._element)||_.find('[form="'+this._element.id+'"]')||null,this._params.isBtnText="false"!==b.get(this._element,"data-btn-text"),this._params.isJsonParse="false"!==b.get(this._element,"data-json-parse"),this._params.isShowPass="true"===b.get(this._element,"data-show-pass")}static get NAME(){return"form-sender"}static get NAME_KEY(){return $t}build(){return this._element.classList.add(this._params.classes.general),[..._.findAll("input, textarea, select",this._element)].forEach((e=>{e.parentElement.classList.add(this._params.classes.content)})),this._params.validate&&(b.set(this._element,"novalidate",""),this._element.classList.add(this._params.classes.validation)),this._params.pass.enabled&&[..._.findAll('input[type="password"]',this._element)].forEach((e=>{Ot.init(e,this._params.pass)})),l(this._params.callback.afterInit,[this._element,this]),this}request(e,t){const s=this;s._alertBefore(),s._params.ajax.data=e,s._route((function(e,a){s._element.classList.remove("was-validated"),s._params.alert.enabled&&("string"==typeof e&&"error"===e?s._alertError(t,a):"string"==typeof e&&"success"===e&&s._alertSuccess(t,a)),s._params.redirect&&(window.location.href=s._params.redirect)}))}_alertBefore(){const e=this;"collapse"===e._params.alert.type&&[...document.getElementsByClassName(e._params.classes.alertCollapse)].forEach((function(e){e&&e.classList.contains("show")&&ye.getOrCreateInstance(e,{toggle:!1}).hide()})),e._statusButton("before"),H.trigger(e._element,"vg.fs.before",e)}_alertError(e,t){const s=this;s._statusButton("after"),s._jsonParse(t,"error"),H.trigger(s._element,"vg.fs.error",[e,s,t])}_alertSuccess(e,t){const s=this;s._statusButton("after"),s._jsonParse(t,"success"),H.trigger(s._element,"vg.fs.success",[e,s,t])}_statusButton(e){const t=this;if(!t._button)return;let s=t._button,a={send:"Отправляем...",text:"Отправить"};if(b.has(t._button,"data-spinner")&&"before"===e&&t._button.insertAdjacentHTML("afterbegin",'<span class="spinner-border spinner-border-sm me-2"></span>'),b.has(t._button,"data-text"))a.text=b.get(t._button,"data-text");else{let e=t._button.querySelector("[data-text]");e&&(a.text=b.get(e,"data-text"),s=e)}if(b.has(t._button,"data-text-send"))a.send=b.get(t._button,"data-text-send");else{let e=t._button.querySelector("[data-text-send]");e&&(a.send=b.get(e,"data-text-send"),s=e)}if("before"===e&&(t._params.isBtnText&&(s.innerHTML=a.send),b.set(t._button,"disabled","disabled")),"after"===e){t._params.isBtnText&&(s.innerHTML=a.text),b.remove(t._button,"disabled");let e=t._button.querySelector(".spinner-border");e&&e.remove()}}_jsonParse(e,t){const s=this;if(s._params.isJsonParse&&"string"==typeof e){let a={};try{a=JSON.parse(e),s.alert(a,t)}catch(a){s.alert(e,t)}}else s.alert(e,t)}alert(e,t){const s=this;if(n(e)&&"code"in e&&e.code&&200===e.code&&"response"in e&&e.response){let s=r(e.response);"string"==typeof s?-1===s.indexOf("Parse error")&&-1===s.indexOf("syntax error")||(t="error",e={response:{title:"Error",message:"Something went wrong, please repeat later"},text:"Something went wrong, please repeat later"}):"errors"in s&&r(s.errors)&&(t=r(s.errors)?"error":"success")}s._params.alert.enabled&&("modal"===s._params.alert.type&&s._alertModal(e,t),"collapse"===s._params.alert.type&&s._alertCollapse(e,t))}_alertModal(e,t){const s=this;[...document.getElementsByClassName("modal")].forEach((function(e){e&&e.classList.contains("show")&&bootstrap.Modal.getOrCreateInstance(e).hide()})),[...document.getElementsByClassName("vg-modal")].forEach((function(e){if(e&&e.classList.contains("show")){const t=xt.getOrCreateInstance(e);t.hide([t])}}));let a=s._params.classes.general+"-"+h(),i=_.find("."+s._params.classes.alertModal);i&&i.remove(),setTimeout((()=>{xt.init(a,{classes:{alert:s._params.classes.alertModal}},(function(a){let i=a._element;i.classList.add(s._params.classes.alertModal);let n=_.find(".vg-modal-body",i);n&&n.append(s.setDataRelationStatus(i,t,e,"modal")),a.toggle()}))}),s._params.timeout)}_alertCollapse(e,t){const s=this;let a=_.find("."+s._params.classes.alertCollapse);a||(a=document.createElement("div"),a.classList.add(s._params.classes.alertCollapse),a.classList.add("vg-collapse"),a.id=s._params.classes.general+"-"+h(),a.append(s.setDataRelationStatus(a,t,e,"collapse")),s._element.prepend(a)),ye.getOrCreateInstance(a,{toggle:!1}).toggle()}setDataRelationStatus(e,t,s,a){let i=_.find(".vg-alert-"+t,e);if(n(s)){if("error"===t&&"code"in s&&200!==s.code&&"text"in s&&!s.text)switch(s.text="Something went wrong, please repeat later",s.code){case 400:s.text="Bad Request";break;case 401:case 403:s.text="Unauthorized";break;case 413:s.text="Forbidden";break;case 404:s.text="Not Found";break;case 422:s.text="Unprocessable Entity";break;case 500:s.text="Internal Server Error";break;case 504:s.text="Gateway Timeout"}if("response"in s){let e=r(s.response),a="",i="",o="";if("string"!=typeof e){if(!("view"in e)){if("title"in e&&(a=e.title),"error"===t&&200!==s.code&&(o=" "+s.text+" ("+s.code+")"),i+='<h4 class="vg-alert-content--title">'+a+o+"</h4>","message"in e&&(i+='<div class="vg-alert-content--message">'+e.message+"</div>"),"errors"in e){let t=r(e.errors)||null;if(n(t))for(const e in t)Array.isArray(t[e])?t[e].forEach((function(e){i+="<div>"+e+"</div>"})):i="<div>"+t[e]+"</div>"}s={view:i}}}else s.view=e}}if(i)_.find(".vg-alert-content--text",i).innerHTML=s.view;else{i=document.createElement("div"),i.classList.add("vg-alert","vg-alert-"+t,"vg-alert-"+a);let e=document.createElement("div");e.classList.add("vg-alert-content");let n=document.createElement("div");n.classList.add("vg-alert-content--icon");let r=document.createElement("i");r.innerHTML=q(t),n.append(r),e.append(n);let o=document.createElement("div");o.classList.add("vg-alert-content--text"),o.innerHTML=s.view,e.append(o),i.append(e)}return i}static init(e,t={}){jt.getOrCreateInstance(e,t).build()}}H.on(document,Pt,(function(e){if(!b.has(e.target,"data-vgformsender"))return;const t=jt.getOrCreateInstance(e.target,{});if(t){if(t._params.validate&&!t._element.checkValidity())return e.preventDefault(),e.stopPropagation(),t._element.classList.add(t._params.classes.wasValidate),!1;if(!t._params.submit){e.preventDefault();let s=new FormData(t._element);return t.request(s,e)}}}));const It=jt,Nt="vg.rollup",Ht="show",qt="vg-rollup-display--none",Dt=`${Nt}.hide`,Bt=`${Nt}.show`,Ft=`click.${Nt}.data.api`;class Rt extends R{constructor(e,t={}){super(e,t),this._params=this._getParams(e,o({content:"text",offset:0,cnt:0,fade:!0,transition:!1,number:!1,height:0,ellipsis:{line:null},more:" еще ",button:{enable:!0,more:"Показать",less:"Свернуть"}},t)),this.classes={container:"vg-rollup",hidden:"vg-rollup-content--hidden",fade:"vg-rollup-content--fade",ellipsis:"vg-rollup-content--ellipsis",button:"vg-rollup-content--button",transition:"vg-rollup-content--transition"},this.total=0,this.count=0,this.offset=0,this.isOffset=!1,this._params.offset>0&&(this.offset=this._params.offset+this._params.cnt||0,this.isOffset=!0),this.build()}static get NAME(){return"rollup"}static get NAME_KEY(){return Nt}static toggle(e,t){const s=Rt.getOrCreateInstance(e);if(s.isShow()){let e="";if(s._params.number){let t=s.total-s.count;t>0&&(e=s._params.more+t)}t.setAttribute("aria-expanded",!1),s._element.classList.remove(Ht),t.innerHTML=s._params.button.more+e,s.switch(s._element,!0),H.trigger(s._element,Dt,{relatedTarget:t})}else s._element.classList.add(Ht),t.innerHTML=s._params.button.less,s.offset>0&&(s.isOffset?t.innerHTML=s._params.button.more:t.innerHTML=s._params.button.less),s.switch(s._element,!1),H.trigger(s._element,Bt,{relatedTarget:t})}build(e=null,t=!0){let s=this,a=e||s._element,i=a.clientHeight,n=s._params.height||i/2;a.classList.add(s.classes.container);let r=s._params.fade,o=s._params.transition,l=null!==s._params.ellipsis.line,d=s._params.button.enable,c=s._params.number;if(t||s.switch(a),i>n&&"text"===s._params.content)a.classList.add(s.classes.hidden),a.style.height=n+"px",m(),h(),p(),u();else if("elements"===s._params.content){let e=s._params.elements||"item",t=a.querySelectorAll("."+e),i=s._params.cnt||5,n=1;s.total=t.length,s.count=i;for(const e of t)n>i&&e.classList.add(qt),n++;!0===d&&(d=n-1>i),m(),h(),p(),u()}function m(){if(l){let e=s._params.ellipsis.line;r=!1,e?(a.classList.add(s.classes.ellipsis),a.style.webkitLineClamp=e):console.log("Переменная [data-line] или параметр[line] не должны быть пустыми")}}function h(){o&&a.classList.add(s.classes.transition)}function p(){r&&a.classList.add(s.classes.fade)}function u(){if(t&&(a.setAttribute("id",a.id),d)){let e="";if(c){let t=s.total-s.count;t>0&&(e=s._params.more+t)}let t=s._params.button.more;a.insertAdjacentHTML("afterend",'<div class="'+s.classes.button+'"><a href="#" aria-expanded="false" data-vg-toggle="rollup" data-vg-target="#'+a.id+'">'+t+e+"</a></div>")}}}switch(e,t=!1){const s=this;if(t)this.build(e,!1);else if(e.classList.remove(this.classes.hidden),e.classList.remove(this.classes.ellipsis),e.classList.remove(this.classes.fade),e.removeAttribute("style"),"elements"===s._params.content){let t=s._params.elements,a=[...e.querySelectorAll("."+t)];if(a.length)if(s.offset>0){let t=s._params.elements,a=[...e.querySelectorAll("."+t)];a.slice(s.count,s.offset).forEach((e=>e.classList.remove(qt))),s.offset=s.offset+s.settings.offset,s.offset>a.length&&(s.isOffset=!1,s.offset=0)}else a.forEach((e=>e.classList.remove(qt)))}}isShow(){return this._element.classList.contains(Ht)}static init(e,t={},s){l(s,[Rt.getOrCreateInstance(e,t)])}}H.on(document,Ft,'[data-vg-toggle="rollup"]',(function(e){const t=_.getElementFromSelector(this);t&&(["A","AREA"].includes(this.tagName)&&e.preventDefault(),i(this)||(this.setAttribute("aria-expanded",!0),Rt.toggle(t,this)))}));const zt=Rt;function Yt(e){for(let t=1;t<arguments.length;t++){let s=arguments[t];for(let t in s)e[t]=s[t]}return e}const Xt=function e(t,s){function a(e,a,i){if("undefined"==typeof document)return;"number"==typeof(i=Yt({},s,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);let n="";for(let e in i)i[e]&&(n+="; "+e,!0!==i[e]&&(n+="="+i[e].split(";")[0]));return document.cookie=e+"="+t.write(a,e)+n}return Object.create({set:a,get:function(e){if("undefined"==typeof document||arguments.length&&!e)return;let s=document.cookie?document.cookie.split("; "):[],a={};for(let i=0;i<s.length;i++){let n=s[i].split("="),r=n.slice(1).join("=");try{let s=decodeURIComponent(n[0]);if(a[s]=t.read(r,s),e===s)break}catch(e){}}return e?a[e]:a},remove:function(e,t){a(e,"",Yt({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,Yt({},this.attributes,t))},withConverter:function(t){return e(Yt({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(s)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),Kt="vg.lawcookie",Vt="show",Wt=`${Kt}.hide`,Gt=`${Kt}.hidden`,Ut=`${Kt}.show`,Jt=`${Kt}.shown`,Zt=`click.${Kt}.data.api`;class Qt extends R{static sParams={};constructor(e,t={}){super(e,t),this._params=this._getParams(e,o({storage:"local",delay:500,cookie:{name:"lawCookie",value:"yes",attributes:{}},animation:{enable:!0,in:"animate__fadeInUp",out:"animate__fadeOutDown",delay:800},ajax:{route:"",target:"",method:"get"}},t)),Qt.sParams=this._params,this._params.animation.delay=this._params.animation.enable?this._params.animation.delay:0,this._animation(this._element,Qt.NAME_KEY,this._params.animation)}static get NAME(){return"lawcookie"}static get NAME_KEY(){return Kt}toggle(){return this._isShown()?this.hide():this.show()}_isShown(){return this.storage().get()}show(){i(this._element)||H.trigger(this._element,Ut,{}).defaultPrevented||(this._element.classList.add(Vt),this._queueCallback((()=>{H.trigger(this._element,Jt,{})}),this._element,!0,this._params.delay))}hide(){H.trigger(this._element,Wt).defaultPrevented||setTimeout((()=>{this._element.classList.remove(Vt),this._queueCallback((()=>H.trigger(this._element,Gt)),this._element,!0)}),this._params.animation.delay)}storage(){return this._storage={isCookie:"cookie"===this._params.storage,storage:"cookie"===this._params.storage?Xt:localStorage,name:this._params.cookie.name,value:this._params.cookie.value,attributes:this._params.cookie.attributes},this}get(){return this._storage.isCookie?this._storage.storage.get(this._storage.name):this._storage.storage.getItem(this._storage.name)}set(){this._storage.isCookie?this._storage.storage.set(this._storage.name,this._storage.value,this._storage.attributes):this._storage.storage.setItem(this._storage.name,this._storage.value)}dispose(){super.dispose()}static reset(){Xt.remove(Qt.sParams.cookie.name),localStorage.clear(),location.reload()}static init(e,t={}){Qt.getOrCreateInstance(e,t).toggle()}}D(Qt),H.on(document,Zt,'[data-vg-toggle="lawcookie"]',(function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),i(this))return;const t=_.find("#vg-lawcookie");if(!t)return;const s=Qt.getOrCreateInstance(t);s.storage().set(),s.hide()})),H.on(document,Zt,'[data-vg-toggle="lawcookie-clear"]',(function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),i(this))return;const t=_.find("#vg-lawcookie");t&&(Qt.getOrCreateInstance(t).dispose(),location.reload())}));const es=Qt,ts="vg.select",ss="show",as="active",is="vg-select",ns="vg-select-dropdown",rs="vg-select-list",os="vg-select-list--option",ls="vg-select-list--optgroup",ds="vg-select-current",cs=`click.${ts}.data.api`,ms=`keyup.${ts}.data.api`,hs=`reset.${ts}.data.api`,ps=`${ts}.change`,us=`${ts}.hide`,gs=`${ts}.hidden`,_s=`${ts}.show`,fs=`${ts}.shown`,vs='[data-vg-toggle="select"]';let bs;class ws extends R{constructor(e,t={}){super(e,t),this._params=this._getParams(e,o({search:!1,placeholder:""},t)),e.parentElement.style.position="relative",this._drop=_.find("."+ns,this._element),this.refresh()}static get NAME(){return"select"}static get NAME_KEY(){return ts}static buildListOptions(e,t){let a=e.options,i=document.createElement("ul");i.classList.add(rs);let n=e.querySelectorAll("optgroup");if(n.length){let e=!1;[...n].forEach((function(t){let s=document.createElement("ol");s.classList.add(ls);let a=document.createElement("li");a.innerHTML=t.label.trim(),a.classList.add("vg-select-list--optgroup-title"),s.prepend(a),r(_.findAll("option",t),s,e),i.append(s),e=!0}))}else r(a,i,!1);return t.append(i),i;function r(t,a,i){let n=0;for(const r of t){let t=document.createElement("li");t.innerHTML=r.innerHTML.trim().replace(/<\/[^>]+(>|$)/g,""),t.dataset.value=b.get(r,"value"),t.classList.add(os),b.set(t,"data-vg-toggle","select-option");let o=b.get(r);if(!s(o))for(const e of Object.keys(o))b.set(t,"data-"+e,o[e]);n!==e.selectedIndex||i||t.classList.add("selected"),b.has(r,"disabled")&&t.classList.add("disabled"),b.has(r,"hidden")&&t.classList.add("hidden"),a.append(t),n++}}}static build(e,t){let a,i=e.dataset.placeholder||"",n=e.dataset.search||!1;if("true"===e.dataset?.inited&&!t)return;t&&ws.destroy(e),a=i&&0===e.selectedIndex?'<span class="vg-select-current--placeholder">'+i+"<span>":e.options[e.selectedIndex].innerText;let r=b.get(e,"class"),o=document.createElement("div");r=r.split(" ");for(const e of r)o.classList.add(e);b.has(e,"disabled")&&o.classList.add("disabled");let l=b.get(e);if(!s(l))for(const e of Object.keys(l))b.set(o,"data-"+e,l[e]);let d=document.createElement("div");d.classList.add(ds),b.set(d,"data-vg-toggle","select"),b.set(d,"aria-expanded","false"),d.innerHTML=a.trim(),o.append(d);let c=document.createElement("div");if(c.classList.add(ns),o.append(c),ws.buildListOptions(e,c),e.insertAdjacentElement("afterend",o),e.dataset.inited="true",n){let e=document.createElement("div");e.classList.add("vg-select-search");let t=document.createElement("input");b.set(t,"name","vg-select-search"),b.set(t,"type","text"),b.set(t,"placeholder","Поиск..."),e.append(t),c.prepend(e)}return o}toggle(e){return this._isShown()?this.hide():this.show(e)}show(e){if(!i(this._element)&&!H.trigger(this._element,_s,{relatedTarget:e}).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))H.on(e,"mouseover",m);if(this._element.classList.add(ss),this._params.search){let e=_.find("input",this._element);e&&e.focus()}this._queueCallback((()=>{this._element.classList.add(as),H.trigger(this._element,fs,{relatedTarget:e})}),this._drop,!0,50)}}hide(){!i(this._element)&&this._isShown()&&this._completeHide()}_completeHide(){if(H.trigger(this._element,us,{}).defaultPrevented)return;this._element.classList.remove(as);let e=_.find(vs,this._element);if(b.set(e,"aria-expanded","false"),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))H.off(e,"mouseover",m);this._queueCallback((()=>{this._element.classList.remove(ss),H.trigger(this._element,gs,{})}),this._drop,!0,10)}_isShown(){return this._element.classList.contains(ss)}refresh(){const e=this._element.previousSibling;new MutationObserver((()=>{clearTimeout(bs),bs=setTimeout((()=>{ws.build(e,!0)}),100)})).observe(e,{attributeFilter:["disabled","required","style","hidden"],childList:!0,subtree:!0,characterDataOldValue:!0})}dispose(){super.dispose()}static destroy(e){let t=e.nextElementSibling;t&&t.classList.contains(is)&&(t.remove(),e.selectedIndex=0,[...e.querySelectorAll("option")].forEach((function(t,s){t.hasAttribute("selected")&&(e.selectedIndex=s)})))}static hideOpenToggles(e){const t=_.findAll(".vg-select:not(.disabled):not(:disabled).show");for(const s of t){const t=ws.getInstance(s);if(!t)continue;if(e.target.closest("."+is)===t._element)return;if(e.composedPath().includes(t._element))continue;const a={relatedTarget:t._element};"click"===e.type&&(a.clickEvent=e),t._completeHide(a)}}static clearDrops(e){2===e.button||"keyup"===e.type&&"Tab"!==e.key||ws.hideOpenToggles(e)}static changeSelector(e,t,a={}){!n(a)&&s(a)||(e.value=r(t),H.trigger(e,ps,{data:a}),H.trigger(e,"change",{data:a}))}static init(e,t={},s=!1){let a=ws.build(e);ws.getOrCreateInstance(a,t)}}H.on(document,cs,ws.clearDrops),H.on(document,cs,vs,(function(){const e=this.closest("."+is);b.set(this,"aria-expanded",!0);const t=_.find(".vg-select.show");t&&t!==e&&ws.getInstance(t).hide(),ws.getOrCreateInstance(e).toggle(this)})),H.on(document,cs,'[data-vg-toggle="select-option"]',(function(e){let t=e.target;if(!t.classList.contains("disabled")){let e=t.closest("."+is),s=e.querySelectorAll("."+os);if(s.length)for(const e of s)e.classList.remove("selected");t.classList.add("selected"),e.querySelector("."+ds).innerText=t.innerText,e.classList.remove("show");let a=e.previousSibling;ws.changeSelector(a,t.dataset.value,{value:t.dataset.value,title:t.innerHTML})}})),H.on(document,ms,"[name=vg-select-search]",(function(e){let t=this,s=t?.closest("."+ns).querySelector("."+rs);if(s){let e=[...s.querySelectorAll("."+os)],a=[...s.querySelectorAll("."+ls)],i=t?.value;e=e.concat(a);for(const t of e)b.show(t);if(i.length){i=i.trim(),i=i.toLowerCase(),i=function(e){let t,s="й ц у к е н г ш щ з х ъ ф ы в а п р о л д ж э я ч с м и т ь б ю".split(/ +/g),a="q w e r t y u i o p [ ] a s d f g h j k l ; ' z x c v b n m , .".split(/ +/g);for(t=0;t<s.length;t++)e=(e=e.split(a[t]).join(s[t])).split(a[t].toUpperCase()).join(s[t].toUpperCase());return e}(i);for(const t of e)-1===t.innerText.toLowerCase().indexOf(i)&&b.hide(t)}}})),H.on(document,hs,"form",(function(){_.findAll("select."+is,this).forEach((e=>{ws.build(e,!0)}))}));const ys=ws,ks="vg.alert",Ls=`keydown.dismiss.${ks}`,xs=`hidePrevented.${ks}`,Es=`click.${ks}.data.api`;class As extends R{constructor(e,t={}){super(e,t),this._params=this._getParams(e,o({backdrop:!0,overflow:!0,keyboard:!0,confirm:!0,showInside:!0,theme:"default",elements:[{title:"Вы уверены?",element:"button",type:"confirm",classes:["btn","btn-primary"]}],animation:{enable:!1,in:"animate__rollIn",out:"animate__rollOut",delay:800},ajax:{route:"",target:"",method:"get",loader:!1}},t)),this._addEventListeners(),this._dismissElement(),this._params.animation.delay=this._params.animation.enable?this._params.animation.delay:0,this._animation(this._element,As.NAME_KEY,this._params.animation)}static get NAME(){return"alert"}static get NAME_KEY(){return ks}static run(e,t={},s){return As.build(e,t,s)}static build(e,t,s){t=o({theme:"default"},t);let a=As.getOrCreateInstance(void 0,t);l(s,[a]),a.show()}toggle(e){return this._isShown()?this.hide():this.show(e)}show(e){}hide(){}dispose(){super.dispose()}_isShown(){return this._element.classList.contains("show")}_addEventListeners(){H.on(document,Ls,(e=>{"Escape"===e.key&&(this._params.keyboard?this.hide():H.trigger(this._element,xs))}))}}D(As),H.on(document,Es,'[data-vg-toggle="alert"]',(function(e){}));const Cs=As,Ts="vg.toast",Ss="vg-toast-open",Ms="show",Os=`${Ts}.hide`,$s=`${Ts}.hidden`,Ps=`${Ts}.show`,js=`${Ts}.shown`,Is=`${Ts}.loaded`,Ns=`keydown.dismiss.${Ts}`,Hs=`hidePrevented.${Ts}`,qs=`click.${Ts}.data.api`;class Ds extends R{constructor(e,t={}){super(e,t),this._params=this._getParams(e,o({static:!0,placement:"bottom center",autohide:!1,delay:3e3,enableClickToast:!0,enableButtonClose:!0,keyboard:!0,theme:"dark",stack:{enable:!0,max:5},animation:{enable:!0,in:"animate__fadeIn",out:"animate__fadeOut",delay:400},ajax:{route:"",target:"",method:"get",loader:!1}},t)),this._params.animation.delay=this._params.animation.enable?this._params.animation.delay:0,this._animation(this._element,Ds.NAME_KEY,this._params.animation),this._dismissElement(),this._addEventListeners(),this._timeout=null}static get NAME(){return"toast"}static get NAME_KEY(){return Ts}static run(e,t={},s){return Ds.build(e,t,s)}static build(e,t,s){t=o({placement:"bottom center",static:!1,theme:"dark",stack:{enable:!1}},t);let a=document.createElement("div");a.classList.add("vg-toast"),a.id="vg-toast-"+h(),"theme"in t&&a.classList.add("vg-toast-"+t.theme),"placement"in t&&t.placement.split(" ").forEach((e=>a.classList.add(e)));let i=document.createElement("div");if(i.classList.add("vg-toast-wrapper"),"type"in t){let e=document.createElement("div");e.classList.add("vg-toast-icon"),i.append(e)}let n=document.createElement("div");n.classList.add("vg-toast-content");let r=document.createElement("div");if(r.classList.add("vg-toast-body"),"string"==typeof e)r.innerHTML=e,n.append(r);else if(Array.isArray(e))if(e.length>1){let t=document.createElement("div");t.classList.add("vg-toast-header"),t.innerHTML=e[0],n.append(t),r.innerHTML=e[1],n.append(r)}else r.innerHTML=e[0],n.append(r);if(i.append(n),"enableButtonClose"in t&&t.enableButtonClose){let e=document.createElement("div");e.classList.add("vg-toast-button"),e.innerHTML='<button class="vg-btn-close" data-vg-dismiss="toast"></button>',i.append(e)}a.append(i),document.body.append(a);let d=Ds.getOrCreateInstance(a,t);l(s,[d]),d.show()}toggle(e){return this._isShown()?this.hide():this.show(e)}show(e){i(this._element)||(this._clearTimeout(),this._params=this._getParams(e||{},this._params),this._route((function(e,t){H.trigger(this._element,Is,{stats:e,data:t})})),H.trigger(this._element,Ps,{relatedTarget:e}).defaultPrevented||(this._element.classList.add(Ms),document.body.classList.add(Ss),this._setPlacement(),this._queueCallback((()=>{this._element.classList.add(Ms),H.trigger(this._element,js,{relatedTarget:e}),this._scheduleHide()}),this._element,!0,0)))}hide(){i(this._element)||H.trigger(this._element,Os).defaultPrevented||setTimeout((()=>{this._element?.classList.remove(Ms),this._queueCallback((()=>{document.body.classList.remove(Ss),H.trigger(this._element,$s),this._params.stack.enable&&this._setPlacement(),this._params.static||this.dispose()}),this._element,!1,this._params.animation.delay)}),this._params.animation.delay)}dispose(){this._clearTimeout(),this._isShown()&&this._element.classList.remove(Ms),this._params.static||this._element.remove(),super.dispose()}_scheduleHide(){this._params.autohide&&(this._timeout=setTimeout((()=>{this.hide()}),this._params.delay))}_isShown(){return this._element.classList.contains(Ms)}_setPlacement(){let e=this._enableStack();if(this._params.stack.enable&&e.length>this._params.stack.max){let t=e.shift();Ds.getInstance(t.el).hide()}e.forEach((e=>{let t=e.el.classList.contains("top"),s=e.el.classList.contains("bottom"),a=e.el.classList.contains("left"),i=e.el.classList.contains("right"),n=e.el.classList.contains("center");t||s||n||i||a||(s=!0,n=!0),n?a?(e.el.style.left=0,e.el.style.bottom="calc(50% - ("+e.top+"px))"):i?(e.el.style.right=0,e.el.style.bottom="calc(50% - ("+e.top+"px))"):s?(e.el.style.left="calc(50% - ("+e.el.clientWidth+"px) / 2)",e.el.style.bottom=e.top+"px"):t?(e.el.style.left="calc(50% - ("+e.el.clientWidth+"px) / 2)",e.el.style.top=e.top+"px"):(e.el.style.left="calc(50% - ("+e.el.clientHeight+"px) / 2)",e.el.style.bottom="calc(50% - "+e.top+"px)"):(a&&(e.el.style.left=0),s&&(e.el.style.bottom=e.top+"px"),t&&(e.el.style.top=e.top+"px"),i&&(e.el.style.right=0))}))}_enableStack(){let e=[..._.findAll(".vg-toast.show")],t=0;return this._params.stack.enable?(e=e.map((e=>({el:e,top:e.clientHeight}))),e.map((function(e,s){return 0===s?{el:e.el,top:0}:(t+=e.top,{el:e.el,top:t})}))):(e.forEach((e=>{e!==this._element&&Ds.getInstance(e).hide()})),[{el:this._element,top:0}])}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}_addEventListeners(){H.on(document,Ns,(e=>{"Escape"===e.key&&(this._params.keyboard?this.hide():H.trigger(this._element,Hs))})),this._params.enableClickToast&&(this._element.classList.add("vg-toast-pointer"),H.on(document,qs,"#"+this._element.id,(()=>{this.hide()})))}}D(Ds),H.on(document,qs,'[data-vg-toggle="toast"]',(function(e){const t=_.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),i(this)||(this.setAttribute("aria-expanded",!0),H.one(t,$s,(()=>{this.setAttribute("aria-expanded",!1)})),Ds.getOrCreateInstance(t).toggle(this))}));const Bs=Ds;vg=t})();
|
|
2
|
+
var vg;(()=>{"use strict";var e={d:(t,s)=>{for(var a in s)e.o(s,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:s[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function s(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}e.r(t),e.d(t,{VGAlert:()=>Ts,VGCollapse:()=>ke,VGDropdown:()=>tt,VGFormSender:()=>Nt,VGLawCookie:()=>ts,VGModal:()=>Et,VGNav:()=>qe,VGRollup:()=>Yt,VGSelect:()=>ks,VGSidebar:()=>de,VGToast:()=>Fs});const a=e=>!!r(e)&&void 0!==e.nodeType,i=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"));function n(e){if(!a(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),s=e.closest("details:not([open])");if(!s)return t;if(s!==e){const t=e.closest("summary");if(t&&t.parentNode!==s)return!1;if(null===t)return!1}return t}function r(e){return e&&"object"==typeof e}function o(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function l(...e){const t=e=>e&&"object"==typeof e;return e.reduce(((e,s)=>(Object.keys(s).forEach((a=>{const i=e[a],n=s[a];Array.isArray(i)&&Array.isArray(n)?e[a]=i.concat(...n):t(i)&&t(n)?e[a]=l(i,n):e[a]=n})),e)),{})}function d(e,t=[],s=e){return"function"==typeof e?e(...t):s}const c="transitionend",m=e=>{e.offsetHeight},h=()=>{};function p(e=7){let t="";let s=0;for(;s<e;)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random())),s+=1;return t}const u=()=>"rtl"===document.documentElement.dir,g=e=>{let t=e.getAttribute("data-vg-target");if(!t||"#"===t){let s=e.getAttribute("href");if(!s||!s.includes("#")&&!s.startsWith("."))return null;s.includes("#")&&!s.startsWith("#")&&(s=`#${s.split("#")[1]}`),t=s&&"#"!==s?s.trim():null}return t?t.split(",").map((e=>(e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,((e,t)=>`#${CSS.escape(t)}`))),e))(e))).join(","):null},_={find:(e,t=document.documentElement)=>a(e)?e:Element.prototype.querySelector.call(t,e),findAll:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),getSelectorFromElement(e){const t=g(e);return t&&_.find(t)?t:null},getElementFromSelector(e){const t=g(e);return t?_.find(t):null},getMultipleElementsFromSelector(e){const t=g(e);return t?_.findAll(t):[]},prev:e=>e.previousElementSibling||null},f=_,v=new Map,b={set(e,t,s){v.has(e)||v.set(e,new Map);const a=v.get(e);a.has(t)||0===a.size?a.set(t,s):console.error(`VGApp не допускает более одного экземпляра для каждого элемента. Связанный экземпляр: ${Array.from(a.keys())[0]}.`)},get:(e,t)=>v.has(e)&&v.get(e).get(t)||null,remove(e,t){if(!v.has(e))return;const s=v.get(e);s.delete(t),0===s.size&&v.delete(e)}},w={get(e,t="data",s=!0){if(!e)return{};if("data"===t){let t=["data-vg-toggle","data-vg-target","data-vg-dismiss"],a={},i=[].filter.call(e.attributes,(function(e){return/^data-/.test(e.name)}));return i.length&&i.forEach((function(e){let i=e.name;t.includes(i)||(s&&(i=i.slice(5)),a[i]=o(e.value))})),a}return"all"===t?e.getAttributeNames().reduce(((t,s)=>({...t,[s]:e.getAttribute(s)})),{}):e.getAttribute(t)},has:(e,t)=>e.hasAttribute(t),set(e,t,s){a(e)&&t&&e.setAttribute(t,s)},remove(e,t){a(e)&&t&&e.removeAttribute(t)},hide(e){e.style.display="none"},show(e,t="block"){e.style.display=t}},y=class{constructor(e,t=null){this._params=this.merge(e,t)}get(){return this._params}fromElement(e){return a(e)?w.get(e):{}}merge(e,t){let s=l(e,this.fromElement(t));for(let e in s)if(-1!==e.indexOf("-")){let t=e.split("-"),a=o(s[e]);t[0]in s&&t[1]in s[t[0]]&&(s[t[0]][t[1]]=a),delete s[e]}return"params"in s&&(s=l(s,s.params),delete s.params),s}},k=/[^.]*(?=\..*)\.|.*/,L=/\..*/,x=/::\d+$/,E={};let A=1;const C={mouseenter:"mouseover",mouseleave:"mouseout"},T=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","submit","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","popstate","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function S(e,t){return t&&`${t}::${A++}`||e.uidEvent||A++}function M(e){const t=S(e);return e.uidEvent=t,E[t]=E[t]||{},E[t]}function O(e,t,s=null){return Object.values(e).find((e=>e.callable===t&&e.delegationSelector===s))}function $(e,t,s){const a="string"==typeof t,i=a?s:t||s;let n=(r=(r=e).replace(L,""),C[r]||r);var r;return T.has(n)||(n=e),[a,i,n]}function P(e,t,s,a,i){if("string"!=typeof t||!e)return;let[n,r,o]=$(t,s,a);if(t in C){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};r=e(r)}const l=M(e),d=l[o]||(l[o]={}),c=O(d,r,n?s:null);if(c)return void(c.oneOff=c.oneOff&&i);const m=S(r,t.replace(k,"")),h=n?function(e,t,s){return function a(i){const n=e.querySelectorAll(t);for(let{target:r}=i;r&&r!==this;r=r.parentNode)for(const o of n)if(o===r)return N(i,{delegateTarget:r}),a.oneOff&&H.off(e,i.type,t,s),s.apply(r,[i])}}(e,s,r):function(e,t){return function s(a){return N(a,{delegateTarget:e}),s.oneOff&&H.off(e,a.type,t),t.apply(e,[a])}}(e,r);h.delegationSelector=n?s:null,h.callable=r,h.oneOff=i,h.uidEvent=m,d[m]=h,e.addEventListener(o,h,n)}function j(e,t,s,a,i){const n=O(t[s],a,i);n&&(e.removeEventListener(s,n,Boolean(i)),delete t[s][n.uidEvent])}function I(e,t,s,a){const i=t[s]||{};for(const[n,r]of Object.entries(i))n.includes(a)&&j(e,t,s,r.callable,r.delegationSelector)}function N(e,t={}){for(const[s,a]of Object.entries(t))try{e[s]=a}catch{Object.defineProperty(e,s,{configurable:!0,get:()=>a})}return e}const H={on(e,t,s,a){P(e,t,s,a,!1)},one(e,t,s,a){P(e,t,s,a,!0)},off(e,t,s,a){if("string"!=typeof t||!e)return;const[i,n,r]=$(t,s,a),o=r!==t,l=M(e),d=l[r]||{},c=t.startsWith(".");if(void 0===n){if(c)for(const s of Object.keys(l))I(e,l,s,t.slice(1));for(const[s,a]of Object.entries(d)){const i=s.replace(x,"");o&&!t.includes(i)||j(e,l,r,a.callable,a.delegationSelector)}}else{if(!Object.keys(d).length)return;j(e,l,r,n,i?s:null)}},trigger(e,t,s){if("string"!=typeof t||!e)return null;const a=N(new Event(t,{bubbles:!0,cancelable:!0}),s);return e.dispatchEvent(a),a}},q=H,D=e=>({error:'<svg viewBox="0 0 87 87" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="ui-success" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-2" transform="translate(2.000000, 2.000000)"><circle id="Oval-2" stroke="rgba(252, 191, 191, .5)" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><circle class="ui-error-circle" stroke="#F74444" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><path class="ui-error-line1" d="M22.244224,22 L60.4279902,60.1837662" id="Line" stroke="#F74444" stroke-width="3" stroke-linecap="square"></path><path class="ui-error-line2" d="M60.755776,21 L23.244224,59.8443492" id="Line" stroke="#F74444" stroke-width="3" stroke-linecap="square"></path></g></g></svg>',success:'<svg viewBox="0 0 87 87" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="ui-error" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-3" transform="translate(2.000000, 2.000000)"><circle id="Oval-2" stroke="rgba(117, 183, 152, 0.4)" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><circle class="ui-success-circle" id="Oval-2" stroke="#A5DC86" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><polyline class="ui-success-path" id="Path-2" stroke="#A5DC86" stroke-width="4" points="19 38.8036813 31.1020744 54.8046875 63.299221 28"></polyline></g></g></svg>',waiting:'<svg viewBox="0 0 87 87" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="ui-waiting" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-3" transform="translate(2.000000, 2.000000)"><circle id="Oval-2" stroke="rgba(255, 218, 106, 0.4)" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><circle class="ui-waiting-circle" id="Oval-2" stroke="#ffda6a" stroke-width="4" cx="41.5" cy="41.5" r="41.5"></circle><path class="ui-waiting-line1" d="M43 63C54.598 63 64 53.598 64 42C64 30.402 54.598 21 43 21C31.402 21 22 30.402 22 42C22 53.598 31.402 63 43 63Z" stroke-width="3" stroke="#ffda6a" stroke-linecap="round" stroke-linejoin="round"/><path class="ui-waiting-line2" d="M40.6667 32.6641V44.3307H52.3334" stroke="#ffda6a" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></g></g></svg>',dots:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-three-dots-vertical" viewBox="0 0 16 16"><path d="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/></svg>',cross:'<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 224.512 224.512" xml:space="preserve"><g><polygon points="224.507,6.997 217.521,0 112.256,105.258 6.998,0 0.005,6.997 105.263,112.254 0.005,217.512 6.998,224.512 112.256,119.24 217.521,224.512 224.507,217.512 119.249,112.254 "/></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g></svg>'}[e]??{}),B=(e,t="hide")=>{const s=`click.dismiss.${e.EVENT_KEY}`,a=e.NAME;q.on(document,s,`[data-vg-dismiss="${a}"]`,(function(s){if(["A","AREA"].includes(this.tagName)&&s.preventDefault(),i(this))return;const n=f.getSelectorFromElement(this)||this.closest(`.vg-${a}`);e.getOrCreateInstance(n)[t]()}))},F={x:function(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;let e,t=["MSXML2.XmlHttp.6.0","MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"];for(let s=0;s<t.length;s++)try{e=new ActiveXObject(t[s]);break}catch(e){}return e},send:function(e,t,s,a,i){void 0===i&&(i=!0);let n=F.x();n.open(s,e,i),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.onreadystatechange=function(){4===n.readyState&&(200===n.status?t("success",{text:n.statusText,response:n.responseText,code:n.status}):t("error",{text:n.statusText,response:n.responseText,code:n.status}))},n.send(a)},get:function(e,t,a,i){let n=[];if(!s(t))for(let e of t)n.push(encodeURIComponent(e[0])+"="+encodeURIComponent(e[1]));F.send(e+(n.length?"?"+n.join("&"):""),a,"GET",null,i)},post:function(e,t,s,a){F.send(e,s,"POST",t,a)}},R=class{constructor(e,t,s={}){this._params=l({enable:!1,in:"animate__backInUp",out:"animate__backOutUp",delay:0},s),this.classes={animated:"animate__animated"},this._params.enable&&a(e)&&(this._element=e,this._name_key=t,this._element.classList.contains(this.classes.animated)||this._element.classList.add(this.classes.animated),this._triggers())}_triggers(){q.on(this._element,this._name_key+".show",(()=>{this._element.classList.remove(this._params.out),this._element.classList.add(this._params.in)})),q.on(this._element,this._name_key+".hide",(()=>{this._element.classList.remove(this._params.in),this._element.classList.add(this._params.out)})),q.on(this._element,this._name_key+".hidden",(()=>{this._element.classList.remove(this._params.out)}))}},z=class{constructor(e){if(e){if(this._element=f.find(e),!this._element)throw new Error("Товарищ! Первый параметр не должен быть пустым!");this._params={},b.set(this._element,this.constructor.NAME_KEY,this)}}_getParams(e,t){return new y(t,e).get()}dispose(){b.remove(this._element,this.constructor.NAME_KEY),q.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_route(e){const t=this;let s=null;const a=e=>{s&&(s.innerHTML=e)};t._params.hasOwnProperty("ajax")&&t._params.ajax.route&&(!1 in t._params.ajax&&(t._params.ajax.method="get"),"target"in t._params.ajax&&t._params.ajax.target&&(s=f.find(t._params.ajax.target)),"loader"in t._params.ajax&&t._params.ajax.loader&&a('<div class="vg-loader"></div>'),F[t._params.ajax.method](t._params.ajax.route,t._params.ajax.data||{},(function(t,s){a(s.response),d(e,[t,s])})))}_dismissElement(){let e=D("cross"),t=this._element.querySelector(".vg-btn-close");t&&(t.querySelector("svg")||t.insertAdjacentHTML("beforeend",e))}_queueCallback(e,t,s=!0,a){!function(e,t,s=!0,a){if(!s)return void d(e);const i=a||(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:s}=window.getComputedStyle(e);const a=Number.parseFloat(t),i=Number.parseFloat(s);return a||i?(t=t.split(",")[0],s=s.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(s))):0})(t)+5;let n=!1;const r=({target:s})=>{s===t&&(n=!0,t.removeEventListener(c,r),d(e))};t.addEventListener(c,r),setTimeout((()=>{n||(e=>{e.dispatchEvent(new Event(c))})(t)}),i)}(e,t,s,a)}_animation(e,t,s={}){new R(e,t,s)}static getInstance(e){return b.get(f.find(e),this.NAME_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,s(t)?{}:t)}static get DATA_KEY(){return`vg.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}},Y=class{static append(){document.body.style.paddingRight=function(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}()+"px",document.body.style.overflow="hidden"}static destroy(){document.body.style.overflow="",document.body.style.paddingRight="",w.get(document.body,"style")||w.remove(document.body,"style")}},X="vg-backdrop",K="fade";class V{static show(e){V._append(),d(e)}static hide(e){V._destroy(),d(e)}static _append(){if(f.find("."+X))return!1;let e=document.createElement("div");e.classList.add(X),document.body.append(e),setTimeout((()=>{e.classList.add(K)}),50),q.on(e,"mousedown.vg.backdrop",(()=>{V.hide(),Y.destroy()}))}static _destroy(){let e=f.find("."+X);e&&(e.classList.remove(K),setTimeout((()=>{e.remove()}),500))}}const W=V,G="vg.sidebar",U="show",J="vg-sidebar-open",Z=`${G}.hide`,Q=`${G}.hidden`,ee=`${G}.show`,te=`${G}.shown`,se=`${G}.loaded`,ae=`keydown.dismiss.${G}`,ie=`hidePrevented.${G}`,ne=`click.${G}.data.api`,re=`popstate.${G}.data.api`,oe=`DOMContentLoaded.${G}.data.api`;class le extends z{constructor(e,t={}){super(e,t),this._params=this._getParams(e,l({backdrop:!0,overflow:!0,keyboard:!0,hash:!1,animation:{enable:!1,in:"animate__rollIn",out:"animate__rollOut",delay:800},ajax:{route:"",target:"",method:"get",loader:!1}},t)),this._addEventListeners(),this._dismissElement(),this._params.animation.delay=this._params.animation.enable?this._params.animation.delay:0,this._animation(this._element,le.NAME_KEY,this._params.animation)}static get NAME(){return"sidebar"}static get NAME_KEY(){return G}toggle(e){return this._isShown()?this.hide():this.show(e)}show(e){const t=this;i(t._element)||(e&&(t._params=t._getParams(e,t._params)),t._route((function(e,s){q.trigger(t._element,se,{stats:e,data:s})})),q.trigger(t._element,ee,{relatedTarget:e}).defaultPrevented||(t._params.backdrop&&W.show(),t._params.overflow&&Y.append(),this._params.hash&&(window.history.pushState(null,"vg-sidebar-open","#"+this._element.id),q.on(window,re,(()=>{this.hide()}))),t._element.classList.add(U),document.body.classList.add(J),t._queueCallback((()=>{q.on(f.find(".vg-backdrop"),"mousedown.vg.backdrop",(function(){t.hide()})),q.trigger(t._element,te,{relatedTarget:e})}),t._element,!0,50)))}hide(){const e=this;i(e._element)||q.trigger(this._element,Z).defaultPrevented||setTimeout((()=>{e._element.setAttribute("aria-expanded",!1),e._element.classList.remove(U),this._queueCallback((()=>{e._params.backdrop&&W.hide((function(){e._params.overflow&&Y.destroy()})),e._params.overflow&&Y.destroy(),e._params.hash&&history.pushState("",document.title,window.location.pathname+window.location.search),document.body.classList.remove(J),q.trigger(this._element,Q)}),this._element,!0)}),this._params.animation.delay)}dispose(){super.dispose()}_isShown(){return this._element.classList.contains(U)}_addEventListeners(){q.on(document,ae,(e=>{"Escape"===e.key&&(this._params.keyboard?this.hide():q.trigger(this._element,ie))}))}}B(le),q.on(document,ne,'[data-vg-toggle="sidebar"]',(function(e){const t=f.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),i(this))return;this.setAttribute("aria-expanded",!0),q.one(t,Q,(()=>{this.setAttribute("aria-expanded",!1)}));const s=f.find(".vg-sidebar.show");s&&s!==t&&le.getInstance(s).hide(),le.getOrCreateInstance(t).toggle(this)})),q.on(document,oe,(function(){let e=window.location.hash.slice(1);if(e){let t=f.find("#"+e);if(t&&t.classList.contains("vg-sidebar")){if(i(t))return;le.getOrCreateInstance(t).toggle()}}}));const de=le,ce="vg.collapse",me="show",he="vg-collapse",pe="vg-collapsing",ue=`:scope .${he} .${he}`,ge='[data-vg-toggle="collapse"]',_e=`${ce}.hide`,fe=`${ce}.hidden`,ve=`${ce}.show`,be=`${ce}.shown`,we=`click.${ce}.data.api`;class ye extends z{constructor(e,t={}){super(e,t),this._params=this._getParams(e,l({toggle:!0,parent:null,ajax:{route:"",target:"",method:"get",loader:!1}},t)),this._isTransitioning=!1,this._triggerArray=[];const s=f.findAll(ge);for(const e of s){const t=f.getSelectorFromElement(e),s=f.findAll(t).filter((e=>e===this._element));null!==t&&s.length&&this._triggerArray.push(e)}this._initializeChildren(),this._params.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._params.toggle&&this.toggle()}static get NAME(){return"collapse"}static get NAME_KEY(){return ce}toggle(e){return this._isShown()?this.hide():this.show(e)}show(){const e=this;if(e._isTransitioning||e._isShown())return;let t=[];if(!(e._params.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((e=>e!==this._element)).map((e=>ye.getOrCreateInstance(e,{toggle:!1})))),t.length&&t[0]._isTransitioning||q.trigger(e._element,ve).defaultPrevented)){for(const e of t)e.hide();e._element.classList.remove(he),e._element.classList.add(pe),e._element.style.height=0,e._addAriaAndCollapsedClass(e._triggerArray,!0),e._isTransitioning=!0,e._route(),e._queueCallback((()=>{e._isTransitioning=!1,e._element.classList.remove(pe),e._element.classList.add(he,me),e._element.style.height="",q.trigger(e._element,be)}),e._element,!0),e._element.style.height=`${e._element.scrollHeight}px`}}hide(){const e=this;if(!e._isTransitioning&&e._isShown()&&!q.trigger(e._element,_e).defaultPrevented){e._element.style.height=`${this._element.getBoundingClientRect().height}px`,m(e._element),e._element.classList.add(pe),e._element.classList.remove(he,me);for(const t of e._triggerArray){const s=f.getElementFromSelector(t);s&&!e._isShown(s)&&e._addAriaAndCollapsedClass([t],!1)}e._isTransitioning=!0,e._element.style.height="",e._queueCallback((()=>{e._isTransitioning=!1,e._element.classList.remove(pe),e._element.classList.add(he),q.trigger(e._element,fe)}),e._element,!0)}}dispose(){super.dispose()}_isShown(e=this._element){return e.classList.contains(me)}_addAriaAndCollapsedClass(e,t){if(e.length)for(const s of e)this._changeStateButton(s,t)}_initializeChildren(){if(!this._params.parent)return;const e=this._getFirstLevelChildren(ge);for(const t of e){const e=f.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=f.find(ue,this._params.parent);return f.find(e,this._params.parent).filter((e=>!t.includes(e)))}_changeStateButton(e,t){e.classList.toggle("vg-collapsed",!t),e.setAttribute("aria-expanded",t),e.innerHTML=w.get(e,`data-${t?"hide":"show"}-text`)||e.innerHTML}}q.on(document,we,ge,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault(),f.getMultipleElementsFromSelector(this).forEach((function(e){ye.getOrCreateInstance(e,{toggle:!1}).toggle()}))}));const ke=ye,Le=class{constructor(){this.breakpoints={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400,xxxl:1600}}static check(e){return(new this).define(e)}static checkMobileOrTablet(){let e=!1;var t;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.slice(0,4)))&&(e=!0),e}define(e){let t=window.innerWidth,s=this._checkResponsiveClass(e),a=this.breakpoints,i=Object.keys(a).find((e=>a[e]===s)),n=Object.keys(a),r=n.indexOf(i);return t>=a[n[r+1]]}_checkResponsiveClass(e){let t=e._element,s=e._params,a=0;return a=t.classList.contains(s.classes.XXXL)?this.breakpoints.xxxl:t.classList.contains(s.classes.XXL)?this.breakpoints.xxl:t.classList.contains(s.classes.XL)?this.breakpoints.xl:t.classList.contains(s.classes.LG)?this.breakpoints.lg:t.classList.contains(s.classes.MD)?this.breakpoints.md:t.classList.contains(s.classes.SM)?this.breakpoints.sm:(t.classList.contains(s.classes.XS),this.breakpoints.xs),a}},xe="vg.nav",Ee="show",Ae="fade",Ce="active",Te=`${xe}.hide`,Se=`${xe}.hidden`,Me=`${xe}.show`,Oe=`${xe}.shown`,$e=`mouseover.${xe}.data.api`,Pe=`mouseout.${xe}.data.api`,je=`click.${xe}.data.api`,Ie=`keyup.${xe}.data.api`,Ne=`resize.${xe}.data.api`;class He extends z{constructor(e,t={}){super(e),this._params=this._getParams(e,l({breakpoint:!1,placement:"horizontal",classes:{hamburgerActive:"vg-nav-hamburger-active",hamburgerAlways:"vg-nav-hamburger-always",hamburger:"vg-nav-hamburger",container:"vg-nav-container",wrapper:"vg-nav-wrapper",active:"vg-nav-active",expand:"vg-nav-expand",cloned:"vg-nav-cloned",hover:"vg-nav-hover",flip:"vg-nav-flip",XXXL:"vg-nav-xxxl",XXL:"vg-nav-xxl",XL:"vg-nav-xl",LG:"vg-nav-lg",MD:"vg-nav-md",SM:"vg-nav-sm",XS:"vg-nav-xs"},expand:!0,hover:!1,position:!0,collapse:!0,toggle:'<span class="default"></span>',hamburger:{enable:!0,always:!1,title:"",body:null},callback:h,animation:!0,timeoutAnimation:300,ajax:{route:"",target:"",method:"get"}},t)),this._navigation=null,this.navigation="."+this._params.classes.wrapper,this.movedLinks=[],this.$links=f.findAll("."+this._params.classes.wrapper+" > li",this.navigation),!1===this._params.animation&&(this._params.timeoutAnimation=10)}static get NAME(){return"nav"}static get NAME_KEY(){return xe}get navigation(){return this._navigation}set navigation(e){let t=f.find(e,this._element);t&&(this._navigation=t)}build(){if(!this.navigation)return;let e=this._params;if(this._element.classList.add(e.classes.container),this._element.classList.add("vg-nav-"+e.placement),e.breakpoint||(e.expand=!1),e.hamburger.always?this._element.classList.add(e.classes.hamburgerAlways):e.breakpoint&&e.expand?!1!==e.breakpoint&&this._element.classList.add("vg-nav-"+e.breakpoint):this._element.classList.add(e.classes.expand),e.hover&&(this._element.classList.add(e.classes.hover),Le.checkMobileOrTablet()&&this._element.classList.remove(e.classes.hover)),e.expand&&!e.hamburger.body&&null===f.find("."+e.classes.hamburger,this._element)){let t="",s='<span class="'+e.classes.hamburger+'--lines"><span></span><span></span><span></span></span>';e.hamburger.title&&(t='<span class="'+e.classes.hamburger+'--title">'+e.hamburger.title+"</span>"),null!==e.hamburger.body&&(s=e.hamburger.body),this._element.insertAdjacentHTML("afterbegin",'<a href="#sidebar-nav" class="'+e.classes.hamburger+'" data-vg-toggle="sidebar">'+t+s+"</a>")}if(e.toggle){let t=[...f.findAll(".dropdown-mega > a, .dropdown > a",this._element)],s='<span class="toggle">'+e.toggle+"</span>";t.length&&t.forEach((function(e){e.querySelector(".toggle")||e.closest(".dots")||(e.setAttribute("aria-expanded","false"),e.insertAdjacentHTML("beforeend",s))}))}e.collapse&&Le.check(this)&&"vertical"!==e.placement&&function(e){let t=e.navigation.clientWidth,s=0,a=f.find(".dots",e.navigation),i=D("dots");if(e.$links.length){if(a)s=a.clientWidth;else{let t=f.find("a",e.$links[0]),a=getComputedStyle(t);s=o(a.paddingLeft.slice(0,-2))+o(a.paddingRight.slice(0,-2))+16}for(let i of e.$links)s+=i.getBoundingClientRect().width,t<s?(e.movedLinks.push(i),i.remove()):e.movedLinks.length&&(a?e.navigation.insertBefore(e.movedLinks[0],a):e.navigation.appendChild(e.movedLinks[0]),e.movedLinks.splice(0,1));e.movedLinks.length?a||e.navigation.insertAdjacentHTML("beforeend",'<li class="dropdown dots"><a href="#" aria-expanded="false">'+i+"</a></li>"):a&&a.remove();let n=e.navigation.querySelector(".dots");if(n&&e.movedLinks.length){let t=n.querySelector("ul");if(t)for(let s of e.movedLinks)t.prepend(s);else{let t=document.createElement("ul");t.classList.add("dropdown-content"),t.classList.add("right");for(let s of e.movedLinks)t.prepend(s);n.appendChild(t)}}}}(this),"afterInit"in this._params.callback&&d(this._params.callback.afterInit,[this])}show(e){let t=e.relatedTarget;if(!t||i(t))return;if(t.closest(".dropdown-content")||t.classList.add("first"),q.trigger(t,Me,{relatedTarget:e}).defaultPrevented)return;let s=f.find(".dropdown-content",t),a=t.firstElementChild;a&&a.setAttribute("aria-expanded","true"),s.classList.add(Ee),t.classList.add(Ce),function(e){let{width:t,right:s}=e.getBoundingClientRect(),a=window.innerWidth-s-t;e.classList.remove("right"),e.classList.remove("left");let i=e.closest("li").querySelectorAll("ul");if(a>t)for(const e of i)e.classList.add("left");else for(const e of i)e.classList.add("right")}(s),this._queueCallback((()=>{s.classList.add(Ae),q.trigger(t,Oe,e)}),s,!0,50)}hide(e){const t=this;if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))q.off(e,"mouseover",h);let s=e.relatedTarget;if("elm"in e&&e.elm&&(s=e.elm),s){if(q.trigger(s,Te).defaultPrevented)return;s.classList.remove(Ce),s.classList.contains("first")&&s.classList.remove("first"),[...f.findAll("."+Ee,s)].forEach((function(s,a){s.classList.remove(Ae);let i=s.closest(".dropdown");i.classList.contains(Ce)&&i.classList.remove(Ce);let n=s.previousElementSibling;if(n&&n.setAttribute("aria-expanded","false"),0===a){const a=()=>{s.classList.remove(Ee),q.trigger(s,Se,e)};t._queueCallback(a,s,!0,500)}}))}}static init(e,t={}){const s=He.getOrCreateInstance(e,t);s.build();let a=f.findAll(".dropdown",s._navigation);s._params.hover?[...a].forEach((function(e){let t=null;q.on(e,$e,(function(e){if(t)return;He.hideOpenDrops(e);let a=e.target.closest(".dropdown");if(!a)return;if(!s.navigation.contains(a))return;t=a;let i={relatedTarget:a};s.show(i)})),q.on(e,Pe,(function(e){if(!t)return;let a=e.relatedTarget.closest(".dropdown"),i=t;for(;a;){if(a===t)return;a=a.parentNode}t=null,s.hide({relatedTarget:a,elm:i})}))})):(q.on(document,Ie,He.clearDrops),q.on(document,je,He.clearDrops),q.on(document,je,".vg-nav a",(function(e){if(!w.has(this,"aria-expanded"))return;"click"in s._params.callback&&d(s._params.callback.click,[this]),e.preventDefault();let t=this.closest(".vg-nav"),a=t.querySelector(".first"),r=this.closest(".dropdown");if(r&&(!i(r)||n(r))){if(a&&this.closest(".first")){if(r.classList.contains("active"))return void s.hide({relatedTarget:r})}else[...f.findAll(".active",t)].forEach((function(e){e&&e!==r&&s.hide({relatedTarget:e})}));s.show({relatedTarget:r})}})));const r=document.getElementById("sidebar-nav");let o=s._element.querySelector("."+s._params.classes.hamburger);r&&o&&(r.addEventListener("vg.sidebar.show",(function(){o.classList.add(s._params.classes.hamburgerActive)})),r.addEventListener("vg.sidebar.hide",(function(){o.classList.remove(s._params.classes.hamburgerActive)})))}static clearDrops(e){2===e.button||"keyup"===e.type&&"Tab"!==e.key||He.hideOpenDrops(e)}static hideOpenDrops(e){const t=f.findAll(".dropdown:not(.disabled):not(:disabled).active");for(const s of t){const t=He.getInstance(s.closest(".vg-nav"));if(!t)continue;if(e.target.closest(".first"))return;const a={relatedTarget:s};"click"===e.type&&(a.clickEvent=e),t.hide(a)}}}q.on(window,Ne,(function(){f.find(".vg-nav")&&He.getOrCreateInstance(".vg-nav",{}).build()}));const qe=He,De=class{constructor(e={}){this.params=l({element:null,drop:null},e)}_getPlacement(){const e=this,t=e=>{let s=e.parentNode,a=getComputedStyle(s).overflow;return"BODY"===s.tagName?null:"visible"!==a?s:void t(s)};let s,a,i=!1,n=e.params.drop.getBoundingClientRect(),r=e.params.element.getBoundingClientRect();if(t(e.params.element))i=!0,s=n.top,a=n.left;else{let t=getComputedStyle(e.params.drop);s=o(t.top.slice(0,-2)),a=o(t.left.slice(0,-2))}return n.left+n.width>window.innerWidth&&(a=r.width-n.width),{isFixed:i,top:s,left:a}}},Be="vg.dropdown",Fe="show",Re="fade",ze="vg-dropdown-content",Ye='[data-vg-toggle="dropdown"]',Xe=`${Be}.hide`,Ke=`${Be}.hidden`,Ve=`${Be}.show`,We=`${Be}.shown`,Ge=`keyup.${Be}.data.api`,Ue=`keydown.${Be}.data.api`,Je=`click.${Be}.data.api`,Ze=`mouseover.${Be}.data.api`,Qe=`mouseout.${Be}.data.api`;class et extends z{constructor(e,t){super(e,t);let s={offset:[0,2],backdrop:!1,overflow:!1,keyboard:!1,placement:"bottom",timeoutAnimation:350,hover:!1,ajax:{route:"",target:"",method:"get",loader:!1},animation:{enable:!1,in:"animate__flipInY",out:"animate__flipOutY",delay:800}};"offset"in t&&Array.isArray(t.offset)&&(s.offset=t.offset),this._params=this._getParams(e,l(s,t));const a=f.getElementFromSelector(this._element);this._parent=this._element.parentNode,this._drop=a||f.find("."+ze,this._parent),this._isPlacement=!1,this._params.animation.delay=this._params.animation.enable?this._params.animation.delay:0,this._animation(this._drop,et.NAME_KEY,this._params.animation)}static get NAME(){return"dropdown"}static get NAME_KEY(){return Be}toggle(){return this._isShown()?this.hide():this.show()}show(){if(i(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!q.trigger(this._element,Ve,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))q.on(e,"mouseover",h);this._route(),this._element.setAttribute("aria-expanded",!0),this._element.classList.add(Fe),this._drop.classList.add(Fe),this._setPlacement(),this._params.backdrop&&!this._params.hover&&W.show(),this._params.overflow&&(Y.append(),document.body.classList.add("dropdown-open")),this._queueCallback((()=>{this._drop.classList.add(Re),q.trigger(this._element,We,e)}),this._drop,!0,50)}}hide(){if(i(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){return super.dispose()}_isShown(){return this._element.classList.contains(Fe)}_completeHide(e){if(!q.trigger(this._element,Xe,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))q.off(e,"mouseover",h);if(this._drop.classList.remove(Re),this._element.classList.remove(Fe),this._element.setAttribute("aria-expanded","false"),this._params.backdrop&&!this._params.hover){const e=this;W.hide((function(){e._params.overflow&&Y.destroy()}))}this._params.overflow&&(Y.destroy(),document.body.classList.remove("dropdown-open")),setTimeout((()=>{this._queueCallback((()=>{this._drop.classList.remove(Fe),q.trigger(this._element,Ke,e)}),this._parent,!0,10)}),this._params.animation.delay)}}_setPlacement(){const e=this;if(!e._isPlacement){let t=new De({element:this._parent,drop:this._drop})._getPlacement();t.isFixed&&(e._drop.style.position="fixed",e._drop.style.transform="translateY(-20%)"),e._drop.style.left=t.left+"px",e._drop.style.top=t.top+"px"}e._params.offset&&(e._drop.style.paddingTop=e._params.offset[1]+"px",e._drop.style.paddingRight=e._params.offset[0]+"px"),e._isPlacement=!0}static init(e,t={}){const s=et.getOrCreateInstance(e,t);if(s._params.hover){let e=null;q.on(s._parent,Ze,(function(t){if(e)return;et.hideOpenToggles(t);let a=t.target.closest(".vg-dropdown");a&&s._parent.contains(a)&&(e=a,s.show())})),q.on(s._parent,Qe,(function(t){if(!e)return;let a=t.relatedTarget;for(;a;){if(a===e)return;a=a.parentNode}e=null,s._completeHide({relatedTarget:s._element})}))}else q.on(document,Ge,Ye,et.keydownHandler),q.on(document,Ue,"."+ze,et.keydownHandler),q.on(document,Ge,et.clearDrops),q.on(document,Je,et.clearDrops),q.on(e,Je,(function(e){e.preventDefault(),s.toggle()}))}static hideOpenToggles(e){const t=f.findAll('[data-vg-toggle="dropdown"]:not(.disabled):not(:disabled).show');for(const s of t){const t=et.getInstance(s);if(!t)continue;if(e.target.closest("."+ze)===t._drop)return;if(e.composedPath().includes(t._element))continue;const a={relatedTarget:t._element};"click"===e.type&&(a.clickEvent=e),t._completeHide(a)}}static keydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),s="Escape"===e.key,a=["ArrowUp","ArrowDown"].includes(e.key);if(!a&&!s)return;if(t&&!s)return;e.preventDefault();const i=this.matches(Ye)?this:f.find(Ye,e.delegateTarget.parentNode),n=et.getOrCreateInstance(i);if(a)return e.stopPropagation(),void n.show();n._isShown()&&(e.stopPropagation(),n.hide(),i.focus())}static clearDrops(e){2===e.button||"keyup"===e.type&&"Tab"!==e.key||et.hideOpenToggles(e)}}const tt=et,st=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",at=".sticky-top",it="padding-right",nt="margin-right",rt=class{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,it,(t=>t+e)),this._setElementAttributes(st,it,(t=>t+e)),this._setElementAttributes(at,nt,(t=>t-e))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,it),this._resetElementAttributes(st,it),this._resetElementAttributes(at,nt)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,s){const a=this.getWidth();this._applyManipulationCallback(e,(e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+a)return;this._saveInitialAttribute(e,t);const i=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${s(Number.parseFloat(i))}px`)}))}_saveInitialAttribute(e,t){const s=e.style.getPropertyValue(t);s&&w.get(e,t,s)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,(e=>{const s=w.get(e,t);null!==s?(w.remove(e,t),e.style.setProperty(t,s)):e.style.removeProperty(t)}))}_applyManipulationCallback(e,t){if(a(e))t(e);else for(const s of f.findAll(e,this._element))t(s)}},ot="vg.modal",lt="vg-modal-open",dt="show",ct="vg-modal-static",mt=`${ot}.hide`,ht=`${ot}.hidden`,pt=`${ot}.show`,ut=`${ot}.shown`,gt=`${ot}.resize`,_t=`${ot}.loaded`,ft=`keydown.dismiss.${ot}`,vt=`hidePrevented.${ot}`,bt=`click.${ot}.data.api`,wt=`mousedown.dismiss${ot}`,yt=`click.dismiss${ot}`,kt=`DOMContentLoaded.${ot}.data.api`,Lt=`popstate.${ot}.data.api`;class xt extends z{constructor(e,t={}){super(e,t),this._params=this._getParams(e,l({backdrop:!0,focus:!0,keyboard:!0,fields:[],hash:!1,ajax:{route:"",target:"",method:"get",loader:!1},animation:{enable:!1,in:"animate__rollIn",out:"animate__rollOut",delay:800},classes:{general:"vg-modal",dialog:"vg-modal-dialog",content:"vg-modal-content",header:"vg-modal-header",title:"vg-modal-title",body:"vg-modal-body",footer:"vg-modal-footer"}},t)),this._button=null,this._dialog=f.find(".vg-modal-dialog",this._element),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new rt,this._addEventListeners(),this._dismissElement(),this._params.animation.delay=this._params.animation.enable?this._params.animation.delay:0,this._animation(this._element,xt.NAME_KEY,this._params.animation)}static get NAME(){return"modal"}static get NAME_KEY(){return ot}static init(e,t,s){xt.build(e,t,s)}static build(e,t,s){if("string"!=typeof e)return;let a=document.createElement("div");a.classList.add("vg-modal","fade"),a.id=e;let i=document.createElement("div");i.classList.add("vg-modal-dialog");let n=document.createElement("div");n.classList.add("vg-modal-content");let r=document.createElement("button");w.set(r,"type","button"),w.set(r,"data-vg-dismiss","modal"),w.set(r,"data-vg-target","#"+e),w.set(r,"aria-label","close"),r.classList.add("vg-btn-close"),n.append(r);let o=document.createElement("div");o.classList.add("vg-modal-body"),n.append(o),i.append(n),a.append(i),document.body.append(a),d(s,[xt.getOrCreateInstance(a,t)])}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){const t=this;i(t._element)||(this._params=this._getParams(e,this._params),t._route((function(e,s){q.trigger(t._element,_t,{stats:e,data:s})})),q.trigger(this._element,pt,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._params.hash&&(window.history.pushState(null,"vg-sidebar-open","#"+this._element.id),q.on(window,Lt,(()=>{this.hide()}))),this._scrollBar.hide(),document.body.classList.add(lt),this._addFieldsInModal(e),this._adjustDialog(),W.show((()=>this._showElement(e)))))}hide(e=[]){this._isShown&&!this._isTransitioning&&(q.trigger(this._element,mt).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,setTimeout((()=>{this._element.classList.remove(dt),this._queueCallback((()=>this._hideModal(e)),this._element,this._isAnimatedFade())}),this._params.animation.delay)))}_hideModal(e){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,e.length||(this._params.hash&&history.pushState("",document.title,window.location.pathname+window.location.search),W.hide((()=>{document.body.classList.remove(lt),this._resetAdjustments(),this._scrollBar.reset(),q.trigger(this._element,ht)})))}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=f.find(".vg-modal-body",this._dialog);t&&(t.scrollTop=0),m(this._element),this._element.classList.add(dt),this._queueCallback((()=>{this._isTransitioning=!1,q.trigger(this._element,ut,{relatedTarget:e})}),this._dialog,this._isAnimatedFade())}_isAnimatedFade(){return this._element.classList.contains("fade")}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),s=t>0;if(s&&!e){const e=u()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!s&&e){const e=u()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}_addEventListeners(){q.on(this._element,ft,(e=>{"Escape"===e.key&&(this._params.keyboard?this.hide():this._triggerBackdropTransition())})),q.on(window,gt,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),q.on(this._element,wt,(e=>{q.one(this._element,yt,(t=>{this._element===e.target&&this._element===t.target&&("static"!==this._params.backdrop?this._params.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_triggerBackdropTransition(){if(q.trigger(this._element,vt).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(ct)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(ct),this._queueCallback((()=>{this._element.classList.remove(ct),this._queueCallback((()=>{this._element.style.overflowY=t}),this._dialog)}),this._dialog))}_addFieldsInModal(e){this._params=this._getParams(e,this._params),this._params.fields.length&&this._params.fields.forEach((e=>{if(!1 in e&&!1 in e)return;let t=f.findAll("[data-"+e.name+"]",this._element);if(t.length)for(const s of t)switch(s.tagName){case"INPUT":s.value=e.value;break;case"IMG":w.set(s,"src",e.value);break;default:s.innerHTML=e.value}}))}}B(xt),q.on(document,bt,'[data-vg-toggle="modal"]',(function(e){const t=f.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),q.one(t,pt,(e=>{e.defaultPrevented}));const s=f.find(".vg-modal.show");s&&xt.getInstance(s).hide([s]),xt.getOrCreateInstance(t).toggle(this)})),q.on(document,kt,(function(){let e=window.location.hash.slice(1);if(e){let t=f.find("#"+e);if(t&&t.classList.contains("vg-modal")){if(i(t))return;xt.getOrCreateInstance(t).toggle()}}}));const Et=xt,At=[{type:"collapse",template:""},{type:"modal",template:'<div class="vg-modal"></div>'},{type:"pass-open",template:'<span data-vg-toggle="vgpass" class="[[classes]]" title="Показать / Скрыть" data-bs-toggle="tooltip"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M288 80c-65.2 0-118.8 29.6-159.9 67.7C89.6 183.5 63 226 49.4 256c13.6 30 40.2 72.5 78.6 108.3C169.2 402.4 222.8 432 288 432s118.8-29.6 159.9-67.7C486.4 328.5 513 286 526.6 256c-13.6-30-40.2-72.5-78.6-108.3C406.8 109.6 353.2 80 288 80zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1c3.3 7.9 3.3 16.7 0 24.6c-14.9 35.7-46.2 87.7-93 131.1C433.5 443.2 368.8 480 288 480s-145.5-36.8-192.6-80.6C48.6 356 17.3 304 2.5 268.3c-3.3-7.9-3.3-16.7 0-24.6C17.3 208 48.6 156 95.4 112.6zM288 336c44.2 0 80-35.8 80-80s-35.8-80-80-80c-.7 0-1.3 0-2 0c1.3 5.1 2 10.5 2 16c0 35.3-28.7 64-64 64c-5.5 0-10.9-.7-16-2c0 .7 0 1.3 0 2c0 44.2 35.8 80 80 80zm0-208a128 128 0 1 1 0 256 128 128 0 1 1 0-256z"/></svg></span>'},{type:"pass-close",template:'<span data-vg-toggle="vgpass" class="[[classes]]" title="Показать / Скрыть" data-bs-toggle="tooltip"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--\x3e<path d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zm151 118.3C226 97.7 269.5 80 320 80c65.2 0 118.8 29.6 159.9 67.7C518.4 183.5 545 226 558.6 256c-12.6 28-36.6 66.8-70.9 100.9l-53.8-42.2c9.1-17.6 14.2-37.5 14.2-58.7c0-70.7-57.3-128-128-128c-32.2 0-61.7 11.9-84.2 31.5l-46.1-36.1zM394.9 284.2l-81.5-63.9c4.2-8.5 6.6-18.2 6.6-28.3c0-5.5-.7-10.9-2-16c.7 0 1.3 0 2 0c44.2 0 80 35.8 80 80c0 9.9-1.8 19.4-5.1 28.2zm9.4 130.3C378.8 425.4 350.7 432 320 432c-65.2 0-118.8-29.6-159.9-67.7C121.6 328.5 95 286 81.4 256c8.3-18.4 21.5-41.5 39.4-64.8L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5l-41.9-33zM192 256c0 70.7 57.3 128 128 128c13.3 0 26.1-2 38.2-5.8L302 334c-23.5-5.4-43.1-21.2-53.7-42.3l-56.1-44.2c-.2 2.8-.3 5.6-.3 8.5z"/></svg></span>'}],Ct=class{constructor(e,t={}){if(!e)throw new Error("Element is required");this._element=e,this._params=l({insert:"afterend",classes:[]},t),this.templateBuild=null}render(e,t){let s=this.toHTML(e,t);"afterend"===this._params.insert&&this._element.insertAdjacentHTML("afterend",s)}toHTML(e=0,t){let s="";for(const e of At)e.type===this._params.template&&(s=e.template);if(s)return s=s.replace("[[classes]]",this._params.classes.join(" ")),d(t,[this._element,this._params,s]),s}setContent(){}},Tt="vg.hideshowpass",St="show",Mt=`click.${Tt}.data.api`;class Ot extends z{constructor(e,t={}){super(e,t),this._params=this._getParams(e,l({},t))}static get NAME(){return"hideshowpass"}static get NAME_KEY(){return Tt}toggle(e){return this._isShown()?this.hide(e):this.show(e)}show(e){e&&(this._params=this._getParams(e,this._params)),this._element.classList.add(St),e.remove(),this.build(!0),w.set(this._element,"type","text")}hide(e){this._element.classList.remove(St),e.remove(),this.build(!1),w.set(this._element,"type","password")}_isShown(){return this._element.classList.contains(St)}static init(e,t){Ot.getOrCreateInstance(e,t).build(!1)}build(e=!1){this._params.template=e?"pass-open":"pass-close",new Ct(this._element,this._params).render()}}q.on(document,Mt,'[data-vg-toggle="vgpass"]',(function(e){const t=f.prev(this);t&&(["A","AREA"].includes(this.tagName)&&e.preventDefault(),i(this)||(this.setAttribute("aria-expanded",!0),Ot.getOrCreateInstance(t).toggle(this)))}));const $t=Ot,Pt="vg.fs",jt=`submit.${Pt}.data.api`;class It extends z{constructor(e,t={}){super(e,t),this._params=this._getParams(e,l({redirect:"",validate:!1,submit:!1,fields:[],timeout:50,pass:{enabled:!0,template:"pass-open",classes:["vg-form-sender--hide-show-pass"],insert:"afterend"},alert:{enabled:!0,type:"modal",errors:!0},ajax:{route:"",target:"",method:"get"},classes:{general:"vg-form-sender",alertCollapse:"vg-form-sender-collapse",alertModal:"vg-form-sender-modal",validation:"needs-validation",wasValidate:"was-validated",content:"vg-form-sender--content"},callback:{afterInit:h}},t)),this._params.ajax.route=w.get(this._element,"action").toLowerCase(),this._params.ajax.method=w.get(this._element,"method").toLowerCase(),this._button=f.find('[type="submit"]',this._element)||f.find('[form="'+this._element.id+'"]')||null,this._params.isBtnText="false"!==w.get(this._element,"data-btn-text"),this._params.isJsonParse="false"!==w.get(this._element,"data-json-parse"),this._params.isShowPass="true"===w.get(this._element,"data-show-pass")}static get NAME(){return"form-sender"}static get NAME_KEY(){return Pt}build(){return this._element.classList.add(this._params.classes.general),[...f.findAll("input, textarea, select",this._element)].forEach((e=>{n(e)&&e.parentElement.classList.add(this._params.classes.content)})),this._params.validate&&(w.set(this._element,"novalidate",""),this._element.classList.add(this._params.classes.validation)),this._params.pass.enabled&&[...f.findAll('input[type="password"]',this._element)].forEach((e=>{$t.init(e,this._params.pass)})),d(this._params.callback.afterInit,[this._element,this]),this}request(e,t){const s=this;s._alertBefore(),s._params.ajax.data=e,s._route((function(e,a){s._element.classList.remove("was-validated"),s._params.alert.enabled&&("string"==typeof e&&"error"===e?s._alertError(t,a):"string"==typeof e&&"success"===e&&s._alertSuccess(t,a)),s._params.redirect&&(window.location.href=s._params.redirect)}))}_alertBefore(){const e=this;"collapse"===e._params.alert.type&&[...document.getElementsByClassName(e._params.classes.alertCollapse)].forEach((function(e){e&&e.classList.contains("show")&&ke.getOrCreateInstance(e,{toggle:!1}).hide()})),e._statusButton("before"),q.trigger(e._element,"vg.fs.before",e)}_alertError(e,t){const s=this;s._statusButton("after"),s._jsonParse(t,"error"),q.trigger(s._element,"vg.fs.error",[e,s,t])}_alertSuccess(e,t){const s=this;s._statusButton("after"),s._jsonParse(t,"success"),q.trigger(s._element,"vg.fs.success",[e,s,t])}_statusButton(e){const t=this;if(!t._button)return;let s=t._button,a={send:"Отправляем...",text:"Отправить"};if(w.has(t._button,"data-spinner")&&"before"===e&&t._button.insertAdjacentHTML("afterbegin",'<span class="spinner-border spinner-border-sm me-2"></span>'),w.has(t._button,"data-text"))a.text=w.get(t._button,"data-text");else{let e=t._button.querySelector("[data-text]");e&&(a.text=w.get(e,"data-text"),s=e)}if(w.has(t._button,"data-text-send"))a.send=w.get(t._button,"data-text-send");else{let e=t._button.querySelector("[data-text-send]");e&&(a.send=w.get(e,"data-text-send"),s=e)}if("before"===e&&(t._params.isBtnText&&(s.innerHTML=a.send),w.set(t._button,"disabled","disabled")),"after"===e){t._params.isBtnText&&(s.innerHTML=a.text),w.remove(t._button,"disabled");let e=t._button.querySelector(".spinner-border");e&&e.remove()}}_jsonParse(e,t){const s=this;if(s._params.isJsonParse&&"string"==typeof e){let a={};try{a=JSON.parse(e),s.alert(a,t)}catch(a){s.alert(e,t)}}else s.alert(e,t)}alert(e,t){const s=this;if(r(e)&&"code"in e&&e.code&&200===e.code&&"response"in e&&e.response){let s=o(e.response);"string"==typeof s?-1===s.indexOf("Parse error")&&-1===s.indexOf("syntax error")||(t="error",e={response:{title:"Error",message:"Something went wrong, please repeat later"},text:"Something went wrong, please repeat later"}):"errors"in s&&o(s.errors)&&(t=o(s.errors)?"error":"success")}s._params.alert.enabled&&("modal"===s._params.alert.type&&s._alertModal(e,t),"collapse"===s._params.alert.type&&s._alertCollapse(e,t))}_alertModal(e,t){const s=this;[...document.getElementsByClassName("modal")].forEach((function(e){e&&e.classList.contains("show")&&bootstrap.Modal.getOrCreateInstance(e).hide()})),[...document.getElementsByClassName("vg-modal")].forEach((function(e){if(e&&e.classList.contains("show")){const t=Et.getOrCreateInstance(e);t.hide([t])}}));let a=s._params.classes.general+"-"+p(),i=f.find("."+s._params.classes.alertModal);i&&i.remove(),setTimeout((()=>{Et.init(a,{classes:{alert:s._params.classes.alertModal}},(function(a){let i=a._element;i.classList.add(s._params.classes.alertModal);let n=f.find(".vg-modal-body",i);n&&n.append(s.setDataRelationStatus(i,t,e,"modal")),a.toggle()}))}),s._params.timeout)}_alertCollapse(e,t){const s=this;let a=f.find("."+s._params.classes.alertCollapse);a||(a=document.createElement("div"),a.classList.add(s._params.classes.alertCollapse),a.classList.add("vg-collapse"),a.id=s._params.classes.general+"-"+p(),a.append(s.setDataRelationStatus(a,t,e,"collapse")),s._element.prepend(a)),ke.getOrCreateInstance(a,{toggle:!1}).toggle()}setDataRelationStatus(e,t,s,a){let i=f.find(".vg-alert-"+t,e);if(r(s)){if("error"===t&&"code"in s&&200!==s.code&&"text"in s&&!s.text)switch(s.text="Something went wrong, please repeat later",s.code){case 400:s.text="Bad Request";break;case 401:case 403:s.text="Unauthorized";break;case 413:s.text="Forbidden";break;case 404:s.text="Not Found";break;case 422:s.text="Unprocessable Entity";break;case 500:s.text="Internal Server Error";break;case 504:s.text="Gateway Timeout"}if("response"in s){let e=o(s.response),a="",i="",n="";if("string"!=typeof e){if(!("view"in e)){if("title"in e&&(a=e.title),"error"===t&&200!==s.code&&this._params.alert.errors&&(n=" "+s.text+" ("+s.code+")"),a&&(i+='<h4 class="vg-alert-content--title">'+a+n+"</h4>"),"message"in e&&(i+='<div class="vg-alert-content--message">'+e.message+"</div>"),"errors"in e&&this._params.alert.errors){let t=o(e.errors)||null;if(r(t))for(const e in t)Array.isArray(t[e])?t[e].forEach((function(e){i+="<div>"+e+"</div>"})):i="<div>"+t[e]+"</div>"}s={view:i}}}else s.view=e}}if(i)f.find(".vg-alert-content--text",i).innerHTML=s.view;else{i=document.createElement("div"),i.classList.add("vg-alert","vg-alert-"+t,"vg-alert-"+a);let e=document.createElement("div");e.classList.add("vg-alert-content");let n=document.createElement("div");n.classList.add("vg-alert-content--icon");let r=document.createElement("i");r.innerHTML=D(t),n.append(r),e.append(n);let o=document.createElement("div");o.classList.add("vg-alert-content--text"),o.innerHTML=s.view,e.append(o),i.append(e)}return i}static init(e,t={}){It.getOrCreateInstance(e,t).build()}}q.on(document,jt,(function(e){if(!w.has(e.target,"data-vgformsender"))return;const t=It.getOrCreateInstance(e.target,{});if(t){if(t._params.validate&&!t._element.checkValidity())return e.preventDefault(),e.stopPropagation(),t._element.classList.add(t._params.classes.wasValidate),!1;if(!t._params.submit){e.preventDefault();let s=new FormData(t._element);return t.request(s,e)}}}));const Nt=It,Ht="vg.rollup",qt="show",Dt="vg-rollup-display--none",Bt=`${Ht}.hide`,Ft=`${Ht}.show`,Rt=`click.${Ht}.data.api`;class zt extends z{constructor(e,t={}){super(e,t),this._params=this._getParams(e,l({content:"text",offset:0,cnt:0,fade:!0,transition:!1,number:!1,height:0,ellipsis:{line:null},more:" еще ",button:{enable:!0,more:"Показать",less:"Свернуть"}},t)),this.classes={container:"vg-rollup",hidden:"vg-rollup-content--hidden",fade:"vg-rollup-content--fade",ellipsis:"vg-rollup-content--ellipsis",button:"vg-rollup-content--button",transition:"vg-rollup-content--transition"},this.total=0,this.count=0,this.offset=0,this.isOffset=!1,this._params.offset>0&&(this.offset=this._params.offset+this._params.cnt||0,this.isOffset=!0),this.build()}static get NAME(){return"rollup"}static get NAME_KEY(){return Ht}static toggle(e,t){const s=zt.getOrCreateInstance(e);if(s.isShow()){let e="";if(s._params.number){let t=s.total-s.count;t>0&&(e=s._params.more+t)}t.setAttribute("aria-expanded",!1),s._element.classList.remove(qt),t.innerHTML=s._params.button.more+e,s.switch(s._element,!0),q.trigger(s._element,Bt,{relatedTarget:t})}else s._element.classList.add(qt),t.innerHTML=s._params.button.less,s.offset>0&&(s.isOffset?t.innerHTML=s._params.button.more:t.innerHTML=s._params.button.less),s.switch(s._element,!1),q.trigger(s._element,Ft,{relatedTarget:t})}build(e=null,t=!0){let s=this,a=e||s._element,i=a.clientHeight,n=s._params.height||i/2;a.classList.add(s.classes.container);let r=s._params.fade,o=s._params.transition,l=null!==s._params.ellipsis.line,d=s._params.button.enable,c=s._params.number;if(t||s.switch(a),i>n&&"text"===s._params.content)a.classList.add(s.classes.hidden),a.style.height=n+"px",m(),h(),p(),u();else if("elements"===s._params.content){let e=s._params.elements||"item",t=a.querySelectorAll("."+e),i=s._params.cnt||5,n=1;s.total=t.length,s.count=i;for(const e of t)n>i&&e.classList.add(Dt),n++;!0===d&&(d=n-1>i),m(),h(),p(),u()}function m(){if(l){let e=s._params.ellipsis.line;r=!1,e?(a.classList.add(s.classes.ellipsis),a.style.webkitLineClamp=e):console.log("Переменная [data-line] или параметр[line] не должны быть пустыми")}}function h(){o&&a.classList.add(s.classes.transition)}function p(){r&&a.classList.add(s.classes.fade)}function u(){if(t&&(a.setAttribute("id",a.id),d)){let e="";if(c){let t=s.total-s.count;t>0&&(e=s._params.more+t)}let t=s._params.button.more;a.insertAdjacentHTML("afterend",'<div class="'+s.classes.button+'"><a href="#" aria-expanded="false" data-vg-toggle="rollup" data-vg-target="#'+a.id+'">'+t+e+"</a></div>")}}}switch(e,t=!1){const s=this;if(t)this.build(e,!1);else if(e.classList.remove(this.classes.hidden),e.classList.remove(this.classes.ellipsis),e.classList.remove(this.classes.fade),e.removeAttribute("style"),"elements"===s._params.content){let t=s._params.elements,a=[...e.querySelectorAll("."+t)];if(a.length)if(s.offset>0){let t=s._params.elements,a=[...e.querySelectorAll("."+t)];a.slice(s.count,s.offset).forEach((e=>e.classList.remove(Dt))),s.offset=s.offset+s.settings.offset,s.offset>a.length&&(s.isOffset=!1,s.offset=0)}else a.forEach((e=>e.classList.remove(Dt)))}}isShow(){return this._element.classList.contains(qt)}static init(e,t={},s){d(s,[zt.getOrCreateInstance(e,t)])}}q.on(document,Rt,'[data-vg-toggle="rollup"]',(function(e){const t=f.getElementFromSelector(this);t&&(["A","AREA"].includes(this.tagName)&&e.preventDefault(),i(this)||(this.setAttribute("aria-expanded",!0),zt.toggle(t,this)))}));const Yt=zt;function Xt(e){for(let t=1;t<arguments.length;t++){let s=arguments[t];for(let t in s)e[t]=s[t]}return e}const Kt=function e(t,s){function a(e,a,i){if("undefined"==typeof document)return;"number"==typeof(i=Xt({},s,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);let n="";for(let e in i)i[e]&&(n+="; "+e,!0!==i[e]&&(n+="="+i[e].split(";")[0]));return document.cookie=e+"="+t.write(a,e)+n}return Object.create({set:a,get:function(e){if("undefined"==typeof document||arguments.length&&!e)return;let s=document.cookie?document.cookie.split("; "):[],a={};for(let i=0;i<s.length;i++){let n=s[i].split("="),r=n.slice(1).join("=");try{let s=decodeURIComponent(n[0]);if(a[s]=t.read(r,s),e===s)break}catch(e){}}return e?a[e]:a},remove:function(e,t){a(e,"",Xt({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,Xt({},this.attributes,t))},withConverter:function(t){return e(Xt({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(s)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),Vt="vg.lawcookie",Wt="show",Gt=`${Vt}.hide`,Ut=`${Vt}.hidden`,Jt=`${Vt}.show`,Zt=`${Vt}.shown`,Qt=`click.${Vt}.data.api`;class es extends z{static sParams={};constructor(e,t={}){super(e,t),this._params=this._getParams(e,l({storage:"local",delay:500,cookie:{name:"lawCookie",value:"yes",attributes:{}},animation:{enable:!0,in:"animate__fadeInUp",out:"animate__fadeOutDown",delay:800},ajax:{route:"",target:"",method:"get"}},t)),es.sParams=this._params,this._params.animation.delay=this._params.animation.enable?this._params.animation.delay:0,this._animation(this._element,es.NAME_KEY,this._params.animation)}static get NAME(){return"lawcookie"}static get NAME_KEY(){return Vt}toggle(){return this._isShown()?this.hide():this.show()}_isShown(){return this.storage().get()}show(){i(this._element)||q.trigger(this._element,Jt,{}).defaultPrevented||(this._element.classList.add(Wt),this._queueCallback((()=>{q.trigger(this._element,Zt,{})}),this._element,!0,this._params.delay))}hide(){q.trigger(this._element,Gt).defaultPrevented||setTimeout((()=>{this._element.classList.remove(Wt),this._queueCallback((()=>q.trigger(this._element,Ut)),this._element,!0)}),this._params.animation.delay)}storage(){return this._storage={isCookie:"cookie"===this._params.storage,storage:"cookie"===this._params.storage?Kt:localStorage,name:this._params.cookie.name,value:this._params.cookie.value,attributes:this._params.cookie.attributes},this}get(){return this._storage.isCookie?this._storage.storage.get(this._storage.name):this._storage.storage.getItem(this._storage.name)}set(){this._storage.isCookie?this._storage.storage.set(this._storage.name,this._storage.value,this._storage.attributes):this._storage.storage.setItem(this._storage.name,this._storage.value)}dispose(){super.dispose()}static reset(){Kt.remove(es.sParams.cookie.name),localStorage.clear(),location.reload()}static init(e,t={}){es.getOrCreateInstance(e,t).toggle()}}B(es),q.on(document,Qt,'[data-vg-toggle="lawcookie"]',(function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),i(this))return;const t=f.find("#vg-lawcookie");if(!t)return;const s=es.getOrCreateInstance(t);s.storage().set(),s.hide()})),q.on(document,Qt,'[data-vg-toggle="lawcookie-clear"]',(function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),i(this))return;const t=f.find("#vg-lawcookie");t&&(es.getOrCreateInstance(t).dispose(),location.reload())}));const ts=es,ss="vg.select",as="show",is="active",ns="vg-select",rs="vg-select-dropdown",os="vg-select-list",ls="vg-select-list--option",ds="vg-select-list--optgroup",cs="vg-select-current",ms=`click.${ss}.data.api`,hs=`keyup.${ss}.data.api`,ps=`reset.${ss}.data.api`,us=`${ss}.change`,gs=`${ss}.hide`,_s=`${ss}.hidden`,fs=`${ss}.show`,vs=`${ss}.shown`,bs='[data-vg-toggle="select"]';let ws;class ys extends z{constructor(e,t={}){super(e,t),this._params=this._getParams(e,l({search:!1,placeholder:""},t)),e.parentElement.style.position="relative",this._drop=f.find("."+rs,this._element),this.refresh()}static get NAME(){return"select"}static get NAME_KEY(){return ss}static buildListOptions(e,t){let a=e.options,i=document.createElement("ul");i.classList.add(os);let n=e.querySelectorAll("optgroup");if(n.length){let e=!1;[...n].forEach((function(t){let s=document.createElement("ol");s.classList.add(ds);let a=document.createElement("li");a.innerHTML=t.label.trim(),a.classList.add("vg-select-list--optgroup-title"),s.prepend(a),r(f.findAll("option",t),s,e),i.append(s),e=!0}))}else r(a,i,!1);return t.append(i),i;function r(t,a,i){let n=0;for(const r of t){let t=document.createElement("li");t.innerHTML=r.innerHTML.trim().replace(/<\/[^>]+(>|$)/g,""),t.dataset.value=w.get(r,"value"),t.classList.add(ls),w.set(t,"data-vg-toggle","select-option");let o=w.get(r);if(!s(o))for(const e of Object.keys(o))w.set(t,"data-"+e,o[e]);n!==e.selectedIndex||i||t.classList.add("selected"),w.has(r,"disabled")&&t.classList.add("disabled"),w.has(r,"hidden")&&t.classList.add("hidden"),a.append(t),n++}}}static build(e,t){let a,i=e.dataset.placeholder||"",n=e.dataset.search||!1;if("true"===e.dataset?.inited&&!t)return;t&&ys.destroy(e),a=i&&0===e.selectedIndex?'<span class="vg-select-current--placeholder">'+i+"<span>":e.options[e.selectedIndex].innerText;let r=w.get(e,"class"),o=document.createElement("div");r=r.split(" ");for(const e of r)o.classList.add(e);w.has(e,"disabled")&&o.classList.add("disabled");let l=w.get(e);if(!s(l))for(const e of Object.keys(l))w.set(o,"data-"+e,l[e]);let d=document.createElement("div");d.classList.add(cs),w.set(d,"data-vg-toggle","select"),w.set(d,"aria-expanded","false"),d.innerHTML=a.trim(),o.append(d);let c=document.createElement("div");if(c.classList.add(rs),o.append(c),ys.buildListOptions(e,c),e.insertAdjacentElement("afterend",o),e.dataset.inited="true",n){let e=document.createElement("div");e.classList.add("vg-select-search");let t=document.createElement("input");w.set(t,"name","vg-select-search"),w.set(t,"type","text"),w.set(t,"placeholder","Поиск..."),e.append(t),c.prepend(e)}return o}toggle(e){return this._isShown()?this.hide():this.show(e)}show(e){if(!i(this._element)&&!q.trigger(this._element,fs,{relatedTarget:e}).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))q.on(e,"mouseover",h);if(this._element.classList.add(as),this._params.search){let e=f.find("input",this._element);e&&e.focus()}this._queueCallback((()=>{this._element.classList.add(is),q.trigger(this._element,vs,{relatedTarget:e})}),this._drop,!0,50)}}hide(){!i(this._element)&&this._isShown()&&this._completeHide()}_completeHide(){if(q.trigger(this._element,gs,{}).defaultPrevented)return;this._element.classList.remove(is);let e=f.find(bs,this._element);if(w.set(e,"aria-expanded","false"),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))q.off(e,"mouseover",h);this._queueCallback((()=>{this._element.classList.remove(as),q.trigger(this._element,_s,{})}),this._drop,!0,10)}_isShown(){return this._element.classList.contains(as)}refresh(){const e=this._element.previousSibling;new MutationObserver((()=>{clearTimeout(ws),ws=setTimeout((()=>{ys.build(e,!0)}),100)})).observe(e,{attributeFilter:["disabled","required","style","hidden"],childList:!0,subtree:!0,characterDataOldValue:!0})}dispose(){super.dispose()}static destroy(e){let t=e.nextElementSibling;t&&t.classList.contains(ns)&&(t.remove(),e.selectedIndex=0,[...e.querySelectorAll("option")].forEach((function(t,s){t.hasAttribute("selected")&&(e.selectedIndex=s)})))}static hideOpenToggles(e){const t=f.findAll(".vg-select:not(.disabled):not(:disabled).show");for(const s of t){const t=ys.getInstance(s);if(!t)continue;if(e.target.closest("."+ns)===t._element)return;if(e.composedPath().includes(t._element))continue;const a={relatedTarget:t._element};"click"===e.type&&(a.clickEvent=e),t._completeHide(a)}}static clearDrops(e){2===e.button||"keyup"===e.type&&"Tab"!==e.key||ys.hideOpenToggles(e)}static changeSelector(e,t,a={}){!r(a)&&s(a)||(e.value=o(t),q.trigger(e,us,{data:a}),q.trigger(e,"change",{data:a}))}static init(e,t={},s=!1){let a=ys.build(e);ys.getOrCreateInstance(a,t)}}q.on(document,ms,ys.clearDrops),q.on(document,ms,bs,(function(){const e=this.closest("."+ns);w.set(this,"aria-expanded",!0);const t=f.find(".vg-select.show");t&&t!==e&&ys.getInstance(t).hide(),ys.getOrCreateInstance(e).toggle(this)})),q.on(document,ms,'[data-vg-toggle="select-option"]',(function(e){let t=e.target;if(!t.classList.contains("disabled")){let e=t.closest("."+ns),s=e.querySelectorAll("."+ls);if(s.length)for(const e of s)e.classList.remove("selected");t.classList.add("selected"),e.querySelector("."+cs).innerText=t.innerText,e.classList.remove("show");let a=e.previousSibling;ys.changeSelector(a,t.dataset.value,{value:t.dataset.value,title:t.innerHTML})}})),q.on(document,hs,"[name=vg-select-search]",(function(e){let t=this,s=t?.closest("."+rs).querySelector("."+os);if(s){let e=[...s.querySelectorAll("."+ls)],a=[...s.querySelectorAll("."+ds)],i=t?.value;e=e.concat(a);for(const t of e)w.show(t);if(i.length){i=i.trim(),i=i.toLowerCase(),i=function(e){let t,s="й ц у к е н г ш щ з х ъ ф ы в а п р о л д ж э я ч с м и т ь б ю".split(/ +/g),a="q w e r t y u i o p [ ] a s d f g h j k l ; ' z x c v b n m , .".split(/ +/g);for(t=0;t<s.length;t++)e=(e=e.split(a[t]).join(s[t])).split(a[t].toUpperCase()).join(s[t].toUpperCase());return e}(i);for(const t of e)-1===t.innerText.toLowerCase().indexOf(i)&&w.hide(t)}}})),q.on(document,ps,"form",(function(){f.findAll("select."+ns,this).forEach((e=>{ys.build(e,!0)}))}));const ks=ys,Ls="vg.alert",xs=`keydown.dismiss.${Ls}`,Es=`hidePrevented.${Ls}`,As=`click.${Ls}.data.api`;class Cs extends z{constructor(e,t={}){super(e,t),this._params=this._getParams(e,l({backdrop:!0,overflow:!0,keyboard:!0,confirm:!0,showInside:!0,theme:"default",elements:[{title:"Вы уверены?",element:"button",type:"confirm",classes:["btn","btn-primary"]}],animation:{enable:!1,in:"animate__rollIn",out:"animate__rollOut",delay:800},ajax:{route:"",target:"",method:"get",loader:!1}},t)),this._addEventListeners(),this._dismissElement(),this._params.animation.delay=this._params.animation.enable?this._params.animation.delay:0,this._animation(this._element,Cs.NAME_KEY,this._params.animation)}static get NAME(){return"alert"}static get NAME_KEY(){return Ls}static run(e,t={},s){return Cs.build(e,t,s)}static build(e,t,s){t=l({theme:"default"},t);let a=Cs.getOrCreateInstance(void 0,t);d(s,[a]),a.show()}toggle(e){return this._isShown()?this.hide():this.show(e)}show(e){}hide(){}dispose(){super.dispose()}_isShown(){return this._element.classList.contains("show")}_addEventListeners(){q.on(document,xs,(e=>{"Escape"===e.key&&(this._params.keyboard?this.hide():q.trigger(this._element,Es))}))}}B(Cs),q.on(document,As,'[data-vg-toggle="alert"]',(function(e){}));const Ts=Cs,Ss="vg.toast",Ms="vg-toast-open",Os="show",$s=`${Ss}.hide`,Ps=`${Ss}.hidden`,js=`${Ss}.show`,Is=`${Ss}.shown`,Ns=`${Ss}.loaded`,Hs=`keydown.dismiss.${Ss}`,qs=`hidePrevented.${Ss}`,Ds=`click.${Ss}.data.api`;class Bs extends z{constructor(e,t={}){super(e,t),this._params=this._getParams(e,l({static:!0,placement:"bottom center",autohide:!1,delay:3e3,enableClickToast:!0,enableButtonClose:!0,keyboard:!0,theme:"dark",stack:{enable:!0,max:5},animation:{enable:!0,in:"animate__fadeIn",out:"animate__fadeOut",delay:400},ajax:{route:"",target:"",method:"get",loader:!1}},t)),this._params.animation.delay=this._params.animation.enable?this._params.animation.delay:0,this._animation(this._element,Bs.NAME_KEY,this._params.animation),this._dismissElement(),this._addEventListeners(),this._timeout=null}static get NAME(){return"toast"}static get NAME_KEY(){return Ss}static run(e,t={},s){return Bs.build(e,t,s)}static build(e,t,s){t=l({placement:"bottom center",static:!1,theme:"dark",stack:{enable:!1}},t);let a=document.createElement("div");a.classList.add("vg-toast"),a.id="vg-toast-"+p(),"theme"in t&&a.classList.add("vg-toast-"+t.theme),"placement"in t&&t.placement.split(" ").forEach((e=>a.classList.add(e)));let i=document.createElement("div");if(i.classList.add("vg-toast-wrapper"),"type"in t){let e=document.createElement("div");e.classList.add("vg-toast-icon"),i.append(e)}let n=document.createElement("div");n.classList.add("vg-toast-content");let r=document.createElement("div");if(r.classList.add("vg-toast-body"),"string"==typeof e)r.innerHTML=e,n.append(r);else if(Array.isArray(e))if(e.length>1){let t=document.createElement("div");t.classList.add("vg-toast-header"),t.innerHTML=e[0],n.append(t),r.innerHTML=e[1],n.append(r)}else r.innerHTML=e[0],n.append(r);if(i.append(n),"enableButtonClose"in t&&t.enableButtonClose){let e=document.createElement("div");e.classList.add("vg-toast-button"),e.innerHTML='<button class="vg-btn-close" data-vg-dismiss="toast"></button>',i.append(e)}a.append(i),document.body.append(a);let o=Bs.getOrCreateInstance(a,t);d(s,[o]),o.show()}toggle(e){return this._isShown()?this.hide():this.show(e)}show(e){i(this._element)||(this._clearTimeout(),this._params=this._getParams(e||{},this._params),this._route((function(e,t){q.trigger(this._element,Ns,{stats:e,data:t})})),q.trigger(this._element,js,{relatedTarget:e}).defaultPrevented||(this._element.classList.add(Os),document.body.classList.add(Ms),this._setPlacement(),this._queueCallback((()=>{this._element.classList.add(Os),q.trigger(this._element,Is,{relatedTarget:e}),this._scheduleHide()}),this._element,!0,0)))}hide(){i(this._element)||q.trigger(this._element,$s).defaultPrevented||setTimeout((()=>{this._element?.classList.remove(Os),this._queueCallback((()=>{document.body.classList.remove(Ms),q.trigger(this._element,Ps),this._params.stack.enable&&this._setPlacement(),this._params.static||this.dispose()}),this._element,!1,this._params.animation.delay)}),this._params.animation.delay)}dispose(){this._clearTimeout(),this._isShown()&&this._element.classList.remove(Os),this._params.static||this._element.remove(),super.dispose()}_scheduleHide(){this._params.autohide&&(this._timeout=setTimeout((()=>{this.hide()}),this._params.delay))}_isShown(){return this._element.classList.contains(Os)}_setPlacement(){let e=this._enableStack();if(this._params.stack.enable&&e.length>this._params.stack.max){let t=e.shift();Bs.getInstance(t.el).hide()}e.forEach((e=>{let t=e.el.classList.contains("top"),s=e.el.classList.contains("bottom"),a=e.el.classList.contains("left"),i=e.el.classList.contains("right"),n=e.el.classList.contains("center");t||s||n||i||a||(s=!0,n=!0),n?a?(e.el.style.left=0,e.el.style.bottom="calc(50% - ("+e.top+"px))"):i?(e.el.style.right=0,e.el.style.bottom="calc(50% - ("+e.top+"px))"):s?(e.el.style.left="calc(50% - ("+e.el.clientWidth+"px) / 2)",e.el.style.bottom=e.top+"px"):t?(e.el.style.left="calc(50% - ("+e.el.clientWidth+"px) / 2)",e.el.style.top=e.top+"px"):(e.el.style.left="calc(50% - ("+e.el.clientHeight+"px) / 2)",e.el.style.bottom="calc(50% - "+e.top+"px)"):(a&&(e.el.style.left=0),s&&(e.el.style.bottom=e.top+"px"),t&&(e.el.style.top=e.top+"px"),i&&(e.el.style.right=0))}))}_enableStack(){let e=[...f.findAll(".vg-toast.show")],t=0;return this._params.stack.enable?(e=e.map((e=>({el:e,top:e.clientHeight}))),e.map((function(e,s){return 0===s?{el:e.el,top:0}:(t+=e.top,{el:e.el,top:t})}))):(e.forEach((e=>{e!==this._element&&Bs.getInstance(e).hide()})),[{el:this._element,top:0}])}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}_addEventListeners(){q.on(document,Hs,(e=>{"Escape"===e.key&&(this._params.keyboard?this.hide():q.trigger(this._element,qs))})),this._params.enableClickToast&&(this._element.classList.add("vg-toast-pointer"),q.on(document,Ds,"#"+this._element.id,(()=>{this.hide()})))}}B(Bs),q.on(document,Ds,'[data-vg-toggle="toast"]',(function(e){const t=f.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),i(this)||(this.setAttribute("aria-expanded",!0),q.one(t,Ps,(()=>{this.setAttribute("aria-expanded",!1)})),Bs.getOrCreateInstance(t).toggle(this))}));const Fs=Bs;vg=t})();
|
|
3
3
|
//# sourceMappingURL=vgapp.js.map
|