@opengis/partsmap 0.0.99 → 0.0.100

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 CHANGED
@@ -20883,7 +20883,7 @@ const IconTable = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_rend
20883
20883
  this.tableData = this.rows, this.total = this.initTotal, this.id && (this.selectedRow = this.rows[0], this.selectedId = this.id, this.isSelectObj = !0);
20884
20884
  },
20885
20885
  mounted() {
20886
- this.windowWidth = window.innerWidth, this.rows || this.getData();
20886
+ this.windowWidth = window.innerWidth, parseInt(this.windowWidth) < 1e3 && (this.isMapVisible = !1), this.rows || this.getData();
20887
20887
  const b = new URLSearchParams(window.location.search).get("filter"), P = b == null ? void 0 : b.split("|");
20888
20888
  P == null || P.forEach((B) => {
20889
20889
  const [X, T] = B.split("=");
@@ -20981,7 +20981,7 @@ const IconTable = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_rend
20981
20981
  },
20982
20982
  checkUrl(g = !0) {
20983
20983
  const b = new URLSearchParams(window.location.search);
20984
- b.has("id") ? (this.isSelectObj = !0, this.isMapVisible = g, this.selectedId = b.get("id")) : (this.isSelectObj = !1, this.selectedId = "");
20984
+ b.has("id") ? (this.isSelectObj = !0, this.isMapVisible = parseInt(this.windowWidth) < 1e3 ? !1 : g, this.selectedId = b.get("id")) : (this.isSelectObj = !1, this.selectedId = "");
20985
20985
  },
20986
20986
  changeLimit(g) {
20987
20987
  this.limit = g, this.currentPage = 1, this.getData();
@@ -21022,7 +21022,7 @@ const IconTable = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_rend
21022
21022
  },
21023
21023
  async selectRow(g, b = !0) {
21024
21024
  var c;
21025
- this.isMapVisible = b;
21025
+ this.isMapVisible = parseInt(this.windowWidth) < 1e3 ? !1 : b;
21026
21026
  const C = await (await fetch(`${this.prefix}/data/${this.table}/${g.id}`)).json();
21027
21027
  this.selectedRow = ((c = C == null ? void 0 : C.rows) == null ? void 0 : c[0]) || g;
21028
21028
  const B = window.location.pathname, X = new URLSearchParams(window.location.search);
@@ -21125,7 +21125,7 @@ function _sfc_render(g, b, P, C, B, X) {
21125
21125
  renderSlot(g.$slots, "buttons"),
21126
21126
  createElementVNode("button", {
21127
21127
  type: "button",
21128
- class: "py-2 px-2 hidden min-[1001px]: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",
21128
+ class: "map-visible-button py-2 px-2 hidden min-[1001px]: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",
21129
21129
  title: g.isMapVisible ? "Приховати карту" : "Показати карту",
21130
21130
  onClick: b[2] || (b[2] = (...et) => g.toggleMapVisible && g.toggleMapVisible(...et))
21131
21131
  }, [
@@ -582,4 +582,4 @@ uniform ${A} ${I} u_${L};
582
582
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(b){return b instanceof this?b:new this(b)}static concat(b,...P){const C=new this(b);return P.forEach(B=>C.set(B)),C}static accessor(b){const C=(this[$internals]=this[$internals]={accessors:{}}).accessors,B=this.prototype;function X(T){const c=normalizeHeader(T);C[c]||(buildAccessors(B,T),C[c]=!0)}return utils$1.isArray(b)?b.forEach(X):X(b),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),utils$1.reduceDescriptors(AxiosHeaders.prototype,({value:m},b)=>{let P=b[0].toUpperCase()+b.slice(1);return{get:()=>m,set(C){this[P]=C}}}),utils$1.freezeMethods(AxiosHeaders);function transformData(m,b){const P=this||defaults,C=b||P,B=AxiosHeaders.from(C.headers);let X=C.data;return utils$1.forEach(m,function(c){X=c.call(P,X,B.normalize(),b?b.status:void 0)}),B.normalize(),X}function isCancel(m){return!!(m&&m.__CANCEL__)}function CanceledError(m,b,P){AxiosError.call(this,m??"canceled",AxiosError.ERR_CANCELED,b,P),this.name="CanceledError"}utils$1.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(m,b,P){const C=P.config.validateStatus;!P.status||!C||C(P.status)?m(P):b(new AxiosError("Request failed with status code "+P.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(P.status/100)-4],P.config,P.request,P))}function parseProtocol(m){const b=/^([-+\w]{1,25})(:?\/\/|:)/.exec(m);return b&&b[1]||""}function speedometer(m,b){m=m||10;const P=new Array(m),C=new Array(m);let B=0,X=0,T;return b=b!==void 0?b:1e3,function(fe){const _e=Date.now(),ye=C[X];T||(T=_e),P[B]=fe,C[B]=_e;let ae=X,oe=0;for(;ae!==B;)oe+=P[ae++],ae=ae%m;if(B=(B+1)%m,B===X&&(X=(X+1)%m),_e-T<b)return;const at=ye&&_e-ye;return at?Math.round(oe*1e3/at):void 0}}function throttle(m,b){let P=0,C=1e3/b,B,X;const T=(_e,ye=Date.now())=>{P=ye,B=null,X&&(clearTimeout(X),X=null),m.apply(null,_e)};return[(..._e)=>{const ye=Date.now(),ae=ye-P;ae>=C?T(_e,ye):(B=_e,X||(X=setTimeout(()=>{X=null,T(B)},C-ae)))},()=>B&&T(B)]}const progressEventReducer=(m,b,P=3)=>{let C=0;const B=speedometer(50,250);return throttle(X=>{const T=X.loaded,c=X.lengthComputable?X.total:void 0,fe=T-C,_e=B(fe),ye=T<=c;C=T;const ae={loaded:T,total:c,progress:c?T/c:void 0,bytes:fe,rate:_e||void 0,estimated:_e&&c&&ye?(c-T)/_e:void 0,event:X,lengthComputable:c!=null,[b?"download":"upload"]:!0};m(ae)},P)},progressEventDecorator=(m,b)=>{const P=m!=null;return[C=>b[0]({lengthComputable:P,total:m,loaded:C}),b[1]]},asyncDecorator=m=>(...b)=>utils$1.asap(()=>m(...b)),isURLSameOrigin=platform.hasStandardBrowserEnv?function(){const b=/(msie|trident)/i.test(navigator.userAgent),P=document.createElement("a");let C;function B(X){let T=X;return b&&(P.setAttribute("href",T),T=P.href),P.setAttribute("href",T),{href:P.href,protocol:P.protocol?P.protocol.replace(/:$/,""):"",host:P.host,search:P.search?P.search.replace(/^\?/,""):"",hash:P.hash?P.hash.replace(/^#/,""):"",hostname:P.hostname,port:P.port,pathname:P.pathname.charAt(0)==="/"?P.pathname:"/"+P.pathname}}return C=B(window.location.href),function(T){const c=utils$1.isString(T)?B(T):T;return c.protocol===C.protocol&&c.host===C.host}}():function(){return function(){return!0}}(),cookies=platform.hasStandardBrowserEnv?{write(m,b,P,C,B,X){const T=[m+"="+encodeURIComponent(b)];utils$1.isNumber(P)&&T.push("expires="+new Date(P).toGMTString()),utils$1.isString(C)&&T.push("path="+C),utils$1.isString(B)&&T.push("domain="+B),X===!0&&T.push("secure"),document.cookie=T.join("; ")},read(m){const b=document.cookie.match(new RegExp("(^|;\\s*)("+m+")=([^;]*)"));return b?decodeURIComponent(b[3]):null},remove(m){this.write(m,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(m){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(m)}function combineURLs(m,b){return b?m.replace(/\/?\/$/,"")+"/"+b.replace(/^\/+/,""):m}function buildFullPath(m,b){return m&&!isAbsoluteURL(b)?combineURLs(m,b):b}const headersToObject=m=>m instanceof AxiosHeaders?{...m}:m;function mergeConfig(m,b){b=b||{};const P={};function C(_e,ye,ae){return utils$1.isPlainObject(_e)&&utils$1.isPlainObject(ye)?utils$1.merge.call({caseless:ae},_e,ye):utils$1.isPlainObject(ye)?utils$1.merge({},ye):utils$1.isArray(ye)?ye.slice():ye}function B(_e,ye,ae){if(utils$1.isUndefined(ye)){if(!utils$1.isUndefined(_e))return C(void 0,_e,ae)}else return C(_e,ye,ae)}function X(_e,ye){if(!utils$1.isUndefined(ye))return C(void 0,ye)}function T(_e,ye){if(utils$1.isUndefined(ye)){if(!utils$1.isUndefined(_e))return C(void 0,_e)}else return C(void 0,ye)}function c(_e,ye,ae){if(ae in b)return C(_e,ye);if(ae in m)return C(void 0,_e)}const fe={url:X,method:X,data:X,baseURL:T,transformRequest:T,transformResponse:T,paramsSerializer:T,timeout:T,timeoutMessage:T,withCredentials:T,withXSRFToken:T,adapter:T,responseType:T,xsrfCookieName:T,xsrfHeaderName:T,onUploadProgress:T,onDownloadProgress:T,decompress:T,maxContentLength:T,maxBodyLength:T,beforeRedirect:T,transport:T,httpAgent:T,httpsAgent:T,cancelToken:T,socketPath:T,responseEncoding:T,validateStatus:c,headers:(_e,ye)=>B(headersToObject(_e),headersToObject(ye),!0)};return utils$1.forEach(Object.keys(Object.assign({},m,b)),function(ye){const ae=fe[ye]||B,oe=ae(m[ye],b[ye],ye);utils$1.isUndefined(oe)&&ae!==c||(P[ye]=oe)}),P}const resolveConfig=m=>{const b=mergeConfig({},m);let{data:P,withXSRFToken:C,xsrfHeaderName:B,xsrfCookieName:X,headers:T,auth:c}=b;b.headers=T=AxiosHeaders.from(T),b.url=buildURL(buildFullPath(b.baseURL,b.url),m.params,m.paramsSerializer),c&&T.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let fe;if(utils$1.isFormData(P)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)T.setContentType(void 0);else if((fe=T.getContentType())!==!1){const[_e,...ye]=fe?fe.split(";").map(ae=>ae.trim()).filter(Boolean):[];T.setContentType([_e||"multipart/form-data",...ye].join("; "))}}if(platform.hasStandardBrowserEnv&&(C&&utils$1.isFunction(C)&&(C=C(b)),C||C!==!1&&isURLSameOrigin(b.url))){const _e=B&&X&&cookies.read(X);_e&&T.set(B,_e)}return b},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(m){return new Promise(function(P,C){const B=resolveConfig(m);let X=B.data;const T=AxiosHeaders.from(B.headers).normalize();let{responseType:c,onUploadProgress:fe,onDownloadProgress:_e}=B,ye,ae,oe,at,Ve;function Xe(){at&&at(),Ve&&Ve(),B.cancelToken&&B.cancelToken.unsubscribe(ye),B.signal&&B.signal.removeEventListener("abort",ye)}let Fe=new XMLHttpRequest;Fe.open(B.method.toUpperCase(),B.url,!0),Fe.timeout=B.timeout;function ut(){if(!Fe)return;const Ze=AxiosHeaders.from("getAllResponseHeaders"in Fe&&Fe.getAllResponseHeaders()),xt={data:!c||c==="text"||c==="json"?Fe.responseText:Fe.response,status:Fe.status,statusText:Fe.statusText,headers:Ze,config:m,request:Fe};settle(function(Tt){P(Tt),Xe()},function(Tt){C(Tt),Xe()},xt),Fe=null}"onloadend"in Fe?Fe.onloadend=ut:Fe.onreadystatechange=function(){!Fe||Fe.readyState!==4||Fe.status===0&&!(Fe.responseURL&&Fe.responseURL.indexOf("file:")===0)||setTimeout(ut)},Fe.onabort=function(){Fe&&(C(new AxiosError("Request aborted",AxiosError.ECONNABORTED,m,Fe)),Fe=null)},Fe.onerror=function(){C(new AxiosError("Network Error",AxiosError.ERR_NETWORK,m,Fe)),Fe=null},Fe.ontimeout=function(){let Ct=B.timeout?"timeout of "+B.timeout+"ms exceeded":"timeout exceeded";const xt=B.transitional||transitionalDefaults;B.timeoutErrorMessage&&(Ct=B.timeoutErrorMessage),C(new AxiosError(Ct,xt.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,m,Fe)),Fe=null},X===void 0&&T.setContentType(null),"setRequestHeader"in Fe&&utils$1.forEach(T.toJSON(),function(Ct,xt){Fe.setRequestHeader(xt,Ct)}),utils$1.isUndefined(B.withCredentials)||(Fe.withCredentials=!!B.withCredentials),c&&c!=="json"&&(Fe.responseType=B.responseType),_e&&([oe,Ve]=progressEventReducer(_e,!0),Fe.addEventListener("progress",oe)),fe&&Fe.upload&&([ae,at]=progressEventReducer(fe),Fe.upload.addEventListener("progress",ae),Fe.upload.addEventListener("loadend",at)),(B.cancelToken||B.signal)&&(ye=Ze=>{Fe&&(C(!Ze||Ze.type?new CanceledError(null,m,Fe):Ze),Fe.abort(),Fe=null)},B.cancelToken&&B.cancelToken.subscribe(ye),B.signal&&(B.signal.aborted?ye():B.signal.addEventListener("abort",ye)));const kt=parseProtocol(B.url);if(kt&&platform.protocols.indexOf(kt)===-1){C(new AxiosError("Unsupported protocol "+kt+":",AxiosError.ERR_BAD_REQUEST,m));return}Fe.send(X||null)})},composeSignals=(m,b)=>{let P=new AbortController,C;const B=function(fe){if(!C){C=!0,T();const _e=fe instanceof Error?fe:this.reason;P.abort(_e instanceof AxiosError?_e:new CanceledError(_e instanceof Error?_e.message:_e))}};let X=b&&setTimeout(()=>{B(new AxiosError(`timeout ${b} of ms exceeded`,AxiosError.ETIMEDOUT))},b);const T=()=>{m&&(X&&clearTimeout(X),X=null,m.forEach(fe=>{fe&&(fe.removeEventListener?fe.removeEventListener("abort",B):fe.unsubscribe(B))}),m=null)};m.forEach(fe=>fe&&fe.addEventListener&&fe.addEventListener("abort",B));const{signal:c}=P;return c.unsubscribe=T,[c,()=>{X&&clearTimeout(X),X=null}]},streamChunk=function*(m,b){let P=m.byteLength;if(!b||P<b){yield m;return}let C=0,B;for(;C<P;)B=C+b,yield m.slice(C,B),C=B},readBytes=async function*(m,b,P){for await(const C of m)yield*streamChunk(ArrayBuffer.isView(C)?C:await P(String(C)),b)},trackStream=(m,b,P,C,B)=>{const X=readBytes(m,b,B);let T=0,c,fe=_e=>{c||(c=!0,C&&C(_e))};return new ReadableStream({async pull(_e){try{const{done:ye,value:ae}=await X.next();if(ye){fe(),_e.close();return}let oe=ae.byteLength;if(P){let at=T+=oe;P(at)}_e.enqueue(new Uint8Array(ae))}catch(ye){throw fe(ye),ye}},cancel(_e){return fe(_e),X.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(m=>b=>m.encode(b))(new TextEncoder):async m=>new Uint8Array(await new Response(m).arrayBuffer())),test=(m,...b)=>{try{return!!m(...b)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let m=!1;const b=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!b}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$1.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(m=>m.body)};isFetchSupported&&(m=>{["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!resolvers[b]&&(resolvers[b]=utils$1.isFunction(m[b])?P=>P[b]():(P,C)=>{throw new AxiosError(`Response type '${b}' is not supported`,AxiosError.ERR_NOT_SUPPORT,C)})})})(new Response);const getBodyLength=async m=>{if(m==null)return 0;if(utils$1.isBlob(m))return m.size;if(utils$1.isSpecCompliantForm(m))return(await new Request(m).arrayBuffer()).byteLength;if(utils$1.isArrayBufferView(m)||utils$1.isArrayBuffer(m))return m.byteLength;if(utils$1.isURLSearchParams(m)&&(m=m+""),utils$1.isString(m))return(await encodeText(m)).byteLength},resolveBodyLength=async(m,b)=>{const P=utils$1.toFiniteNumber(m.getContentLength());return P??getBodyLength(b)},fetchAdapter=isFetchSupported&&(async m=>{let{url:b,method:P,data:C,signal:B,cancelToken:X,timeout:T,onDownloadProgress:c,onUploadProgress:fe,responseType:_e,headers:ye,withCredentials:ae="same-origin",fetchOptions:oe}=resolveConfig(m);_e=_e?(_e+"").toLowerCase():"text";let[at,Ve]=B||X||T?composeSignals([B,X],T):[],Xe,Fe;const ut=()=>{!Xe&&setTimeout(()=>{at&&at.unsubscribe()}),Xe=!0};let kt;try{if(fe&&supportsRequestStream&&P!=="get"&&P!=="head"&&(kt=await resolveBodyLength(ye,C))!==0){let et=new Request(b,{method:"POST",body:C,duplex:"half"}),Tt;if(utils$1.isFormData(C)&&(Tt=et.headers.get("content-type"))&&ye.setContentType(Tt),et.body){const[nr,si]=progressEventDecorator(kt,progressEventReducer(asyncDecorator(fe)));C=trackStream(et.body,DEFAULT_CHUNK_SIZE,nr,si,encodeText)}}utils$1.isString(ae)||(ae=ae?"include":"omit"),Fe=new Request(b,{...oe,signal:at,method:P.toUpperCase(),headers:ye.normalize().toJSON(),body:C,duplex:"half",credentials:ae});let Ze=await fetch(Fe);const Ct=supportsResponseStream&&(_e==="stream"||_e==="response");if(supportsResponseStream&&(c||Ct)){const et={};["status","statusText","headers"].forEach(Cr=>{et[Cr]=Ze[Cr]});const Tt=utils$1.toFiniteNumber(Ze.headers.get("content-length")),[nr,si]=c&&progressEventDecorator(Tt,progressEventReducer(asyncDecorator(c),!0))||[];Ze=new Response(trackStream(Ze.body,DEFAULT_CHUNK_SIZE,nr,()=>{si&&si(),Ct&&ut()},encodeText),et)}_e=_e||"text";let xt=await resolvers[utils$1.findKey(resolvers,_e)||"text"](Ze,m);return!Ct&&ut(),Ve&&Ve(),await new Promise((et,Tt)=>{settle(et,Tt,{data:xt,headers:AxiosHeaders.from(Ze.headers),status:Ze.status,statusText:Ze.statusText,config:m,request:Fe})})}catch(Ze){throw ut(),Ze&&Ze.name==="TypeError"&&/fetch/i.test(Ze.message)?Object.assign(new AxiosError("Network Error",AxiosError.ERR_NETWORK,m,Fe),{cause:Ze.cause||Ze}):AxiosError.from(Ze,Ze&&Ze.code,m,Fe)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$1.forEach(knownAdapters,(m,b)=>{if(m){try{Object.defineProperty(m,"name",{value:b})}catch{}Object.defineProperty(m,"adapterName",{value:b})}});const renderReason=m=>`- ${m}`,isResolvedHandle=m=>utils$1.isFunction(m)||m===null||m===!1,adapters={getAdapter:m=>{m=utils$1.isArray(m)?m:[m];const{length:b}=m;let P,C;const B={};for(let X=0;X<b;X++){P=m[X];let T;if(C=P,!isResolvedHandle(P)&&(C=knownAdapters[(T=String(P)).toLowerCase()],C===void 0))throw new AxiosError(`Unknown adapter '${T}'`);if(C)break;B[T||"#"+X]=C}if(!C){const X=Object.entries(B).map(([c,fe])=>`adapter ${c} `+(fe===!1?"is not supported by the environment":"is not available in the build"));let T=b?X.length>1?`since :
583
583
  `+X.map(renderReason).join(`
584
584
  `):" "+renderReason(X[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+T,"ERR_NOT_SUPPORT")}return C},adapters:knownAdapters};function throwIfCancellationRequested(m){if(m.cancelToken&&m.cancelToken.throwIfRequested(),m.signal&&m.signal.aborted)throw new CanceledError(null,m)}function dispatchRequest(m){return throwIfCancellationRequested(m),m.headers=AxiosHeaders.from(m.headers),m.data=transformData.call(m,m.transformRequest),["post","put","patch"].indexOf(m.method)!==-1&&m.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(m.adapter||defaults.adapter)(m).then(function(C){return throwIfCancellationRequested(m),C.data=transformData.call(m,m.transformResponse,C),C.headers=AxiosHeaders.from(C.headers),C},function(C){return isCancel(C)||(throwIfCancellationRequested(m),C&&C.response&&(C.response.data=transformData.call(m,m.transformResponse,C.response),C.response.headers=AxiosHeaders.from(C.response.headers))),Promise.reject(C)})}const VERSION="1.7.4",validators$1={};["object","boolean","number","function","string","symbol"].forEach((m,b)=>{validators$1[m]=function(C){return typeof C===m||"a"+(b<1?"n ":" ")+m}});const deprecatedWarnings={};validators$1.transitional=function(b,P,C){function B(X,T){return"[Axios v"+VERSION+"] Transitional option '"+X+"'"+T+(C?". "+C:"")}return(X,T,c)=>{if(b===!1)throw new AxiosError(B(T," has been removed"+(P?" in "+P:"")),AxiosError.ERR_DEPRECATED);return P&&!deprecatedWarnings[T]&&(deprecatedWarnings[T]=!0,console.warn(B(T," has been deprecated since v"+P+" and will be removed in the near future"))),b?b(X,T,c):!0}};function assertOptions(m,b,P){if(typeof m!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const C=Object.keys(m);let B=C.length;for(;B-- >0;){const X=C[B],T=b[X];if(T){const c=m[X],fe=c===void 0||T(c,X,m);if(fe!==!0)throw new AxiosError("option "+X+" must be "+fe,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(P!==!0)throw new AxiosError("Unknown option "+X,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(b){this.defaults=b,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(b,P){try{return await this._request(b,P)}catch(C){if(C instanceof Error){let B;Error.captureStackTrace?Error.captureStackTrace(B={}):B=new Error;const X=B.stack?B.stack.replace(/^.+\n/,""):"";try{C.stack?X&&!String(C.stack).endsWith(X.replace(/^.+\n.+\n/,""))&&(C.stack+=`
585
- `+X):C.stack=X}catch{}}throw C}}_request(b,P){typeof b=="string"?(P=P||{},P.url=b):P=b||{},P=mergeConfig(this.defaults,P);const{transitional:C,paramsSerializer:B,headers:X}=P;C!==void 0&&validator.assertOptions(C,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),B!=null&&(utils$1.isFunction(B)?P.paramsSerializer={serialize:B}:validator.assertOptions(B,{encode:validators.function,serialize:validators.function},!0)),P.method=(P.method||this.defaults.method||"get").toLowerCase();let T=X&&utils$1.merge(X.common,X[P.method]);X&&utils$1.forEach(["delete","get","head","post","put","patch","common"],Ve=>{delete X[Ve]}),P.headers=AxiosHeaders.concat(T,X);const c=[];let fe=!0;this.interceptors.request.forEach(function(Xe){typeof Xe.runWhen=="function"&&Xe.runWhen(P)===!1||(fe=fe&&Xe.synchronous,c.unshift(Xe.fulfilled,Xe.rejected))});const _e=[];this.interceptors.response.forEach(function(Xe){_e.push(Xe.fulfilled,Xe.rejected)});let ye,ae=0,oe;if(!fe){const Ve=[dispatchRequest.bind(this),void 0];for(Ve.unshift.apply(Ve,c),Ve.push.apply(Ve,_e),oe=Ve.length,ye=Promise.resolve(P);ae<oe;)ye=ye.then(Ve[ae++],Ve[ae++]);return ye}oe=c.length;let at=P;for(ae=0;ae<oe;){const Ve=c[ae++],Xe=c[ae++];try{at=Ve(at)}catch(Fe){Xe.call(this,Fe);break}}try{ye=dispatchRequest.call(this,at)}catch(Ve){return Promise.reject(Ve)}for(ae=0,oe=_e.length;ae<oe;)ye=ye.then(_e[ae++],_e[ae++]);return ye}getUri(b){b=mergeConfig(this.defaults,b);const P=buildFullPath(b.baseURL,b.url);return buildURL(P,b.params,b.paramsSerializer)}}utils$1.forEach(["delete","get","head","options"],function(b){Axios.prototype[b]=function(P,C){return this.request(mergeConfig(C||{},{method:b,url:P,data:(C||{}).data}))}}),utils$1.forEach(["post","put","patch"],function(b){function P(C){return function(X,T,c){return this.request(mergeConfig(c||{},{method:b,headers:C?{"Content-Type":"multipart/form-data"}:{},url:X,data:T}))}}Axios.prototype[b]=P(),Axios.prototype[b+"Form"]=P(!0)});class CancelToken{constructor(b){if(typeof b!="function")throw new TypeError("executor must be a function.");let P;this.promise=new Promise(function(X){P=X});const C=this;this.promise.then(B=>{if(!C._listeners)return;let X=C._listeners.length;for(;X-- >0;)C._listeners[X](B);C._listeners=null}),this.promise.then=B=>{let X;const T=new Promise(c=>{C.subscribe(c),X=c}).then(B);return T.cancel=function(){C.unsubscribe(X)},T},b(function(X,T,c){C.reason||(C.reason=new CanceledError(X,T,c),P(C.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(b){if(this.reason){b(this.reason);return}this._listeners?this._listeners.push(b):this._listeners=[b]}unsubscribe(b){if(!this._listeners)return;const P=this._listeners.indexOf(b);P!==-1&&this._listeners.splice(P,1)}static source(){let b;return{token:new CancelToken(function(B){b=B}),cancel:b}}}function spread(m){return function(P){return m.apply(null,P)}}function isAxiosError(m){return utils$1.isObject(m)&&m.isAxiosError===!0}const HttpStatusCode={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(HttpStatusCode).forEach(([m,b])=>{HttpStatusCode[b]=m});function createInstance(m){const b=new Axios(m),P=bind(Axios.prototype.request,b);return utils$1.extend(P,Axios.prototype,b,{allOwnKeys:!0}),utils$1.extend(P,b,null,{allOwnKeys:!0}),P.create=function(B){return createInstance(mergeConfig(m,B))},P}const axios=createInstance(defaults);axios.Axios=Axios,axios.CanceledError=CanceledError,axios.CancelToken=CancelToken,axios.isCancel=isCancel,axios.VERSION=VERSION,axios.toFormData=toFormData,axios.AxiosError=AxiosError,axios.Cancel=axios.CanceledError,axios.all=function(b){return Promise.all(b)},axios.spread=spread,axios.isAxiosError=isAxiosError,axios.mergeConfig=mergeConfig,axios.AxiosHeaders=AxiosHeaders,axios.formToJSON=m=>formDataToJSON(utils$1.isHTMLForm(m)?new FormData(m):m),axios.getAdapter=adapters.getAdapter,axios.HttpStatusCode=HttpStatusCode,axios.default=axios;const debounce=(m,b=300)=>{let P;return function(...B){clearTimeout(P),P=setTimeout(()=>{m.apply(this,B)},b)}},_sfc_main$a={mixins:[layerMixin],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:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>, &copy; <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(m){m&&m.on("load",this.handleMapLoad)}},methods:{handleMapLoad(){var m;this.baseLayers.forEach(b=>{this.layerList.push(b)}),this.toggleLayerVisibility((m=this.baseLayers[0])==null?void 0:m.id)},toggleLayerVisibility(m){this.$emit("update:selectedLayer",m),this.changeBaseLayer(m)}}},_hoisted_1$9={class:"vs-map-slot-layers z-10 select-none"},_hoisted_2$9=["onClick"],_hoisted_3$7=["src"];function _sfc_render$9(m,b,P,C,B,X){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(P.baseLayers,(T,c)=>(vue.openBlock(),vue.createElementBlock("div",{key:T.id,class:vue.normalizeClass(["vs-map-slot-layers__layer relative",{focused:T.id==P.selectedLayer}]),onClick:fe=>X.toggleLayerVisibility(T.id)},[vue.createElementVNode("img",{src:T.image,class:"vs-map-slot-layers__image"},null,8,_hoisted_3$7),vue.createElementVNode("div",{class:vue.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%]"]])},vue.toDisplayString(T==null?void 0:T.name),3)],10,_hoisted_2$9))),128))])}const MapSlotLayers=_export_sfc(_sfc_main$a,[["render",_sfc_render$9],["__scopeId","data-v-8959e540"]]),_sfc_main$9={props:["colors","strokes","title"],methods:{capitalizeFirstLetter(m){return m?m.charAt(0).toUpperCase()+m.slice(1):""}}},_hoisted_1$8={class:"absolute left-[20px] bottom-[74px] bg-white max-w-[250px] p-[10px] rounded-lg z-10 border"},_hoisted_2$8={key:0,class:"mb-[10px] text-[1rem]"},_hoisted_3$6={key:1},_hoisted_4$6={class:"legend-item flex items-center gap-2 mb-[10px]"},_hoisted_5$5={class:"ml-1 text-[0.875rem]"},_hoisted_6$5={class:"legend-item"},_hoisted_7$1={key:0,class:"flex justify-start items-center gap-2"},_hoisted_8$1={class:"ml-1 text-[0.875rem]"};function _sfc_render$8(m,b,P,C,B,X){var T;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$8,[P.title?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$8,vue.toDisplayString(P.title),1)):vue.createCommentVNode("",!0),(T=P.strokes)!=null&&T.length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$6,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(P.strokes,c=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$6,[vue.createElementVNode("div",{class:"w-[15px] h-[4px]",style:vue.normalizeStyle({background:`repeating-linear-gradient(to right, ${c.color}, ${c.color} 5px, transparent 5px, transparent 8px)`})},null,4),vue.createElementVNode("div",_hoisted_5$5,vue.toDisplayString(X.capitalizeFirstLetter(c.text)),1)]))),256))])):vue.createCommentVNode("",!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(P.colors,c=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$5,[c.id>0?(vue.openBlock(),vue.createElementBlock("div",_hoisted_7$1,[vue.createElementVNode("div",{class:"w-[15px] h-[15px] rounded-[50%] min-w-[15px]",style:vue.normalizeStyle({backgroundColor:c.color})},null,4),vue.createElementVNode("div",_hoisted_8$1,vue.toDisplayString(X.capitalizeFirstLetter(c.text)),1)])):vue.createCommentVNode("",!0)]))),256))])}const MapLegend=_export_sfc(_sfc_main$9,[["render",_sfc_render$8]]);function feature(m,b,P={}){const C={type:"Feature"};return(P.id===0||P.id)&&(C.id=P.id),P.bbox&&(C.bbox=P.bbox),C.properties=b||{},C.geometry=m,C}function point(m,b,P={}){if(!m)throw new Error("coordinates is required");if(!Array.isArray(m))throw new Error("coordinates must be an Array");if(m.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!isNumber(m[0])||!isNumber(m[1]))throw new Error("coordinates must contain numbers");return feature({type:"Point",coordinates:m},b,P)}function polygon(m,b,P={}){for(const B of m){if(B.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(B[B.length-1].length!==B[0].length)throw new Error("First and last Position are not equivalent.");for(let X=0;X<B[B.length-1].length;X++)if(B[B.length-1][X]!==B[0][X])throw new Error("First and last Position are not equivalent.")}return feature({type:"Polygon",coordinates:m},b,P)}function multiPoint(m,b,P={}){return feature({type:"MultiPoint",coordinates:m},b,P)}function multiPolygon(m,b,P={}){return feature({type:"MultiPolygon",coordinates:m},b,P)}function isNumber(m){return!isNaN(m)&&m!==null&&!Array.isArray(m)}function coordEach(m,b,P){if(m!==null)for(var C,B,X,T,c,fe,_e,ye=0,ae=0,oe,at=m.type,Ve=at==="FeatureCollection",Xe=at==="Feature",Fe=Ve?m.features.length:1,ut=0;ut<Fe;ut++){_e=Ve?m.features[ut].geometry:Xe?m.geometry:m,oe=_e?_e.type==="GeometryCollection":!1,c=oe?_e.geometries.length:1;for(var kt=0;kt<c;kt++){var Ze=0,Ct=0;if(T=oe?_e.geometries[kt]:_e,T!==null){fe=T.coordinates;var xt=T.type;switch(ye=0,xt){case null:break;case"Point":if(b(fe,ae,ut,Ze,Ct)===!1)return!1;ae++,Ze++;break;case"LineString":case"MultiPoint":for(C=0;C<fe.length;C++){if(b(fe[C],ae,ut,Ze,Ct)===!1)return!1;ae++,xt==="MultiPoint"&&Ze++}xt==="LineString"&&Ze++;break;case"Polygon":case"MultiLineString":for(C=0;C<fe.length;C++){for(B=0;B<fe[C].length-ye;B++){if(b(fe[C][B],ae,ut,Ze,Ct)===!1)return!1;ae++}xt==="MultiLineString"&&Ze++,xt==="Polygon"&&Ct++}xt==="Polygon"&&Ze++;break;case"MultiPolygon":for(C=0;C<fe.length;C++){for(Ct=0,B=0;B<fe[C].length;B++){for(X=0;X<fe[C][B].length-ye;X++){if(b(fe[C][B][X],ae,ut,Ze,Ct)===!1)return!1;ae++}Ct++}Ze++}break;case"GeometryCollection":for(C=0;C<T.geometries.length;C++)if(coordEach(T.geometries[C],b)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function bbox(m,b={}){if(m.bbox!=null&&b.recompute!==!0)return m.bbox;const P=[1/0,1/0,-1/0,-1/0];return coordEach(m,C=>{P[0]>C[0]&&(P[0]=C[0]),P[1]>C[1]&&(P[1]=C[1]),P[2]<C[0]&&(P[2]=C[0]),P[3]<C[1]&&(P[3]=C[1])}),P}function center(m,b={}){const P=bbox(m),C=(P[0]+P[2])/2,B=(P[1]+P[3])/2;return point([C,B],b.properties,b)}const _sfc_main$8={components:{MapSlotLayers,MapLegend},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,filtersParam:{type:String,default:""},row:{type:Object,default:{}},pointZoom:{type:String,default:"12"},legend:{type:Boolean,default:()=>!0}},mixins:[layerMixin],inject:["prefix"],data(){return{map:null,hoverObject:null,hoverData:null,popup:null,colors:[],strokes:null}},async mounted(){var m,b,P,C;try{if(await this.createMap(),(m=this.row)!=null&&m.geom){const{type:B,coordinates:X}=this.row.geom;let T;switch(B){case"Polygon":T=polygon(X);break;case"MultiPolygon":T=multiPolygon(X);break;case"MultiPoint":T=multiPoint(X);break;default:(b=this.map)==null||b.fitBounds([X,X],{maxZoom:this.zoom,padding:30,duration:0}),this.isSelectObj=!0;return}const c=center(T).geometry.coordinates;(P=this.map)==null||P.fitBounds([c,c],{maxZoom:this.zoom,padding:30,duration:0})}(C=this.map)==null||C.fitBounds(this.center,{duration:0})}catch{}},watch:{filtersParam(m){this.setFilter(this.table,m)},selectedBaseLayer(m){this.$emit("update:selectedBaseLayer",m)},row:{handler(m){m!=null&&m.geom&&this.fitToBounds(m.geom),this.map&&this.map.getStyle()&&this.map.getStyle().layers.filter(C=>C.source===this.table&&C.type==="line").forEach(C=>{var B;this.map.setPaintProperty(C.id,"line-width",((B=this.row)==null?void 0:B.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(m=>m==null?void 0:m.id)}},methods:{async getColorStyle(){var m=[["#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:b}}=await axios.get(`${this.prefix}/data/${this.table}/${this.colorAttr}`),P=b.reduce((C,B,X)=>B!=null&&B.id?[...C,B.id.toString(),B.color||m[0][X%5]]:C,["match",["get",this.colorAttr]]);return this.colors=[...b],P.push("gray"),P}catch(b){console.log(b)}},async getStrokeStyle(){if(!this.strokeAttr)return"transparent";try{const{data:{rows:m}}=await axios.get(`${this.prefix}/data/${this.table}/${this.strokeAttr}`),b=m.reduce((P,C,B)=>C!=null&&C.id?[...P,{id:C.id.toString(),color:C.color||"#000000",dash:C.dash||[2,2],text:C.text||C.id.toString()}]:P,[]);return this.strokes=[...b],["match",["get",this.strokeAttr],...b.flatMap(({id:P,color:C})=>[P,C]),"transparent"]}catch(m){return console.log(m),"transparent"}},async handleMapLoad(){var C,B,X,T,c;(C=this.row)!=null&&C.geom&&this.fitToBounds(this.row.geom),this.$emit("map",this.map),this.map.on("mousemove",this.handleMapHover);const m=await this.getStrokeStyle(),b=await this.getColorStyle(),P=((X=(B=location.search.split("&").find(fe=>fe.includes("filter=")))==null?void 0:B.split("filter="))==null?void 0:X[1])||"";await this.addLayer({id:this.table,service:"vector",url:`${this.prefix}/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":b,"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":b}},{type:"line",paint:{"line-color":b,"line-width":((T=this.row)==null?void 0:T.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":m,"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]}}]:[]]}),P&&this.setFilter(this.table,P)},async createMap(){const m={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new maplibregl.Map({container:"maplibre-map",style:m,zoom:this.zoom,center:this.center,minZoom:this.minZoom}),this.$parent.map=this.map,this.map.addControl(new maplibregl.NavigationControl({visualizePitch:!0})),this.map.on("load",this.handleMapLoad)},fitToBounds(m){if(!this.map)return;const{type:b,coordinates:P}=m;let C,B;switch(b){case"Polygon":C=polygon(P),B=bbox(C),this.map.fitBounds(B,{padding:30,maxZoom:15,duration:0});break;case"MultiPolygon":C=multiPolygon(P),B=bbox(C),this.map.fitBounds(B,{padding:30,maxZoom:15,duration:0});break;case"MultiPoint":C=multiPoint(P),B=bbox(C),this.map.fitBounds(B,{padding:30,maxZoom:15,duration:0});break;case"Point":this.map.flyTo({center:P,zoom:15,duration:0,essential:!0});break;default:console.warn("Невідомий тип геометрії:",b)}},async handleMapHover(m){var T,c,fe;this.hoverObject&&(this.map.setFeatureState(this.hoverObject,{hover:!1}),this.hoverObject=null),this.popup||(this.popup=new maplibregl.Popup({maxWidth:"400px",closeButton:!1,closeOnClick:!1}));const b=this.map.queryRenderedFeatures(m.point);if(this.map.getCanvas().style.cursor="pointer",!(b!=null&&b.length)||((T=b==null?void 0:b[0])==null?void 0:T.source)==="region-search-id"){this.map.getCanvas().style.cursor="",this.popup.remove();return}const P=["route-line"];if(!b.filter(_e=>!P.some(ye=>{var ae;return(ae=_e.layer)==null?void 0:ae.source.includes(ye)})).length)return;const B=b[0].geometry.coordinates.slice();b[0].source==="highlighted-polygon"&&b[1]?this.hoverData=(c=b[1])==null?void 0:c.properties:this.hoverData=(fe=b[0])==null?void 0:fe.properties;const X={source:b[0].source,sourceLayer:b[0].sourceLayer,id:b[0].id};if(X.source!=="region-search-id"){for(this.map.setFeatureState(X,{hover:!0}),this.hoverObject=X;Math.abs(m.lngLat.lng-B[0])>180;)B[0]+=m.lngLat.lng>B[0]?360:-360;this.popup.setLngLat(m.lngLat).setHTML(this.$refs.popup.innerHTML).addTo(this.map)}}}},_hoisted_1$7={class:"vs-map-portal relative z-1 mt-2",id:"mapwrapper"},_hoisted_2$7={ref:"popup",style:{display:"none"}};function _sfc_render$7(m,b,P,C,B,X){const T=vue.resolveComponent("MapLegend"),c=vue.resolveComponent("MapSlotLayers");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7,[vue.createElementVNode("div",{id:"maplibre-map",ref:"maplibreMap",class:"w-full compare_main_map",style:vue.normalizeStyle({height:P.height})},null,4),vue.withDirectives(vue.createVNode(T,{colors:B.colors,strokes:B.strokes,title:P.legendname},null,8,["colors","strokes","title"]),[[vue.vShow,P.legend]]),vue.createVNode(c,{map:B.map,baseLayers:P.basemap,selectedLayer:P.selectedBaseLayer,"onUpdate:selectedLayer":b[0]||(b[0]=fe=>m.$emit("update:selectedBaseLayer",fe))},null,8,["map","baseLayers","selectedLayer"]),vue.createElementVNode("div",_hoisted_2$7,[vue.renderSlot(m.$slots,"default",{hoverData:B.hoverData})],512)])}const MapPortal=_export_sfc(_sfc_main$8,[["render",_sfc_render$7]]),_sfc_main$7={},_hoisted_1$6={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"},_hoisted_2$6=vue.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),_hoisted_11$1=[_hoisted_2$6];function _sfc_render$6(m,b){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$6,_hoisted_11$1)}const FilterIcon=_export_sfc(_sfc_main$7,[["render",_sfc_render$6]]),_sfc_main$6={},_hoisted_1$5={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"},_hoisted_2$5=vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_hoisted_3$5=vue.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),_hoisted_4$5=vue.createElementVNode("path",{d:"M15 4v16"},null,-1),_hoisted_5$4=vue.createElementVNode("path",{d:"M9 10l2 2l-2 2"},null,-1),_hoisted_6$4=[_hoisted_2$5,_hoisted_3$5,_hoisted_4$5,_hoisted_5$4];function _sfc_render$5(m,b){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$5,_hoisted_6$4)}const VisibleMapIcon=_export_sfc(_sfc_main$6,[["render",_sfc_render$5]]),_sfc_main$5={},_hoisted_1$4={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"},_hoisted_2$4=vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_hoisted_3$4=vue.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),_hoisted_4$4=vue.createElementVNode("path",{d:"M15 4v16"},null,-1),_hoisted_5$3=vue.createElementVNode("path",{d:"M10 10l-2 2l2 2"},null,-1),_hoisted_6$3=[_hoisted_2$4,_hoisted_3$4,_hoisted_4$4,_hoisted_5$3];function _sfc_render$4(m,b){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$4,_hoisted_6$3)}const HiddenMapIcon=_export_sfc(_sfc_main$5,[["render",_sfc_render$4]]),_sfc_main$4={},_hoisted_1$3={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"},_hoisted_2$3=vue.createElementVNode("path",{d:"M18 6 6 18"},null,-1),_hoisted_3$3=vue.createElementVNode("path",{d:"m6 6 12 12"},null,-1),_hoisted_4$3=[_hoisted_2$3,_hoisted_3$3];function _sfc_render$3(m,b){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$3,_hoisted_4$3)}const CloseIcon=_export_sfc(_sfc_main$4,[["render",_sfc_render$3]]),_sfc_main$3={__name:"vs-partsmap-search",props:{modelValue:null,maskForSearch:null,searchShow:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(m,{emit:b}){const P=b;return(C,B)=>{const X=vue.resolveComponent("VsTextMask"),T=vue.resolveComponent("vs-text");return m.maskForSearch?(vue.openBlock(),vue.createBlock(X,{key:0,"model-value":m.modelValue,"onUpdate:modelValue":B[0]||(B[0]=c=>P("update:modelValue",c)),class:"w-full table-interface-search",placeholder:"Пошук",mask:m.maskForSearch,icon:"search",iconPosition:"left",clearable:"",style:{height:"38px","min-width":"300px","max-width":"300px"}},null,8,["model-value","mask"])):m.searchShow?(vue.openBlock(),vue.createBlock(T,{key:1,"model-value":m.modelValue,"onUpdate:modelValue":B[1]||(B[1]=c=>P("update:modelValue",c)),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"}},null,8,["model-value"])):vue.createCommentVNode("",!0)}}},_sfc_main$2={},_hoisted_1$2={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-map"},_hoisted_2$2=vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_hoisted_3$2=vue.createElementVNode("path",{d:"M3 7l6 -3l6 3l6 -3v13l-6 3l-6 -3l-6 3v-13"},null,-1),_hoisted_4$2=vue.createElementVNode("path",{d:"M9 4v13"},null,-1),_hoisted_5$2=vue.createElementVNode("path",{d:"M15 7v13"},null,-1),_hoisted_6$2=[_hoisted_2$2,_hoisted_3$2,_hoisted_4$2,_hoisted_5$2];function _sfc_render$2(m,b){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$2,_hoisted_6$2)}const IconMap=_export_sfc(_sfc_main$2,[["render",_sfc_render$2]]),_sfc_main$1={},_hoisted_1$1={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-table"},_hoisted_2$1=vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_hoisted_3$1=vue.createElementVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"},null,-1),_hoisted_4$1=vue.createElementVNode("path",{d:"M3 10h18"},null,-1),_hoisted_5$1=vue.createElementVNode("path",{d:"M10 3v18"},null,-1),_hoisted_6$1=[_hoisted_2$1,_hoisted_3$1,_hoisted_4$1,_hoisted_5$1];function _sfc_render$1(m,b){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$1,_hoisted_6$1)}const IconTable=_export_sfc(_sfc_main$1,[["render",_sfc_render$1]]),_sfc_main=vue.defineComponent({props:{prefix:{type:String,default:"/api"},applyVueRouter:{type:Boolean,default:!0},dashedLine:{type:Boolean,default:!1},title:{type:String,default:()=>""},table:{type:String,default:()=>""},rows:{type:Object,default:()=>null},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:()=>""},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},pointZoom:{type:String,default:()=>"12"},legend:{type:Boolean,default:()=>!0},defaultColor:{type:String,default:()=>"blue"},polygonOpacity:{type:Number,default:()=>null},history:{type:Boolean,default:!0}},mixins:[layerMixin],components:{MapPortal,NoData,FilterIcon,VisibleMapIcon,HiddenMapIcon,CloseIcon,VsPartsmapSearch:_sfc_main$3,IconTable,IconMap},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,isFilterVisible:!1,tableData:null,map:null,legendName:null,total:null,filtered:null,activeFiltersCount:"",regionSelectValue:null,addressSelectValue:null,currentBbox:null,mountedFilter:{},isCompareOpen:!1,windowWidth:0,handleDebouncedUpdateValue:debounce(m=>{this.handleSearchValue(m)},300)}},provide(){return{prefix:this.prefix}},watch:{map(){this.map.on("click",this.handleMapClick),this.$emit("update:map",this.map)},activeFiltersCount(){var m,b;return(b=(m=this.$refs)==null?void 0:m.filter)==null?void 0:b.filteredActiveFiltersLength},activeFilters(){var m,b;return(b=(m=this.$refs)==null?void 0:m.filter)==null?void 0:b.activeFilters}},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.windowWidth=window.innerWidth,this.rows||this.getData();const b=new URLSearchParams(window.location.search).get("filter"),P=b==null?void 0:b.split("|");P==null||P.forEach(B=>{const[X,T]=B.split("=");T!=null&&T.includes(",")?this.mountedFilter[X]=T==null?void 0:T.split(","):this.mountedFilter[X]=T,this.activeFilters=this.mountedFilter});const C=new URLSearchParams(window.location.search);this.currentPage=C.get("page")||1,this.getFilter(),addEventListener("resize",this.changeWidth)},updated(){this.checkFilterLength()},methods:{async getData(){try{const m={search:this.search||null,limit:this.limit,page:this.currentPage,polyline:this.polyline};m.filter=this.filtersParam;const{data:b}=await axios.get(`${this.prefix}/data/${this.table}`,{params:m});this.tableData=b==null?void 0:b.rows,this.total=b.filtered,this.filtered=b.filtered}catch(m){console.error(m.message)}},moveToDefaultPage(){var b;new URLSearchParams(window.location.search).delete("id"),(b=this.map)==null||b.fitBounds(this.maxBounds,{duration:0}),this.history&&window.history.pushState({},"",newUrl),this.isSelectObj=!1},regionFullName(m){return m.region?`${m.text} / ${m.region}`:m.text},getLabelById(m){var P;const b=(P=this.filters)==null?void 0:P.find(C=>C.id===m);return b?b.label:m},getOptionsLabelById(id,option){var m;const filter=(m=this.filters)==null?void 0:m.find(b=>b.id===id);if(filter!=null&&filter.formatter){const func=eval(filter==null?void 0:filter.formatter);return func(option)}return Array.isArray(option)?filter!=null&&filter.options?filter==null?void 0:filter.options.filter(b=>option.includes(b.id)).map(b=>b.text).join(", "):option==null?void 0:option.length:option},async clearFilter(m){var b,P,C;await((P=(b=this.$refs)==null?void 0:b.filter)==null?void 0:P.clearFilter(m)),this.filterUrl=(C=this.$refs)==null?void 0:C.filter.filterUrl,(m==="region_katottg"||m==="katottg")&&this.$emit("update:filterState",{}),await this.updateTableAndMap(),await this.getData()},handlePageChange(m){this.currentPage=m;const b=new URL(window.location.href),P=new URLSearchParams(window.location.search);P.set("page",m),b.search=decodeURI(P.toString()),window.history.pushState({},"",b),this.getData()},async getFilter(){var m;try{const{data:b}=await axios.get(`${this.prefix}/filter/${this.table}`);this.filters=(m=b==null?void 0:b.list)==null?void 0:m.map(P=>({...P,label:(P==null?void 0:P.label)||(P==null?void 0:P.ua),id:(P==null?void 0:P.id)||(P==null?void 0:P.name)}))}catch(b){console.error(b.message)}},async handleSearchValue(m){this.search=m,await this.getData()},closeObjCard(){var C;const m=new URLSearchParams(window.location.search);m.delete("id"),this.deletePulsePoint();const P=`${window.location.pathname}?${m.toString()}`;(this.currentBbox||this.center)&&((C=this.map)==null||C.fitBounds(this.currentBbox||[this.center,this.center],{maxZoom:this.zoom,duration:0})),window.history.pushState({},"",P),this.isSelectObj=!1,this.selectedRow=null,this.getData()},handleFilterChange(m){this.$emit("update:filterState",m),this.currentPage=m.state.page||1,this.filterUrl=m.url==="no-url"?null:m.url.split("|").filter(b=>!b.includes("page=")).join("|")},async updateTableAndMap(){var m,b;this.selectedRow||(this.filtersParam=this.filterUrl,this.activeFilters=(b=(m=this.$refs)==null?void 0:m.filter)==null?void 0:b.activeFilters,this.isFilterVisible=!1,this.getData())},toggleMapVisible(){this.isMapVisible=!this.isMapVisible},checkUrl(m=!0){const b=new URLSearchParams(window.location.search);b.has("id")?(this.isSelectObj=!0,this.isMapVisible=m,this.selectedId=b.get("id")):(this.isSelectObj=!1,this.selectedId="")},changeLimit(m){this.limit=m,this.currentPage=1,this.getData()},resetFilters(){this.$refs.filter&&(this.$refs.filter.clearAll(),this.search="",this.filtersParam="",this.polyline=null,this.regionSelectValue=null,this.addressSelectValue=null,this.currentBbox=null,this.activeFilters=null,this.tabsIsVisible=!1)},checkFilterLength(){var b,P;const m=(P=(b=this.$refs)==null?void 0:b.filter)==null?void 0:P.filteredActiveFiltersLength;m!==this.previousLength&&(this.previousLength=m,this.activeFiltersCount=m)},async handleMapClick(m){var X,T,c,fe,_e,ye,ae,oe,at,Ve;const b=this.map.queryRenderedFeatures(m.point);if((b==null?void 0:b.length)<1||((X=b[0])==null?void 0:X.source)==="region-search-id"||((T=b[0])==null?void 0:T.source)==="route-line")return;const P=window.location.pathname,C=new URLSearchParams(window.location.search);C.set("id",`${(c=b[0])==null?void 0:c.properties.id}`),this.getObjectData((_e=(fe=b[0])==null?void 0:fe.properties)==null?void 0:_e.id);const B=`${P}?${C.toString()}`;this.history&&window.history.pushState({},"",B),this.isSelectObj=!0,m.lngLat&&((Ve=this.map)==null||Ve.fitBounds([[(ye=m.lngLat)==null?void 0:ye.lng,(ae=m.lngLat)==null?void 0:ae.lat],[(oe=m.lngLat)==null?void 0:oe.lng,(at=m.lngLat)==null?void 0:at.lat]],{padding:30,duration:0})),this.checkUrl()},async getObjectData(m){var b,P;try{const{data:C}=await axios.get(`${this.prefix}/data/${this.table}/${m}`);this.selectRow((b=C==null?void 0:C.rows)==null?void 0:b[0]),((P=C==null?void 0:C.rows)==null?void 0:P.lenght)<1&&this.deletePulsePoint()}catch(C){console.error(C.message)}},async selectRow(m,b=!0){var c;this.isMapVisible=b;const C=await(await fetch(`${this.prefix}/data/${this.table}/${m.id}`)).json();this.selectedRow=((c=C==null?void 0:C.rows)==null?void 0:c[0])||m;const B=window.location.pathname,X=new URLSearchParams(window.location.search);X.set("id",`${m.id}`);const T=`${B}?${X.toString()}`;this.history&&window.history.pushState({},"",T),this.checkUrl(b),this.isSelectObj=!0},deletePulsePoint(){this.marker&&this.marker.remove()},addPulsePoint(m){this.deletePulsePoint();const b=document.createElement("div");b.className="gps-marker",b.style.width="10px",b.style.height="10px",b.style.position="relative";const P=document.createElement("div");P.className="gps-wave",b.appendChild(P),this.marker=new maplibregl.Marker({element:b,anchor:"center"}).setLngLat(m).addTo(this.map)}}}),_hoisted_1={class:"pt-[20px]"},_hoisted_2={key:0,class:"w-full gap-5 flex justify-between mb-[6px] pr-3"},_hoisted_3={class:"flex items-center gap-2 max-h-[38px] pt-[4px]"},_hoisted_4={class:"custom-filter-list"},_hoisted_5={key:0,class:"font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"},_hoisted_6={class:"flex items-center"},_hoisted_7=["title"],_hoisted_8=vue.createElementVNode("span",{class:"sr-only"},"Відкрити мапу",-1),_hoisted_9={class:"max-[1000px]:flex gap-2 min-[1001px]:hidden"},_hoisted_10={class:"flex"},_hoisted_11={key:0,class:"py-[15px] pb-[24px] pl-2"},_hoisted_12={class:"font-bold text-2xl mr-[10px]"},_hoisted_13={class:"text-sm text-stone-500 font-medium"},_hoisted_14=vue.createElementVNode("span",{class:"text-sm text-stone-500 font-medium"}," об'єктів",-1),_hoisted_15={class:"wrapperTable flex flex-col",style:{height:"calc(100vh - 302px)"}},_hoisted_16={key:0,class:"flex gap-x-2 flex-wrap"},_hoisted_17={class:"font-medium"},_hoisted_18=vue.createElementVNode("span",{class:"h-3 mx-2 border-s border-gray-200"},null,-1),_hoisted_19={class:"text-gray-500"},_hoisted_20=["onClick"],_hoisted_21={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"},_hoisted_22=vue.createElementVNode("span",{class:"font-medium"}," Очистити ",-1),_hoisted_23={key:2,class:"text-center py-28"},_hoisted_24=vue.createElementVNode("h2",{class:"font-medium text-base text-gray-500 rounded-xl"}," За вашим запитом даних не знайдено! ",-1),_hoisted_25=vue.createElementVNode("p",{class:"font-normal text-sm text-gray-500 rounded-xl"}," Введіть, будь ласка, інші значення для пошуку. ",-1),_hoisted_26={key:1},_hoisted_27={key:2,class:"my-5 pr-2"},_hoisted_28={class:"flex justify-between"},_hoisted_29={class:"w-full lg:w-1/2 relative"},_hoisted_30={class:"map-section relative"};function _sfc_render(m,b,P,C,B,X){var ut,kt,Ze,Ct,xt;const T=vue.resolveComponent("VsPartsmapSearch"),c=vue.resolveComponent("FilterIcon"),fe=vue.resolveComponent("VsFilterList"),_e=vue.resolveComponent("VisibleMapIcon"),ye=vue.resolveComponent("HiddenMapIcon"),ae=vue.resolveComponent("IconTable"),oe=vue.resolveComponent("IconMap"),at=vue.resolveComponent("CloseIcon"),Ve=vue.resolveComponent("NoData"),Xe=vue.resolveComponent("VsPagination"),Fe=vue.resolveComponent("MapPortal");return vue.openBlock(),vue.createElementBlock("section",_hoisted_1,[vue.renderSlot(m.$slots,"header",{title:m.title,total:m.total,selectedRow:m.selectedRow}),vue.createElementVNode("div",null,[vue.renderSlot(m.$slots,"filters",{selectedRow:m.selectedRow}),(ut=m.$slots)!=null&&ut.filters?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_2,[vue.createElementVNode("div",_hoisted_3,[vue.createVNode(T,{"model-value":m.search,"onUpdate:modelValue":m.handleDebouncedUpdateValue,maskForSearch:m.maskForSearch,searchShow:m.searchShow},null,8,["model-value","onUpdate:modelValue","maskForSearch","searchShow"]),vue.createElementVNode("div",_hoisted_4,[m.filters?(vue.openBlock(),vue.createBlock(fe,{key:0,ref:"filter",modelValue:m.mountedFilter,"onUpdate:modelValue":b[0]||(b[0]=et=>m.mountedFilter=et),scheme:parseInt(m.windowWidth)>=1e3?m.filters:(kt=m.filters)==null?void 0:kt.map(et=>({...et,inline:!1})),isDialog:(Ze=m.filters)==null?void 0:Ze.some(et=>!(et!=null&&et.inline)),"apply-vue-router":m.applyVueRouter,history:"",view:"plain",clearable:!1,name:"filter",onFilterChange:b[1]||(b[1]=async et=>{await m.handleFilterChange(et),await m.updateTableAndMap()})},{button:vue.withCtx(({visible:et})=>[vue.createElementVNode("button",{type:"button",class:vue.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",[et?"border border-blue-600 border-2":"border border-gray-200"]])},[vue.createVNode(c),vue.createTextVNode(" Фільтри "),m.activeFiltersCount>=1?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5,vue.toDisplayString(m.activeFiltersCount),1)):vue.createCommentVNode("",!0)],2)]),_:1},8,["modelValue","scheme","isDialog","apply-vue-router"])):vue.createCommentVNode("",!0)])]),vue.createElementVNode("div",_hoisted_6,[vue.renderSlot(m.$slots,"buttons"),vue.createElementVNode("button",{type:"button",class:"py-2 px-2 hidden min-[1001px]: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:m.isMapVisible?"Приховати карту":"Показати карту",onClick:b[2]||(b[2]=(...et)=>m.toggleMapVisible&&m.toggleMapVisible(...et))},[m.isMapVisible?(vue.openBlock(),vue.createBlock(_e,{key:0})):(vue.openBlock(),vue.createBlock(ye,{key:1})),_hoisted_8],8,_hoisted_7),vue.createElementVNode("div",_hoisted_9,[vue.createElementVNode("button",{onClick:b[3]||(b[3]=et=>m.isMapVisible=!1),class:"py-2 px-2 h-[38px] 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"},[vue.createVNode(ae)]),vue.createElementVNode("button",{onClick:b[4]||(b[4]=et=>m.isMapVisible=!0),class:"py-2 px-2 h-[38px] 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"},[vue.createVNode(oe)])])])])),vue.createElementVNode("div",_hoisted_10,[vue.withDirectives(vue.createElementVNode("div",{class:vue.normalizeClass(["relative overflow-hidden",m.isMapVisible?"w-2/4 mr-0":"w-full mr-3",m.isSelectObj?"hidden":""])},[(Ct=m.$slots)!=null&&Ct.header?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("h1",_hoisted_11,[vue.createElementVNode("span",_hoisted_12,vue.toDisplayString(m.title),1),vue.createElementVNode("span",_hoisted_13,vue.toDisplayString(m.total),1),_hoisted_14])),vue.createElementVNode("div",_hoisted_15,[m.activeFilters?(vue.openBlock(),vue.createElementBlock("div",_hoisted_16,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(m.activeFilters,(et,Tt,nr)=>(vue.openBlock(),vue.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:nr},[vue.createElementVNode("span",_hoisted_17,vue.toDisplayString(m.getLabelById(Tt)),1),_hoisted_18,vue.createElementVNode("span",_hoisted_19,vue.toDisplayString(m.getOptionsLabelById(Tt,et)),1),vue.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:si=>m.clearFilter(Tt)},[vue.createVNode(at)],8,_hoisted_20)]))),128)),((xt=Object.keys(m.activeFilters))==null?void 0:xt.length)>=2?(vue.openBlock(),vue.createElementBlock("span",_hoisted_21,[_hoisted_22,vue.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:b[5]||(b[5]=et=>m.mountedFilter={})},[vue.createVNode(at)])])):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),m.total>=1?vue.renderSlot(m.$slots,"table",{key:1,rows:m.tableData,map:m.map,marker:m.marker,selectRow:m.selectRow,getData:m.getData,addGeomMarker:m.addGeomMarker,isMapVisible:m.isMapVisible}):(vue.openBlock(),vue.createElementBlock("div",_hoisted_23,[vue.createVNode(Ve),_hoisted_24,_hoisted_25,vue.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:b[6]||(b[6]=(...et)=>m.resetFilters&&m.resetFilters(...et))}," Очистити дані пошуку ")]))]),m.total>=1?(vue.openBlock(),vue.createElementBlock("hr",_hoisted_26)):vue.createCommentVNode("",!0),m.total>=1?(vue.openBlock(),vue.createElementBlock("div",_hoisted_27,[vue.createElementVNode("div",_hoisted_28,[vue.createVNode(Xe,{total:m.total,maxPages:7,defaultPage:m.currentPage,pageSize:m.limit,goTo:!1,size:"medium",onPageChange:m.handlePageChange,backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[10,20,30],onPageSizeChange:m.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])):vue.createCommentVNode("",!0)],2),[[vue.vShow,parseInt(m.windowWidth)>=1e3?!0:!m.isMapVisible]]),m.isSelectObj?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(m.isMapVisible?"w-full fixed lg:static lg:w-1/2 mr-0 pb-5":"w-full pb-5 mr-3"),style:{height:"calc(100vh - 152px)"}},[vue.renderSlot(m.$slots,"details",{table:m.table,selectedId:m.selectedId,selectedRow:m.selectedRow,map:m.map,closeObjCard:m.closeObjCard,isMapVisible:m.isMapVisible})],2)):vue.createCommentVNode("",!0),vue.withDirectives(vue.createElementVNode("div",_hoisted_29,[vue.createElementVNode("section",_hoisted_30,[vue.renderSlot(m.$slots,"default",{map:m.map,removeSelectedBaseLayer:()=>m.selectedBaseLayer="",selectedBaseLayer:m.selectedBaseLayer,selectedRow:m.selectedRow}),vue.createVNode(Fe,{height:"calc(100vh - 152px)",width:"w-2/4",table:m.table,filtersParam:m.filtersParam,row:m.selectedRow,legendname:m.legendname,legend:m.legend,colorAttr:m.colorAttr,strokeAttr:m.strokeAttr,polygonOpacity:m.polygonOpacity,maxBounds:m.maxBounds,center:m.center,zoom:m.zoom,dashedLine:m.dashedLine,minZoom:m.minZoom,basemap:m.basemap,pointZoom:m.pointZoom,defaultColor:m.defaultColor,onMap:b[7]||(b[7]=et=>m.map=et),selectedBaseLayer:m.selectedBaseLayer,"onUpdate:selectedBaseLayer":b[8]||(b[8]=et=>m.selectedBaseLayer=et),onIsCompareOpen:b[9]||(b[9]=et=>m.isCompareOpen=et)},{default:vue.withCtx(({hoverData:et})=>[vue.renderSlot(m.$slots,"popup",{data:et})]),_:3},8,["table","filtersParam","row","legendname","legend","colorAttr","strokeAttr","polygonOpacity","maxBounds","center","zoom","dashedLine","minZoom","basemap","pointZoom","defaultColor","selectedBaseLayer"])])],512),[[vue.vShow,m.isMapVisible]])])])])}const VsPartsMap=_export_sfc(_sfc_main,[["render",_sfc_render]]),install=m=>{m.component("VsPartsMap",VsPartsMap)},PartsMap={install,components:{VsPartsMap}};return typeof window<"u"&&(window.PartsMap=PartsMap),PartsMap});
585
+ `+X):C.stack=X}catch{}}throw C}}_request(b,P){typeof b=="string"?(P=P||{},P.url=b):P=b||{},P=mergeConfig(this.defaults,P);const{transitional:C,paramsSerializer:B,headers:X}=P;C!==void 0&&validator.assertOptions(C,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),B!=null&&(utils$1.isFunction(B)?P.paramsSerializer={serialize:B}:validator.assertOptions(B,{encode:validators.function,serialize:validators.function},!0)),P.method=(P.method||this.defaults.method||"get").toLowerCase();let T=X&&utils$1.merge(X.common,X[P.method]);X&&utils$1.forEach(["delete","get","head","post","put","patch","common"],Ve=>{delete X[Ve]}),P.headers=AxiosHeaders.concat(T,X);const c=[];let fe=!0;this.interceptors.request.forEach(function(Xe){typeof Xe.runWhen=="function"&&Xe.runWhen(P)===!1||(fe=fe&&Xe.synchronous,c.unshift(Xe.fulfilled,Xe.rejected))});const _e=[];this.interceptors.response.forEach(function(Xe){_e.push(Xe.fulfilled,Xe.rejected)});let ye,ae=0,oe;if(!fe){const Ve=[dispatchRequest.bind(this),void 0];for(Ve.unshift.apply(Ve,c),Ve.push.apply(Ve,_e),oe=Ve.length,ye=Promise.resolve(P);ae<oe;)ye=ye.then(Ve[ae++],Ve[ae++]);return ye}oe=c.length;let at=P;for(ae=0;ae<oe;){const Ve=c[ae++],Xe=c[ae++];try{at=Ve(at)}catch(Fe){Xe.call(this,Fe);break}}try{ye=dispatchRequest.call(this,at)}catch(Ve){return Promise.reject(Ve)}for(ae=0,oe=_e.length;ae<oe;)ye=ye.then(_e[ae++],_e[ae++]);return ye}getUri(b){b=mergeConfig(this.defaults,b);const P=buildFullPath(b.baseURL,b.url);return buildURL(P,b.params,b.paramsSerializer)}}utils$1.forEach(["delete","get","head","options"],function(b){Axios.prototype[b]=function(P,C){return this.request(mergeConfig(C||{},{method:b,url:P,data:(C||{}).data}))}}),utils$1.forEach(["post","put","patch"],function(b){function P(C){return function(X,T,c){return this.request(mergeConfig(c||{},{method:b,headers:C?{"Content-Type":"multipart/form-data"}:{},url:X,data:T}))}}Axios.prototype[b]=P(),Axios.prototype[b+"Form"]=P(!0)});class CancelToken{constructor(b){if(typeof b!="function")throw new TypeError("executor must be a function.");let P;this.promise=new Promise(function(X){P=X});const C=this;this.promise.then(B=>{if(!C._listeners)return;let X=C._listeners.length;for(;X-- >0;)C._listeners[X](B);C._listeners=null}),this.promise.then=B=>{let X;const T=new Promise(c=>{C.subscribe(c),X=c}).then(B);return T.cancel=function(){C.unsubscribe(X)},T},b(function(X,T,c){C.reason||(C.reason=new CanceledError(X,T,c),P(C.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(b){if(this.reason){b(this.reason);return}this._listeners?this._listeners.push(b):this._listeners=[b]}unsubscribe(b){if(!this._listeners)return;const P=this._listeners.indexOf(b);P!==-1&&this._listeners.splice(P,1)}static source(){let b;return{token:new CancelToken(function(B){b=B}),cancel:b}}}function spread(m){return function(P){return m.apply(null,P)}}function isAxiosError(m){return utils$1.isObject(m)&&m.isAxiosError===!0}const HttpStatusCode={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(HttpStatusCode).forEach(([m,b])=>{HttpStatusCode[b]=m});function createInstance(m){const b=new Axios(m),P=bind(Axios.prototype.request,b);return utils$1.extend(P,Axios.prototype,b,{allOwnKeys:!0}),utils$1.extend(P,b,null,{allOwnKeys:!0}),P.create=function(B){return createInstance(mergeConfig(m,B))},P}const axios=createInstance(defaults);axios.Axios=Axios,axios.CanceledError=CanceledError,axios.CancelToken=CancelToken,axios.isCancel=isCancel,axios.VERSION=VERSION,axios.toFormData=toFormData,axios.AxiosError=AxiosError,axios.Cancel=axios.CanceledError,axios.all=function(b){return Promise.all(b)},axios.spread=spread,axios.isAxiosError=isAxiosError,axios.mergeConfig=mergeConfig,axios.AxiosHeaders=AxiosHeaders,axios.formToJSON=m=>formDataToJSON(utils$1.isHTMLForm(m)?new FormData(m):m),axios.getAdapter=adapters.getAdapter,axios.HttpStatusCode=HttpStatusCode,axios.default=axios;const debounce=(m,b=300)=>{let P;return function(...B){clearTimeout(P),P=setTimeout(()=>{m.apply(this,B)},b)}},_sfc_main$a={mixins:[layerMixin],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:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>, &copy; <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(m){m&&m.on("load",this.handleMapLoad)}},methods:{handleMapLoad(){var m;this.baseLayers.forEach(b=>{this.layerList.push(b)}),this.toggleLayerVisibility((m=this.baseLayers[0])==null?void 0:m.id)},toggleLayerVisibility(m){this.$emit("update:selectedLayer",m),this.changeBaseLayer(m)}}},_hoisted_1$9={class:"vs-map-slot-layers z-10 select-none"},_hoisted_2$9=["onClick"],_hoisted_3$7=["src"];function _sfc_render$9(m,b,P,C,B,X){return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(P.baseLayers,(T,c)=>(vue.openBlock(),vue.createElementBlock("div",{key:T.id,class:vue.normalizeClass(["vs-map-slot-layers__layer relative",{focused:T.id==P.selectedLayer}]),onClick:fe=>X.toggleLayerVisibility(T.id)},[vue.createElementVNode("img",{src:T.image,class:"vs-map-slot-layers__image"},null,8,_hoisted_3$7),vue.createElementVNode("div",{class:vue.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%]"]])},vue.toDisplayString(T==null?void 0:T.name),3)],10,_hoisted_2$9))),128))])}const MapSlotLayers=_export_sfc(_sfc_main$a,[["render",_sfc_render$9],["__scopeId","data-v-8959e540"]]),_sfc_main$9={props:["colors","strokes","title"],methods:{capitalizeFirstLetter(m){return m?m.charAt(0).toUpperCase()+m.slice(1):""}}},_hoisted_1$8={class:"absolute left-[20px] bottom-[74px] bg-white max-w-[250px] p-[10px] rounded-lg z-10 border"},_hoisted_2$8={key:0,class:"mb-[10px] text-[1rem]"},_hoisted_3$6={key:1},_hoisted_4$6={class:"legend-item flex items-center gap-2 mb-[10px]"},_hoisted_5$5={class:"ml-1 text-[0.875rem]"},_hoisted_6$5={class:"legend-item"},_hoisted_7$1={key:0,class:"flex justify-start items-center gap-2"},_hoisted_8$1={class:"ml-1 text-[0.875rem]"};function _sfc_render$8(m,b,P,C,B,X){var T;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$8,[P.title?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$8,vue.toDisplayString(P.title),1)):vue.createCommentVNode("",!0),(T=P.strokes)!=null&&T.length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$6,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(P.strokes,c=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$6,[vue.createElementVNode("div",{class:"w-[15px] h-[4px]",style:vue.normalizeStyle({background:`repeating-linear-gradient(to right, ${c.color}, ${c.color} 5px, transparent 5px, transparent 8px)`})},null,4),vue.createElementVNode("div",_hoisted_5$5,vue.toDisplayString(X.capitalizeFirstLetter(c.text)),1)]))),256))])):vue.createCommentVNode("",!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(P.colors,c=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$5,[c.id>0?(vue.openBlock(),vue.createElementBlock("div",_hoisted_7$1,[vue.createElementVNode("div",{class:"w-[15px] h-[15px] rounded-[50%] min-w-[15px]",style:vue.normalizeStyle({backgroundColor:c.color})},null,4),vue.createElementVNode("div",_hoisted_8$1,vue.toDisplayString(X.capitalizeFirstLetter(c.text)),1)])):vue.createCommentVNode("",!0)]))),256))])}const MapLegend=_export_sfc(_sfc_main$9,[["render",_sfc_render$8]]);function feature(m,b,P={}){const C={type:"Feature"};return(P.id===0||P.id)&&(C.id=P.id),P.bbox&&(C.bbox=P.bbox),C.properties=b||{},C.geometry=m,C}function point(m,b,P={}){if(!m)throw new Error("coordinates is required");if(!Array.isArray(m))throw new Error("coordinates must be an Array");if(m.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!isNumber(m[0])||!isNumber(m[1]))throw new Error("coordinates must contain numbers");return feature({type:"Point",coordinates:m},b,P)}function polygon(m,b,P={}){for(const B of m){if(B.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(B[B.length-1].length!==B[0].length)throw new Error("First and last Position are not equivalent.");for(let X=0;X<B[B.length-1].length;X++)if(B[B.length-1][X]!==B[0][X])throw new Error("First and last Position are not equivalent.")}return feature({type:"Polygon",coordinates:m},b,P)}function multiPoint(m,b,P={}){return feature({type:"MultiPoint",coordinates:m},b,P)}function multiPolygon(m,b,P={}){return feature({type:"MultiPolygon",coordinates:m},b,P)}function isNumber(m){return!isNaN(m)&&m!==null&&!Array.isArray(m)}function coordEach(m,b,P){if(m!==null)for(var C,B,X,T,c,fe,_e,ye=0,ae=0,oe,at=m.type,Ve=at==="FeatureCollection",Xe=at==="Feature",Fe=Ve?m.features.length:1,ut=0;ut<Fe;ut++){_e=Ve?m.features[ut].geometry:Xe?m.geometry:m,oe=_e?_e.type==="GeometryCollection":!1,c=oe?_e.geometries.length:1;for(var kt=0;kt<c;kt++){var Ze=0,Ct=0;if(T=oe?_e.geometries[kt]:_e,T!==null){fe=T.coordinates;var xt=T.type;switch(ye=0,xt){case null:break;case"Point":if(b(fe,ae,ut,Ze,Ct)===!1)return!1;ae++,Ze++;break;case"LineString":case"MultiPoint":for(C=0;C<fe.length;C++){if(b(fe[C],ae,ut,Ze,Ct)===!1)return!1;ae++,xt==="MultiPoint"&&Ze++}xt==="LineString"&&Ze++;break;case"Polygon":case"MultiLineString":for(C=0;C<fe.length;C++){for(B=0;B<fe[C].length-ye;B++){if(b(fe[C][B],ae,ut,Ze,Ct)===!1)return!1;ae++}xt==="MultiLineString"&&Ze++,xt==="Polygon"&&Ct++}xt==="Polygon"&&Ze++;break;case"MultiPolygon":for(C=0;C<fe.length;C++){for(Ct=0,B=0;B<fe[C].length;B++){for(X=0;X<fe[C][B].length-ye;X++){if(b(fe[C][B][X],ae,ut,Ze,Ct)===!1)return!1;ae++}Ct++}Ze++}break;case"GeometryCollection":for(C=0;C<T.geometries.length;C++)if(coordEach(T.geometries[C],b)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function bbox(m,b={}){if(m.bbox!=null&&b.recompute!==!0)return m.bbox;const P=[1/0,1/0,-1/0,-1/0];return coordEach(m,C=>{P[0]>C[0]&&(P[0]=C[0]),P[1]>C[1]&&(P[1]=C[1]),P[2]<C[0]&&(P[2]=C[0]),P[3]<C[1]&&(P[3]=C[1])}),P}function center(m,b={}){const P=bbox(m),C=(P[0]+P[2])/2,B=(P[1]+P[3])/2;return point([C,B],b.properties,b)}const _sfc_main$8={components:{MapSlotLayers,MapLegend},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,filtersParam:{type:String,default:""},row:{type:Object,default:{}},pointZoom:{type:String,default:"12"},legend:{type:Boolean,default:()=>!0}},mixins:[layerMixin],inject:["prefix"],data(){return{map:null,hoverObject:null,hoverData:null,popup:null,colors:[],strokes:null}},async mounted(){var m,b,P,C;try{if(await this.createMap(),(m=this.row)!=null&&m.geom){const{type:B,coordinates:X}=this.row.geom;let T;switch(B){case"Polygon":T=polygon(X);break;case"MultiPolygon":T=multiPolygon(X);break;case"MultiPoint":T=multiPoint(X);break;default:(b=this.map)==null||b.fitBounds([X,X],{maxZoom:this.zoom,padding:30,duration:0}),this.isSelectObj=!0;return}const c=center(T).geometry.coordinates;(P=this.map)==null||P.fitBounds([c,c],{maxZoom:this.zoom,padding:30,duration:0})}(C=this.map)==null||C.fitBounds(this.center,{duration:0})}catch{}},watch:{filtersParam(m){this.setFilter(this.table,m)},selectedBaseLayer(m){this.$emit("update:selectedBaseLayer",m)},row:{handler(m){m!=null&&m.geom&&this.fitToBounds(m.geom),this.map&&this.map.getStyle()&&this.map.getStyle().layers.filter(C=>C.source===this.table&&C.type==="line").forEach(C=>{var B;this.map.setPaintProperty(C.id,"line-width",((B=this.row)==null?void 0:B.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(m=>m==null?void 0:m.id)}},methods:{async getColorStyle(){var m=[["#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:b}}=await axios.get(`${this.prefix}/data/${this.table}/${this.colorAttr}`),P=b.reduce((C,B,X)=>B!=null&&B.id?[...C,B.id.toString(),B.color||m[0][X%5]]:C,["match",["get",this.colorAttr]]);return this.colors=[...b],P.push("gray"),P}catch(b){console.log(b)}},async getStrokeStyle(){if(!this.strokeAttr)return"transparent";try{const{data:{rows:m}}=await axios.get(`${this.prefix}/data/${this.table}/${this.strokeAttr}`),b=m.reduce((P,C,B)=>C!=null&&C.id?[...P,{id:C.id.toString(),color:C.color||"#000000",dash:C.dash||[2,2],text:C.text||C.id.toString()}]:P,[]);return this.strokes=[...b],["match",["get",this.strokeAttr],...b.flatMap(({id:P,color:C})=>[P,C]),"transparent"]}catch(m){return console.log(m),"transparent"}},async handleMapLoad(){var C,B,X,T,c;(C=this.row)!=null&&C.geom&&this.fitToBounds(this.row.geom),this.$emit("map",this.map),this.map.on("mousemove",this.handleMapHover);const m=await this.getStrokeStyle(),b=await this.getColorStyle(),P=((X=(B=location.search.split("&").find(fe=>fe.includes("filter=")))==null?void 0:B.split("filter="))==null?void 0:X[1])||"";await this.addLayer({id:this.table,service:"vector",url:`${this.prefix}/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":b,"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":b}},{type:"line",paint:{"line-color":b,"line-width":((T=this.row)==null?void 0:T.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":m,"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]}}]:[]]}),P&&this.setFilter(this.table,P)},async createMap(){const m={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new maplibregl.Map({container:"maplibre-map",style:m,zoom:this.zoom,center:this.center,minZoom:this.minZoom}),this.$parent.map=this.map,this.map.addControl(new maplibregl.NavigationControl({visualizePitch:!0})),this.map.on("load",this.handleMapLoad)},fitToBounds(m){if(!this.map)return;const{type:b,coordinates:P}=m;let C,B;switch(b){case"Polygon":C=polygon(P),B=bbox(C),this.map.fitBounds(B,{padding:30,maxZoom:15,duration:0});break;case"MultiPolygon":C=multiPolygon(P),B=bbox(C),this.map.fitBounds(B,{padding:30,maxZoom:15,duration:0});break;case"MultiPoint":C=multiPoint(P),B=bbox(C),this.map.fitBounds(B,{padding:30,maxZoom:15,duration:0});break;case"Point":this.map.flyTo({center:P,zoom:15,duration:0,essential:!0});break;default:console.warn("Невідомий тип геометрії:",b)}},async handleMapHover(m){var T,c,fe;this.hoverObject&&(this.map.setFeatureState(this.hoverObject,{hover:!1}),this.hoverObject=null),this.popup||(this.popup=new maplibregl.Popup({maxWidth:"400px",closeButton:!1,closeOnClick:!1}));const b=this.map.queryRenderedFeatures(m.point);if(this.map.getCanvas().style.cursor="pointer",!(b!=null&&b.length)||((T=b==null?void 0:b[0])==null?void 0:T.source)==="region-search-id"){this.map.getCanvas().style.cursor="",this.popup.remove();return}const P=["route-line"];if(!b.filter(_e=>!P.some(ye=>{var ae;return(ae=_e.layer)==null?void 0:ae.source.includes(ye)})).length)return;const B=b[0].geometry.coordinates.slice();b[0].source==="highlighted-polygon"&&b[1]?this.hoverData=(c=b[1])==null?void 0:c.properties:this.hoverData=(fe=b[0])==null?void 0:fe.properties;const X={source:b[0].source,sourceLayer:b[0].sourceLayer,id:b[0].id};if(X.source!=="region-search-id"){for(this.map.setFeatureState(X,{hover:!0}),this.hoverObject=X;Math.abs(m.lngLat.lng-B[0])>180;)B[0]+=m.lngLat.lng>B[0]?360:-360;this.popup.setLngLat(m.lngLat).setHTML(this.$refs.popup.innerHTML).addTo(this.map)}}}},_hoisted_1$7={class:"vs-map-portal relative z-1 mt-2",id:"mapwrapper"},_hoisted_2$7={ref:"popup",style:{display:"none"}};function _sfc_render$7(m,b,P,C,B,X){const T=vue.resolveComponent("MapLegend"),c=vue.resolveComponent("MapSlotLayers");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7,[vue.createElementVNode("div",{id:"maplibre-map",ref:"maplibreMap",class:"w-full compare_main_map",style:vue.normalizeStyle({height:P.height})},null,4),vue.withDirectives(vue.createVNode(T,{colors:B.colors,strokes:B.strokes,title:P.legendname},null,8,["colors","strokes","title"]),[[vue.vShow,P.legend]]),vue.createVNode(c,{map:B.map,baseLayers:P.basemap,selectedLayer:P.selectedBaseLayer,"onUpdate:selectedLayer":b[0]||(b[0]=fe=>m.$emit("update:selectedBaseLayer",fe))},null,8,["map","baseLayers","selectedLayer"]),vue.createElementVNode("div",_hoisted_2$7,[vue.renderSlot(m.$slots,"default",{hoverData:B.hoverData})],512)])}const MapPortal=_export_sfc(_sfc_main$8,[["render",_sfc_render$7]]),_sfc_main$7={},_hoisted_1$6={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"},_hoisted_2$6=vue.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),_hoisted_11$1=[_hoisted_2$6];function _sfc_render$6(m,b){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$6,_hoisted_11$1)}const FilterIcon=_export_sfc(_sfc_main$7,[["render",_sfc_render$6]]),_sfc_main$6={},_hoisted_1$5={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"},_hoisted_2$5=vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_hoisted_3$5=vue.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),_hoisted_4$5=vue.createElementVNode("path",{d:"M15 4v16"},null,-1),_hoisted_5$4=vue.createElementVNode("path",{d:"M9 10l2 2l-2 2"},null,-1),_hoisted_6$4=[_hoisted_2$5,_hoisted_3$5,_hoisted_4$5,_hoisted_5$4];function _sfc_render$5(m,b){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$5,_hoisted_6$4)}const VisibleMapIcon=_export_sfc(_sfc_main$6,[["render",_sfc_render$5]]),_sfc_main$5={},_hoisted_1$4={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"},_hoisted_2$4=vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_hoisted_3$4=vue.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),_hoisted_4$4=vue.createElementVNode("path",{d:"M15 4v16"},null,-1),_hoisted_5$3=vue.createElementVNode("path",{d:"M10 10l-2 2l2 2"},null,-1),_hoisted_6$3=[_hoisted_2$4,_hoisted_3$4,_hoisted_4$4,_hoisted_5$3];function _sfc_render$4(m,b){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$4,_hoisted_6$3)}const HiddenMapIcon=_export_sfc(_sfc_main$5,[["render",_sfc_render$4]]),_sfc_main$4={},_hoisted_1$3={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"},_hoisted_2$3=vue.createElementVNode("path",{d:"M18 6 6 18"},null,-1),_hoisted_3$3=vue.createElementVNode("path",{d:"m6 6 12 12"},null,-1),_hoisted_4$3=[_hoisted_2$3,_hoisted_3$3];function _sfc_render$3(m,b){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$3,_hoisted_4$3)}const CloseIcon=_export_sfc(_sfc_main$4,[["render",_sfc_render$3]]),_sfc_main$3={__name:"vs-partsmap-search",props:{modelValue:null,maskForSearch:null,searchShow:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(m,{emit:b}){const P=b;return(C,B)=>{const X=vue.resolveComponent("VsTextMask"),T=vue.resolveComponent("vs-text");return m.maskForSearch?(vue.openBlock(),vue.createBlock(X,{key:0,"model-value":m.modelValue,"onUpdate:modelValue":B[0]||(B[0]=c=>P("update:modelValue",c)),class:"w-full table-interface-search",placeholder:"Пошук",mask:m.maskForSearch,icon:"search",iconPosition:"left",clearable:"",style:{height:"38px","min-width":"300px","max-width":"300px"}},null,8,["model-value","mask"])):m.searchShow?(vue.openBlock(),vue.createBlock(T,{key:1,"model-value":m.modelValue,"onUpdate:modelValue":B[1]||(B[1]=c=>P("update:modelValue",c)),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"}},null,8,["model-value"])):vue.createCommentVNode("",!0)}}},_sfc_main$2={},_hoisted_1$2={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-map"},_hoisted_2$2=vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_hoisted_3$2=vue.createElementVNode("path",{d:"M3 7l6 -3l6 3l6 -3v13l-6 3l-6 -3l-6 3v-13"},null,-1),_hoisted_4$2=vue.createElementVNode("path",{d:"M9 4v13"},null,-1),_hoisted_5$2=vue.createElementVNode("path",{d:"M15 7v13"},null,-1),_hoisted_6$2=[_hoisted_2$2,_hoisted_3$2,_hoisted_4$2,_hoisted_5$2];function _sfc_render$2(m,b){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$2,_hoisted_6$2)}const IconMap=_export_sfc(_sfc_main$2,[["render",_sfc_render$2]]),_sfc_main$1={},_hoisted_1$1={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",class:"icon icon-tabler icons-tabler-outline icon-tabler-table"},_hoisted_2$1=vue.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),_hoisted_3$1=vue.createElementVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"},null,-1),_hoisted_4$1=vue.createElementVNode("path",{d:"M3 10h18"},null,-1),_hoisted_5$1=vue.createElementVNode("path",{d:"M10 3v18"},null,-1),_hoisted_6$1=[_hoisted_2$1,_hoisted_3$1,_hoisted_4$1,_hoisted_5$1];function _sfc_render$1(m,b){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$1,_hoisted_6$1)}const IconTable=_export_sfc(_sfc_main$1,[["render",_sfc_render$1]]),_sfc_main=vue.defineComponent({props:{prefix:{type:String,default:"/api"},applyVueRouter:{type:Boolean,default:!0},dashedLine:{type:Boolean,default:!1},title:{type:String,default:()=>""},table:{type:String,default:()=>""},rows:{type:Object,default:()=>null},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:()=>""},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},pointZoom:{type:String,default:()=>"12"},legend:{type:Boolean,default:()=>!0},defaultColor:{type:String,default:()=>"blue"},polygonOpacity:{type:Number,default:()=>null},history:{type:Boolean,default:!0}},mixins:[layerMixin],components:{MapPortal,NoData,FilterIcon,VisibleMapIcon,HiddenMapIcon,CloseIcon,VsPartsmapSearch:_sfc_main$3,IconTable,IconMap},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,isFilterVisible:!1,tableData:null,map:null,legendName:null,total:null,filtered:null,activeFiltersCount:"",regionSelectValue:null,addressSelectValue:null,currentBbox:null,mountedFilter:{},isCompareOpen:!1,windowWidth:0,handleDebouncedUpdateValue:debounce(m=>{this.handleSearchValue(m)},300)}},provide(){return{prefix:this.prefix}},watch:{map(){this.map.on("click",this.handleMapClick),this.$emit("update:map",this.map)},activeFiltersCount(){var m,b;return(b=(m=this.$refs)==null?void 0:m.filter)==null?void 0:b.filteredActiveFiltersLength},activeFilters(){var m,b;return(b=(m=this.$refs)==null?void 0:m.filter)==null?void 0:b.activeFilters}},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.windowWidth=window.innerWidth,parseInt(this.windowWidth)<1e3&&(this.isMapVisible=!1),this.rows||this.getData();const b=new URLSearchParams(window.location.search).get("filter"),P=b==null?void 0:b.split("|");P==null||P.forEach(B=>{const[X,T]=B.split("=");T!=null&&T.includes(",")?this.mountedFilter[X]=T==null?void 0:T.split(","):this.mountedFilter[X]=T,this.activeFilters=this.mountedFilter});const C=new URLSearchParams(window.location.search);this.currentPage=C.get("page")||1,this.getFilter(),addEventListener("resize",this.changeWidth)},updated(){this.checkFilterLength()},methods:{async getData(){try{const m={search:this.search||null,limit:this.limit,page:this.currentPage,polyline:this.polyline};m.filter=this.filtersParam;const{data:b}=await axios.get(`${this.prefix}/data/${this.table}`,{params:m});this.tableData=b==null?void 0:b.rows,this.total=b.filtered,this.filtered=b.filtered}catch(m){console.error(m.message)}},moveToDefaultPage(){var b;new URLSearchParams(window.location.search).delete("id"),(b=this.map)==null||b.fitBounds(this.maxBounds,{duration:0}),this.history&&window.history.pushState({},"",newUrl),this.isSelectObj=!1},regionFullName(m){return m.region?`${m.text} / ${m.region}`:m.text},getLabelById(m){var P;const b=(P=this.filters)==null?void 0:P.find(C=>C.id===m);return b?b.label:m},getOptionsLabelById(id,option){var m;const filter=(m=this.filters)==null?void 0:m.find(b=>b.id===id);if(filter!=null&&filter.formatter){const func=eval(filter==null?void 0:filter.formatter);return func(option)}return Array.isArray(option)?filter!=null&&filter.options?filter==null?void 0:filter.options.filter(b=>option.includes(b.id)).map(b=>b.text).join(", "):option==null?void 0:option.length:option},async clearFilter(m){var b,P,C;await((P=(b=this.$refs)==null?void 0:b.filter)==null?void 0:P.clearFilter(m)),this.filterUrl=(C=this.$refs)==null?void 0:C.filter.filterUrl,(m==="region_katottg"||m==="katottg")&&this.$emit("update:filterState",{}),await this.updateTableAndMap(),await this.getData()},handlePageChange(m){this.currentPage=m;const b=new URL(window.location.href),P=new URLSearchParams(window.location.search);P.set("page",m),b.search=decodeURI(P.toString()),window.history.pushState({},"",b),this.getData()},async getFilter(){var m;try{const{data:b}=await axios.get(`${this.prefix}/filter/${this.table}`);this.filters=(m=b==null?void 0:b.list)==null?void 0:m.map(P=>({...P,label:(P==null?void 0:P.label)||(P==null?void 0:P.ua),id:(P==null?void 0:P.id)||(P==null?void 0:P.name)}))}catch(b){console.error(b.message)}},async handleSearchValue(m){this.search=m,await this.getData()},closeObjCard(){var C;const m=new URLSearchParams(window.location.search);m.delete("id"),this.deletePulsePoint();const P=`${window.location.pathname}?${m.toString()}`;(this.currentBbox||this.center)&&((C=this.map)==null||C.fitBounds(this.currentBbox||[this.center,this.center],{maxZoom:this.zoom,duration:0})),window.history.pushState({},"",P),this.isSelectObj=!1,this.selectedRow=null,this.getData()},handleFilterChange(m){this.$emit("update:filterState",m),this.currentPage=m.state.page||1,this.filterUrl=m.url==="no-url"?null:m.url.split("|").filter(b=>!b.includes("page=")).join("|")},async updateTableAndMap(){var m,b;this.selectedRow||(this.filtersParam=this.filterUrl,this.activeFilters=(b=(m=this.$refs)==null?void 0:m.filter)==null?void 0:b.activeFilters,this.isFilterVisible=!1,this.getData())},toggleMapVisible(){this.isMapVisible=!this.isMapVisible},checkUrl(m=!0){const b=new URLSearchParams(window.location.search);b.has("id")?(this.isSelectObj=!0,this.isMapVisible=parseInt(this.windowWidth)<1e3?!1:m,this.selectedId=b.get("id")):(this.isSelectObj=!1,this.selectedId="")},changeLimit(m){this.limit=m,this.currentPage=1,this.getData()},resetFilters(){this.$refs.filter&&(this.$refs.filter.clearAll(),this.search="",this.filtersParam="",this.polyline=null,this.regionSelectValue=null,this.addressSelectValue=null,this.currentBbox=null,this.activeFilters=null,this.tabsIsVisible=!1)},checkFilterLength(){var b,P;const m=(P=(b=this.$refs)==null?void 0:b.filter)==null?void 0:P.filteredActiveFiltersLength;m!==this.previousLength&&(this.previousLength=m,this.activeFiltersCount=m)},async handleMapClick(m){var X,T,c,fe,_e,ye,ae,oe,at,Ve;const b=this.map.queryRenderedFeatures(m.point);if((b==null?void 0:b.length)<1||((X=b[0])==null?void 0:X.source)==="region-search-id"||((T=b[0])==null?void 0:T.source)==="route-line")return;const P=window.location.pathname,C=new URLSearchParams(window.location.search);C.set("id",`${(c=b[0])==null?void 0:c.properties.id}`),this.getObjectData((_e=(fe=b[0])==null?void 0:fe.properties)==null?void 0:_e.id);const B=`${P}?${C.toString()}`;this.history&&window.history.pushState({},"",B),this.isSelectObj=!0,m.lngLat&&((Ve=this.map)==null||Ve.fitBounds([[(ye=m.lngLat)==null?void 0:ye.lng,(ae=m.lngLat)==null?void 0:ae.lat],[(oe=m.lngLat)==null?void 0:oe.lng,(at=m.lngLat)==null?void 0:at.lat]],{padding:30,duration:0})),this.checkUrl()},async getObjectData(m){var b,P;try{const{data:C}=await axios.get(`${this.prefix}/data/${this.table}/${m}`);this.selectRow((b=C==null?void 0:C.rows)==null?void 0:b[0]),((P=C==null?void 0:C.rows)==null?void 0:P.lenght)<1&&this.deletePulsePoint()}catch(C){console.error(C.message)}},async selectRow(m,b=!0){var c;this.isMapVisible=parseInt(this.windowWidth)<1e3?!1:b;const C=await(await fetch(`${this.prefix}/data/${this.table}/${m.id}`)).json();this.selectedRow=((c=C==null?void 0:C.rows)==null?void 0:c[0])||m;const B=window.location.pathname,X=new URLSearchParams(window.location.search);X.set("id",`${m.id}`);const T=`${B}?${X.toString()}`;this.history&&window.history.pushState({},"",T),this.checkUrl(b),this.isSelectObj=!0},deletePulsePoint(){this.marker&&this.marker.remove()},addPulsePoint(m){this.deletePulsePoint();const b=document.createElement("div");b.className="gps-marker",b.style.width="10px",b.style.height="10px",b.style.position="relative";const P=document.createElement("div");P.className="gps-wave",b.appendChild(P),this.marker=new maplibregl.Marker({element:b,anchor:"center"}).setLngLat(m).addTo(this.map)}}}),_hoisted_1={class:"pt-[20px]"},_hoisted_2={key:0,class:"w-full gap-5 flex justify-between mb-[6px] pr-3"},_hoisted_3={class:"flex items-center gap-2 max-h-[38px] pt-[4px]"},_hoisted_4={class:"custom-filter-list"},_hoisted_5={key:0,class:"font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"},_hoisted_6={class:"flex items-center"},_hoisted_7=["title"],_hoisted_8=vue.createElementVNode("span",{class:"sr-only"},"Відкрити мапу",-1),_hoisted_9={class:"max-[1000px]:flex gap-2 min-[1001px]:hidden"},_hoisted_10={class:"flex"},_hoisted_11={key:0,class:"py-[15px] pb-[24px] pl-2"},_hoisted_12={class:"font-bold text-2xl mr-[10px]"},_hoisted_13={class:"text-sm text-stone-500 font-medium"},_hoisted_14=vue.createElementVNode("span",{class:"text-sm text-stone-500 font-medium"}," об'єктів",-1),_hoisted_15={class:"wrapperTable flex flex-col",style:{height:"calc(100vh - 302px)"}},_hoisted_16={key:0,class:"flex gap-x-2 flex-wrap"},_hoisted_17={class:"font-medium"},_hoisted_18=vue.createElementVNode("span",{class:"h-3 mx-2 border-s border-gray-200"},null,-1),_hoisted_19={class:"text-gray-500"},_hoisted_20=["onClick"],_hoisted_21={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"},_hoisted_22=vue.createElementVNode("span",{class:"font-medium"}," Очистити ",-1),_hoisted_23={key:2,class:"text-center py-28"},_hoisted_24=vue.createElementVNode("h2",{class:"font-medium text-base text-gray-500 rounded-xl"}," За вашим запитом даних не знайдено! ",-1),_hoisted_25=vue.createElementVNode("p",{class:"font-normal text-sm text-gray-500 rounded-xl"}," Введіть, будь ласка, інші значення для пошуку. ",-1),_hoisted_26={key:1},_hoisted_27={key:2,class:"my-5 pr-2"},_hoisted_28={class:"flex justify-between"},_hoisted_29={class:"w-full lg:w-1/2 relative"},_hoisted_30={class:"map-section relative"};function _sfc_render(m,b,P,C,B,X){var ut,kt,Ze,Ct,xt;const T=vue.resolveComponent("VsPartsmapSearch"),c=vue.resolveComponent("FilterIcon"),fe=vue.resolveComponent("VsFilterList"),_e=vue.resolveComponent("VisibleMapIcon"),ye=vue.resolveComponent("HiddenMapIcon"),ae=vue.resolveComponent("IconTable"),oe=vue.resolveComponent("IconMap"),at=vue.resolveComponent("CloseIcon"),Ve=vue.resolveComponent("NoData"),Xe=vue.resolveComponent("VsPagination"),Fe=vue.resolveComponent("MapPortal");return vue.openBlock(),vue.createElementBlock("section",_hoisted_1,[vue.renderSlot(m.$slots,"header",{title:m.title,total:m.total,selectedRow:m.selectedRow}),vue.createElementVNode("div",null,[vue.renderSlot(m.$slots,"filters",{selectedRow:m.selectedRow}),(ut=m.$slots)!=null&&ut.filters?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_2,[vue.createElementVNode("div",_hoisted_3,[vue.createVNode(T,{"model-value":m.search,"onUpdate:modelValue":m.handleDebouncedUpdateValue,maskForSearch:m.maskForSearch,searchShow:m.searchShow},null,8,["model-value","onUpdate:modelValue","maskForSearch","searchShow"]),vue.createElementVNode("div",_hoisted_4,[m.filters?(vue.openBlock(),vue.createBlock(fe,{key:0,ref:"filter",modelValue:m.mountedFilter,"onUpdate:modelValue":b[0]||(b[0]=et=>m.mountedFilter=et),scheme:parseInt(m.windowWidth)>=1e3?m.filters:(kt=m.filters)==null?void 0:kt.map(et=>({...et,inline:!1})),isDialog:(Ze=m.filters)==null?void 0:Ze.some(et=>!(et!=null&&et.inline)),"apply-vue-router":m.applyVueRouter,history:"",view:"plain",clearable:!1,name:"filter",onFilterChange:b[1]||(b[1]=async et=>{await m.handleFilterChange(et),await m.updateTableAndMap()})},{button:vue.withCtx(({visible:et})=>[vue.createElementVNode("button",{type:"button",class:vue.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",[et?"border border-blue-600 border-2":"border border-gray-200"]])},[vue.createVNode(c),vue.createTextVNode(" Фільтри "),m.activeFiltersCount>=1?(vue.openBlock(),vue.createElementBlock("span",_hoisted_5,vue.toDisplayString(m.activeFiltersCount),1)):vue.createCommentVNode("",!0)],2)]),_:1},8,["modelValue","scheme","isDialog","apply-vue-router"])):vue.createCommentVNode("",!0)])]),vue.createElementVNode("div",_hoisted_6,[vue.renderSlot(m.$slots,"buttons"),vue.createElementVNode("button",{type:"button",class:"map-visible-button py-2 px-2 hidden min-[1001px]: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:m.isMapVisible?"Приховати карту":"Показати карту",onClick:b[2]||(b[2]=(...et)=>m.toggleMapVisible&&m.toggleMapVisible(...et))},[m.isMapVisible?(vue.openBlock(),vue.createBlock(_e,{key:0})):(vue.openBlock(),vue.createBlock(ye,{key:1})),_hoisted_8],8,_hoisted_7),vue.createElementVNode("div",_hoisted_9,[vue.createElementVNode("button",{onClick:b[3]||(b[3]=et=>m.isMapVisible=!1),class:"py-2 px-2 h-[38px] 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"},[vue.createVNode(ae)]),vue.createElementVNode("button",{onClick:b[4]||(b[4]=et=>m.isMapVisible=!0),class:"py-2 px-2 h-[38px] 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"},[vue.createVNode(oe)])])])])),vue.createElementVNode("div",_hoisted_10,[vue.withDirectives(vue.createElementVNode("div",{class:vue.normalizeClass(["relative overflow-hidden",m.isMapVisible?"w-2/4 mr-0":"w-full mr-3",m.isSelectObj?"hidden":""])},[(Ct=m.$slots)!=null&&Ct.header?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("h1",_hoisted_11,[vue.createElementVNode("span",_hoisted_12,vue.toDisplayString(m.title),1),vue.createElementVNode("span",_hoisted_13,vue.toDisplayString(m.total),1),_hoisted_14])),vue.createElementVNode("div",_hoisted_15,[m.activeFilters?(vue.openBlock(),vue.createElementBlock("div",_hoisted_16,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(m.activeFilters,(et,Tt,nr)=>(vue.openBlock(),vue.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:nr},[vue.createElementVNode("span",_hoisted_17,vue.toDisplayString(m.getLabelById(Tt)),1),_hoisted_18,vue.createElementVNode("span",_hoisted_19,vue.toDisplayString(m.getOptionsLabelById(Tt,et)),1),vue.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:si=>m.clearFilter(Tt)},[vue.createVNode(at)],8,_hoisted_20)]))),128)),((xt=Object.keys(m.activeFilters))==null?void 0:xt.length)>=2?(vue.openBlock(),vue.createElementBlock("span",_hoisted_21,[_hoisted_22,vue.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:b[5]||(b[5]=et=>m.mountedFilter={})},[vue.createVNode(at)])])):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),m.total>=1?vue.renderSlot(m.$slots,"table",{key:1,rows:m.tableData,map:m.map,marker:m.marker,selectRow:m.selectRow,getData:m.getData,addGeomMarker:m.addGeomMarker,isMapVisible:m.isMapVisible}):(vue.openBlock(),vue.createElementBlock("div",_hoisted_23,[vue.createVNode(Ve),_hoisted_24,_hoisted_25,vue.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:b[6]||(b[6]=(...et)=>m.resetFilters&&m.resetFilters(...et))}," Очистити дані пошуку ")]))]),m.total>=1?(vue.openBlock(),vue.createElementBlock("hr",_hoisted_26)):vue.createCommentVNode("",!0),m.total>=1?(vue.openBlock(),vue.createElementBlock("div",_hoisted_27,[vue.createElementVNode("div",_hoisted_28,[vue.createVNode(Xe,{total:m.total,maxPages:7,defaultPage:m.currentPage,pageSize:m.limit,goTo:!1,size:"medium",onPageChange:m.handlePageChange,backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[10,20,30],onPageSizeChange:m.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])):vue.createCommentVNode("",!0)],2),[[vue.vShow,parseInt(m.windowWidth)>=1e3?!0:!m.isMapVisible]]),m.isSelectObj?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(m.isMapVisible?"w-full fixed lg:static lg:w-1/2 mr-0 pb-5":"w-full pb-5 mr-3"),style:{height:"calc(100vh - 152px)"}},[vue.renderSlot(m.$slots,"details",{table:m.table,selectedId:m.selectedId,selectedRow:m.selectedRow,map:m.map,closeObjCard:m.closeObjCard,isMapVisible:m.isMapVisible})],2)):vue.createCommentVNode("",!0),vue.withDirectives(vue.createElementVNode("div",_hoisted_29,[vue.createElementVNode("section",_hoisted_30,[vue.renderSlot(m.$slots,"default",{map:m.map,removeSelectedBaseLayer:()=>m.selectedBaseLayer="",selectedBaseLayer:m.selectedBaseLayer,selectedRow:m.selectedRow}),vue.createVNode(Fe,{height:"calc(100vh - 152px)",width:"w-2/4",table:m.table,filtersParam:m.filtersParam,row:m.selectedRow,legendname:m.legendname,legend:m.legend,colorAttr:m.colorAttr,strokeAttr:m.strokeAttr,polygonOpacity:m.polygonOpacity,maxBounds:m.maxBounds,center:m.center,zoom:m.zoom,dashedLine:m.dashedLine,minZoom:m.minZoom,basemap:m.basemap,pointZoom:m.pointZoom,defaultColor:m.defaultColor,onMap:b[7]||(b[7]=et=>m.map=et),selectedBaseLayer:m.selectedBaseLayer,"onUpdate:selectedBaseLayer":b[8]||(b[8]=et=>m.selectedBaseLayer=et),onIsCompareOpen:b[9]||(b[9]=et=>m.isCompareOpen=et)},{default:vue.withCtx(({hoverData:et})=>[vue.renderSlot(m.$slots,"popup",{data:et})]),_:3},8,["table","filtersParam","row","legendname","legend","colorAttr","strokeAttr","polygonOpacity","maxBounds","center","zoom","dashedLine","minZoom","basemap","pointZoom","defaultColor","selectedBaseLayer"])])],512),[[vue.vShow,m.isMapVisible]])])])])}const VsPartsMap=_export_sfc(_sfc_main,[["render",_sfc_render]]),install=m=>{m.component("VsPartsMap",VsPartsMap)},PartsMap={install,components:{VsPartsMap}};return typeof window<"u"&&(window.PartsMap=PartsMap),PartsMap});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/partsmap",
3
- "version": "0.0.99",
3
+ "version": "0.0.100",
4
4
  "type": "module",
5
5
  "description": "partsmap-plugins",
6
6
  "main": "dist/PartsMap.js",