@cat-of-summer/st-script 1.0.2 → 1.0.3

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.
@@ -1,4 +1,4 @@
1
- import { elements, find, own } from '../_traits/hasInstanceSymbol.js';
1
+ import { elements, expose, find, own } from '../_traits/hasInstanceSymbol.js';
2
2
 
3
3
 
4
4
  export default class Select {
@@ -11,7 +11,6 @@ export default class Select {
11
11
 
12
12
  get params() {return this.#params;}
13
13
 
14
- // Текущие значения по управляемым <select>: multiple → массив, иначе — строка.
15
14
  get value() {
16
15
  return elements(this.#params.target).map(select => select.multiple
17
16
  ? [...select.selectedOptions].map(o => o.value)
@@ -69,7 +68,6 @@ export default class Select {
69
68
  this.on_init(this.#params);
70
69
  }
71
70
 
72
- // Расчёт inline-позиции панели опций из location (top/bottom/left/right/center).
73
71
  #locate(options) {
74
72
  let loc = (this.#params.location || '').toLowerCase().split(/\s+/);
75
73
 
@@ -83,8 +81,14 @@ export default class Select {
83
81
  });
84
82
  }
85
83
 
86
- // Обернуть один нативный <select> кастомной структурой и навесить поведение.
87
84
  #build(select) {
85
+ own(select, this);
86
+ expose(select, {
87
+ open: () => this.open(select),
88
+ close: () => this.close(select),
89
+ toggle: () => this.toggle(select)
90
+ });
91
+
88
92
  let container = document.createElement('select-container');
89
93
  own(container, this);
90
94
  Object.assign(container.style, { position: 'relative', display: 'inline-block' });
@@ -98,7 +102,6 @@ export default class Select {
98
102
  Object.assign(options.style, { transition: `all ${this.#params.duration}s` });
99
103
  this.#locate(options);
100
104
 
101
- // Нативный select — держатель значения; визуально скрыт.
102
105
  Object.assign(select.style, {
103
106
  position: 'absolute', width: '1px', height: '1px',
104
107
  overflow: 'hidden', clip: 'rect(0 0 0 0)', clipPath: 'inset(50%)',
@@ -137,7 +140,6 @@ export default class Select {
137
140
  });
138
141
  }
139
142
 
140
- // Применить выбор опции: синхронизация нативного select + хуки + change.
141
143
  #choose(container, select, option, item) {
142
144
  if (this.before_change(option, select) === false) return;
143
145
 
@@ -158,7 +160,6 @@ export default class Select {
158
160
  if (!select.multiple && this.#params.close_on_select) this.close(container);
159
161
  }
160
162
 
161
- // Отрисовать текст текущего выбора в триггере.
162
163
  #render(select, trigger) {
163
164
  if (select.multiple)
164
165
  trigger.textContent = [...select.selectedOptions].map(o => o.textContent).join(', ');
@@ -204,7 +205,6 @@ export default class Select {
204
205
  });
205
206
  }
206
207
 
207
- // Нормализовать произвольный элемент к его <select-container>.
208
208
  #resolve = (el) => el?.closest?.('select-container')
209
209
  ?? (el?.tagName?.toLowerCase() == 'select' ? el.parentElement : null);
210
210
  }
@@ -1,4 +1,4 @@
1
- import { elements, find, own } from '../_traits/hasInstanceSymbol.js';
1
+ import { elements, expose, find, own } from '../_traits/hasInstanceSymbol.js';
2
2
 
3
3
 
4
4
  export default class Toggle {
@@ -64,6 +64,11 @@ export default class Toggle {
64
64
 
65
65
  for (let trigger of elements(this.#params.trigger)) {
66
66
  own(trigger, this);
67
+ expose(trigger, {
68
+ toggle: () => this.toggle(trigger),
69
+ activate: () => this.activate(trigger),
70
+ deactivate: () => this.deactivate(trigger)
71
+ });
67
72
  init(trigger);
68
73
  this.#targets(trigger).forEach(init);
69
74
 
@@ -1 +0,0 @@
1
- var W=Symbol(),k=h=>{try{return h instanceof Element?h:document.querySelector(h)}catch{return}},E=h=>{if(h==null)return[];if(h instanceof Element)return[h];if(h instanceof NodeList||h instanceof HTMLCollection)return[...h];if(Array.isArray(h))return h.flatMap(E);try{return[...document.querySelectorAll(h)]}catch{return[]}},x=h=>k(h)?.[W],w=(h,e)=>(h&&(h[W]=e),h);var C=class{static merge(...e){let t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s)&&(Object.getPrototypeOf(s)??Object.prototype)===Object.prototype,i=(s,n)=>{if(typeof s=="function"&&typeof n=="function")return(...o)=>i(s(...o),n(...o));if(!(Array.isArray(s)&&Array.isArray(n)||t(s)&&t(n)))return n;let r=Array.isArray(s)?s.slice():{...s};for(let[o,l]of Object.entries(n))r[o]=o in r?i(r[o],l):l;return r};return e.reduce(i,{})}static generate_unique_prefix(e){return e={characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",length:16,...e},[...Array(e.length)].map(t=>e.characters[Math.random()*e.characters.length|0]).join("")}static fetch(e){e instanceof HTMLFormElement&&(e={url:e.getAttribute("action")||"",method:e.getAttribute("method")||"",data:new FormData(e)}),e={url:"",method:"",data:null,headers:{},timeout:0,response_type:"",...e};let t={beforeSend:[e.before_send],onSend:[e.on_send],onSuccess:[e.on_success],onComplete:[e.on_complete],onFailed:[e.on_failed]},i,s,n,r=!1,o=new Promise((u,c)=>(s=u,n=c)),l=(u,c)=>{for(let p of t[u])if(p)try{p(c)}catch(d){console.error(`st_ajax: ${u} error`,d)}},a={then:(u,c)=>o.then(u,c),catch:u=>o.catch(u),finally:u=>o.finally(u),abort:()=>i?.abort()};for(let u of Object.keys(t))a[u]=c=>(t[u].push(c),a);let f=u=>{if(r)return;r=!0;let c=u instanceof XMLHttpRequest?{status:u.status,status_text:u.statusText,response:u.responseText,request:u}:{status:void 0,status_text:"",response:u};l("onFailed",c),n(c)};return queueMicrotask(()=>{try{let u=e.url,c=e.method,p;if(l("beforeSend",e),e.data instanceof FormData?p=e.data:e.data instanceof HTMLFormElement?(u=u||e.data.getAttribute("action"),c=c||e.data.getAttribute("method"),p=new FormData(e.data)):p=e.data,u=u||window.location.href,c=c?c.toUpperCase():"GET",p&&typeof p=="object")if(c=="GET"){let d=p instanceof FormData?new URLSearchParams(p).toString():Object.entries(p).map(([g,y])=>`${encodeURIComponent(g)}=${encodeURIComponent(y)}`).join("&");d&&(u+=(/\?.+=/.test(u)?"&":"?")+d),p=null}else p instanceof FormData||(p=JSON.stringify(e.data),Object.keys(e.headers).some(d=>d.toLowerCase()=="content-type")||(e.headers["Content-Type"]="application/json"));if(i=new XMLHttpRequest,e.response_type)try{i.responseType=e.response_type}catch{}e.timeout>0&&Number.isFinite(e.timeout)&&(i.timeout=e.timeout),i.onerror=i.ontimeout=()=>f(i),i.onreadystatechange=()=>{if(i.readyState!==4)return;let d;if(i.status>=200&&i.status<300){if(i.responseType)d=i.response;else{let g=i.getResponseHeader("Content-Type")||e.response_type||"";if(g.includes("/json"))try{d=JSON.parse(i.responseText)}catch{d=i.responseText}else g.includes("/xml")?d=new DOMParser().parseFromString(i.responseText,"application/xml"):g.includes("/html")?d=new DOMParser().parseFromString(i.responseText,"text/html"):d=i.responseText}l("onSuccess",{data:d,request:i}),r=!0,s({data:d,request:i})}else f(i);l("onComplete",{data:d,request:i})},i.open(c,u,!0);for(let d in e.headers)if(Object.prototype.hasOwnProperty.call(e.headers,d))try{i.setRequestHeader(d,e.headers[d])}catch{}i.send(p),l("onSend",{detail:e})}catch(u){f(u)}}),a}};var S=class h{#e={};#t=null;static find=x;static HOOKS=["before_load","on_load","before_paste","on_paste","on_failed","on_complete","before_init","on_init"];static html(e,...t){let i=Array.isArray(e)?e.reduce((s,n,r)=>s+t[r-1]+n):e;return new DOMParser().parseFromString(i,"text/html").body.firstElementChild}get params(){let e={};for(let[t,i]of Object.entries(this.#e))typeof i!="function"&&t!="formats"&&(e[t]=i);return e}get loading(){return!!this.#t}html=h.html;clone(e={}){return new h({...this.#e,...e,formats:{...this.#e.formats,...e.formats},parent:this})}constructor(e){this.#e={target:null,source:null,mode:"append",multiple:!0,allow_interrupt:!1,formats:{},render(t){return t},before_load:()=>{},on_load:()=>{},before_paste:()=>{},on_paste:()=>{},on_failed:()=>{},on_complete:()=>{},before_init:()=>{},on_init:()=>{},...e},this.#e.before_init.call(this,this.#e),this.target=k(this.#e.target),this.target&&w(this.target,this),this.#e.on_init.call(this,this.#e)}#s(e){return e instanceof Document?"html":typeof e=="string"?"text":"json"}#o(e){let t=this.#e,i=t.formats?.[e]??{},s={};for(let n of new Set([...Object.keys(t),...Object.keys(i)])){if(n=="formats")continue;let r=t[n],o=i[n],l;n in i&&n in t&&h.HOOKS.includes(n)&&typeof r=="function"&&typeof o=="function"?l=n=="on_load"?(a,f,u)=>{let c=r.call(this,a,f,u)??f;return o.call(this,a,c,u)??c}:(...a)=>{r.apply(this,a),o.apply(this,a)}:l=n in i?o:r,s[n]=typeof l=="function"?l.bind(this):l}return s}#c(e,t,i){if(i=="html"){let s=e.body??e.documentElement??e;return t.source?t.multiple?[...s.querySelectorAll(t.source)]:s.querySelector(t.source):t.multiple?[...s.children]:s.firstElementChild}return i=="json"&&t.source?t.source.split(".").reduce((s,n)=>s?.[n],e):e}load(e={}){let{mode:t,...i}=typeof e=="string"?{url:e}:e;if(this.#t){if(!this.#e.allow_interrupt)return this;this.#t.abort()}this.target?.setAttribute("state","loading"),this.#e.before_load.call(this,i);let s=C.fetch(i).onSuccess(({data:n,request:r})=>{let o=this.#s(n),l=this.#o(o),a=this.#c(n,l,o);a=l.on_load(n,a,r)??a;let f=[],u=l.multiple?a?.length??0:1;for(let d=0;d<u;d++){let g=l.multiple?a?.[d]:a,y=l.render(g,d);y instanceof Node&&f.push(y)}l.before_paste(f);let c=document.createDocumentFragment();f.forEach(d=>c.append(d));let p=t??l.mode;this.target&&(p=="replace"?this.target.replaceChildren(c):p=="prepend"?this.target.prepend(c):this.target.append(c)),l.on_paste(f,n)}).onFailed(n=>this.#e.on_failed.call(this,n)).onComplete(n=>this.#e.on_complete.call(this,n));return s.finally(()=>{this.#t===s&&(this.#t=null,this.target?.setAttribute("state","loaded"))}),this.#t=s,this}abort(){return this.#t?.abort(),this}};var T=class h extends HTMLElement{static#e=new Set(["disabled","checked","readonly","required","selected","hidden","open","autofocus"]);static#t=new Map;static#s=new Set;static create(e){let{app:t,setup:i=()=>{},template:s="",events:n={}}=e;if(h.#t.has(t))throw new Error(`Application "${t}" already exists!`);h.#t.set(t,{setup:i,template:s,events:n,config:e}),h.#s.forEach(r=>{r.#o!==!0&&r.#R()})}static extend(e,t={}){let i=h.#t.get(e);if(!i)throw new Error(`Application "${e}" not found!`);let s=i.config,n={...s,...t};return(s.events||t.events)&&(n.events={...s.events,...t.events}),h.create(n)}#o=!1;#c="";#h=!1;#n=new Map;#d=null;#l=new Set;#p=!1;#i=[];#r=null;#f=new Map;#u=null;#a=[];#g=new Set;#k=!1;#m=new Map;#T=0;constructor(){super(),h.#s.add(this)}#v(e){!e||!e.length||e.forEach(t=>{if(t.type==="event"&&t.element&&t.handler)t.element.removeEventListener(t.eventName,t.handler);else if(t.type==="model"&&t.element&&t.handler){let i=t.element.tagName==="SELECT"?"change":"input";t.element.removeEventListener(i,t.handler)}else t.type==="attrSync"&&t.unwatch&&t.unwatch();t.effect&&(this.#n.forEach((i,s)=>{i.delete(t.effect),i.size===0&&this.#n.delete(s)}),this.#l.delete(t.effect))})}get template(){return this.#c}get attrs(){return{get:e=>this.getAttribute(e),set:(e,t)=>this.setAttribute(e,t),remove:e=>this.removeAttribute(e),has:e=>this.hasAttribute(e),toggle:(e,t)=>this.toggleAttribute(e,t),keys:()=>Array.from(this.attributes).map(e=>e.name),entries:()=>Array.from(this.attributes).map(e=>[e.name,e.value])}}addEventListener(e,t,i){if((e==="setup"||e==="rendered")&&this.#h){queueMicrotask(()=>t(new CustomEvent(e)));return}super.addEventListener(e,t,i)}dispatchEvent(e,t=null,i={}){if(typeof e=="string"){let s=new CustomEvent(e,{cancelable:!0,...i,detail:t});return super.dispatchEvent(s)}return super.dispatchEvent(e)}applyTemplate(e=""){let t=e||this.#c;if(this.#v(this.#i),this.#i=[],this.innerHTML="",t){let s=document.createElement("template");s.innerHTML=t.trim();let n=s.content.cloneNode(!0);Array.from(n.childNodes).forEach(r=>this.#x(r)),this.#j(n)}let i=++this.#T;new Promise(s=>{let n=null,r,o=()=>{clearTimeout(n),n=setTimeout(()=>{r.disconnect(),this.#L(Array.from(this.children)).then(s)},0)};r=new MutationObserver(l=>{l.some(a=>a.type==="childList")&&o()}),r.observe(this,{childList:!0}),o()}).then(()=>{i===this.#T&&(this.#h=!0,this.dispatchEvent("rendered"))})}#j(e){HTMLElement.prototype.appendChild.call(this,e)}clone(e={}){let t=this.attrs.get("app");return h.extend(t,e)}watch(e,t,i={}){if(typeof t!="function")return()=>{};let{deep:s=!1,immediate:n=!1}=i;if(typeof e=="string"&&e.endsWith("()")){let r=e.slice(0,-2),o=this[r];if(typeof o!="function")return()=>{};let l=this.#m.get(r);if(!l){l={original:o,handlers:[]},this.#m.set(r,l);let f=(...u)=>{let c=o.apply(this,u),p=d=>{for(let g of[...l.handlers])g.callback(u,d,g.unwatch)};return c instanceof Promise?c.then(d=>(p(d),d)):(p(c),c)};this[r]=f}let a=()=>{let f=l.handlers.findIndex(u=>u.unwatch===a);f!==-1&&l.handlers.splice(f,1),l.handlers.length===0&&(this[r]=l.original,this.#m.delete(r))};return l.handlers.push({callback:t,unwatch:a}),a}if(typeof e=="string"){let r=e,o=()=>{let a=this.#a.findIndex(f=>f.unwatch===o);a!==-1&&this.#a.splice(a,1)},l={type:"key",key:r,callback:t,deep:s,immediate:n,lastValue:void 0,unwatch:o};if(this.#a.push(l),n){let a=this.#O(r);l.lastValue=s&&a!==null&&typeof a=="object"?JSON.parse(JSON.stringify(a)):a,t(a,void 0,o)}return o}if(typeof e=="function"){let r=e,o,l={type:"getter",getter:r,callback:t,deep:s,lastValue:o,effect:null,unwatch:null};this.#a.push(l);let a=()=>{let c=this.#a.indexOf(l);c!==-1&&this.#a.splice(c,1),l.effect&&(this.#n.forEach((p,d)=>{p.delete(l.effect),p.size===0&&this.#n.delete(d)}),this.#l.delete(l.effect))};l.unwatch=a;let f=()=>{let c=r.call(this);if(s?!this.#C(c,o):c!==o){let d=o;o=s&&c!==null&&typeof c=="object"?JSON.parse(JSON.stringify(c)):c,t(c,d,l.unwatch)}},u=this.#_(f);return l.effect=u,a}return()=>{}}unwatch(){[...this.#a].forEach(e=>e.unwatch()),this.#m.forEach(e=>{[...e.handlers].forEach(t=>t.unwatch())})}hasWatchers(){let e=0;return this.#m.forEach(t=>{e+=t.handlers.length}),this.#a.length+e}watched(e,t,i={}){if(typeof e=="string"&&e.endsWith("()")){let s=e.slice(0,-2),n=this.#m.get(s);n&&[...n.handlers].forEach(r=>r.unwatch())}else typeof e=="string"?this.#a.filter(s=>s.type==="key"&&s.key===e).forEach(s=>s.unwatch()):typeof e=="function"&&this.#a.filter(s=>s.type==="getter"&&s.getter===e).forEach(s=>s.unwatch());return this.watch(e,t,i)}#E(e){this.#d&&(this.#n.has(e)||this.#n.set(e,new Set),this.#n.get(e).add(this.#d))}#y(e){this.#g.add(e);let t=this.#n.get(e);if(t&&t.forEach(s=>this.#l.add(s)),this.#p){this.#k=!0;return}this.#p=!0;let i=()=>{this.#l.forEach(r=>{try{r()}catch(o){console.error("Effect execution error:",o)}}),this.#l.clear();let s=Array.from(this.#g),n=new Set;for(let r of s)for(let o of this.#a){if(o.type!=="key")continue;(o.key===r||o.deep&&(r===o.key||r.startsWith(o.key+".")))&&n.add(o)}for(let r of n){if(r.type!=="key")continue;let o=this.#O(r.key);if(!(r.deep?!this.#C(o,r.lastValue):o!==r.lastValue))continue;let a=r.lastValue;r.lastValue=r.deep&&o!==null&&typeof o=="object"?JSON.parse(JSON.stringify(o)):o,r.callback(o,a,r.unwatch)}this.#g.clear(),this.#p=!1,this.#k&&(this.#k=!1,this.#p=!0,Promise.resolve().then(i))};Promise.resolve().then(i)}#O(e){return e.split(".").reduce((t,i)=>t?.[i],this)}#C(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;let i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(let n of i)if(!s.includes(n)||!this.#C(e[n],t[n]))return!1;return!0}#w(e,t=[]){if(e===null||typeof e!="object"||e.__isReactive)return e;let i=this;return new Proxy(e,{get(n,r,o){if(r==="__isReactive")return!0;let l=typeof r=="symbol"?"<symbol>":r,a=[...t,l].join(".");i.#E(a);let f=Reflect.get(n,r,o);return f!==null&&typeof f=="object"&&!f.__isReactive?i.#w(f,[...t,l]):f},set(n,r,o,l){if(n[r]===o)return!0;let f=Reflect.set(n,r,o,l),u=typeof r=="symbol"?"<symbol>":r,c=[...t,u].join(".");if(i.#y(c),Array.isArray(n)&&(r==="length"||!isNaN(r))){let p=t.join(".");p&&i.#y(p)}return f},deleteProperty(n,r){let o=Reflect.deleteProperty(n,r),l=typeof r=="symbol"?"<symbol>":r,a=[...t,l].join(".");return i.#y(a),o}})}#M(e,t){let i=this;return new Proxy(e,{apply(s,n,r){let o=Reflect.apply(s,i,r);return o instanceof Promise?o.then(l=>(i.#y(t),l)):(i.#y(t),o)}})}#_(e){let t=this.#r?{...this.#r}:null,i=()=>{let s=null;if(t){s={};for(let n of Object.keys(t))s[n]=this[n],this[n]=t[n]}this.#d=i;try{e()}finally{if(this.#d=null,s)for(let n of Object.keys(s))s[n]!==void 0?this[n]=s[n]:delete this[n]}};return i(),i}#b(e){try{return new Function("$event",`with(this) { return (${e}); }`).call(this)}catch(t){console.warn("Expression evaluation error:",e,t);return}}#N(e,t=null){try{return new Function("$event",`with(this) { ${e} }`).call(this,t)}catch(i){console.error("Statement execution error:",e,i)}}#F(e){let t=e.nodeValue,i=[],s=[],n=0,r=/\{\{(.+?)\}\}/g,o;for(;(o=r.exec(t))!==null;){o.index>n&&i.push(t.substring(n,o.index));let a=o[1].trim();i.push(null),s.push({index:i.length-1,expr:a}),n=r.lastIndex}n<t.length&&i.push(t.substring(n));let l=this.#_(()=>{s.forEach(({index:a,expr:f})=>{let u=this.#b(f);i[a]=u==null?"":String(u)}),e.nodeValue=i.join("")});this.#i.push({type:"text",node:e,effect:l})}#q(e,t){let i=t.name.slice(1),s=t.value,n=this.#r?{...this.#r}:null,r=o=>{if(n){let l={};for(let a of Object.keys(n))l[a]=this[a],this[a]=n[a];this.#N(s,o);for(let a of Object.keys(l))l[a]!==void 0?this[a]=l[a]:delete this[a]}else this.#N(s,o)};e.addEventListener(i,r),this.#i.push({type:"event",element:e,eventName:i,handler:r})}#$(e,t){let i=t.value,s=this.#_(()=>{this.#b(i)?e.style.display="":e.style.display="none"});this.#i.push({type:"show",element:e,effect:s})}#I(e,t){let i=t.value,s=this.#_(()=>{let l=this.#b(i);e.tagName==="INPUT"&&e.type==="checkbox"?e.checked=!!l:e.tagName==="INPUT"&&e.type==="radio"?e.checked=e.value===l:e.tagName==="SELECT"?e.value=l:e.value=l??""}),n=this.#r?{...this.#r}:null,r=e.tagName==="SELECT"?"change":"input",o=l=>{let a;if(e.type==="checkbox"?a=e.checked:e.type==="number"||e.type==="range"?a=e.valueAsNumber:a=e.value,n){let f={};for(let u of Object.keys(n))f[u]=this[u],this[u]=n[u];try{new Function("value",`with(this) { ${i} = value; }`).call(this,a)}catch(u){console.error("Model binding error:",i,u)}for(let u of Object.keys(f))f[u]!==void 0?this[u]=f[u]:delete this[u]}else try{new Function("value",`with(this) { ${i} = value; }`).call(this,a)}catch(f){console.error("Model binding error:",i,f)}};e.addEventListener(r,o),this.#i.push({type:"model",element:e,effect:s,handler:o})}#z(e,t){let i=t.value,s=document.createComment(`if: ${i}`);e.parentNode.insertBefore(s,e);let n=[{expr:i,element:e,bindings:[],processed:!1}],r=e.nextElementSibling;for(;r;)if(r.hasAttribute("#else-if")){let a=r.getAttribute("#else-if");n.push({expr:a,element:r,bindings:[],processed:!1}),r.removeAttribute("#else-if");let f=r.nextElementSibling;r.remove(),r=f}else if(r.hasAttribute("#else")){n.push({expr:"true",element:r,bindings:[],processed:!1}),r.removeAttribute("#else"),r.remove();break}else break;e.removeAttribute(t.name),e.remove();let o=null,l=this.#_(()=>{let a=null;for(let f of n)if(this.#b(f.expr)){a=f;break}if(o!==a){if(o&&(o.element&&o.element.parentNode&&o.element.remove(),this.#v(o.bindings),o.bindings=[]),a&&(s.parentNode.insertBefore(a.element,s.nextSibling),!a.processed)){let f=this.#i.length;this.#x(a.element),a.bindings=this.#i.slice(f),a.processed=!0}o=a}});this.#i.push({type:"conditional",placeholder:s,chain:n,effect:l})}#H(e,t){let i=t.value,s=i.match(/^\s*(\w+)\s+in\s+(.+)$/);if(!s){console.error("Invalid for syntax:",i);return}let n=s[1],r=s[2],o=e.parentNode,l=e.nextSibling;e.removeAttribute(t.name);let a=e.cloneNode(!0);e.remove();let f=[],u=this.#_(()=>{let c=this.#b(r);f.forEach(g=>{g.node&&g.node.parentNode&&g.node.remove(),this.#v(g.bindings)}),f=[];let p;if(Array.isArray(c))p=c.map((g,y)=>({value:g,key:void 0,index:y}));else if(c!==null&&typeof c=="object")p=Object.entries(c).map(([g,y],_)=>({value:y,key:g,index:_}));else return;if(p.length===0)return;let d=document.createDocumentFragment();p.forEach(({value:g,key:y,index:_})=>{let m=a.cloneNode(!0),v=this[n],b=this.$index,L=this.$key;this[n]=g,this.$index=_,y!==void 0&&(this.$key=y);let A=this.#r,D={...A,[n]:g,$index:_};y!==void 0&&(D.$key=y),this.#r=D;let V=this.#i.length;this.#x(m);let B=this.#i.slice(V);this.#r=A,v!==void 0?this[n]=v:delete this[n],b!==void 0?this.$index=b:delete this.$index,L!==void 0?this.$key=L:delete this.$key,d.appendChild(m),f.push({node:m,bindings:B})}),o.insertBefore(d,l)});this.#i.push({type:"loop",parent:o,nextSibling:l,template:a,effect:u})}#P(e,t){let i=t.name,s=t.value,n=[],r=[],o=0,l=/\{\{(.+?)\}\}/g,a;for(;(a=l.exec(s))!==null;){a.index>o&&n.push(s.substring(o,a.index));let u=a[1].trim();n.push(null),r.push({index:n.length-1,expr:u}),o=l.lastIndex}o<s.length&&n.push(s.substring(o));let f=this.#_(()=>{r.forEach(({index:c,expr:p})=>{let d=this.#b(p);n[c]=d==null?"":String(d)});let u=n.join("");h.#e.has(i)?u===""||u==="false"||u==="0"||u==="null"||u==="undefined"||!u?e.removeAttribute(i):e.setAttribute(i,""):e.setAttribute(i,u)});this.#i.push({type:"attribute",element:e,attrName:i,effect:f})}#D(e){let t=Array.from(e.attributes);for(let i of t){if(i.name==="#if")return this.#z(e,i),e.removeAttribute(i.name),!0;if(i.name==="#for")return this.#H(e,i),e.removeAttribute(i.name),!0;if(i.name==="#show")this.#$(e,i),e.removeAttribute(i.name);else if(i.name==="#model")this.#I(e,i),e.removeAttribute(i.name);else if(i.name==="#once")e.removeAttribute(i.name);else{if(i.name==="#pre")return e.removeAttribute(i.name),!0;i.name.startsWith("@")?(this.#q(e,i),e.removeAttribute(i.name)):/\{\{.+?\}\}/.test(i.value)&&this.#P(e,i)}}return!1}#x(e){if(e.nodeType===Node.ELEMENT_NODE){let t=this.#D(e);if(e.localName==="st-app")return;!t&&(e.parentNode||e.childNodes.length>0)&&Array.from(e.childNodes).forEach(i=>this.#x(i))}else e.nodeType===Node.TEXT_NODE&&/\{\{.+?\}\}/.test(e.nodeValue)&&this.#F(e)}#R(){let e=this.attrs.get("app"),t=h.#t.get(e);if(t){this.addEventListener("setup",t.setup),Object.entries(t.events).forEach(([r,o])=>this.addEventListener(r,o)),this.#c=t.template;let i=t.config,s=Object.getOwnPropertyDescriptors(i),n=new Set(["app","setup","template","events"]);Object.entries(s).forEach(([r,o])=>{if(!n.has(r)){if(o.get){let l=o.get;this.#f.set(r,l),Object.defineProperty(this,r,{get(){return this.#E(r),l.call(this)},enumerable:o.enumerable,configurable:!0})}else if(o.value!==void 0){let l=o.value,a=l;typeof l=="object"&&l!==null?a=this.#w(l,[r]):typeof l=="function"&&(a=this.#M(l,r)),Object.defineProperty(this,r,{get(){return this.#E(r),a},set(f){a!==f&&(typeof f=="object"&&f!==null?a=this.#w(f,[r]):a=f,this.#y(r))},enumerable:!0,configurable:!0})}}}),typeof this.#o=="function"&&this.#o(),this.#o=!0}else this.attrs.get("app")||(typeof this.#o=="function"&&this.#o(),this.#o=!0)}async#L(e){await Promise.all(e.map(t=>new Promise(i=>{let s=null,n=()=>{clearTimeout(s),s=setTimeout(()=>{r.disconnect(),this.#L(Array.from(t.children)).then(i)},0)},r=new MutationObserver(o=>{o.some(l=>l.type==="childList")&&n()});r.observe(t,{childList:!0}),n()})))}#S(e){return e==null?"":e===!0?"true":e===!1?"false":typeof e=="number"?String(e):typeof e=="object"?JSON.stringify(e):String(e)}#A(e){if(!e.startsWith(":")||e==="app")return;let t=e.replace(/^:+/,""),i=this.getAttribute(e),s=Object.getOwnPropertyDescriptor(this,t),n=i;if(!i&&s&&(s.get||s.value!==void 0)){let r=this[t],o=this.#S(r);this.getAttribute(e)!==o&&this.setAttribute(e,o),n=r,s=null}if(!(s&&s.set===void 0&&s.writable===!1)&&!(s&&s.get!==void 0&&s.set===void 0)){if(i)if(i==="true")n=!0;else if(i==="false")n=!1;else if(/^-?\d+(\.\d+)?$/.test(i))n=Number(i);else try{n=JSON.parse(i)}catch{n=i}if(!s||!s.set){let r=n;typeof n=="object"&&n!==null?r=this.#w(n,[t]):typeof n=="function"&&(r=this.#M(n,t));let o=e;if(Object.defineProperty(this,t,{get(){return this.#E(t),r},set(l){if(r!==l){typeof l=="object"&&l!==null?r=this.#w(l,[t]):r=l,this.#y(t);let a=this.#S(l);this.getAttribute(o)!==a&&this.setAttribute(o,a)}},enumerable:!0,configurable:!0}),typeof n=="object"&&n!==null){let l=this.watch(t,()=>{let a=this[t],f=this.#S(a);this.getAttribute(e)!==f&&this.setAttribute(e,f)},{deep:!0});this.#i.push({type:"attrSync",unwatch:l})}}else this[t]=n}}attributeChangedCallback(e,t,i){e.startsWith(":")&&e!=="app"&&t!==i&&this.#o===!0&&this.#A(e)}connectedCallback(){if(h.#s.add(this),this.#o===!0){this.#u||(this.#u=new MutationObserver(e=>{for(let t of e)t.type==="attributes"&&t.attributeName&&t.attributeName.startsWith(":")&&t.attributeName!=="app"&&this.#A(t.attributeName)}),this.#u.observe(this,{attributes:!0}));return}this.#R(),Promise.all([new Promise(e=>{if(this.#o===!0)return e();this.#o=e}),new Promise(e=>{let t=null,i=()=>{clearTimeout(t),t=setTimeout(()=>{s.disconnect(),this.#L(Array.from(this.children)).then(e)},0)},s=new MutationObserver(n=>{n.some(r=>r.type==="childList")&&i()});s.observe(this,{childList:!0}),i()})]).then(()=>{this.dispatchEvent("setup");for(let t of this.attrs.keys())!t.startsWith(":")||t==="app"||this.#A(t);let e=!1;this.childNodes.length>0&&Array.from(this.childNodes).some(i=>i.nodeType===Node.ELEMENT_NODE||i.nodeType===Node.TEXT_NODE&&i.textContent.trim()!=="")&&(this.#c?(this.applyTemplate(this.innerHTML),e=!0):this.#c=this.innerHTML),e||this.applyTemplate(),this.#o===!0&&!this.#u&&(this.#u=new MutationObserver(t=>{for(let i of t)i.type==="attributes"&&i.attributeName&&i.attributeName.startsWith(":")&&i.attributeName!=="app"&&this.#A(i.attributeName)}),this.#u.observe(this,{attributes:!0}))})}disconnectedCallback(){this.#u&&(this.#u.disconnect(),this.#u=null),this.#v(this.#i),this.#i=[];for(let e of this.#a)e.type==="getter"&&e.effect&&(this.#n.forEach((t,i)=>{t.delete(e.effect),t.size===0&&this.#n.delete(i)}),this.#l.delete(e.effect));this.#a=[],this.#m.forEach((e,t)=>{this[t]=e.original}),this.#m.clear(),this.#g.clear(),this.#n.clear(),this.#l.clear(),h.#s.delete(this)}toggleAttribute(e,t="",i=""){let s=this.getAttribute(e);this[t==""&&i==""&&(s||this.hasAttribute(e))?"removeAttribute":"setAttribute"](e,s!=t?t:i)}static{customElements.define("st-app",this)}};var $=class h{static DEFAULT_ICONS={arrow:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"><style type="text/css">.st0{fill:#77B3D4;}.st1{opacity:0.2;}.st2{fill:#231F20;}.st3{fill:#FFFFFF;}</style><g id="Layer_1"><g><circle class="st0" cx="32" cy="32" r="32"/></g><g class="st1"><path class="st2" d="M49.5,33.9L35.3,15.7c-1.8-2.3-4.7-2.3-6.5,0L14.5,33.9c-1.8,2.3-1,4.1,1.7,4.1H24v12c0,2.2,1.8,4,4,4h8c2.2,0,4-1.8,4-4V38h7.8C50.6,38,51.3,36.1,49.5,33.9z"/></g><g><path class="st3" d="M40,48c0,2.2-1.8,4-4,4h-8c-2.2,0-4-1.8-4-4V24c0-2.2,1.8-4,4-4h8c2.2,0,4,1.8,4,4V48z"/></g><g><path class="st3" d="M16.2,36c-2.7,0-3.5-1.9-1.7-4.1l14.3-18.1c1.8-2.3,4.7-2.3,6.5,0l14.3,18.1c1.8,2.3,1,4.1-1.7,4.1H16.2z"/></g></g><g id="Layer_2"></g></svg>'};static#e={settings:{position:"bottom-right"},condition:{name:"scroll",options:{hiding_type:"opacity",transition:"0.3s",attribute:[],margin_top:Math.min(window.innerHeight,document.documentElement.clientHeight),margin_left:void 0,margin_right:void 0,margin_bottom:void 0}},action:{name:"scroll",options:{selector:void 0,hiding_type:"opacity",setAttribute:void 0,removeAttribute:void 0,toggleAttribute:void 0,top:0,left:void 0,behavior:"smooth",hook:function(){}}},widget_container:{id:void 0,class:void 0,style:{}},widget:{id:void 0,class:void 0,style:{}},button_container:{id:void 0,class:void 0,style:{}},button:{src:h.DEFAULT_ICONS.arrow}};static#t={widget_container:{position:"fixed",width:"60px",height:"60px",margin:"30px"},widget:{position:"absolute"},button_container:{display:"flex","justify-content":"center","align-items":"center",overflow:"hidden",width:"60px",height:"60px","border-radius":"50%",cursor:"pointer"},button:{width:"100%",height:"100%","object-fit":"cover"}};static#s(...e){function t(s,n){function r(o,l,a){if(typeof l[o]=="object")for(let f in l[o])a[o]||(a[o]={}),r(f,l[o],a[o]);else a[o]=l[o]}for(let o in s)r(o,s,n)}let i={};for(let s of e)t(s,i);return i}static#o(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i="";for(let s=0;s<e;s++)i+=t.charAt(Math.floor(Math.random()*t.length));return i}static#c={opacity:"0",visibility:"hidden",display:"none"};#h="st_"+h.#o(16);#n=this.#h+"_wc";#d=this.#h+"_w";#l=this.#h+"_bc";#p=this.#h+"_b";#i=document.createElement("style");#r=document.createElement("div");#f=document.createElement("div");#u=document.createElement("div");#a(e,t,i){new RegExp(e+"{.*?"+t+":.*?;.*?}").test(this.#i.innerHTML)?this.#i.innerHTML=this.#i.innerHTML.replace(new RegExp("("+e+"{.*?"+t+":).*?(;.*?})"),"$1"+i+"$2"):new RegExp(e+"{.*?}").test(this.#i.innerHTML)?this.#i.innerHTML=this.#i.innerHTML.replace(new RegExp("("+e+"{.*?)(})"),"$1"+t+":"+i+";$2"):this.#i.innerHTML+=e+"{"+t+":"+i+";}"}#g(e,t){for(let i in t)this.#a(e,i,t[i])}constructor(e){function t(r,o,l=!1){return{show:function(){r.style.removeProperty(o)},hide:function(){r.style.setProperty(o,l?"unset":h.#c[o])}}}function i(r){switch(r){case"top-left":return{top:"0",left:"0"};case"top-right":return{top:"0",right:"0"};case"bottom-left":return{bottom:"0",left:"0"};case"bottom-right":default:return{bottom:"0",right:"0"}}}function s(r){return r?typeof r=="object"?[r[0]??"st_active",r[1]??"",r[2]??""]:[r??"st_active","",""]:null}let n=h.#s(h.#e,e);if(this.#g("."+this.#n,h.#t.widget_container),this.#g("."+this.#d,h.#t.widget),this.#g("."+this.#l,h.#t.button_container),this.#g("."+this.#p,h.#t.button),this.#g("."+this.#n,i(n.settings.position)),this.#g("."+this.#d,i(n.settings.position)),this.#r.classList.add(this.#n),this.#g("."+this.#n,n.widget_container.style),n.widget_container.class&&this.#r.classList.add(n.widget_container.class),n.widget_container.id&&(this.#r.id=n.widget_container.id),this.#f.classList.add(this.#d),this.#g("."+this.#d,n.widget.style),n.widget.class&&this.#f.classList.add(n.widget.class),n.widget.id&&(this.#f.id=n.widget.id),this.#u.classList.add(this.#l),this.#g("."+this.#l,n.button_container.style),n.button_container.class&&this.#u.classList.add(n.button_container.class),n.button_container.id&&(this.#u.id=n.button_container.id),n.condition){let r=function(a,f){let u=s(f);return{set:function(){u&&(u[1]?a.setAttribute(u[0],u[1]):a.setAttribute(u[0],""))},remove:function(){u&&(u[1]?u[2]?a.setAttribute(u[0],u[2]):a.setAttribute(u[0],""):a.removeAttribute(u[0]))}}};if(!n.condition.options.hiding_type in h.#c)return;let o=t(this.#f,n.condition.options.hiding_type),l=r(this.#f,n.condition.options.attribute);switch(o.hide(),l.remove(),n.condition.name){case"hover":this.#r.addEventListener("mouseenter",function(){o.show(),l.set()}),this.#r.addEventListener("mouseleave",function(){o.hide(),l.remove()});break;case"scroll":default:let a=Math.min(window.innerHeight,document.documentElement.clientHeight),f=Math.min(window.innerWidth,document.documentElement.clientWidth),u=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),c=Math.max(document.body.scrollWidth,document.documentElement.scrollWidth,document.body.offsetWidth,document.documentElement.offsetWidth,document.body.clientWidth,document.documentElement.clientWidth),p=n.condition.options.margin_top,d=n.condition.options.margin_bottom,g=n.condition.options.margin_right,y=n.condition.options.margin_left;window.addEventListener("scroll",function(){let _=window.pageYOffset||window.scrollY||document.documentElement.scrollTop,m=_+a,v=window.pageXOffset||window.scrollX||document.documentElement.scrollLeft,b=v+f;_>p||m<u-d||b<c-g||v>y?(o.show(),l.set()):(o.hide(),l.remove())});break}n.condition.options.transition&&this.#f.style.setProperty("transition",n.condition.options.transition)}if(n.action)switch(n.action.name){case"show_popup":if(!n.action.options.selector||!n.action.options.hiding_type in h.#c)return;this.#u.addEventListener("click",function(){for(let r of document.querySelectorAll(n.action.options.selector)){let o=t(r,n.action.options.hiding_type,!0);if(r.style[h.#c[n.action.options.hiding_type]]?o.show():o.hide(),n.action.options.setAttribute){let l=s(n.action.options.setAttribute);r.setAttribute(l[0],l[1])}n.action.options.removeAttribute&&r.removeAttribute(n.action.options.removeAttribute),n.action.options.toggleAttribute&&r.toggleAttribute(n.action.options.toggleAttribute)}});break;case"function":this.#u.addEventListener("click",n.action.options.hook);break;case"scroll":default:this.#u.addEventListener("click",function(){window.scrollTo({top:n.action.options.top,left:n.action.options.left,behavior:n.action.options.behavior})});break}new RegExp("^<svg.*?</svg>$").test(n.button.src)?this.#u.innerHTML=n.button.src:this.#u.innerHTML="<img src="+n.button.src+' alt="icon">',this.#u.childNodes[0].classList.add(this.#p),this.#i.setAttribute("widget",this.#h),document.head.appendChild(this.#i),this.#f.appendChild(this.#u),this.#r.appendChild(this.#f),document.querySelector("body").appendChild(this.#r)}},U=$;var O=class h{static set(e,t,i={}){if(i={path:"/",expires:3600,...i},!(i.expires instanceof Date)){let s=i.expires;i.expires=new Date(typeof s=="number"?Date.now()+s*1e3:Date.parse(s)||Date.parse(s.replace(/-/g,"/")))}document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+"; expires="+i.expires.toUTCString()+"; path="+i.path+(i.domain?"; domain="+i.domain:"")+(i.secure?"; secure":"")+(i.sameSite?"; samesite="+i.sameSite:"")}static get(e){e=encodeURIComponent(e);let t=document.cookie.split(";");for(let i=0;i<t.length;i++){let s=t[i].trim();if(s.startsWith(e+"=")){let n=decodeURIComponent(s.substring(e.length+1));try{return JSON.parse(n)}catch{return n}}}return null}static delete(e,t={}){h.set(e,"",{expires:0,...t})}static callback(e,t,i={}){i={interval:0,delay:0,value:!0,...i};let s=setInterval(()=>{h.get(e)===null&&(h.set(e,i.value,i),setTimeout(()=>{t(e)},i.delay*1e3)),i.interval||clearInterval(s)},i.interval*1e3)}static consent(e){e={content:"<div><span>\u042D\u0442\u043E\u0442 \u0441\u0430\u0439\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u0444\u0430\u0439\u043B\u044B cookies \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044B \u0441\u0431\u043E\u0440\u0430 \u0442\u0435\u0445\u043D\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u0441\u0435\u0442\u0438\u0442\u0435\u043B\u0435\u0439 (\u0434\u0430\u043D\u043D\u044B\u0435 \u043E\u0431 IP-\u0430\u0434\u0440\u0435\u0441\u0435, \u043C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0438 \u0438 \u0442.\u0434.) \u0434\u043B\u044F \u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0435\u043D\u0438\u044F \u0440\u0430\u0431\u043E\u0442\u043E\u0441\u043F\u043E\u0441\u043E\u0431\u043D\u043E\u0441\u0442\u0438 \u0438 \u0443\u043B\u0443\u0447\u0448\u0435\u043D\u0438\u044F \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F.</span><div><button action='accept'>\u041F\u0440\u0438\u043D\u044F\u0442\u044C</button><button action='decline'>\u041E\u0442\u043A\u043B\u043E\u043D\u0438\u0442\u044C</button></div></div>",container:"body",location:"bottom",zIndex:1e3,name:"cookie_consent",interval:5,...e};let t=document.createElement("container");if(e.container=="body"&&Object.assign(t.style,{position:"absolute",overflow:"hidden",width:"max-content",height:"max-content",maxWidth:"100vw",maxHeight:"100vh",zIndex:e.zIndex,transition:"inherit",pointerEvents:"all",display:"none",...(()=>{let i=(e.location||"").toLowerCase().split(/\s+/),s={top:i.includes("top")?0:i.includes("bottom")?void 0:"50%",bottom:i.includes("bottom")?0:void 0,left:i.includes("left")?0:i.includes("right")?void 0:"50%",right:i.includes("right")?0:void 0},n=s.left==="50%"?"translateX(-50%)":"",r=s.top==="50%"?"translateY(-50%)":"";return(n||r)&&(s.transform=`${n} ${r}`.trim()),s})()}),document.querySelector(e.container).append(t),!(e.content instanceof Element)){let i=e.content;e.content=i.trim().startsWith("<")?new DOMParser().parseFromString(i,"text/html").body.firstElementChild:document.querySelector(i)??(()=>{throw new Error("\u0421\u0435\u043B\u0435\u043A\u0442\u043E\u0440 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D")})()}t.append(e.content),h.callback(e.name,i=>{["accept","decline"].forEach(s=>{t.querySelectorAll(`[action=${s}]`).forEach(n=>{n.addEventListener("click",r=>{h.set(e.name,s=="accept",e),t.style.display="none"})})}),t.style.display=""},{...e,value:null})}};var I=class h{static DEFAULT_ICONS={link:'<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><g id="chain"><circle cx="16" cy="16" fill="#33d9b2" r="16" style="fill: rgb(119, 179, 212);"></circle><g fill="#fff" fill-rule="evenodd"><path d="m16.75 10h-7.5a.5.5 0 0 0 -.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5v-7.5a.5.5 0 0 0 -1 0v7h-11v-11h7a.5.5 0 0 0 0-1z" fill="#fff" style="fill: rgb(255, 255, 255);"></path><path d="m21.543 9.5-6.643 6.646a.5.5 0 0 0 .708.707l6.646-6.646v1.793a.5.5 0 0 0 1 0v-3a.5.5 0 0 0 -.5-.5h-3a.5.5 0 0 0 0 1z" fill="#fff" style="fill: rgb(255, 255, 255);"></path></g></g></svg>',email:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"><style type="text/css">.st0{fill:#77B3D4;}.st1{opacity:0.2;}.st2{fill:#231F20;}.st3{fill:#E0E0D1;}.st4{fill:#FFFFFF;}</style><g id="Layer_1"><g><circle class="st0" cx="32" cy="32" r="32"/></g><g><g class="st1"><path class="st2" d="M52,44c0,2.2-1.8,4-4,4H16c-2.2,0-4-1.8-4-4V24c0-2.2,1.8-4,4-4h32c2.2,0,4,1.8,4,4V44z"/></g><g><path class="st3" d="M52,42c0,2.2-1.8,4-4,4H16c-2.2,0-4-1.8-4-4V22c0-2.2,1.8-4,4-4h32c2.2,0,4,1.8,4,4V42z"/></g><g class="st1"><g><path class="st2" d="M35.5,30.2c-1.9-2.1-5.1-2.1-7,0L13,43.2c-0.2,0.2-0.3,0.4-0.5,0.6c0.7,1.3,2,2.2,3.4,2.2h32c1.5,0,2.7-0.9,3.4-2.2c-0.1-0.2-0.3-0.4-0.5-0.6L35.5,30.2z"/></g></g><g><g><path class="st3" d="M35.5,32c-1.9-1.9-5.1-1.9-7,0L13,43.5c-0.2,0.2-0.3,0.3-0.5,0.5c0.7,1.2,2,1.9,3.4,1.9h32c1.5,0,2.7-0.8,3.4-1.9c-0.1-0.2-0.3-0.3-0.5-0.5L35.5,32z"/></g></g><g class="st1"><g><path class="st2" d="M12.6,20.2c0.7-1.3,2-2.2,3.4-2.2h32c1.5,0,2.7,0.9,3.4,2.2c-0.1,0.2-0.3,0.4-0.5,0.6l-15.4,13c-1.9,2.1-5.1,2.1-7,0L12.6,20.2z"/></g></g><g><g><path class="st4" d="M28.5,32c1.9,1.9,5.1,1.9,7,0L51,20.5c0.2-0.2,0.3-0.3,0.5-0.5c-0.7-1.2-2-1.9-3.4-1.9H16c-1.5,0-2.7,0.8-3.4,1.9c0.1,0.2,0.3,0.3,0.5,0.5L28.5,32z"/></g></g></g></g><g id="Layer_2"></g></svg>',telegram:'<svg viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid"><g><path d="M128,0 C57.307,0 0,57.307 0,128 L0,128 C0,198.693 57.307,256 128,256 L128,256 C198.693,256 256,198.693 256,128 L256,128 C256,57.307 198.693,0 128,0 L128,0 Z" fill="#40B3E0"></path><path d="M190.2826,73.6308 L167.4206,188.8978 C167.4206,188.8978 164.2236,196.8918 155.4306,193.0548 L102.6726,152.6068 L83.4886,143.3348 L51.1946,132.4628 C51.1946,132.4628 46.2386,130.7048 45.7586,126.8678 C45.2796,123.0308 51.3546,120.9528 51.3546,120.9528 L179.7306,70.5928 C179.7306,70.5928 190.2826,65.9568 190.2826,73.6308" fill="#FFFFFF"></path><path d="M98.6178,187.6035 C98.6178,187.6035 97.0778,187.4595 95.1588,181.3835 C93.2408,175.3085 83.4888,143.3345 83.4888,143.3345 L161.0258,94.0945 C161.0258,94.0945 165.5028,91.3765 165.3428,94.0945 C165.3428,94.0945 166.1418,94.5735 163.7438,96.8115 C161.3458,99.0505 102.8328,151.6475 102.8328,151.6475" fill="#D2E5F1"></path><path d="M122.9015,168.1154 L102.0335,187.1414 C102.0335,187.1414 100.4025,188.3794 98.6175,187.6034 L102.6135,152.2624" fill="#B5CFE4"></path></g></svg>',whatsapp:'<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>Whatsapp-color</title><desc>Created with Sketch.</desc><defs></defs><g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Color-" transform="translate(-700.000000, -360.000000)" fill="#67C15E"><path d="M723.993033,360 C710.762252,360 700,370.765287 700,383.999801 C700,389.248451 701.692661,394.116025 704.570026,398.066947 L701.579605,406.983798 L710.804449,404.035539 C714.598605,406.546975 719.126434,408 724.006967,408 C737.237748,408 748,397.234315 748,384.000199 C748,370.765685 737.237748,360.000398 724.006967,360.000398 L723.993033,360.000398 L723.993033,360 Z M717.29285,372.190836 C716.827488,371.07628 716.474784,371.034071 715.769774,371.005401 C715.529728,370.991464 715.262214,370.977527 714.96564,370.977527 C714.04845,370.977527 713.089462,371.245514 712.511043,371.838033 C711.806033,372.557577 710.056843,374.23638 710.056843,377.679202 C710.056843,381.122023 712.567571,384.451756 712.905944,384.917648 C713.258648,385.382743 717.800808,392.55031 724.853297,395.471492 C730.368379,397.757149 732.00491,397.545307 733.260074,397.27732 C735.093658,396.882308 737.393002,395.527239 737.971421,393.891043 C738.54984,392.25405 738.54984,390.857171 738.380255,390.560912 C738.211068,390.264652 737.745308,390.095816 737.040298,389.742615 C736.335288,389.389811 732.90737,387.696673 732.25849,387.470894 C731.623543,387.231179 731.017259,387.315995 730.537963,387.99333 C729.860819,388.938653 729.198006,389.89831 728.661785,390.476494 C728.238619,390.928051 727.547144,390.984595 726.969123,390.744481 C726.193254,390.420348 724.021298,389.657798 721.340985,387.273388 C719.267356,385.42535 717.856938,383.125756 717.448104,382.434484 C717.038871,381.729275 717.405907,381.319529 717.729948,380.938852 C718.082653,380.501232 718.421026,380.191036 718.77373,379.781688 C719.126434,379.372738 719.323884,379.160897 719.549599,378.681068 C719.789645,378.215575 719.62006,377.735746 719.450874,377.382942 C719.281687,377.030139 717.871269,373.587317 717.29285,372.190836 Z" id="Whatsapp"></path></g></g></svg>'};static#e={settings:{position:"bottom-right"},condition:{name:"scroll",options:{hiding_type:"opacity",transition:"0.3s",attribute:[],margin_top:Math.min(window.innerHeight,document.documentElement.clientHeight),margin_left:void 0,margin_right:void 0,margin_bottom:void 0}},widget_container:{id:void 0,class:void 0,style:{}},widget:{id:void 0,class:void 0,style:{}},links_container:{id:void 0,class:void 0,style:{}},links:{0:{href:"undefined",src:h.DEFAULT_ICONS.link,id:void 0,class:void 0,style:{}}}};static#t={widget_container:{position:"fixed",width:"60px",height:"60px",margin:"30px"},widget:{position:"absolute",display:"flex","flex-direction":"column",gap:"15px"},links_container:{display:"flex","justify-content":"center","align-items":"center",overflow:"hidden",width:"60px",height:"60px","border-radius":"50%",cursor:"pointer"},link:{width:"100%",height:"100%","object-fit":"cover"}};static#s(...e){function t(s,n){function r(o,l,a){if(typeof l[o]=="object")for(let f in l[o])a[o]||(a[o]={}),r(f,l[o],a[o]);else a[o]=l[o]}for(let o in s)r(o,s,n)}let i={};for(let s of e)t(s,i);return i}static#o(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i="";for(let s=0;s<e;s++)i+=t.charAt(Math.floor(Math.random()*t.length));return i}static#c={opacity:"0",visibility:"hidden",display:"none"};#h="st_"+h.#o(16);#n=this.#h+"_wc";#d=this.#h+"_w";#l=this.#h+"_ic";#p=this.#h+"_i";#i=document.createElement("style");#r=document.createElement("div");#f=document.createElement("div");#u(e,t,i){new RegExp(e+"{.*?"+t+":.*?;.*?}").test(this.#i.innerHTML)?this.#i.innerHTML=this.#i.innerHTML.replace(new RegExp("("+e+"{.*?"+t+":).*?(;.*?})"),"$1"+i+"$2"):new RegExp(e+"{.*?}").test(this.#i.innerHTML)?this.#i.innerHTML=this.#i.innerHTML.replace(new RegExp("("+e+"{.*?)(})"),"$1"+t+":"+i+";$2"):this.#i.innerHTML+=e+"{"+t+":"+i+";}"}#a(e,t){for(let i in t)this.#u(e,i,t[i])}constructor(e){function t(n,r,o=!1){return{show:function(){n.style.removeProperty(r)},hide:function(){n.style.setProperty(r,o?"unset":h.#c[r])}}}function i(n){switch(n){case"top-left":return{top:"0",left:"0"};case"top-right":return{top:"0",right:"0"};case"bottom-left":return{bottom:"0",left:"0"};case"bottom-right":default:return{bottom:"0",right:"0"}}}let s=h.#s(h.#e,e);if(this.#a("."+this.#n,h.#t.widget_container),this.#a("."+this.#d,h.#t.widget),this.#a("."+this.#l,h.#t.links_container),this.#a("."+this.#p,h.#t.link),this.#a("."+this.#n,i(s.settings.position)),this.#a("."+this.#d,i(s.settings.position)),this.#a("."+this.#l,s.links_container.style),this.#f.classList.add(this.#n),this.#a("."+this.#n,s.widget_container.style),s.widget_container.class&&this.#f.classList.add(s.widget_container.class),s.widget_container.id&&(this.#f.id=s.widget_container.id),this.#r.classList.add(this.#d),this.#a("."+this.#d,s.widget.style),s.widget.class&&this.#r.classList.add(s.widget.class),s.widget.id&&(this.#r.id=s.widget.id),s.condition){let n=function(l,a){function f(c){return c?typeof c=="object"?[c[0]??"st_active",c[1]??"",c[2]??""]:[c??"st_active","",""]:null}let u=f(a);return{set:function(){u&&(u[1]?l.setAttribute(u[0],u[1]):l.setAttribute(u[0],""))},remove:function(){u&&(u[1]?u[2]?l.setAttribute(u[0],u[2]):l.setAttribute(u[0],""):l.removeAttribute(u[0]))}}};if(!s.condition.options.hiding_type in h.#c)return;let r=t(this.#r,s.condition.options.hiding_type),o=n(this.#r,s.condition.options.attribute);switch(r.hide(),o.remove(),s.condition.name){case"hover":this.#f.addEventListener("mouseenter",function(){r.show(),o.set()}),this.#f.addEventListener("mouseleave",function(){r.hide(),o.remove()});break;case"scroll":default:let l=Math.min(window.innerHeight,document.documentElement.clientHeight),a=Math.min(window.innerWidth,document.documentElement.clientWidth),f=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),u=Math.max(document.body.scrollWidth,document.documentElement.scrollWidth,document.body.offsetWidth,document.documentElement.offsetWidth,document.body.clientWidth,document.documentElement.clientWidth),c=s.condition.options.margin_top,p=s.condition.options.margin_bottom,d=s.condition.options.margin_right,g=s.condition.options.margin_left;window.addEventListener("scroll",function(){let y=window.pageYOffset||window.scrollY||document.documentElement.scrollTop,_=y+l,m=window.pageXOffset||window.scrollX||document.documentElement.scrollLeft,v=m+a;y>c||_<f-p||v<u-d||m>g?(r.show(),o.set()):(r.hide(),o.remove())});break}s.condition.options.transition&&this.#r.style.setProperty("transition",s.condition.options.transition)}for(let n in s.links){let r=document.createElement("a");r.classList.add(this.#l),s.links_container.class&&r.classList.add(s.links_container.class),s.links[n].class&&r.classList.add(s.links[n].class),s.links[n].id&&(r.id=s.links[n].id,this.#a("#"+s.links[n].id,s.links[n].style)),r.setAttribute("href",s.links[n].href),r.setAttribute("target","_blank"),r.setAttribute("rel","nofollow noopener noreferrer"),new RegExp("^<svg.*?</svg>$").test(s.links[n].src)?r.innerHTML=s.links[n].src:r.innerHTML="<img src="+s.links[n].src+' alt="icon">',r.childNodes[0].classList.add(this.#p),this.#r.appendChild(r)}this.#i.setAttribute("widget",this.#h),document.head.appendChild(this.#i),this.#f.appendChild(this.#r),document.querySelector("body").appendChild(this.#f)}},X=I;var z=class{#e="_";#t=!0;#s=[];#o=[];#c(e,t){let i="",s=0,n=0;for(let r of t)for(;n+s<e.length;){let[o,l,a]=e[n+s];if(!l)i+=o,s++;else{new RegExp(`^${o}$`).test(r)&&(i+=r,n++);break}}if(this.#e&&this.#t)for(;n+s<e.length;)i+=e[n+s++][1]?e[n+s-1][2]:e[n+s-1][0];else n?n+s<e.length&&!e[n+s][1]&&(i+=e[n+s++][0]):i="";return[i,n,e.filter(r=>r[1]).length==n]}#h(e){return this.#s.map(t=>this.#c(t,e)).reduce((t,i,s)=>!t||i[1]>t[0][1]?[i,s]:t,null)}#n(e){return e.replace(/{(\d+)\*{([^}]*?)}(.*?)}/g,(t,i,s,n)=>`{{${s}}${n}}`.repeat(i)).split(/({{.*?}.*?})/).filter(Boolean).map(t=>{let[,i]=t.match(/^{{(.*?)}.*?}$/)||[],[,s]=t.match(/^{{.*?}=(.*?)}$/)||[];return[i||t,!!i,s||this.#e]})}#d(e=null){if(this.#l()){console.warn("\u041F\u043E\u043F\u044B\u0442\u043A\u0430 \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u043C\u0430\u0441\u043A\u0443 \u043F\u043E\u0441\u043B\u0435 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F \u043F\u0440\u0430\u0432\u0438\u043B",this);return}(e?[e]:this.#o).forEach(t=>{t.best_mask=this.#h(t.value),t.input.value=t.best_mask[0][0],Object.assign(t.input.dataset,{mask_id:t.best_mask[1],progress:t.best_mask[0][1],is_full:t.best_mask[0][2]})})}#l(){return!this.#s.some(e=>!e!=null)}add_mask(e){return this.#s.push(this.#n(e)),this.#d(),this.#s.length-1}remove_mask(e){delete this.#s[e],this.#d()}set_masks(e){this.#s=e.map(t=>this.#n(t)),this.#d()}constructor(e){let t=this;t.#e=e.default_filler??t.#e,t.#t=e.placeholder??t.#t,(e.inputs?e.inputs instanceof Element?[e.inputs]:Array.from(e.inputs):Array.from(document.querySelectorAll(e.selector))).forEach(s=>{let n={input:s,value:s.value.split().filter(Boolean)};s.addEventListener("input",r=>{if(r.preventDefault(),this.#l()){console.error("\u041D\u0435\u0442 \u043C\u0430\u0441\u043E\u043A \u0434\u043B\u044F \u044D\u0442\u043E\u0433\u043E \u043F\u043E\u043B\u044F.",this);return}if(r.data===null){let o=[];for(let l of n.value)if(o.push(l),this.#c(this.#s[n.best_mask[1]],o)[1]==n.best_mask[0][1]){o.pop();break}n.value=o}else n.value.push(...r.data);t.#d(n),typeof e.on_input=="function"&&e.on_input(s,{mask_id:n.best_mask[1],progress:n.best_mask[0][1],is_full:n.best_mask[0][2]})}),t.#o.push(n),s.closest("form")?.addEventListener("reset",()=>{n.value=[],t.#d(n)})}),e.masks&&t.set_masks(e.masks)}};var Y=z;var M=class h{modal;overlay;area;container;content;#e={};#t={};#s="hidden";static find=x;get state(){return this.#s}get params(){return this.#e}clone(e){let t=this.content.cloneNode(!0);return t.id=e.id??(t.id||"modal").replace(/#+$/,"")+(e.suffix??"_copy"),new h({...this.#e,...this.#t,content:t,...e,parent:this})}constructor(e){e={zIndex:1e3,duration:0,container:"body",overlay:!0,overlay_shading:.5,overlay_blur:"5px",overlay_scroll_lock:!0,content:"<div></div>",location:"center center",trigger:null,close_by_overlay:!0,close_by_esc:!0,auto_close:-1,allow_interrupt:!1,before_show:()=>{},on_show:()=>{},before_hide:()=>{},on_hide:()=>{},before_init:()=>{},on_init:()=>{},...e};let t,i,s;for(let[o,l]of Object.entries(e))typeof l=="function"?(this[o]=l.bind(this),this.#t[o]=l):this.#e[o]=l;this.before_init(this.#e),this.modal=document.createElement("modal"),w(this.modal,this),Object.assign(this.modal.style,{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",zIndex:this.#e.zIndex,transition:`all ${this.#e.duration}s`,pointerEvents:"none",display:"none",overflow:"hidden"}),this.modal.setAttribute("state","hidden");try{k(this.#e.container).append(this.modal)}catch{throw new Error("\u041D\u0435\u0443\u0434\u0430\u0447\u043D\u0430\u044F \u043F\u043E\u043F\u044B\u0442\u043A\u0430 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043C\u043E\u0434\u0430\u043B\u044C\u043D\u043E\u0435 \u043E\u043A\u043D\u043E \u0432 \u0443\u043A\u0430\u0437\u0430\u043D\u043D\u044B\u0439 \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440")}this.#e.overlay&&(this.overlay=document.createElement("modal-overlay"),w(this.overlay,this),Object.assign(this.overlay.style,{position:"absolute",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:`rgba(0, 0, 0, ${this.#e.overlay_shading})`,backdropFilter:`blur(${this.#e.overlay_blur})`,zIndex:++this.#e.zIndex,transition:"inherit"}),this.modal.append(this.overlay));let n=(this.#e.location||"").toLowerCase().split(/\s+/);this.area=document.createElement("modal-area"),w(this.area,this),Object.assign(this.area.style,{position:"absolute",top:"0",left:"0",right:"0",bottom:"0",overflowY:"auto",overflowX:"clip",display:"flex",alignItems:"flex-start",justifyContent:n.includes("left")?"flex-start":n.includes("right")?"flex-end":"center",zIndex:++this.#e.zIndex,pointerEvents:"all",transition:"inherit"}),this.modal.append(this.area),this.#e.close_by_overlay&&this.area.addEventListener("click",o=>{this.container.contains(o.target)||this.hide(o)}),this.container=document.createElement("modal-container"),w(this.container,this),Object.assign(this.container.style,{position:"relative",flexShrink:"0",width:"max-content",height:"max-content",maxWidth:"100vw",zIndex:++this.#e.zIndex,transition:"inherit",pointerEvents:"all",marginTop:n.includes("top")?"0":"auto",marginBottom:n.includes("bottom")?"0":"auto",marginLeft:n.includes("left")?"0":"auto",marginRight:n.includes("right")?"0":"auto"}),this.area.append(this.container);try{this.content=k(this.#e.content)??new DOMParser().parseFromString(this.#e.content,"text/html").body.firstElementChild}catch{throw new Error("\u041D\u0435\u0443\u0434\u0430\u0447\u043D\u0430\u044F \u043F\u043E\u043F\u044B\u0442\u043A\u0430 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043F\u0435\u0440\u0435\u0434\u0430\u043D\u043D\u044B\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442 \u0432 \u043C\u043E\u0434\u0430\u043B\u044C\u043D\u043E\u0435 \u043E\u043A\u043D\u043E")}this.container.append(this.content),w(this.content,this),this.content.style.transition="inherit",this.content.querySelectorAll('[action="close"]').forEach(o=>{o.addEventListener("click",()=>this.hide())});let r=o=>{o.before_func(o.data),clearTimeout(t),this.modal.style.display="flex",requestAnimationFrame(()=>{this.#s=o.process,this.modal.setAttribute("state",this.#s),requestAnimationFrame(()=>{t=setTimeout(()=>{this.#s=o.final,this.modal.setAttribute("state",this.#s),o.hide&&(this.modal.style.display="none"),o.after_func(o.data)},this.#e.duration*1e3)})})};this.show=(o=null)=>{(this.#s=="hidden"||this.#e.allow_interrupt&&this.#s=="hiding")&&(r({before_func:this.before_show,after_func:this.on_show,process:"showing",final:"shown",hide:!1,data:o}),this.#e.overlay_scroll_lock&&this.overlay&&(s=document.documentElement.style.scrollBehavior,i=document.body.style,i={position:i.position,top:i.top,left:i.left,width:i.width,scroll_Y:window.scrollY||document.documentElement.scrollTop,scroll_X:window.scrollX||document.documentElement.scrollLeft},document.documentElement.style.scrollBehavior="unset",Object.assign(document.body.style,{position:"fixed",width:"100vw",top:`-${i.scroll_Y}px`,left:`-${i.scroll_X}px`})),this.#e.auto_close>0&&(clearTimeout(t),t=setTimeout(()=>{this.hide()},this.#e.auto_close*1e3)))},this.hide=(o=null)=>{(this.#s=="shown"||this.#e.allow_interrupt&&this.#s=="showing")&&(r({before_func:this.before_hide,after_func:this.on_hide,process:"hiding",final:"hidden",hide:!0,data:o}),clearTimeout(t),t=setTimeout(()=>{i&&(Object.assign(document.body.style,i),window.scrollTo(i.scroll_X,i.scroll_Y)),s!=null&&(document.documentElement.style.scrollBehavior=s)},this.#e.duration*1e3))},this.#e.close_by_esc&&document.addEventListener("keydown",o=>{(o.code==="Escape"||o.keyCode===27)&&this.hide(o)}),this.#e.trigger&&document.querySelectorAll(this.#e.trigger).forEach(o=>{o.addEventListener("click",()=>this.show(o))}),this.on_init(this.#e)}};var H=class h{static#e=new Map;constructor(e={}){let t=Object.assign({selector:null,root:null,rootMargin:"0px",threshold:0,before_init:()=>{},on_init:()=>{}},e);if(!t.selector)throw new Error("st_observer: selector required");let i=typeof t.selector=="string"?t.selector:Symbol("selector");if(h.#e.has(i))return this._internal=h.#e.get(i),this;let s={key:i,selector:t.selector,options:{root:t.root,rootMargin:t.rootMargin,threshold:t.threshold},observer:null,callbacks:new WeakMap,elements:new Set,_connected:!1,crossRules:new Map};t.before_init();let n=()=>({on_show:new Set,once_show:new Set,while_show:new Set,on_hide:new Set,once_hide:new Set,while_hide:new Set,_once_shown:!1,_once_hidden:!1,_wasIntersecting:!1}),r=(d,...g)=>{try{d(...g)}catch(y){console.error(y)}},o=(d,g)=>!(d.right<=g.left||d.left>=g.right||d.bottom<=g.top||d.top>=g.bottom),l=d=>d?typeof d=="string"?Array.from(document.querySelectorAll(d)):d instanceof Element?[d]:NodeList.prototype.isPrototypeOf(d)||Array.isArray(d)?Array.from(d):[]:typeof s.selector=="string"?Array.from(document.querySelectorAll(s.selector)):s.selector instanceof Element?[s.selector]:NodeList.prototype.isPrototypeOf(s.selector)||Array.isArray(s.selector)?Array.from(s.selector):[],a=d=>({goals:new Set(d),on_cross:new Set,once_cross:new Set,while_cross:new Set,_once_done:new Set,_wasCrossing:new Map}),f=d=>{let g=s.crossRules.get(d);if(!g||!g.length||!document.contains(d))return;let y=d.getBoundingClientRect();for(let _ of g)for(let m of _.goals){if(!document.contains(m)){_._wasCrossing.set(m,!1);continue}let v=m.getBoundingClientRect(),b=o(y,v);b&&_.while_cross.forEach(A=>r(A,{target:d,goal:m},d,m)),!!!_._wasCrossing.get(m)&&b&&_.on_cross.forEach(A=>r(A,{target:d,goal:m},d,m)),b&&!_._once_done.has(m)&&(_.once_cross.forEach(A=>r(A,{target:d,goal:m},d,m)),_._once_done.add(m)),_._wasCrossing.set(m,!!b)}},u=()=>{for(let d of Array.from(s.crossRules.keys()))if(document.contains(d))try{f(d)}catch(g){console.error(g)}},c=()=>d=>{for(let g of d){let y=g.target,_=s.callbacks.get(y);_||(_=n(),s.callbacks.set(y,_)),g.isIntersecting?(_.while_show.forEach(m=>r(m,g,y)),_._wasIntersecting||_.on_show.forEach(m=>r(m,g,y)),_._once_shown||(_._once_shown=!0,_.once_show.forEach(m=>r(m,g,y))),_._wasIntersecting=!0):(_.while_hide.forEach(m=>r(m,g,y)),_._wasIntersecting&&_.on_hide.forEach(m=>r(m,g,y)),_._once_hidden||(_._once_hidden=!0,_.once_hide.forEach(m=>r(m,g,y))),_._wasIntersecting=!1)}u()};this._internal=s,this._createCbObj=n,this._resolveTargets=l,this._createCrossRule=a,this._checkCrossForTarget=f,this._runAllCrossChecks=u,this._makeIoCallback=c;let p=l();for(let d of p)s.elements.add(d),t.on_init(d),s.callbacks.get(d)||s.callbacks.set(d,n());h.#e.set(i,s),this.connect()}enableAutoCrossChecks(e={}){let t=Object.assign({strategy:"all",watchScrollAncestors:!0,watchResize:!0,rAFWhileAnimating:!1},e);if(this._autoChecks)return this._autoChecks.cfg=t,this;let i=this._internal,s=this,n=!1,r=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1,(t.strategy==="all"||t.strategy==="entryOnly")&&s._runAllCrossChecks()}))},o=c=>{let p=new Set,d=c.parentNode;for(;d&&d!==document;){if(d instanceof HTMLElement){let g=getComputedStyle(d),y=g.overflow+g.overflowX+g.overflowY;/(auto|scroll|overlay)/.test(y)&&p.add(d)}d=d.parentNode}return p.add(window),Array.from(p)},l=()=>r(),a=new Set;if(t.watchScrollAncestors)for(let c of Array.from(i.elements))o(c).forEach(d=>{a.has(d)||(d.addEventListener("scroll",l,{passive:!0}),a.add(d))});else window.addEventListener("scroll",l,{passive:!0}),a.add(window);t.watchResize&&window.addEventListener("resize",l,{passive:!0});let f=null,u=()=>{s._runAllCrossChecks(),f=requestAnimationFrame(u)};return this._autoChecks={cfg:t,scrollTargets:a,onScrollOrResize:l,rafId:f,startRaf:()=>{f||u()},stopRaf:()=>{f&&(cancelAnimationFrame(f),f=null)}},this}disableAutoCrossChecks(){if(!this._autoChecks)return this;let e=this._autoChecks;e.scrollTargets.forEach(t=>{try{t.removeEventListener("scroll",e.onScrollOrResize)}catch{}});try{window.removeEventListener("resize",e.onScrollOrResize)}catch{}return e.stopRaf(),this._autoChecks=null,this}_register(e,t,i){if(typeof t!="function")return this;let s=this._internal,n=this._resolveTargets(i);for(let r of n){let o=s.callbacks.get(r);if(o||(o=this._createCbObj(),s.callbacks.set(r,o)),o[e].add(t),!s.elements.has(r)&&(s.elements.add(r),s._connected&&s.observer))try{s.observer.observe(r)}catch{}}return this}on_show(e,t){return this._register("on_show",e,t)}while_show(e,t){return this._register("while_show",e,t)}once_show(e,t){return this._register("once_show",e,t)}on_hide(e,t){return this._register("on_hide",e,t)}while_hide(e,t){return this._register("while_hide",e,t)}once_hide(e,t){return this._register("once_hide",e,t)}observe(e){let t=this._resolveTargets(e);for(let i of t)if(this._internal.callbacks.get(i)||this._internal.callbacks.set(i,this._createCbObj()),this._internal.elements.add(i),this._internal._connected&&this._internal.observer)try{this._internal.observer.observe(i)}catch{}return this}unobserve(e){let t=this._resolveTargets(e);for(let i of t){try{this._internal.observer&&this._internal.observer.unobserve(i)}catch{}this._internal.callbacks.delete(i),this._internal.elements.delete(i)}return this}disconnect(){try{this._internal.observer&&this._internal.observer.disconnect()}catch{}return this._internal.observer=null,this._internal._connected=!1,this}connect(e={}){if(this._internal._connected)return this;if(e.root!==void 0&&(this._internal.options.root=e.root),e.rootMargin!==void 0&&(this._internal.options.rootMargin=e.rootMargin),e.threshold!==void 0&&(this._internal.options.threshold=e.threshold),this._internal.observer=new IntersectionObserver(this._makeIoCallback(),this._internal.options),e.resetFlags)for(let t of Array.from(this._internal.elements)){let i=this._internal.callbacks.get(t);i&&(i._once_shown=!1,i._once_hidden=!1,i._wasIntersecting=!1)}for(let t of Array.from(this._internal.elements))try{this._internal.observer.observe(t)}catch{}return this._internal._connected=!0,this}reconnect(e={}){return this.connect(e)}resetOnceFlags(e){let t=e?this._resolveTargets(e):Array.from(this._internal.elements);for(let i of t){let s=this._internal.callbacks.get(i);s&&(s._once_shown=!1,s._once_hidden=!1,s._wasIntersecting=!1)}return this}isConnected(){return!!this._internal._connected}getObservedElements(){return Array.from(this._internal.elements)}_registerCross(e,t,i,s){if(typeof t!="function")return this;let n=this._internal;s===void 0&&(typeof i=="string"||i instanceof Element||NodeList.prototype.isPrototypeOf(i)||Array.isArray(i))&&(s=i,i=void 0);let r=this._resolveTargets(i),o=this._resolveTargets(s);if(!o.length)return console.warn("st_observer: cross registration no goals"),this;for(let l of r){n.callbacks.get(l)||n.callbacks.set(l,this._createCbObj()),n.elements.add(l);let a=n.crossRules.get(l);a||(a=[],n.crossRules.set(l,a));let f=a.find(u=>{if(u.goals.size!==o.length)return!1;for(let c of o)if(!u.goals.has(c))return!1;return!0});f||(f=this._createCrossRule(o),a.push(f)),f[e].add(t);for(let u of o)n.elements.add(u)}return this._runAllCrossChecks(),this}on_cross(e,t,i){return this._registerCross("on_cross",e,t,i)}once_cross(e,t,i){return this._registerCross("once_cross",e,t,i)}while_cross(e,t,i){return this._registerCross("while_cross",e,t,i)}resetCrossOnceFlags(e,t){let i=this._internal,s=e?this._resolveTargets(e):Array.from(i.crossRules.keys()),n=t?this._resolveTargets(t):null;for(let r of s){let o=i.crossRules.get(r);if(o)for(let l of o)if(!n)l._once_done.clear();else for(let a of n)l._once_done.delete(a)}return this}},J=H;var N=class h{#e={};#t={};#s=new WeakMap;static find=x;get params(){return this.#e}get value(){return E(this.#e.target).map(e=>e.multiple?[...e.selectedOptions].map(t=>t.value):e.value)}clone(e){return new h({...this.#e,...this.#t,...e,parent:this})}constructor(e){e={target:"select",location:"bottom center",action:"click",duration:0,allow_interrupt:!1,close_on_select:!0,close_on_outside:!0,before_open:()=>{},on_open:()=>{},before_close:()=>{},on_close:()=>{},before_change:()=>{},on_change:()=>{},before_init:()=>{},on_init:()=>{},...e};for(let[t,i]of Object.entries(e))typeof i=="function"&&t!="target"?(this[t]=i.bind(this),this.#t[t]=i):this.#e[t]=i;this.before_init(this.#e);for(let t of E(this.#e.target))this.#c(t);this.on_init(this.#e)}#o(e){let t=(this.#e.location||"").toLowerCase().split(/\s+/);Object.assign(e.style,{position:"absolute",top:t.includes("top")?"auto":"100%",bottom:t.includes("top")?"100%":"auto",left:t.includes("right")?"auto":t.includes("center")?"50%":"0",right:t.includes("right")?"0":"auto",transform:t.includes("center")&&!t.includes("right")?"translateX(-50%)":"none"})}#c(e){let t=document.createElement("select-container");w(t,this),Object.assign(t.style,{position:"relative",display:"inline-block"});let i=document.createElement("select-trigger");w(i,this),Object.assign(i.style,{display:"block",cursor:"pointer"});let s=document.createElement("select-options");w(s,this),Object.assign(s.style,{transition:`all ${this.#e.duration}s`}),this.#o(s),Object.assign(e.style,{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)"}),e.parentNode.insertBefore(t,e),t.append(i,e,s),t.setAttribute("state","closed");for(let n of[...e.options]){let r=document.createElement("select-option");w(r,this),r.textContent=n.textContent,r.style.cursor="pointer",n.disabled&&r.setAttribute("disabled",""),r.toggleAttribute("selected",n.selected),r.addEventListener("click",()=>{n.disabled||this.#h(t,e,n,r)}),s.append(r)}this.#n(e,i),this.#e.action=="hover"?(t.addEventListener("mouseenter",()=>this.open(t)),t.addEventListener("mouseleave",()=>this.close(t))):i.addEventListener(this.#e.action,()=>this.toggle(t)),this.#e.close_on_outside&&document.addEventListener("click",n=>{t.contains(n.target)||this.close(t)})}#h(e,t,i,s){this.before_change(i,t)!==!1&&(t.multiple?(i.selected=!i.selected,s.toggleAttribute("selected",i.selected)):(t.value=i.value,[...e.querySelectorAll("select-option")].forEach(n=>n.toggleAttribute("selected",n===s))),t.dispatchEvent(new Event("change",{bubbles:!0})),this.#n(t,e.querySelector("select-trigger")),this.on_change(i,t),!t.multiple&&this.#e.close_on_select&&this.close(e))}#n(e,t){e.multiple?t.textContent=[...e.selectedOptions].map(i=>i.textContent).join(", "):t.textContent=(e.selectedOptions[0]??e.options[0])?.textContent??""}#d(e,t,i,s,n){s(e),clearTimeout(this.#s.get(e)),requestAnimationFrame(()=>{e.setAttribute("state",t),requestAnimationFrame(()=>{this.#s.set(e,setTimeout(()=>(e.setAttribute("state",i),n(e)),this.#e.duration*1e3))})})}#l(e,t){let i=e.getAttribute("state")??"closed",s=this.#e.allow_interrupt;(t?i=="closed"||s&&i=="closing":i=="open"||s&&i=="opening")&&this.#d(e,t?"opening":"closing",t?"open":"closed",t?this.before_open:this.before_close,t?this.on_open:this.on_close)}open(e){E(e).map(this.#p).forEach(t=>t&&this.#l(t,!0))}close(e){E(e).map(this.#p).forEach(t=>t&&this.#l(t,!1))}toggle(e){E(e).map(this.#p).forEach(t=>{t&&this.#l(t,!["open","opening"].includes(t.getAttribute("state")))})}#p=e=>e?.closest?.("select-container")??(e?.tagName?.toLowerCase()=="select"?e.parentElement:null)};var R=class h{#e={};#t={};#s=[];#o=[];#c=!1;params={};query={};#h="";#n="";clone(e){return new h({...this.#e,...this.#t,...e,parent:this})}constructor(e){e={point:"/",name:"",match_all:!0,strict_mode:!0,before_init:()=>{},on_init:()=>{},...e};for(let[t,i]of Object.entries(e))typeof i=="function"?(this[t]=i.bind(this),this.#t[t]=i):this.#e[t]=i;this.before_init(this.#e),this.#o.push({prefix:this.#e.point,middlewares:[]}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>this.#a()):queueMicrotask(()=>this.#a()),this.on_init(this.#e)}#d(){return this.#o[this.#o.length-1]}prefix(e){let t=this.#d();return this.#o.push({prefix:"/"+this.#l(t.prefix)+"/"+this.#l(e)+"/",middlewares:[...t.middlewares]}),this}group(e){e(),this.#o.length>1&&this.#o.pop()}middleware(e){let t=this.#d();return t.middlewares=t.middlewares.concat(Array.isArray(e)?e:[e]),this}get(e,t,i={}){return this.#p(e,t,i)}#l(e){return String(e).replace(/^\/+|\/+$/g,"")}#p(e,t,i={}){if(typeof t!="function")throw new Error("Route: \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u0437\u0430\u043C\u044B\u043A\u0430\u043D\u0438\u0435\u043C");typeof i=="string"&&(i={alias:i});let s=this.#d(),n=i.strict_mode??this.#e.strict_mode,r=n?("/"+this.#l(s.prefix)+"/"+this.#l(e)+"/").replace(/\/{2,}/g,"/"):(this.#l(s.prefix)+"/"+this.#l(e)).replace(/\/{2,}/g,"/");for(let a of this.#s)if(a.pattern===r)throw new Error(`Route: \u0434\u0443\u0431\u043B\u0438\u043A\u0430\u0442 \u043C\u0430\u0440\u0448\u0440\u0443\u0442\u0430: ${r}`);let{regex:o,names:l}=this.#i(r);return this.#s.push({pattern:r,uri:e,alias:i.alias??null,closure:t,middlewares:s.middlewares,names:l,regex:o,strict_mode:n}),this}#i(e){let t=[],i=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n="^"+e.replace(/\{(\w+)\}|\*|[^{*]+/g,(r,o)=>o!==void 0?(t.push(o),"([^/]+)"):r==="*"?(t.push("*"),"(.*)"):i(r)).replace(/\/+$/,"")+"/?$";return{regex:new RegExp(n),names:t}}#r(){return this.#e.name?"route:"+this.#e.name:"route"}#f(e){return"route:"+this.#e.name+":"+e}#u(e,t){document.dispatchEvent(new CustomEvent(e,{detail:t}))}#a(){if(!this.#c){this.#c=!0,this.#h=location.pathname,this.#n=location.href,this.query=Object.fromEntries(new URLSearchParams(location.search)),this.#u(this.#r(),{name:this.#e.name,path:this.#h,query:this.query,url:this.#n});for(let e of this.#s){let t=e.regex.exec(this.#h);if(!t)continue;let i=t.slice(1).map(h.#g);if(this.params={},e.names.forEach((n,r)=>{this.params[n]=i[r]}),e.middlewares.some(n=>!n.call(this,...i)))continue;e.closure.call(this,...i);let s={name:this.#e.name,pattern:e.pattern,uri:e.uri,alias:e.alias,params:this.params,values:i,query:this.query,path:this.#h,url:this.#n};if(e.alias&&this.#u(this.#f(e.alias),s),e.uri&&this.#u(this.#f(e.uri),s),!this.#e.match_all)break}}}get routes(){return this.#s}get path(){return this.#h}get url(){return this.#n}static#g(e){if(e==null)return e;try{return decodeURIComponent(e)}catch{return e}}};var j=class h{#e={};#t={};#s=new WeakMap;#o=new Map;#c=null;static find=x;get params(){return this.#e}clone(e){return new h({...this.#e,...this.#t,...e,parent:this})}constructor(e){e={duration:0,trigger:"[trigger]",target:null,allow_interrupt:!1,action:"click",anchor:!1,keep_history:!1,before_activate:()=>{},on_activate:()=>{},before_deactivate:()=>{},on_deactivate:()=>{},before_activated:()=>{},on_activated:()=>{},before_deactivated:()=>{},on_deactivated:()=>{},before_init:()=>{},on_init:()=>{},...e},e.keep_history&&(e.anchor=!0);for(let[i,s]of Object.entries(e))typeof s=="function"&&i!="target"?(this[i]=s.bind(this),this.#t[i]=s):this.#e[i]=s;this.before_init(this.#e);let t=i=>i.hasAttribute("state")||i.setAttribute("state","inactive");for(let i of E(this.#e.trigger)){w(i,this),t(i),this.#h(i).forEach(t);let s=this.#n(i);s&&this.#o.set(s,i),this.#e.action=="hover"?(i.addEventListener("mouseenter",()=>this.activate(i)),i.addEventListener("mouseleave",()=>this.deactivate(i))):i.addEventListener(this.#e.action,()=>this.toggle(i))}this.#e.anchor&&(this.#p(),this.#e.keep_history&&window.addEventListener("hashchange",()=>this.#p())),this.on_init(this.#e)}#h(e){let t=this.#e.target;return typeof t=="function"&&(t=t(e)),t??=e.getAttribute("target"),E(t)}#n(e){if(!this.#e.anchor)return null;if(e.id)return e.id;let t=this.#h(e);return t.length===1&&t[0].id?t[0].id:null}#d(e){let t="#"+e;location.hash!==t&&(this.#e.keep_history?history.pushState(null,"",t):history.replaceState(null,"",t))}#l(){if(!location.hash)return;let e=location.pathname+location.search;this.#e.keep_history?history.pushState(null,"",e):history.replaceState(null,"",e)}#p(){let e=this.#o.get(location.hash.slice(1));e?this.activate(e):this.#e.keep_history&&this.#c&&(this.deactivate(this.#c),this.#c=null)}#i(e,t,i,s,n){e.forEach(r=>(s(r),clearTimeout(this.#s.get(r)))),requestAnimationFrame(()=>{e.forEach(r=>r.setAttribute("state",t)),requestAnimationFrame(()=>{let r=setTimeout(()=>e.forEach(o=>(o.setAttribute("state",i),n(o))),this.#e.duration*1e3);e.forEach(o=>this.#s.set(o,r))})})}#r(e,t){let i=e.getAttribute("state")??"inactive",s=this.#e.allow_interrupt;if(!(t?i=="inactive"||s&&i=="deactivating":i=="active"||s&&i=="activating"))return;let n=t?"activate":"deactivate",r=t?"activating":"deactivating",o=t?"active":"inactive",l=this.#h(e),a=this.#n(e);a&&(t?(this.#d(a),this.#c=e):location.hash.slice(1)===a&&(this.#l(),this.#c=null)),this.#i([e],r,o,f=>this[`before_${n}`](f,l),f=>this[`on_${n}`](f,l)),this.#i(l,r,o,f=>this[`before_${n}d`](f,e),f=>this[`on_${n}d`](f,e))}toggle(e){E(e).forEach(t=>this.#r(t,!["active","activating"].includes(t.getAttribute("state"))))}activate(e){E(e).forEach(t=>this.#r(t,!0))}deactivate(e){E(e).forEach(t=>this.#r(t,!1))}};var F=class h{static#e=Symbol();static#t=new WeakMap;static#s=new WeakMap;static#o=new Set(["\u0432","\u0432\u043E","\u043D\u0430","\u043F\u043E","\u0441","\u0441\u043E","\u043A","\u043A\u043E","\u0443","\u043E","\u043E\u0431","\u043E\u0431\u043E","\u0437\u0430","\u0438\u0437","\u0438\u0437\u043E","\u0434\u043E","\u043E\u0442","\u043F\u0440\u0438","\u043F\u043E\u0434","\u043F\u043E\u0434\u043E","\u043D\u0430\u0434","\u043D\u0430\u0434\u043E","\u0431\u0435\u0437","\u0434\u043B\u044F","\u043F\u0440\u043E","\u0447\u0435\u0440\u0435\u0437","\u0441\u043A\u0432\u043E\u0437\u044C","\u043C\u0435\u0436\u0434\u0443","\u043C\u0435\u0436","\u043F\u0435\u0440\u0435\u0434","\u043F\u0435\u0440\u0435\u0434\u043E","\u043E\u043A\u043E\u043B\u043E","\u0441\u0440\u0435\u0434\u0438","\u043A\u0440\u043E\u043C\u0435","\u0432\u043E\u043A\u0440\u0443\u0433","\u0432\u0434\u043E\u043B\u044C","\u043F\u0440\u043E\u0442\u0438\u0432","\u0440\u0430\u0434\u0438","\u0432\u043C\u0435\u0441\u0442\u043E","\u0432\u043D\u0443\u0442\u0440\u0438","\u0441\u0432\u0435\u0440\u0445\u0443","\u0441\u043D\u0438\u0437\u0443","\u0432\u043E\u0437\u043B\u0435","\u043D\u0430\u043F\u0440\u043E\u0442\u0438\u0432","\u0431\u043B\u0430\u0433\u043E\u0434\u0430\u0440\u044F","\u0441\u043E\u0433\u043B\u0430\u0441\u043D\u043E","\u0432\u043E\u043F\u0440\u0435\u043A\u0438","\u0438","\u0430","\u043D\u043E","\u0434\u0430","\u0438\u043B\u0438","\u043B\u0438\u0431\u043E","\u0447\u0442\u043E","\u0447\u0442\u043E\u0431","\u0447\u0442\u043E\u0431\u044B","\u043A\u0430\u043A","\u0435\u0441\u043B\u0438","\u0438\u0431\u043E","\u0445\u043E\u0442\u044F","\u043F\u043E\u043A\u0430","\u043A\u043E\u0433\u0434\u0430","\u043A\u0443\u0434\u0430","\u043E\u0442\u043A\u0443\u0434\u0430","\u0437\u0430\u0447\u0435\u043C","\u043F\u043E\u0447\u0435\u043C\u0443","\u0436\u0435","\u043B\u0438","\u0431\u044B","\u0431","\u0432\u0435\u0434\u044C","\u043B\u0438\u0448\u044C","\u0443\u0436","\u0430\u0436","\u0442\u043E","\u043D\u0438","\u043D\u0435","\u043D\u0443","\u0432\u043E\u043D","\u0432\u043E\u0442"]);static#c=new Set(["SCRIPT","STYLE","NOSCRIPT","CODE","PRE","TEXTAREA","KBD","SAMP"]);static#h=(()=>{let e=[...this.#o].sort((t,i)=>i.length-t.length).map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|");return new RegExp(`(?<=^|[\\s(\xAB\u201E"'\\[])(${e})(\\s+)(?=\\S)`,"gi")})();static#n=/(\d) +(?=\S)/g;static#d=/ +(?=[—–] )/g;static preventWidows(e){let t=k(e);if(!t||t[h.#e])return;h.#i(t);let i=h.#r(t);for(let s of i)h.#t.set(s,s.nodeValue),s[h.#e]=!0,h.#p(s);h.#g(t)}static#l(e){return e.replace(h.#h,(t,i)=>i+"\xA0").replace(h.#n,"$1\xA0").replace(h.#d,"\xA0")}static#p(e){h.#t.has(e)||h.#t.set(e,e.nodeValue);let t=h.#l(h.#t.get(e));e.nodeValue!==t&&(e.nodeValue=t)}static#i(e){e[h.#e]=!0;let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),i;for(;i=t.nextNode();)i[h.#e]=!0}static#r(e){let t=[],i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:n=>{if(!n.nodeValue||!n.nodeValue.trim())return NodeFilter.FILTER_REJECT;for(let r=n.parentElement;r&&r!==e.parentElement;r=r.parentElement){if(h.#c.has(r.tagName))return NodeFilter.FILTER_REJECT;let o=r.getAttribute&&r.getAttribute("contenteditable");if(o===""||o==="true")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}),s;for(;s=i.nextNode();)t.push(s);return t}static#f(e){let t=h.#r(e);for(let i of t)i[h.#e]||(h.#t.set(i,i.nodeValue),i[h.#e]=!0),h.#p(i)}static#u(e,t){e.mutating=!0;try{t()}finally{e.mutation&&e.mutation.takeRecords(),e.mutating=!1}}static#a(e,t){let i=window.requestIdleCallback?window.requestIdleCallback.bind(window):s=>setTimeout(s,0);t.flush_scheduled||(t.flush_scheduled=!0,i(()=>{t.flush_scheduled=!1,h.#u(t,()=>{for(let s of t.queue)s.parentNode&&(h.#t.has(s)||h.#t.set(s,s.nodeValue),s[h.#e]=!0,h.#p(s));t.queue.clear()})}))}static#g(e){let t={mutation:null,intersection:null,resize:null,mutating:!1,visible:!1,pending_resize:!1,flush_scheduled:!1,queue:new Set};h.#s.set(e,t),t.mutation=new MutationObserver(i=>{if(!t.mutating){for(let s of i){if(s.type==="characterData"){s.target.parentNode&&s.target.nodeValue&&s.target.nodeValue.trim()&&t.queue.add(s.target);continue}if(s.type==="childList"){for(let n of s.addedNodes)if(n.nodeType===Node.TEXT_NODE)n.nodeValue&&n.nodeValue.trim()&&t.queue.add(n);else if(n.nodeType===Node.ELEMENT_NODE){h.#i(n);for(let r of h.#r(n))t.queue.add(r)}}}t.visible&&t.queue.size&&h.#a(e,t)}}),t.mutation.observe(e,{subtree:!0,childList:!0,characterData:!0}),t.intersection=new IntersectionObserver(i=>{for(let s of i)t.visible=s.isIntersecting,s.isIntersecting&&(t.queue.size&&h.#a(e,t),t.pending_resize&&(t.pending_resize=!1,h.#u(t,()=>h.#f(e))))},{rootMargin:"200px"}),t.intersection.observe(e),t.resize=new ResizeObserver(()=>{if(!t.mutating){if(!t.visible){t.pending_resize=!0;return}h.#u(t,()=>h.#f(e))}}),t.resize.observe(e)}};var q=class h{static find=x;static formatSize(e){let t=["\u0411","\u041A\u0411","\u041C\u0411","\u0413\u0411","\u0422\u0411"],i=0;for(;e>=1024&&i<t.length-1;)e/=1024,i++;return e.toFixed(1)+" "+t[i]}constructor(e){e={target:null,input_name:null,entry:"*[file-item]",delete_name:null,before_init:()=>{},on_init:()=>{},before_files_add:()=>{},on_files_add:()=>{},before_file_delete:()=>{},on_file_delete:()=>{},before_drop:()=>{},on_drop:()=>{},handle_exception:null,...e,limits:{files:0,file_size:0,total_size:0,mimes:[],...e.limits??{}}};let t=e.input_name.replace(/\[\]$/,"");e.input_name=t+(e.limits.files!=1?"[]":""),e.delete_name=(e.delete_name?e.delete_name.replace(/\[\]$/,""):t+"_to_delete")+(e.limits.files!=1?"[]":""),document.querySelectorAll(e.target).forEach(i=>{if(x(i))throw new Error("Already inited");w(i,this);for(let[c,p]of Object.entries(e))typeof p=="function"&&(i[c]=p.bind(i));i.before_init(e);let s=(c,p,d=null)=>e.handle_exception?i.handle_exception(Object.assign(new Error(p),{file:c,code:d})):(alert(p),!1),n=()=>Object.assign(document.createElement("input"),{type:"file",name:e.input_name,multiple:e.limits.files!=1,hidden:!0}),r=i.querySelector("*[files-list]"),o=null;i.files=new Map,i.total_size=0;let l=c=>{let p=new DOMParser().parseFromString(o,"text/html").body.firstElementChild;c._id=crypto.randomUUID(),i.files.set(c._id,c),i.total_size+=c.size;let d=p.querySelectorAll("img[preview]"),g=p.querySelectorAll("*[filename]"),y=p.querySelectorAll("*[fileweight]"),_=p.querySelectorAll("*[delete-button]");if(c.type.startsWith("image/")){let b=new FileReader;b.onload=L=>d.forEach(A=>A.src=L.target.result),b.readAsDataURL(c)}else d.forEach(b=>b.remove());g.forEach(b=>b.textContent=c.name),y.forEach(b=>{b.textContent=h.formatSize(c.size),b.setAttribute("size",c.size)}),_.forEach(b=>b.addEventListener("click",()=>{i.before_file_delete(c)!==!1&&(i.total_size=Math.max(0,i.total_size-parseInt(c.size)),i.files.delete(c._id),p.remove(),i.on_file_delete(c))}));let m=n(),v=new DataTransfer;return v.items.add(c),m.files=v.files,p.appendChild(m),p},a=c=>{let p=c.querySelector(`input[name^="${t}"]`)??c.querySelector("input[type='hidden'][value]")??c.querySelector("input[value]"),d=c.querySelectorAll("*[delete-button]");if(p){let g=c.querySelector("img[preview]"),y=c.querySelector("*[filename]"),_=c.querySelector("*[fileweight]"),m={_id:crypto.randomUUID(),preview:g?.src||"",value:p.value,name:y?.textContent||"",size:parseFloat(_?.getAttribute("size")??_?.textContent??0)||0};i.files.set(m._id,m),d.forEach(v=>v.addEventListener("click",()=>{if(i.before_file_delete(m)===!1)return;let b=Object.assign(document.createElement("input"),{type:"hidden",name:e.delete_name,hidden:!0,value:p.value});i.appendChild(b),i.files.delete(m._id),i.on_file_delete(m),c.remove()})),p.remove()}else c.remove();return c},f=c=>{if(e.limits.files>0&&i.files.size>=e.limits.files)return s(c,`\u041C\u0430\u043A\u0441\u0438\u043C\u0443\u043C \u0444\u0430\u0439\u043B\u043E\u0432: ${e.limits.files}`,0);if(e.limits.file_size>0&&c.size>e.limits.file_size)return s(c,`\u0424\u0430\u0439\u043B "${c.name}" \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0439! \u041C\u0430\u043A\u0441\u0438\u043C\u0443\u043C ${h.formatSize(e.limits.file_size)}.`,1);if(e.limits.total_size>0&&i.total_size+c.size>e.limits.total_size)return s(c,`\u041F\u0440\u0435\u0432\u044B\u0448\u0435\u043D \u043E\u0431\u0449\u0438\u0439 \u043B\u0438\u043C\u0438\u0442! \u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0441\u0443\u043C\u043C\u0430 \u0432\u0441\u0435\u0445 \u0444\u0430\u0439\u043B\u043E\u0432 ${h.formatSize(e.limits.total_size)}.`,2);if(e.limits.mimes.length>0){let p=c.type.trim(),d=p.split(";")[0].trim().toLowerCase();for(let g of e.limits.mimes){if(g.endsWith("/*")&&!/[\\^$.*+?()[\]{}|]/.test(g.slice(0,-2))){if(d.startsWith(g.slice(0,-1).toLowerCase()))return!0;continue}if(/[\\^$.*+?()[\]{}|]/.test(g)){try{let y=new RegExp(g,"i");if(y.test(p)||y.test(d))return!0}catch{}continue}if(d===g.toLowerCase())return!0}return s(c,`\u0424\u0430\u0439\u043B "${c.name}" \u0438\u043C\u0435\u0435\u0442 \u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0439 \u0442\u0438\u043F: ${d}.`,3)}return!0},u=c=>{let p=Array.from(c);if(i.before_files_add(p),p=p.filter(f),p.length>0){let d=document.createDocumentFragment();p.forEach(g=>{d.appendChild(l(g))}),r.appendChild(d)}i.on_files_add(p)};try{let c=i.querySelectorAll(e.entry);c.length>0&&c.forEach(p=>{let d=a(p);o||(o=d.outerHTML)})}catch{o=e.entry}o=o.trim(),i.querySelectorAll("*[drop-zone]").forEach(c=>{let p=!1;["dragenter","dragover"].forEach(d=>c.addEventListener(d,g=>{g.preventDefault(),c.setAttribute("dragover",""),p||(i.before_drop(),p=!0)})),["dragleave","drop"].forEach(d=>c.addEventListener(d,g=>{g.preventDefault(),c.removeAttribute("dragover"),p=!1})),c.addEventListener("drop",d=>{d.preventDefault(),i.on_drop(),u(d.dataTransfer.files)})}),i.querySelectorAll("*[add-button]").forEach(c=>c.addEventListener("click",()=>{let p=n();p.addEventListener("change",()=>{u(p.files)}),document.body.appendChild(p),p.click()})),i.on_init(e)})}};var P=class{#e=null;#t=null;constructor(e){this.#e=function(t){(!e.validator||e.validator(t))&&(()=>{if(e.regexp){let i=new RegExp(e.regexp);return!e.attribute&&!e.property?i.test(t.value):e.attribute&&e.property?t.hasAttribute(e.attribute)&&i.test(t[e.property]):(e.attribute?i.test(t.getAttribute(e.attribute)):!0)&&(e.property?i.test(t[e.property]):!0)}else return e.attribute?t.hasAttribute(e.attribute):!0})()?e.on_valid(t):e.on_invalid(t),e.after_check&&e.after_check(t)},this.#t=e.selector,typeof e.onload=="function"?e.onload(this.#t):e.onload===!0&&this.apply(),document.querySelectorAll(this.#t).forEach(t=>{(e.events??["input","blur"]).forEach(i=>{t.addEventListener(i,()=>{this.#e(t)})})})}apply(e){document.querySelectorAll(e??this.#t).forEach(this.#e,this)}},K=P;export{T as App,O as Cookie,C as Core,S as Loader,M as Modal,R as Route,N as Select,j as Toggle,q as Uploader,U as st_button_widget,X as st_links_widget,Y as st_mask,J as st_observer,F as st_typograf,K as st_validator};
package/dist/index.min.js DELETED
@@ -1,2 +0,0 @@
1
- var index=(()=>{var $=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var ee=Object.prototype.hasOwnProperty;var te=(c,e)=>{for(var t in e)$(c,t,{get:e[t],enumerable:!0})},ie=(c,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Q(e))!ee.call(c,s)&&s!==t&&$(c,s,{get:()=>e[s],enumerable:!(i=Z(e,s))||i.enumerable});return c};var se=c=>ie($({},"__esModule",{value:!0}),c);var ne={};te(ne,{App:()=>T,Cookie:()=>O,Core:()=>C,Loader:()=>S,Modal:()=>M,Route:()=>R,Select:()=>N,Toggle:()=>j,Uploader:()=>q,st_button_widget:()=>B,st_links_widget:()=>U,st_mask:()=>X,st_observer:()=>Y,st_typograf:()=>F,st_validator:()=>J});var V=Symbol(),k=c=>{try{return c instanceof Element?c:document.querySelector(c)}catch{return}},E=c=>{if(c==null)return[];if(c instanceof Element)return[c];if(c instanceof NodeList||c instanceof HTMLCollection)return[...c];if(Array.isArray(c))return c.flatMap(E);try{return[...document.querySelectorAll(c)]}catch{return[]}},x=c=>k(c)?.[V],w=(c,e)=>(c&&(c[V]=e),c);var C=class{static merge(...e){let t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s)&&(Object.getPrototypeOf(s)??Object.prototype)===Object.prototype,i=(s,n)=>{if(typeof s=="function"&&typeof n=="function")return(...o)=>i(s(...o),n(...o));if(!(Array.isArray(s)&&Array.isArray(n)||t(s)&&t(n)))return n;let r=Array.isArray(s)?s.slice():{...s};for(let[o,l]of Object.entries(n))r[o]=o in r?i(r[o],l):l;return r};return e.reduce(i,{})}static generate_unique_prefix(e){return e={characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",length:16,...e},[...Array(e.length)].map(t=>e.characters[Math.random()*e.characters.length|0]).join("")}static fetch(e){e instanceof HTMLFormElement&&(e={url:e.getAttribute("action")||"",method:e.getAttribute("method")||"",data:new FormData(e)}),e={url:"",method:"",data:null,headers:{},timeout:0,response_type:"",...e};let t={beforeSend:[e.before_send],onSend:[e.on_send],onSuccess:[e.on_success],onComplete:[e.on_complete],onFailed:[e.on_failed]},i,s,n,r=!1,o=new Promise((u,h)=>(s=u,n=h)),l=(u,h)=>{for(let p of t[u])if(p)try{p(h)}catch(d){console.error(`st_ajax: ${u} error`,d)}},a={then:(u,h)=>o.then(u,h),catch:u=>o.catch(u),finally:u=>o.finally(u),abort:()=>i?.abort()};for(let u of Object.keys(t))a[u]=h=>(t[u].push(h),a);let f=u=>{if(r)return;r=!0;let h=u instanceof XMLHttpRequest?{status:u.status,status_text:u.statusText,response:u.responseText,request:u}:{status:void 0,status_text:"",response:u};l("onFailed",h),n(h)};return queueMicrotask(()=>{try{let u=e.url,h=e.method,p;if(l("beforeSend",e),e.data instanceof FormData?p=e.data:e.data instanceof HTMLFormElement?(u=u||e.data.getAttribute("action"),h=h||e.data.getAttribute("method"),p=new FormData(e.data)):p=e.data,u=u||window.location.href,h=h?h.toUpperCase():"GET",p&&typeof p=="object")if(h=="GET"){let d=p instanceof FormData?new URLSearchParams(p).toString():Object.entries(p).map(([g,y])=>`${encodeURIComponent(g)}=${encodeURIComponent(y)}`).join("&");d&&(u+=(/\?.+=/.test(u)?"&":"?")+d),p=null}else p instanceof FormData||(p=JSON.stringify(e.data),Object.keys(e.headers).some(d=>d.toLowerCase()=="content-type")||(e.headers["Content-Type"]="application/json"));if(i=new XMLHttpRequest,e.response_type)try{i.responseType=e.response_type}catch{}e.timeout>0&&Number.isFinite(e.timeout)&&(i.timeout=e.timeout),i.onerror=i.ontimeout=()=>f(i),i.onreadystatechange=()=>{if(i.readyState!==4)return;let d;if(i.status>=200&&i.status<300){if(i.responseType)d=i.response;else{let g=i.getResponseHeader("Content-Type")||e.response_type||"";if(g.includes("/json"))try{d=JSON.parse(i.responseText)}catch{d=i.responseText}else g.includes("/xml")?d=new DOMParser().parseFromString(i.responseText,"application/xml"):g.includes("/html")?d=new DOMParser().parseFromString(i.responseText,"text/html"):d=i.responseText}l("onSuccess",{data:d,request:i}),r=!0,s({data:d,request:i})}else f(i);l("onComplete",{data:d,request:i})},i.open(h,u,!0);for(let d in e.headers)if(Object.prototype.hasOwnProperty.call(e.headers,d))try{i.setRequestHeader(d,e.headers[d])}catch{}i.send(p),l("onSend",{detail:e})}catch(u){f(u)}}),a}};var S=class c{#e={};#t=null;static find=x;static HOOKS=["before_load","on_load","before_paste","on_paste","on_failed","on_complete","before_init","on_init"];static html(e,...t){let i=Array.isArray(e)?e.reduce((s,n,r)=>s+t[r-1]+n):e;return new DOMParser().parseFromString(i,"text/html").body.firstElementChild}get params(){let e={};for(let[t,i]of Object.entries(this.#e))typeof i!="function"&&t!="formats"&&(e[t]=i);return e}get loading(){return!!this.#t}html=c.html;clone(e={}){return new c({...this.#e,...e,formats:{...this.#e.formats,...e.formats},parent:this})}constructor(e){this.#e={target:null,source:null,mode:"append",multiple:!0,allow_interrupt:!1,formats:{},render(t){return t},before_load:()=>{},on_load:()=>{},before_paste:()=>{},on_paste:()=>{},on_failed:()=>{},on_complete:()=>{},before_init:()=>{},on_init:()=>{},...e},this.#e.before_init.call(this,this.#e),this.target=k(this.#e.target),this.target&&w(this.target,this),this.#e.on_init.call(this,this.#e)}#s(e){return e instanceof Document?"html":typeof e=="string"?"text":"json"}#o(e){let t=this.#e,i=t.formats?.[e]??{},s={};for(let n of new Set([...Object.keys(t),...Object.keys(i)])){if(n=="formats")continue;let r=t[n],o=i[n],l;n in i&&n in t&&c.HOOKS.includes(n)&&typeof r=="function"&&typeof o=="function"?l=n=="on_load"?(a,f,u)=>{let h=r.call(this,a,f,u)??f;return o.call(this,a,h,u)??h}:(...a)=>{r.apply(this,a),o.apply(this,a)}:l=n in i?o:r,s[n]=typeof l=="function"?l.bind(this):l}return s}#c(e,t,i){if(i=="html"){let s=e.body??e.documentElement??e;return t.source?t.multiple?[...s.querySelectorAll(t.source)]:s.querySelector(t.source):t.multiple?[...s.children]:s.firstElementChild}return i=="json"&&t.source?t.source.split(".").reduce((s,n)=>s?.[n],e):e}load(e={}){let{mode:t,...i}=typeof e=="string"?{url:e}:e;if(this.#t){if(!this.#e.allow_interrupt)return this;this.#t.abort()}this.target?.setAttribute("state","loading"),this.#e.before_load.call(this,i);let s=C.fetch(i).onSuccess(({data:n,request:r})=>{let o=this.#s(n),l=this.#o(o),a=this.#c(n,l,o);a=l.on_load(n,a,r)??a;let f=[],u=l.multiple?a?.length??0:1;for(let d=0;d<u;d++){let g=l.multiple?a?.[d]:a,y=l.render(g,d);y instanceof Node&&f.push(y)}l.before_paste(f);let h=document.createDocumentFragment();f.forEach(d=>h.append(d));let p=t??l.mode;this.target&&(p=="replace"?this.target.replaceChildren(h):p=="prepend"?this.target.prepend(h):this.target.append(h)),l.on_paste(f,n)}).onFailed(n=>this.#e.on_failed.call(this,n)).onComplete(n=>this.#e.on_complete.call(this,n));return s.finally(()=>{this.#t===s&&(this.#t=null,this.target?.setAttribute("state","loaded"))}),this.#t=s,this}abort(){return this.#t?.abort(),this}};var T=class c extends HTMLElement{static#e=new Set(["disabled","checked","readonly","required","selected","hidden","open","autofocus"]);static#t=new Map;static#s=new Set;static create(e){let{app:t,setup:i=()=>{},template:s="",events:n={}}=e;if(c.#t.has(t))throw new Error(`Application "${t}" already exists!`);c.#t.set(t,{setup:i,template:s,events:n,config:e}),c.#s.forEach(r=>{r.#o!==!0&&r.#R()})}static extend(e,t={}){let i=c.#t.get(e);if(!i)throw new Error(`Application "${e}" not found!`);let s=i.config,n={...s,...t};return(s.events||t.events)&&(n.events={...s.events,...t.events}),c.create(n)}#o=!1;#c="";#h=!1;#n=new Map;#d=null;#l=new Set;#p=!1;#i=[];#r=null;#f=new Map;#u=null;#a=[];#g=new Set;#k=!1;#m=new Map;#T=0;constructor(){super(),c.#s.add(this)}#v(e){!e||!e.length||e.forEach(t=>{if(t.type==="event"&&t.element&&t.handler)t.element.removeEventListener(t.eventName,t.handler);else if(t.type==="model"&&t.element&&t.handler){let i=t.element.tagName==="SELECT"?"change":"input";t.element.removeEventListener(i,t.handler)}else t.type==="attrSync"&&t.unwatch&&t.unwatch();t.effect&&(this.#n.forEach((i,s)=>{i.delete(t.effect),i.size===0&&this.#n.delete(s)}),this.#l.delete(t.effect))})}get template(){return this.#c}get attrs(){return{get:e=>this.getAttribute(e),set:(e,t)=>this.setAttribute(e,t),remove:e=>this.removeAttribute(e),has:e=>this.hasAttribute(e),toggle:(e,t)=>this.toggleAttribute(e,t),keys:()=>Array.from(this.attributes).map(e=>e.name),entries:()=>Array.from(this.attributes).map(e=>[e.name,e.value])}}addEventListener(e,t,i){if((e==="setup"||e==="rendered")&&this.#h){queueMicrotask(()=>t(new CustomEvent(e)));return}super.addEventListener(e,t,i)}dispatchEvent(e,t=null,i={}){if(typeof e=="string"){let s=new CustomEvent(e,{cancelable:!0,...i,detail:t});return super.dispatchEvent(s)}return super.dispatchEvent(e)}applyTemplate(e=""){let t=e||this.#c;if(this.#v(this.#i),this.#i=[],this.innerHTML="",t){let s=document.createElement("template");s.innerHTML=t.trim();let n=s.content.cloneNode(!0);Array.from(n.childNodes).forEach(r=>this.#x(r)),this.#j(n)}let i=++this.#T;new Promise(s=>{let n=null,r,o=()=>{clearTimeout(n),n=setTimeout(()=>{r.disconnect(),this.#L(Array.from(this.children)).then(s)},0)};r=new MutationObserver(l=>{l.some(a=>a.type==="childList")&&o()}),r.observe(this,{childList:!0}),o()}).then(()=>{i===this.#T&&(this.#h=!0,this.dispatchEvent("rendered"))})}#j(e){HTMLElement.prototype.appendChild.call(this,e)}clone(e={}){let t=this.attrs.get("app");return c.extend(t,e)}watch(e,t,i={}){if(typeof t!="function")return()=>{};let{deep:s=!1,immediate:n=!1}=i;if(typeof e=="string"&&e.endsWith("()")){let r=e.slice(0,-2),o=this[r];if(typeof o!="function")return()=>{};let l=this.#m.get(r);if(!l){l={original:o,handlers:[]},this.#m.set(r,l);let f=(...u)=>{let h=o.apply(this,u),p=d=>{for(let g of[...l.handlers])g.callback(u,d,g.unwatch)};return h instanceof Promise?h.then(d=>(p(d),d)):(p(h),h)};this[r]=f}let a=()=>{let f=l.handlers.findIndex(u=>u.unwatch===a);f!==-1&&l.handlers.splice(f,1),l.handlers.length===0&&(this[r]=l.original,this.#m.delete(r))};return l.handlers.push({callback:t,unwatch:a}),a}if(typeof e=="string"){let r=e,o=()=>{let a=this.#a.findIndex(f=>f.unwatch===o);a!==-1&&this.#a.splice(a,1)},l={type:"key",key:r,callback:t,deep:s,immediate:n,lastValue:void 0,unwatch:o};if(this.#a.push(l),n){let a=this.#O(r);l.lastValue=s&&a!==null&&typeof a=="object"?JSON.parse(JSON.stringify(a)):a,t(a,void 0,o)}return o}if(typeof e=="function"){let r=e,o,l={type:"getter",getter:r,callback:t,deep:s,lastValue:o,effect:null,unwatch:null};this.#a.push(l);let a=()=>{let h=this.#a.indexOf(l);h!==-1&&this.#a.splice(h,1),l.effect&&(this.#n.forEach((p,d)=>{p.delete(l.effect),p.size===0&&this.#n.delete(d)}),this.#l.delete(l.effect))};l.unwatch=a;let f=()=>{let h=r.call(this);if(s?!this.#C(h,o):h!==o){let d=o;o=s&&h!==null&&typeof h=="object"?JSON.parse(JSON.stringify(h)):h,t(h,d,l.unwatch)}},u=this.#_(f);return l.effect=u,a}return()=>{}}unwatch(){[...this.#a].forEach(e=>e.unwatch()),this.#m.forEach(e=>{[...e.handlers].forEach(t=>t.unwatch())})}hasWatchers(){let e=0;return this.#m.forEach(t=>{e+=t.handlers.length}),this.#a.length+e}watched(e,t,i={}){if(typeof e=="string"&&e.endsWith("()")){let s=e.slice(0,-2),n=this.#m.get(s);n&&[...n.handlers].forEach(r=>r.unwatch())}else typeof e=="string"?this.#a.filter(s=>s.type==="key"&&s.key===e).forEach(s=>s.unwatch()):typeof e=="function"&&this.#a.filter(s=>s.type==="getter"&&s.getter===e).forEach(s=>s.unwatch());return this.watch(e,t,i)}#E(e){this.#d&&(this.#n.has(e)||this.#n.set(e,new Set),this.#n.get(e).add(this.#d))}#y(e){this.#g.add(e);let t=this.#n.get(e);if(t&&t.forEach(s=>this.#l.add(s)),this.#p){this.#k=!0;return}this.#p=!0;let i=()=>{this.#l.forEach(r=>{try{r()}catch(o){console.error("Effect execution error:",o)}}),this.#l.clear();let s=Array.from(this.#g),n=new Set;for(let r of s)for(let o of this.#a){if(o.type!=="key")continue;(o.key===r||o.deep&&(r===o.key||r.startsWith(o.key+".")))&&n.add(o)}for(let r of n){if(r.type!=="key")continue;let o=this.#O(r.key);if(!(r.deep?!this.#C(o,r.lastValue):o!==r.lastValue))continue;let a=r.lastValue;r.lastValue=r.deep&&o!==null&&typeof o=="object"?JSON.parse(JSON.stringify(o)):o,r.callback(o,a,r.unwatch)}this.#g.clear(),this.#p=!1,this.#k&&(this.#k=!1,this.#p=!0,Promise.resolve().then(i))};Promise.resolve().then(i)}#O(e){return e.split(".").reduce((t,i)=>t?.[i],this)}#C(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;let i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(let n of i)if(!s.includes(n)||!this.#C(e[n],t[n]))return!1;return!0}#w(e,t=[]){if(e===null||typeof e!="object"||e.__isReactive)return e;let i=this;return new Proxy(e,{get(n,r,o){if(r==="__isReactive")return!0;let l=typeof r=="symbol"?"<symbol>":r,a=[...t,l].join(".");i.#E(a);let f=Reflect.get(n,r,o);return f!==null&&typeof f=="object"&&!f.__isReactive?i.#w(f,[...t,l]):f},set(n,r,o,l){if(n[r]===o)return!0;let f=Reflect.set(n,r,o,l),u=typeof r=="symbol"?"<symbol>":r,h=[...t,u].join(".");if(i.#y(h),Array.isArray(n)&&(r==="length"||!isNaN(r))){let p=t.join(".");p&&i.#y(p)}return f},deleteProperty(n,r){let o=Reflect.deleteProperty(n,r),l=typeof r=="symbol"?"<symbol>":r,a=[...t,l].join(".");return i.#y(a),o}})}#M(e,t){let i=this;return new Proxy(e,{apply(s,n,r){let o=Reflect.apply(s,i,r);return o instanceof Promise?o.then(l=>(i.#y(t),l)):(i.#y(t),o)}})}#_(e){let t=this.#r?{...this.#r}:null,i=()=>{let s=null;if(t){s={};for(let n of Object.keys(t))s[n]=this[n],this[n]=t[n]}this.#d=i;try{e()}finally{if(this.#d=null,s)for(let n of Object.keys(s))s[n]!==void 0?this[n]=s[n]:delete this[n]}};return i(),i}#b(e){try{return new Function("$event",`with(this) { return (${e}); }`).call(this)}catch(t){console.warn("Expression evaluation error:",e,t);return}}#N(e,t=null){try{return new Function("$event",`with(this) { ${e} }`).call(this,t)}catch(i){console.error("Statement execution error:",e,i)}}#F(e){let t=e.nodeValue,i=[],s=[],n=0,r=/\{\{(.+?)\}\}/g,o;for(;(o=r.exec(t))!==null;){o.index>n&&i.push(t.substring(n,o.index));let a=o[1].trim();i.push(null),s.push({index:i.length-1,expr:a}),n=r.lastIndex}n<t.length&&i.push(t.substring(n));let l=this.#_(()=>{s.forEach(({index:a,expr:f})=>{let u=this.#b(f);i[a]=u==null?"":String(u)}),e.nodeValue=i.join("")});this.#i.push({type:"text",node:e,effect:l})}#q(e,t){let i=t.name.slice(1),s=t.value,n=this.#r?{...this.#r}:null,r=o=>{if(n){let l={};for(let a of Object.keys(n))l[a]=this[a],this[a]=n[a];this.#N(s,o);for(let a of Object.keys(l))l[a]!==void 0?this[a]=l[a]:delete this[a]}else this.#N(s,o)};e.addEventListener(i,r),this.#i.push({type:"event",element:e,eventName:i,handler:r})}#$(e,t){let i=t.value,s=this.#_(()=>{this.#b(i)?e.style.display="":e.style.display="none"});this.#i.push({type:"show",element:e,effect:s})}#I(e,t){let i=t.value,s=this.#_(()=>{let l=this.#b(i);e.tagName==="INPUT"&&e.type==="checkbox"?e.checked=!!l:e.tagName==="INPUT"&&e.type==="radio"?e.checked=e.value===l:e.tagName==="SELECT"?e.value=l:e.value=l??""}),n=this.#r?{...this.#r}:null,r=e.tagName==="SELECT"?"change":"input",o=l=>{let a;if(e.type==="checkbox"?a=e.checked:e.type==="number"||e.type==="range"?a=e.valueAsNumber:a=e.value,n){let f={};for(let u of Object.keys(n))f[u]=this[u],this[u]=n[u];try{new Function("value",`with(this) { ${i} = value; }`).call(this,a)}catch(u){console.error("Model binding error:",i,u)}for(let u of Object.keys(f))f[u]!==void 0?this[u]=f[u]:delete this[u]}else try{new Function("value",`with(this) { ${i} = value; }`).call(this,a)}catch(f){console.error("Model binding error:",i,f)}};e.addEventListener(r,o),this.#i.push({type:"model",element:e,effect:s,handler:o})}#z(e,t){let i=t.value,s=document.createComment(`if: ${i}`);e.parentNode.insertBefore(s,e);let n=[{expr:i,element:e,bindings:[],processed:!1}],r=e.nextElementSibling;for(;r;)if(r.hasAttribute("#else-if")){let a=r.getAttribute("#else-if");n.push({expr:a,element:r,bindings:[],processed:!1}),r.removeAttribute("#else-if");let f=r.nextElementSibling;r.remove(),r=f}else if(r.hasAttribute("#else")){n.push({expr:"true",element:r,bindings:[],processed:!1}),r.removeAttribute("#else"),r.remove();break}else break;e.removeAttribute(t.name),e.remove();let o=null,l=this.#_(()=>{let a=null;for(let f of n)if(this.#b(f.expr)){a=f;break}if(o!==a){if(o&&(o.element&&o.element.parentNode&&o.element.remove(),this.#v(o.bindings),o.bindings=[]),a&&(s.parentNode.insertBefore(a.element,s.nextSibling),!a.processed)){let f=this.#i.length;this.#x(a.element),a.bindings=this.#i.slice(f),a.processed=!0}o=a}});this.#i.push({type:"conditional",placeholder:s,chain:n,effect:l})}#H(e,t){let i=t.value,s=i.match(/^\s*(\w+)\s+in\s+(.+)$/);if(!s){console.error("Invalid for syntax:",i);return}let n=s[1],r=s[2],o=e.parentNode,l=e.nextSibling;e.removeAttribute(t.name);let a=e.cloneNode(!0);e.remove();let f=[],u=this.#_(()=>{let h=this.#b(r);f.forEach(g=>{g.node&&g.node.parentNode&&g.node.remove(),this.#v(g.bindings)}),f=[];let p;if(Array.isArray(h))p=h.map((g,y)=>({value:g,key:void 0,index:y}));else if(h!==null&&typeof h=="object")p=Object.entries(h).map(([g,y],_)=>({value:y,key:g,index:_}));else return;if(p.length===0)return;let d=document.createDocumentFragment();p.forEach(({value:g,key:y,index:_})=>{let m=a.cloneNode(!0),v=this[n],b=this.$index,L=this.$key;this[n]=g,this.$index=_,y!==void 0&&(this.$key=y);let A=this.#r,W={...A,[n]:g,$index:_};y!==void 0&&(W.$key=y),this.#r=W;let K=this.#i.length;this.#x(m);let G=this.#i.slice(K);this.#r=A,v!==void 0?this[n]=v:delete this[n],b!==void 0?this.$index=b:delete this.$index,L!==void 0?this.$key=L:delete this.$key,d.appendChild(m),f.push({node:m,bindings:G})}),o.insertBefore(d,l)});this.#i.push({type:"loop",parent:o,nextSibling:l,template:a,effect:u})}#P(e,t){let i=t.name,s=t.value,n=[],r=[],o=0,l=/\{\{(.+?)\}\}/g,a;for(;(a=l.exec(s))!==null;){a.index>o&&n.push(s.substring(o,a.index));let u=a[1].trim();n.push(null),r.push({index:n.length-1,expr:u}),o=l.lastIndex}o<s.length&&n.push(s.substring(o));let f=this.#_(()=>{r.forEach(({index:h,expr:p})=>{let d=this.#b(p);n[h]=d==null?"":String(d)});let u=n.join("");c.#e.has(i)?u===""||u==="false"||u==="0"||u==="null"||u==="undefined"||!u?e.removeAttribute(i):e.setAttribute(i,""):e.setAttribute(i,u)});this.#i.push({type:"attribute",element:e,attrName:i,effect:f})}#D(e){let t=Array.from(e.attributes);for(let i of t){if(i.name==="#if")return this.#z(e,i),e.removeAttribute(i.name),!0;if(i.name==="#for")return this.#H(e,i),e.removeAttribute(i.name),!0;if(i.name==="#show")this.#$(e,i),e.removeAttribute(i.name);else if(i.name==="#model")this.#I(e,i),e.removeAttribute(i.name);else if(i.name==="#once")e.removeAttribute(i.name);else{if(i.name==="#pre")return e.removeAttribute(i.name),!0;i.name.startsWith("@")?(this.#q(e,i),e.removeAttribute(i.name)):/\{\{.+?\}\}/.test(i.value)&&this.#P(e,i)}}return!1}#x(e){if(e.nodeType===Node.ELEMENT_NODE){let t=this.#D(e);if(e.localName==="st-app")return;!t&&(e.parentNode||e.childNodes.length>0)&&Array.from(e.childNodes).forEach(i=>this.#x(i))}else e.nodeType===Node.TEXT_NODE&&/\{\{.+?\}\}/.test(e.nodeValue)&&this.#F(e)}#R(){let e=this.attrs.get("app"),t=c.#t.get(e);if(t){this.addEventListener("setup",t.setup),Object.entries(t.events).forEach(([r,o])=>this.addEventListener(r,o)),this.#c=t.template;let i=t.config,s=Object.getOwnPropertyDescriptors(i),n=new Set(["app","setup","template","events"]);Object.entries(s).forEach(([r,o])=>{if(!n.has(r)){if(o.get){let l=o.get;this.#f.set(r,l),Object.defineProperty(this,r,{get(){return this.#E(r),l.call(this)},enumerable:o.enumerable,configurable:!0})}else if(o.value!==void 0){let l=o.value,a=l;typeof l=="object"&&l!==null?a=this.#w(l,[r]):typeof l=="function"&&(a=this.#M(l,r)),Object.defineProperty(this,r,{get(){return this.#E(r),a},set(f){a!==f&&(typeof f=="object"&&f!==null?a=this.#w(f,[r]):a=f,this.#y(r))},enumerable:!0,configurable:!0})}}}),typeof this.#o=="function"&&this.#o(),this.#o=!0}else this.attrs.get("app")||(typeof this.#o=="function"&&this.#o(),this.#o=!0)}async#L(e){await Promise.all(e.map(t=>new Promise(i=>{let s=null,n=()=>{clearTimeout(s),s=setTimeout(()=>{r.disconnect(),this.#L(Array.from(t.children)).then(i)},0)},r=new MutationObserver(o=>{o.some(l=>l.type==="childList")&&n()});r.observe(t,{childList:!0}),n()})))}#S(e){return e==null?"":e===!0?"true":e===!1?"false":typeof e=="number"?String(e):typeof e=="object"?JSON.stringify(e):String(e)}#A(e){if(!e.startsWith(":")||e==="app")return;let t=e.replace(/^:+/,""),i=this.getAttribute(e),s=Object.getOwnPropertyDescriptor(this,t),n=i;if(!i&&s&&(s.get||s.value!==void 0)){let r=this[t],o=this.#S(r);this.getAttribute(e)!==o&&this.setAttribute(e,o),n=r,s=null}if(!(s&&s.set===void 0&&s.writable===!1)&&!(s&&s.get!==void 0&&s.set===void 0)){if(i)if(i==="true")n=!0;else if(i==="false")n=!1;else if(/^-?\d+(\.\d+)?$/.test(i))n=Number(i);else try{n=JSON.parse(i)}catch{n=i}if(!s||!s.set){let r=n;typeof n=="object"&&n!==null?r=this.#w(n,[t]):typeof n=="function"&&(r=this.#M(n,t));let o=e;if(Object.defineProperty(this,t,{get(){return this.#E(t),r},set(l){if(r!==l){typeof l=="object"&&l!==null?r=this.#w(l,[t]):r=l,this.#y(t);let a=this.#S(l);this.getAttribute(o)!==a&&this.setAttribute(o,a)}},enumerable:!0,configurable:!0}),typeof n=="object"&&n!==null){let l=this.watch(t,()=>{let a=this[t],f=this.#S(a);this.getAttribute(e)!==f&&this.setAttribute(e,f)},{deep:!0});this.#i.push({type:"attrSync",unwatch:l})}}else this[t]=n}}attributeChangedCallback(e,t,i){e.startsWith(":")&&e!=="app"&&t!==i&&this.#o===!0&&this.#A(e)}connectedCallback(){if(c.#s.add(this),this.#o===!0){this.#u||(this.#u=new MutationObserver(e=>{for(let t of e)t.type==="attributes"&&t.attributeName&&t.attributeName.startsWith(":")&&t.attributeName!=="app"&&this.#A(t.attributeName)}),this.#u.observe(this,{attributes:!0}));return}this.#R(),Promise.all([new Promise(e=>{if(this.#o===!0)return e();this.#o=e}),new Promise(e=>{let t=null,i=()=>{clearTimeout(t),t=setTimeout(()=>{s.disconnect(),this.#L(Array.from(this.children)).then(e)},0)},s=new MutationObserver(n=>{n.some(r=>r.type==="childList")&&i()});s.observe(this,{childList:!0}),i()})]).then(()=>{this.dispatchEvent("setup");for(let t of this.attrs.keys())!t.startsWith(":")||t==="app"||this.#A(t);let e=!1;this.childNodes.length>0&&Array.from(this.childNodes).some(i=>i.nodeType===Node.ELEMENT_NODE||i.nodeType===Node.TEXT_NODE&&i.textContent.trim()!=="")&&(this.#c?(this.applyTemplate(this.innerHTML),e=!0):this.#c=this.innerHTML),e||this.applyTemplate(),this.#o===!0&&!this.#u&&(this.#u=new MutationObserver(t=>{for(let i of t)i.type==="attributes"&&i.attributeName&&i.attributeName.startsWith(":")&&i.attributeName!=="app"&&this.#A(i.attributeName)}),this.#u.observe(this,{attributes:!0}))})}disconnectedCallback(){this.#u&&(this.#u.disconnect(),this.#u=null),this.#v(this.#i),this.#i=[];for(let e of this.#a)e.type==="getter"&&e.effect&&(this.#n.forEach((t,i)=>{t.delete(e.effect),t.size===0&&this.#n.delete(i)}),this.#l.delete(e.effect));this.#a=[],this.#m.forEach((e,t)=>{this[t]=e.original}),this.#m.clear(),this.#g.clear(),this.#n.clear(),this.#l.clear(),c.#s.delete(this)}toggleAttribute(e,t="",i=""){let s=this.getAttribute(e);this[t==""&&i==""&&(s||this.hasAttribute(e))?"removeAttribute":"setAttribute"](e,s!=t?t:i)}static{customElements.define("st-app",this)}};var I=class c{static DEFAULT_ICONS={arrow:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"><style type="text/css">.st0{fill:#77B3D4;}.st1{opacity:0.2;}.st2{fill:#231F20;}.st3{fill:#FFFFFF;}</style><g id="Layer_1"><g><circle class="st0" cx="32" cy="32" r="32"/></g><g class="st1"><path class="st2" d="M49.5,33.9L35.3,15.7c-1.8-2.3-4.7-2.3-6.5,0L14.5,33.9c-1.8,2.3-1,4.1,1.7,4.1H24v12c0,2.2,1.8,4,4,4h8c2.2,0,4-1.8,4-4V38h7.8C50.6,38,51.3,36.1,49.5,33.9z"/></g><g><path class="st3" d="M40,48c0,2.2-1.8,4-4,4h-8c-2.2,0-4-1.8-4-4V24c0-2.2,1.8-4,4-4h8c2.2,0,4,1.8,4,4V48z"/></g><g><path class="st3" d="M16.2,36c-2.7,0-3.5-1.9-1.7-4.1l14.3-18.1c1.8-2.3,4.7-2.3,6.5,0l14.3,18.1c1.8,2.3,1,4.1-1.7,4.1H16.2z"/></g></g><g id="Layer_2"></g></svg>'};static#e={settings:{position:"bottom-right"},condition:{name:"scroll",options:{hiding_type:"opacity",transition:"0.3s",attribute:[],margin_top:Math.min(window.innerHeight,document.documentElement.clientHeight),margin_left:void 0,margin_right:void 0,margin_bottom:void 0}},action:{name:"scroll",options:{selector:void 0,hiding_type:"opacity",setAttribute:void 0,removeAttribute:void 0,toggleAttribute:void 0,top:0,left:void 0,behavior:"smooth",hook:function(){}}},widget_container:{id:void 0,class:void 0,style:{}},widget:{id:void 0,class:void 0,style:{}},button_container:{id:void 0,class:void 0,style:{}},button:{src:c.DEFAULT_ICONS.arrow}};static#t={widget_container:{position:"fixed",width:"60px",height:"60px",margin:"30px"},widget:{position:"absolute"},button_container:{display:"flex","justify-content":"center","align-items":"center",overflow:"hidden",width:"60px",height:"60px","border-radius":"50%",cursor:"pointer"},button:{width:"100%",height:"100%","object-fit":"cover"}};static#s(...e){function t(s,n){function r(o,l,a){if(typeof l[o]=="object")for(let f in l[o])a[o]||(a[o]={}),r(f,l[o],a[o]);else a[o]=l[o]}for(let o in s)r(o,s,n)}let i={};for(let s of e)t(s,i);return i}static#o(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i="";for(let s=0;s<e;s++)i+=t.charAt(Math.floor(Math.random()*t.length));return i}static#c={opacity:"0",visibility:"hidden",display:"none"};#h="st_"+c.#o(16);#n=this.#h+"_wc";#d=this.#h+"_w";#l=this.#h+"_bc";#p=this.#h+"_b";#i=document.createElement("style");#r=document.createElement("div");#f=document.createElement("div");#u=document.createElement("div");#a(e,t,i){new RegExp(e+"{.*?"+t+":.*?;.*?}").test(this.#i.innerHTML)?this.#i.innerHTML=this.#i.innerHTML.replace(new RegExp("("+e+"{.*?"+t+":).*?(;.*?})"),"$1"+i+"$2"):new RegExp(e+"{.*?}").test(this.#i.innerHTML)?this.#i.innerHTML=this.#i.innerHTML.replace(new RegExp("("+e+"{.*?)(})"),"$1"+t+":"+i+";$2"):this.#i.innerHTML+=e+"{"+t+":"+i+";}"}#g(e,t){for(let i in t)this.#a(e,i,t[i])}constructor(e){function t(r,o,l=!1){return{show:function(){r.style.removeProperty(o)},hide:function(){r.style.setProperty(o,l?"unset":c.#c[o])}}}function i(r){switch(r){case"top-left":return{top:"0",left:"0"};case"top-right":return{top:"0",right:"0"};case"bottom-left":return{bottom:"0",left:"0"};case"bottom-right":default:return{bottom:"0",right:"0"}}}function s(r){return r?typeof r=="object"?[r[0]??"st_active",r[1]??"",r[2]??""]:[r??"st_active","",""]:null}let n=c.#s(c.#e,e);if(this.#g("."+this.#n,c.#t.widget_container),this.#g("."+this.#d,c.#t.widget),this.#g("."+this.#l,c.#t.button_container),this.#g("."+this.#p,c.#t.button),this.#g("."+this.#n,i(n.settings.position)),this.#g("."+this.#d,i(n.settings.position)),this.#r.classList.add(this.#n),this.#g("."+this.#n,n.widget_container.style),n.widget_container.class&&this.#r.classList.add(n.widget_container.class),n.widget_container.id&&(this.#r.id=n.widget_container.id),this.#f.classList.add(this.#d),this.#g("."+this.#d,n.widget.style),n.widget.class&&this.#f.classList.add(n.widget.class),n.widget.id&&(this.#f.id=n.widget.id),this.#u.classList.add(this.#l),this.#g("."+this.#l,n.button_container.style),n.button_container.class&&this.#u.classList.add(n.button_container.class),n.button_container.id&&(this.#u.id=n.button_container.id),n.condition){let r=function(a,f){let u=s(f);return{set:function(){u&&(u[1]?a.setAttribute(u[0],u[1]):a.setAttribute(u[0],""))},remove:function(){u&&(u[1]?u[2]?a.setAttribute(u[0],u[2]):a.setAttribute(u[0],""):a.removeAttribute(u[0]))}}};if(!n.condition.options.hiding_type in c.#c)return;let o=t(this.#f,n.condition.options.hiding_type),l=r(this.#f,n.condition.options.attribute);switch(o.hide(),l.remove(),n.condition.name){case"hover":this.#r.addEventListener("mouseenter",function(){o.show(),l.set()}),this.#r.addEventListener("mouseleave",function(){o.hide(),l.remove()});break;case"scroll":default:let a=Math.min(window.innerHeight,document.documentElement.clientHeight),f=Math.min(window.innerWidth,document.documentElement.clientWidth),u=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),h=Math.max(document.body.scrollWidth,document.documentElement.scrollWidth,document.body.offsetWidth,document.documentElement.offsetWidth,document.body.clientWidth,document.documentElement.clientWidth),p=n.condition.options.margin_top,d=n.condition.options.margin_bottom,g=n.condition.options.margin_right,y=n.condition.options.margin_left;window.addEventListener("scroll",function(){let _=window.pageYOffset||window.scrollY||document.documentElement.scrollTop,m=_+a,v=window.pageXOffset||window.scrollX||document.documentElement.scrollLeft,b=v+f;_>p||m<u-d||b<h-g||v>y?(o.show(),l.set()):(o.hide(),l.remove())});break}n.condition.options.transition&&this.#f.style.setProperty("transition",n.condition.options.transition)}if(n.action)switch(n.action.name){case"show_popup":if(!n.action.options.selector||!n.action.options.hiding_type in c.#c)return;this.#u.addEventListener("click",function(){for(let r of document.querySelectorAll(n.action.options.selector)){let o=t(r,n.action.options.hiding_type,!0);if(r.style[c.#c[n.action.options.hiding_type]]?o.show():o.hide(),n.action.options.setAttribute){let l=s(n.action.options.setAttribute);r.setAttribute(l[0],l[1])}n.action.options.removeAttribute&&r.removeAttribute(n.action.options.removeAttribute),n.action.options.toggleAttribute&&r.toggleAttribute(n.action.options.toggleAttribute)}});break;case"function":this.#u.addEventListener("click",n.action.options.hook);break;case"scroll":default:this.#u.addEventListener("click",function(){window.scrollTo({top:n.action.options.top,left:n.action.options.left,behavior:n.action.options.behavior})});break}new RegExp("^<svg.*?</svg>$").test(n.button.src)?this.#u.innerHTML=n.button.src:this.#u.innerHTML="<img src="+n.button.src+' alt="icon">',this.#u.childNodes[0].classList.add(this.#p),this.#i.setAttribute("widget",this.#h),document.head.appendChild(this.#i),this.#f.appendChild(this.#u),this.#r.appendChild(this.#f),document.querySelector("body").appendChild(this.#r)}},B=I;var O=class c{static set(e,t,i={}){if(i={path:"/",expires:3600,...i},!(i.expires instanceof Date)){let s=i.expires;i.expires=new Date(typeof s=="number"?Date.now()+s*1e3:Date.parse(s)||Date.parse(s.replace(/-/g,"/")))}document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+"; expires="+i.expires.toUTCString()+"; path="+i.path+(i.domain?"; domain="+i.domain:"")+(i.secure?"; secure":"")+(i.sameSite?"; samesite="+i.sameSite:"")}static get(e){e=encodeURIComponent(e);let t=document.cookie.split(";");for(let i=0;i<t.length;i++){let s=t[i].trim();if(s.startsWith(e+"=")){let n=decodeURIComponent(s.substring(e.length+1));try{return JSON.parse(n)}catch{return n}}}return null}static delete(e,t={}){c.set(e,"",{expires:0,...t})}static callback(e,t,i={}){i={interval:0,delay:0,value:!0,...i};let s=setInterval(()=>{c.get(e)===null&&(c.set(e,i.value,i),setTimeout(()=>{t(e)},i.delay*1e3)),i.interval||clearInterval(s)},i.interval*1e3)}static consent(e){e={content:"<div><span>\u042D\u0442\u043E\u0442 \u0441\u0430\u0439\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u0444\u0430\u0439\u043B\u044B cookies \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044B \u0441\u0431\u043E\u0440\u0430 \u0442\u0435\u0445\u043D\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u043E\u0441\u0435\u0442\u0438\u0442\u0435\u043B\u0435\u0439 (\u0434\u0430\u043D\u043D\u044B\u0435 \u043E\u0431 IP-\u0430\u0434\u0440\u0435\u0441\u0435, \u043C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0438 \u0438 \u0442.\u0434.) \u0434\u043B\u044F \u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0435\u043D\u0438\u044F \u0440\u0430\u0431\u043E\u0442\u043E\u0441\u043F\u043E\u0441\u043E\u0431\u043D\u043E\u0441\u0442\u0438 \u0438 \u0443\u043B\u0443\u0447\u0448\u0435\u043D\u0438\u044F \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F.</span><div><button action='accept'>\u041F\u0440\u0438\u043D\u044F\u0442\u044C</button><button action='decline'>\u041E\u0442\u043A\u043B\u043E\u043D\u0438\u0442\u044C</button></div></div>",container:"body",location:"bottom",zIndex:1e3,name:"cookie_consent",interval:5,...e};let t=document.createElement("container");if(e.container=="body"&&Object.assign(t.style,{position:"absolute",overflow:"hidden",width:"max-content",height:"max-content",maxWidth:"100vw",maxHeight:"100vh",zIndex:e.zIndex,transition:"inherit",pointerEvents:"all",display:"none",...(()=>{let i=(e.location||"").toLowerCase().split(/\s+/),s={top:i.includes("top")?0:i.includes("bottom")?void 0:"50%",bottom:i.includes("bottom")?0:void 0,left:i.includes("left")?0:i.includes("right")?void 0:"50%",right:i.includes("right")?0:void 0},n=s.left==="50%"?"translateX(-50%)":"",r=s.top==="50%"?"translateY(-50%)":"";return(n||r)&&(s.transform=`${n} ${r}`.trim()),s})()}),document.querySelector(e.container).append(t),!(e.content instanceof Element)){let i=e.content;e.content=i.trim().startsWith("<")?new DOMParser().parseFromString(i,"text/html").body.firstElementChild:document.querySelector(i)??(()=>{throw new Error("\u0421\u0435\u043B\u0435\u043A\u0442\u043E\u0440 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D")})()}t.append(e.content),c.callback(e.name,i=>{["accept","decline"].forEach(s=>{t.querySelectorAll(`[action=${s}]`).forEach(n=>{n.addEventListener("click",r=>{c.set(e.name,s=="accept",e),t.style.display="none"})})}),t.style.display=""},{...e,value:null})}};var z=class c{static DEFAULT_ICONS={link:'<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><g id="chain"><circle cx="16" cy="16" fill="#33d9b2" r="16" style="fill: rgb(119, 179, 212);"></circle><g fill="#fff" fill-rule="evenodd"><path d="m16.75 10h-7.5a.5.5 0 0 0 -.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5v-7.5a.5.5 0 0 0 -1 0v7h-11v-11h7a.5.5 0 0 0 0-1z" fill="#fff" style="fill: rgb(255, 255, 255);"></path><path d="m21.543 9.5-6.643 6.646a.5.5 0 0 0 .708.707l6.646-6.646v1.793a.5.5 0 0 0 1 0v-3a.5.5 0 0 0 -.5-.5h-3a.5.5 0 0 0 0 1z" fill="#fff" style="fill: rgb(255, 255, 255);"></path></g></g></svg>',email:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"><style type="text/css">.st0{fill:#77B3D4;}.st1{opacity:0.2;}.st2{fill:#231F20;}.st3{fill:#E0E0D1;}.st4{fill:#FFFFFF;}</style><g id="Layer_1"><g><circle class="st0" cx="32" cy="32" r="32"/></g><g><g class="st1"><path class="st2" d="M52,44c0,2.2-1.8,4-4,4H16c-2.2,0-4-1.8-4-4V24c0-2.2,1.8-4,4-4h32c2.2,0,4,1.8,4,4V44z"/></g><g><path class="st3" d="M52,42c0,2.2-1.8,4-4,4H16c-2.2,0-4-1.8-4-4V22c0-2.2,1.8-4,4-4h32c2.2,0,4,1.8,4,4V42z"/></g><g class="st1"><g><path class="st2" d="M35.5,30.2c-1.9-2.1-5.1-2.1-7,0L13,43.2c-0.2,0.2-0.3,0.4-0.5,0.6c0.7,1.3,2,2.2,3.4,2.2h32c1.5,0,2.7-0.9,3.4-2.2c-0.1-0.2-0.3-0.4-0.5-0.6L35.5,30.2z"/></g></g><g><g><path class="st3" d="M35.5,32c-1.9-1.9-5.1-1.9-7,0L13,43.5c-0.2,0.2-0.3,0.3-0.5,0.5c0.7,1.2,2,1.9,3.4,1.9h32c1.5,0,2.7-0.8,3.4-1.9c-0.1-0.2-0.3-0.3-0.5-0.5L35.5,32z"/></g></g><g class="st1"><g><path class="st2" d="M12.6,20.2c0.7-1.3,2-2.2,3.4-2.2h32c1.5,0,2.7,0.9,3.4,2.2c-0.1,0.2-0.3,0.4-0.5,0.6l-15.4,13c-1.9,2.1-5.1,2.1-7,0L12.6,20.2z"/></g></g><g><g><path class="st4" d="M28.5,32c1.9,1.9,5.1,1.9,7,0L51,20.5c0.2-0.2,0.3-0.3,0.5-0.5c-0.7-1.2-2-1.9-3.4-1.9H16c-1.5,0-2.7,0.8-3.4,1.9c0.1,0.2,0.3,0.3,0.5,0.5L28.5,32z"/></g></g></g></g><g id="Layer_2"></g></svg>',telegram:'<svg viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid"><g><path d="M128,0 C57.307,0 0,57.307 0,128 L0,128 C0,198.693 57.307,256 128,256 L128,256 C198.693,256 256,198.693 256,128 L256,128 C256,57.307 198.693,0 128,0 L128,0 Z" fill="#40B3E0"></path><path d="M190.2826,73.6308 L167.4206,188.8978 C167.4206,188.8978 164.2236,196.8918 155.4306,193.0548 L102.6726,152.6068 L83.4886,143.3348 L51.1946,132.4628 C51.1946,132.4628 46.2386,130.7048 45.7586,126.8678 C45.2796,123.0308 51.3546,120.9528 51.3546,120.9528 L179.7306,70.5928 C179.7306,70.5928 190.2826,65.9568 190.2826,73.6308" fill="#FFFFFF"></path><path d="M98.6178,187.6035 C98.6178,187.6035 97.0778,187.4595 95.1588,181.3835 C93.2408,175.3085 83.4888,143.3345 83.4888,143.3345 L161.0258,94.0945 C161.0258,94.0945 165.5028,91.3765 165.3428,94.0945 C165.3428,94.0945 166.1418,94.5735 163.7438,96.8115 C161.3458,99.0505 102.8328,151.6475 102.8328,151.6475" fill="#D2E5F1"></path><path d="M122.9015,168.1154 L102.0335,187.1414 C102.0335,187.1414 100.4025,188.3794 98.6175,187.6034 L102.6135,152.2624" fill="#B5CFE4"></path></g></svg>',whatsapp:'<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>Whatsapp-color</title><desc>Created with Sketch.</desc><defs></defs><g id="Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Color-" transform="translate(-700.000000, -360.000000)" fill="#67C15E"><path d="M723.993033,360 C710.762252,360 700,370.765287 700,383.999801 C700,389.248451 701.692661,394.116025 704.570026,398.066947 L701.579605,406.983798 L710.804449,404.035539 C714.598605,406.546975 719.126434,408 724.006967,408 C737.237748,408 748,397.234315 748,384.000199 C748,370.765685 737.237748,360.000398 724.006967,360.000398 L723.993033,360.000398 L723.993033,360 Z M717.29285,372.190836 C716.827488,371.07628 716.474784,371.034071 715.769774,371.005401 C715.529728,370.991464 715.262214,370.977527 714.96564,370.977527 C714.04845,370.977527 713.089462,371.245514 712.511043,371.838033 C711.806033,372.557577 710.056843,374.23638 710.056843,377.679202 C710.056843,381.122023 712.567571,384.451756 712.905944,384.917648 C713.258648,385.382743 717.800808,392.55031 724.853297,395.471492 C730.368379,397.757149 732.00491,397.545307 733.260074,397.27732 C735.093658,396.882308 737.393002,395.527239 737.971421,393.891043 C738.54984,392.25405 738.54984,390.857171 738.380255,390.560912 C738.211068,390.264652 737.745308,390.095816 737.040298,389.742615 C736.335288,389.389811 732.90737,387.696673 732.25849,387.470894 C731.623543,387.231179 731.017259,387.315995 730.537963,387.99333 C729.860819,388.938653 729.198006,389.89831 728.661785,390.476494 C728.238619,390.928051 727.547144,390.984595 726.969123,390.744481 C726.193254,390.420348 724.021298,389.657798 721.340985,387.273388 C719.267356,385.42535 717.856938,383.125756 717.448104,382.434484 C717.038871,381.729275 717.405907,381.319529 717.729948,380.938852 C718.082653,380.501232 718.421026,380.191036 718.77373,379.781688 C719.126434,379.372738 719.323884,379.160897 719.549599,378.681068 C719.789645,378.215575 719.62006,377.735746 719.450874,377.382942 C719.281687,377.030139 717.871269,373.587317 717.29285,372.190836 Z" id="Whatsapp"></path></g></g></svg>'};static#e={settings:{position:"bottom-right"},condition:{name:"scroll",options:{hiding_type:"opacity",transition:"0.3s",attribute:[],margin_top:Math.min(window.innerHeight,document.documentElement.clientHeight),margin_left:void 0,margin_right:void 0,margin_bottom:void 0}},widget_container:{id:void 0,class:void 0,style:{}},widget:{id:void 0,class:void 0,style:{}},links_container:{id:void 0,class:void 0,style:{}},links:{0:{href:"undefined",src:c.DEFAULT_ICONS.link,id:void 0,class:void 0,style:{}}}};static#t={widget_container:{position:"fixed",width:"60px",height:"60px",margin:"30px"},widget:{position:"absolute",display:"flex","flex-direction":"column",gap:"15px"},links_container:{display:"flex","justify-content":"center","align-items":"center",overflow:"hidden",width:"60px",height:"60px","border-radius":"50%",cursor:"pointer"},link:{width:"100%",height:"100%","object-fit":"cover"}};static#s(...e){function t(s,n){function r(o,l,a){if(typeof l[o]=="object")for(let f in l[o])a[o]||(a[o]={}),r(f,l[o],a[o]);else a[o]=l[o]}for(let o in s)r(o,s,n)}let i={};for(let s of e)t(s,i);return i}static#o(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i="";for(let s=0;s<e;s++)i+=t.charAt(Math.floor(Math.random()*t.length));return i}static#c={opacity:"0",visibility:"hidden",display:"none"};#h="st_"+c.#o(16);#n=this.#h+"_wc";#d=this.#h+"_w";#l=this.#h+"_ic";#p=this.#h+"_i";#i=document.createElement("style");#r=document.createElement("div");#f=document.createElement("div");#u(e,t,i){new RegExp(e+"{.*?"+t+":.*?;.*?}").test(this.#i.innerHTML)?this.#i.innerHTML=this.#i.innerHTML.replace(new RegExp("("+e+"{.*?"+t+":).*?(;.*?})"),"$1"+i+"$2"):new RegExp(e+"{.*?}").test(this.#i.innerHTML)?this.#i.innerHTML=this.#i.innerHTML.replace(new RegExp("("+e+"{.*?)(})"),"$1"+t+":"+i+";$2"):this.#i.innerHTML+=e+"{"+t+":"+i+";}"}#a(e,t){for(let i in t)this.#u(e,i,t[i])}constructor(e){function t(n,r,o=!1){return{show:function(){n.style.removeProperty(r)},hide:function(){n.style.setProperty(r,o?"unset":c.#c[r])}}}function i(n){switch(n){case"top-left":return{top:"0",left:"0"};case"top-right":return{top:"0",right:"0"};case"bottom-left":return{bottom:"0",left:"0"};case"bottom-right":default:return{bottom:"0",right:"0"}}}let s=c.#s(c.#e,e);if(this.#a("."+this.#n,c.#t.widget_container),this.#a("."+this.#d,c.#t.widget),this.#a("."+this.#l,c.#t.links_container),this.#a("."+this.#p,c.#t.link),this.#a("."+this.#n,i(s.settings.position)),this.#a("."+this.#d,i(s.settings.position)),this.#a("."+this.#l,s.links_container.style),this.#f.classList.add(this.#n),this.#a("."+this.#n,s.widget_container.style),s.widget_container.class&&this.#f.classList.add(s.widget_container.class),s.widget_container.id&&(this.#f.id=s.widget_container.id),this.#r.classList.add(this.#d),this.#a("."+this.#d,s.widget.style),s.widget.class&&this.#r.classList.add(s.widget.class),s.widget.id&&(this.#r.id=s.widget.id),s.condition){let n=function(l,a){function f(h){return h?typeof h=="object"?[h[0]??"st_active",h[1]??"",h[2]??""]:[h??"st_active","",""]:null}let u=f(a);return{set:function(){u&&(u[1]?l.setAttribute(u[0],u[1]):l.setAttribute(u[0],""))},remove:function(){u&&(u[1]?u[2]?l.setAttribute(u[0],u[2]):l.setAttribute(u[0],""):l.removeAttribute(u[0]))}}};if(!s.condition.options.hiding_type in c.#c)return;let r=t(this.#r,s.condition.options.hiding_type),o=n(this.#r,s.condition.options.attribute);switch(r.hide(),o.remove(),s.condition.name){case"hover":this.#f.addEventListener("mouseenter",function(){r.show(),o.set()}),this.#f.addEventListener("mouseleave",function(){r.hide(),o.remove()});break;case"scroll":default:let l=Math.min(window.innerHeight,document.documentElement.clientHeight),a=Math.min(window.innerWidth,document.documentElement.clientWidth),f=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),u=Math.max(document.body.scrollWidth,document.documentElement.scrollWidth,document.body.offsetWidth,document.documentElement.offsetWidth,document.body.clientWidth,document.documentElement.clientWidth),h=s.condition.options.margin_top,p=s.condition.options.margin_bottom,d=s.condition.options.margin_right,g=s.condition.options.margin_left;window.addEventListener("scroll",function(){let y=window.pageYOffset||window.scrollY||document.documentElement.scrollTop,_=y+l,m=window.pageXOffset||window.scrollX||document.documentElement.scrollLeft,v=m+a;y>h||_<f-p||v<u-d||m>g?(r.show(),o.set()):(r.hide(),o.remove())});break}s.condition.options.transition&&this.#r.style.setProperty("transition",s.condition.options.transition)}for(let n in s.links){let r=document.createElement("a");r.classList.add(this.#l),s.links_container.class&&r.classList.add(s.links_container.class),s.links[n].class&&r.classList.add(s.links[n].class),s.links[n].id&&(r.id=s.links[n].id,this.#a("#"+s.links[n].id,s.links[n].style)),r.setAttribute("href",s.links[n].href),r.setAttribute("target","_blank"),r.setAttribute("rel","nofollow noopener noreferrer"),new RegExp("^<svg.*?</svg>$").test(s.links[n].src)?r.innerHTML=s.links[n].src:r.innerHTML="<img src="+s.links[n].src+' alt="icon">',r.childNodes[0].classList.add(this.#p),this.#r.appendChild(r)}this.#i.setAttribute("widget",this.#h),document.head.appendChild(this.#i),this.#f.appendChild(this.#r),document.querySelector("body").appendChild(this.#f)}},U=z;var H=class{#e="_";#t=!0;#s=[];#o=[];#c(e,t){let i="",s=0,n=0;for(let r of t)for(;n+s<e.length;){let[o,l,a]=e[n+s];if(!l)i+=o,s++;else{new RegExp(`^${o}$`).test(r)&&(i+=r,n++);break}}if(this.#e&&this.#t)for(;n+s<e.length;)i+=e[n+s++][1]?e[n+s-1][2]:e[n+s-1][0];else n?n+s<e.length&&!e[n+s][1]&&(i+=e[n+s++][0]):i="";return[i,n,e.filter(r=>r[1]).length==n]}#h(e){return this.#s.map(t=>this.#c(t,e)).reduce((t,i,s)=>!t||i[1]>t[0][1]?[i,s]:t,null)}#n(e){return e.replace(/{(\d+)\*{([^}]*?)}(.*?)}/g,(t,i,s,n)=>`{{${s}}${n}}`.repeat(i)).split(/({{.*?}.*?})/).filter(Boolean).map(t=>{let[,i]=t.match(/^{{(.*?)}.*?}$/)||[],[,s]=t.match(/^{{.*?}=(.*?)}$/)||[];return[i||t,!!i,s||this.#e]})}#d(e=null){if(this.#l()){console.warn("\u041F\u043E\u043F\u044B\u0442\u043A\u0430 \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u043C\u0430\u0441\u043A\u0443 \u043F\u043E\u0441\u043B\u0435 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F \u043F\u0440\u0430\u0432\u0438\u043B",this);return}(e?[e]:this.#o).forEach(t=>{t.best_mask=this.#h(t.value),t.input.value=t.best_mask[0][0],Object.assign(t.input.dataset,{mask_id:t.best_mask[1],progress:t.best_mask[0][1],is_full:t.best_mask[0][2]})})}#l(){return!this.#s.some(e=>!e!=null)}add_mask(e){return this.#s.push(this.#n(e)),this.#d(),this.#s.length-1}remove_mask(e){delete this.#s[e],this.#d()}set_masks(e){this.#s=e.map(t=>this.#n(t)),this.#d()}constructor(e){let t=this;t.#e=e.default_filler??t.#e,t.#t=e.placeholder??t.#t,(e.inputs?e.inputs instanceof Element?[e.inputs]:Array.from(e.inputs):Array.from(document.querySelectorAll(e.selector))).forEach(s=>{let n={input:s,value:s.value.split().filter(Boolean)};s.addEventListener("input",r=>{if(r.preventDefault(),this.#l()){console.error("\u041D\u0435\u0442 \u043C\u0430\u0441\u043E\u043A \u0434\u043B\u044F \u044D\u0442\u043E\u0433\u043E \u043F\u043E\u043B\u044F.",this);return}if(r.data===null){let o=[];for(let l of n.value)if(o.push(l),this.#c(this.#s[n.best_mask[1]],o)[1]==n.best_mask[0][1]){o.pop();break}n.value=o}else n.value.push(...r.data);t.#d(n),typeof e.on_input=="function"&&e.on_input(s,{mask_id:n.best_mask[1],progress:n.best_mask[0][1],is_full:n.best_mask[0][2]})}),t.#o.push(n),s.closest("form")?.addEventListener("reset",()=>{n.value=[],t.#d(n)})}),e.masks&&t.set_masks(e.masks)}};var X=H;var M=class c{modal;overlay;area;container;content;#e={};#t={};#s="hidden";static find=x;get state(){return this.#s}get params(){return this.#e}clone(e){let t=this.content.cloneNode(!0);return t.id=e.id??(t.id||"modal").replace(/#+$/,"")+(e.suffix??"_copy"),new c({...this.#e,...this.#t,content:t,...e,parent:this})}constructor(e){e={zIndex:1e3,duration:0,container:"body",overlay:!0,overlay_shading:.5,overlay_blur:"5px",overlay_scroll_lock:!0,content:"<div></div>",location:"center center",trigger:null,close_by_overlay:!0,close_by_esc:!0,auto_close:-1,allow_interrupt:!1,before_show:()=>{},on_show:()=>{},before_hide:()=>{},on_hide:()=>{},before_init:()=>{},on_init:()=>{},...e};let t,i,s;for(let[o,l]of Object.entries(e))typeof l=="function"?(this[o]=l.bind(this),this.#t[o]=l):this.#e[o]=l;this.before_init(this.#e),this.modal=document.createElement("modal"),w(this.modal,this),Object.assign(this.modal.style,{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",zIndex:this.#e.zIndex,transition:`all ${this.#e.duration}s`,pointerEvents:"none",display:"none",overflow:"hidden"}),this.modal.setAttribute("state","hidden");try{k(this.#e.container).append(this.modal)}catch{throw new Error("\u041D\u0435\u0443\u0434\u0430\u0447\u043D\u0430\u044F \u043F\u043E\u043F\u044B\u0442\u043A\u0430 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043C\u043E\u0434\u0430\u043B\u044C\u043D\u043E\u0435 \u043E\u043A\u043D\u043E \u0432 \u0443\u043A\u0430\u0437\u0430\u043D\u043D\u044B\u0439 \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440")}this.#e.overlay&&(this.overlay=document.createElement("modal-overlay"),w(this.overlay,this),Object.assign(this.overlay.style,{position:"absolute",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:`rgba(0, 0, 0, ${this.#e.overlay_shading})`,backdropFilter:`blur(${this.#e.overlay_blur})`,zIndex:++this.#e.zIndex,transition:"inherit"}),this.modal.append(this.overlay));let n=(this.#e.location||"").toLowerCase().split(/\s+/);this.area=document.createElement("modal-area"),w(this.area,this),Object.assign(this.area.style,{position:"absolute",top:"0",left:"0",right:"0",bottom:"0",overflowY:"auto",overflowX:"clip",display:"flex",alignItems:"flex-start",justifyContent:n.includes("left")?"flex-start":n.includes("right")?"flex-end":"center",zIndex:++this.#e.zIndex,pointerEvents:"all",transition:"inherit"}),this.modal.append(this.area),this.#e.close_by_overlay&&this.area.addEventListener("click",o=>{this.container.contains(o.target)||this.hide(o)}),this.container=document.createElement("modal-container"),w(this.container,this),Object.assign(this.container.style,{position:"relative",flexShrink:"0",width:"max-content",height:"max-content",maxWidth:"100vw",zIndex:++this.#e.zIndex,transition:"inherit",pointerEvents:"all",marginTop:n.includes("top")?"0":"auto",marginBottom:n.includes("bottom")?"0":"auto",marginLeft:n.includes("left")?"0":"auto",marginRight:n.includes("right")?"0":"auto"}),this.area.append(this.container);try{this.content=k(this.#e.content)??new DOMParser().parseFromString(this.#e.content,"text/html").body.firstElementChild}catch{throw new Error("\u041D\u0435\u0443\u0434\u0430\u0447\u043D\u0430\u044F \u043F\u043E\u043F\u044B\u0442\u043A\u0430 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043F\u0435\u0440\u0435\u0434\u0430\u043D\u043D\u044B\u0439 \u043A\u043E\u043D\u0442\u0435\u043D\u0442 \u0432 \u043C\u043E\u0434\u0430\u043B\u044C\u043D\u043E\u0435 \u043E\u043A\u043D\u043E")}this.container.append(this.content),w(this.content,this),this.content.style.transition="inherit",this.content.querySelectorAll('[action="close"]').forEach(o=>{o.addEventListener("click",()=>this.hide())});let r=o=>{o.before_func(o.data),clearTimeout(t),this.modal.style.display="flex",requestAnimationFrame(()=>{this.#s=o.process,this.modal.setAttribute("state",this.#s),requestAnimationFrame(()=>{t=setTimeout(()=>{this.#s=o.final,this.modal.setAttribute("state",this.#s),o.hide&&(this.modal.style.display="none"),o.after_func(o.data)},this.#e.duration*1e3)})})};this.show=(o=null)=>{(this.#s=="hidden"||this.#e.allow_interrupt&&this.#s=="hiding")&&(r({before_func:this.before_show,after_func:this.on_show,process:"showing",final:"shown",hide:!1,data:o}),this.#e.overlay_scroll_lock&&this.overlay&&(s=document.documentElement.style.scrollBehavior,i=document.body.style,i={position:i.position,top:i.top,left:i.left,width:i.width,scroll_Y:window.scrollY||document.documentElement.scrollTop,scroll_X:window.scrollX||document.documentElement.scrollLeft},document.documentElement.style.scrollBehavior="unset",Object.assign(document.body.style,{position:"fixed",width:"100vw",top:`-${i.scroll_Y}px`,left:`-${i.scroll_X}px`})),this.#e.auto_close>0&&(clearTimeout(t),t=setTimeout(()=>{this.hide()},this.#e.auto_close*1e3)))},this.hide=(o=null)=>{(this.#s=="shown"||this.#e.allow_interrupt&&this.#s=="showing")&&(r({before_func:this.before_hide,after_func:this.on_hide,process:"hiding",final:"hidden",hide:!0,data:o}),clearTimeout(t),t=setTimeout(()=>{i&&(Object.assign(document.body.style,i),window.scrollTo(i.scroll_X,i.scroll_Y)),s!=null&&(document.documentElement.style.scrollBehavior=s)},this.#e.duration*1e3))},this.#e.close_by_esc&&document.addEventListener("keydown",o=>{(o.code==="Escape"||o.keyCode===27)&&this.hide(o)}),this.#e.trigger&&document.querySelectorAll(this.#e.trigger).forEach(o=>{o.addEventListener("click",()=>this.show(o))}),this.on_init(this.#e)}};var P=class c{static#e=new Map;constructor(e={}){let t=Object.assign({selector:null,root:null,rootMargin:"0px",threshold:0,before_init:()=>{},on_init:()=>{}},e);if(!t.selector)throw new Error("st_observer: selector required");let i=typeof t.selector=="string"?t.selector:Symbol("selector");if(c.#e.has(i))return this._internal=c.#e.get(i),this;let s={key:i,selector:t.selector,options:{root:t.root,rootMargin:t.rootMargin,threshold:t.threshold},observer:null,callbacks:new WeakMap,elements:new Set,_connected:!1,crossRules:new Map};t.before_init();let n=()=>({on_show:new Set,once_show:new Set,while_show:new Set,on_hide:new Set,once_hide:new Set,while_hide:new Set,_once_shown:!1,_once_hidden:!1,_wasIntersecting:!1}),r=(d,...g)=>{try{d(...g)}catch(y){console.error(y)}},o=(d,g)=>!(d.right<=g.left||d.left>=g.right||d.bottom<=g.top||d.top>=g.bottom),l=d=>d?typeof d=="string"?Array.from(document.querySelectorAll(d)):d instanceof Element?[d]:NodeList.prototype.isPrototypeOf(d)||Array.isArray(d)?Array.from(d):[]:typeof s.selector=="string"?Array.from(document.querySelectorAll(s.selector)):s.selector instanceof Element?[s.selector]:NodeList.prototype.isPrototypeOf(s.selector)||Array.isArray(s.selector)?Array.from(s.selector):[],a=d=>({goals:new Set(d),on_cross:new Set,once_cross:new Set,while_cross:new Set,_once_done:new Set,_wasCrossing:new Map}),f=d=>{let g=s.crossRules.get(d);if(!g||!g.length||!document.contains(d))return;let y=d.getBoundingClientRect();for(let _ of g)for(let m of _.goals){if(!document.contains(m)){_._wasCrossing.set(m,!1);continue}let v=m.getBoundingClientRect(),b=o(y,v);b&&_.while_cross.forEach(A=>r(A,{target:d,goal:m},d,m)),!!!_._wasCrossing.get(m)&&b&&_.on_cross.forEach(A=>r(A,{target:d,goal:m},d,m)),b&&!_._once_done.has(m)&&(_.once_cross.forEach(A=>r(A,{target:d,goal:m},d,m)),_._once_done.add(m)),_._wasCrossing.set(m,!!b)}},u=()=>{for(let d of Array.from(s.crossRules.keys()))if(document.contains(d))try{f(d)}catch(g){console.error(g)}},h=()=>d=>{for(let g of d){let y=g.target,_=s.callbacks.get(y);_||(_=n(),s.callbacks.set(y,_)),g.isIntersecting?(_.while_show.forEach(m=>r(m,g,y)),_._wasIntersecting||_.on_show.forEach(m=>r(m,g,y)),_._once_shown||(_._once_shown=!0,_.once_show.forEach(m=>r(m,g,y))),_._wasIntersecting=!0):(_.while_hide.forEach(m=>r(m,g,y)),_._wasIntersecting&&_.on_hide.forEach(m=>r(m,g,y)),_._once_hidden||(_._once_hidden=!0,_.once_hide.forEach(m=>r(m,g,y))),_._wasIntersecting=!1)}u()};this._internal=s,this._createCbObj=n,this._resolveTargets=l,this._createCrossRule=a,this._checkCrossForTarget=f,this._runAllCrossChecks=u,this._makeIoCallback=h;let p=l();for(let d of p)s.elements.add(d),t.on_init(d),s.callbacks.get(d)||s.callbacks.set(d,n());c.#e.set(i,s),this.connect()}enableAutoCrossChecks(e={}){let t=Object.assign({strategy:"all",watchScrollAncestors:!0,watchResize:!0,rAFWhileAnimating:!1},e);if(this._autoChecks)return this._autoChecks.cfg=t,this;let i=this._internal,s=this,n=!1,r=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1,(t.strategy==="all"||t.strategy==="entryOnly")&&s._runAllCrossChecks()}))},o=h=>{let p=new Set,d=h.parentNode;for(;d&&d!==document;){if(d instanceof HTMLElement){let g=getComputedStyle(d),y=g.overflow+g.overflowX+g.overflowY;/(auto|scroll|overlay)/.test(y)&&p.add(d)}d=d.parentNode}return p.add(window),Array.from(p)},l=()=>r(),a=new Set;if(t.watchScrollAncestors)for(let h of Array.from(i.elements))o(h).forEach(d=>{a.has(d)||(d.addEventListener("scroll",l,{passive:!0}),a.add(d))});else window.addEventListener("scroll",l,{passive:!0}),a.add(window);t.watchResize&&window.addEventListener("resize",l,{passive:!0});let f=null,u=()=>{s._runAllCrossChecks(),f=requestAnimationFrame(u)};return this._autoChecks={cfg:t,scrollTargets:a,onScrollOrResize:l,rafId:f,startRaf:()=>{f||u()},stopRaf:()=>{f&&(cancelAnimationFrame(f),f=null)}},this}disableAutoCrossChecks(){if(!this._autoChecks)return this;let e=this._autoChecks;e.scrollTargets.forEach(t=>{try{t.removeEventListener("scroll",e.onScrollOrResize)}catch{}});try{window.removeEventListener("resize",e.onScrollOrResize)}catch{}return e.stopRaf(),this._autoChecks=null,this}_register(e,t,i){if(typeof t!="function")return this;let s=this._internal,n=this._resolveTargets(i);for(let r of n){let o=s.callbacks.get(r);if(o||(o=this._createCbObj(),s.callbacks.set(r,o)),o[e].add(t),!s.elements.has(r)&&(s.elements.add(r),s._connected&&s.observer))try{s.observer.observe(r)}catch{}}return this}on_show(e,t){return this._register("on_show",e,t)}while_show(e,t){return this._register("while_show",e,t)}once_show(e,t){return this._register("once_show",e,t)}on_hide(e,t){return this._register("on_hide",e,t)}while_hide(e,t){return this._register("while_hide",e,t)}once_hide(e,t){return this._register("once_hide",e,t)}observe(e){let t=this._resolveTargets(e);for(let i of t)if(this._internal.callbacks.get(i)||this._internal.callbacks.set(i,this._createCbObj()),this._internal.elements.add(i),this._internal._connected&&this._internal.observer)try{this._internal.observer.observe(i)}catch{}return this}unobserve(e){let t=this._resolveTargets(e);for(let i of t){try{this._internal.observer&&this._internal.observer.unobserve(i)}catch{}this._internal.callbacks.delete(i),this._internal.elements.delete(i)}return this}disconnect(){try{this._internal.observer&&this._internal.observer.disconnect()}catch{}return this._internal.observer=null,this._internal._connected=!1,this}connect(e={}){if(this._internal._connected)return this;if(e.root!==void 0&&(this._internal.options.root=e.root),e.rootMargin!==void 0&&(this._internal.options.rootMargin=e.rootMargin),e.threshold!==void 0&&(this._internal.options.threshold=e.threshold),this._internal.observer=new IntersectionObserver(this._makeIoCallback(),this._internal.options),e.resetFlags)for(let t of Array.from(this._internal.elements)){let i=this._internal.callbacks.get(t);i&&(i._once_shown=!1,i._once_hidden=!1,i._wasIntersecting=!1)}for(let t of Array.from(this._internal.elements))try{this._internal.observer.observe(t)}catch{}return this._internal._connected=!0,this}reconnect(e={}){return this.connect(e)}resetOnceFlags(e){let t=e?this._resolveTargets(e):Array.from(this._internal.elements);for(let i of t){let s=this._internal.callbacks.get(i);s&&(s._once_shown=!1,s._once_hidden=!1,s._wasIntersecting=!1)}return this}isConnected(){return!!this._internal._connected}getObservedElements(){return Array.from(this._internal.elements)}_registerCross(e,t,i,s){if(typeof t!="function")return this;let n=this._internal;s===void 0&&(typeof i=="string"||i instanceof Element||NodeList.prototype.isPrototypeOf(i)||Array.isArray(i))&&(s=i,i=void 0);let r=this._resolveTargets(i),o=this._resolveTargets(s);if(!o.length)return console.warn("st_observer: cross registration no goals"),this;for(let l of r){n.callbacks.get(l)||n.callbacks.set(l,this._createCbObj()),n.elements.add(l);let a=n.crossRules.get(l);a||(a=[],n.crossRules.set(l,a));let f=a.find(u=>{if(u.goals.size!==o.length)return!1;for(let h of o)if(!u.goals.has(h))return!1;return!0});f||(f=this._createCrossRule(o),a.push(f)),f[e].add(t);for(let u of o)n.elements.add(u)}return this._runAllCrossChecks(),this}on_cross(e,t,i){return this._registerCross("on_cross",e,t,i)}once_cross(e,t,i){return this._registerCross("once_cross",e,t,i)}while_cross(e,t,i){return this._registerCross("while_cross",e,t,i)}resetCrossOnceFlags(e,t){let i=this._internal,s=e?this._resolveTargets(e):Array.from(i.crossRules.keys()),n=t?this._resolveTargets(t):null;for(let r of s){let o=i.crossRules.get(r);if(o)for(let l of o)if(!n)l._once_done.clear();else for(let a of n)l._once_done.delete(a)}return this}},Y=P;var N=class c{#e={};#t={};#s=new WeakMap;static find=x;get params(){return this.#e}get value(){return E(this.#e.target).map(e=>e.multiple?[...e.selectedOptions].map(t=>t.value):e.value)}clone(e){return new c({...this.#e,...this.#t,...e,parent:this})}constructor(e){e={target:"select",location:"bottom center",action:"click",duration:0,allow_interrupt:!1,close_on_select:!0,close_on_outside:!0,before_open:()=>{},on_open:()=>{},before_close:()=>{},on_close:()=>{},before_change:()=>{},on_change:()=>{},before_init:()=>{},on_init:()=>{},...e};for(let[t,i]of Object.entries(e))typeof i=="function"&&t!="target"?(this[t]=i.bind(this),this.#t[t]=i):this.#e[t]=i;this.before_init(this.#e);for(let t of E(this.#e.target))this.#c(t);this.on_init(this.#e)}#o(e){let t=(this.#e.location||"").toLowerCase().split(/\s+/);Object.assign(e.style,{position:"absolute",top:t.includes("top")?"auto":"100%",bottom:t.includes("top")?"100%":"auto",left:t.includes("right")?"auto":t.includes("center")?"50%":"0",right:t.includes("right")?"0":"auto",transform:t.includes("center")&&!t.includes("right")?"translateX(-50%)":"none"})}#c(e){let t=document.createElement("select-container");w(t,this),Object.assign(t.style,{position:"relative",display:"inline-block"});let i=document.createElement("select-trigger");w(i,this),Object.assign(i.style,{display:"block",cursor:"pointer"});let s=document.createElement("select-options");w(s,this),Object.assign(s.style,{transition:`all ${this.#e.duration}s`}),this.#o(s),Object.assign(e.style,{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)"}),e.parentNode.insertBefore(t,e),t.append(i,e,s),t.setAttribute("state","closed");for(let n of[...e.options]){let r=document.createElement("select-option");w(r,this),r.textContent=n.textContent,r.style.cursor="pointer",n.disabled&&r.setAttribute("disabled",""),r.toggleAttribute("selected",n.selected),r.addEventListener("click",()=>{n.disabled||this.#h(t,e,n,r)}),s.append(r)}this.#n(e,i),this.#e.action=="hover"?(t.addEventListener("mouseenter",()=>this.open(t)),t.addEventListener("mouseleave",()=>this.close(t))):i.addEventListener(this.#e.action,()=>this.toggle(t)),this.#e.close_on_outside&&document.addEventListener("click",n=>{t.contains(n.target)||this.close(t)})}#h(e,t,i,s){this.before_change(i,t)!==!1&&(t.multiple?(i.selected=!i.selected,s.toggleAttribute("selected",i.selected)):(t.value=i.value,[...e.querySelectorAll("select-option")].forEach(n=>n.toggleAttribute("selected",n===s))),t.dispatchEvent(new Event("change",{bubbles:!0})),this.#n(t,e.querySelector("select-trigger")),this.on_change(i,t),!t.multiple&&this.#e.close_on_select&&this.close(e))}#n(e,t){e.multiple?t.textContent=[...e.selectedOptions].map(i=>i.textContent).join(", "):t.textContent=(e.selectedOptions[0]??e.options[0])?.textContent??""}#d(e,t,i,s,n){s(e),clearTimeout(this.#s.get(e)),requestAnimationFrame(()=>{e.setAttribute("state",t),requestAnimationFrame(()=>{this.#s.set(e,setTimeout(()=>(e.setAttribute("state",i),n(e)),this.#e.duration*1e3))})})}#l(e,t){let i=e.getAttribute("state")??"closed",s=this.#e.allow_interrupt;(t?i=="closed"||s&&i=="closing":i=="open"||s&&i=="opening")&&this.#d(e,t?"opening":"closing",t?"open":"closed",t?this.before_open:this.before_close,t?this.on_open:this.on_close)}open(e){E(e).map(this.#p).forEach(t=>t&&this.#l(t,!0))}close(e){E(e).map(this.#p).forEach(t=>t&&this.#l(t,!1))}toggle(e){E(e).map(this.#p).forEach(t=>{t&&this.#l(t,!["open","opening"].includes(t.getAttribute("state")))})}#p=e=>e?.closest?.("select-container")??(e?.tagName?.toLowerCase()=="select"?e.parentElement:null)};var R=class c{#e={};#t={};#s=[];#o=[];#c=!1;params={};query={};#h="";#n="";clone(e){return new c({...this.#e,...this.#t,...e,parent:this})}constructor(e){e={point:"/",name:"",match_all:!0,strict_mode:!0,before_init:()=>{},on_init:()=>{},...e};for(let[t,i]of Object.entries(e))typeof i=="function"?(this[t]=i.bind(this),this.#t[t]=i):this.#e[t]=i;this.before_init(this.#e),this.#o.push({prefix:this.#e.point,middlewares:[]}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>this.#a()):queueMicrotask(()=>this.#a()),this.on_init(this.#e)}#d(){return this.#o[this.#o.length-1]}prefix(e){let t=this.#d();return this.#o.push({prefix:"/"+this.#l(t.prefix)+"/"+this.#l(e)+"/",middlewares:[...t.middlewares]}),this}group(e){e(),this.#o.length>1&&this.#o.pop()}middleware(e){let t=this.#d();return t.middlewares=t.middlewares.concat(Array.isArray(e)?e:[e]),this}get(e,t,i={}){return this.#p(e,t,i)}#l(e){return String(e).replace(/^\/+|\/+$/g,"")}#p(e,t,i={}){if(typeof t!="function")throw new Error("Route: \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u0437\u0430\u043C\u044B\u043A\u0430\u043D\u0438\u0435\u043C");typeof i=="string"&&(i={alias:i});let s=this.#d(),n=i.strict_mode??this.#e.strict_mode,r=n?("/"+this.#l(s.prefix)+"/"+this.#l(e)+"/").replace(/\/{2,}/g,"/"):(this.#l(s.prefix)+"/"+this.#l(e)).replace(/\/{2,}/g,"/");for(let a of this.#s)if(a.pattern===r)throw new Error(`Route: \u0434\u0443\u0431\u043B\u0438\u043A\u0430\u0442 \u043C\u0430\u0440\u0448\u0440\u0443\u0442\u0430: ${r}`);let{regex:o,names:l}=this.#i(r);return this.#s.push({pattern:r,uri:e,alias:i.alias??null,closure:t,middlewares:s.middlewares,names:l,regex:o,strict_mode:n}),this}#i(e){let t=[],i=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n="^"+e.replace(/\{(\w+)\}|\*|[^{*]+/g,(r,o)=>o!==void 0?(t.push(o),"([^/]+)"):r==="*"?(t.push("*"),"(.*)"):i(r)).replace(/\/+$/,"")+"/?$";return{regex:new RegExp(n),names:t}}#r(){return this.#e.name?"route:"+this.#e.name:"route"}#f(e){return"route:"+this.#e.name+":"+e}#u(e,t){document.dispatchEvent(new CustomEvent(e,{detail:t}))}#a(){if(!this.#c){this.#c=!0,this.#h=location.pathname,this.#n=location.href,this.query=Object.fromEntries(new URLSearchParams(location.search)),this.#u(this.#r(),{name:this.#e.name,path:this.#h,query:this.query,url:this.#n});for(let e of this.#s){let t=e.regex.exec(this.#h);if(!t)continue;let i=t.slice(1).map(c.#g);if(this.params={},e.names.forEach((n,r)=>{this.params[n]=i[r]}),e.middlewares.some(n=>!n.call(this,...i)))continue;e.closure.call(this,...i);let s={name:this.#e.name,pattern:e.pattern,uri:e.uri,alias:e.alias,params:this.params,values:i,query:this.query,path:this.#h,url:this.#n};if(e.alias&&this.#u(this.#f(e.alias),s),e.uri&&this.#u(this.#f(e.uri),s),!this.#e.match_all)break}}}get routes(){return this.#s}get path(){return this.#h}get url(){return this.#n}static#g(e){if(e==null)return e;try{return decodeURIComponent(e)}catch{return e}}};var j=class c{#e={};#t={};#s=new WeakMap;#o=new Map;#c=null;static find=x;get params(){return this.#e}clone(e){return new c({...this.#e,...this.#t,...e,parent:this})}constructor(e){e={duration:0,trigger:"[trigger]",target:null,allow_interrupt:!1,action:"click",anchor:!1,keep_history:!1,before_activate:()=>{},on_activate:()=>{},before_deactivate:()=>{},on_deactivate:()=>{},before_activated:()=>{},on_activated:()=>{},before_deactivated:()=>{},on_deactivated:()=>{},before_init:()=>{},on_init:()=>{},...e},e.keep_history&&(e.anchor=!0);for(let[i,s]of Object.entries(e))typeof s=="function"&&i!="target"?(this[i]=s.bind(this),this.#t[i]=s):this.#e[i]=s;this.before_init(this.#e);let t=i=>i.hasAttribute("state")||i.setAttribute("state","inactive");for(let i of E(this.#e.trigger)){w(i,this),t(i),this.#h(i).forEach(t);let s=this.#n(i);s&&this.#o.set(s,i),this.#e.action=="hover"?(i.addEventListener("mouseenter",()=>this.activate(i)),i.addEventListener("mouseleave",()=>this.deactivate(i))):i.addEventListener(this.#e.action,()=>this.toggle(i))}this.#e.anchor&&(this.#p(),this.#e.keep_history&&window.addEventListener("hashchange",()=>this.#p())),this.on_init(this.#e)}#h(e){let t=this.#e.target;return typeof t=="function"&&(t=t(e)),t??=e.getAttribute("target"),E(t)}#n(e){if(!this.#e.anchor)return null;if(e.id)return e.id;let t=this.#h(e);return t.length===1&&t[0].id?t[0].id:null}#d(e){let t="#"+e;location.hash!==t&&(this.#e.keep_history?history.pushState(null,"",t):history.replaceState(null,"",t))}#l(){if(!location.hash)return;let e=location.pathname+location.search;this.#e.keep_history?history.pushState(null,"",e):history.replaceState(null,"",e)}#p(){let e=this.#o.get(location.hash.slice(1));e?this.activate(e):this.#e.keep_history&&this.#c&&(this.deactivate(this.#c),this.#c=null)}#i(e,t,i,s,n){e.forEach(r=>(s(r),clearTimeout(this.#s.get(r)))),requestAnimationFrame(()=>{e.forEach(r=>r.setAttribute("state",t)),requestAnimationFrame(()=>{let r=setTimeout(()=>e.forEach(o=>(o.setAttribute("state",i),n(o))),this.#e.duration*1e3);e.forEach(o=>this.#s.set(o,r))})})}#r(e,t){let i=e.getAttribute("state")??"inactive",s=this.#e.allow_interrupt;if(!(t?i=="inactive"||s&&i=="deactivating":i=="active"||s&&i=="activating"))return;let n=t?"activate":"deactivate",r=t?"activating":"deactivating",o=t?"active":"inactive",l=this.#h(e),a=this.#n(e);a&&(t?(this.#d(a),this.#c=e):location.hash.slice(1)===a&&(this.#l(),this.#c=null)),this.#i([e],r,o,f=>this[`before_${n}`](f,l),f=>this[`on_${n}`](f,l)),this.#i(l,r,o,f=>this[`before_${n}d`](f,e),f=>this[`on_${n}d`](f,e))}toggle(e){E(e).forEach(t=>this.#r(t,!["active","activating"].includes(t.getAttribute("state"))))}activate(e){E(e).forEach(t=>this.#r(t,!0))}deactivate(e){E(e).forEach(t=>this.#r(t,!1))}};var F=class c{static#e=Symbol();static#t=new WeakMap;static#s=new WeakMap;static#o=new Set(["\u0432","\u0432\u043E","\u043D\u0430","\u043F\u043E","\u0441","\u0441\u043E","\u043A","\u043A\u043E","\u0443","\u043E","\u043E\u0431","\u043E\u0431\u043E","\u0437\u0430","\u0438\u0437","\u0438\u0437\u043E","\u0434\u043E","\u043E\u0442","\u043F\u0440\u0438","\u043F\u043E\u0434","\u043F\u043E\u0434\u043E","\u043D\u0430\u0434","\u043D\u0430\u0434\u043E","\u0431\u0435\u0437","\u0434\u043B\u044F","\u043F\u0440\u043E","\u0447\u0435\u0440\u0435\u0437","\u0441\u043A\u0432\u043E\u0437\u044C","\u043C\u0435\u0436\u0434\u0443","\u043C\u0435\u0436","\u043F\u0435\u0440\u0435\u0434","\u043F\u0435\u0440\u0435\u0434\u043E","\u043E\u043A\u043E\u043B\u043E","\u0441\u0440\u0435\u0434\u0438","\u043A\u0440\u043E\u043C\u0435","\u0432\u043E\u043A\u0440\u0443\u0433","\u0432\u0434\u043E\u043B\u044C","\u043F\u0440\u043E\u0442\u0438\u0432","\u0440\u0430\u0434\u0438","\u0432\u043C\u0435\u0441\u0442\u043E","\u0432\u043D\u0443\u0442\u0440\u0438","\u0441\u0432\u0435\u0440\u0445\u0443","\u0441\u043D\u0438\u0437\u0443","\u0432\u043E\u0437\u043B\u0435","\u043D\u0430\u043F\u0440\u043E\u0442\u0438\u0432","\u0431\u043B\u0430\u0433\u043E\u0434\u0430\u0440\u044F","\u0441\u043E\u0433\u043B\u0430\u0441\u043D\u043E","\u0432\u043E\u043F\u0440\u0435\u043A\u0438","\u0438","\u0430","\u043D\u043E","\u0434\u0430","\u0438\u043B\u0438","\u043B\u0438\u0431\u043E","\u0447\u0442\u043E","\u0447\u0442\u043E\u0431","\u0447\u0442\u043E\u0431\u044B","\u043A\u0430\u043A","\u0435\u0441\u043B\u0438","\u0438\u0431\u043E","\u0445\u043E\u0442\u044F","\u043F\u043E\u043A\u0430","\u043A\u043E\u0433\u0434\u0430","\u043A\u0443\u0434\u0430","\u043E\u0442\u043A\u0443\u0434\u0430","\u0437\u0430\u0447\u0435\u043C","\u043F\u043E\u0447\u0435\u043C\u0443","\u0436\u0435","\u043B\u0438","\u0431\u044B","\u0431","\u0432\u0435\u0434\u044C","\u043B\u0438\u0448\u044C","\u0443\u0436","\u0430\u0436","\u0442\u043E","\u043D\u0438","\u043D\u0435","\u043D\u0443","\u0432\u043E\u043D","\u0432\u043E\u0442"]);static#c=new Set(["SCRIPT","STYLE","NOSCRIPT","CODE","PRE","TEXTAREA","KBD","SAMP"]);static#h=(()=>{let e=[...this.#o].sort((t,i)=>i.length-t.length).map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|");return new RegExp(`(?<=^|[\\s(\xAB\u201E"'\\[])(${e})(\\s+)(?=\\S)`,"gi")})();static#n=/(\d) +(?=\S)/g;static#d=/ +(?=[—–] )/g;static preventWidows(e){let t=k(e);if(!t||t[c.#e])return;c.#i(t);let i=c.#r(t);for(let s of i)c.#t.set(s,s.nodeValue),s[c.#e]=!0,c.#p(s);c.#g(t)}static#l(e){return e.replace(c.#h,(t,i)=>i+"\xA0").replace(c.#n,"$1\xA0").replace(c.#d,"\xA0")}static#p(e){c.#t.has(e)||c.#t.set(e,e.nodeValue);let t=c.#l(c.#t.get(e));e.nodeValue!==t&&(e.nodeValue=t)}static#i(e){e[c.#e]=!0;let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),i;for(;i=t.nextNode();)i[c.#e]=!0}static#r(e){let t=[],i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:n=>{if(!n.nodeValue||!n.nodeValue.trim())return NodeFilter.FILTER_REJECT;for(let r=n.parentElement;r&&r!==e.parentElement;r=r.parentElement){if(c.#c.has(r.tagName))return NodeFilter.FILTER_REJECT;let o=r.getAttribute&&r.getAttribute("contenteditable");if(o===""||o==="true")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}),s;for(;s=i.nextNode();)t.push(s);return t}static#f(e){let t=c.#r(e);for(let i of t)i[c.#e]||(c.#t.set(i,i.nodeValue),i[c.#e]=!0),c.#p(i)}static#u(e,t){e.mutating=!0;try{t()}finally{e.mutation&&e.mutation.takeRecords(),e.mutating=!1}}static#a(e,t){let i=window.requestIdleCallback?window.requestIdleCallback.bind(window):s=>setTimeout(s,0);t.flush_scheduled||(t.flush_scheduled=!0,i(()=>{t.flush_scheduled=!1,c.#u(t,()=>{for(let s of t.queue)s.parentNode&&(c.#t.has(s)||c.#t.set(s,s.nodeValue),s[c.#e]=!0,c.#p(s));t.queue.clear()})}))}static#g(e){let t={mutation:null,intersection:null,resize:null,mutating:!1,visible:!1,pending_resize:!1,flush_scheduled:!1,queue:new Set};c.#s.set(e,t),t.mutation=new MutationObserver(i=>{if(!t.mutating){for(let s of i){if(s.type==="characterData"){s.target.parentNode&&s.target.nodeValue&&s.target.nodeValue.trim()&&t.queue.add(s.target);continue}if(s.type==="childList"){for(let n of s.addedNodes)if(n.nodeType===Node.TEXT_NODE)n.nodeValue&&n.nodeValue.trim()&&t.queue.add(n);else if(n.nodeType===Node.ELEMENT_NODE){c.#i(n);for(let r of c.#r(n))t.queue.add(r)}}}t.visible&&t.queue.size&&c.#a(e,t)}}),t.mutation.observe(e,{subtree:!0,childList:!0,characterData:!0}),t.intersection=new IntersectionObserver(i=>{for(let s of i)t.visible=s.isIntersecting,s.isIntersecting&&(t.queue.size&&c.#a(e,t),t.pending_resize&&(t.pending_resize=!1,c.#u(t,()=>c.#f(e))))},{rootMargin:"200px"}),t.intersection.observe(e),t.resize=new ResizeObserver(()=>{if(!t.mutating){if(!t.visible){t.pending_resize=!0;return}c.#u(t,()=>c.#f(e))}}),t.resize.observe(e)}};var q=class c{static find=x;static formatSize(e){let t=["\u0411","\u041A\u0411","\u041C\u0411","\u0413\u0411","\u0422\u0411"],i=0;for(;e>=1024&&i<t.length-1;)e/=1024,i++;return e.toFixed(1)+" "+t[i]}constructor(e){e={target:null,input_name:null,entry:"*[file-item]",delete_name:null,before_init:()=>{},on_init:()=>{},before_files_add:()=>{},on_files_add:()=>{},before_file_delete:()=>{},on_file_delete:()=>{},before_drop:()=>{},on_drop:()=>{},handle_exception:null,...e,limits:{files:0,file_size:0,total_size:0,mimes:[],...e.limits??{}}};let t=e.input_name.replace(/\[\]$/,"");e.input_name=t+(e.limits.files!=1?"[]":""),e.delete_name=(e.delete_name?e.delete_name.replace(/\[\]$/,""):t+"_to_delete")+(e.limits.files!=1?"[]":""),document.querySelectorAll(e.target).forEach(i=>{if(x(i))throw new Error("Already inited");w(i,this);for(let[h,p]of Object.entries(e))typeof p=="function"&&(i[h]=p.bind(i));i.before_init(e);let s=(h,p,d=null)=>e.handle_exception?i.handle_exception(Object.assign(new Error(p),{file:h,code:d})):(alert(p),!1),n=()=>Object.assign(document.createElement("input"),{type:"file",name:e.input_name,multiple:e.limits.files!=1,hidden:!0}),r=i.querySelector("*[files-list]"),o=null;i.files=new Map,i.total_size=0;let l=h=>{let p=new DOMParser().parseFromString(o,"text/html").body.firstElementChild;h._id=crypto.randomUUID(),i.files.set(h._id,h),i.total_size+=h.size;let d=p.querySelectorAll("img[preview]"),g=p.querySelectorAll("*[filename]"),y=p.querySelectorAll("*[fileweight]"),_=p.querySelectorAll("*[delete-button]");if(h.type.startsWith("image/")){let b=new FileReader;b.onload=L=>d.forEach(A=>A.src=L.target.result),b.readAsDataURL(h)}else d.forEach(b=>b.remove());g.forEach(b=>b.textContent=h.name),y.forEach(b=>{b.textContent=c.formatSize(h.size),b.setAttribute("size",h.size)}),_.forEach(b=>b.addEventListener("click",()=>{i.before_file_delete(h)!==!1&&(i.total_size=Math.max(0,i.total_size-parseInt(h.size)),i.files.delete(h._id),p.remove(),i.on_file_delete(h))}));let m=n(),v=new DataTransfer;return v.items.add(h),m.files=v.files,p.appendChild(m),p},a=h=>{let p=h.querySelector(`input[name^="${t}"]`)??h.querySelector("input[type='hidden'][value]")??h.querySelector("input[value]"),d=h.querySelectorAll("*[delete-button]");if(p){let g=h.querySelector("img[preview]"),y=h.querySelector("*[filename]"),_=h.querySelector("*[fileweight]"),m={_id:crypto.randomUUID(),preview:g?.src||"",value:p.value,name:y?.textContent||"",size:parseFloat(_?.getAttribute("size")??_?.textContent??0)||0};i.files.set(m._id,m),d.forEach(v=>v.addEventListener("click",()=>{if(i.before_file_delete(m)===!1)return;let b=Object.assign(document.createElement("input"),{type:"hidden",name:e.delete_name,hidden:!0,value:p.value});i.appendChild(b),i.files.delete(m._id),i.on_file_delete(m),h.remove()})),p.remove()}else h.remove();return h},f=h=>{if(e.limits.files>0&&i.files.size>=e.limits.files)return s(h,`\u041C\u0430\u043A\u0441\u0438\u043C\u0443\u043C \u0444\u0430\u0439\u043B\u043E\u0432: ${e.limits.files}`,0);if(e.limits.file_size>0&&h.size>e.limits.file_size)return s(h,`\u0424\u0430\u0439\u043B "${h.name}" \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0439! \u041C\u0430\u043A\u0441\u0438\u043C\u0443\u043C ${c.formatSize(e.limits.file_size)}.`,1);if(e.limits.total_size>0&&i.total_size+h.size>e.limits.total_size)return s(h,`\u041F\u0440\u0435\u0432\u044B\u0448\u0435\u043D \u043E\u0431\u0449\u0438\u0439 \u043B\u0438\u043C\u0438\u0442! \u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0441\u0443\u043C\u043C\u0430 \u0432\u0441\u0435\u0445 \u0444\u0430\u0439\u043B\u043E\u0432 ${c.formatSize(e.limits.total_size)}.`,2);if(e.limits.mimes.length>0){let p=h.type.trim(),d=p.split(";")[0].trim().toLowerCase();for(let g of e.limits.mimes){if(g.endsWith("/*")&&!/[\\^$.*+?()[\]{}|]/.test(g.slice(0,-2))){if(d.startsWith(g.slice(0,-1).toLowerCase()))return!0;continue}if(/[\\^$.*+?()[\]{}|]/.test(g)){try{let y=new RegExp(g,"i");if(y.test(p)||y.test(d))return!0}catch{}continue}if(d===g.toLowerCase())return!0}return s(h,`\u0424\u0430\u0439\u043B "${h.name}" \u0438\u043C\u0435\u0435\u0442 \u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0439 \u0442\u0438\u043F: ${d}.`,3)}return!0},u=h=>{let p=Array.from(h);if(i.before_files_add(p),p=p.filter(f),p.length>0){let d=document.createDocumentFragment();p.forEach(g=>{d.appendChild(l(g))}),r.appendChild(d)}i.on_files_add(p)};try{let h=i.querySelectorAll(e.entry);h.length>0&&h.forEach(p=>{let d=a(p);o||(o=d.outerHTML)})}catch{o=e.entry}o=o.trim(),i.querySelectorAll("*[drop-zone]").forEach(h=>{let p=!1;["dragenter","dragover"].forEach(d=>h.addEventListener(d,g=>{g.preventDefault(),h.setAttribute("dragover",""),p||(i.before_drop(),p=!0)})),["dragleave","drop"].forEach(d=>h.addEventListener(d,g=>{g.preventDefault(),h.removeAttribute("dragover"),p=!1})),h.addEventListener("drop",d=>{d.preventDefault(),i.on_drop(),u(d.dataTransfer.files)})}),i.querySelectorAll("*[add-button]").forEach(h=>h.addEventListener("click",()=>{let p=n();p.addEventListener("change",()=>{u(p.files)}),document.body.appendChild(p),p.click()})),i.on_init(e)})}};var D=class{#e=null;#t=null;constructor(e){this.#e=function(t){(!e.validator||e.validator(t))&&(()=>{if(e.regexp){let i=new RegExp(e.regexp);return!e.attribute&&!e.property?i.test(t.value):e.attribute&&e.property?t.hasAttribute(e.attribute)&&i.test(t[e.property]):(e.attribute?i.test(t.getAttribute(e.attribute)):!0)&&(e.property?i.test(t[e.property]):!0)}else return e.attribute?t.hasAttribute(e.attribute):!0})()?e.on_valid(t):e.on_invalid(t),e.after_check&&e.after_check(t)},this.#t=e.selector,typeof e.onload=="function"?e.onload(this.#t):e.onload===!0&&this.apply(),document.querySelectorAll(this.#t).forEach(t=>{(e.events??["input","blur"]).forEach(i=>{t.addEventListener(i,()=>{this.#e(t)})})})}apply(e){document.querySelectorAll(e??this.#t).forEach(this.#e,this)}},J=D;return se(ne);})();
2
- if(typeof index!=="undefined"&&index&&index.default)globalThis.index=index.default;
@@ -1 +0,0 @@
1
- var u=class{#s="_";#l=!0;#e=[];#r=[];#i(e,t){let r="",l=0,s=0;for(let i of t)for(;s+l<e.length;){let[n,a,_]=e[s+l];if(!a)r+=n,l++;else{new RegExp(`^${n}$`).test(i)&&(r+=i,s++);break}}if(this.#s&&this.#l)for(;s+l<e.length;)r+=e[s+l++][1]?e[s+l-1][2]:e[s+l-1][0];else s?s+l<e.length&&!e[s+l][1]&&(r+=e[s+l++][0]):r="";return[r,s,e.filter(i=>i[1]).length==s]}#u(e){return this.#e.map(t=>this.#i(t,e)).reduce((t,r,l)=>!t||r[1]>t[0][1]?[r,l]:t,null)}#n(e){return e.replace(/{(\d+)\*{([^}]*?)}(.*?)}/g,(t,r,l,s)=>`{{${l}}${s}}`.repeat(r)).split(/({{.*?}.*?})/).filter(Boolean).map(t=>{let[,r]=t.match(/^{{(.*?)}.*?}$/)||[],[,l]=t.match(/^{{.*?}=(.*?)}$/)||[];return[r||t,!!r,l||this.#s]})}#t(e=null){if(this.#a()){console.warn("\u041F\u043E\u043F\u044B\u0442\u043A\u0430 \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u043C\u0430\u0441\u043A\u0443 \u043F\u043E\u0441\u043B\u0435 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F \u043F\u0440\u0430\u0432\u0438\u043B",this);return}(e?[e]:this.#r).forEach(t=>{t.best_mask=this.#u(t.value),t.input.value=t.best_mask[0][0],Object.assign(t.input.dataset,{mask_id:t.best_mask[1],progress:t.best_mask[0][1],is_full:t.best_mask[0][2]})})}#a(){return!this.#e.some(e=>!e!=null)}add_mask(e){return this.#e.push(this.#n(e)),this.#t(),this.#e.length-1}remove_mask(e){delete this.#e[e],this.#t()}set_masks(e){this.#e=e.map(t=>this.#n(t)),this.#t()}constructor(e){let t=this;t.#s=e.default_filler??t.#s,t.#l=e.placeholder??t.#l,(e.inputs?e.inputs instanceof Element?[e.inputs]:Array.from(e.inputs):Array.from(document.querySelectorAll(e.selector))).forEach(l=>{let s={input:l,value:l.value.split().filter(Boolean)};l.addEventListener("input",i=>{if(i.preventDefault(),this.#a()){console.error("\u041D\u0435\u0442 \u043C\u0430\u0441\u043E\u043A \u0434\u043B\u044F \u044D\u0442\u043E\u0433\u043E \u043F\u043E\u043B\u044F.",this);return}if(i.data===null){let n=[];for(let a of s.value)if(n.push(a),this.#i(this.#e[s.best_mask[1]],n)[1]==s.best_mask[0][1]){n.pop();break}s.value=n}else s.value.push(...i.data);t.#t(s),typeof e.on_input=="function"&&e.on_input(l,{mask_id:s.best_mask[1],progress:s.best_mask[0][1],is_full:s.best_mask[0][2]})}),t.#r.push(s),l.closest("form")?.addEventListener("reset",()=>{s.value=[],t.#t(s)})}),e.masks&&t.set_masks(e.masks)}};var f=u;export{f as default};
@@ -1,2 +0,0 @@
1
- var st_mask=(()=>{var h=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var d=(i,e)=>{for(var t in e)h(i,t,{get:e[t],enumerable:!0})},p=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of o(e))!c.call(i,s)&&s!==t&&h(i,s,{get:()=>e[s],enumerable:!(r=f(e,s))||r.enumerable});return i};var m=i=>p(h({},"__esModule",{value:!0}),i);var g={};d(g,{default:()=>k});var _=class{#s="_";#l=!0;#e=[];#r=[];#i(e,t){let r="",s=0,l=0;for(let n of t)for(;l+s<e.length;){let[a,u,v]=e[l+s];if(!u)r+=a,s++;else{new RegExp(`^${a}$`).test(n)&&(r+=n,l++);break}}if(this.#s&&this.#l)for(;l+s<e.length;)r+=e[l+s++][1]?e[l+s-1][2]:e[l+s-1][0];else l?l+s<e.length&&!e[l+s][1]&&(r+=e[l+s++][0]):r="";return[r,l,e.filter(n=>n[1]).length==l]}#u(e){return this.#e.map(t=>this.#i(t,e)).reduce((t,r,s)=>!t||r[1]>t[0][1]?[r,s]:t,null)}#n(e){return e.replace(/{(\d+)\*{([^}]*?)}(.*?)}/g,(t,r,s,l)=>`{{${s}}${l}}`.repeat(r)).split(/({{.*?}.*?})/).filter(Boolean).map(t=>{let[,r]=t.match(/^{{(.*?)}.*?}$/)||[],[,s]=t.match(/^{{.*?}=(.*?)}$/)||[];return[r||t,!!r,s||this.#s]})}#t(e=null){if(this.#a()){console.warn("\u041F\u043E\u043F\u044B\u0442\u043A\u0430 \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u043C\u0430\u0441\u043A\u0443 \u043F\u043E\u0441\u043B\u0435 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F \u043F\u0440\u0430\u0432\u0438\u043B",this);return}(e?[e]:this.#r).forEach(t=>{t.best_mask=this.#u(t.value),t.input.value=t.best_mask[0][0],Object.assign(t.input.dataset,{mask_id:t.best_mask[1],progress:t.best_mask[0][1],is_full:t.best_mask[0][2]})})}#a(){return!this.#e.some(e=>!e!=null)}add_mask(e){return this.#e.push(this.#n(e)),this.#t(),this.#e.length-1}remove_mask(e){delete this.#e[e],this.#t()}set_masks(e){this.#e=e.map(t=>this.#n(t)),this.#t()}constructor(e){let t=this;t.#s=e.default_filler??t.#s,t.#l=e.placeholder??t.#l,(e.inputs?e.inputs instanceof Element?[e.inputs]:Array.from(e.inputs):Array.from(document.querySelectorAll(e.selector))).forEach(s=>{let l={input:s,value:s.value.split().filter(Boolean)};s.addEventListener("input",n=>{if(n.preventDefault(),this.#a()){console.error("\u041D\u0435\u0442 \u043C\u0430\u0441\u043E\u043A \u0434\u043B\u044F \u044D\u0442\u043E\u0433\u043E \u043F\u043E\u043B\u044F.",this);return}if(n.data===null){let a=[];for(let u of l.value)if(a.push(u),this.#i(this.#e[l.best_mask[1]],a)[1]==l.best_mask[0][1]){a.pop();break}l.value=a}else l.value.push(...n.data);t.#t(l),typeof e.on_input=="function"&&e.on_input(s,{mask_id:l.best_mask[1],progress:l.best_mask[0][1],is_full:l.best_mask[0][2]})}),t.#r.push(l),s.closest("form")?.addEventListener("reset",()=>{l.value=[],t.#t(l)})}),e.masks&&t.set_masks(e.masks)}};var k=_;return m(g);})();
2
- if(typeof st_mask!=="undefined"&&st_mask&&st_mask.default)globalThis.st_mask=st_mask.default;