1import{_ as rt}from"./CTQNHQBy.js";import{d as Fe,u as Ne,e as De,_ as Ue,ag as ve,ah as we,ai as de,aj as X,ak as Le,al as A,am as ce,an as We,ao as ut,ap as dt,aq as Ge,ar as ct,as as He,at as qe,au as pt,f as mt,ae as ft,c as vt,h as yt,i as gt,g as _t}from"./p7j0WGZt.js";import{_ as ht}from"./BgCs3lMD.js";import{_ as bt}from"./t0EP02gX.js";import{E as wt}from"./CdEwMwj7.js";import{_ as kt}from"./x2i0Ks1Q.js";import{m as q,M,N as O,Q as b,a9 as B,$ as G,I as re,a7 as ue,S as z,u as d,U as oe,j,q as I,F as pe,v as H,o as Ze,Y as Q,Z as T,af as Mt,a0 as ye,aq as Ct,X as xt,a3 as St,k as E,i as se,O as zt,P as $t,au as Qe,n as ge,p as R,g as _e,b as D,c as Te,J as Vt,V as jt,x as ie,_ as Ot,l as Yt,a1 as ne,T as Pt,ag as It}from"./uOatmh1Q.js";import{u as At}from"./Cj7e6CUJ.js";import{u as Lt}from"./Du64k5oF.js";import{a as Tt}from"./DaewPl6L.js";/* empty css */import{S as Xe}from"./BWqnvDh9.js";/* empty css */import{u as Bt}from"./BcJomcCB.js";import Rt from"./C-kvKWhi.js";import{V as Et}from"./szPhQV0g.js";import{V as Ft}from"./S-LaDRZ0.js";import"./DwV9Eu39.js";import"./CwQ1es6R.js";/* empty css */import"./S7pvcqnU.js";/* empty css *//* empty css */import"./CG6-6GM1.js";import"./jbnnUtj1.js";import"./DsU8Zdyl.js";import"./T6P7-iWy.js";import"./B_NgNNr0.js";import"./aztHNYCY.js";import"./AzmwF-xq.js";const Nt={class:"retail-card"},Dt=["innerHTML"],Ut={class:"retail-card__contacts"},Wt=["href"],Gt=["href"],Ht=["href"],qt={class:"retail-card__filials-list"},Zt=["onClick"],Qt={class:"retail-card__filials-phones"},Xt=["href"],Jt=q({__name:"RetailCard",props:{item:{}},emits:["setPin"],setup(e,{emit:o}){Fe();const{$reachGoal:l}=Ne(),r=e,t=c=>{const a=c%10;if(a===0||a>=5)return"пÑедÑÑавиÑелÑÑÑв";if(a===1)return"пÑедÑÑавиÑелÑÑÑво";if(c>1&&c<5||a>1&&a<5)return"пÑедÑÑавиÑелÑÑÑва"},s=j(0),_=c=>{s.value===c?s.value=0:s.value=c};function g(c){const a=new Xe({title:r.item?.title,email:r.item?.email,phone:r.item?.phone,website:r.item?.website});l("click_where_to_buy_contacts",{type:"retail",button:c,...a.data()})}return(c,a)=>{const m=De;return M(),O("div",Nt,[b("h3",{class:"retail-card__title",innerHTML:e.item.title},null,8,Dt),e.item.mainAddress?(M(),O("p",{key:0,class:"retail-card__address",onClick:a[0]||(a[0]=h=>c.$emit("setPin",e.item))},B(e.item.mainAddress),1)):G("",!0),b("div",Ut,[(M(!0),O(re,null,ue(e.item.phone,h=>(M(),O("a",{key:h,href:`tel:${h}`,target:"_blank",onClick:a[1]||(a[1]=w=>g("phone"))},B(h),9,Wt))),128)),b("a",{href:`mailto:${e.item.email}`,target:"_blank",onClick:a[2]||(a[2]=h=>g("email"))},B(e.item.email),9,Gt)]),b("a",{href:e.item.website,target:"_blank",class:"retail-card__site",onClick:a[3]||(a[3]=h=>g("website"))},B(e.item.website),9,Ht),b("div",{class:oe(["retail-card__filials",{open:d(s)===e.item.id}])},[b("div",{class:"retail-card__filials-title",onClick:a[4]||(a[4]=h=>_(e.item.id))},[b("span",null,B(e.item.shopAddressCount)+" "+B(t(e.item.shopAddressCount)),1),z(m,{name:d(s)===e.item.id?"minus":"plus",size:20},null,8,["name"])]),b("div",qt,[(M(!0),O(re,null,ue(e.item.addresses,h=>(M(),O("div",{key:h.id,class:"retail-card__filials-filial",onClick:w=>c.$emit("setPin",h)},[b("p",null,B(h.title),1),b("div",Qt,[(M(!0),O(re,null,ue(h.phone,w=>(M(),O("a",{key:w,href:`tel:${w}`,target:"_blank",onClick:a[5]||(a[5]=Y=>g("address_phone"))},B(w),9,Xt))),128))])],8,Zt))),128))])],2)])}}}),Kt=Ue(Jt,[["__scopeId","data-v-54068173"]]);var ke=e=>e instanceof Date,ea=e=>Object.keys(e).length===0,Ce=e=>e!=null&&typeof e=="object",Be=(e,...o)=>Object.prototype.hasOwnProperty.call(e,...o),Me=e=>Ce(e)&&ea(e),ta=()=>Object.create(null),xe=(e,o)=>{if(e===o)return{};if(!Ce(e)||!Ce(o))return o;const l=Object.keys(e).reduce((r,t)=>(Be(o,t)||(r[t]=void 0),r),ta());return ke(e)||ke(o)?e.valueOf()==o.valueOf()?{}:o:Object.keys(o).reduce((r,t)=>{if(!Be(e,t))return r[t]=o[t],r;const s=xe(e[t],o[t]);return Me(s)&&!ke(s)&&(Me(e[t])||!Me(o[t]))||(r[t]=s),r},l)};function Se(){_e()||A({text:"injectMap must be only called on runtime.",isInternal:!0});const e=se("map");return(!e||!D(e))&&A({text:"Was not able to inject valid map in injectMap.",isInternal:!0}),e}function aa(){_e()||A({text:"injectLayers must be only called on runtime.",isInternal:!0});const e=se("layers");return(!e||!D(e))&&A({text:"Was not able to inject valid layers in injectLayers.",isInternal:!0}),e}async function la({timeoutCallback:e,waitDuration:o}={}){if(typeof window>"u"&&A({text:"waitTillYmapInit cannot be called on SSR.",isInternal:!0}),!(typeof ymaps3<"u"))return new Promise((l,r)=>{if(typeof ymaps3>"u"){let t;o=typeof o<"u"?o:X.value.mapsScriptWaitDuration,o!==!1&&(t=setTimeout(()=>{e?.(t,!0),r(new Ge("Was not able to wait for map initialization in waitTillYmapInit. Ensure that map was initialized. You can change this behavior b
1y using mapsScriptWaitDuration."))},typeof o=="number"?o:5e3),e?.(t,!1)),I(ve,()=>{t&&(clearTimeout(t),e?.(t,!0)),de.value==="loaded"?l():r(ct)},{immediate:!0})}else l()})}async function Je({map:e,timeoutCallback:o,waitDuration:l}={}){!e&&!_e()&&A({text:"onMapInit must be only called on runtime.",isInternal:!0}),typeof window>"u"&&A({text:"waitTillMapInit cannot be called on SSR.",isInternal:!0});const r=e||Se();if(!r.value)return new Promise((t,s)=>{let _;l=typeof l<"u"?l:X.value.mapsRenderWaitDuration,l!==!1&&(_=setTimeout(()=>{o?.(_,!0),s(new Ge("Was not able to wait for map initialization in waitTillMapInit. You can change this behavior by using mapsRenderWaitDuration."))},typeof l=="number"?l:5e3),o?.(_,!1));let g;g=I(r,()=>{r.value&&(g?.(),_&&(clearTimeout(_),o?.(_,!0)),t())},{immediate:!0})})}function Re({children:e,isMercator:o,root:l}){l||A({text:"Failed to execute deleteMapChild due to destroyed root",isInternal:!0}),e&&!o?typeof l?.value=="object"&&Array.isArray(l.value)?l.value=l.value.filter(r=>r!==e):l.value?.removeChild(e):l.value&&e&&o&&"update"in l.value&&l.value.update({projection:void 0})}function Ee(){return typeof X.value.mapInnerSelector=="string"||X.value.mapInnerSelector===!1?X.value.mapInnerSelector:"ymaps,ymaps3"}var na={key:0,class:"__ymap_slots"},ia=q({name:"YandexMap",__name:"YandexMap",props:{modelValue:{type:Object,default:null},tag:{type:String,default:"div"},width:{type:String,default:"100%"},height:{type:String,default:"100%"},zIndex:{type:Number,default:0},settings:{type:Object,required:!0},readonlySettings:{type:Boolean,default:!1},realSettingsLocation:{type:Boolean,default:!1},layers:{type:Array,default:(()=>[])},cursorGrab:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:o}){const l=e,r=o,t=E(null),s=E(null),_=E([]),g=E(null),c=E(null),a=E(!1),m=j(0);ie("map",t),ie("layers",_),ie("projection",g),ie("needsToHold",m);const h=R(()=>({...l.settings,projection:void 0})),w=async()=>{l.settings.location||A({text:"You must specify location in YandexMap settings"}),t.value&&t.value.destroy();const u=c.value;if(!u)return;const i=h.value;g.value&&(i.projection=g.value),t.value=new ymaps3.YMap(u,i,[..._.value,...l.layers]),r("update:modelValue",t.value)};let Y,f,v=null;async function k(){await Je({map:t,timeoutCallback:(u,i)=>{i?v=null:v=u}}).catch(()=>{}),t.value&&(l.cursorGrab?(Y=new ymaps3.YMapListener({onActionStart:u=>{u.type==="drag"&&l.cursorGrab&&s.value?.classList.add("__ymap--grabbing")},onActionEnd:u=>{u.type==="drag"&&s.value?.classList.remove("__ymap--grabbing")}}),t.value.addChild(Y)):Y&&t.value.removeChild(Y))}let V=!1;return I(de,async u=>{if(u==="pending"){V=!0,a.value=!1;return}u!=="loaded"&&!V||(a.value=!0,await H(),m.value&&await new Promise(i=>I(m,()=>{m.value||i()},{immediate:!0})),await w())}),pe(async()=>{if(ve.value&&!we?.value?.parentElement){de.value="pending",we.value?.remove(),we.value=null;for(const i in window)i.includes("ymaps3")&&delete window[i]}const u=()=>{f?.();let i=ce(h);f=I(h,C=>{if(!t.value)return;const P=ce(C);l.realSettingsLocation&&P.location&&("center"in P.location&&"center"in i.location?i.location.center=t.value.center:"bounds"in P.location&&"bounds"in i.location&&(i.location.bounds=t.value.bounds),"zoom"in P.location&&"zoom"in i.location&&(i.location.zoom=t.value.zoom));const x=Object.keys(xe(i,P));if(x.length===0)return;const S={...P};for(const U in S)x.includes(U)||delete S[U];i=P,t.value?.update(S)},{deep:!0})};if(l.readonlySettings||u(),I(()=>l.readonlySettings,i=>{i?u():f?.()}),I(()=>l.cursorGrab,k,{immediate:!0}),!ve.value){if(X.value.initializeOn==="onComponentMount")try{await Le()}catch(i){console.error("An error occured while initializing Yandex Map with onComponentMount setting"),console.error(i);return}else(de.value==="loading"||X.value.initializeOn==="onPluginInit")&&(X.value.initializeOn==="onPluginInit"&&de.value!=="loading"&&await H(),await Le());ve.value||A({text:"You have set up <yandex-map> component without initializing Yandex maps. Please check initializeOn setting or call initYmaps manually before registering this component."})}a.value=!0,await H(),m.value&&await new Promise(i=>I(m,()=>{m.value||i()},{immediate:!0})),await w()}),Ze(()=>{v&&clearTimeout(v),t.value&&t.value.destroy(),t.value=null,r("update:modelValue",t.value)}),(u,i)=>(M(),Q(St(e.tag),{ref_key:"mapRef",ref:s,class:oe(["__ymap",{"__ymap--grab":e.cursorGrab}]),style:xt({width:e.width,height:e.height,zIndex:e.zIndex.toString()})},{default:T(()=>[b("div",{ref_key:"ymapContainer",ref:c,class:"__ymap_container"},null,512),a.value?Mt((M(),O("div",na,[ye(u.$slots,"default")],512)),[[Ct,!1]]):G("",!0)]),_:3},8,["class","style"]))}});function sa({mapRootRef:e}={}){const o=e??E();ie("mapRoot",o);const l=E([]);return ie("mapRootInitPromises",l),{mapRootRef:o,mapRootInitPromises:l}}
1async function he({returnOnly:e,willDeleteByHand:o,strictMapRoot:l,requiredImport:r,createFunction:t,settings:s,settingsUpdateIgnoreKeys:_,settingsUpdateFull:g,isLayer:c,isProjection:a,mapRoot:m,index:h}){_e()||A({text:"setupMapChildren must be only called on runtime.",isInternal:!0});try{const w=m?.mapRootRef,Y=m?.mapRootInitPromises,f=E(),v=se("mapRoot",null),k=se("mapRootInitPromises",null),V=Se(),u=aa();let i=null;const C=(x,S)=>{i||(i=new Set),S?i.delete(x):i.add(x)};if(!e&&!o&&Ze(()=>{f.value&&Re({children:f.value,isMercator:a,root:v?.value?v:V}),i?.size&&(i.forEach(x=>clearTimeout(x)),i.clear())}),s){let x=ce(s);I(s,S=>{if(!S)return;if(g){f.value&&"update"in f.value&&f.value.update(S);return}const U=Object.keys(xe(x,S));if(U.length===0)return;const J=ce(S);for(const Z in J)U.includes(Z)||delete J[Z];const K=_&&(D(_)?_.value:_);K&&ut(J,K),Object.keys(J).length!==0&&(x=ce(S),f.value&&"update"in f.value&&f.value.update(J))},{deep:!0})}!e&&!a&&I(()=>Te(h),x=>{!f.value||!V.value||(Re({children:f.value,isMercator:a,root:v?.value?v:V}),typeof v?.value=="object"&&Array.isArray(v.value)?v.value=[...v.value,f.value]:(v?.value||V.value).addChild(f.value,x))}),!c&&!a?(await Je({timeoutCallback:C}),V.value||A({text:"map is undefined in setupMapChildren. Please verify that Yandex Maps were initialized successfully and you only use components inside <yandex-map>."})):await la({timeoutCallback:C}),l&&(v?.value||await H(),v?.value||A({text:"mapRoot is undefined in setupMapChildren. Please verify that you are using component inside it's root: for example, don't use Controls outside <yandex-map-controls>."})),Y&&(await H(),await Promise.all(Y.value));let P;if(r){const x=r();k?.value&&k.value.push(Promise.resolve(x)),P=await x}if(f.value=t(P),w&&!w.value&&(w.value=f.value),!e&&V.value&&!a){k?.value&&(await Promise.all(k.value),r||await H());const x=Te(h);typeof v?.value=="object"&&Array.isArray(v.value)?(v.value.splice(x??v.value.length,0,f.value),Vt(v)):(v?.value||V.value).addChild(f.value,x)}else c?u.value.push(f.value):a&&V.value&&V.value.update({projection:f.value});return f.value}catch(w){throw console.error("Error during map children loading",w),w}}var oa=q({name:"YandexMapDefaultFeaturesLayer",__name:"YandexMapDefaultFeaturesLayer",props:{modelValue:{type:Object,default:null},settings:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(e,{emit:o}){const l=e,r=o,t=se("needsToHold");t.value++;let s;return pe(async()=>{s=await he({createFunction:()=>new ymaps3.YMapDefaultFeaturesLayer(l.settings||{}),settings:R(()=>l.settings),isLayer:!0}),r("update:modelValue",s),t.value--}),()=>{}}}),ra=q({name:"YandexMapDefaultSchemeLayer",__name:"YandexMapDefaultSchemeLayer",props:{modelValue:{type:Object,default:null},settings:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(e,{emit:o}){const l=e,r=o,t=se("needsToHold");t.value++;let s;return pe(async()=>{s=await he({createFunction:()=>new ymaps3.YMapDefaultSchemeLayer(l.settings||{}),settings:R(()=>l.settings),isLayer:!0}),r("update:modelValue",s),t.value--}),()=>{}}});function Ke({position:e,containerAttrs:o,wrapperAttrs:l,zeroSizes:r}){const t={class:["__ymap-marker"],style:{}},s={class:["__ymap-marker_wrapper"],style:{}},_=e==="default"||e==="default default";if(e&&!_)if(e.startsWith("translate"))s.style.transform=e;else{let c=0,a=0;const m=e.split(" ");for(let h=0;h<m.length;h++){let w=0;const Y=m[h];switch(Y){case"top":case"left":w=-100;break;case"top-center":case"left-center":w=-50;break;case"bottom":case"right":w=100;break;case"bottom-center":case"right-center":w=50;break;default:w=0}Y.startsWith("left")||Y.startsWith("right")?c=w:a=w}s.style.transform=`translate(${c}%, ${a}%)`}(r===!0||r!==!1&&e&&!_)&&(t.style.width="0",t.style.height="0",s.style.transform&&(s.style.width="fit-content"));const g={root:{...o??{}},children:{...l??{}}};for(const[c,a]of Object.entries(g)){const m=c==="root"?t:s;a.class&&(Array.isArray(a.class)||(a.class=[a.class]),a.class=[...m.class,...a.class]),a?.style&&(typeof a.style!="object"||Array.isArray(a.style)?console.warn(`Style property was given in ${c} of marker, but it is not an object. Style of this prop can only be an object, therefore it was ignored.`):a.style={...m.style,...a.style}),Object.assign(m,a)}return{root:t,children:s}}function ua(e){e={...e};for(const o in{position:!0,containerAttrs:!0,wrapperAttrs:!0,zeroSizes:!0})o in e&&delete e[o];return e}var da=q({name:"YandexMapMarker",inheritAttrs:!1,props:{modelValue:{type:Object,default:null},settings:{type:Object,required:!0},position:{type:String},containerAttrs:{type:Object,default:()=>({})},wrapperAttrs:{type:Object,default:()=>({})},zeroSizes:{type:Boolean,default:null}},emits:{"update:modelValue"(e){return!0}},slots:Object,setup(e,{slots:o,emit:l,attrs:r}){let t;const s=j(null);function _(){const a=Ee();a!==!1&&(s.value?.parentElement?.closest(a)||s.value?.remove())}pe(async()=>{e.settings.coordinates||A({text:"You must specify coordinates in YandexMapMarker settings"}),t=await he({settings:R(()=>e.settings),createFunction:()=>new ymaps3.YMapMarker(e.settings,s.value)}),_(),l("update:modelValue",t)});let g;Qe(()=>{const a=Ee();a!==!1&&(!g&&s.value?.parentElement?.closest(a)?g=s.value.parentElement:g&&s.value&&!s.value?.parentElement?.closest(a)&&g.appendChild(s.value),_())});const c=R(()=>Ke({position:e.position,containerAttrs:e.containerAttrs,wrapperAttrs:e.wrapperAttrs,zeroSizes:e.zeroSizes}));return()=>We([ge("div",{...c.value.root,ref:s,...r},[ge("div",{...c.value.children},o.default?.({}))])])}}),ca=q({name:"YandexMapClustererCluster",props:{clusterMarkerProps:{type:Object,default:()=>({})},zoomOnClusterClick:{type:[Boolean,Object],default:!1},feature:{type:Object,required:!0}},emits:{trueBounds(e){return e.length===2},updatedBounds(e){return e.length===2},updatedCluster(e){return!0}},slots:Object,setup(e,{slots:o,emit:l}){const r=Se(),t=j(null),s=R(()=>Ke({position:e.clusterMarkerProps?.position??"top-center left-center",containerAttrs:e.clusterMarkerProps?.containerAttrs,wrapperAttrs:e.clusterMarkerProps?.wrapperAttrs,zeroSizes:e.clusterMarkerProps?.zeroSizes}));function _(){const c=t.value;if(!c)return;const a=e.feature.element,m=e.feature.clusterer;
1a.children.length&&a.children.forEach(h=>{try{a.removeChild(h)}catch(w){console.warn("Non-fatal error occurred when updating Map clusterer",w)}});try{a.addChild(new ymaps3.YMapMarker({...ua(e.clusterMarkerProps),coordinates:m.lnglat,onClick:async(h,w)=>{if(e.clusterMarkerProps.onClick?.(h,w),m.features.length>=2){const Y=typeof e.zoomOnClusterClick=="object"?e.zoomOnClusterClick:{},f=He(m.features.map(k=>k.geometry.coordinates));if(l("trueBounds",f),!e.zoomOnClusterClick)return;const v=Y.duration??500;if(Y.strategy==="boundsCorrect"){const[[k,V],[u,i]]=f,C=V-i,P=u-k,x=[[k-P,V-C],[u+P,i+C]];l("updatedBounds",x),r.value?.setLocation({bounds:x,duration:v,easing:Y.easing})}else{const{center:k,zoom:V}=await qe({bounds:f,map:r.value,roundZoom:!0,comfortZoomLevel:!0});r.value?.setLocation({center:k,zoom:V,duration:v,easing:Y.easing}),await pt(v+50),r.value&&l("updatedBounds",r.value.bounds)}}}},c))}catch(h){console.error(h)}}I(t,_);const g=j(!1);return Qe(()=>{if(!g.value){g.value=!0;return}l("updatedCluster",e.feature.clusterer.clusterId)}),()=>We([ge("div",{...s.value.root,ref:t},[ge("div",s.value.children,o.default?.({clusterer:e.feature.clusterer,coordinates:e.feature.clusterer.lnglat,length:e.feature.clusterer.features.length}))])])}}),pa={class:"__ymap_clusterer_clusters"},ma=q({name:"YandexMapClustererClusters",__name:"YandexMapClustererClusters",props:{clusterMarkerProps:{type:Object,default:()=>({})},zoomOnClusterClick:{type:[Boolean,Object],default:!1}},emits:["trueBounds","updatedBounds","updatedCluster"],setup(e,{emit:o}){const l=o,r=se("clusterFeatures");return(t,s)=>(M(),O("div",pa,[(M(!0),O(re,null,ue(d(r),_=>(M(),Q(ca,{key:_.clusterer.clusterId,"cluster-marker-props":e.clusterMarkerProps,feature:_,"zoom-on-cluster-click":e.zoomOnClusterClick,onTrueBounds:s[0]||(s[0]=g=>l("trueBounds",g)),onUpdatedBounds:s[1]||(s[1]=g=>l("updatedBounds",g)),onUpdatedCluster:s[2]||(s[2]=g=>l("updatedCluster",g))},{default:T(g=>[ye(t.$slots,"default",jt({ref_for:!0},g))]),_:3},8,["cluster-marker-props","feature","zoom-on-cluster-click"]))),128))]))}}),fa={key:0,class:"__ymap_clusterer--empty"},va={key:1,class:"__ymap-clusterer"},ya=q({name:"YandexMapClusterer",__name:"YandexMapClusterer",props:{modelValue:{type:Object,default:null},settings:{type:Object,default:()=>({})},clusterMarkerProps:{type:Object,default:()=>({})},gridSize:{type:Number,default:64},zoomOnClusterClick:{type:[Boolean,Object],default:!1}},emits:["update:modelValue","trueBounds","updatedBounds"],setup(e,{emit:o}){const l=e,r=o,t=E(null),s=E([]),_=E([]),g=j(0);ie("clusterFeatures",R(()=>_.value.filter(f=>f.clusterer.features.length>1)));let c;const a=R(()=>l.settings.tickTimeout),m=()=>{const f={...l.settings};!f.method&&c&&(f.method=c?.({gridSize:l.gridSize})),a.value&&(f.tickTimeout=a.value);let v=f.marker;v||(v=u=>{const i=s.value.find(C=>C._props.id===u.id);return i||(A({text:`No entity with id ${u.id} (coordinates: ${u.geometry.coordinates.join(", ")}) were found in YandexMapClusterer.`,isInternal:!0,warn:!0}),new ymaps3.YMapMarker({coordinates:u.geometry.coordinates}))});const k=u=>{const i=_.value.find(C=>C.clusterer.lnglat[0]===u[0]&&C.clusterer.lnglat[1]===u[1]);return i?i.element:(A({text:`No element with coordinates of ${u.join(", ")} were found in YandexMapClusterer.`,isInternal:!0,warn:!0}),new ymaps3.YMapMarker({coordinates:u}))};let V=f.features;return V||(V=s.value.map((u,i)=>(u._props.id||u.update({id:Math.random().toString()+Date.now().toString()}),{type:"Feature",id:u._props.id,geometry:{type:"Point",coordinates:u._props.coordinates},properties:"properties"in u._props?u._props.properties:{}}))),f.onRender=u=>{if(u.length<=1&&g.value++,_.value=u.map(i=>(i.clusterId=`cluster-${g.value}-${i.features.map(C=>C.id).join(",")}`,{clusterer:i,element:_.value.find(C=>C.clusterer.clusterId===i.clusterId)?.element||new ymaps3.YMapCollection({})})),l.settings.onRender)return l.settings.onRender(u)},{...f,marker:v,features:V,cluster:k}},h=async()=>{_.value=[],await H(),t.value?.update(m()),t.value?._render()};I(()=>[l.settings,l.gridSize],()=>{h()},{deep:!0});const w=sa({mapRootRef:s}),Y=async()=>{t.value=await he({createFunction:({YMapClusterer:f,clusterByGri
1d:v})=>{c=v;const k=m();return k.features.length>0&&(k.features=[]),new f(k)},requiredImport:()=>dt("@yandex/ymaps3-clusterer"),mapRoot:w}),r("update:modelValue",t.value)};return I(s,async()=>{await H(),h()}),pe(async()=>{await Y()}),(f,v)=>t.value?(M(),O("div",va,[ye(f.$slots,"default"),z(ma,{"cluster-marker-props":e.clusterMarkerProps,"zoom-on-cluster-click":e.zoomOnClusterClick,onTrueBounds:v[0]||(v[0]=k=>r("trueBounds",k)),onUpdatedBounds:v[1]||(v[1]=k=>r("updatedBounds",k)),onUpdatedCluster:v[2]||(v[2]=k=>g.value++)},{default:T(k=>[ye(f.$slots,"cluster",zt($t(k)))]),_:3},8,["cluster-marker-props","zoom-on-cluster-click"])])):(M(),O("div",fa))}});const ga={class:"retail-page__title"},_a={key:1},ha={key:0,class:"retail-page__filter"},ba={class:"filter-buttons"},wa={key:1,class:"retail-page__view-tabs"},ka={class:"retail-page__content"},Ma={key:0,class:"retail-page__list"},Ca={key:1,class:"retail-page__map"},xa={class:"marker"},Sa={key:0,class:"marker-popup"},za={class:"marker-popup__title"},$a={class:"marker-popup__address"},Va={class:"marker-popup__phone"},ja=["href","onClick"],Oa={class:"marker-popup__phone"},Ya=["href","onClick"],Pa=["href","onClick"],Ia=["onClick"],Aa={class:"modal-content"},La={class:"retail-page__filter"},Ta={class:"filter-buttons"},Ba=q({__name:"retail",async setup(e){let o,l;const{$reachGoal:r}=Ne(),{query:t,setQuery:s,clearQuery:_}=At(),g=j([{title:"ÐлавнаÑ",path:"/"},{title:"Ðде кÑпиÑÑ"}]),c=Fe(),a=j(!1),{data:m,status:h,refresh:w}=([o,l]=Ot(()=>Lt("where-to-buy-retail",()=>Tt.getWhereBuyRetail({city:t.value?.city?String(t.value?.city):void 0,country:t.value?.country?String(t.value?.country):void 0,productType:t.value?.productType?Str
1ing(t.value?.productType):void 0}),{watch:[t]})),o=await o,l(),o),Y=_t(),f=mt();I(()=>m.value?.data,p=>{p!==void 0&&p.metaData?(yt({title:p.metaData.title??"Ðде кÑпиÑÑ - ÑозниÑнÑм покÑпаÑелÑм",meta:[{name:"description",content:p.metaData.description}]}),gt({ogTitle:p.metaData.title?p.metaData.title:"Ðде кÑпиÑÑ - ÑозниÑнÑм покÑпаÑелÑм",ogDescription:p.metaData.description,ogType:"website",ogUrl:`${Y.public.siteUrl}${f.fullPath}`,ogImageAlt:p.metaData.title?p.metaData.title:"Ðде кÑпиÑÑ - ÑозниÑнÑм покÑпаÑелÑм"})):Bt("Ðде кÑпиÑÑ - ÑозниÑнÑм покÑпаÑелÑм)")},{immediate:!0});const v=R(()=>h.value=="pending"),k=j("retail"),V=j([{label:"ÐпÑовÑм покÑпаÑелÑм",value:"wholesale"},{label:"РозниÑнÑм покÑпаÑелÑм",value:"retail"}]),u=j(),i=j(),C=j(),P=j([]),x=j([]),S=E(null),U=j([55.751574,37.573856]),J=j(10),K=j([]),Z=j(!1),me=j(!1),et=R(()=>h.value==="pending"&&!m.value?.data),ze=R(()=>m.value?.data?.filter?.countries?.values??[]),$e=R(()=>m.value?.data?.filter?.productTypes?.values??[]);I(()=>m?.value?.data,async()=>{if(!me.value){if(m?.value?.data.filter&&(i.value=m?.value.data.filter.countries.values?.find(p=>p.selected===!0),C.value=m?.value.data.filter.cities.values?.find(p=>p.selected===!0&&p.country===i.value.code),u.value=m?.value.data.filter.productTypes.values?.find(p=>p.selected===!0),K.value=m?.value.data.filter.cities.values?.filter(p=>p.country===i.value.code)),m?.value?.data.items){const p=[],n=[];for(let N=0;N<m?.value?.data.items.length;N++){const $=m?.value?.data.items[N];if($.coordinates){const L=$.coordinates.split(",");L.length===2&&(n.push([Number(L[1]),Number(L[0])]),p.push({coordinates:[Number(L[1]),Number(L[0])],title:$.title,address:$.mainAddress?$.mainAddress:"",phone:$.phone[0],email:$.email,website:$.website,id:$.id}))}if($.addresses)for(let L=0;L<$.addresses.length;L++){const W=$.addresses[L];if(W.coordinates){const F=W.coordinates.split(",");F.length===2&&(n.push([Number(F[1]),Number(F[0])]),p.push({coordinates:[Number(F[1]),Number(F[0])],title:$.title,address:W.title?W.title:"",phone:W.phone[0],email:W.email,website:$.website,id:W.id}))}}}P.value=p,x.value=n,P.value.length>0&&(U.value=P.value[0]?.coordinates),Z.value&&S.value&&await Ve()}a.value=!1}},{immediate:!0,deep:!0});const Ve=async()=>{if(!(!S.value||!Z.value||me.value)&&x.value.length!==0){me.value=!0;try{if(x.value.length>
1=2){const p=x.value,n=await qe({bounds:He(p),map:S.value,roundZoom:!0,comfortZoomLevel:!1});await S.value?.setLocation({center:n.center,zoom:Math.min(n.zoom+1,18),duration:300})}else x.value.length===1&&await S.value?.setLocation({center:x.value[0],zoom:15,duration:300})}catch(p){console.warn("ÐÑибка пÑи ÑÑÑановке гÑÐ°Ð½Ð¸Ñ ÐºÐ°ÑÑÑ:",p),U.value&&await S.value?.setLocation({center:U.value,zoom:13,duration:300})}finally{me.value=!1}}};I(S,p=>{p&&(Z.value=!0,setTimeout(()=>{Ve()},100))});const ee=j(null),te=j(!1),ae=j("list"),je=async()=>{c.isMobile&&(a.value=!0),s({singles:[{key:"country",value:i.value&&i.value.code?String(i.value.code):void 0},{key:"city",value:C.value&&C.value.code?String(C.value.code):void 0},{key:"productType",value:u.value&&u.value.code?String(u.value.code):void 0}]}),c.isMobile&&(te.value=!1)},Oe=async()=>{c.isMobile&&(a.value=!0),_(["city","country","productType"]),await w(),c.isMobile&&(te.value=!1),r("where_to_buy_filter_clear_filters",{type:"retail"})},tt=p=>{const n=p.coordinates;if(n&&S.value&&Z.value){S.value?.setLocation({center:[Number(n.split(",")[1]),Number(n.split(",")[0])],zoom:18,duration:300});const N=P.value.findIndex($=>$.id===p.id);Pe(N)}},Ye=()=>{m?.value?.data.filter.cities.values&&(K.value=m?.value?.data.filter.cities.values.filter(p=>p.country===i.value.code),C.value={}),r("where_to_buy_filter_set_field",{type:"retail",field:{code:"country",value:i.value?.value}})},at=()=>{r("where_to_buy_filter_set_field",{type:"retail",field:{code:"city",value:C.value?.value}})},lt=()=>{r("where_to_buy_filter_set_field",{type:"retail",field:{code:"product_type",value:u.value?.value}})};async function Pe(p){if(ee.value===p){ee.value=null;return}ee.value=p,await H(),document.querySelectorAll(".isCurrentMarker").forEach(N=>{const $=N.closest("ymaps");$&&($.style.zIndex="2")})}const nt=p=>{S.value&&Z.value&&p&&S.value?.setLocation({center:p,zoom:(S.value.zoom||12)+2,duration:300})},Ie=R(()=>c.isMobile&&ae.value==="map"),Ae=ft("retailMobileMapView",()=>!1);I(Ie,p=>{Ae.value=p},{immediate:!0}),Yt(()=>{Ae.value=!1});const it=R(()=>c.isMobile?"100%":"863px");function be(p,n){const N=new Xe({title:n.title,email:n.email,phone:n.phone,website:n.website});
1r("click_where_to_buy_contacts",{type:"retail",button:p,...N.data()})}return(p,n)=>{const N=rt,$=De,L=vt,W=ht,F=bt,st=wt,ot=kt;return M(),O("div",{class:oe(["retail-page",{"retail-page--map-view":d(Ie)}])},[d(c).isMobile&&d(a)?(M(),Q(Et,{key:0,class:"loading-overlay","model-value":d(a)},{default:T(()=>[z(Ft,{indeterminate:"",color:"primary",size:50,width:5})]),_:1},8,["model-value"])):G("",!0),z(N,{breadcrumbs:d(g)},null,8,["breadcrumbs"]),b("h1",ga,[ne(B(d(m)?.data.metaData.h1??"Ðде кÑпиÑÑ")+" ",1),d(c).isMobile?(M(),Q(L,{key:0,variant:"with-icon",onClick:n[0]||(n[0]=y=>te.value=!0)},{default:T(()=>[z($,{name:"filter"}),n[15]||(n[15]=b("span",{class:"retail-page__filter__text"}," ФилÑÑÑÑ ",-1))]),_:1})):G("",!0)]),z(W,{modelValue:d(k),"onUpdate:modelValue":[n[1]||(n[1]=y=>D(k)?k.value=y:null),n[2]||(n[2]=y=>p.$router.push({path:"/where-to-buy/"}))],class:"fill",options:d(V)},null,8,["modelValue","options"]),z(Pt,{name:"skeleton-fade",mode:"out-in"},{default:T(()=>[d(et)?(M(),Q(Rt,{key:0,"is-mobile":d(c).isMobile},null,8,["is-mobile"])):(M(),O("div",_a,[!d(c).isMobile&&!d(v)?(M(),O("div",ha,[z(F,{modelValue:d(i),"onUpdate:modelValue":[n[3]||(n[3]=y=>D(i)?i.value=y:null),Ye],options:d(ze),"name-value":"code","name-property":"value",placeholder:"СÑÑана"},null,8,["modelValue","options"]),z(F,{modelValue:d(C),"onUpdate:modelValue":[n[4]||(n[4]=y=>D(C)?C.value=y:null),at],options:d(K),"name-value":"code","name-property":"value",placeholder:"ÐоÑод","search-select":""},null,8,["modelValue","options"]),z(F,{modelValue:d(u),"onUpdate:modelValue":[n[5]||(n[5]=y=>D(u)?u.value=y:null),lt],options:d($e),"name-value":"code","name-property":"value",placeholder:"Тип пÑодÑкÑии"},null,8,["modelValue","options"]),b("div",ba,[z(L,{"variant-height":"h-middle",onClick:je},{default:T(()=>[...n[16]||(n[16]=[ne("ÐоказаÑÑ",-1)])]),_:1}),z(L,{variant:"grey","variant-height":"h-middle",onClick:Oe},{default:T(()=>[...n[17]||(n[17]=[ne("СбÑоÑиÑÑ",-1)])]),_:1})])])):G("",!0),d(c).isMobile?(M(),O("div",wa,[b("div",{class:oe(["tab",{active:d(ae)==="list"}]),onClick:n[6]||(n[6]=y=>ae.value="list")},[z($,{name:"list",size:24}),n[18]||(n[18]=ne(" СпиÑком ",-1))],2),b("div",{class:oe(["tab",{active:d(ae)==="map"}]),onClick:n[7]||(n[7]=y=>ae.value="map")},[z($,{name:"map",size:24}),n[19]||(n[19]=ne(" Ðа каÑÑе ",-1))],2)])):G("",!0),b("div",ka,[!d(c).isMobile||d(ae)==="list"?(M(),O("div",Ma,[(M(!0),O(re,null,ue(d(m)?.data.items,y=>(M(),Q(d(Kt),{key:y.id,item:y,onSetPin:tt},null,8,["item"]))),128))])):G("",!0),d(P).length>0&&(!d(c).isMobile||d(ae)==="map")?(M(),O("div",Ca,[z(d(ia),{modelValue:S.value,"onUpdate:modelValue":n[9]||(n[9]=y=>S.value=y),settings:{location:{center:d(U),zoom:d(J)}},width:"100%",height:d(it)},{default:T(()=>[z(d(ra)),z(d(oa)),z(d(ya),{"zoom-on-cluster-click":"","grid-size":60},{cluster:T(({length:y,coordinates:le})=>[b("div",{class:"cluster",onClick:fe=>nt(le)},B(y),9,Ia)]),default:T(()=>[(M(!0),O(re,null,ue(d(P),(y,le)=>(M(),Q(d(da),{key:le,settings:{coordinates:y.coordinates,zIndex:d(ee)===le?10:1,onClick:()=>Pe(le)},class:oe({isCurrentMarker:d(ee)===le})},{default:T(()=>[b("div",xa,[d(ee)===le?(M(),O("div",Sa,[b("div",{class:"close",onClick:n[8]||(n[8]=It(fe=>ee.value=null,["stop"]))},[z($,{name:"ui/close",size:20})]),b("div",za,B(y.title),1),b("div",$a,B(y.address),1),b("div",Va,[n[20]||(n[20]=b("span",{class:"label"}," ТелеÑон: ",-1)),b("a",{href:`tel:${y.phone}`,target:"_blank",onClick:fe=>be("phone",y)},B(y.phone),9,ja)]),b("div",Oa,[n[21]||(n[21]=b("span",{class:"label"}," E-mail: ",-1)),b("a",{href:`mailto:${y.email}`,target:"_blank",onClick:fe=>be("email",y)},B(y.email),9,Ya)]),b("a",{href:y.website,target:"_blank",class:"site",onClick:fe=>be("website",y)},B(y.website),9,Pa)])):G("",!0)])]),_:2},1032,["settings","class"]))),128))]),_:1})]),_:1},8,["modelValue","settings","height"])])):!d(c).isMobile&&!d(v)?(M(),Q(st,{key:2,text:"ÐеÑки Ð´Ð»Ñ ÐºÐ°ÑÑÑ Ð½Ðµ наÑÑÑоенÑ"})):G("",!0)])]))]),_:1}),z(ot,{modelValue:d(te),"onUpdate:modelValue":n[13]||(n[13]=y=>D(te)?te.value=y:null),width:"500",class:"error-modal",onClose:n[14]||(n[14]=y=>te.value=!1)},{default:T(()=>[b("div",Aa,[n[24]||(n[24]=b("h3",null,"ФилÑÑÑ",-1)),b("div",La,[z(F,{modelValue:d(i),"onUpdate:modelValue":[n[10]||(n[10]=y=>D(i)?i.value=y:null),Ye],options:d(ze),"name-value":"code","name-property":"value",placeholder:"СÑÑана"},null,8,["modelValue","options"]),z(F,{modelValue:d(C),"onUpdate:modelValue":n[11]||(n[11]=y=>D(C)?C.value=y:null),options:d(K),"name-value":"code","name-property":"value",placeholder:"ÐоÑод","search-select":""},null,8,["modelValue","options"]),z(F,{modelValue:d(u),"onUpdate:modelValue":n[12]||(n[12]=y=>D(u)?u.value=y:null),options:d($e),"name-value":"code","name-property":"value",placeholder:"Тип пÑодÑкÑии"},null,8,["modelValue","options"]),b("div",Ta,[z(L,{"variant-height":"h-middle",onClick:je},{default:T(()=>[...n[22]||(n[22]=[ne("ÐоказаÑÑ",-1)])]),_:1}),z(L,{variant:"grey","variant-height":"h-middle",onClick:Oe},{default:T(()=>[...n[23]||(n[23]=[ne("СбÑоÑиÑÑ",-1)])]),_:1})])])])]),_:1},8,["modelValue"])],2)}}}),vl=Ue(Ba,[["__scopeId","data-v-3a87e85c"]]);export{vl as default};
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.