1(()=>{function Z(a,r){return["style_1","style_2","style_3","style_4","style_5","style_6","style_7","style_8"].includes(a)?r!=null&&r[a]?r[a].value:null:a}var f=a=>String(a!=null?a:"").trim();function ce(a){let r=f(a.coordinates).split(",").map(f);if(r.length!==2||!r.every(s=>/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/.test(s)))return null;let[e,o]=r.map(Number);return Math.abs(o)<=180&&Math.abs(e)<=90?[o,e]:null}function ee(a){if(!(a!=null&&a.path)||!a.filename||a.type==="video")return"";let r=`${a.path}158x158/${a.filename}`;try{let e=new URL(r,window.location.href);return["http:","https:"].includes(e.protocol)?e.href:""}catch(e){return""}}function te(a,r,e,o){var c,p,k,b;let l=r.filter(C=>{var A;return(A=a.category_ids)==null?void 0:A.includes(C.id)})[0],m=f(a.phone).replace(/[^\d+]/g,"");return{source:a,id:e,name:f(a.name)||o,address:f(a.address),description:f(a.description),phone:f(a.phone),workingHours:f(a.working_hours),coordinates:ce(a),color:f(l==null?void 0:l.color)||"#404040",markerImage:ee(l==null?void 0:l.image),image:ee(a.list_image),isGalleryIcon:/^\/icons\//.test((c=a.list_image)==null?void 0:c.path),phoneUrl:/^\+?\d+$/.test(m)?`tel:${m}`:"",directions:((p=a.directions)!=null?p:[]).filter(C=>["metro","stop"].includes(C.type)&&f(C.name)).map(C=>({type:C.type,name:f(C.name),walking_distance:f(C.walking_distance)})),yandexUrl:(k=a.yandex_organization_url)!=null?k:"",dgisUrl:(b=a.dgis_organization_url)!=null?b:""}}function ae(a,r,e){let o=f(r).toLocaleLowerCase();return a.filter(s=>{var l;return(e===null||((l=s.source.category_ids)==null?void 0:l.includes(e)))&&[f(s.source.name),s.address].some(m=>m.toLocaleLowerCase().includes(o))})}function ne(a,r){if(!r)return!0;if(!a.coordinates)return!1;let[[e,o],[s,l]]=r,[m,c]=a.coordinates,p=k=>(k%360+360)%360;return c>=l&&c<=o&&(s-e>=360||p(m-e)<=p(s-e))}function re(a){let r=document.createElement("template");r.innerHTML=a;for(let e of[...r.content.querySelectorAll("*")]){if(!["P","DIV","BR","B","STRONG","I","EM","DEL","S","UL","OL","LI","A","SPAN"].includes(e.tagName)){e.remove();continue}let o=e.getAttribute("href"),s=e.style.color,l=e.style.backgroundColor,m=e.style.padding;for(let c of[...e.attributes])e.removeAttribute(c.name);e.tagName==="A"&&o&&/^(https?:|mailto:|tel:|\/|#)/i.test(o.trim())&&e.setAttribute("href",o),e.style.color=s,e.style.backgroundColor=l,e.style.padding=m}return r.content}var V;function oe(a,r){return V||(V=(window.ymaps3?Promise.resolve():new Promise((o,s)=>{let l=document.createElement("script");l.src=`https://api-maps.yandex.ru/v3/?apikey=${encodeURIComponent(a)}&lang=${encodeURIComponent(r)}`,l.onload=o,l.onerror=()=>s(new Error("Yandex Maps SDK could not load")),document.head.append(l)})).then(async()=>{let o=window.ymaps3;await o.ready;let s=await o.import("@yandex/[email protected]");return{sdk:o,...s}})),V}var R=class{constructor(r,e,o,s,l,m){this.api=e,this.symbol=o,this.clusterLabel=s,this.onSelect=l,this.map=new e.sdk.YMap(r,{location:{center:[0,0],zoom:1},zoomRounding:"snap"});try{this.map.addChild(new e.sdk.YMapDefaultSchemeLayer),this.map.addChild(new e.sdk.YMapDefaultFeaturesLayer),this.clusterer=new e.YMapClusterer({method:e.clusterByGrid({gridSize:64}),features:[],marker:p=>this.marker(p.properties.point),cluster:(p,k)=>{let b=document.createElement("button");return b.type="button",b.className="map-01__cluster",b.textContent=k.length,b.setAttribute("aria-label",`${this.clusterLabel}: ${k.length}`),b.onclick=()=>this.zoom(1,p),new e.sdk.YMapMarker({coordinates:p},b)}}),this.map.addChild(this.clusterer);let c=({mapInAction:p})=>{p||m(this.map.bounds)};this.listener=new e.sdk.YMapListener({onUpdate:c,onResize:c}),this.map.addChild(this.listener)}catch(c){throw this.map.destroy(),c}this.hasFitted=!1,this.selectedMarker=null}marker(r,e=!1){let o=document.createElement("button");if(o.type="button",o.className=`map-01__marker${e?" map-01__marker--selected":""}`,o.style.backgroundColor=r.color,o.setAttribute("aria-label",r.name),o.append(this.symbol.cloneNode(!0)),r.markerImage){let s=document.createElement("img");s.alt="",s.src=r.markerImage,s.onload=()=>{o.firstElementChild.style.display="none"},s.onerror=()=>s.remove(),o.append(s)}return o.onclick=()=>this.onSelect(r.source),new this.api.sdk.YMapMarker({coordinates:r.coordinates,zIndex:e?2e3:1e3},o)}update(r,e,o=0){let s=r.filter(m=>m.coordinates);this.selectedMarker&&this.map.removeChild(this.selectedMarker),this.selectedMarker=null,this.map.removeChild(this.clusterer),this.clusterer.update({features:s.filter(m=>m.source!==e).map(m=>({type:"Feature",id:String(m.id),geometry:{type:"Point",coordinates:m.coordinates},properties:{point:m}}))}),this.map.addChild(this.clusterer);let l=s.find(m=>m.source===e);l&&(this.selectedMarker=this.marker(l,!0),this.map.addChild(this.selectedMarker)),this.hasFitted||this.fit(s,o,0)}fit(r,e=0,o=500){let s=r.filter(c=>c.coordinates).map(c=>c.coordinates);if(!s.length)return;let l=[0,1].map(c=>Math.min(...s.map(p=>p[c]))),m=[0,1].map(c=>Math.max(...s.map(p=>p[c])));
1this.map.setMargin([28,28,28+e,28]),this.map.setLocation({...l.every((c,p)=>c===m[p])?{center:l,zoom:Math.max(this.map.zoomRange.min,Math.min(this.map.zoomRange.max,14))}:{bounds:[l,m]},duration:o,easing:"ease-in-out"}),this.hasFitted=!0}center(r){if(!r)return;let{min:e,max:o}=this.map.zoomRange;this.map.setMargin([0,0,0,0]),this.map.setLocation({center:r,zoom:Math.max(e,Math.min(o,Math.max(16,this.map.zoom))),duration:500,easing:"ease-in-out"})}zoom(r,e=this.map.center){let{min:o,max:s}=this.map.zoomRange;this.map.setLocation({center:e,zoom:Math.max(o,Math.min(s,this.map.zoom+r))})}destroy(){this.map.removeChild(this.listener),this.map.destroy()}};var Y=new WeakMap;function se(a,r){if(Y.has(a))return Y.get(a);let e=t=>a.querySelector(t),o=e(".map-01__runtime"),s=e(".map-01__panel"),l=e("[data-map-search]"),m=e(".map-01__directions"),c=e("[data-map-handle]"),p=e("[data-map-categories]"),k=e("[data-map-points]"),b=e("[data-map-point-template]"),C=e("[data-map-direction-template]"),A=window.matchMedia("(max-width: 767px)"),H=new AbortController,q=r.labels,i={query:"",categoryId:null,selected:null,panel:"partial",providers:!1},g={content:{},design:{},colors:{},...r},v=[],P=[],z=[],W,d,w=!1,I=!1,h,B=!1,M,_=(t,n)=>{e(t).hidden=!n},E=(t,n)=>{e(t).textContent=n},U=t=>{var n;return(n=e(t))==null?void 0:n.focus({preventScroll:!0})},L=(t,n,u,y={})=>t.addEventListener(n,u,{...y,signal:H.signal}),D=()=>w&&i.panel==="partial"?s.getBoundingClientRect().height:0,F=()=>{o.classList.toggle("map-01--mobile",w),o.inert=g.editing===!0,s.classList.toggle("map-01__panel--expanded",i.panel==="expanded"),s.classList.toggle("map-01__panel--hidden",w&&i.panel==="hidden"),s.inert=w&&i.panel==="hidden",_("[data-map-show]",w&&i.panel==="hidden");let t=g.design.show_route_button===!0&&!!(d!=null&&d.yandexUrl||d!=null&&d.dgisUrl);_(".map-01__footer",t),_('[data-map-action="route"]',!i.providers),_("[data-map-providers]",i.providers)},J=()=>{let t=z.filter(n=>ne(n,W)).map(n=>{let u=b.content.firstElementChild.cloneNode(!0);u.dataset.mapPoint=n.id,u.querySelector(".map-01__point-title").textContent=n.name,u.querySelector(".map-01__address").textContent=n.address;let y=u.querySelector("img");return n.image?(y.src=n.image,y.parentElement.classList.add("map-01__image--custom"),y.parentElement.classList.toggle("map-01__image--icon",n.isGalleryIcon)):y.remove(),u});k.replaceChildren(...t),_(".map-01__empty",t.length===0),E(".map-01__empty",P.length?q.no_results:q.empty),_('[data-map-action="clear"]',i.query!=="")},le=()=>{if(_(".map-01__list-view",!d),_(".map-01__card",!!d),!d)return;E(".map-01__card-title",d.name),E(".map-01__card-address",d.address);for(let n of["description","workingHours"]){let u=re(d[n]);_(`[data-map-${n}]`,!!f(u.textContent)),e(`[data-map-${n}]`).replaceChildren(u)}_(".map-01__contact",!!d.phone);let t=e("[data-map-phone-link]");t.textContent=d.phone,t.hidden=!d.phoneUrl,d.phoneUrl?t.setAttribute("href",d.phoneUrl):t.removeAttribute("href"),E("[data-map-phone-text]",d.phone),_("[data-map-phone-text]",!d.phoneUrl),m.hidden=d.directions.length===0,e("[data-map-directions]").replaceChildren(...d.directions.map(n=>{let u=C.content.firstElementChild.cloneNode(!0);for(let y of["metro","stop"])u.querySelector(`[data-map-transport="${y}"]`).toggleAttribute("hidden",n.type!==y);return u.querySelector("[data-map-transport-label]").textContent=q[n.type],u.querySelector("[data-map-direction-name]").textContent=n.name,u.querySelector(".map-01__walk").hidden=!n.walking_distance,u.querySelector("[data-map-distance]").textContent=n.walking_distance,u}));for(let n of["dgis","yandex"]){let u=e(`[data-map-provider="${n}"]`),y=d[`${n}Url`];u.hidden=!y,y?u.setAttribute("href",y):u.removeAttribute("href")}},S=()=>{z=ae(P,i.query,i.categoryId),d=z.find(t=>t.source===i.selected),d||(i.selected=null,i.providers=!1);for(let t of p.querySelectorAll("button")){let n=(t.dataset.mapCategory==="all"?null:v[Number(t.dataset.mapCategory)].id)===i.categoryId;t.classList.toggle("is-active",n),t.setAttribute("aria-pressed",String(n))}J(),le(),F(),h==null||h.update(z,i.selected,D())},K=t=>{B=!0,i.selected=t,i.providers=!1,w&&(i.panel="expanded"),S(),h==null||h.center(d==null?void 0:d.coordinates),U("[data-map-back]")},T=t=>{i.panel=t,t!=="expanded"&&(i.selected=null),S(),U(t==="hidden"?"[data-map-show]":d?"[data-map-back]":g.design.show_search?"[data-map-search]":".map-01__results")},de={back:()=>{let t=d.id;
1i.selected=null,S(),U(`[data-map-point="${t}"]`)},clear:()=>{i.query="",l.value="",S(),U("[data-map-search]")},route:()=>{i.providers=!0,F()},show:()=>T("partial"),"zoom-in":()=>h==null?void 0:h.zoom(1),"zoom-out":()=>h==null?void 0:h.zoom(-1)};L(o,"click",t=>{if(g.editing===!0)return;let n=t.target.closest("[data-map-point], [data-map-category], [data-map-action]");n&&(t.stopPropagation(),n.hasAttribute("data-map-point")?K(P[Number(n.dataset.mapPoint)].source):n.hasAttribute("data-map-category")?(i.categoryId=n.dataset.mapCategory==="all"?null:v[Number(n.dataset.mapCategory)].id,B=!1,w&&i.panel==="expanded"&&(i.panel="partial",i.selected=null),S(),h==null||h.fit(z,D()),n.scrollIntoView({block:"nearest",inline:"nearest"})):de[n.dataset.mapAction]())}),L(l,"input",()=>{g.design.show_search&&(i.query=l.value,S())});let j=()=>{let t=r.editor?g.device==="phone_portrait":A.matches;t&&!w&&(i.panel=i.selected?"expanded":"partial"),w=t,F()};L(A,"change",j);let $=()=>{let t=M;M=null,t&&c.hasPointerCapture(t.id)&&c.releasePointerCapture(t.id)};L(c,"pointerdown",t=>{g.editing===!0||t.button!==0||!t.isPrimary||(M={id:t.pointerId,y:t.clientY},c.setPointerCapture(M.id))}),L(c,"pointerup",t=>{if(!M||t.pointerId!==M.id)return;let n=t.clientY-M.y;$(),n<-40&&T("expanded"),n>40&&T(i.panel==="expanded"?"partial":"hidden")}),L(c,"pointercancel",$),L(c,"lostpointercapture",$),L(o,"error",t=>{t.target.matches("[data-map-image]")&&t.target.parentElement.classList.add("map-01__image--broken")},{capture:!0}),L(o,"load",t=>{t.target.matches("[data-map-image]")&&t.target.parentElement.classList.remove("map-01__image--broken")},{capture:!0});let G={update(t){var y,X;if(I)return;g={...g,...t},_(".map-01__search",g.design.show_search),g.design.show_search||(i.query="",l.value=""),E("[data-map-route-button] .button__text",g.content.route_button_text);let n=((y=g.content.categories)!=null?y:[]).map(x=>({...x,name:f(x.name),color:Z(x.color,g.colors)}));v=n.filter(x=>x.name),(!g.design.show_categories||!v.some(x=>x.id===i.categoryId))&&(i.categoryId=null),P=((X=g.content.points)!=null?X:[]).map((x,O)=>te(x,n,O,q.unnamed));let u=p.querySelector('[data-map-category="all"]');p.replaceChildren(u,...v.map((x,O)=>{let N=document.createElement("button");return N.type="button",N.dataset.mapCategory=O,N.textContent=x.name,N})),p.hidden=!g.design.show_categories||v.length===0,j(),S()},destroy(){I||(I=!0,$(),H.abort(),h==null||h.destroy(),Y.delete(a))}};Y.set(a,G),G.update({}),o.dataset.mapReady="";let Q=e("[data-map-editor-host]");return Q&&(Q.textContent=window.location.hostname),f(r.key)&&oe(f(r.key),r.lang).then(t=>{I||!a.isConnected||(h=new R(e("[data-map-canvas]"),t,e("[data-map-symbol]"),q.cluster,K,n=>{I||(W=n,J())}),h.update(z,i.selected,D()),B&&d&&h.center(d.coordinates),_(".map-01__zoom",!0))}).catch(t=>console.warn("Map addresses: Yandex initialization failed",t)),G}function ie(){for(let a of document.querySelectorAll("[data-map-public]"))se(a,JSON.parse(a.querySelector("[data-map-config]").textContent))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ie,{once:!0}):ie();})();
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.