@opengis/partsmap 0.0.92 → 0.0.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PartsMap.js +19 -12
- package/dist/PartsMap.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/PartsMap.js
CHANGED
@@ -20562,6 +20562,7 @@ const zy = /* @__PURE__ */ Ji(Iy, [["render", My]]), Ly = {
|
|
20562
20562
|
compareIcon: zy,
|
20563
20563
|
CompareBaseLayers: Ty
|
20564
20564
|
},
|
20565
|
+
emits: ["isCompareOpen"],
|
20565
20566
|
props: {
|
20566
20567
|
map: { type: Object },
|
20567
20568
|
compareLayers: { type: Array },
|
@@ -20799,7 +20800,8 @@ const Jy = /* @__PURE__ */ Ji(Ny, [["render", Xy]]), Ky = {
|
|
20799
20800
|
map: null,
|
20800
20801
|
hoverObject: null,
|
20801
20802
|
popup: null,
|
20802
|
-
colors: []
|
20803
|
+
colors: [],
|
20804
|
+
strokes: null
|
20803
20805
|
};
|
20804
20806
|
},
|
20805
20807
|
async mounted() {
|
@@ -20932,7 +20934,7 @@ const Jy = /* @__PURE__ */ Ji(Ny, [["render", Xy]]), Ky = {
|
|
20932
20934
|
await this.addLayer({
|
20933
20935
|
id: this.table,
|
20934
20936
|
service: "vector",
|
20935
|
-
url: `/api/vtile/${this.table}/ua/{z}/{x}/{y}.vmt?pointZoom=${this.pointZoom}&dt=${(/* @__PURE__ */ new Date()).toISOString()}
|
20937
|
+
url: `/api/vtile/${this.table}/ua/{z}/{x}/{y}.vmt?pointZoom=${this.pointZoom}&dt=${(/* @__PURE__ */ new Date()).toISOString()}`,
|
20936
20938
|
layers: [
|
20937
20939
|
{
|
20938
20940
|
type: "fill",
|
@@ -21006,7 +21008,7 @@ const Jy = /* @__PURE__ */ Ji(Ny, [["render", Xy]]), Ky = {
|
|
21006
21008
|
}
|
21007
21009
|
] : []
|
21008
21010
|
]
|
21009
|
-
});
|
21011
|
+
}), I && this.setFilter(this.table, I);
|
21010
21012
|
},
|
21011
21013
|
async createMap() {
|
21012
21014
|
const f = {
|
@@ -21072,7 +21074,7 @@ function Qy(f, x, I, C, L, U) {
|
|
21072
21074
|
}, null, 4),
|
21073
21075
|
Hs(tr(S, {
|
21074
21076
|
colors: L.colors,
|
21075
|
-
strokes:
|
21077
|
+
strokes: L.strokes,
|
21076
21078
|
title: I.legendname
|
21077
21079
|
}, null, 8, ["colors", "strokes", "title"]), [
|
21078
21080
|
[Jo, I.legend]
|
@@ -21261,6 +21263,7 @@ const B0 = /* @__PURE__ */ Ji(I0, [["render", R0], ["__scopeId", "data-v-3740577
|
|
21261
21263
|
dashedLine: { type: Boolean, default: !1 },
|
21262
21264
|
title: { type: String, default: () => "" },
|
21263
21265
|
table: { type: String, default: () => "" },
|
21266
|
+
rows: { type: Object, default: () => null },
|
21264
21267
|
isMapCompare: { type: Boolean, default: !0 },
|
21265
21268
|
initTotal: { type: [Number, String], default: () => "" },
|
21266
21269
|
colorAttr: { type: String, default: () => "" },
|
@@ -21412,16 +21415,20 @@ const B0 = /* @__PURE__ */ Ji(I0, [["render", R0], ["__scopeId", "data-v-3740577
|
|
21412
21415
|
this.addressSelectValue && (f && this.selectedId && this.closeObjCard(), this.getData());
|
21413
21416
|
}
|
21414
21417
|
},
|
21415
|
-
|
21416
|
-
|
21417
|
-
|
21418
|
-
|
21419
|
-
|
21420
|
-
const
|
21421
|
-
|
21418
|
+
created() {
|
21419
|
+
this.tableData = this.rows, this.total = this.initTotal, this.id && (this.selectedRow = this.rows[0], this.selectedId = this.id, this.isSelectObj = !0);
|
21420
|
+
},
|
21421
|
+
mounted() {
|
21422
|
+
this.rows || this.getData();
|
21423
|
+
const f = new URLSearchParams(window.location.search), x = f.get("filter");
|
21424
|
+
f.get("id");
|
21425
|
+
const I = x == null ? void 0 : x.split("|");
|
21426
|
+
I == null || I.forEach((L) => {
|
21422
21427
|
const [U, S] = L.split("=");
|
21423
21428
|
S != null && S.includes(",") ? this.mountedFilter[U] = S == null ? void 0 : S.split(",") : this.mountedFilter[U] = S, this.activeFilters = this.mountedFilter;
|
21424
|
-
})
|
21429
|
+
});
|
21430
|
+
const C = new URLSearchParams(window.location.search);
|
21431
|
+
this.currentPage = C.get("page") || 1, this.getFilter();
|
21425
21432
|
},
|
21426
21433
|
updated() {
|
21427
21434
|
this.checkFilterLength();
|
package/dist/PartsMap.umd.cjs
CHANGED
@@ -582,4 +582,4 @@ uniform ${C} ${E} u_${R};
|
|
582
582
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(x){return x instanceof this?x:new this(x)}static concat(x,...k){const P=new this(x);return k.forEach(D=>P.set(D)),P}static accessor(x){const P=(this[vu]=this[vu]={accessors:{}}).accessors,D=this.prototype;function j(S){const c=Uo(S);P[c]||(Wf(D,S),P[c]=!0)}return ge.isArray(x)?x.forEach(j):j(x),this}}Hi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ge.reduceDescriptors(Hi.prototype,({value:f},x)=>{let k=x[0].toUpperCase()+x.slice(1);return{get:()=>f,set(P){this[k]=P}}}),ge.freezeMethods(Hi);function Ac(f,x){const k=this||$o,P=x||k,D=Hi.from(P.headers);let j=P.data;return ge.forEach(f,function(c){j=c.call(k,j,D.normalize(),x?x.status:void 0)}),D.normalize(),j}function bu(f){return!!(f&&f.__CANCEL__)}function $s(f,x,k){ct.call(this,f??"canceled",ct.ERR_CANCELED,x,k),this.name="CanceledError"}ge.inherits($s,ct,{__CANCEL__:!0});function wu(f,x,k){const P=k.config.validateStatus;!k.status||!P||P(k.status)?f(k):x(new ct("Request failed with status code "+k.status,[ct.ERR_BAD_REQUEST,ct.ERR_BAD_RESPONSE][Math.floor(k.status/100)-4],k.config,k.request,k))}function Xf(f){const x=/^([-+\w]{1,25})(:?\/\/|:)/.exec(f);return x&&x[1]||""}function Jf(f,x){f=f||10;const k=new Array(f),P=new Array(f);let D=0,j=0,S;return x=x!==void 0?x:1e3,function(fe){const me=Date.now(),ve=P[j];S||(S=me),k[D]=fe,P[D]=me;let ae=j,le=0;for(;ae!==D;)le+=k[ae++],ae=ae%f;if(D=(D+1)%f,D===j&&(j=(j+1)%f),me-S<x)return;const ht=ve&&me-ve;return ht?Math.round(le*1e3/ht):void 0}}function Kf(f,x){let k=0,P=1e3/x,D,j;const S=(me,ve=Date.now())=>{k=ve,D=null,j&&(clearTimeout(j),j=null),f.apply(null,me)};return[(...me)=>{const ve=Date.now(),ae=ve-k;ae>=P?S(me,ve):(D=me,j||(j=setTimeout(()=>{j=null,S(D)},P-ae)))},()=>D&&S(D)]}const dl=(f,x,k=3)=>{let P=0;const D=Jf(50,250);return Kf(j=>{const S=j.loaded,c=j.lengthComputable?j.total:void 0,fe=S-P,me=D(fe),ve=S<=c;P=S;const ae={loaded:S,total:c,progress:c?S/c:void 0,bytes:fe,rate:me||void 0,estimated:me&&c&&ve?(c-S)/me:void 0,event:j,lengthComputable:c!=null,[x?"download":"upload"]:!0};f(ae)},k)},Su=(f,x)=>{const k=f!=null;return[P=>x[0]({lengthComputable:k,total:f,loaded:P}),x[1]]},Tu=f=>(...x)=>ge.asap(()=>f(...x)),Yf=Ir.hasStandardBrowserEnv?function(){const x=/(msie|trident)/i.test(navigator.userAgent),k=document.createElement("a");let P;function D(j){let S=j;return x&&(k.setAttribute("href",S),S=k.href),k.setAttribute("href",S),{href:k.href,protocol:k.protocol?k.protocol.replace(/:$/,""):"",host:k.host,search:k.search?k.search.replace(/^\?/,""):"",hash:k.hash?k.hash.replace(/^#/,""):"",hostname:k.hostname,port:k.port,pathname:k.pathname.charAt(0)==="/"?k.pathname:"/"+k.pathname}}return P=D(window.location.href),function(S){const c=ge.isString(S)?D(S):S;return c.protocol===P.protocol&&c.host===P.host}}():function(){return function(){return!0}}(),Qf=Ir.hasStandardBrowserEnv?{write(f,x,k,P,D,j){const S=[f+"="+encodeURIComponent(x)];ge.isNumber(k)&&S.push("expires="+new Date(k).toGMTString()),ge.isString(P)&&S.push("path="+P),ge.isString(D)&&S.push("domain="+D),j===!0&&S.push("secure"),document.cookie=S.join("; ")},read(f){const x=document.cookie.match(new RegExp("(^|;\\s*)("+f+")=([^;]*)"));return x?decodeURIComponent(x[3]):null},remove(f){this.write(f,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function em(f){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(f)}function tm(f,x){return x?f.replace(/\/?\/$/,"")+"/"+x.replace(/^\/+/,""):f}function ku(f,x){return f&&!em(x)?tm(f,x):x}const Iu=f=>f instanceof Hi?{...f}:f;function is(f,x){x=x||{};const k={};function P(me,ve,ae){return ge.isPlainObject(me)&&ge.isPlainObject(ve)?ge.merge.call({caseless:ae},me,ve):ge.isPlainObject(ve)?ge.merge({},ve):ge.isArray(ve)?ve.slice():ve}function D(me,ve,ae){if(ge.isUndefined(ve)){if(!ge.isUndefined(me))return P(void 0,me,ae)}else return P(me,ve,ae)}function j(me,ve){if(!ge.isUndefined(ve))return P(void 0,ve)}function S(me,ve){if(ge.isUndefined(ve)){if(!ge.isUndefined(me))return P(void 0,me)}else return P(void 0,ve)}function c(me,ve,ae){if(ae in x)return P(me,ve);if(ae in f)return P(void 0,me)}const fe={url:j,method:j,data:j,baseURL:S,transformRequest:S,transformResponse:S,paramsSerializer:S,timeout:S,timeoutMessage:S,withCredentials:S,withXSRFToken:S,adapter:S,responseType:S,xsrfCookieName:S,xsrfHeaderName:S,onUploadProgress:S,onDownloadProgress:S,decompress:S,maxContentLength:S,maxBodyLength:S,beforeRedirect:S,transport:S,httpAgent:S,httpsAgent:S,cancelToken:S,socketPath:S,responseEncoding:S,validateStatus:c,headers:(me,ve)=>D(Iu(me),Iu(ve),!0)};return ge.forEach(Object.keys(Object.assign({},f,x)),function(ve){const ae=fe[ve]||D,le=ae(f[ve],x[ve],ve);ge.isUndefined(le)&&ae!==c||(k[ve]=le)}),k}const Cu=f=>{const x=is({},f);let{data:k,withXSRFToken:P,xsrfHeaderName:D,xsrfCookieName:j,headers:S,auth:c}=x;x.headers=S=Hi.from(S),x.url=gu(ku(x.baseURL,x.url),f.params,f.paramsSerializer),c&&S.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let fe;if(ge.isFormData(k)){if(Ir.hasStandardBrowserEnv||Ir.hasStandardBrowserWebWorkerEnv)S.setContentType(void 0);else if((fe=S.getContentType())!==!1){const[me,...ve]=fe?fe.split(";").map(ae=>ae.trim()).filter(Boolean):[];S.setContentType([me||"multipart/form-data",...ve].join("; "))}}if(Ir.hasStandardBrowserEnv&&(P&&ge.isFunction(P)&&(P=P(x)),P||P!==!1&&Yf(x.url))){const me=D&&j&&Qf.read(j);me&&S.set(D,me)}return x},im=typeof XMLHttpRequest<"u"&&function(f){return new Promise(function(k,P){const D=Cu(f);let j=D.data;const S=Hi.from(D.headers).normalize();let{responseType:c,onUploadProgress:fe,onDownloadProgress:me}=D,ve,ae,le,ht,$e;function Ke(){ht&&ht(),$e&&$e(),D.cancelToken&&D.cancelToken.unsubscribe(ve),D.signal&&D.signal.removeEventListener("abort",ve)}let Oe=new XMLHttpRequest;Oe.open(D.method.toUpperCase(),D.url,!0),Oe.timeout=D.timeout;function ft(){if(!Oe)return;const He=Hi.from("getAllResponseHeaders"in Oe&&Oe.getAllResponseHeaders()),wt={data:!c||c==="text"||c==="json"?Oe.responseText:Oe.response,status:Oe.status,statusText:Oe.statusText,headers:He,config:f,request:Oe};wu(function($t){k($t),Ke()},function($t){P($t),Ke()},wt),Oe=null}"onloadend"in Oe?Oe.onloadend=ft:Oe.onreadystatechange=function(){!Oe||Oe.readyState!==4||Oe.status===0&&!(Oe.responseURL&&Oe.responseURL.indexOf("file:")===0)||setTimeout(ft)},Oe.onabort=function(){Oe&&(P(new ct("Request aborted",ct.ECONNABORTED,f,Oe)),Oe=null)},Oe.onerror=function(){P(new ct("Network Error",ct.ERR_NETWORK,f,Oe)),Oe=null},Oe.ontimeout=function(){let Ft=D.timeout?"timeout of "+D.timeout+"ms exceeded":"timeout exceeded";const wt=D.transitional||yu;D.timeoutErrorMessage&&(Ft=D.timeoutErrorMessage),P(new ct(Ft,wt.clarifyTimeoutError?ct.ETIMEDOUT:ct.ECONNABORTED,f,Oe)),Oe=null},j===void 0&&S.setContentType(null),"setRequestHeader"in Oe&&ge.forEach(S.toJSON(),function(Ft,wt){Oe.setRequestHeader(wt,Ft)}),ge.isUndefined(D.withCredentials)||(Oe.withCredentials=!!D.withCredentials),c&&c!=="json"&&(Oe.responseType=D.responseType),me&&([le,$e]=dl(me,!0),Oe.addEventListener("progress",le)),fe&&Oe.upload&&([ae,ht]=dl(fe),Oe.upload.addEventListener("progress",ae),Oe.upload.addEventListener("loadend",ht)),(D.cancelToken||D.signal)&&(ve=He=>{Oe&&(P(!He||He.type?new $s(null,f,Oe):He),Oe.abort(),Oe=null)},D.cancelToken&&D.cancelToken.subscribe(ve),D.signal&&(D.signal.aborted?ve():D.signal.addEventListener("abort",ve)));const st=Xf(D.url);if(st&&Ir.protocols.indexOf(st)===-1){P(new ct("Unsupported protocol "+st+":",ct.ERR_BAD_REQUEST,f));return}Oe.send(j||null)})},rm=(f,x)=>{let k=new AbortController,P;const D=function(fe){if(!P){P=!0,S();const me=fe instanceof Error?fe:this.reason;k.abort(me instanceof ct?me:new $s(me instanceof Error?me.message:me))}};let j=x&&setTimeout(()=>{D(new ct(`timeout ${x} of ms exceeded`,ct.ETIMEDOUT))},x);const S=()=>{f&&(j&&clearTimeout(j),j=null,f.forEach(fe=>{fe&&(fe.removeEventListener?fe.removeEventListener("abort",D):fe.unsubscribe(D))}),f=null)};f.forEach(fe=>fe&&fe.addEventListener&&fe.addEventListener("abort",D));const{signal:c}=k;return c.unsubscribe=S,[c,()=>{j&&clearTimeout(j),j=null}]},nm=function*(f,x){let k=f.byteLength;if(!x||k<x){yield f;return}let P=0,D;for(;P<k;)D=P+x,yield f.slice(P,D),P=D},sm=async function*(f,x,k){for await(const P of f)yield*nm(ArrayBuffer.isView(P)?P:await k(String(P)),x)},Eu=(f,x,k,P,D)=>{const j=sm(f,x,D);let S=0,c,fe=me=>{c||(c=!0,P&&P(me))};return new ReadableStream({async pull(me){try{const{done:ve,value:ae}=await j.next();if(ve){fe(),me.close();return}let le=ae.byteLength;if(k){let ht=S+=le;k(ht)}me.enqueue(new Uint8Array(ae))}catch(ve){throw fe(ve),ve}},cancel(me){return fe(me),j.return()}},{highWaterMark:2})},pl=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Pu=pl&&typeof ReadableStream=="function",Mc=pl&&(typeof TextEncoder=="function"?(f=>x=>f.encode(x))(new TextEncoder):async f=>new Uint8Array(await new Response(f).arrayBuffer())),Au=(f,...x)=>{try{return!!f(...x)}catch{return!1}},om=Pu&&Au(()=>{let f=!1;const x=new Request(Ir.origin,{body:new ReadableStream,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!x}),Mu=64*1024,zc=Pu&&Au(()=>ge.isReadableStream(new Response("").body)),fl={stream:zc&&(f=>f.body)};pl&&(f=>{["text","arrayBuffer","blob","formData","stream"].forEach(x=>{!fl[x]&&(fl[x]=ge.isFunction(f[x])?k=>k[x]():(k,P)=>{throw new ct(`Response type '${x}' is not supported`,ct.ERR_NOT_SUPPORT,P)})})})(new Response);const am=async f=>{if(f==null)return 0;if(ge.isBlob(f))return f.size;if(ge.isSpecCompliantForm(f))return(await new Request(f).arrayBuffer()).byteLength;if(ge.isArrayBufferView(f)||ge.isArrayBuffer(f))return f.byteLength;if(ge.isURLSearchParams(f)&&(f=f+""),ge.isString(f))return(await Mc(f)).byteLength},lm=async(f,x)=>{const k=ge.toFiniteNumber(f.getContentLength());return k??am(x)},Dc={http:Mf,xhr:im,fetch:pl&&(async f=>{let{url:x,method:k,data:P,signal:D,cancelToken:j,timeout:S,onDownloadProgress:c,onUploadProgress:fe,responseType:me,headers:ve,withCredentials:ae="same-origin",fetchOptions:le}=Cu(f);me=me?(me+"").toLowerCase():"text";let[ht,$e]=D||j||S?rm([D,j],S):[],Ke,Oe;const ft=()=>{!Ke&&setTimeout(()=>{ht&&ht.unsubscribe()}),Ke=!0};let st;try{if(fe&&om&&k!=="get"&&k!=="head"&&(st=await lm(ve,P))!==0){let Wt=new Request(x,{method:"POST",body:P,duplex:"half"}),$t;if(ge.isFormData(P)&&($t=Wt.headers.get("content-type"))&&ve.setContentType($t),Wt.body){const[Vr,bi]=Su(st,dl(Tu(fe)));P=Eu(Wt.body,Mu,Vr,bi,Mc)}}ge.isString(ae)||(ae=ae?"include":"omit"),Oe=new Request(x,{...le,signal:ht,method:k.toUpperCase(),headers:ve.normalize().toJSON(),body:P,duplex:"half",credentials:ae});let He=await fetch(Oe);const Ft=zc&&(me==="stream"||me==="response");if(zc&&(c||Ft)){const Wt={};["status","statusText","headers"].forEach(Nr=>{Wt[Nr]=He[Nr]});const $t=ge.toFiniteNumber(He.headers.get("content-length")),[Vr,bi]=c&&Su($t,dl(Tu(c),!0))||[];He=new Response(Eu(He.body,Mu,Vr,()=>{bi&&bi(),Ft&&ft()},Mc),Wt)}me=me||"text";let wt=await fl[ge.findKey(fl,me)||"text"](He,f);return!Ft&&ft(),$e&&$e(),await new Promise((Wt,$t)=>{wu(Wt,$t,{data:wt,headers:Hi.from(He.headers),status:He.status,statusText:He.statusText,config:f,request:Oe})})}catch(He){throw ft(),He&&He.name==="TypeError"&&/fetch/i.test(He.message)?Object.assign(new ct("Network Error",ct.ERR_NETWORK,f,Oe),{cause:He.cause||He}):ct.from(He,He&&He.code,f,Oe)}})};ge.forEach(Dc,(f,x)=>{if(f){try{Object.defineProperty(f,"name",{value:x})}catch{}Object.defineProperty(f,"adapterName",{value:x})}});const zu=f=>`- ${f}`,cm=f=>ge.isFunction(f)||f===null||f===!1,Du={getAdapter:f=>{f=ge.isArray(f)?f:[f];const{length:x}=f;let k,P;const D={};for(let j=0;j<x;j++){k=f[j];let S;if(P=k,!cm(k)&&(P=Dc[(S=String(k)).toLowerCase()],P===void 0))throw new ct(`Unknown adapter '${S}'`);if(P)break;D[S||"#"+j]=P}if(!P){const j=Object.entries(D).map(([c,fe])=>`adapter ${c} `+(fe===!1?"is not supported by the environment":"is not available in the build"));let S=x?j.length>1?`since :
|
583
583
|
`+j.map(zu).join(`
|
584
584
|
`):" "+zu(j[0]):"as no adapter specified";throw new ct("There is no suitable adapter to dispatch the request "+S,"ERR_NOT_SUPPORT")}return P},adapters:Dc};function Lc(f){if(f.cancelToken&&f.cancelToken.throwIfRequested(),f.signal&&f.signal.aborted)throw new $s(null,f)}function Lu(f){return Lc(f),f.headers=Hi.from(f.headers),f.data=Ac.call(f,f.transformRequest),["post","put","patch"].indexOf(f.method)!==-1&&f.headers.setContentType("application/x-www-form-urlencoded",!1),Du.getAdapter(f.adapter||$o.adapter)(f).then(function(P){return Lc(f),P.data=Ac.call(f,f.transformResponse,P),P.headers=Hi.from(P.headers),P},function(P){return bu(P)||(Lc(f),P&&P.response&&(P.response.data=Ac.call(f,f.transformResponse,P.response),P.response.headers=Hi.from(P.response.headers))),Promise.reject(P)})}const Ru="1.7.4",Rc={};["object","boolean","number","function","string","symbol"].forEach((f,x)=>{Rc[f]=function(P){return typeof P===f||"a"+(x<1?"n ":" ")+f}});const Bu={};Rc.transitional=function(x,k,P){function D(j,S){return"[Axios v"+Ru+"] Transitional option '"+j+"'"+S+(P?". "+P:"")}return(j,S,c)=>{if(x===!1)throw new ct(D(S," has been removed"+(k?" in "+k:"")),ct.ERR_DEPRECATED);return k&&!Bu[S]&&(Bu[S]=!0,console.warn(D(S," has been deprecated since v"+k+" and will be removed in the near future"))),x?x(j,S,c):!0}};function hm(f,x,k){if(typeof f!="object")throw new ct("options must be an object",ct.ERR_BAD_OPTION_VALUE);const P=Object.keys(f);let D=P.length;for(;D-- >0;){const j=P[D],S=x[j];if(S){const c=f[j],fe=c===void 0||S(c,j,f);if(fe!==!0)throw new ct("option "+j+" must be "+fe,ct.ERR_BAD_OPTION_VALUE);continue}if(k!==!0)throw new ct("Unknown option "+j,ct.ERR_BAD_OPTION)}}const Bc={assertOptions:hm,validators:Rc},Cn=Bc.validators;class rs{constructor(x){this.defaults=x,this.interceptors={request:new _u,response:new _u}}async request(x,k){try{return await this._request(x,k)}catch(P){if(P instanceof Error){let D;Error.captureStackTrace?Error.captureStackTrace(D={}):D=new Error;const j=D.stack?D.stack.replace(/^.+\n/,""):"";try{P.stack?j&&!String(P.stack).endsWith(j.replace(/^.+\n.+\n/,""))&&(P.stack+=`
|
585
|
-
`+j):P.stack=j}catch{}}throw P}}_request(x,k){typeof x=="string"?(k=k||{},k.url=x):k=x||{},k=is(this.defaults,k);const{transitional:P,paramsSerializer:D,headers:j}=k;P!==void 0&&Bc.assertOptions(P,{silentJSONParsing:Cn.transitional(Cn.boolean),forcedJSONParsing:Cn.transitional(Cn.boolean),clarifyTimeoutError:Cn.transitional(Cn.boolean)},!1),D!=null&&(ge.isFunction(D)?k.paramsSerializer={serialize:D}:Bc.assertOptions(D,{encode:Cn.function,serialize:Cn.function},!0)),k.method=(k.method||this.defaults.method||"get").toLowerCase();let S=j&&ge.merge(j.common,j[k.method]);j&&ge.forEach(["delete","get","head","post","put","patch","common"],$e=>{delete j[$e]}),k.headers=Hi.concat(S,j);const c=[];let fe=!0;this.interceptors.request.forEach(function(Ke){typeof Ke.runWhen=="function"&&Ke.runWhen(k)===!1||(fe=fe&&Ke.synchronous,c.unshift(Ke.fulfilled,Ke.rejected))});const me=[];this.interceptors.response.forEach(function(Ke){me.push(Ke.fulfilled,Ke.rejected)});let ve,ae=0,le;if(!fe){const $e=[Lu.bind(this),void 0];for($e.unshift.apply($e,c),$e.push.apply($e,me),le=$e.length,ve=Promise.resolve(k);ae<le;)ve=ve.then($e[ae++],$e[ae++]);return ve}le=c.length;let ht=k;for(ae=0;ae<le;){const $e=c[ae++],Ke=c[ae++];try{ht=$e(ht)}catch(Oe){Ke.call(this,Oe);break}}try{ve=Lu.call(this,ht)}catch($e){return Promise.reject($e)}for(ae=0,le=me.length;ae<le;)ve=ve.then(me[ae++],me[ae++]);return ve}getUri(x){x=is(this.defaults,x);const k=ku(x.baseURL,x.url);return gu(k,x.params,x.paramsSerializer)}}ge.forEach(["delete","get","head","options"],function(x){rs.prototype[x]=function(k,P){return this.request(is(P||{},{method:x,url:k,data:(P||{}).data}))}}),ge.forEach(["post","put","patch"],function(x){function k(P){return function(j,S,c){return this.request(is(c||{},{method:x,headers:P?{"Content-Type":"multipart/form-data"}:{},url:j,data:S}))}}rs.prototype[x]=k(),rs.prototype[x+"Form"]=k(!0)});class Fc{constructor(x){if(typeof x!="function")throw new TypeError("executor must be a function.");let k;this.promise=new Promise(function(j){k=j});const P=this;this.promise.then(D=>{if(!P._listeners)return;let j=P._listeners.length;for(;j-- >0;)P._listeners[j](D);P._listeners=null}),this.promise.then=D=>{let j;const S=new Promise(c=>{P.subscribe(c),j=c}).then(D);return S.cancel=function(){P.unsubscribe(j)},S},x(function(j,S,c){P.reason||(P.reason=new $s(j,S,c),k(P.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(x){if(this.reason){x(this.reason);return}this._listeners?this._listeners.push(x):this._listeners=[x]}unsubscribe(x){if(!this._listeners)return;const k=this._listeners.indexOf(x);k!==-1&&this._listeners.splice(k,1)}static source(){let x;return{token:new Fc(function(D){x=D}),cancel:x}}}function um(f){return function(k){return f.apply(null,k)}}function dm(f){return ge.isObject(f)&&f.isAxiosError===!0}const Oc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Oc).forEach(([f,x])=>{Oc[x]=f});function Fu(f){const x=new rs(f),k=eu(rs.prototype.request,x);return ge.extend(k,rs.prototype,x,{allOwnKeys:!0}),ge.extend(k,x,null,{allOwnKeys:!0}),k.create=function(D){return Fu(is(f,D))},k}const Zt=Fu($o);Zt.Axios=rs,Zt.CanceledError=$s,Zt.CancelToken=Fc,Zt.isCancel=bu,Zt.VERSION=Ru,Zt.toFormData=hl,Zt.AxiosError=ct,Zt.Cancel=Zt.CanceledError,Zt.all=function(x){return Promise.all(x)},Zt.spread=um,Zt.isAxiosError=dm,Zt.mergeConfig=is,Zt.AxiosHeaders=Hi,Zt.formToJSON=f=>xu(ge.isHTMLForm(f)?new FormData(f):f),Zt.getAdapter=Du.getAdapter,Zt.HttpStatusCode=Oc,Zt.default=Zt;const pm=(f,x=300)=>{let k;return function(...D){clearTimeout(k),k=setTimeout(()=>{f.apply(this,D)},x)}};function ml(f,x,k={}){const P={type:"Feature"};return(k.id===0||k.id)&&(P.id=k.id),k.bbox&&(P.bbox=k.bbox),P.properties=x||{},P.geometry=f,P}function Ou(f,x,k={}){if(!f)throw new Error("coordinates is required");if(!Array.isArray(f))throw new Error("coordinates must be an Array");if(f.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Uu(f[0])||!Uu(f[1]))throw new Error("coordinates must contain numbers");return ml({type:"Point",coordinates:f},x,k)}function Vu(f,x,k={}){for(const D of f){if(D.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(D[D.length-1].length!==D[0].length)throw new Error("First and last Position are not equivalent.");for(let j=0;j<D[D.length-1].length;j++)if(D[D.length-1][j]!==D[0][j])throw new Error("First and last Position are not equivalent.")}return ml({type:"Polygon",coordinates:f},x,k)}function Nu(f,x,k={}){return ml({type:"MultiPoint",coordinates:f},x,k)}function $u(f,x,k={}){return ml({type:"MultiPolygon",coordinates:f},x,k)}function Uu(f){return!isNaN(f)&&f!==null&&!Array.isArray(f)}function Vc(f,x,k){if(f!==null)for(var P,D,j,S,c,fe,me,ve=0,ae=0,le,ht=f.type,$e=ht==="FeatureCollection",Ke=ht==="Feature",Oe=$e?f.features.length:1,ft=0;ft<Oe;ft++){me=$e?f.features[ft].geometry:Ke?f.geometry:f,le=me?me.type==="GeometryCollection":!1,c=le?me.geometries.length:1;for(var st=0;st<c;st++){var He=0,Ft=0;if(S=le?me.geometries[st]:me,S!==null){fe=S.coordinates;var wt=S.type;switch(ve=k&&(wt==="Polygon"||wt==="MultiPolygon")?1:0,wt){case null:break;case"Point":if(x(fe,ae,ft,He,Ft)===!1)return!1;ae++,He++;break;case"LineString":case"MultiPoint":for(P=0;P<fe.length;P++){if(x(fe[P],ae,ft,He,Ft)===!1)return!1;ae++,wt==="MultiPoint"&&He++}wt==="LineString"&&He++;break;case"Polygon":case"MultiLineString":for(P=0;P<fe.length;P++){for(D=0;D<fe[P].length-ve;D++){if(x(fe[P][D],ae,ft,He,Ft)===!1)return!1;ae++}wt==="MultiLineString"&&He++,wt==="Polygon"&&Ft++}wt==="Polygon"&&He++;break;case"MultiPolygon":for(P=0;P<fe.length;P++){for(Ft=0,D=0;D<fe[P].length;D++){for(j=0;j<fe[P][D].length-ve;j++){if(x(fe[P][D][j],ae,ft,He,Ft)===!1)return!1;ae++}Ft++}He++}break;case"GeometryCollection":for(P=0;P<S.geometries.length;P++)if(Vc(S.geometries[P],x,k)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function jo(f,x={}){if(f.bbox!=null&&x.recompute!==!0)return f.bbox;const k=[1/0,1/0,-1/0,-1/0];return Vc(f,P=>{k[0]>P[0]&&(k[0]=P[0]),k[1]>P[1]&&(k[1]=P[1]),k[2]<P[0]&&(k[2]=P[0]),k[3]<P[1]&&(k[3]=P[1])}),k}function fm(f,x={}){const k=jo(f),P=(k[0]+k[2])/2,D=(k[1]+k[3])/2;return Ou([P,D],x.properties,x)}function mm(f,x={}){let k=0,P=0,D=0;return Vc(f,function(j){k+=j[0],P+=j[1],D++},!0),Ou([k/D,P/D],x.properties)}const gm={mixins:[Oo],props:{map:{type:Object},baseLayers:{type:Array,default:[{id:"orto10",name:"Ortophoto 1:10К",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",service:"TMS",category:"Національна інфраструктура геопросторових даних",scale:1e4,year:2020,bounds:"ua",maxzoom:18,owner:"НДІГК (Інститут геодезії та картографії)",image:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4954/2876.png",basemap:!0},{id:"graymap",name:"Сіра карта",url:"https://basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",service:"TMS",category:"Базові карти",attribution:"© <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>, © <a href='https://carto.com/attributions'>CARTO</a>",bounds1:"ua",image:"https://basemaps.cartocdn.com/light_all/10/601/348.png",position:0,owner:"OSM",basemap:!0},{id:"darkmap_carto",name:"Темна карта України",image:"https://basemaps.cartocdn.com/dark_all/13/4791/2762.png?ver=2023-04-14",url:"https://basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png",service:"TMS",category:"Базові карти",active:!1}]},selectedLayer:{type:String,required:!0}},watch:{map(f){f&&f.on("load",this.handleMapLoad)}},methods:{handleMapLoad(){var f;this.baseLayers.forEach(x=>{this.layerList.push(x)}),this.toggleLayerVisibility((f=this.baseLayers[0])==null?void 0:f.id)},toggleLayerVisibility(f){this.$emit("update:selectedLayer",f),this.changeBaseLayer(f)}}},_m={class:"vs-map-slot-layers z-10 select-none"},ym=["onClick"],xm=["src"];function vm(f,x,k,P,D,j){return N.openBlock(),N.createElementBlock("div",_m,[(N.openBlock(!0),N.createElementBlock(N.Fragment,null,N.renderList(k.baseLayers,(S,c)=>(N.openBlock(),N.createElementBlock("div",{key:S.id,class:N.normalizeClass(["vs-map-slot-layers__layer relative",{focused:S.id==k.selectedLayer}]),onClick:fe=>j.toggleLayerVisibility(S.id)},[N.createElementVNode("img",{src:S.image,class:"vs-map-slot-layers__image"},null,8,xm),N.createElementVNode("div",{class:N.normalizeClass(["absolute py-2 px-4 text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg top-[-46px] text-nowrap p-2 hidden whitespace-nowrap",[c===0?"left-[-10px]":"left-[50%] translate-x-[-50%]"]])},N.toDisplayString(S==null?void 0:S.name),3)],10,ym))),128))])}const bm=Fi(gm,[["render",vm],["__scopeId","data-v-8959e540"]]),wm={},Sm={class:"shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Tm=[N.createElementVNode("path",{d:"M18 6 6 18"},null,-1),N.createElementVNode("path",{d:"m6 6 12 12"},null,-1)];function km(f,x){return N.openBlock(),N.createElementBlock("svg",Sm,Tm)}const gl=Fi(wm,[["render",km]]),Im={},Cm={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Em=[N.createElementVNode("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),N.createElementVNode("path",{d:"M2 17L12 22L22 17",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),N.createElementVNode("path",{d:"M2 12L12 17L22 12",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)];function Pm(f,x){return N.openBlock(),N.createElementBlock("svg",Cm,Em)}const Am={components:{closeIcon:gl,layersIcon:Fi(Im,[["render",Pm]])},mixins:[Oo],props:{layers:{type:Array,default:()=>[]},map:{type:Object,default:null},basemapIds:{type:Array,default:()=>[]}},data(){return{isOpen:!1,selectedLayers:[],mounted:!1}},mounted(){this.mounted=!0},methods:{async handleLayerChange(f,x){await this.setVisible(f,x),x&&this.map.getStyle().layers.filter(D=>!this.basemapIds.includes(D.id)&&D.id!==f.id).map(D=>D.id).forEach(D=>{this.map.getLayer(D)&&this.map.moveLayer(D)})}}},Mm=f=>(N.pushScopeId("data-v-4c33eaa0"),f=f(),N.popScopeId(),f),zm={class:"p-[10px]"},Dm={class:"select-none absolute left-[20px] top-[10px] border bg-white max-w-[250px] p-[10px] rounded-lg z-10"},Lm={class:"flex justify-between items-center border-b pb-[8px] text-[16px]"},Rm=Mm(()=>N.createElementVNode("span",null,"Додаткові шари",-1)),Bm={class:"mt-2 max-h-[300px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},Fm=["id","value","onChange"],Om=["for"];function Vm(f,x,k,P,D,j){const S=N.resolveComponent("layersIcon"),c=N.resolveComponent("VsPopover"),fe=N.resolveComponent("closeIcon");return N.openBlock(),N.createElementBlock(N.Fragment,null,[!D.isOpen&&D.mounted?(N.openBlock(),N.createBlock(c,{key:0,teleport:"body",trigger:"hover",placement:"right",class:"select-none flex absolute left-[20px] top-[10px] border bg-white max-w-[250px] rounded-lg cursor-pointer z-10",onClick:x[0]||(x[0]=me=>D.isOpen=!D.isOpen)},{reference:N.withCtx(()=>[N.createElementVNode("div",zm,[N.createVNode(S,{class:"h-5 w-5"})])]),default:N.withCtx(()=>[N.createTextVNode(" Додаткові шари ")]),_:1})):N.createCommentVNode("",!0),N.withDirectives(N.createElementVNode("div",Dm,[N.createElementVNode("div",Lm,[Rm,D.mounted?(N.openBlock(),N.createBlock(c,{key:0,teleport:"body",trigger:"hover",placement:"bottom",class:"flex"},{reference:N.withCtx(()=>[N.createElementVNode("button",{type:"button",class:"size-6 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:x[1]||(x[1]=me=>D.isOpen=!D.isOpen)},[N.createVNode(fe)])]),default:N.withCtx(()=>[N.createTextVNode(" Приховати панель ")]),_:1})):N.createCommentVNode("",!0)]),N.withDirectives(N.createElementVNode("div",Bm,[(N.openBlock(!0),N.createElementBlock(N.Fragment,null,N.renderList(k.layers,me=>(N.openBlock(),N.createElementBlock("div",{key:me.id,class:"flex items-center gap-2 text-sm"},[N.createElementVNode("input",{type:"checkbox",id:`layer-${me.id}`,value:me.id,class:"cursor-pointer",onChange:ve=>j.handleLayerChange(me,ve.target.checked)},null,40,Fm),N.createElementVNode("label",{for:`layer-${me.id}`,class:"cursor-pointer"},N.toDisplayString(me.name),9,Om)]))),128))],512),[[N.vShow,D.isOpen]])],512),[[N.vShow,D.isOpen]])],64)}const Nm=Fi(Am,[["render",Vm],["__scopeId","data-v-4c33eaa0"]]),$m={mixins:[Oo],components:{closeIcon:gl},props:{map:{type:Object,required:!0},compareLayers:{type:Array,default:()=>[]},table:{type:String,default:""},collapsed:{type:Boolean,default:!1}},data(){return{mounted:!1,currentLayer:null}},mounted(){var f,x;this.currentLayer=((x=(f=this.compareLayers)==null?void 0:f[0])==null?void 0:x.id)||null,this.mounted=!0},watch:{async currentLayer(f,x){const k=this.compareLayers.find(D=>D.id===x),P=this.compareLayers.find(D=>D.id===f);k&&await this.setVisible(k,!1,this.map),P&&await this.setVisible(P,!0,this.map),this.map.getStyle().layers.forEach(D=>{D.source===this.table&&this.map.getLayer(D.id)&&this.map.moveLayer(D.id)})}}},Um={class:"absolute w-full top-[10px] right-[50px] shadow-sm bg-white max-w-[250px] p-[10px] rounded-lg z-10 select-none border"},jm={class:"flex items-start justify-between pb-1 border-b"},qm=N.createElementVNode("div",{class:"text-[16px] max-w-[180px]"}," Базові шари порівняльної карти ",-1),Zm={class:"flex gap-2"},Gm=N.createElementVNode("button",{type:"button",class:"size-6 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"}," - ",-1),Hm={class:"pt-1 max-h-[300px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},Wm=["id","name","value"],Xm=["for"];function Jm(f,x,k,P,D,j){const S=N.resolveComponent("VsPopover"),c=N.resolveComponent("closeIcon");return N.withDirectives((N.openBlock(),N.createElementBlock("div",Um,[N.createElementVNode("div",jm,[qm,N.createElementVNode("div",Zm,[D.mounted?(N.openBlock(),N.createBlock(S,{key:0,trigger:"hover",placement:"bottom",teleport:"body",onClick:x[0]||(x[0]=fe=>f.$emit("update:collapsed",!0))},{reference:N.withCtx(()=>[Gm]),default:N.withCtx(()=>[N.createTextVNode(" Згорнути панель ")]),_:1})):N.createCommentVNode("",!0),D.mounted?(N.openBlock(),N.createBlock(S,{key:1,trigger:"hover",placement:"bottom",teleport:"body"},{reference:N.withCtx(()=>[N.createElementVNode("button",{type:"button",class:"size-6 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:x[1]||(x[1]=fe=>f.$emit("close"))},[N.createVNode(c,{class:"cursor-pointer"})])]),default:N.withCtx(()=>[N.createTextVNode(" Приховати панель ")]),_:1})):N.createCommentVNode("",!0)])]),N.createElementVNode("div",Hm,[(N.openBlock(!0),N.createElementBlock(N.Fragment,null,N.renderList(k.compareLayers,fe=>(N.openBlock(),N.createElementBlock("div",{key:fe.id,class:"flex items-center py-1"},[N.withDirectives(N.createElementVNode("input",{type:"radio",id:fe.id,name:fe.id,value:fe.id,"onUpdate:modelValue":x[2]||(x[2]=me=>D.currentLayer=me),class:"shrink-0 border-gray-200 rounded-full text-blue-600 focus:ring-blue-500 checked:border-blue-500 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800"},null,8,Wm),[[N.vModelRadio,D.currentLayer]]),N.createElementVNode("label",{for:fe.id,class:"text-[14px] ml-2 cursor-pointer"},N.toDisplayString(fe.name),9,Xm)]))),128))])],512)),[[N.vShow,!k.collapsed]])}const Km=Fi($m,[["render",Jm]]),Ym={},Qm={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eg=[N.createElementVNode("path",{d:"M18 8L22 12L18 16",stroke:"#333333","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),N.createElementVNode("path",{d:"M6 8L2 12L6 16",stroke:"#333333","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),N.createElementVNode("path",{d:"M2 12H22",stroke:"#333333","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)];function tg(f,x,k,P,D,j){return N.openBlock(),N.createElementBlock("svg",Qm,eg)}const ig={components:{closeIcon:gl,compareIcon:Fi(Ym,[["render",tg]]),CompareBaseLayers:Km},props:{map:{type:Object},compareLayers:{type:Array},table:{type:String}},data(){return{isOpen:!1,mounted:!1,afterMap:null,compare:null,isOpen:!1,afterMapLoaded:!1,collapsed:!1}},mounted(){this.mounted=!0,window.maplibregl=In,this.loadScripts()},computed:{modalButtonClasses(){return{"!bg-[#F2F2F2]":this.isOpen,"bg-white":!this.isOpen}}},watch:{isOpen(f){this.$emit("isCompareOpen",f)}},methods:{loadScripts(){const f=document.createElement("link");f.setAttribute("rel","stylesheet"),f.setAttribute("href","https://cdn.jsdelivr.net/npm/@maplibre/maplibre-gl-compare@0.5.0/dist/maplibre-gl-compare.min.css"),document.head.appendChild(f);const x=document.createElement("script");x.setAttribute("src","https://cdn.jsdelivr.net/npm/@maplibre/maplibre-gl-compare@0.5.0/dist/maplibre-gl-compare.min.js"),document.head.appendChild(x)},initCompare(){const f=this.map,x={version:8,glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf",sources:{},layers:[]},k=new In.Map({container:"after",style:x,center:f.getCenter(),zoom:f.getZoom(),minZoom:f.getMinZoom()});if(k.addControl(new In.NavigationControl({visualizePitch:!0})),k.on("load",()=>{this.afterMapLoaded=!0,this.syncLayers()}),this.afterMap=k,window.maplibregl&&window.maplibregl.Compare){const P="#comparison-container";this.compare=new window.maplibregl.Compare(f,k,P,{mousemove:!1})}else console.error("Compare is not available on window.maplibregl")},destroyCompare(){this.compare&&(this.compare.remove(),this.compare=null),this.afterMap&&(this.afterMap.remove(),this.afterMap=null),this.isOpen=!1,this.afterMapLoaded=!1},toggleCompare(){if(this.collapsed){this.collapsed=!1;return}this.isOpen=!this.isOpen,this.isOpen?this.$nextTick(()=>{this.initCompare(),this.resizeMaps()}):this.destroyCompare()},resizeMaps(){this.map.resize(),this.afterMap&&this.afterMap.resize()},syncLayers(){if(!this.map||!this.afterMap)return;const f=this.map,x=this.afterMap;f.getSource(this.table)&&(x.getSource(this.table)||x.addSource(this.table,f.getStyle().sources[this.table]));const P=f.getStyle().layers.filter(D=>D.source===this.table);P.length&&P.forEach(D=>{x.getLayer(D.id)||x.addLayer(D)})}}},rg={class:"w-[29px] h-[29px] flex items-center justify-center"},ng={key:2,id:"comparison-container",class:"absolute top-0 right-0 w-full h-full"},sg=[N.createElementVNode("div",{id:"after",class:"map-compare"},null,-1)];function og(f,x,k,P,D,j){const S=N.resolveComponent("compareIcon"),c=N.resolveComponent("VsPopover"),fe=N.resolveComponent("CompareBaseLayers");return N.openBlock(),N.createElementBlock(N.Fragment,null,[D.mounted?(N.openBlock(),N.createBlock(c,{key:0,teleport:"body",trigger:"hover",placement:"left",class:N.normalizeClass(["flex absolute right-[10px] top-[120px] bg-white max-w-[250px] rounded-lg cursor-pointer z-10",j.modalButtonClasses]),onClick:j.toggleCompare,style:{"box-shadow":"0 0 0 2px rgba(0, 0, 0, 0.2)"}},{reference:N.withCtx(()=>[N.createElementVNode("div",rg,[N.createVNode(S,{class:"w-4 h-4"})])]),default:N.withCtx(()=>[N.createTextVNode(" Порівняти шари ")]),_:1},8,["class","onClick"])):N.createCommentVNode("",!0),D.isOpen&&D.afterMapLoaded?(N.openBlock(),N.createBlock(fe,{key:1,table:k.table,map:D.afterMap,compareLayers:k.compareLayers,onClose:j.destroyCompare,collapsed:D.collapsed,"onUpdate:collapsed":x[0]||(x[0]=me=>D.collapsed=me)},null,8,["table","map","compareLayers","onClose","collapsed"])):N.createCommentVNode("",!0),D.isOpen?(N.openBlock(),N.createElementBlock("div",ng,sg)):N.createCommentVNode("",!0)],64)}const ag=Fi(ig,[["render",og]]),lg={props:["colors","strokes","title"],methods:{capitalizeFirstLetter(f){return f?f.charAt(0).toUpperCase()+f.slice(1):""}}},cg={class:"absolute left-[20px] bottom-[74px] bg-white max-w-[250px] p-[10px] rounded-lg z-10 border"},hg={key:0,class:"mb-[10px] text-[1rem]"},ug={key:1},dg={class:"legend-item flex items-center gap-2 mb-[10px]"},pg={class:"ml-1 text-[0.875rem]"},fg={class:"legend-item"},mg={key:0,class:"flex justify-start items-center gap-2"},gg={class:"ml-1 text-[0.875rem]"};function _g(f,x,k,P,D,j){var S;return N.openBlock(),N.createElementBlock("div",cg,[k.title?(N.openBlock(),N.createElementBlock("div",hg,N.toDisplayString(k.title),1)):N.createCommentVNode("",!0),(S=k.strokes)!=null&&S.length?(N.openBlock(),N.createElementBlock("div",ug,[(N.openBlock(!0),N.createElementBlock(N.Fragment,null,N.renderList(k.strokes,c=>(N.openBlock(),N.createElementBlock("div",dg,[N.createElementVNode("div",{class:"w-[15px] h-[4px]",style:N.normalizeStyle({background:`repeating-linear-gradient(to right, ${c.color}, ${c.color} 5px, transparent 5px, transparent 8px)`})},null,4),N.createElementVNode("div",pg,N.toDisplayString(j.capitalizeFirstLetter(c.text)),1)]))),256))])):N.createCommentVNode("",!0),(N.openBlock(!0),N.createElementBlock(N.Fragment,null,N.renderList(k.colors,c=>(N.openBlock(),N.createElementBlock("div",fg,[c.id>0?(N.openBlock(),N.createElementBlock("div",mg,[N.createElementVNode("div",{class:"w-[15px] h-[15px] rounded-[50%] min-w-[15px]",style:N.normalizeStyle({backgroundColor:c.color})},null,4),N.createElementVNode("div",gg,N.toDisplayString(j.capitalizeFirstLetter(c.text)),1)])):N.createCommentVNode("",!0)]))),256))])}const yg={components:{MapSlotLayers:bm,MapLegend:Fi(lg,[["render",_g]]),AdditionalLayers:Nm,MapCompare:ag},props:{isMapCompare:{type:Boolean,default:!0},polygonOpacity:{type:Number,default:()=>null},polygonStrokeWidth:{type:Number,default:()=>4},dashedLine:{type:Boolean,default:()=>!1},colorAttr:null,strokeAttr:null,zoom:{type:Array,default:()=>8},defaultColor:{type:String,default:"blue"},selectedBaseLayer:{type:String,required:!0},legendname:{type:String,default:()=>""},height:{type:String,default:()=>"100vh"},width:{type:String,default:"100vw"},center:{type:Array,default:[32,49]},maxBounds:{type:Array,default:[[22,44],[40,52]]},table:{type:String,default:""},zoom:{type:[String,Number],default:13},minZoom:{type:[String,Number],default:1},basemap:Array,additionalLayers:Array,filtersParam:{type:String,default:""},row:{type:Object,default:{}},pointZoom:{type:String,default:"12"},legend:{type:Boolean,default:()=>!0},compareLayers:{type:Array,default:()=>[]}},mixins:[Oo],data(){return{map:null,hoverObject:null,popup:null,colors:[]}},async mounted(){var f,x,k,P;try{if(await this.createMap(),(f=this.row)!=null&&f.geom){const{type:D,coordinates:j}=this.row.geom;let S;switch(D){case"Polygon":S=Vu(j);break;case"MultiPolygon":S=$u(j);break;case"MultiPoint":S=Nu(j);break;default:(x=this.map)==null||x.fitBounds([j,j],{maxZoom:this.zoom,padding:30,duration:0}),this.isSelectObj=!0;return}const c=fm(S).geometry.coordinates;(k=this.map)==null||k.fitBounds([c,c],{maxZoom:this.zoom,padding:30,duration:0})}(P=this.map)==null||P.fitBounds(this.center,{duration:0})}catch{}},watch:{filtersParam(f){this.setFilter(this.table,f)},selectedBaseLayer(f){this.$emit("update:selectedBaseLayer",f)},row:{handler(f){f!=null&&f.geom&&this.fitToBounds(f.geom),this.map&&this.map.getStyle()&&this.map.getStyle().layers.filter(P=>P.source===this.table&&P.type==="line").forEach(P=>{var D;this.map.setPaintProperty(P.id,"line-width",((D=this.row)==null?void 0:D.id)!=null?["case",["==",["get","id"],this.row.id.toString()],(this.polygonStrokeWidth??2.5)*2,this.polygonStrokeWidth??2.5]:this.polygonStrokeWidth??2.5)})},immediate:!0}},computed:{basemapIds(){return this.basemap.map(f=>f==null?void 0:f.id)},allLayers(){return[...this.basemap||[],...this.additionalLayers||[],...this.compareLayers||[]]}},methods:{async getColorStyle(){var f=[["#69D2E7","#A7DBD8","#E0E4CC","#F38630","#FA6900"],["#FE4365","#FC9D9A","#F9CDAD","#C8C8A9","#83AF9B"],["#ECD078","#D95B43","#C02942","#542437","#53777A"]];if(!this.colorAttr)return this.defaultColor;try{const{data:{rows:x}}=await Zt.get(`/api/data/${this.table}/${this.colorAttr}`),k=x.reduce((P,D,j)=>D!=null&&D.id?[...P,D.id.toString(),D.color||f[0][j%5]]:P,["match",["get",this.colorAttr]]);return this.colors=[...x],k.push("gray"),k}catch(x){console.log(x)}},async getStrokeStyle(){if(!this.strokeAttr)return"transparent";try{const{data:{rows:f}}=await Zt.get(`/api/data/${this.table}/${this.strokeAttr}`),x=f.reduce((k,P,D)=>P!=null&&P.id?[...k,{id:P.id.toString(),color:P.color||"#000000",dash:P.dash||[2,2],text:P.text||P.id.toString()}]:k,[]);return this.strokes=[...x],["match",["get",this.strokeAttr],...x.flatMap(({id:k,color:P})=>[k,P]),"transparent"]}catch(f){return console.log(f),"transparent"}},async handleMapLoad(){var P,D,j,S,c;(P=this.row)!=null&&P.geom&&this.fitToBounds(this.row.geom),this.$emit("map",this.map);const f=await this.getStrokeStyle(),x=await this.getColorStyle(),k=((j=(D=location.search.split("&").find(fe=>fe.includes("filter=")))==null?void 0:D.split("filter="))==null?void 0:j[1])||"";await this.addLayer({id:this.table,service:"vector",url:`/api/vtile/${this.table}/ua/{z}/{x}/{y}.vmt?pointZoom=${this.pointZoom}&dt=${new Date().toISOString()}${k?`&filter=${k}`:""}`,layers:[{type:"fill","source-layer":this.table,paint:{"fill-color":x,"fill-opacity":this.polygonOpacity??.5,"fill-outline-color":["case",["==",["feature-state","hover"],!0],"red","#000000"]},filter:["all",["==",["geometry-type"],"Polygon"]]},{type:"circle","source-layer":this.table,filter:["all",["==",["geometry-type"],"Point"]],paint:{"circle-radius":{base:1.75,stops:[[10,5],[12,6],[18,12]]},"circle-stroke-color":["case",["==",["feature-state","hover"],!0],"red","#ccc"],"circle-stroke-width":["case",["==",["feature-state","hover"],!0],2,1],"circle-color":x}},{type:"line",paint:{"line-color":x,"line-width":((S=this.row)==null?void 0:S.id)!=null?["case",["==",["get","id"],this.row.id.toString()],(this.polygonStrokeWidth??2.5)*2,this.polygonStrokeWidth??2.5]:this.polygonStrokeWidth??2.5}},...this.dashedLine?[{type:"line",paint:{"line-color":f,"line-width":((c=this.row)==null?void 0:c.id)!=null?["case",["==",["get","id"],this.row.id.toString()],(this.polygonStrokeWidth??2.5)*2,this.polygonStrokeWidth??2.5]:this.polygonStrokeWidth??2.5,"line-dasharray":[2,2]}}]:[]]})},async createMap(){const f={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new In.Map({container:"maplibre-map",style:f,zoom:this.zoom,center:this.center,minZoom:this.minZoom}),this.$parent.map=this.map,this.map.addControl(new In.NavigationControl({visualizePitch:!0})),this.map.on("load",this.handleMapLoad)},fitToBounds(f){if(!this.map)return;const{type:x,coordinates:k}=f;let P,D;switch(x){case"Polygon":P=Vu(k),D=jo(P),this.map.fitBounds(D,{padding:30,maxZoom:15,duration:0});break;case"MultiPolygon":P=$u(k),D=jo(P),this.map.fitBounds(D,{padding:30,maxZoom:15,duration:0});break;case"MultiPoint":P=Nu(k),D=jo(P),this.map.fitBounds(D,{padding:30,maxZoom:15,duration:0});break;case"Point":this.map.flyTo({center:k,zoom:15,duration:0,essential:!0});break;default:console.warn("Невідомий тип геометрії:",x)}}}},xg={class:"vs-map-portal relative z-1 mt-2",id:"mapwrapper"};function vg(f,x,k,P,D,j){var ve;const S=N.resolveComponent("MapLegend"),c=N.resolveComponent("MapSlotLayers"),fe=N.resolveComponent("MapCompare"),me=N.resolveComponent("AdditionalLayers");return N.openBlock(),N.createElementBlock("div",xg,[N.createElementVNode("div",{id:"maplibre-map",ref:"maplibreMap",class:"w-full compare_main_map",style:N.normalizeStyle({height:k.height})},null,4),N.withDirectives(N.createVNode(S,{colors:D.colors,strokes:f.strokes,title:k.legendname},null,8,["colors","strokes","title"]),[[N.vShow,k.legend]]),N.createVNode(c,{map:D.map,baseLayers:k.basemap,selectedLayer:k.selectedBaseLayer,"onUpdate:selectedLayer":x[0]||(x[0]=ae=>f.$emit("update:selectedBaseLayer",ae))},null,8,["map","baseLayers","selectedLayer"]),k.isMapCompare?(N.openBlock(),N.createBlock(fe,{key:0,map:D.map,compareLayers:j.allLayers,table:k.table,onIsCompareOpen:x[1]||(x[1]=ae=>f.$emit("isCompareOpen",ae))},null,8,["map","compareLayers","table"])):N.createCommentVNode("",!0),(ve=k.additionalLayers)!=null&&ve.length?(N.openBlock(),N.createBlock(me,{key:1,map:D.map,layers:k.additionalLayers,basemapIds:j.basemapIds},null,8,["map","layers","basemapIds"])):N.createCommentVNode("",!0)])}const bg=Fi(yg,[["render",vg]]),wg={},Sg={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Tg=[N.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)];function kg(f,x){return N.openBlock(),N.createElementBlock("svg",Sg,Tg)}const Ig=Fi(wg,[["render",kg]]),Cg={},Eg={xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-layout-sidebar-right-collapse"},Pg=[N.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),N.createElementVNode("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null,-1),N.createElementVNode("path",{d:"M15 4v16"},null,-1),N.createElementVNode("path",{d:"M9 10l2 2l-2 2"},null,-1)];function Ag(f,x){return N.openBlock(),N.createElementBlock("svg",Eg,Pg)}const Mg=Fi(Cg,[["render",Ag]]),zg={},Dg={xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-layout-sidebar-right-expand"},Lg=[N.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),N.createElementVNode("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null,-1),N.createElementVNode("path",{d:"M15 4v16"},null,-1),N.createElementVNode("path",{d:"M10 10l-2 2l2 2"},null,-1)];function Rg(f,x){return N.openBlock(),N.createElementBlock("svg",Dg,Lg)}const Bg=Fi(zg,[["render",Rg]]),Fg={props:{visible:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},size:{type:String,default:()=>""}},emits:["update:visible","onClose"],name:"vs-dialog",mounted(){window.addEventListener("keydown",this.checkKey)},unmounted(){window.removeEventListener("keydown",this.checkKey)},computed:{hasSlot(){var f;return!!((f=this.$slots)!=null&&f.footer)},checkSize(){return this.size==="small"?"w-5/12":this.size==="medium"?"w-6/12":"lg:w-7/12 w-11/12"}},methods:{checkKey({key:f}){f==="Escape"&&this.handleClose()},handleClose(){this.$emit("update:visible",!1),this.$emit("onClose")}}},ju=f=>(N.pushScopeId("data-v-37405773"),f=f(),N.popScopeId(),f),Og={class:"vsTailwind ui-dialog__wrapper"},Vg={class:"w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},Ng={class:"py-2.5 px-4 flex justify-between items-center border-b"},$g={class:"font-medium text-gray-800"},Ug=[ju(()=>N.createElementVNode("span",{class:"sr-only"},"Close",-1)),ju(()=>N.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[N.createElementVNode("path",{d:"M18 6 6 18"}),N.createElementVNode("path",{d:"m6 6 12 12"})],-1))],jg={class:"ui-dialog__content p-4"},qg={key:0,class:"flex justify-end gap-x-2"};function Zg(f,x,k,P,D,j){return N.openBlock(),N.createBlock(N.Teleport,{to:"#modal"},[N.createVNode(N.Transition,{name:"fade"},{default:N.withCtx(()=>[N.withDirectives(N.createElementVNode("div",Og,[N.createElementVNode("div",Vg,[N.createVNode(N.Transition,{name:"content",appear:""},{default:N.withCtx(()=>[N.createElementVNode("div",{class:N.normalizeClass(["ui-dialog__modal opacity-1 transition-all flex flex-col bg-white border pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",[j.checkSize]])},[N.createElementVNode("div",Ng,[N.createElementVNode("h3",$g,N.toDisplayString(k.title),1),N.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:x[0]||(x[0]=(...S)=>j.handleClose&&j.handleClose(...S))},Ug)]),N.createElementVNode("div",jg,[N.renderSlot(f.$slots,"default",{},void 0,!0)]),j.hasSlot?(N.openBlock(),N.createElementBlock("div",qg,[N.renderSlot(f.$slots,"footer",{},void 0,!0)])):N.createCommentVNode("",!0)],2)]),_:3})])],512),[[N.vShow,k.visible]])]),_:3})])}const Gg=Fi(Fg,[["render",Zg],["__scopeId","data-v-37405773"]]),Hg=N.defineComponent({props:{dashedLine:{type:Boolean,default:!1},title:{type:String,default:()=>""},table:{type:String,default:()=>""},isMapCompare:{type:Boolean,default:!0},initTotal:{type:[Number,String],default:()=>""},colorAttr:{type:String,default:()=>""},strokeAttr:{type:String,default:()=>""},legendname:{type:String,default:()=>""},center:{type:Array},maxBounds:{type:Array,default:()=>[[22,44.4],[40,52.5]]},id:{type:String,default:()=>""},isAutocomplete:{type:Boolean,default:()=>!1},isAddressAutocomplete:{type:Boolean,default:()=>!1},zoom:{type:[Number,String],default:()=>"13"},minZoom:{type:[Number,String],default:()=>"1"},maskForSearch:{type:String,default:()=>null},searchShow:{type:Boolean,default:()=>!0},basemap:{type:Array},additionalLayers:{type:Array},pointZoom:{type:String,default:()=>"12"},legend:{type:Boolean,default:()=>!0},defaultColor:{type:String,default:()=>"blue"},compareLayers:{type:Array,default:()=>[]},polygonOpacity:{type:Number,default:()=>null}},mixins:[Oo],components:{MapPortal:bg,NoData:qp,FilterIcon:Ig,VisibleMapIcon:Mg,HiddenMapIcon:Bg,CloseIcon:gl,VsDialog:Gg},data(){return{filters:"",search:"",limit:20,polyline:null,filtersParam:"",isSelectObj:!1,selectedId:"",searchRegion:"",searchAddress:"",map:null,selectedBaseLayer:"",marker:null,selectedRow:null,activeFilters:"",isMapVisible:!0,tabsIsVisible:!1,filterUrl:"",currentPage:1,regionOptionGeneral:null,isFilterVisible:!1,tableData:null,hoverData:null,atuData:[],map:null,legendName:null,total:null,filtered:null,filterValues:"",activeFiltersCount:"",visibleTrue:!0,regionSelectValue:null,addressSelectValue:null,currentBbox:null,mountedFilter:{},isCompareOpen:!1,optionRowsCount:[{value:10,label:"10"},{value:20,label:"20"},{value:30,label:"30"}],handleDebouncedUpdateValue:pm(f=>{this.handleSearchValue(f)},300)}},watch:{map(){this.map.on("mousemove",this.handleMapHover),this.map.on("click",this.handleMapClick),this.$emit("update:map",this.map)},activeFiltersCount(){var f,x;return(x=(f=this.$refs)==null?void 0:f.filter)==null?void 0:x.filteredActiveFiltersLength},activeFilters(){var f,x;return(x=(f=this.$refs)==null?void 0:f.filter)==null?void 0:x.activeFilters},isFilterVisible(f){f||this.getData()},async regionSelectValue(f,x){var D,j;if(!this.regionSelectValue){this.map.removeSource("region-search-id");return}f&&this.selectedId&&this.closeObjCard(),this.polyline=this.regionSelectValue.encoded_geom,this.getData();const k=((D=this.regionSelectValue)==null?void 0:D.geom)||Tr.toGeoJSON(this.regionSelectValue.encoded_geom),P=this.map.getSource("region-search-id");if(this.currentBbox=jo(k),P)P.setData({type:"Feature",geometry:k});else{this.map.addSource("region-search-id",{type:"geojson",data:{type:"Feature",geometry:k}});const S={id:"region-search-id",type:"line",source:"region-search-id",paint:{"line-color":"blue","line-opacity":1}};await this.map.addLayer(S)}this.moveLayer("site.prc.parcel_object.table"),(j=this.map)==null||j.fitBounds(this.currentBbox,{zoom:this.setAtuZoom,padding:20,duration:0}),this.getData()},async addressSelectValue(f,x){this.addressSelectValue&&(f&&this.selectedId&&this.closeObjCard(),this.getData())}},async mounted(){const f=new URLSearchParams(window.location.search);this.currentPage=f.get("page")||1,await this.getData();const x=new URLSearchParams(window.location.search),k=x.get("filter");x.get("id");const P=k==null?void 0:k.split("|");P==null||P.forEach(D=>{const[j,S]=D.split("=");S!=null&&S.includes(",")?this.mountedFilter[j]=S==null?void 0:S.split(","):this.mountedFilter[j]=S,this.activeFilters=this.mountedFilter}),this.getFilter(),this.total=this.initTotal,this.id&&(this.selectedId=this.id,this.isSelectObj=!0,this.selectedRow=this.tableData.find(D=>D.id===this.id))},updated(){this.checkFilterLength()},computed:{setAtuZoom(){var f,x,k;return((f=this.regionSelectValue)==null?void 0:f.id)==="UA80000000000093317"||((x=this.regionSelectValue)==null?void 0:x.id)==="UA85000000000065278"?10:((k=this.regionSelectValue)==null?void 0:k.region)===""?7.5:11}},methods:{async getData(){try{const f={search:this.search||null,limit:this.limit,page:this.currentPage,polyline:this.polyline};f.filter=this.filtersParam;const{data:x}=await Zt.get(`/api/data/${this.table}`,{params:f});this.tableData=x==null?void 0:x.rows,this.total=x.filtered,this.filtered=x.filtered}catch(f){console.error(f.message)}},moveToDefaultPage(){var P;const f=new URLSearchParams(window.location.search);f.delete("id");const k=`${window.location.pathname}?${f.toString()}`;(P=this.map)==null||P.fitBounds(this.maxBounds,{duration:0}),window.history.pushState({},"",k),this.isSelectObj=!1},regionFullName(f){return f.region?`${f.text} / ${f.region}`:f.text},getLabelById(f){const x=this.filters.find(k=>k.id===f);return x?x.label:f},getOptionsLabelById(f,x){if(Array.isArray(x)){const k=this.filters.find(P=>P.id===f);return k!=null&&k.options?k==null?void 0:k.options.filter(P=>x.includes(P.id)).map(P=>P.text).join(", "):x==null?void 0:x.length}else return x},async clearFilter(f){var x,k,P;await((k=(x=this.$refs)==null?void 0:x.filter)==null?void 0:k.clearFilter(f)),this.filterUrl=(P=this.$refs)==null?void 0:P.filter.filterUrl,(f==="region_katottg"||f==="katottg")&&this.$emit("update:filterState",{}),await this.updateTableAndMap(),await this.getData()},handlePageChange(f){this.currentPage=f;const x=new URL(window.location.href),k=new URLSearchParams(window.location.search);k.set("page",f),x.search=decodeURI(k.toString()),window.history.pushState({},"",x),this.getData()},async getFilter(){var f;try{const{data:x}=await Zt.get(`/api/filter/${this.table}`);this.filters=(f=x==null?void 0:x.list)==null?void 0:f.map(k=>({...k,label:(k==null?void 0:k.label)||(k==null?void 0:k.ua),id:(k==null?void 0:k.id)||(k==null?void 0:k.name)}))}catch(x){console.error(x.message)}},async handleSearchValue(f){this.search=f,await this.getData()},closeObjCard(){var P;const f=new URLSearchParams(window.location.search);f.delete("id"),this.deletePulsePoint(),this.deleteHighlighPolygon();const k=`${window.location.pathname}?${f.toString()}`;(this.currentBbox||this.center)&&((P=this.map)==null||P.fitBounds(this.currentBbox||[this.center,this.center],{maxZoom:this.zoom,duration:0})),window.history.pushState({},"",k),this.isSelectObj=!1,this.selectedRow=null,this.getData()},async handleSearchRegionValue(f){var k;const x=this.map.getLayer("region-search-id");this.searchRegion=f,f===""&&x?((k=this.map)==null||k.fitBounds(this.maxBounds,{duration:0}),this.currentBbox=null,this.polyline=null,this.map.removeLayer("region-search-id"),this.getData()):f===""&&this.getData()},async handleSearchAddressValue(f){var k;const x=this.map.getLayer("address-search-id");this.searchAddress=f,f===""&&x?((k=this.map)==null||k.fitBounds(this.maxBounds,{duration:0}),this.currentBbox=null,this.polyline=null,this.map.removeLayer("address-search-id"),this.getData()):f===""&&this.getData()},handleFilterChange(f){this.$emit("update:filterState",f),this.currentPage=f.state.page||1,this.filterUrl=f.url==="no-url"?null:f.url.split("|").filter(x=>!x.includes("page=")).join("|")},async updateTableAndMap(){var f,x;this.selectedRow||(this.filtersParam=this.filterUrl,this.activeFilters=(x=(f=this.$refs)==null?void 0:f.filter)==null?void 0:x.activeFilters,this.isFilterVisible=!1,this.getData())},handleFilterSubmit(){var f;this.isSelectObj="",this.selectedId="",this.selectedId=!1,(f=this.map)==null||f.fitBounds(this.maxBounds,{duration:0}),this.isFilterVisible=!1},toggleMapVisible(){this.isMapVisible=!this.isMapVisible},checkUrl(f=!0){const x=new URLSearchParams(window.location.search);x.has("id")?(this.isSelectObj=!0,this.isMapVisible=f,this.selectedId=x.get("id")):(this.isSelectObj=!1,this.selectedId="")},changeLimit(f){this.limit=f,this.currentPage=1,this.getData()},filterModalClose(){this.isFilterVisible=!1},resetFilters(){this.$refs.filter&&(this.$refs.filter.clearAll(),this.search="",this.isFilterVisible=!1,this.filtersParam="",this.polyline=null,this.regionSelectValue=null,this.addressSelectValue=null,this.currentBbox=null,this.activeFilters=null,this.tabsIsVisible=!1,this.handleSearchRegionValue(""),this.handleSearchAddressValue(""))},checkFilterLength(){var x,k;const f=(k=(x=this.$refs)==null?void 0:x.filter)==null?void 0:k.filteredActiveFiltersLength;f!==this.previousLength&&(this.previousLength=f,this.activeFiltersCount=f)},async handleMapClick(f){var j,S,c,fe,me,ve,ae,le,ht,$e;const x=this.map.queryRenderedFeatures(f.point);if((x==null?void 0:x.length)<1||((j=x[0])==null?void 0:j.source)==="region-search-id"||((S=x[0])==null?void 0:S.source)==="route-line")return;const k=window.location.pathname,P=new URLSearchParams(window.location.search);P.set("id",`${(c=x[0])==null?void 0:c.properties.id}`),this.getObjectData((me=(fe=x[0])==null?void 0:fe.properties)==null?void 0:me.id);const D=`${k}?${P.toString()}`;window.history.pushState({},"",D),this.isSelectObj=!0,f.lngLat&&(($e=this.map)==null||$e.fitBounds([[(ve=f.lngLat)==null?void 0:ve.lng,(ae=f.lngLat)==null?void 0:ae.lat],[(le=f.lngLat)==null?void 0:le.lng,(ht=f.lngLat)==null?void 0:ht.lat]],{padding:30,duration:0})),this.checkUrl()},async getObjectData(f){var x,k;try{const{data:P}=await Zt.get(`/api/data/${this.table}/${f}`);this.selectRow((x=P==null?void 0:P.rows)==null?void 0:x[0]),((k=P==null?void 0:P.rows)==null?void 0:k.lenght)<1&&this.deletePulsePoint()}catch(P){console.error(P.message)}},async selectRow(f,x=!0){var c;this.isMapVisible=x;const P=await(await fetch(`/api/data/${this.table}/${f.id}`)).json();this.selectedRow=((c=P==null?void 0:P.rows)==null?void 0:c[0])||f;const D=window.location.pathname,j=new URLSearchParams(window.location.search);j.set("id",`${f.id}`);const S=`${D}?${j.toString()}`;window.history.pushState({},"",S),this.checkUrl(x),this.isSelectObj=!0},deletePulsePoint(){this.marker&&this.marker.remove()},addPulsePoint(f){this.deletePulsePoint();const x=document.createElement("div");x.className="gps-marker",x.style.width="10px",x.style.height="10px",x.style.position="relative";const k=document.createElement("div");k.className="gps-wave",x.appendChild(k),this.marker=new In.Marker({element:x,anchor:"center"}).setLngLat(f).addTo(this.map)},deleteHighlighPolygon(){var f,x,k;(f=this.map)!=null&&f.getLayer("highlighted-polygon")&&((x=this.map)==null||x.removeLayer("highlighted-polygon"),(k=this.map)==null||k.removeSource("highlighted-polygon"))},highlightPolygon(f){var x,k,P,D,j,S;this.deletePulsePoint(),this.deleteHighlighPolygon(),(D=this.map)==null||D.addSource("highlighted-polygon",{type:"geojson",data:{geometry:{type:(x=f==null?void 0:f.geom)==null?void 0:x.type,coordinates:(k=f==null?void 0:f.geom)==null?void 0:k.coordinates},type:"Feature",properties:{id:f==null?void 0:f.id,name:f==null?void 0:f.name,category:f==null?void 0:f.id},id:f==null?void 0:f.id,layer:{id:"site.rest_zone.table-0",type:"fill",source:"site.rest_zone.table",sourceLayer:"site.rest_zone.table",filter:["all",["==",["geometry-type"],(P=f==null?void 0:f.geom)==null?void 0:P.type]],paint:{"fill-color":"orange","fill-opacity":.5},layout:{}},source:"site.rest_zone.table",sourceLayer:"site.rest_zone.table",state:{hover:!0},table:"site.rest_zone.table"}}),(j=this.map)==null||j.addLayer({id:"highlighted-polygon",type:"fill",source:"highlighted-polygon",layout:{},minzoom:12,maxzoom:0,paint:{"fill-color":"orange","fill-opacity":.6}}),(S=this.map)==null||S.moveLayer("highlighted-polygon")},async handleMapHover(f){var S,c,fe;this.hoverObject&&(this.map.setFeatureState(this.hoverObject,{hover:!1}),this.hoverObject=null),this.popup||(this.popup=new In.Popup({maxWidth:"400px",closeButton:!1,closeOnClick:!1}));const x=this.map.queryRenderedFeatures(f.point);if(this.map.getCanvas().style.cursor="pointer",!(x!=null&&x.length)||((S=x==null?void 0:x[0])==null?void 0:S.source)==="region-search-id"){this.map.getCanvas().style.cursor="",this.popup.remove();return}const k=["route-line"];if(!x.filter(me=>!k.some(ve=>{var ae;return(ae=me.layer)==null?void 0:ae.source.includes(ve)})).length)return;const D=x[0].geometry.coordinates.slice();x[0].source==="highlighted-polygon"&&x[1]?this.hoverData=(c=x[1])==null?void 0:c.properties:this.hoverData=(fe=x[0])==null?void 0:fe.properties;const j={source:x[0].source,sourceLayer:x[0].sourceLayer,id:x[0].id};if(j.source!=="region-search-id"){for(this.map.setFeatureState(j,{hover:!0}),this.hoverObject=j;Math.abs(f.lngLat.lng-D[0])>180;)D[0]+=f.lngLat.lng>D[0]?360:-360;this.popup.setLngLat(f.lngLat).setHTML(this.$refs.popup.innerHTML).addTo(this.map)}},removeSelectedBaseLayer(){this.selectedBaseLayer=""},addGeomMarker(f){if(!this.map||!f)return;this.marker&&this.marker.remove();let x;(f==null?void 0:f.type)==="Point"?x=f.coordinates:x=mm(f).geometry.coordinates,this.marker=new In.Marker({color:"green"}).setLngLat(x).addTo(this.map)}}}),Wg={class:"ml-3 pt-[20px]"},Xg={class:"w-full gap-5 flex justify-between mb-[6px] pr-3"},Jg={class:"flex items-center gap-2 max-h-[38px] pt-[4px]"},Kg={class:"custom-filter-list"},Yg={key:0,class:"font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"},Qg=["title"],e_=N.createElementVNode("span",{class:"sr-only"},"Відкрити мапу",-1),t_={class:"flex"},i_={class:"py-[15px] pb-[24px] pl-2"},r_={class:"font-bold text-2xl mr-[10px]"},n_={class:"text-sm text-stone-500 font-medium"},s_=N.createElementVNode("span",{class:"text-sm text-stone-500 font-medium"}," об'єктів",-1),o_={class:"wrapperTable flex flex-col",style:{height:"calc(100vh - 302px)"}},a_={key:0,class:"flex gap-x-2 flex-wrap"},l_={class:"font-medium"},c_=N.createElementVNode("span",{class:"h-3 mx-2 border-s border-gray-200"},null,-1),h_={class:"text-gray-500"},u_=["onClick"],d_={key:0,class:"mb-[10px] py-1 ps-3 pe-1 inline-flex items-center bg-white border border-gray-200 text-gray-800 text-xs rounded-full"},p_=N.createElementVNode("span",{class:"font-medium"}," Очистити ",-1),f_={key:2,class:"text-center py-28"},m_=N.createElementVNode("h2",{class:"font-medium text-base text-gray-500 rounded-xl"}," За вашим запитом даних не знайдено! ",-1),g_=N.createElementVNode("p",{class:"font-normal text-sm text-gray-500 rounded-xl"}," Введіть, будь ласка, інші значення для пошуку. ",-1),__={key:0},y_={key:1,class:"my-5 pr-2"},x_={class:"flex justify-between"},v_={class:"w-2/4"},b_={class:"map-section relative"},w_={ref:"popup",style:{display:"none"}};function S_(f,x,k,P,D,j){var Oe,ft;const S=N.resolveComponent("VsTextMask"),c=N.resolveComponent("vs-text"),fe=N.resolveComponent("FilterIcon"),me=N.resolveComponent("VsFilterList"),ve=N.resolveComponent("VisibleMapIcon"),ae=N.resolveComponent("HiddenMapIcon"),le=N.resolveComponent("CloseIcon"),ht=N.resolveComponent("NoData"),$e=N.resolveComponent("VsPagination"),Ke=N.resolveComponent("MapPortal");return N.openBlock(),N.createElementBlock("section",Wg,[N.createElementVNode("div",null,[N.createElementVNode("div",Xg,[N.createElementVNode("div",Jg,[f.maskForSearch?(N.openBlock(),N.createBlock(S,{key:0,"model-value":f.search,"onUpdate:modelValue":f.handleDebouncedUpdateValue,class:"w-full table-interface-search",placeholder:"Пошук",mask:f.maskForSearch,icon:"search",iconPosition:"left",clearable:"",style:{height:"38px","min-width":"300px","max-width":"300px"},ref:"searchInput"},null,8,["model-value","onUpdate:modelValue","mask"])):f.searchShow?(N.openBlock(),N.createBlock(c,{key:1,"model-value":f.search,"onUpdate:modelValue":f.handleDebouncedUpdateValue,class:"[&>input]:py-[7px] [&>input]:max-h-[38px] [&>input]:w-[220px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600",placeholder:"Пошук",icon:"search","icon-position":"left",clearable:"",style:{height:"38px"},ref:"searchInput"},null,8,["model-value","onUpdate:modelValue"])):N.createCommentVNode("",!0),N.createElementVNode("div",Kg,[f.filters?(N.openBlock(),N.createBlock(me,{key:0,ref:"filter",modelValue:f.mountedFilter,"onUpdate:modelValue":x[0]||(x[0]=st=>f.mountedFilter=st),scheme:f.filters,isDialog:(Oe=f.filters)==null?void 0:Oe.some(st=>!(st!=null&&st.inline)),"apply-vue-router":"",history:"",view:"plain",clearable:!1,name:"filter",onFilterChange:x[1]||(x[1]=async st=>{await f.handleFilterChange(st),await f.updateTableAndMap()})},{button:N.withCtx(({visible:st})=>[N.createElementVNode("button",{type:"button",class:N.normalizeClass(["py-2 px-2.5 h-[40px] inline-flex items-center gap-x-1.5 text-sm font-medium rounded-lg bg-white text-gray-800 hover:bg-gray-50 focus:outline-none focus:bg-gray-50",[st?"border border-blue-600 border-2":"border border-gray-200"]])},[N.createVNode(fe),N.createTextVNode(" Фільтри "),f.activeFiltersCount>=1?(N.openBlock(),N.createElementBlock("span",Yg,N.toDisplayString(f.activeFiltersCount),1)):N.createCommentVNode("",!0)],2)]),_:1},8,["modelValue","scheme","isDialog"])):N.createCommentVNode("",!0)])]),N.createElementVNode("button",{type:"button",class:"py-2 px-2 inline-flex items-center gap-x-1.5 text-sm rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100",title:f.isMapVisible?"Приховати карту":"Показати карту",onClick:x[2]||(x[2]=(...st)=>f.toggleMapVisible&&f.toggleMapVisible(...st))},[f.isMapVisible?(N.openBlock(),N.createBlock(ve,{key:0})):(N.openBlock(),N.createBlock(ae,{key:1})),e_],8,Qg)]),N.createElementVNode("div",t_,[N.createElementVNode("div",{class:N.normalizeClass(["relative overflow-hidden",f.isMapVisible?"w-2/4 mr-0":"w-full mr-3",f.isSelectObj?"hidden":""])},[N.createElementVNode("h1",i_,[N.createElementVNode("span",r_,N.toDisplayString(f.title),1),N.createElementVNode("span",n_,N.toDisplayString(f.total),1),s_]),N.createElementVNode("div",o_,[f.activeFilters?(N.openBlock(),N.createElementBlock("div",a_,[(N.openBlock(!0),N.createElementBlock(N.Fragment,null,N.renderList(f.activeFilters,(st,He,Ft)=>(N.openBlock(),N.createElementBlock("span",{class:"mb-[10px] py-1 ps-3 pe-1 inline-flex items-center bg-white border border-gray-200 text-gray-800 text-xs rounded-full",key:Ft},[N.createElementVNode("span",l_,N.toDisplayString(f.getLabelById(He)),1),c_,N.createElementVNode("span",h_,N.toDisplayString(f.getOptionsLabelById(He,st)),1),N.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-5 ms-1 rounded-full text-gray-600 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 text-sm",onClick:wt=>f.clearFilter(He)},[N.createVNode(le)],8,u_)]))),128)),((ft=Object.keys(f.activeFilters))==null?void 0:ft.length)>=2?(N.openBlock(),N.createElementBlock("span",d_,[p_,N.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-5 ms-1 rounded-full text-gray-600 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 text-sm",onClick:x[3]||(x[3]=st=>f.mountedFilter={})},[N.createVNode(le)])])):N.createCommentVNode("",!0)])):N.createCommentVNode("",!0),f.total>=1?N.renderSlot(f.$slots,"table",{key:1,rows:f.tableData,map:f.map,marker:f.marker,selectRow:f.selectRow,getData:f.getData,addGeomMarker:f.addGeomMarker,isMapVisible:f.isMapVisible}):(N.openBlock(),N.createElementBlock("div",f_,[N.createVNode(ht),m_,g_,N.createElementVNode("button",{type:"button",class:"mt-[10px] py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs rounded-lg border border-stone-200 bg-white text-stone-800 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100",onClick:x[4]||(x[4]=(...st)=>f.resetFilters&&f.resetFilters(...st))}," Очистити дані пошуку ")]))]),f.total>=1?(N.openBlock(),N.createElementBlock("hr",__)):N.createCommentVNode("",!0),f.total>=1?(N.openBlock(),N.createElementBlock("div",y_,[N.createElementVNode("div",x_,[N.createVNode($e,{total:f.total,maxPages:7,defaultPage:f.currentPage,pageSize:f.limit,goTo:!1,size:"medium",onPageChange:f.handlePageChange,backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[10,20,30],onPageSizeChange:f.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])):N.createCommentVNode("",!0)],2),f.isSelectObj?(N.openBlock(),N.createElementBlock("div",{key:0,class:N.normalizeClass(f.isMapVisible?"w-2/4 mr-0 pb-5":"w-full pb-5 mr-3"),style:{height:"calc(100vh - 152px)"}},[N.renderSlot(f.$slots,"details",{table:f.table,selectedId:f.selectedId,selectedRow:f.selectedRow,map:f.map,closeObjCard:f.closeObjCard,isMapVisible:f.isMapVisible})],2)):N.createCommentVNode("",!0),N.withDirectives(N.createElementVNode("div",v_,[N.createElementVNode("section",b_,[N.renderSlot(f.$slots,"default",{map:f.map,removeSelectedBaseLayer:f.removeSelectedBaseLayer,selectedBaseLayer:f.selectedBaseLayer,isCompareOpen:f.isCompareOpen,selectedRow:f.selectedRow}),N.createVNode(Ke,{height:"calc(100vh - 152px)",width:"w-2/4",table:f.table,filtersParam:f.filtersParam,row:f.selectedRow,legendname:f.legendname,legend:f.legend,compareLayers:f.compareLayers,colorAttr:f.colorAttr,strokeAttr:f.strokeAttr,polygonOpacity:f.polygonOpacity,maxBounds:f.maxBounds,center:f.center,zoom:f.zoom,dashedLine:f.dashedLine,minZoom:f.minZoom,basemap:f.basemap,additionalLayers:f.additionalLayers,pointZoom:f.pointZoom,defaultColor:f.defaultColor,isMapCompare:f.isMapCompare,onMap:x[5]||(x[5]=st=>f.map=st),selectedBaseLayer:f.selectedBaseLayer,"onUpdate:selectedBaseLayer":x[6]||(x[6]=st=>f.selectedBaseLayer=st),onIsCompareOpen:x[7]||(x[7]=st=>f.isCompareOpen=st)},null,8,["table","filtersParam","row","legendname","legend","compareLayers","colorAttr","strokeAttr","polygonOpacity","maxBounds","center","zoom","dashedLine","minZoom","basemap","additionalLayers","pointZoom","defaultColor","isMapCompare","selectedBaseLayer"])])],512),[[N.vShow,f.isMapVisible]])]),N.createElementVNode("div",w_,[N.renderSlot(f.$slots,"popup",{data:f.hoverData})],512)])])}const qu=Fi(Hg,[["render",S_]]),Zu={install:f=>{f.component("VsPartsMap",qu)},components:{VsPartsMap:qu}};return typeof window<"u"&&(window.PartsMap=Zu),Zu});
|
585
|
+
`+j):P.stack=j}catch{}}throw P}}_request(x,k){typeof x=="string"?(k=k||{},k.url=x):k=x||{},k=is(this.defaults,k);const{transitional:P,paramsSerializer:D,headers:j}=k;P!==void 0&&Bc.assertOptions(P,{silentJSONParsing:Cn.transitional(Cn.boolean),forcedJSONParsing:Cn.transitional(Cn.boolean),clarifyTimeoutError:Cn.transitional(Cn.boolean)},!1),D!=null&&(ge.isFunction(D)?k.paramsSerializer={serialize:D}:Bc.assertOptions(D,{encode:Cn.function,serialize:Cn.function},!0)),k.method=(k.method||this.defaults.method||"get").toLowerCase();let S=j&&ge.merge(j.common,j[k.method]);j&&ge.forEach(["delete","get","head","post","put","patch","common"],$e=>{delete j[$e]}),k.headers=Hi.concat(S,j);const c=[];let fe=!0;this.interceptors.request.forEach(function(Ke){typeof Ke.runWhen=="function"&&Ke.runWhen(k)===!1||(fe=fe&&Ke.synchronous,c.unshift(Ke.fulfilled,Ke.rejected))});const me=[];this.interceptors.response.forEach(function(Ke){me.push(Ke.fulfilled,Ke.rejected)});let ve,ae=0,le;if(!fe){const $e=[Lu.bind(this),void 0];for($e.unshift.apply($e,c),$e.push.apply($e,me),le=$e.length,ve=Promise.resolve(k);ae<le;)ve=ve.then($e[ae++],$e[ae++]);return ve}le=c.length;let ht=k;for(ae=0;ae<le;){const $e=c[ae++],Ke=c[ae++];try{ht=$e(ht)}catch(Oe){Ke.call(this,Oe);break}}try{ve=Lu.call(this,ht)}catch($e){return Promise.reject($e)}for(ae=0,le=me.length;ae<le;)ve=ve.then(me[ae++],me[ae++]);return ve}getUri(x){x=is(this.defaults,x);const k=ku(x.baseURL,x.url);return gu(k,x.params,x.paramsSerializer)}}ge.forEach(["delete","get","head","options"],function(x){rs.prototype[x]=function(k,P){return this.request(is(P||{},{method:x,url:k,data:(P||{}).data}))}}),ge.forEach(["post","put","patch"],function(x){function k(P){return function(j,S,c){return this.request(is(c||{},{method:x,headers:P?{"Content-Type":"multipart/form-data"}:{},url:j,data:S}))}}rs.prototype[x]=k(),rs.prototype[x+"Form"]=k(!0)});class Fc{constructor(x){if(typeof x!="function")throw new TypeError("executor must be a function.");let k;this.promise=new Promise(function(j){k=j});const P=this;this.promise.then(D=>{if(!P._listeners)return;let j=P._listeners.length;for(;j-- >0;)P._listeners[j](D);P._listeners=null}),this.promise.then=D=>{let j;const S=new Promise(c=>{P.subscribe(c),j=c}).then(D);return S.cancel=function(){P.unsubscribe(j)},S},x(function(j,S,c){P.reason||(P.reason=new $s(j,S,c),k(P.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(x){if(this.reason){x(this.reason);return}this._listeners?this._listeners.push(x):this._listeners=[x]}unsubscribe(x){if(!this._listeners)return;const k=this._listeners.indexOf(x);k!==-1&&this._listeners.splice(k,1)}static source(){let x;return{token:new Fc(function(D){x=D}),cancel:x}}}function um(f){return function(k){return f.apply(null,k)}}function dm(f){return ge.isObject(f)&&f.isAxiosError===!0}const Oc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Oc).forEach(([f,x])=>{Oc[x]=f});function Fu(f){const x=new rs(f),k=eu(rs.prototype.request,x);return ge.extend(k,rs.prototype,x,{allOwnKeys:!0}),ge.extend(k,x,null,{allOwnKeys:!0}),k.create=function(D){return Fu(is(f,D))},k}const Zt=Fu($o);Zt.Axios=rs,Zt.CanceledError=$s,Zt.CancelToken=Fc,Zt.isCancel=bu,Zt.VERSION=Ru,Zt.toFormData=hl,Zt.AxiosError=ct,Zt.Cancel=Zt.CanceledError,Zt.all=function(x){return Promise.all(x)},Zt.spread=um,Zt.isAxiosError=dm,Zt.mergeConfig=is,Zt.AxiosHeaders=Hi,Zt.formToJSON=f=>xu(ge.isHTMLForm(f)?new FormData(f):f),Zt.getAdapter=Du.getAdapter,Zt.HttpStatusCode=Oc,Zt.default=Zt;const pm=(f,x=300)=>{let k;return function(...D){clearTimeout(k),k=setTimeout(()=>{f.apply(this,D)},x)}};function ml(f,x,k={}){const P={type:"Feature"};return(k.id===0||k.id)&&(P.id=k.id),k.bbox&&(P.bbox=k.bbox),P.properties=x||{},P.geometry=f,P}function Ou(f,x,k={}){if(!f)throw new Error("coordinates is required");if(!Array.isArray(f))throw new Error("coordinates must be an Array");if(f.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Uu(f[0])||!Uu(f[1]))throw new Error("coordinates must contain numbers");return ml({type:"Point",coordinates:f},x,k)}function Vu(f,x,k={}){for(const D of f){if(D.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(D[D.length-1].length!==D[0].length)throw new Error("First and last Position are not equivalent.");for(let j=0;j<D[D.length-1].length;j++)if(D[D.length-1][j]!==D[0][j])throw new Error("First and last Position are not equivalent.")}return ml({type:"Polygon",coordinates:f},x,k)}function Nu(f,x,k={}){return ml({type:"MultiPoint",coordinates:f},x,k)}function $u(f,x,k={}){return ml({type:"MultiPolygon",coordinates:f},x,k)}function Uu(f){return!isNaN(f)&&f!==null&&!Array.isArray(f)}function Vc(f,x,k){if(f!==null)for(var P,D,j,S,c,fe,me,ve=0,ae=0,le,ht=f.type,$e=ht==="FeatureCollection",Ke=ht==="Feature",Oe=$e?f.features.length:1,ft=0;ft<Oe;ft++){me=$e?f.features[ft].geometry:Ke?f.geometry:f,le=me?me.type==="GeometryCollection":!1,c=le?me.geometries.length:1;for(var st=0;st<c;st++){var He=0,Ft=0;if(S=le?me.geometries[st]:me,S!==null){fe=S.coordinates;var wt=S.type;switch(ve=k&&(wt==="Polygon"||wt==="MultiPolygon")?1:0,wt){case null:break;case"Point":if(x(fe,ae,ft,He,Ft)===!1)return!1;ae++,He++;break;case"LineString":case"MultiPoint":for(P=0;P<fe.length;P++){if(x(fe[P],ae,ft,He,Ft)===!1)return!1;ae++,wt==="MultiPoint"&&He++}wt==="LineString"&&He++;break;case"Polygon":case"MultiLineString":for(P=0;P<fe.length;P++){for(D=0;D<fe[P].length-ve;D++){if(x(fe[P][D],ae,ft,He,Ft)===!1)return!1;ae++}wt==="MultiLineString"&&He++,wt==="Polygon"&&Ft++}wt==="Polygon"&&He++;break;case"MultiPolygon":for(P=0;P<fe.length;P++){for(Ft=0,D=0;D<fe[P].length;D++){for(j=0;j<fe[P][D].length-ve;j++){if(x(fe[P][D][j],ae,ft,He,Ft)===!1)return!1;ae++}Ft++}He++}break;case"GeometryCollection":for(P=0;P<S.geometries.length;P++)if(Vc(S.geometries[P],x,k)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function jo(f,x={}){if(f.bbox!=null&&x.recompute!==!0)return f.bbox;const k=[1/0,1/0,-1/0,-1/0];return Vc(f,P=>{k[0]>P[0]&&(k[0]=P[0]),k[1]>P[1]&&(k[1]=P[1]),k[2]<P[0]&&(k[2]=P[0]),k[3]<P[1]&&(k[3]=P[1])}),k}function fm(f,x={}){const k=jo(f),P=(k[0]+k[2])/2,D=(k[1]+k[3])/2;return Ou([P,D],x.properties,x)}function mm(f,x={}){let k=0,P=0,D=0;return Vc(f,function(j){k+=j[0],P+=j[1],D++},!0),Ou([k/D,P/D],x.properties)}const gm={mixins:[Oo],props:{map:{type:Object},baseLayers:{type:Array,default:[{id:"orto10",name:"Ortophoto 1:10К",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",service:"TMS",category:"Національна інфраструктура геопросторових даних",scale:1e4,year:2020,bounds:"ua",maxzoom:18,owner:"НДІГК (Інститут геодезії та картографії)",image:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4954/2876.png",basemap:!0},{id:"graymap",name:"Сіра карта",url:"https://basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",service:"TMS",category:"Базові карти",attribution:"© <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>, © <a href='https://carto.com/attributions'>CARTO</a>",bounds1:"ua",image:"https://basemaps.cartocdn.com/light_all/10/601/348.png",position:0,owner:"OSM",basemap:!0},{id:"darkmap_carto",name:"Темна карта України",image:"https://basemaps.cartocdn.com/dark_all/13/4791/2762.png?ver=2023-04-14",url:"https://basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png",service:"TMS",category:"Базові карти",active:!1}]},selectedLayer:{type:String,required:!0}},watch:{map(f){f&&f.on("load",this.handleMapLoad)}},methods:{handleMapLoad(){var f;this.baseLayers.forEach(x=>{this.layerList.push(x)}),this.toggleLayerVisibility((f=this.baseLayers[0])==null?void 0:f.id)},toggleLayerVisibility(f){this.$emit("update:selectedLayer",f),this.changeBaseLayer(f)}}},_m={class:"vs-map-slot-layers z-10 select-none"},ym=["onClick"],xm=["src"];function vm(f,x,k,P,D,j){return N.openBlock(),N.createElementBlock("div",_m,[(N.openBlock(!0),N.createElementBlock(N.Fragment,null,N.renderList(k.baseLayers,(S,c)=>(N.openBlock(),N.createElementBlock("div",{key:S.id,class:N.normalizeClass(["vs-map-slot-layers__layer relative",{focused:S.id==k.selectedLayer}]),onClick:fe=>j.toggleLayerVisibility(S.id)},[N.createElementVNode("img",{src:S.image,class:"vs-map-slot-layers__image"},null,8,xm),N.createElementVNode("div",{class:N.normalizeClass(["absolute py-2 px-4 text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg top-[-46px] text-nowrap p-2 hidden whitespace-nowrap",[c===0?"left-[-10px]":"left-[50%] translate-x-[-50%]"]])},N.toDisplayString(S==null?void 0:S.name),3)],10,ym))),128))])}const bm=Fi(gm,[["render",vm],["__scopeId","data-v-8959e540"]]),wm={},Sm={class:"shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Tm=[N.createElementVNode("path",{d:"M18 6 6 18"},null,-1),N.createElementVNode("path",{d:"m6 6 12 12"},null,-1)];function km(f,x){return N.openBlock(),N.createElementBlock("svg",Sm,Tm)}const gl=Fi(wm,[["render",km]]),Im={},Cm={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Em=[N.createElementVNode("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),N.createElementVNode("path",{d:"M2 17L12 22L22 17",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),N.createElementVNode("path",{d:"M2 12L12 17L22 12",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)];function Pm(f,x){return N.openBlock(),N.createElementBlock("svg",Cm,Em)}const Am={components:{closeIcon:gl,layersIcon:Fi(Im,[["render",Pm]])},mixins:[Oo],props:{layers:{type:Array,default:()=>[]},map:{type:Object,default:null},basemapIds:{type:Array,default:()=>[]}},data(){return{isOpen:!1,selectedLayers:[],mounted:!1}},mounted(){this.mounted=!0},methods:{async handleLayerChange(f,x){await this.setVisible(f,x),x&&this.map.getStyle().layers.filter(D=>!this.basemapIds.includes(D.id)&&D.id!==f.id).map(D=>D.id).forEach(D=>{this.map.getLayer(D)&&this.map.moveLayer(D)})}}},Mm=f=>(N.pushScopeId("data-v-4c33eaa0"),f=f(),N.popScopeId(),f),zm={class:"p-[10px]"},Dm={class:"select-none absolute left-[20px] top-[10px] border bg-white max-w-[250px] p-[10px] rounded-lg z-10"},Lm={class:"flex justify-between items-center border-b pb-[8px] text-[16px]"},Rm=Mm(()=>N.createElementVNode("span",null,"Додаткові шари",-1)),Bm={class:"mt-2 max-h-[300px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},Fm=["id","value","onChange"],Om=["for"];function Vm(f,x,k,P,D,j){const S=N.resolveComponent("layersIcon"),c=N.resolveComponent("VsPopover"),fe=N.resolveComponent("closeIcon");return N.openBlock(),N.createElementBlock(N.Fragment,null,[!D.isOpen&&D.mounted?(N.openBlock(),N.createBlock(c,{key:0,teleport:"body",trigger:"hover",placement:"right",class:"select-none flex absolute left-[20px] top-[10px] border bg-white max-w-[250px] rounded-lg cursor-pointer z-10",onClick:x[0]||(x[0]=me=>D.isOpen=!D.isOpen)},{reference:N.withCtx(()=>[N.createElementVNode("div",zm,[N.createVNode(S,{class:"h-5 w-5"})])]),default:N.withCtx(()=>[N.createTextVNode(" Додаткові шари ")]),_:1})):N.createCommentVNode("",!0),N.withDirectives(N.createElementVNode("div",Dm,[N.createElementVNode("div",Lm,[Rm,D.mounted?(N.openBlock(),N.createBlock(c,{key:0,teleport:"body",trigger:"hover",placement:"bottom",class:"flex"},{reference:N.withCtx(()=>[N.createElementVNode("button",{type:"button",class:"size-6 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:x[1]||(x[1]=me=>D.isOpen=!D.isOpen)},[N.createVNode(fe)])]),default:N.withCtx(()=>[N.createTextVNode(" Приховати панель ")]),_:1})):N.createCommentVNode("",!0)]),N.withDirectives(N.createElementVNode("div",Bm,[(N.openBlock(!0),N.createElementBlock(N.Fragment,null,N.renderList(k.layers,me=>(N.openBlock(),N.createElementBlock("div",{key:me.id,class:"flex items-center gap-2 text-sm"},[N.createElementVNode("input",{type:"checkbox",id:`layer-${me.id}`,value:me.id,class:"cursor-pointer",onChange:ve=>j.handleLayerChange(me,ve.target.checked)},null,40,Fm),N.createElementVNode("label",{for:`layer-${me.id}`,class:"cursor-pointer"},N.toDisplayString(me.name),9,Om)]))),128))],512),[[N.vShow,D.isOpen]])],512),[[N.vShow,D.isOpen]])],64)}const Nm=Fi(Am,[["render",Vm],["__scopeId","data-v-4c33eaa0"]]),$m={mixins:[Oo],components:{closeIcon:gl},props:{map:{type:Object,required:!0},compareLayers:{type:Array,default:()=>[]},table:{type:String,default:""},collapsed:{type:Boolean,default:!1}},data(){return{mounted:!1,currentLayer:null}},mounted(){var f,x;this.currentLayer=((x=(f=this.compareLayers)==null?void 0:f[0])==null?void 0:x.id)||null,this.mounted=!0},watch:{async currentLayer(f,x){const k=this.compareLayers.find(D=>D.id===x),P=this.compareLayers.find(D=>D.id===f);k&&await this.setVisible(k,!1,this.map),P&&await this.setVisible(P,!0,this.map),this.map.getStyle().layers.forEach(D=>{D.source===this.table&&this.map.getLayer(D.id)&&this.map.moveLayer(D.id)})}}},Um={class:"absolute w-full top-[10px] right-[50px] shadow-sm bg-white max-w-[250px] p-[10px] rounded-lg z-10 select-none border"},jm={class:"flex items-start justify-between pb-1 border-b"},qm=N.createElementVNode("div",{class:"text-[16px] max-w-[180px]"}," Базові шари порівняльної карти ",-1),Zm={class:"flex gap-2"},Gm=N.createElementVNode("button",{type:"button",class:"size-6 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"}," - ",-1),Hm={class:"pt-1 max-h-[300px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},Wm=["id","name","value"],Xm=["for"];function Jm(f,x,k,P,D,j){const S=N.resolveComponent("VsPopover"),c=N.resolveComponent("closeIcon");return N.withDirectives((N.openBlock(),N.createElementBlock("div",Um,[N.createElementVNode("div",jm,[qm,N.createElementVNode("div",Zm,[D.mounted?(N.openBlock(),N.createBlock(S,{key:0,trigger:"hover",placement:"bottom",teleport:"body",onClick:x[0]||(x[0]=fe=>f.$emit("update:collapsed",!0))},{reference:N.withCtx(()=>[Gm]),default:N.withCtx(()=>[N.createTextVNode(" Згорнути панель ")]),_:1})):N.createCommentVNode("",!0),D.mounted?(N.openBlock(),N.createBlock(S,{key:1,trigger:"hover",placement:"bottom",teleport:"body"},{reference:N.withCtx(()=>[N.createElementVNode("button",{type:"button",class:"size-6 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:x[1]||(x[1]=fe=>f.$emit("close"))},[N.createVNode(c,{class:"cursor-pointer"})])]),default:N.withCtx(()=>[N.createTextVNode(" Приховати панель ")]),_:1})):N.createCommentVNode("",!0)])]),N.createElementVNode("div",Hm,[(N.openBlock(!0),N.createElementBlock(N.Fragment,null,N.renderList(k.compareLayers,fe=>(N.openBlock(),N.createElementBlock("div",{key:fe.id,class:"flex items-center py-1"},[N.withDirectives(N.createElementVNode("input",{type:"radio",id:fe.id,name:fe.id,value:fe.id,"onUpdate:modelValue":x[2]||(x[2]=me=>D.currentLayer=me),class:"shrink-0 border-gray-200 rounded-full text-blue-600 focus:ring-blue-500 checked:border-blue-500 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800"},null,8,Wm),[[N.vModelRadio,D.currentLayer]]),N.createElementVNode("label",{for:fe.id,class:"text-[14px] ml-2 cursor-pointer"},N.toDisplayString(fe.name),9,Xm)]))),128))])],512)),[[N.vShow,!k.collapsed]])}const Km=Fi($m,[["render",Jm]]),Ym={},Qm={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eg=[N.createElementVNode("path",{d:"M18 8L22 12L18 16",stroke:"#333333","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),N.createElementVNode("path",{d:"M6 8L2 12L6 16",stroke:"#333333","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),N.createElementVNode("path",{d:"M2 12H22",stroke:"#333333","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)];function tg(f,x,k,P,D,j){return N.openBlock(),N.createElementBlock("svg",Qm,eg)}const ig={components:{closeIcon:gl,compareIcon:Fi(Ym,[["render",tg]]),CompareBaseLayers:Km},emits:["isCompareOpen"],props:{map:{type:Object},compareLayers:{type:Array},table:{type:String}},data(){return{isOpen:!1,mounted:!1,afterMap:null,compare:null,isOpen:!1,afterMapLoaded:!1,collapsed:!1}},mounted(){this.mounted=!0,window.maplibregl=In,this.loadScripts()},computed:{modalButtonClasses(){return{"!bg-[#F2F2F2]":this.isOpen,"bg-white":!this.isOpen}}},watch:{isOpen(f){this.$emit("isCompareOpen",f)}},methods:{loadScripts(){const f=document.createElement("link");f.setAttribute("rel","stylesheet"),f.setAttribute("href","https://cdn.jsdelivr.net/npm/@maplibre/maplibre-gl-compare@0.5.0/dist/maplibre-gl-compare.min.css"),document.head.appendChild(f);const x=document.createElement("script");x.setAttribute("src","https://cdn.jsdelivr.net/npm/@maplibre/maplibre-gl-compare@0.5.0/dist/maplibre-gl-compare.min.js"),document.head.appendChild(x)},initCompare(){const f=this.map,x={version:8,glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf",sources:{},layers:[]},k=new In.Map({container:"after",style:x,center:f.getCenter(),zoom:f.getZoom(),minZoom:f.getMinZoom()});if(k.addControl(new In.NavigationControl({visualizePitch:!0})),k.on("load",()=>{this.afterMapLoaded=!0,this.syncLayers()}),this.afterMap=k,window.maplibregl&&window.maplibregl.Compare){const P="#comparison-container";this.compare=new window.maplibregl.Compare(f,k,P,{mousemove:!1})}else console.error("Compare is not available on window.maplibregl")},destroyCompare(){this.compare&&(this.compare.remove(),this.compare=null),this.afterMap&&(this.afterMap.remove(),this.afterMap=null),this.isOpen=!1,this.afterMapLoaded=!1},toggleCompare(){if(this.collapsed){this.collapsed=!1;return}this.isOpen=!this.isOpen,this.isOpen?this.$nextTick(()=>{this.initCompare(),this.resizeMaps()}):this.destroyCompare()},resizeMaps(){this.map.resize(),this.afterMap&&this.afterMap.resize()},syncLayers(){if(!this.map||!this.afterMap)return;const f=this.map,x=this.afterMap;f.getSource(this.table)&&(x.getSource(this.table)||x.addSource(this.table,f.getStyle().sources[this.table]));const P=f.getStyle().layers.filter(D=>D.source===this.table);P.length&&P.forEach(D=>{x.getLayer(D.id)||x.addLayer(D)})}}},rg={class:"w-[29px] h-[29px] flex items-center justify-center"},ng={key:2,id:"comparison-container",class:"absolute top-0 right-0 w-full h-full"},sg=[N.createElementVNode("div",{id:"after",class:"map-compare"},null,-1)];function og(f,x,k,P,D,j){const S=N.resolveComponent("compareIcon"),c=N.resolveComponent("VsPopover"),fe=N.resolveComponent("CompareBaseLayers");return N.openBlock(),N.createElementBlock(N.Fragment,null,[D.mounted?(N.openBlock(),N.createBlock(c,{key:0,teleport:"body",trigger:"hover",placement:"left",class:N.normalizeClass(["flex absolute right-[10px] top-[120px] bg-white max-w-[250px] rounded-lg cursor-pointer z-10",j.modalButtonClasses]),onClick:j.toggleCompare,style:{"box-shadow":"0 0 0 2px rgba(0, 0, 0, 0.2)"}},{reference:N.withCtx(()=>[N.createElementVNode("div",rg,[N.createVNode(S,{class:"w-4 h-4"})])]),default:N.withCtx(()=>[N.createTextVNode(" Порівняти шари ")]),_:1},8,["class","onClick"])):N.createCommentVNode("",!0),D.isOpen&&D.afterMapLoaded?(N.openBlock(),N.createBlock(fe,{key:1,table:k.table,map:D.afterMap,compareLayers:k.compareLayers,onClose:j.destroyCompare,collapsed:D.collapsed,"onUpdate:collapsed":x[0]||(x[0]=me=>D.collapsed=me)},null,8,["table","map","compareLayers","onClose","collapsed"])):N.createCommentVNode("",!0),D.isOpen?(N.openBlock(),N.createElementBlock("div",ng,sg)):N.createCommentVNode("",!0)],64)}const ag=Fi(ig,[["render",og]]),lg={props:["colors","strokes","title"],methods:{capitalizeFirstLetter(f){return f?f.charAt(0).toUpperCase()+f.slice(1):""}}},cg={class:"absolute left-[20px] bottom-[74px] bg-white max-w-[250px] p-[10px] rounded-lg z-10 border"},hg={key:0,class:"mb-[10px] text-[1rem]"},ug={key:1},dg={class:"legend-item flex items-center gap-2 mb-[10px]"},pg={class:"ml-1 text-[0.875rem]"},fg={class:"legend-item"},mg={key:0,class:"flex justify-start items-center gap-2"},gg={class:"ml-1 text-[0.875rem]"};function _g(f,x,k,P,D,j){var S;return N.openBlock(),N.createElementBlock("div",cg,[k.title?(N.openBlock(),N.createElementBlock("div",hg,N.toDisplayString(k.title),1)):N.createCommentVNode("",!0),(S=k.strokes)!=null&&S.length?(N.openBlock(),N.createElementBlock("div",ug,[(N.openBlock(!0),N.createElementBlock(N.Fragment,null,N.renderList(k.strokes,c=>(N.openBlock(),N.createElementBlock("div",dg,[N.createElementVNode("div",{class:"w-[15px] h-[4px]",style:N.normalizeStyle({background:`repeating-linear-gradient(to right, ${c.color}, ${c.color} 5px, transparent 5px, transparent 8px)`})},null,4),N.createElementVNode("div",pg,N.toDisplayString(j.capitalizeFirstLetter(c.text)),1)]))),256))])):N.createCommentVNode("",!0),(N.openBlock(!0),N.createElementBlock(N.Fragment,null,N.renderList(k.colors,c=>(N.openBlock(),N.createElementBlock("div",fg,[c.id>0?(N.openBlock(),N.createElementBlock("div",mg,[N.createElementVNode("div",{class:"w-[15px] h-[15px] rounded-[50%] min-w-[15px]",style:N.normalizeStyle({backgroundColor:c.color})},null,4),N.createElementVNode("div",gg,N.toDisplayString(j.capitalizeFirstLetter(c.text)),1)])):N.createCommentVNode("",!0)]))),256))])}const yg={components:{MapSlotLayers:bm,MapLegend:Fi(lg,[["render",_g]]),AdditionalLayers:Nm,MapCompare:ag},props:{isMapCompare:{type:Boolean,default:!0},polygonOpacity:{type:Number,default:()=>null},polygonStrokeWidth:{type:Number,default:()=>4},dashedLine:{type:Boolean,default:()=>!1},colorAttr:null,strokeAttr:null,zoom:{type:Array,default:()=>8},defaultColor:{type:String,default:"blue"},selectedBaseLayer:{type:String,required:!0},legendname:{type:String,default:()=>""},height:{type:String,default:()=>"100vh"},width:{type:String,default:"100vw"},center:{type:Array,default:[32,49]},maxBounds:{type:Array,default:[[22,44],[40,52]]},table:{type:String,default:""},zoom:{type:[String,Number],default:13},minZoom:{type:[String,Number],default:1},basemap:Array,additionalLayers:Array,filtersParam:{type:String,default:""},row:{type:Object,default:{}},pointZoom:{type:String,default:"12"},legend:{type:Boolean,default:()=>!0},compareLayers:{type:Array,default:()=>[]}},mixins:[Oo],data(){return{map:null,hoverObject:null,popup:null,colors:[],strokes:null}},async mounted(){var f,x,k,P;try{if(await this.createMap(),(f=this.row)!=null&&f.geom){const{type:D,coordinates:j}=this.row.geom;let S;switch(D){case"Polygon":S=Vu(j);break;case"MultiPolygon":S=$u(j);break;case"MultiPoint":S=Nu(j);break;default:(x=this.map)==null||x.fitBounds([j,j],{maxZoom:this.zoom,padding:30,duration:0}),this.isSelectObj=!0;return}const c=fm(S).geometry.coordinates;(k=this.map)==null||k.fitBounds([c,c],{maxZoom:this.zoom,padding:30,duration:0})}(P=this.map)==null||P.fitBounds(this.center,{duration:0})}catch{}},watch:{filtersParam(f){this.setFilter(this.table,f)},selectedBaseLayer(f){this.$emit("update:selectedBaseLayer",f)},row:{handler(f){f!=null&&f.geom&&this.fitToBounds(f.geom),this.map&&this.map.getStyle()&&this.map.getStyle().layers.filter(P=>P.source===this.table&&P.type==="line").forEach(P=>{var D;this.map.setPaintProperty(P.id,"line-width",((D=this.row)==null?void 0:D.id)!=null?["case",["==",["get","id"],this.row.id.toString()],(this.polygonStrokeWidth??2.5)*2,this.polygonStrokeWidth??2.5]:this.polygonStrokeWidth??2.5)})},immediate:!0}},computed:{basemapIds(){return this.basemap.map(f=>f==null?void 0:f.id)},allLayers(){return[...this.basemap||[],...this.additionalLayers||[],...this.compareLayers||[]]}},methods:{async getColorStyle(){var f=[["#69D2E7","#A7DBD8","#E0E4CC","#F38630","#FA6900"],["#FE4365","#FC9D9A","#F9CDAD","#C8C8A9","#83AF9B"],["#ECD078","#D95B43","#C02942","#542437","#53777A"]];if(!this.colorAttr)return this.defaultColor;try{const{data:{rows:x}}=await Zt.get(`/api/data/${this.table}/${this.colorAttr}`),k=x.reduce((P,D,j)=>D!=null&&D.id?[...P,D.id.toString(),D.color||f[0][j%5]]:P,["match",["get",this.colorAttr]]);return this.colors=[...x],k.push("gray"),k}catch(x){console.log(x)}},async getStrokeStyle(){if(!this.strokeAttr)return"transparent";try{const{data:{rows:f}}=await Zt.get(`/api/data/${this.table}/${this.strokeAttr}`),x=f.reduce((k,P,D)=>P!=null&&P.id?[...k,{id:P.id.toString(),color:P.color||"#000000",dash:P.dash||[2,2],text:P.text||P.id.toString()}]:k,[]);return this.strokes=[...x],["match",["get",this.strokeAttr],...x.flatMap(({id:k,color:P})=>[k,P]),"transparent"]}catch(f){return console.log(f),"transparent"}},async handleMapLoad(){var P,D,j,S,c;(P=this.row)!=null&&P.geom&&this.fitToBounds(this.row.geom),this.$emit("map",this.map);const f=await this.getStrokeStyle(),x=await this.getColorStyle(),k=((j=(D=location.search.split("&").find(fe=>fe.includes("filter=")))==null?void 0:D.split("filter="))==null?void 0:j[1])||"";await this.addLayer({id:this.table,service:"vector",url:`/api/vtile/${this.table}/ua/{z}/{x}/{y}.vmt?pointZoom=${this.pointZoom}&dt=${new Date().toISOString()}`,layers:[{type:"fill","source-layer":this.table,paint:{"fill-color":x,"fill-opacity":this.polygonOpacity??.5,"fill-outline-color":["case",["==",["feature-state","hover"],!0],"red","#000000"]},filter:["all",["==",["geometry-type"],"Polygon"]]},{type:"circle","source-layer":this.table,filter:["all",["==",["geometry-type"],"Point"]],paint:{"circle-radius":{base:1.75,stops:[[10,5],[12,6],[18,12]]},"circle-stroke-color":["case",["==",["feature-state","hover"],!0],"red","#ccc"],"circle-stroke-width":["case",["==",["feature-state","hover"],!0],2,1],"circle-color":x}},{type:"line",paint:{"line-color":x,"line-width":((S=this.row)==null?void 0:S.id)!=null?["case",["==",["get","id"],this.row.id.toString()],(this.polygonStrokeWidth??2.5)*2,this.polygonStrokeWidth??2.5]:this.polygonStrokeWidth??2.5}},...this.dashedLine?[{type:"line",paint:{"line-color":f,"line-width":((c=this.row)==null?void 0:c.id)!=null?["case",["==",["get","id"],this.row.id.toString()],(this.polygonStrokeWidth??2.5)*2,this.polygonStrokeWidth??2.5]:this.polygonStrokeWidth??2.5,"line-dasharray":[2,2]}}]:[]]}),k&&this.setFilter(this.table,k)},async createMap(){const f={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new In.Map({container:"maplibre-map",style:f,zoom:this.zoom,center:this.center,minZoom:this.minZoom}),this.$parent.map=this.map,this.map.addControl(new In.NavigationControl({visualizePitch:!0})),this.map.on("load",this.handleMapLoad)},fitToBounds(f){if(!this.map)return;const{type:x,coordinates:k}=f;let P,D;switch(x){case"Polygon":P=Vu(k),D=jo(P),this.map.fitBounds(D,{padding:30,maxZoom:15,duration:0});break;case"MultiPolygon":P=$u(k),D=jo(P),this.map.fitBounds(D,{padding:30,maxZoom:15,duration:0});break;case"MultiPoint":P=Nu(k),D=jo(P),this.map.fitBounds(D,{padding:30,maxZoom:15,duration:0});break;case"Point":this.map.flyTo({center:k,zoom:15,duration:0,essential:!0});break;default:console.warn("Невідомий тип геометрії:",x)}}}},xg={class:"vs-map-portal relative z-1 mt-2",id:"mapwrapper"};function vg(f,x,k,P,D,j){var ve;const S=N.resolveComponent("MapLegend"),c=N.resolveComponent("MapSlotLayers"),fe=N.resolveComponent("MapCompare"),me=N.resolveComponent("AdditionalLayers");return N.openBlock(),N.createElementBlock("div",xg,[N.createElementVNode("div",{id:"maplibre-map",ref:"maplibreMap",class:"w-full compare_main_map",style:N.normalizeStyle({height:k.height})},null,4),N.withDirectives(N.createVNode(S,{colors:D.colors,strokes:D.strokes,title:k.legendname},null,8,["colors","strokes","title"]),[[N.vShow,k.legend]]),N.createVNode(c,{map:D.map,baseLayers:k.basemap,selectedLayer:k.selectedBaseLayer,"onUpdate:selectedLayer":x[0]||(x[0]=ae=>f.$emit("update:selectedBaseLayer",ae))},null,8,["map","baseLayers","selectedLayer"]),k.isMapCompare?(N.openBlock(),N.createBlock(fe,{key:0,map:D.map,compareLayers:j.allLayers,table:k.table,onIsCompareOpen:x[1]||(x[1]=ae=>f.$emit("isCompareOpen",ae))},null,8,["map","compareLayers","table"])):N.createCommentVNode("",!0),(ve=k.additionalLayers)!=null&&ve.length?(N.openBlock(),N.createBlock(me,{key:1,map:D.map,layers:k.additionalLayers,basemapIds:j.basemapIds},null,8,["map","layers","basemapIds"])):N.createCommentVNode("",!0)])}const bg=Fi(yg,[["render",vg]]),wg={},Sg={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Tg=[N.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)];function kg(f,x){return N.openBlock(),N.createElementBlock("svg",Sg,Tg)}const Ig=Fi(wg,[["render",kg]]),Cg={},Eg={xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-layout-sidebar-right-collapse"},Pg=[N.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),N.createElementVNode("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null,-1),N.createElementVNode("path",{d:"M15 4v16"},null,-1),N.createElementVNode("path",{d:"M9 10l2 2l-2 2"},null,-1)];function Ag(f,x){return N.openBlock(),N.createElementBlock("svg",Eg,Pg)}const Mg=Fi(Cg,[["render",Ag]]),zg={},Dg={xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-layout-sidebar-right-expand"},Lg=[N.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),N.createElementVNode("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null,-1),N.createElementVNode("path",{d:"M15 4v16"},null,-1),N.createElementVNode("path",{d:"M10 10l-2 2l2 2"},null,-1)];function Rg(f,x){return N.openBlock(),N.createElementBlock("svg",Dg,Lg)}const Bg=Fi(zg,[["render",Rg]]),Fg={props:{visible:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},size:{type:String,default:()=>""}},emits:["update:visible","onClose"],name:"vs-dialog",mounted(){window.addEventListener("keydown",this.checkKey)},unmounted(){window.removeEventListener("keydown",this.checkKey)},computed:{hasSlot(){var f;return!!((f=this.$slots)!=null&&f.footer)},checkSize(){return this.size==="small"?"w-5/12":this.size==="medium"?"w-6/12":"lg:w-7/12 w-11/12"}},methods:{checkKey({key:f}){f==="Escape"&&this.handleClose()},handleClose(){this.$emit("update:visible",!1),this.$emit("onClose")}}},ju=f=>(N.pushScopeId("data-v-37405773"),f=f(),N.popScopeId(),f),Og={class:"vsTailwind ui-dialog__wrapper"},Vg={class:"w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},Ng={class:"py-2.5 px-4 flex justify-between items-center border-b"},$g={class:"font-medium text-gray-800"},Ug=[ju(()=>N.createElementVNode("span",{class:"sr-only"},"Close",-1)),ju(()=>N.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[N.createElementVNode("path",{d:"M18 6 6 18"}),N.createElementVNode("path",{d:"m6 6 12 12"})],-1))],jg={class:"ui-dialog__content p-4"},qg={key:0,class:"flex justify-end gap-x-2"};function Zg(f,x,k,P,D,j){return N.openBlock(),N.createBlock(N.Teleport,{to:"#modal"},[N.createVNode(N.Transition,{name:"fade"},{default:N.withCtx(()=>[N.withDirectives(N.createElementVNode("div",Og,[N.createElementVNode("div",Vg,[N.createVNode(N.Transition,{name:"content",appear:""},{default:N.withCtx(()=>[N.createElementVNode("div",{class:N.normalizeClass(["ui-dialog__modal opacity-1 transition-all flex flex-col bg-white border pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",[j.checkSize]])},[N.createElementVNode("div",Ng,[N.createElementVNode("h3",$g,N.toDisplayString(k.title),1),N.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:x[0]||(x[0]=(...S)=>j.handleClose&&j.handleClose(...S))},Ug)]),N.createElementVNode("div",jg,[N.renderSlot(f.$slots,"default",{},void 0,!0)]),j.hasSlot?(N.openBlock(),N.createElementBlock("div",qg,[N.renderSlot(f.$slots,"footer",{},void 0,!0)])):N.createCommentVNode("",!0)],2)]),_:3})])],512),[[N.vShow,k.visible]])]),_:3})])}const Gg=Fi(Fg,[["render",Zg],["__scopeId","data-v-37405773"]]),Hg=N.defineComponent({props:{dashedLine:{type:Boolean,default:!1},title:{type:String,default:()=>""},table:{type:String,default:()=>""},rows:{type:Object,default:()=>null},isMapCompare:{type:Boolean,default:!0},initTotal:{type:[Number,String],default:()=>""},colorAttr:{type:String,default:()=>""},strokeAttr:{type:String,default:()=>""},legendname:{type:String,default:()=>""},center:{type:Array},maxBounds:{type:Array,default:()=>[[22,44.4],[40,52.5]]},id:{type:String,default:()=>""},isAutocomplete:{type:Boolean,default:()=>!1},isAddressAutocomplete:{type:Boolean,default:()=>!1},zoom:{type:[Number,String],default:()=>"13"},minZoom:{type:[Number,String],default:()=>"1"},maskForSearch:{type:String,default:()=>null},searchShow:{type:Boolean,default:()=>!0},basemap:{type:Array},additionalLayers:{type:Array},pointZoom:{type:String,default:()=>"12"},legend:{type:Boolean,default:()=>!0},defaultColor:{type:String,default:()=>"blue"},compareLayers:{type:Array,default:()=>[]},polygonOpacity:{type:Number,default:()=>null}},mixins:[Oo],components:{MapPortal:bg,NoData:qp,FilterIcon:Ig,VisibleMapIcon:Mg,HiddenMapIcon:Bg,CloseIcon:gl,VsDialog:Gg},data(){return{filters:"",search:"",limit:20,polyline:null,filtersParam:"",isSelectObj:!1,selectedId:"",searchRegion:"",searchAddress:"",map:null,selectedBaseLayer:"",marker:null,selectedRow:null,activeFilters:"",isMapVisible:!0,tabsIsVisible:!1,filterUrl:"",currentPage:1,regionOptionGeneral:null,isFilterVisible:!1,tableData:null,hoverData:null,atuData:[],map:null,legendName:null,total:null,filtered:null,filterValues:"",activeFiltersCount:"",visibleTrue:!0,regionSelectValue:null,addressSelectValue:null,currentBbox:null,mountedFilter:{},isCompareOpen:!1,optionRowsCount:[{value:10,label:"10"},{value:20,label:"20"},{value:30,label:"30"}],handleDebouncedUpdateValue:pm(f=>{this.handleSearchValue(f)},300)}},watch:{map(){this.map.on("mousemove",this.handleMapHover),this.map.on("click",this.handleMapClick),this.$emit("update:map",this.map)},activeFiltersCount(){var f,x;return(x=(f=this.$refs)==null?void 0:f.filter)==null?void 0:x.filteredActiveFiltersLength},activeFilters(){var f,x;return(x=(f=this.$refs)==null?void 0:f.filter)==null?void 0:x.activeFilters},isFilterVisible(f){f||this.getData()},async regionSelectValue(f,x){var D,j;if(!this.regionSelectValue){this.map.removeSource("region-search-id");return}f&&this.selectedId&&this.closeObjCard(),this.polyline=this.regionSelectValue.encoded_geom,this.getData();const k=((D=this.regionSelectValue)==null?void 0:D.geom)||Tr.toGeoJSON(this.regionSelectValue.encoded_geom),P=this.map.getSource("region-search-id");if(this.currentBbox=jo(k),P)P.setData({type:"Feature",geometry:k});else{this.map.addSource("region-search-id",{type:"geojson",data:{type:"Feature",geometry:k}});const S={id:"region-search-id",type:"line",source:"region-search-id",paint:{"line-color":"blue","line-opacity":1}};await this.map.addLayer(S)}this.moveLayer("site.prc.parcel_object.table"),(j=this.map)==null||j.fitBounds(this.currentBbox,{zoom:this.setAtuZoom,padding:20,duration:0}),this.getData()},async addressSelectValue(f,x){this.addressSelectValue&&(f&&this.selectedId&&this.closeObjCard(),this.getData())}},created(){this.tableData=this.rows,this.total=this.initTotal,this.id&&(this.selectedRow=this.rows[0],this.selectedId=this.id,this.isSelectObj=!0)},mounted(){this.rows||this.getData();const f=new URLSearchParams(window.location.search),x=f.get("filter");f.get("id");const k=x==null?void 0:x.split("|");k==null||k.forEach(D=>{const[j,S]=D.split("=");S!=null&&S.includes(",")?this.mountedFilter[j]=S==null?void 0:S.split(","):this.mountedFilter[j]=S,this.activeFilters=this.mountedFilter});const P=new URLSearchParams(window.location.search);this.currentPage=P.get("page")||1,this.getFilter()},updated(){this.checkFilterLength()},computed:{setAtuZoom(){var f,x,k;return((f=this.regionSelectValue)==null?void 0:f.id)==="UA80000000000093317"||((x=this.regionSelectValue)==null?void 0:x.id)==="UA85000000000065278"?10:((k=this.regionSelectValue)==null?void 0:k.region)===""?7.5:11}},methods:{async getData(){try{const f={search:this.search||null,limit:this.limit,page:this.currentPage,polyline:this.polyline};f.filter=this.filtersParam;const{data:x}=await Zt.get(`/api/data/${this.table}`,{params:f});this.tableData=x==null?void 0:x.rows,this.total=x.filtered,this.filtered=x.filtered}catch(f){console.error(f.message)}},moveToDefaultPage(){var P;const f=new URLSearchParams(window.location.search);f.delete("id");const k=`${window.location.pathname}?${f.toString()}`;(P=this.map)==null||P.fitBounds(this.maxBounds,{duration:0}),window.history.pushState({},"",k),this.isSelectObj=!1},regionFullName(f){return f.region?`${f.text} / ${f.region}`:f.text},getLabelById(f){const x=this.filters.find(k=>k.id===f);return x?x.label:f},getOptionsLabelById(f,x){if(Array.isArray(x)){const k=this.filters.find(P=>P.id===f);return k!=null&&k.options?k==null?void 0:k.options.filter(P=>x.includes(P.id)).map(P=>P.text).join(", "):x==null?void 0:x.length}else return x},async clearFilter(f){var x,k,P;await((k=(x=this.$refs)==null?void 0:x.filter)==null?void 0:k.clearFilter(f)),this.filterUrl=(P=this.$refs)==null?void 0:P.filter.filterUrl,(f==="region_katottg"||f==="katottg")&&this.$emit("update:filterState",{}),await this.updateTableAndMap(),await this.getData()},handlePageChange(f){this.currentPage=f;const x=new URL(window.location.href),k=new URLSearchParams(window.location.search);k.set("page",f),x.search=decodeURI(k.toString()),window.history.pushState({},"",x),this.getData()},async getFilter(){var f;try{const{data:x}=await Zt.get(`/api/filter/${this.table}`);this.filters=(f=x==null?void 0:x.list)==null?void 0:f.map(k=>({...k,label:(k==null?void 0:k.label)||(k==null?void 0:k.ua),id:(k==null?void 0:k.id)||(k==null?void 0:k.name)}))}catch(x){console.error(x.message)}},async handleSearchValue(f){this.search=f,await this.getData()},closeObjCard(){var P;const f=new URLSearchParams(window.location.search);f.delete("id"),this.deletePulsePoint(),this.deleteHighlighPolygon();const k=`${window.location.pathname}?${f.toString()}`;(this.currentBbox||this.center)&&((P=this.map)==null||P.fitBounds(this.currentBbox||[this.center,this.center],{maxZoom:this.zoom,duration:0})),window.history.pushState({},"",k),this.isSelectObj=!1,this.selectedRow=null,this.getData()},async handleSearchRegionValue(f){var k;const x=this.map.getLayer("region-search-id");this.searchRegion=f,f===""&&x?((k=this.map)==null||k.fitBounds(this.maxBounds,{duration:0}),this.currentBbox=null,this.polyline=null,this.map.removeLayer("region-search-id"),this.getData()):f===""&&this.getData()},async handleSearchAddressValue(f){var k;const x=this.map.getLayer("address-search-id");this.searchAddress=f,f===""&&x?((k=this.map)==null||k.fitBounds(this.maxBounds,{duration:0}),this.currentBbox=null,this.polyline=null,this.map.removeLayer("address-search-id"),this.getData()):f===""&&this.getData()},handleFilterChange(f){this.$emit("update:filterState",f),this.currentPage=f.state.page||1,this.filterUrl=f.url==="no-url"?null:f.url.split("|").filter(x=>!x.includes("page=")).join("|")},async updateTableAndMap(){var f,x;this.selectedRow||(this.filtersParam=this.filterUrl,this.activeFilters=(x=(f=this.$refs)==null?void 0:f.filter)==null?void 0:x.activeFilters,this.isFilterVisible=!1,this.getData())},handleFilterSubmit(){var f;this.isSelectObj="",this.selectedId="",this.selectedId=!1,(f=this.map)==null||f.fitBounds(this.maxBounds,{duration:0}),this.isFilterVisible=!1},toggleMapVisible(){this.isMapVisible=!this.isMapVisible},checkUrl(f=!0){const x=new URLSearchParams(window.location.search);x.has("id")?(this.isSelectObj=!0,this.isMapVisible=f,this.selectedId=x.get("id")):(this.isSelectObj=!1,this.selectedId="")},changeLimit(f){this.limit=f,this.currentPage=1,this.getData()},filterModalClose(){this.isFilterVisible=!1},resetFilters(){this.$refs.filter&&(this.$refs.filter.clearAll(),this.search="",this.isFilterVisible=!1,this.filtersParam="",this.polyline=null,this.regionSelectValue=null,this.addressSelectValue=null,this.currentBbox=null,this.activeFilters=null,this.tabsIsVisible=!1,this.handleSearchRegionValue(""),this.handleSearchAddressValue(""))},checkFilterLength(){var x,k;const f=(k=(x=this.$refs)==null?void 0:x.filter)==null?void 0:k.filteredActiveFiltersLength;f!==this.previousLength&&(this.previousLength=f,this.activeFiltersCount=f)},async handleMapClick(f){var j,S,c,fe,me,ve,ae,le,ht,$e;const x=this.map.queryRenderedFeatures(f.point);if((x==null?void 0:x.length)<1||((j=x[0])==null?void 0:j.source)==="region-search-id"||((S=x[0])==null?void 0:S.source)==="route-line")return;const k=window.location.pathname,P=new URLSearchParams(window.location.search);P.set("id",`${(c=x[0])==null?void 0:c.properties.id}`),this.getObjectData((me=(fe=x[0])==null?void 0:fe.properties)==null?void 0:me.id);const D=`${k}?${P.toString()}`;window.history.pushState({},"",D),this.isSelectObj=!0,f.lngLat&&(($e=this.map)==null||$e.fitBounds([[(ve=f.lngLat)==null?void 0:ve.lng,(ae=f.lngLat)==null?void 0:ae.lat],[(le=f.lngLat)==null?void 0:le.lng,(ht=f.lngLat)==null?void 0:ht.lat]],{padding:30,duration:0})),this.checkUrl()},async getObjectData(f){var x,k;try{const{data:P}=await Zt.get(`/api/data/${this.table}/${f}`);this.selectRow((x=P==null?void 0:P.rows)==null?void 0:x[0]),((k=P==null?void 0:P.rows)==null?void 0:k.lenght)<1&&this.deletePulsePoint()}catch(P){console.error(P.message)}},async selectRow(f,x=!0){var c;this.isMapVisible=x;const P=await(await fetch(`/api/data/${this.table}/${f.id}`)).json();this.selectedRow=((c=P==null?void 0:P.rows)==null?void 0:c[0])||f;const D=window.location.pathname,j=new URLSearchParams(window.location.search);j.set("id",`${f.id}`);const S=`${D}?${j.toString()}`;window.history.pushState({},"",S),this.checkUrl(x),this.isSelectObj=!0},deletePulsePoint(){this.marker&&this.marker.remove()},addPulsePoint(f){this.deletePulsePoint();const x=document.createElement("div");x.className="gps-marker",x.style.width="10px",x.style.height="10px",x.style.position="relative";const k=document.createElement("div");k.className="gps-wave",x.appendChild(k),this.marker=new In.Marker({element:x,anchor:"center"}).setLngLat(f).addTo(this.map)},deleteHighlighPolygon(){var f,x,k;(f=this.map)!=null&&f.getLayer("highlighted-polygon")&&((x=this.map)==null||x.removeLayer("highlighted-polygon"),(k=this.map)==null||k.removeSource("highlighted-polygon"))},highlightPolygon(f){var x,k,P,D,j,S;this.deletePulsePoint(),this.deleteHighlighPolygon(),(D=this.map)==null||D.addSource("highlighted-polygon",{type:"geojson",data:{geometry:{type:(x=f==null?void 0:f.geom)==null?void 0:x.type,coordinates:(k=f==null?void 0:f.geom)==null?void 0:k.coordinates},type:"Feature",properties:{id:f==null?void 0:f.id,name:f==null?void 0:f.name,category:f==null?void 0:f.id},id:f==null?void 0:f.id,layer:{id:"site.rest_zone.table-0",type:"fill",source:"site.rest_zone.table",sourceLayer:"site.rest_zone.table",filter:["all",["==",["geometry-type"],(P=f==null?void 0:f.geom)==null?void 0:P.type]],paint:{"fill-color":"orange","fill-opacity":.5},layout:{}},source:"site.rest_zone.table",sourceLayer:"site.rest_zone.table",state:{hover:!0},table:"site.rest_zone.table"}}),(j=this.map)==null||j.addLayer({id:"highlighted-polygon",type:"fill",source:"highlighted-polygon",layout:{},minzoom:12,maxzoom:0,paint:{"fill-color":"orange","fill-opacity":.6}}),(S=this.map)==null||S.moveLayer("highlighted-polygon")},async handleMapHover(f){var S,c,fe;this.hoverObject&&(this.map.setFeatureState(this.hoverObject,{hover:!1}),this.hoverObject=null),this.popup||(this.popup=new In.Popup({maxWidth:"400px",closeButton:!1,closeOnClick:!1}));const x=this.map.queryRenderedFeatures(f.point);if(this.map.getCanvas().style.cursor="pointer",!(x!=null&&x.length)||((S=x==null?void 0:x[0])==null?void 0:S.source)==="region-search-id"){this.map.getCanvas().style.cursor="",this.popup.remove();return}const k=["route-line"];if(!x.filter(me=>!k.some(ve=>{var ae;return(ae=me.layer)==null?void 0:ae.source.includes(ve)})).length)return;const D=x[0].geometry.coordinates.slice();x[0].source==="highlighted-polygon"&&x[1]?this.hoverData=(c=x[1])==null?void 0:c.properties:this.hoverData=(fe=x[0])==null?void 0:fe.properties;const j={source:x[0].source,sourceLayer:x[0].sourceLayer,id:x[0].id};if(j.source!=="region-search-id"){for(this.map.setFeatureState(j,{hover:!0}),this.hoverObject=j;Math.abs(f.lngLat.lng-D[0])>180;)D[0]+=f.lngLat.lng>D[0]?360:-360;this.popup.setLngLat(f.lngLat).setHTML(this.$refs.popup.innerHTML).addTo(this.map)}},removeSelectedBaseLayer(){this.selectedBaseLayer=""},addGeomMarker(f){if(!this.map||!f)return;this.marker&&this.marker.remove();let x;(f==null?void 0:f.type)==="Point"?x=f.coordinates:x=mm(f).geometry.coordinates,this.marker=new In.Marker({color:"green"}).setLngLat(x).addTo(this.map)}}}),Wg={class:"ml-3 pt-[20px]"},Xg={class:"w-full gap-5 flex justify-between mb-[6px] pr-3"},Jg={class:"flex items-center gap-2 max-h-[38px] pt-[4px]"},Kg={class:"custom-filter-list"},Yg={key:0,class:"font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"},Qg=["title"],e_=N.createElementVNode("span",{class:"sr-only"},"Відкрити мапу",-1),t_={class:"flex"},i_={class:"py-[15px] pb-[24px] pl-2"},r_={class:"font-bold text-2xl mr-[10px]"},n_={class:"text-sm text-stone-500 font-medium"},s_=N.createElementVNode("span",{class:"text-sm text-stone-500 font-medium"}," об'єктів",-1),o_={class:"wrapperTable flex flex-col",style:{height:"calc(100vh - 302px)"}},a_={key:0,class:"flex gap-x-2 flex-wrap"},l_={class:"font-medium"},c_=N.createElementVNode("span",{class:"h-3 mx-2 border-s border-gray-200"},null,-1),h_={class:"text-gray-500"},u_=["onClick"],d_={key:0,class:"mb-[10px] py-1 ps-3 pe-1 inline-flex items-center bg-white border border-gray-200 text-gray-800 text-xs rounded-full"},p_=N.createElementVNode("span",{class:"font-medium"}," Очистити ",-1),f_={key:2,class:"text-center py-28"},m_=N.createElementVNode("h2",{class:"font-medium text-base text-gray-500 rounded-xl"}," За вашим запитом даних не знайдено! ",-1),g_=N.createElementVNode("p",{class:"font-normal text-sm text-gray-500 rounded-xl"}," Введіть, будь ласка, інші значення для пошуку. ",-1),__={key:0},y_={key:1,class:"my-5 pr-2"},x_={class:"flex justify-between"},v_={class:"w-2/4"},b_={class:"map-section relative"},w_={ref:"popup",style:{display:"none"}};function S_(f,x,k,P,D,j){var Oe,ft;const S=N.resolveComponent("VsTextMask"),c=N.resolveComponent("vs-text"),fe=N.resolveComponent("FilterIcon"),me=N.resolveComponent("VsFilterList"),ve=N.resolveComponent("VisibleMapIcon"),ae=N.resolveComponent("HiddenMapIcon"),le=N.resolveComponent("CloseIcon"),ht=N.resolveComponent("NoData"),$e=N.resolveComponent("VsPagination"),Ke=N.resolveComponent("MapPortal");return N.openBlock(),N.createElementBlock("section",Wg,[N.createElementVNode("div",null,[N.createElementVNode("div",Xg,[N.createElementVNode("div",Jg,[f.maskForSearch?(N.openBlock(),N.createBlock(S,{key:0,"model-value":f.search,"onUpdate:modelValue":f.handleDebouncedUpdateValue,class:"w-full table-interface-search",placeholder:"Пошук",mask:f.maskForSearch,icon:"search",iconPosition:"left",clearable:"",style:{height:"38px","min-width":"300px","max-width":"300px"},ref:"searchInput"},null,8,["model-value","onUpdate:modelValue","mask"])):f.searchShow?(N.openBlock(),N.createBlock(c,{key:1,"model-value":f.search,"onUpdate:modelValue":f.handleDebouncedUpdateValue,class:"[&>input]:py-[7px] [&>input]:max-h-[38px] [&>input]:w-[220px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600",placeholder:"Пошук",icon:"search","icon-position":"left",clearable:"",style:{height:"38px"},ref:"searchInput"},null,8,["model-value","onUpdate:modelValue"])):N.createCommentVNode("",!0),N.createElementVNode("div",Kg,[f.filters?(N.openBlock(),N.createBlock(me,{key:0,ref:"filter",modelValue:f.mountedFilter,"onUpdate:modelValue":x[0]||(x[0]=st=>f.mountedFilter=st),scheme:f.filters,isDialog:(Oe=f.filters)==null?void 0:Oe.some(st=>!(st!=null&&st.inline)),"apply-vue-router":"",history:"",view:"plain",clearable:!1,name:"filter",onFilterChange:x[1]||(x[1]=async st=>{await f.handleFilterChange(st),await f.updateTableAndMap()})},{button:N.withCtx(({visible:st})=>[N.createElementVNode("button",{type:"button",class:N.normalizeClass(["py-2 px-2.5 h-[40px] inline-flex items-center gap-x-1.5 text-sm font-medium rounded-lg bg-white text-gray-800 hover:bg-gray-50 focus:outline-none focus:bg-gray-50",[st?"border border-blue-600 border-2":"border border-gray-200"]])},[N.createVNode(fe),N.createTextVNode(" Фільтри "),f.activeFiltersCount>=1?(N.openBlock(),N.createElementBlock("span",Yg,N.toDisplayString(f.activeFiltersCount),1)):N.createCommentVNode("",!0)],2)]),_:1},8,["modelValue","scheme","isDialog"])):N.createCommentVNode("",!0)])]),N.createElementVNode("button",{type:"button",class:"py-2 px-2 inline-flex items-center gap-x-1.5 text-sm rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100",title:f.isMapVisible?"Приховати карту":"Показати карту",onClick:x[2]||(x[2]=(...st)=>f.toggleMapVisible&&f.toggleMapVisible(...st))},[f.isMapVisible?(N.openBlock(),N.createBlock(ve,{key:0})):(N.openBlock(),N.createBlock(ae,{key:1})),e_],8,Qg)]),N.createElementVNode("div",t_,[N.createElementVNode("div",{class:N.normalizeClass(["relative overflow-hidden",f.isMapVisible?"w-2/4 mr-0":"w-full mr-3",f.isSelectObj?"hidden":""])},[N.createElementVNode("h1",i_,[N.createElementVNode("span",r_,N.toDisplayString(f.title),1),N.createElementVNode("span",n_,N.toDisplayString(f.total),1),s_]),N.createElementVNode("div",o_,[f.activeFilters?(N.openBlock(),N.createElementBlock("div",a_,[(N.openBlock(!0),N.createElementBlock(N.Fragment,null,N.renderList(f.activeFilters,(st,He,Ft)=>(N.openBlock(),N.createElementBlock("span",{class:"mb-[10px] py-1 ps-3 pe-1 inline-flex items-center bg-white border border-gray-200 text-gray-800 text-xs rounded-full",key:Ft},[N.createElementVNode("span",l_,N.toDisplayString(f.getLabelById(He)),1),c_,N.createElementVNode("span",h_,N.toDisplayString(f.getOptionsLabelById(He,st)),1),N.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-5 ms-1 rounded-full text-gray-600 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 text-sm",onClick:wt=>f.clearFilter(He)},[N.createVNode(le)],8,u_)]))),128)),((ft=Object.keys(f.activeFilters))==null?void 0:ft.length)>=2?(N.openBlock(),N.createElementBlock("span",d_,[p_,N.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-5 ms-1 rounded-full text-gray-600 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 text-sm",onClick:x[3]||(x[3]=st=>f.mountedFilter={})},[N.createVNode(le)])])):N.createCommentVNode("",!0)])):N.createCommentVNode("",!0),f.total>=1?N.renderSlot(f.$slots,"table",{key:1,rows:f.tableData,map:f.map,marker:f.marker,selectRow:f.selectRow,getData:f.getData,addGeomMarker:f.addGeomMarker,isMapVisible:f.isMapVisible}):(N.openBlock(),N.createElementBlock("div",f_,[N.createVNode(ht),m_,g_,N.createElementVNode("button",{type:"button",class:"mt-[10px] py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs rounded-lg border border-stone-200 bg-white text-stone-800 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100",onClick:x[4]||(x[4]=(...st)=>f.resetFilters&&f.resetFilters(...st))}," Очистити дані пошуку ")]))]),f.total>=1?(N.openBlock(),N.createElementBlock("hr",__)):N.createCommentVNode("",!0),f.total>=1?(N.openBlock(),N.createElementBlock("div",y_,[N.createElementVNode("div",x_,[N.createVNode($e,{total:f.total,maxPages:7,defaultPage:f.currentPage,pageSize:f.limit,goTo:!1,size:"medium",onPageChange:f.handlePageChange,backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[10,20,30],onPageSizeChange:f.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])):N.createCommentVNode("",!0)],2),f.isSelectObj?(N.openBlock(),N.createElementBlock("div",{key:0,class:N.normalizeClass(f.isMapVisible?"w-2/4 mr-0 pb-5":"w-full pb-5 mr-3"),style:{height:"calc(100vh - 152px)"}},[N.renderSlot(f.$slots,"details",{table:f.table,selectedId:f.selectedId,selectedRow:f.selectedRow,map:f.map,closeObjCard:f.closeObjCard,isMapVisible:f.isMapVisible})],2)):N.createCommentVNode("",!0),N.withDirectives(N.createElementVNode("div",v_,[N.createElementVNode("section",b_,[N.renderSlot(f.$slots,"default",{map:f.map,removeSelectedBaseLayer:f.removeSelectedBaseLayer,selectedBaseLayer:f.selectedBaseLayer,isCompareOpen:f.isCompareOpen,selectedRow:f.selectedRow}),N.createVNode(Ke,{height:"calc(100vh - 152px)",width:"w-2/4",table:f.table,filtersParam:f.filtersParam,row:f.selectedRow,legendname:f.legendname,legend:f.legend,compareLayers:f.compareLayers,colorAttr:f.colorAttr,strokeAttr:f.strokeAttr,polygonOpacity:f.polygonOpacity,maxBounds:f.maxBounds,center:f.center,zoom:f.zoom,dashedLine:f.dashedLine,minZoom:f.minZoom,basemap:f.basemap,additionalLayers:f.additionalLayers,pointZoom:f.pointZoom,defaultColor:f.defaultColor,isMapCompare:f.isMapCompare,onMap:x[5]||(x[5]=st=>f.map=st),selectedBaseLayer:f.selectedBaseLayer,"onUpdate:selectedBaseLayer":x[6]||(x[6]=st=>f.selectedBaseLayer=st),onIsCompareOpen:x[7]||(x[7]=st=>f.isCompareOpen=st)},null,8,["table","filtersParam","row","legendname","legend","compareLayers","colorAttr","strokeAttr","polygonOpacity","maxBounds","center","zoom","dashedLine","minZoom","basemap","additionalLayers","pointZoom","defaultColor","isMapCompare","selectedBaseLayer"])])],512),[[N.vShow,f.isMapVisible]])]),N.createElementVNode("div",w_,[N.renderSlot(f.$slots,"popup",{data:f.hoverData})],512)])])}const qu=Fi(Hg,[["render",S_]]),Zu={install:f=>{f.component("VsPartsMap",qu)},components:{VsPartsMap:qu}};return typeof window<"u"&&(window.PartsMap=Zu),Zu});
|