1var gt=Object.defineProperty;var yt=(e,s,t)=>s in e?gt(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t;var c=(e,s,t)=>yt(e,typeof s!="symbol"?s+"":s,t);import{F as y,N as bt,f as wt,S as St,E as $t,h as _t}from"./vendor.js";const Tt=()=>{try{y.bind("[data-fancybox]"),y.bind(".sv-editor img")}catch(e){console.error(e)}};class _{static get(s){const t=`${s}=`,i=document.cookie.split(";");for(let n=0;n<i.length;n++){let o=i[n];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return decodeURIComponent(o.substring(t.length,o.length))}return null}static set(s,t,i={}){let n=`${encodeURIComponent(s)}=${encodeURIComponent(t)}`;if(i.days){const o=new Date;o.setTime(o.getTime()+i.days*24*60*60*1e3),n+=`; expires=${o.toUTCString()}`}i.path&&(n+=`; path=${i.path}`),i.domain&&(n+=`; domain=${i.domain}`),i.secure&&(n+="; secure"),i.sameSite&&(n+=`; samesite=${i.sameSite}`),document.cookie=n}static remove(s,t,i){this.set(s,"",{days:-1,path:t,domain:i})}}const I=400,b=new WeakMap,G=e=>{const s=b.get(e);s&&(clearTimeout(s),b.delete(e))},D=(e,s=I,t)=>{G(e),e.style.boxSizing="border-box";const i=e.offsetHeight;e.style.willChange="height, margin, padding",e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=s+"ms",e.style.height=i+"px",e.offsetHeight,e.style.overflow="hidden",e.style.height="0",e.style.paddingTop="0",e.style.paddingBottom="0",e.style.marginTop="0",e.style.marginBottom="0";const n=window.setTimeout(()=>{e.style.display="none",e.style.removeProperty("height"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property"),e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom"),e.style.removeProperty("will-change"),b.delete(e),t==null||t()},s);b.set(e,n)},q=(e,s=I,t)=>{G(e),e.style.removeProperty("display");let i=window.getComputedStyle(e).display;i==="none"&&(i="block"),e.style.display=i;const n=e.offsetHeight;e.style.overflow="hidden",e.style.height="0",e.style.paddingTop="0",e.style.paddingBottom="0",e.style.marginTop="0",e.style.marginBottom="0",e.offsetHeight,e.style.boxSizing="border-box",e.style.willChange="height, margin, padding",e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=s+"ms",e.style.height=n+"px",e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom");const o=window.setTimeout(()=>{e.style.removeProperty("height"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property"),e.style.removeProperty("will-change"),b.delete(e),t==null||t()},s);b.set(e,o)},W=(e,s,t=I,i)=>{if(e==null)return;const n=window.getComputedStyle(e).display==="none";if(s===!0){if(!n)return;q(e,t,i)}else if(s===!1){if(n)return;D(e,t,i)}else n?q(e,t,i):D(e,t,i)},At=(e,s)=>` 2 <div class="sv-modal"> 3 <div class="f-button" data-fancybox-close> 4 <svg> 5 <path d="M19.286 4.714 4.714 19.286M4.714 4.714l14.572 14.572"></path> 6 </svg> 7 </div> 8 9 ${e?`<div class="sv-modal__title">${e}</div>`:""} 10 ${s?`<div class="sv-modal__text">${s}</div>`:""} 11 </div> 12`,w=e=>{const s=At(e.title,e.text);y.close(),y.show([{html:s,type:"html"}]),typeof e.closeAfter=="number"&&setTimeout(()=>y.close(),e.closeAfter)},Et=(e,s)=>{const i=Math.abs(e)%100,n=i%10;return i>=11&&i<=19?s.plural:n===1?s.nominative:n>=2&&n<=4?s.genitive:s.plural},Lt=(e,s,t)=>Et(e,s),A=async e=>new Promise(s=>setTimeout(s,e)),$=new WeakMap,xt=(e,s,t)=>{if(!s){console.warn("component registry: empty key â instance not registered",{$root:e,instance:t});return}let i=$.get(e);i||(i=new Map,$.set(e,i)),i.has(s)&&console.warn("component registry: overriding instance for key on root",{$root:e,key:s,previous:i.get(s),next:t}),i.set(s,t)},E=(e,s)=>{const t=$.get(e);return t?t.get(s)??null:null},It=(e,s)=>{const t=$.get(e);t&&(t.delete(s),t.size===0&&$.delete(e))};class m{constructor(s,t={}){c(this,"refs");c(this,"options");this.refs=s,this.options=t;const i=this.resolveComponentKey();xt(this.refs.$root,i,this)}destroyBase(){const s=this.resolveComponentKey();It(this.refs.$root,s)}resolveComponentKey(){const s=this.constructor;return typeof s.componentKey=="string"&&s.componentKey||typeof this.options.componentKey=="string"&&this.options.componentKey||(s.name??"Component")}}class j extends m{constructor(s){super(s),this.init()}init(){this.refs.$hamburger.addEventListener("click",()=>this.toggleDropdown()),this.refs.$searchTrigger.addEventListener("click",()=>this.toggleSearchFormVisibility(!0)),this.refs.$searchClose.addEventListener("click",()=>this.toggleSearchFormVisibility(!1)),this.refs.expandableItems.forEac
12h(s=>{if(s.$panel===null||s.$content===null){console.warn("mobile nav: incomplete refs for expandable item",s);return}s.$panel.addEventListener("click",()=>{this.toggleExpandableVisibility(s)})})}toggleDropdown(s){this.refs.$hamburger.classList.toggle("sv-mobile-nav__hamburger--active",s),this.refs.$dropdown.classList.toggle("sv-mobile-nav__dropdown--active",s)}toggleSearchFormVisibility(s){this.refs.$dropdown.scrollTo({left:0,top:0,behavior:"smooth"}),this.refs.$searchForm.classList.toggle("sv-mobile-nav__search--active",s),this.refs.$searchForm.addEventListener("transitionend",()=>{s?this.refs.$searchInput.focus():this.refs.$searchInput.blur()},{once:!0})}toggleExpandableVisibility(s){var t;(t=s.$arrow)==null||t.classList.toggle("sv-mobile-nav__arrow--active"),W(s.$content)}}c(j,"componentKey","mobile-nav");const Ct=()=>{try{const e=document.querySelector("div[data-sv-mobile-nav]");if(e===null)return;const s=e.querySelector("div[data-sv-mobile-nav-hamburger]"),t=e.querySelector("div[data-sv-mobile-nav-dropdown]"),i=e.querySelector("div[data-sv-mobile-nav-search-trigger]"),n=e.querySelector("form[data-sv-mobile-nav-search-form]"),o=e.querySelector("input[data-sv-mobile-nav-search-input]"),r=e.querySelector("button[data-sv-mobile-nav-search-close]"),a=e.querySelectorAll("div[data-sv-mobile-nav-expandable]"),l=Array.from(a).map(u=>({$root:u,$panel:u.querySelector("div[data-sv-mobile-nav-expandable-panel]"),$content:u.querySelector("div[data-sv-mobile-nav-expandable-content]"),$arrow:u.querySelector("div[data-sv-mobile-nav-expandable-arrow]")}));if(s===null||t===null||i===null||n===null||o===null||r===null){console.warn("mobile nav: incomplete refs",{$hamburger:s,$dropdown:t,$searchTrigger:i,$searchForm:n,$searchInput:o,$searchClose:r});return}const h={$root:e,$hamburger:s,$dropdown:t,$searchTrigger:i,$searchForm:n,$searchInput:o,$searchClose:r,expandableItems:l};new j(h)}catch(e){console.error(e)}};class K extends m{constructor(s){super(s),this.init()}get isSearchFormOpen(){return this.refs.$searchForm.classList.contains("sv-nav__search--active")}init(){this.refs.$searchTrigger.addEventListener("click",()=>this.toggleSearchFormVisibility()),document.addEventListener("click",s=>this.closeSearchFormOnOutsideClick(s)),document.addEventListener("keydown",s=>this.closeSearchFormOnEscPress(s))}closeSearchFormOnOutsideClick(s){if(!this.isSearchFormOpen)return;const t=s.target;if(!!t.closest("[data-sv-nav-search-trigger]"))return;!!t.closest("[data-sv-nav]")||this.toggleSearchFormVisibility(!1)}closeSearchFormOnEscPress(s){this.isSearchFormOpen&&s.key==="Escape"&&this.toggleSearchFormVisibility(!1)}toggleSearchFormVisibility(s){s===void 0&&(s=!this.isSearchFormOpen),this.refs.$searchForm.classList.toggle("sv-nav__search--active",s),this.refs.$searchTrigger.classList.toggle("sv-nav__action--active",s),this.refs.$searchForm.addEventListener("transitionend",()=>{s?this.refs.$searchInput.focus():this.refs.$searchInput.blur()},{once:!0})}}c(K,"componentKey","nav");const kt=()=>{try{const e=document.querySelector("nav[data-sv-nav]");if(e===null)return;const s=e.querySelector("div[data-sv-nav-search-trigger]"),t=e.querySelector("form[data-sv-nav-search-form]"),i=e.querySelector("input[data-sv-nav-search-input]");if(s===null||t===null||i===null){console.warn("nav: incomplete refs",{$searchTrigger:s,$searchForm:t,$searchInput:i});return}const n={$root:e,$searchTrigger:s,$searchForm:t,$searchInput:i};new K(n)}catch(e){console.error(e)}},Mt=768,O=15,F=30;class z extends m{constructor(t,i){super(t,i);c(this,"swiper",null);this.init()}get mobileGap(){return this.options.lessGap?O/2:O}get desktopGap(){return this.options.lessGap?F/2:F}get swiperOptions(){return{modules:[bt,wt],slidesPerView:"auto",freeMode:this.options.freeMode?{enabled:!0,sticky:!1,momentum:!1,momentumBounce:!1}:!1,watchSlidesProgress:!0,navigation:{prevEl:this.refs.arrows.$left,nextEl:this.refs.arrows.$right,disabledClass:this.options.arrowsDisabledClass??void 0},breakpoints:{0:{spaceBetween:this.mobileGap,slidesPerView:"auto"},[Mt]:{spaceBetween:this.desktopGap,...this.options.slidesDesktop?{slidesPerView:this.options.slidesDesktop}:{}}}}}ensureSwiper(){return this.swiper===null&&(this.swiper=new St(this.refs.$swiper,this.swiperOptions)),this.swiper}init(){this.ensureSwiper()}replaceSlides(t,i=0){const n=this.ensureSwiper(),o=n.wrapperEl;for(;o.firstChild;)o.removeChild(o.firstChild);const r=document.createDocumentFragment();
12for(const a of t){if(typeof a=="string"){const l=document.createElement("template");l.innerHTML=a.trim(),r.appendChild(l.content);return}r.appendChild(a)}if(o.appendChild(r),n.update(),i>=0&&!this.options.freeMode){const a=Math.max(0,n.slides.length-1);n.slideTo(Math.min(i,a),0)}}}c(z,"componentKey","slider");const Pt=e=>{const s=e.querySelector("div[data-sv-slider-swiper]");if(s===null){console.warn("slider: incomplete refs",{$root:e,$swiper:s});return}const t=e.getAttribute("data-sv-slider-name"),i=e.getAttribute("data-sv-slider-arrows-disabled-class"),n=e.hasAttribute("data-sv-slider-free-mode"),o=e.hasAttribute("data-sv-slider-less-gap"),r=isNaN(Number(e.getAttribute("data-sv-slider-slides-desktop")))?null:Number(e.getAttribute("data-sv-slider-slides-desktop"));if(t===null){console.warn("slider: incomplete options",e,{name:t});return}const a=document.querySelector(`div[data-sv-slider-arrow-left="${t}"]`),l=document.querySelector(`div[data-sv-slider-arrow-right="${t}"]`),u={$root:e,$swiper:s,arrows:{$left:a,$right:l}},p={name:t,arrowsDisabledClass:i,slidesDesktop:r,freeMode:n,lessGap:o};new z(u,p)},Dt=()=>{try{document.querySelectorAll("div[data-sv-slider]").forEach(s=>Pt(s))}catch(e){console.error(e)}};class Q extends m{constructor(t){super(t);c(this,"isTransitioning",!1);this.init()}init(){this.refs.items.forEach(t=>{if(t.$heading===null||t.$content===null){console.warn("accordion: incomplete refs for item",t);return}t.$heading.addEventListener("click",()=>this.handleItemClick(t))})}handleItemClick(t){this.isTransitioning||(this.hideAllItems(t),this.toggleItem(t))}hideAllItems(t){this.refs.items.forEach(i=>{i.$root.isEqualNode(t.$root)||this.toggleItem(i,!1)})}toggleItem(t,i){this.isTransitioning=!0,W(t.$content,i,void 0,()=>this.isTransitioning=!1),t.$root.classList.toggle("sv-accordion__item--active",i)}}c(Q,"componentKey","accordion");const qt=e=>{const s=e.querySelectorAll("div[data-sv-accordion-item]"),t=Array.from(s).map(n=>{const o=n.querySelector("div[data-sv-accordion-item-heading]"),r=n.querySelector("div[data-sv-accordion-item-content]");return{$root:n,$heading:o,$content:r}}),i={$root:e,items:t};new Q(i)},Ot=()=>{try{document.querySelectorAll("div[data-sv-accordion]").forEach(s=>qt(s))}catch(e){console.error(e)}};class Y extends m{constructor(s,t){super(s,t),this.init()}get body(){return new FormData(this.refs.$root)}init(){this.refs.$root.addEventListener("submit",async s=>{s.preventDefault(),await this.handleSubmit()})}setLoading(s){this.refs.$root.classList.toggle("sv-form--loading",s),this.refs.$submit.classList.toggle("sv-button--loading",s)}resetForm(){this.refs.$root.reset()}handleSuccess(s){this.resetForm(),w({title:s??"УÑпеÑно",text:"ÐÑо окно закÑоеÑÑÑ Ð°Ð²ÑомаÑиÑеÑки.",closeAfter:6e3})}handleError(s){w({title:"ÐÑибка",text:s??"ÐопÑобÑйÑе позже.",closeAfter:6e3})}async handleSubmit(){try{this.setLoading(!0);const t=await(await fetch(this.options.endpoint,{method:"POST",headers:{Accept:"application/json"},body:this.body})).json();t.status===200?this.handleSuccess(t.message):this.handleError(t.message)}catch(s){console.error(s),this.handleError()}finally{this.setLoading(!1)}}}c(Y,"componentKey","form");const Ft=e=>{const s=e.querySelector("button[data-sv-form-submit]");if(s===null){console.warn("form: incomplete refs",{$root:e,$submit:s});return}const t=e.getAttribute("data-sv-form-endpoint");if(t===null){console.warn("form: incomplete options",e,{endpoint:t});return}const i={$root:e,$submit:s},n={endpoint:t};new Y(i,n)},Bt=()=>{try{document.querySelectorAll("form[data-sv-form]").forEach(s=>Ft(s))}catch(e){console.error(e)}};class J extends m{constructor(s,t){super(s,t),this.init()}get $options(){return this.refs.$root.querySelectorAll("div[data-sv-tabs-option]")}get $contents(){return this.refs.$root.querySelectorAll("div[data-sv-tabs-content]")}init(){this.setActive(this.options.activeIndex),this.$options.forEach(s=>{s.addEventListener("click",()=>this.setActive(s))})}setActive(s){let t=typeof s=="number"?Array.from(this.$options)[s]?s:-1:Array.from(this.$options).indexOf(s);t===-1&&(console.warn(`tabs: no option found by index ${s}`,{$root:this.refs.$root},"fallback to",0),t=0),this.$options.forEach((i,n)=>{i.classList.toggle("sv-tabs__option--active",n===t)}
12),this.$contents.forEach((i,n)=>{i.classList.toggle("sv-tabs__content--active",n===t)})}}c(J,"componentKey","tabs");const Rt=e=>{const s={$root:e},i={activeIndex:Number.isNaN(e.getAttribute("data-sv-tabs-active-index"))?0:Number(e.getAttribute("data-sv-tabs-active-index"))};new J(s,i)},Ut=()=>{try{document.querySelectorAll("div[data-sv-tabs]").forEach(s=>Rt(s))}catch(e){console.error(e)}};class X extends m{constructor(t,i){super(t,i);c(this,"type","");c(this,"tags",new Set);c(this,"onUpdate",()=>{this.applyFilters()});c(this,"onTypeClick",t=>{const n=t.target.closest("div[data-sv-filter-tabs-type]");if(n!==null){const o=n.getAttribute("data-sv-filter-tabs-type")??"";this.setType(o)}});c(this,"onTagClick",t=>{const n=t.target.closest("div[data-sv-filter-tabs-tag]");if(n!==null){const o=n.getAttribute("data-sv-filter-tabs-tag");o&&this.toggleTag(o)}});this.init()}get $typeOptions(){return this.refs.$root.querySelectorAll("div[data-sv-filter-tabs-type]")}get $tagOptions(){return this.refs.$root.querySelectorAll("div[data-sv-filter-tabs-tag]")}get $items(){return this.refs.$root.querySelectorAll("[data-sv-filter-tabs-item]")}get $list(){return this.refs.$root.querySelector("[data-sv-load-more-list]")}get $empty(){return this.refs.$root.querySelector("[data-sv-filter-tabs-empty]")}parseIdList(t){return t?t.split(",").map(i=>i.trim()).filter(Boolean):[]}syncTypeUI(){const t=this.type;this.$typeOptions.forEach(i=>{const n=i.getAttribute("data-sv-filter-tabs-type")??"";i.classList.toggle("sv-filter-tabs__option--active",n===t)})}syncTagsUI(){this.$tagOptions.forEach(t=>{const i=t.getAttribute("data-sv-filter-tabs-tag")??"";t.classList.toggle("sv-filter-tabs__option--active",this.tags.has(i))})}updateEmptyState(t){var n;const i=this.$list;if(i)if(t===0){if(!this.$empty){const o=document.createElement("div");o.setAttribute("data-sv-filter-tabs-empty",""),o.className="sv-filter-tabs__empty",o.textContent=this.options.emptyText,i.insertAdjacentElement("afterend",o)}}else(n=this.$empty)==null||n.remove()}bootstrapFromDOM(){const i=Array.from(this.$typeOptions).find(n=>n.classList.contains("sv-filter-tabs__option--active"))??null??this.$typeOptions[0]??null;this.type=i?i.getAttribute("data-sv-filter-tabs-type")??"":"",this.tags=new Set(Array.from(this.$tagOptions).filter(n=>n.classList.contains("sv-filter-tabs__option--active")).map(n=>n.getAttribute("data-sv-filter-tabs-tag")??"").filter(Boolean))}applyOptionsPreset(){const t=Array.from(this.$typeOptions).map(r=>r.getAttribute("data-sv-filter-tabs-type")??""),i=this.options.activeId??null;if(i!==null)if(t.includes(i))this.type=i;else{const r=t[0]??"";console.warn("filter tabs: requested type not found, fallback to first",{$root:this.refs.$root,requested:i,fallback:r,available:t}),this.type=r}const n=Array.from(this.$tagOptions).map(r=>r.getAttribute("data-sv-filter-tabs-tag")??""),o=this.options.activeTags;if(Array.isArray(o)){const r=o.filter(l=>n.includes(l)),a=o.filter(l=>!n.includes(l));this.tags=new Set(r),a.length&&console.warn("filter tabs: some requested tags do not exist and were ignored",{$root:this.refs.$root,requested:o,invalid:a,available:n})}}init(){document.addEventListener("updateFilterTabs",this.onUpdate),document.addEventListener("click",this.onTypeClick),document.addEventListener("click",this.onTagClick),this.bootstrapFromDOM(),this.applyOptionsPreset(),this.syncTypeUI(),this.syncTagsUI(),this.applyFilters()}destroy(){var t;document.removeEventListener("updateFilterTabs",this.onUpdate),document.removeEventListener("click",this.onTypeClick),document.removeEventListener("click",this.onTagClick),this.type="",this.tags.clear(),(t=this.$empty)==null||t.remove(),this.destroyBase()}applyFilters(){const t=this.type,i=Array.from(this.tags),n=i.length>0;let o=0;this.$items.forEach(r=>{const a=r.getAttribute("data-sv-filter-tabs-item-type")??"",l=this.parseIdList(r.getAttribute("data-sv-filter-tabs-item-tags")),h=!t||a===t,u=!n||i.every(d=>l.includes(d)),p=h&&u;r.classList.toggle("sv-display-none",!p),p&&o++}),this.updateEmptyState(o)}setType(t){this.type=t,this.syncTypeUI(),this.applyFilters()}toggleTag(t){this.tags.has(t)?this.tags.delete(t):this.tags.add(t),this.syncTagsUI(),this.applyFilters()}}c(X,"componentKey","filter-tabs");const Nt=e=>(e??"").split(",").map(s=>
12s.trim()).filter(Boolean),Z=e=>{const s={$root:e},t=e.getAttribute("data-sv-filter-tabs-active-id"),n=new URLSearchParams(window.location.search).get("tags")??e.getAttribute("data-sv-filter-tabs-active-tags"),o=n?Nt(n):null,r=e.getAttribute("data-sv-filter-tabs-empty-text")??"Ðо вÑбÑаннÑм ÑилÑÑÑам ниÑего не найдено.",a={activeId:t,activeTags:o,emptyText:r};new X(s,a)},Ht=()=>{try{document.querySelectorAll("div[data-sv-filter-tabs]").forEach(s=>Z(s))}catch(e){console.error(e)}};class tt extends m{constructor(s){super(s),this.init()}get $loadMoreList(){const s=document.querySelector("[data-sv-load-more-list]");return s===null&&console.warn("load more: incomplete refs",this.refs.$loadMoreButton,{$loadMoreList:s}),s}init(){document.addEventListener("click",async s=>{this.refs.$loadMoreButton.isEqualNode(s.target)&&(s.preventDefault(),await this.loadMore())})}setLoading(s){this.refs.$loadMoreButton.classList.toggle("sv-button--loading",s)}async getNextPageHtml(){const s=await fetch(this.refs.$loadMoreButton.href);if(!s.ok)throw new Error(`HTTP status: ${s.status}`);return s.text()}getRefsFromHtml(s){const i=new DOMParser().parseFromString(s,"text/html"),n=i.querySelectorAll("[data-sv-load-more-item]"),o=i.querySelector("[data-sv-load-more-button]");return{$items:n,$loadMoreButton:o}}injectItems(s){s.forEach(t=>{var i;(i=this.$loadMoreList)==null||i.appendChild(t)})}injectLoadMoreButton(s){!!s?this.refs.$loadMoreButton.href=s.href:this.refs.$loadMoreButton.classList.add("sv-display-none")}updateFilterTabsIfNeeded(){var t;!!((t=this.$loadMoreList)!=null&&t.closest("[data-sv-filter-tabs]"))&&document.dispatchEvent(new CustomEvent("updateFilterTabs"))}async loadMore(){try{this.setLoading(!0);const s=await this.getNextPageHtml(),{$items:t,$loadMoreButton:i}=this.getRefsFromHtml(s);this.injectItems(t),this.injectLoadMoreButton(i),this.updateFilterTabsIfNeeded(),document.dispatchEvent(new Event("sv:bvi-content-updated"))}catch(s){console.error(s),w({title:"ÐÑибка",text:"Ðе ÑдалоÑÑ Ð¿Ð¾Ð´Ð³ÑÑзиÑÑ ÑлеменÑÑ. ÐопÑобÑйÑе позже.",closeAfter:6e3})}finally{this.setLoading(!1)}}}c(tt,"componentKey","load-more");const Vt=()=>{try{const e=document.body,s=document.querySelector("a[data-sv-load-more-button]");if(s===null)return;const t={$root:e,$loadMoreButton:s};new tt(t)}catch(e){console.error(e)}},T="places-ids",Gt="/images/icons/add-icon.svg",Wt="/images/icons/added-icon.svg";class et extends m{constructor(s,t){super(s,t),this.init()}get domPlacesIds(){return Array.from(this.refs.$places).map(s=>s.getAttribute("data-sv-routes-place-id")).filter(s=>typeof s=="string")}getPlacesIds(){const s=_.get(T);if(s===null)return[];try{const t=JSON.parse(s);return Array.isArray(t)?this.domPlacesIds.filter(i=>t.includes(i)):(console.warn("routes: saved places ids must be array",{idsArrayCandidate:t},"fallback to",[]),[])}catch{return console.warn("routes: couldn't parse saved places ids due to incorrect value",{ids:s},"fallback to",[]),[]}}savePlaceId(s){if(!this.domPlacesIds.includes(s)){console.warn("routes: couldn't save place id - it's not on the list",this.refs.$root,{id:s,domPlacesOds:this.domPlacesIds});return}const t=[...new Set([...this.getPlacesIds(),s])],i=JSON.stringify(t);_.set(T,i,{days:1,path:"/"})}clearPlaceId(s){const t=this.getPlacesIds().filter(n=>n!==s),i=JSON.stringify(t);_.set(T,i,{days:1,path:"/"})}clearPlacesIds(){_.remove(T,"/")}updatePlacesUI(s){this.refs.$places.forEach(t=>{const i=t.getAttribute("data-sv-routes-place-id");if(i===null){console.warn("routes: id attribute is missing on routes place while updating ui",this.refs.$root,{$routesPlace:t});return}const n=s.includes(i),o=t.classList.contains("sv-button"),r=t.querySelector("img"),a=t.querySelector("[data-sv-routes-place-text]");o&&t.classList.toggle("sv-button--theme--primary-darker",n),r!==null&&(r.src=n?Wt:Gt),a!==null&&(a.textContent=n?this.options.addedText:this.options.addText)})}updatePopupUI(s){const t=s.length,i=Lt(t,{nominative:this.options.placeNominative,genitive:this.options.placeGenitive,plural:this.options.placePlural});this.refs.$selectedNumber.textContent=`${t} ${i}`,this.refs.$popup.classList.toggle("sv-routes-popup--active",!!t)}
12init(){this.updateUI(),document.addEventListener("click",s=>{const i=s.target.closest("[data-sv-routes-place]");i!==null&&(s.preventDefault(),this.togglePlace(i))}),this.refs.$clearButton.addEventListener("click",()=>this.clearPlaces()),this.refs.$submitButton.addEventListener("click",()=>this.redirectToRoute())}updateUI(){const s=this.getPlacesIds();this.updatePlacesUI(s),this.updatePopupUI(s)}togglePlace(s){const t=typeof s=="string"?s:s.getAttribute("data-sv-routes-place-id")??"";if(t===""){console.warn("routes: id attribute is missing on routes place",this.refs.$root,{$routesPlace:s});return}this.getPlacesIds().includes(t)?this.clearPlaceId(t):this.savePlaceId(t),this.updateUI()}clearPlaces(){this.clearPlacesIds(),this.updateUI()}redirectToRoute(){const s=this.getPlacesIds(),t=`${this.options.redirect}?ids=${s.join(",")}`;window.open(t,"_self")}}c(et,"componentKey","routes");const jt=()=>{try{const e=document.querySelector("div[data-sv-routes]");if(e===null)return;const s=e.querySelector("div[data-sv-routes-popup]"),t=e.querySelector("span[data-sv-routes-selected-number]"),i=e.querySelector("div[data-sv-routes-clear]"),n=e.querySelector("div[data-sv-routes-submit]"),o=e.querySelectorAll("[data-sv-routes-place]");if(s===null||t===null||i===null||n===null||o.length===0){console.warn("routes: incomplete refs",{$root:e,$popup:s,$selectedNumber:t,$clearButton:i,$submitButton:n,$places:o});return}const r={$root:e,$popup:s,$selectedNumber:t,$clearButton:i,$submitButton:n,$places:o},a=e.getAttribute("data-sv-routes-redirect"),l=e.getAttribute("data-sv-routes-add-text"),h=e.getAttribute("data-sv-routes-added-text"),u=e.getAttribute("data-sv-routes-place-nominative"),p=e.getAttribute("data-sv-routes-place-genitive"),d=e.getAttribute("data-sv-routes-place-plural");if(a===null||l===null||h===null||u===null||p===null||d===null){console.warn("routes: incomplete options",e,{redirect:a,addText:l,addedText:h,placeNominative:u,placeGenitive:p,placePlural:d});return}const v={redirect:a,addText:l,addedText:h,placeNominative:u,placeGenitive:p,placePlural:d};new et(r,v)}catch(e){console.error(e)}},st=841.89,L=595.28,B=10,S=10,R=st-2*S,Kt=async e=>{var t;if(document.documentElement.classList.add("sv-print-mode"),await new Promise(i=>requestAnimationFrame(()=>requestAnimationFrame(i))),(t=document.fonts)!=null&&t.ready)try{await document.fonts.ready}catch{}const s=e.querySelectorAll("img");await Promise.all(Array.from(s).map(i=>i.complete?Promise.resolve():new Promise(n=>{i.onload=()=>n(),i.onerror=()=>n()})))},zt=async e=>{await Kt(e);const s=new $t("p","pt","a4"),t=await _t(e,{allowTaint:!0,useCORS:!0,scrollX:0,scrollY:0,windowWidth:document.documentElement.scrollWidth,windowHeight:document.documentElement.scrollHeight,scale:Math.min(2,window.devicePixelRatio||1)}),i=t.width,n=t.height,o=L-2*B,r=o/i*n,a=t.toDataURL("image/jpeg",.95),l=Math.ceil(r/R);for(let h=0;h<l;h++){const u=S-h*R;s.addImage(a,"JPEG",B,u,o,r),s.setFillColor(255,255,255),s.rect(0,0,L,S,"F"),s.rect(0,st-S,L,S,"F"),h<l-1&&s.addPage()}return document.documentElement.classList.remove("sv-print-mode"),s},Qt=e=>{e.save("custom-route.pdf");const s=e.output("blob");window.open(URL.createObjectURL(s))},Yt=e=>{const s=e.getAttribute("data-sv-printable-button");if(s===null){console.warn("printable: id for printable element is missing",e);return}const t=document.querySelector(`[data-sv-printable-element="${s}"]`);if(t===null){console.warn(`printable: element for id "${s}" is missing`,e);return}const i=document.querySelectorAll(`[data-sv-printable-to-show="${s}"]`),n=r=>e.classList.toggle("sv-button--loading",r),o=r=>i.forEach(a=>a.classList.toggle("sv-display-none",!r));e.addEventListener("click",async r=>{r.preventDefault(),n(!0),o(!0),requestAnimationFrame(async()=>{await Jt(t),o(!1),n(!1)})})},Jt=async e=>new Promise(async s=>{const t=await zt(e);Qt(t),s()}),Xt=()=>{try{document.querySelectorAll("[data-sv-printable-button]").forEach(s=>Yt(s))}catch(e){console.error(e)}},Zt=1,U="Ðе вÑбÑано",te=(e,s)=>{const t=Math.max(0,...e,0);return Math.max(t+s,s)},ee=(e,s)=>{const t=Math.max(document.documentElement.clientWidth,window.innerWidth||0),i=Math.max(document.documentElement.clientHeight,window.innerHeight||0),n=te(s,e);return{vw:t,vh:i,safeTop:n}},se=(e,s,t)=>{const i=Math.max(0,s-t*2);return Math.min(e,i)},ie=(e,s,t,i)=>{let n=e;return n=Math.min(n,t-i-s),n=Math.max(n,i),n},ne=(e,s,t,i,n)=>
12{const o=Math.max(0,s-t-(e.bottom+i)),r=Math.max(0,e.top-i-n);return{spaceDown:o,spaceUp:r}},oe=(e,s,t)=>{const i=e<=s,n=e<=t;return i&&!n?!0:!i&&n?!1:i&&n?!0:s>=t},re=(e,s,t,i,n,o,r)=>{let a=e?Math.min(s,t):Math.min(s,i);return Math.max(0,Math.min(a,n-o-r))+Zt},ae=(e,s,t,i,n,o,r)=>{let a=e?s.bottom+t:s.top-t-i;return a<n&&(a=n),a+i>o-r&&(a=Math.max(n,o-r-i)),a};class it extends m{constructor(t,i){super(t,i);c(this,"isOpen",!1);c(this,"wasOpenDown",null);c(this,"isFlipAnimating",!1);c(this,"resizeHandler",()=>this.reposition());c(this,"scrollHandler",()=>this.reposition());c(this,"clickOutsideHandler",t=>this.onDocumentClick(t));c(this,"escHandler",t=>t.key==="Escape"&&this.close());this.init()}getActiveOption(){return Array.from(this.refs.$options).find(t=>t.classList.contains("sv-dropdown__option--active"))??null}updateSelectedTitleFromOption(t){var n;const i=((n=t==null?void 0:t.textContent)==null?void 0:n.trim())??"";this.refs.$title.textContent=i!==""?i:U}clearActiveOption(){this.refs.$options.forEach(t=>t.classList.remove("sv-dropdown__option--active"))}setActiveOption(t,i=!0,n=!1){this.clearActiveOption(),t!==null?(t.classList.add("sv-dropdown__option--active"),this.updateSelectedTitleFromOption(t)):this.updateSelectedTitleFromOption(null),n||this.emitChange(t),i&&this.close()}emitChange(t){var o;const i=t?Array.from(this.refs.$options).indexOf(t):-1,n=((o=t==null?void 0:t.textContent)==null?void 0:o.trim())??"";this.refs.$root.dispatchEvent(new CustomEvent("dropdownChange",{detail:{index:i,text:n}}))}bindOption(t){t.addEventListener("click",()=>this.setActiveOption(t))}bindAllOptions(){this.refs.$options.forEach(t=>this.bindOption(t))}setListVisible(t){this.refs.$list.classList.toggle("sv-dropdown__list--active",t)}onDocumentClick(t){const i=t.target,n=this.refs.$selected.contains(i),o=this.refs.$list.contains(i);!n&&!o&&this.close()}ensureTeleportedToBody(){document.body.isEqualNode(this.refs.$list.parentNode)||document.body.appendChild(this.refs.$list)}getStickyBottoms(){return Array.from(document.querySelectorAll("[data-sv-dropdown-sticky-element]")).map(t=>t.getBoundingClientRect().bottom)}getViewportBox(){return ee(this.options.viewportGap,this.getStickyBottoms())}measureList(){this.refs.$list.classList.add("sv-dropdown__list--active");const t=this.refs.$list.style.maxHeight,i=this.refs.$list.style.height;this.refs.$list.style.maxHeight="none",this.refs.$list.style.height="auto";const n=this.refs.$list.offsetWidth,o=Math.max(this.refs.$list.scrollHeight,this.refs.$list.offsetHeight);return this.refs.$list.style.maxHeight=t,this.refs.$list.style.height=i,{width:n,height:o}}applyPosition(t,i,n,o){this.isFlipAnimating,o?(this.refs.$list.classList.remove("sv-dropdown__list--flip-animation"),this.refs.$list.offsetWidth,this.refs.$list.classList.add("sv-dropdown__list--flip-animation"),this.isFlipAnimating=!0,this.refs.$list.addEventListener("transitionend",()=>{this.refs.$list.classList.remove("sv-dropdown__list--flip-animation"),this.isFlipAnimating=!1},{once:!0})):this.isFlipAnimating||this.refs.$list.classList.remove("sv-dropdown__list--flip-animation"),this.refs.$list.style.maxHeight=`${Math.round(n)}px`,this.refs.$list.style.translate=`${Math.round(t)}px ${Math.round(i)}px`}reposition(){if(!this.isOpen)return;this.ensureTeleportedToBody();const{vw:t,vh:i,safeTop:n}=this.getViewportBox(),o=this.refs.$selected.getBoundingClientRect(),{width:r,height:a}=this.measureList(),l=se(r,t,this.options.viewportGap),h=ie(o.left,l,t,this.options.viewportGap),{spaceDown:u,spaceUp:p}=ne(o,i,this.options.viewportGap,this.options.gap,n),d=oe(a,u,p),v=re(d,a,u,p,i,n,this.options.viewportGap),f=ae(d,o,this.options.gap,v,n,i,this.options.viewportGap),g=this.wasOpenDown!==null&&this.wasOpenDown!==d;this.applyPosition(h,f,v,g),this.wasOpenDown=d}init(){this.ensureTeleportedToBody(),this.refs.$selected.addEventListener("click",()=>this.toggle()),this.bindAllOptions(),this.updateSelectedTitleFromOption(this.getActiveOption()),this.setListVisible(!1)}open(){this.isOpen||(this.isOpen=!0,this.setListVisible(!0),this.wasOpenDown=null,this.reposition(),this.refs.$root.classList.add("sv-dropdown--active"),window.addEventListener("resize",this.resizeHandler,{passive:!0}),window.addEventListener("scroll",this.scrollHandler,{passive:!0}),document.addEventListener("click",this.clickOutsideHandler,!0),document.addEventListener("keydown",this.escHandler))}close(){this.isOpen&&(this.isOpen=!1,this.setListVisible(!1),this.refs.$root.classList.remove("sv-dropdown--active"),this.refs.$list.classList.remove("sv-dropdown__list--flip-animation"),this.isFlipAnimating=!1,window.removeEventListener("resize",this.resizeHandler),window.removeEventListener("scroll",this.scrollHandler),document.removeEventListener("click",this.clickOutsideHandler,!0),document.removeEventListener("keydown",this.escHandler))}toggle(){this.isOpen?this.close():this.open()}replaceOptions(t){const i=(this.refs.$title.textContent??"").trim();for(;this.refs.$list.firstChild;)this.refs.$list.removeChild(this.refs.$list.firstChild);const n=document.createDocumentFragment();let o=!1;t.forEach(({text:a,active:l=!1})=>{const h=document.createElement("div");h.textContent=a,h.className="sv-dropdown__option",h.setAttribute("data-sv-dropdown-option",""),l&&!o&&(h.classList.add("sv-dropdown__option--active"),o=!0),this.bindOption(h),n.appendChild(h)}),this.refs.$list.appendChild(n),this.refs.$options=this.refs.$list.querySelectorAll("[data-sv-dropdown-option]");const r=this.getActiveOption();r!==null?this.updateSelectedTitleFromOption(r):i!==""&&i!==U?this.refs.$title.textContent=i:this.updateSelectedTitleFromOption(null),this.isOpen&&(this.refs.$list.style.maxHeight="none",this.reposition())}setActiveByIndex(t,i=!1,n=!1){const o=Array.from(this.refs.$options),r=t>=0&&t<o.length?o[t]:null;this.setActiveOption(r,i,n)}}c(it,"componentKey","dropdown");const le=e=>{const s=e.querySelector("div[data-sv-dropdown-selected]"),t=e.querySelector("div[data-sv-dropdown-list]"),i=e.querySelector("div[data-sv-dropdown-title]"),n=e.querySelector("svg[data-sv-dropdown-icon]"),o=e.querySelectorAll("[data-sv-dropdown-option]");if(s===null||t===null||i===null||n===null){console.warn("dropdown: incomplete refs",{$root:e,$selected:s,$list:t,$title:i,$icon:n});return}const r={$root:e,$selected:s,$title:i,$icon:n,$list:t,$options:o},a=Number(e.getAttribute("data-sv-dropdown-gap")??0),l=Number(e.getAttribute("data-sv-dropdown-viewport-gap")??0),h={gap:isNaN(a)?0:a,viewportGap:isNaN(l)?0:l};new it(r,h)},ce=()=>{try{document.querySelectorAll("[data-sv-dropdown]").forEach(s=>le(s))}catch(e){console.error(e)}},de=new Map([["playbill","/api/playbill-info"],["excursion","/api/excursion-info"]]),he=(e,s)=>{const t=de.get(e);if(!t)throw new Error(`entity info: no endpoint found for "${e}" entity`);return`${t}/${s}/`},ue=e=>` 13 <div id="entity-modal" class="sv-modal"> 14 <div class="f-button" data-fancybox-close> 15 <svg> 16 <path d="M19.286 4.714 4.714 19.286M4.714 4.714l14.572 14.572"></path> 17 </svg> 18 </div> 19 20 <div class="sv-modal__content"> 21 <div class="sv-entity-info"> 22 ${e!=null&&e.tags?` 23 <div class="sv-entity-info__tags"> 24 ${e.tags.map(s=>`<div class="sv-entity-info__tag">${s}</div>`).join("")} 25 </div> 26 `:""} 27 28 <div class="sv-entity-info__title">${(e==null?void 0:e.title)??""}</div> 29 30 <div class="sv-editor sv-entity-info__address">${(e==null?void 0:e.address)??""}</div> 31 <div class="sv-editor sv-entity-info__description">${(e==null?void 0:e.descriptionEditor)??""}</div> 32 <img class="sv-entity-info__img ${e!=null&&e.meta?"":"sv-entity-info__compensate-gap"}" src="${(e==null?void 0:e.img)??""}" alt=""> 33 34 <div class="sv-editor sv-entity-info__meta"> 35 ${e!=null&&e.meta?e.meta.map((s,t)=>{var n;const i=(n=e==null?void 0:e.meta)!=null&&n.length?t===e.meta.length-1:!1;return` 36 <b>${s.title}</b><br> 37 <p>${s.value}</p>${i?"":"<br><br>"} 38 `}).join(""):""} 39 </div> 40 41 ${e!=null&&e.url?`<a href="${e.url}" target="_blank" class="sv-button sv-button--theme--text sv-entity-info__link">ÐеÑейÑи на ÑайÑ</a>`:""} 42 </div> 43 </div> 44 </div> 45 `;class nt extends m{constructor(t){super(t);
45c(this,"cachedQueries",new Map);this.init()}setItemLoading(t,i){t.classList.toggle("sv-loading",i)}getCachedQuery(t,i){return this.cachedQueries.get(`${t}-${i}`)??null}setCachedQuery(t,i,n){this.cachedQueries.set(`${t}-${i}`,n)}async handleItemClick(t){const i=t.getAttribute("data-sv-entity-info-item-id"),n=t.getAttribute("data-sv-entity-info-item-entity");if(!i||!n){w({title:"ÐÑибка",text:"Ðе ÑдалоÑÑ Ð¿Ð¾Ð»ÑÑиÑÑ Ð¸Ð½ÑоÑмаÑиÑ.<br>ÐопÑобÑйÑе позже.",closeAfter:6e3}),console.warn("entity info: incomplete item options",t,{id:i,entity:n});return}try{this.setItemLoading(t,!0),await A(250);const o=await this.getData(i,n);this.openModal(ue(o)),await A(250)}catch(o){console.error(o),w({title:"ÐÑибка",text:"Ðе ÑдалоÑÑ Ð¿Ð¾Ð»ÑÑиÑÑ Ð¸Ð½ÑоÑмаÑиÑ.<br>ÐопÑобÑйÑе позже.",closeAfter:6e3});return}finally{this.setItemLoading(t,!1)}}getData(t,i){const n=this.getCachedQuery(t,i);return n||this.fetchData(t,i)}async fetchData(t,i){const n=he(i,t),r=await(await fetch(n,{method:"GET",headers:{"Content-Type":"multipart/form-data",Accept:"application/json"}})).json();if((r==null?void 0:r.data)==null)throw new Error(`entity info: data property missing after fetch with id "${t}"`);return this.setCachedQuery(t,i,r.data),r.data}openModal(t){y.show([{html:t,type:"html"}])}init(){document.addEventListener("click",async t=>{const i=t.target;if(i.closest(".bvi-speech-link"))return;const n=i.closest("[data-sv-entity-info-item]");n!==null&&(t.preventDefault(),await this.handleItemClick(n))})}}c(nt,"componentKey","entity-info");const pe=()=>{try{const s={$root:document.body};new nt(s)}catch(e){console.error(e)}},N=e=>`?PAGEN_1=${e}`,ve=(e,s)=>{const t=d=>{const[v,f,g]=d.split("-").map(Number);return new Date(Date.UTC(v,f-1,g))},i=d=>{const v=d.getUTCFullYear(),f=String(d.getUTCMonth()+1).padStart(2,"0"),g=String(d.getUTCDate()).padStart(2,"0");return`${v}-${f}-${g}`},n=d=>{const v=d.getUTCFullYear(),f=String(d.getUTCMonth()+1).padStart(2,"0");return`${v}-${f}`},o=d=>{const f=["ÑнваÑÑ","ÑевÑалÑ","маÑÑ","апÑелÑ","май","иÑнÑ","иÑлÑ","авгÑÑÑ","ÑенÑÑбÑÑ","окÑÑбÑÑ","ноÑбÑÑ","декабÑÑ"][d.getUTCMonth()];return f.charAt(0).toUpperCase()+f.slice(1)+` ${d.getUTCFullYear()}`},r=d=>["вÑ","пн","вÑ","ÑÑ","ÑÑ","пÑ","Ñб"][d.getUTCDay()],a=d=>{const v=d.getUTCDay();return v===0||v===6},l=t(e),h=t(s);if(l>h)return[];const u=[];let p=new Date(l.getTime());for(;p.getTime()<=h.getTime();){const d=n(p);let v=u.find(f=>f.value===d)??null;v||(v={title:o(p),value:d,days:[]},u.push(v)),v.days.push({title:String(p.getUTCDate()).padStart(2,"0"),dow:r(p),isWeekend:a(p),isActive:!1,value:i(p)}),p.setUTCDate(p.getUTCDate()+1)}return u},fe=e=>{const s=document.createElement("div");s.className="swiper-slide sv-slider__slide sv-slider__slide--true-auto",s.setAttribute("data-sv-playbill-month",e.value);const t=document.createElement("div");t.className="sv-inline-calendar";const i=document.createElement("div");i.className="sv-inline-calendar__month",i.textContent=e.title;const n=document.createElement("div");return n.className="sv-inline-calendar__list",e.days.forEach(o=>{const r=document.createElement("div");r.className="sv-inline-calendar__item"+(o.isWeekend?" sv-inline-calendar__item--weekend":"")+(o.isActive?" sv-inline-calendar__item--active":""),r.setAttribute("data-sv-inline-day",o.value);const a=document.createElement("div");a.className="sv-inline-calendar__number",a.textContent=o.title;const l=document.createElement("span");l.className="sv-inline-calendar__dow",l.textContent=o.dow,r.appendChild(a),r.appendChild(l),n.appendChild(r)}),t.appendChild(i),t.appendChild(n),s.appendChild(t),s},x=(e,s)=>{const t=e.slice(0,7);return s.findIndex(i=>i.value===t)},H=(e,s)=>{var n,o,r,a;const t=((o=(n=s[0])==null?void 0:n.days[0])==null?void 0:o.value)??e,i=((a=(r=s[s.length-1])==null?void 0:r.days.slice(-1)[0])==null?void 0:a.value)??e;return e<t?t:e>i?i:e};class ot extends m{constructor(t){super(t);c(this,"sliderInstance",null);c(this,"dropdownInstance",null);c(this,"filterTabsInstance",null);c(this,"months",[]);c(this,"defaultStartValue","");c(this,"selectedStart","");c(this,"selectedEnd",null);this.init()}setRootLoading(t){this.refs.$root.classList.toggle("sv-loading",t)}setFilterTabsLoading(t){this.refs.$filterTabs!==null&&(this.refs.$filterTabs.classList.toggle("sv-loading",t),this.refs.$filterTabs.classList.toggle("sv-loading--top",t))}readRangeFromUrl(){const t=new URL(window.location.href),i=t.searchParams.get("startDate"),n=t.searchParams.get("endDate");return{start:i&&i.trim()!==""?i:null,end:n&&n.trim()!==""?n:null}}writeRangeToUrl(t,i){const n=new URL(window.location.href);n.searchParams.set("startDate",t),i?n.searchParams.set("endDate",i):n.searchParams.delete("endDate"),window.history.replaceState(null,"",n)}normalizeRange(t,i){const n=H(t??"",this.months)||this.defaultStartValue;let o=i?H(i,this.months):null;return o===""&&(o=null),o&&o<n?{start:o,end:n}:{start:n,end:o}}async setRange(t,i,n=!0){this.selectedStart=t,this.selectedEnd=i,n&&(this.writeRangeToUrl(this.selectedStart,this.selectedEnd),await this.reinitFilterTabs())}fillDropdown(){if(this.dropdownInstance===null)return;const t=x(this.selectedStart,this.months),i=this.months.map((n,o)=>({text:n.title,active:o===t}));this.dropdownInstance.replaceOptions(i),this.dropdownInstance.setActiveByIndex(t,!1)}
45fillSlider(){if(this.sliderInstance===null)return;const t=this.months.map(n=>fe({title:n.title,value:n.value,days:n.days.map(o=>({title:o.title,dow:o.dow,isWeekend:o.isWeekend,isActive:!1,value:o.value}))})),i=Math.max(x(this.selectedStart,this.months),0);this.sliderInstance.replaceSlides(t,i)}applyRangeUI(){const t=this.selectedStart,i=this.selectedEnd;this.refs.$slider.querySelectorAll("[data-sv-inline-day]").forEach(o=>{const r=o.getAttribute("data-sv-inline-day")??"",a=r===t,l=i!==null&&r===i,h=i!==null&&r>t&&r<i;o.classList.toggle("sv-inline-calendar__item--active-start",a),o.classList.toggle("sv-inline-calendar__item--active-end",l),o.classList.toggle("sv-inline-calendar__item--in-range",h),o.classList.toggle("sv-inline-calendar__item--active",a||l)})}ensureSelectedVisible(){var i;const t=(i=this.sliderInstance)==null?void 0:i.swiper;if(t){t.update();const n=x(this.selectedStart,this.months);n>=0&&this.centerMonthByIndex(n,0)}}centerMonthByIndex(t,i=0){var C,k,M,P;const n=(C=this.sliderInstance)==null?void 0:C.swiper;if(!n)return;const o=Math.max(0,n.slides.length-1),r=Math.min(Math.max(t,0),o);n.update();const a=n.slidesGrid,l=n.slidesSizesGrid,h=n.width,u=a[r]??0,p=l[r]??((k=n.slides[r])==null?void 0:k.offsetWidth)??0;let d=u-(h-p)/2;const v=Math.max(0,n.virtualSize-h);d=Math.min(Math.max(d,0),v);const g=(n.rtlTranslate?1:-1)*d;(M=n.setTransition)==null||M.call(n,i),(P=n.setTranslate)==null||P.call(n,g),n.updateProgress(),n.updateSlidesClasses(),n.setTranslate||n.slideTo(r,i)}bindLoadMoreClicks(){document.addEventListener("click",t=>{const n=t.target.closest("a[data-sv-playbill-calendar-load-more]"),o=new URLSearchParams(window.location.search),r=o.get("startDate"),a=o.get("endDate");let l="";r&&(l+=`&startDate=${encodeURIComponent(r)}`),a&&(l+=`&endDate=${encodeURIComponent(a)}`),n!==null&&(n.href+=l)},{capture:!0})}bindDayClicks(){this.refs.$slider.addEventListener("click",async t=>{const i=t.target.closest("[data-sv-inline-day]");if(i===null)return;const n=i.getAttribute("data-sv-inline-day")??"";if(n!==""){if(this.selectedEnd!==null){await this.setRange(n,null),this.applyRangeUI();return}if(n===this.selectedStart){await this.setRange(this.defaultStartValue,null),this.applyRangeUI();return}n<this.selectedStart?await this.setRange(n,this.selectedStart):await this.setRange(this.selectedStart,n),this.applyRangeUI()}})}bindDropdownSync(){this.dropdownInstance!==null&&this.refs.$dropdown.addEventListener("dropdownChange",t=>{var o,r,a;const n=((o=t.detail)==null?void 0:o.index)??-1;n<0||(a=(r=this.sliderInstance)==null?void 0:r.swiper)==null||a.slideTo(n,900)})}bindSliderSync(){var i;const t=(i=this.sliderInstance)==null?void 0:i.swiper;t&&t.on("activeIndexChange",()=>{var o;const n=t.activeIndex??0;(o=this.dropdownInstance)==null||o.setActiveByIndex(n,!1,!0)})}async fetchAvailableDates(){var n,o;const i=await(await fetch("/api/playbill-calendar/",{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}})).json();if(((n=i==null?void 0:i.data)==null?void 0:n.startDate)==null||((o=i==null?void 0:i.data)==null?void 0:o.endDate)==null)throw new Error("playbill calendar: startDate or endDate missing in fetched data");return i.data}async fetchPageHtml(){const t=await fetch(window.location.href);if(!t.ok)throw new Error(`HTTP status: ${t.status}`);return t.text()}getFilterTabsFromPageHtml(t){const n=new DOMParser().parseFromString(t,"text/html"),o=n.querySelector("div[data-sv-playbill-calendar-filter-tabs]"),r=n.querySelector("a[data-sv-playbill-calendar-load-more]");if(o===null)throw new Error("playbill calendar: filter tabs not found on fetched page");return{$filterTabs:o,$loadMore:r}}handleLoadMore(t){const i=!!t;if(!this.refs.$loadMore){this.refs.$loadMoreParent.insertAdjacentHTML("afterbegin",` 46 <a class="sv-button sv-button--theme--text" 47 data-sv-playbill-calendar-load-more 48 data-sv-button-loading-text="ÐодгÑÑжаем..." 49 data-sv-load-more-button href="?PAGEN_1=${N(2)}" 50 > 51 ÐоказаÑÑ ÐµÑе 52 </a> 53 `);const n=document.querySelector("a[data-sv-playbill-calendar-load-more]");
53n&&(this.refs.$loadMore=n)}this.refs.$loadMore!==null&&(this.refs.$loadMore.href=N(2),this.refs.$loadMore.classList.toggle("sv-display-none",!i))}async reinitFilterTabs(){try{if(this.refs.$filterTabs===null||this.filterTabsInstance===null)return;this.setFilterTabsLoading(!0),await A(250);const t=await this.fetchPageHtml(),{$filterTabs:i,$loadMore:n}=this.getFilterTabsFromPageHtml(t);this.filterTabsInstance.destroy(),this.refs.$filterTabs.replaceWith(i),this.refs.$filterTabs=i,this.handleLoadMore(n),Z(this.refs.$filterTabs),document.dispatchEvent(new Event("sv:bvi-content-updated"))}catch(t){console.error(t),w({title:"ÐÑибка",text:"Ðе ÑдалоÑÑ Ð·Ð°Ð³ÑÑзиÑÑ ÑлеменÑÑ.<br>ÐопÑобÑйÑе позже.",closeAfter:6e3})}finally{this.setFilterTabsLoading(!1)}}async init(){if(this.sliderInstance=E(this.refs.$slider,"slider"),this.dropdownInstance=E(this.refs.$dropdown,"dropdown"),this.filterTabsInstance=this.refs.$filterTabs?E(this.refs.$filterTabs,"filter-tabs"):null,this.sliderInstance===null||this.dropdownInstance===null){console.warn("playbill calendar: inner slider and dropdown instances required for initialization",this.refs.$root,{sliderInstance:this.sliderInstance,dropdownInstance:this.dropdownInstance});return}try{this.setRootLoading(!0),await A(250);const t=await this.fetchAvailableDates();if((t==null?void 0:t.startDate)!=null&&(t==null?void 0:t.endDate)!=null){this.months=ve(t.startDate,t.endDate),this.defaultStartValue=t.startDate;const i=this.readRangeFromUrl(),n=this.normalizeRange(i.start,i.end);await this.setRange(n.start,n.end,!0),this.bindLoadMoreClicks(),this.bindDayClicks(),this.bindDropdownSync(),this.bindSliderSync(),this.fillDropdown(),this.fillSlider(),this.applyRangeUI(),requestAnimationFrame(()=>{this.ensureSelectedVisible(),this.setRootLoading(!1)})}}catch(t){console.error(t)}}}c(ot,"componentKey","playbill-calendar");const me=()=>{try{const e=document.querySelector("div[data-sv-playbill-calendar]");if(e===null)return;const s=e.querySelector("div[data-sv-playbill-calendar-dropdown]"),t=e.querySelector("div[data-sv-playbill-calendar-slider]"),i=document.querySelector("div[data-sv-playbill-calendar-filter-tabs]"),n=document.querySelector("a[data-sv-playbill-calendar-load-more]"),o=document.querySelector("div[data-sv-playbill-calendar-load-more-parent]");if(s===null||t===null||o===null){console.warn("playbill calendar: incomplete refs",{$root:e,$dropdown:s,$slider:t,$loadMoreParent:o});return}const r={$root:e,$dropdown:s,$slider:t,$filterTabs:i,$loadMore:n,$loadMoreParent:o};new ot(r)}catch(e){console.error(e)}},ge=()=>document.body.classList.contains("bvi-active"),rt=()=>Array.from(document.querySelectorAll(".bvi-body")).find(e=>!e.matches(".fancybox__container")),ye=e=>{e.querySelectorAll("img:not(.bvi-no-style)").forEach(s=>{s.classList.add("bvi-img")}),e.querySelectorAll("*:not(.bvi-no-style)").forEach(s=>{const t=getComputedStyle(s);t.backgroundImage!=="none"&&t.background!=="none"&&s.classList.add("bvi-background-image")})},at=(e,s)=>{const t=rt();if(!t||!ge())return;const i=e.querySelector(".sv-modal__content")??e.querySelector(".fancybox__content")??e.querySelector(".fancybox__slide");if(!i)return;i.classList.add("bvi-body"),Array.from(t.attributes).filter(o=>o.name.startsWith("data-bvi-")).forEach(o=>i.setAttribute(o.name,o.value)),ye(i);let n=!1;i.querySelectorAll([".sv-entity-info__title",".sv-entity-info__address",".sv-entity-info__description",".sv-entity-info__meta",".sv-modal__title",".sv-modal__text"].join(", ")).forEac
53h(o=>{var r;!((r=o.textContent)!=null&&r.trim())||o.classList.contains("bvi-speech")||(o.classList.add("bvi-speech"),n=!0)}),n&&(s==null||s())},be=e=>{document.querySelectorAll(".fancybox__container").forEach(s=>at(s,e))},we=e=>{new MutationObserver(t=>{const i=rt();for(const n of t){if(n.type==="attributes"&&(n.target===document.body||n.target===i)){be(e);continue}n.type==="childList"&&n.addedNodes.forEach(o=>{if(!(o instanceof HTMLElement))return;const r=o.matches(".fancybox__container")?o:o.closest(".fancybox__container");r&&at(r,e)})}}).observe(document.body,{attributes:!0,childList:!0,subtree:!0})},lt="sv-bvi-voice",Se=()=>{const e=navigator.userAgent||"",s=navigator.vendor||"";return/Chrome|CriOS/.test(e)&&!/Edg|OPR|SamsungBrowser|YaBrowser/.test(e)||s==="Google Inc."},ct=()=>window.speechSynthesis.getVoices().filter(e=>e.lang.toLowerCase().startsWith("ru")),dt=()=>{try{return window.localStorage.getItem(lt)||"auto"}catch{return"auto"}},$e=e=>{try{window.localStorage.setItem(lt,e)}catch{}},_e=e=>Se()?e.find(s=>s.name==="Google ÑÑÑÑкий")??e.find(s=>
53/Google/i.test(s.name))??e[0]:e.find(s=>/Ðилена|Milena/i.test(s.name))??e[0],Te=()=>{const e=ct(),s=dt();if(s!=="auto"){const t=e.find(i=>i.voiceURI===s);if(t)return t}return _e(e)},ht=()=>{if(!document.body.classList.contains("bvi-active"))return;const e=document.querySelector(".bvi-panel");if(!e)return;let s=e.querySelector("#sv-bvi-voice-select");if(!s){const o=document.createElement("div");o.className="bvi-block sv-bvi-voice";const r=document.createElement("label");r.className="bvi-block-title",r.htmlFor="sv-bvi-voice-select",r.textContent="ÐÐ¾Ð»Ð¾Ñ Ð¾Ð·Ð²ÑÑки",s=document.createElement("select"),s.id="sv-bvi-voice-select",s.className="sv-bvi-voice__select",s.setAttribute("aria-label","ÐÐ¾Ð»Ð¾Ñ Ð¾Ð·Ð²ÑÑки"),s.addEventListener("change",()=>{$e((s==null?void 0:s.value)||"auto"),window.speechSynthesis.cancel()}),o.append(r,s),(e.querySelector(".bvi-blocks.bvi-block-left")||e).append(o)}const t=dt(),i=ct();s.replaceChildren();const n=new Option("ÐвÑо","auto");s.append(n),i.forEach(o=>s==null?void 0:s.append(new Option(o.name,o.voiceURI))),s.value=i.some(o=>o.voiceURI===t)?t:"auto",s.disabled=i.length===0},Ae=()=>{"speechSynthesis"in window&&window.speechSynthesis.addEventListener("voiceschanged",ht)},ut=e=>e.replace(/\\(["\\/])/g,"$1").replace(/[âââ]/g,"«").replace(/â/g,"»").replace(/\\[nrt]/g," "),pt={0:"нолÑ",1:"один",2:"два",3:"ÑÑи",4:"ÑеÑÑÑе",5:"пÑÑÑ",6:"ÑеÑÑÑ",7:"ÑемÑ",8:"воÑемÑ",9:"девÑÑÑ"},Ee=e=>e.replace(/\((\d{3,5})\)/g,(s,t)=>`(${[...t].map(i=>pt[i]).join(" ")})`),Le=e=>e.replace(/(^|[\s,;])обл\.(?=[\s,;]|$)/gi,"$1облаÑÑÑ").replace(/(^|[\s,;])доп\.?\s*ÑелеÑон(?=[\s:]|$)/gi,"$1дополниÑелÑнÑй ÑелеÑон").replace(/(^|[\s,;])(?:доб|доп)\.?\s*(?:номеÑ\s*)?(\d[\d\s-]*)/gi,(s,t,i)=>`${t}добавоÑнÑй Ð½Ð¾Ð¼ÐµÑ ${[...i.replace(/\D/g,"")].map(n=>pt[n]).join(" ")}`),vt=e=>Ee(Le(ut(e))).replace(/\\/g,"").replace(/["«»]/g,"").replace(/\b(\d{4})\s*г\.(?=\s|$)/g,"$1 года").replace(/\s+/g," ").trim(),xe={"ÐклÑÑиÑÑ Ð²ÐµÑÑÐ¸Ñ ÑайÑа Ð´Ð»Ñ ÑлабовидÑÑиÑ
":"ÐклÑÑиÑÑ Ð²ÐµÑÑÐ¸Ñ ÑайÑа Ð´Ð»Ñ Ñлабо виÌдÑÑиÑ
лÑдей","вклÑÑиÑÑ Ð²ÐµÑÑÐ¸Ñ ÑайÑа Ð´Ð»Ñ ÑлабовидÑÑиÑ
":"вклÑÑиÑÑ Ð²ÐµÑÑÐ¸Ñ ÑайÑа Ð´Ð»Ñ Ñлабо виÌдÑÑиÑ
лÑдей","веÑÑÐ¸Ñ Ð´Ð»Ñ ÑлабовидÑÑиÑ
":"веÑÑÐ¸Ñ Ð´Ð»Ñ Ñлабо виÌдÑÑиÑ
лÑдей","ÐеÑÑÐ¸Ñ Ð´Ð»Ñ ÑлабовидÑÑиÑ
":"ÐеÑÑÐ¸Ñ Ð´Ð»Ñ Ñлабо виÌдÑÑиÑ
лÑдей","ÐеÑÑÐ¸Ñ ÑайÑа Ð´Ð»Ñ ÑлабовиÌдÑÑий":"ÐеÑÑÐ¸Ñ ÑайÑа Ð´Ð»Ñ Ñлабо виÌдÑÑиÑ
лÑдей","одним из лÑÑÑиÑ
оÑганов":"одним из лÑÑÑиÑ
оÌÑганов",РаÑÑен:"РаÑÑеÌн",ÑаÑÑен:"ÑаÑÑеÌн",ФÑолов:"ФÑолоÌв",ÑÑолов:"ÑÑолоÌв","ÐеÑе ÐолÑвиÑ":"ÐеÌÑе ÐÑлÑвиÑ","ÐеÑе ÐÑлÑвиÑ":"ÐеÌÑе ÐÑлÑвиÑ","1467â1645":"Ñ ÑÑÑÑÑа ÑеÑÑÑеÑÑа ÑеÑÑÑдеÑÑÑ ÑедÑмого по ÑÑÑÑÑа ÑеÑÑÑÑÐ¾Ñ ÑоÑок пÑÑÑй год","1467â1645":"Ñ ÑÑÑÑÑа ÑеÑÑÑеÑÑа ÑеÑÑÑдеÑÑÑ ÑедÑмого по ÑÑÑÑÑа ÑеÑÑÑÑÐ¾Ñ ÑоÑок пÑÑÑй год","1467-1645":"Ñ ÑÑÑÑÑа ÑеÑÑÑеÑÑа ÑеÑÑÑдеÑÑÑ ÑедÑмого по ÑÑÑÑÑа ÑеÑÑÑÑÐ¾Ñ ÑоÑок пÑÑÑй год"},ft=e=>Object.entries(xe).reduce((s,[t,i])=>s.replaceAll(t,i),e),Ie=(e,s=120)=>{const t=ft(vt(e)).split(" "),i=[];let n="";return t.forEach(o=>{if(!o)return;const r=n?`${n} ${o}`:o;if(r.length<=s){n=r;return}n&&i.push(n),n=o}),n&&i.push(n),i},mt=e=>{const s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let t;for(;t=s.nextNode();)t.textContent=ut(t.textContent||"")},Ce=()=>{if(!("speechSynthesis"in window))return;const e=window.speechSynthesis,s=e.speak.bind(e);e.speak=t=>{t.text=ft(vt(t.text)),s(t)}},ke=e=>{var t;if(!((t=e.textContent)!=null&&t.trim())||e.matches("[data-bvi-speech-exclude], .bvi-speech, .bvi-speech *")||e.closest("[data-bvi-speech-exclude], .bvi-speech")||e.querySelector(".bvi-speech"))return;const s=e.matches(".sv-info-card__body, .sv-common-info__editor");if(!(!s&&e.querySelector("h1, h2, h3, h4, h5, h6, p, li, blockquote, td, th"))&&!(!s&&e.matches("div")&&Array.from(e.children).some(i=>!i.matches("a, abbr, b, br, em, i, img, mark, s, small, span, strong, svg, u")))){if(mt(e),e.matches("h1, h2, h3, h4, h5, h6, a.sv-button, a.sv-common-info__link")){const i=document.createElement("div");i.classList.add("bvi-speech"),e.before(i),i.append(e);return}e.classList.add("bvi-speech")}},Me=()=>
53{document.querySelectorAll(".sv-editor").forEach(e=>{if(e.closest(".sv-common-info__item"))return;let s=[],t=null,i=0;const n=()=>{if(!t||!s.some(r=>{var a;return(a=r.textContent)==null?void 0:a.trim()})){s=[],t=null;return}const o=document.createElement("div");o.classList.add("bvi-speech"),t.before(o),s.forEach(r=>o.append(r)),mt(o),s=[],t=null};Array.from(e.childNodes).forEach(o=>{if(o instanceof HTMLBRElement){i+=1;return}if(!(o.nodeType===Node.TEXT_NODE||o instanceof HTMLElement&&o.matches("a, abbr, b, em, i, mark, s, small, span, strong, u"))){n(),i=0;return}i>1&&n(),i&&s.length&&s.push(document.createTextNode(" ")),t||(t=o),s.push(o),i=0}),n()})},Pe=()=>{document.querySelectorAll(".sv-info-card__links, .sv-info-card__buttons").forEach(e=>e.setAttribute("data-bvi-speech-exclude","")),document.querySelectorAll([".sv-main .sv-info-card__body, .sv-main .sv-common-info__editor",".sv-first-screen__text",".sv-first-screen__editor",".sv-section__text",".sv-main .sv-socials",'.sv-main [class*="__title"]','.sv-main [class*="__heading"]','.sv-main [class*="__description"]','.sv-main [class*="__text"]',".sv-main h1, .sv-main h2, .sv-main h3, .sv-main h4, .sv-main h5, .sv-main h6",".sv-main p, .sv-main li, .sv-main blockquote, .sv-main td, .sv-main th",".sv-main a.sv-button, .sv-main a.sv-common-info__link, .sv-main .sv-docs__item a"].join(", ")).forEac
53h(ke)},De=()=>{Me(),Pe()},qe=(e,s)=>{if(!(s!=null&&s.querySelector("[data-bvi-speech-exclude]")))return e;const t=s.cloneNode(!0);return t.querySelectorAll("[data-bvi-speech-exclude]").forEach(i=>i.remove()),t.textContent||""},Oe=e=>{!e||!("speechSynthesis"in window)||(e._speech=(s,t)=>{const i=window.speechSynthesis;i.cancel(),Ie(qe(s,t)).forEach(n=>{const o=new SpeechSynthesisUtterance(n);o.lang="ru-RU";const r=Te();r&&(o.voice=r),i.speak(o)})})},Fe=()=>{document.querySelectorAll(".bvi-open").forEach(e=>e.setAttribute("aria-label","ÐклÑÑиÑÑ Ð²ÐµÑÑÐ¸Ñ ÑайÑа Ð´Ð»Ñ ÑлабовидÑÑиÑ
лÑдей"))},V=()=>{var i;Tt(),Ct(),kt(),Dt(),Ot(),Bt(),Ut(),Ht(),Vt(),jt(),Xt(),ce(),pe(),me(),Fe(),Ce(),Ae();const e=(i=window.isvek)==null?void 0:i.Bvi,s=e?new e({lang:"ru-RU"}):void 0;Oe(s);const t=()=>{var n;document.body.classList.contains("bvi-active")&&(De(),ht(),(n=s==null?void 0:s._speechPlayer)==null||n.call(s))};t(),document.querySelectorAll(".bvi-open").forEach(n=>{n.addEventListener("click",()=>requestAnimationFrame(t))}),document.addEventListener("sv:bvi-content-updated",t),we(t)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",V,{once:!0}):V();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.