@evergis/api 3.0.185 → 3.0.186
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/LICENSE +20 -20
- package/README.md +21 -21
- package/dist/__generated__/data-contracts.d.ts +190 -190
- package/dist/api.cjs.development.js +16 -8
- package/dist/api.cjs.development.js.map +1 -1
- package/dist/api.cjs.production.min.js +1 -1
- package/dist/api.cjs.production.min.js.map +1 -1
- package/dist/api.esm.js +204 -196
- package/dist/api.esm.js.map +1 -1
- package/dist/services/Projects.d.ts +1 -1
- package/dist/services/Tables.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@evergis/event-emitter"),n=require("ky"),r=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,s=require("@microsoft/signalr"),i=require("query-string"),o=require("nanoid"),a=require("@evergis/sgis/es/painters/DomPainter/DomPainter"),u=require("@evergis/sgis/es/Map"),l=require("@evergis/sgis/es/layers/TileLayer"),c=require("@evergis/sgis/es/Crs"),p=require("@evergis/sgis/es/layers/DynamicLayer"),h=require("@evergis/sgis");function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function v(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),e}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function k(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){if(null==e)return{};var n,r,s={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(s[n]=e[n]);return s}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?b(e):t}function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=g(e);if(t){var s=g(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return x(this,n)}}function T(e,t,n){return(T="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=g(e)););return e}(e,t);if(r){var s=Object.getOwnPropertyDescriptor(r,t);return s.get?s.get.call(n):s.value}})(e,t,n||e)}let j=function(){function e(t){var n;void 0===t&&(t={}),y(this,e),this.ky=r.extend(t),this.prefixUrl=(null==(n=t.prefixUrl)?void 0:n.toString())||""}return v(e,[{key:"extend",value:function(e){var t;this.ky=r.extend(e),this.prefixUrl=(null==(t=e.prefixUrl)?void 0:t.toString())||""}},{key:"get",value:function(e,t){return this.ky.get(this.stripSlashes(e),{searchParams:P(t)})}},{key:"post",value:function(e,t,n){const r=S(n,t);return this.ky.post(this.stripSlashes(e),r)}},{key:"put",value:function(e,t,n){const r=S(n,t);return this.ky.put(this.stripSlashes(e),r)}},{key:"patch",value:function(e,t,n){const r=S(n,t);return this.ky.patch(this.stripSlashes(e),r)}},{key:"delete",value:function(e,t,n){const r=S(n,t);return this.ky.delete(this.stripSlashes(e),r)}},{key:"createUrl",value:function(e,t){const n=t?"?"+P(t):"";return this.prefixUrl+this.stripSlashes(e)+n}},{key:"stripSlashes",value:function(e){return this.prefixUrl?e.replace(/^\//g,""):e}}]),e}();function S(e,t){const n={searchParams:P(e)};var r;return void 0!==(r=t)&&"object"==typeof r&&null!==r&&r.constructor===Object||Array.isArray(t)?n.json=t:n.body=t,n}function P(e){return void 0===e&&(e={}),i.stringify(e,{arrayFormat:"comma"})}function I(e){return e instanceof FormData?e:Object.keys(e).reduce((t,n)=>(t.append(n,e[n]),t),new FormData)}let L=v((function e(t){y(this,e),this.http=t})),R=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"createToken",value:function(e){return this.http.put("/accessToken/"+e,null).text()}},{key:"disableToken",value:function(e){return this.http.post("/accessToken/"+e+"/disable",null).then(()=>{})}},{key:"enableToken",value:function(e){return this.http.post("/accessToken/"+e+"/enable",null).then(()=>{})}},{key:"revokeToken",value:function(e){return this.http.delete("/accessToken/"+e,null).then(()=>{})}}]),n}(),C=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getAvailiableCs",value:function(){return this.http.get("/srs/list").json()}},{key:"getProj4Representation",value:function(e){return this.http.get("/srs/"+e+"/proj4").text()}},{key:"getWktRepresentation",value:function(e){return this.http.get("/srs/"+e+"/wkt").text()}}]),n}();const E=["taskId","layerName"];let U=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getSearchResult",value:function(e){let{taskId:t,layerName:n}=e,r=m(e,E);return this.http.get("/search/"+t+"/"+n,r).json()}},{key:"getSearchResult1",value:function(e){return this.http.get("/search/"+e).json()}}]),n}(),F=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getAll",value:function(e){return this.http.get("/resources",e).json()}},{key:"searchResources",value:function(e,t){return this.http.post("/resources/search",t,e).json()}},{key:"getResource",value:function(e){return this.http.get("/resources/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/resources/"+e,null).then(()=>{})}},{key:"moveResource",value:function(e,t){return this.http.post("/resources/"+e+"/move",t).json()}},{key:"createDirectory",value:function(e){return this.http.post("/resources/directory",e).json()}},{key:"createFile",value:function(e){return this.http.post("/resources/file",I(e)).json()}},{key:"getPermissions",value:function(e){return this.http.get("/resources/"+e+"/permissions").json()}},{key:"setPermissions",value:function(e,t){return this.http.put("/resources/"+e+"/permissions",t).json()}},{key:"downloadFile",value:function(e){return this.http.get("/resources/"+e+"/download").blob()}}]),n}();var N;(N=exports.ApiEvent||(exports.ApiEvent={})).ConnectionLost="ConnectionLost",N.Unauthorized="Unauthorized",N.SessionClosed="SessionClosed";let A=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getUsers",value:function(e){return this.http.get("/account/user/list",e).json()}},{key:"getExtendedUsers",value:function(e){return this.http.get("/account/user/extendedlist",e).json()}},{key:"getUserInfo",value:function(e){return this.http.get("/account/"+e).json()}},{key:"getExtendedUserInfo",value:function(e){return this.http.get("/account/extended/"+e).json()}},{key:"isUsernameExists",value:function(e){return this.http.get("/account/user/exists",e).json()}},{key:"isEmailExists",value:function(e){return this.http.get("/account/user/email/exists",e).json()}},{key:"registerUser",value:function(e){return this.http.post("/account/register",e).text()}},{key:"createUser",value:function(e,t){return this.http.post("/account/user",t,e).then(()=>{})}},{key:"updateUser",value:function(e){return this.http.patch("/account/user",e).then(()=>{})}},{key:"confirmEmail",value:function(e){return this.http.post("/account/user/"+e+"/email/confirm",null).then(()=>{})}},{key:"verifyEmail",value:function(e){return this.http.post("/account/user/"+e+"/email/verify",null).then(()=>{})}},{key:"setEmail",value:function(e){return this.http.post("/account/setEmail",I(e)).then(()=>{})}},{key:"confirmEmail1",value:function(e){return this.http.post("/account/user/email/confirm",null,e).then(()=>{})}},{key:"changeEmail",value:function(e){return this.http.post("/account/user/email/change",null,e).then(()=>{})}},{key:"confirmChangeEmail",value:function(e){return this.http.post("/account/user/email/change/confirm",null,e).then(()=>{})}},{key:"setUserPassword",value:function(e){return this.http.patch("/account/password/set",e).then(()=>{})}},{key:"changePassword",value:function(e){return this.http.patch("/account/password/change",I(e)).then(()=>{})}},{key:"resetPassword",value:function(e){return this.http.post("/account/password/reset",null,e).then(()=>{})}},{key:"resetPasswordCallback",value:function(e){return this.http.post("/account/password/reset/confirm",I(e)).then(()=>{})}},{key:"removeUser",value:function(e){return this.http.delete("/account/user/"+e,null).then(()=>{})}},{key:"activateUser",value:function(e){return this.http.post("/account/user/"+e+"/activate",null).then(()=>{})}},{key:"deactivateUser",value:function(e){return this.http.post("/account/user/"+e+"/deactivate",null).then(()=>{})}},{key:"authenticate",value:function(e){return this.http.post("/account/login",e).text()}},{key:"refreshToken",value:function(){return this.http.post("/account/refresh-token",null).text()}},{key:"revokeToken",value:function(){return this.http.delete("/account/revoke-token",null).then(()=>{})}},{key:"ldapLogin",value:function(e){return this.http.post("/account/external/login/ldap",e).then(()=>{})}},{key:"getRoles",value:function(e){return this.http.get("/account/role/list",e).json()}},{key:"createRole",value:function(e){return this.http.post("/account/role",e).then(()=>{})}},{key:"updateRole",value:function(e){return this.http.patch("/account/role",e).then(()=>{})}},{key:"removeRole",value:function(e){return this.http.delete("/account/role/"+e,null).then(()=>{})}},{key:"addToRole",value:function(e,t){return this.http.post("/account/user/"+e+"/role/"+t,null).then(()=>{})}},{key:"removeFromRole",value:function(e,t){return this.http.delete("/account/user/"+e+"/role/"+t,null).then(()=>{})}},{key:"postUsedProjects",value:function(e){return this.http.post("/account/latest_projects",e).json()}},{key:"getUsedProjects",value:function(){return this.http.get("/account/latest_projects").json()}},{key:"truncateUsedProjects",value:function(){return this.http.delete("/account/latest_projects",null).then(()=>{})}}]),n}();const D=()=>JSON.parse(localStorage.getItem("@evergis/user-info")||"null")||void 0,O=e=>{if(e){const t=D();localStorage.setItem("@evergis/user-info",JSON.stringify(d({},t,e)))}else localStorage.removeItem("@evergis/user-info")};let B=function(e){k(n,A);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"login",value:async function(e){e&&await T(g(n.prototype),"authenticate",this).call(this,e)}},{key:"fetchCurrentUser",value:async function(){return this.userInfo=await this.getUserInfo(""),this.userInfo}},{key:"username",get:function(){var e;return(null==(e=this.userInfo)?void 0:e.username)||""}},{key:"logout",value:async function(){await this.revokeToken(),O(void 0),this.userInfo={}}},{key:"updateCurrentUser",value:async function(e){await T(g(n.prototype),"updateUser",this).call(this,d({username:this.username},e)),O(e)}},{key:"setPassword",value:function(e){return this.setUserPassword({username:this.username,password:e})}},{key:"isAuth",get:function(){var e;return!(null==(e=this.userInfo)||!e.username)&&"public"!==this.userInfo.username}},{key:"user",get:function(){if(this.userInfo)return this.userInfo;const e=D();return e&&(this.userInfo=e),e}}]),n}();const M=["username"];let q=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getPreview",value:function(e){return this.http.createUrl("/account/user/preview/"+e)}},{key:"uploadPreview",value:function(e,t){let{username:n}=e,r=m(e,M);return this.http.post("/account/user/preview/"+n,I(t),r).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/account/user/preview/"+e,null).then(()=>{})}}]),n}(),_=function(e){k(n,q);var t=w(n);function n(e,r){var s;return y(this,n),(s=t.call(this,e)).userInfo=r,s}return v(n,[{key:"user",get:function(){if(this.userInfo)return this.userInfo;const e=D();return e&&(this.userInfo=e),e}},{key:"username",get:function(){var e;return(null==(e=this.userInfo)?void 0:e.username)||""}},{key:"updateCurrentUserPhoto",value:async function(e,t){const{fileId:n}=await this.uploadPreview(d({username:this.username},t),{file:e});O({profile_photo:n,has_profile_photo:!0})}},{key:"fetchPreview1",value:async function(){var e;const t=this.getPreview(""),n=await fetch(t),r=null!=(e=n.headers.get("content-type"))&&e.includes("text/plain")?await n.text():t+"?r="+Math.random();O({profile_photo:r,has_profile_photo:!0})}},{key:"deleteCurrentUserPhoto",value:async function(){await this.deletePreview(this.username),O({profile_photo:"",has_profile_photo:!1})}}]),n}(),W=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"batchResourcesPermissionsSet",value:function(e){return this.http.put("/bulk/resources/permissions",e).json()}}]),n}(),H=function(e){k(n,W);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const G=["cameraId"],V=["cameraId"],z=["cameraId"],J=["cameraId"],Q=["cameraId"],K=["cameraId"];let X=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getCameras",value:function(e){return this.http.get("/cameras",e).json()}},{key:"getArchiveFeed",value:function(e){let{cameraId:t}=e,n=m(e,G);return this.http.get("/cameras/"+t+"/archiveFeed",n).blob()}},{key:"getArchiveTimeline",value:function(e){let{cameraId:t}=e,n=m(e,V);return this.http.get("/cameras/"+t+"/archiveTimeline",n).json()}},{key:"getArchiveCalendar",value:function(e){let{cameraId:t}=e,n=m(e,z);return this.http.get("/cameras/"+t+"/archiveCalendar",n).json()}},{key:"getArchiveSnapshot",value:function(e){let{cameraId:t}=e,n=m(e,J);return this.http.get("/cameras/"+t+"/archiveSnapshot",n).blob()}},{key:"getLiveFeed",value:function(e){let{cameraId:t}=e,n=m(e,Q);return this.http.get("/cameras/"+t+"/liveFeed",n).blob()}},{key:"getLiveSnapshot",value:function(e){return this.http.get("/cameras/"+e+"/liveSnapshot").blob()}},{key:"getLivePreviewStream",value:function(e){let{cameraId:t}=e,n=m(e,K);return this.http.get("/cameras/"+t+"/getLivePreviewsStream",n).json()}}]),n}(),Y=function(e){k(n,X);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),Z=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getConfigurationsList",value:function(e){return this.http.get("/settings/config",e).json()}},{key:"getConfiguration",value:function(e){return this.http.get("/settings",e).text()}},{key:"setConfiguration",value:function(e,t){return this.http.post("/settings",t,e).then(()=>{})}},{key:"removeConfiguration",value:function(e){return this.http.delete("/settings",null,e).then(()=>{})}}]),n}(),$=function(e){k(n,Z);var t=w(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).settings={modules:[],connection:{url:""}},e}return v(n,[{key:"fetchClientSettings",value:async function(e){const t=JSON.parse(await this.getConfiguration(e));return this.updateClientSettings(t),t}},{key:"updateClientSettings",value:function(e){Object.assign(this.settings,e)}}]),n}(),ee=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getQueryResult",value:function(e){return this.http.post("/eql/query",e).then(()=>{})}},{key:"getQueryDescription",value:function(e){return this.http.post("/eql/description",e).json()}},{key:"setLayerParameterValue",value:function(e){return this.http.post("/eql/setParam",null,e).then(()=>{})}},{key:"setLayerParameters",value:function(e,t){return this.http.post("/eql/setParams",t,e).then(()=>{})}},{key:"getLayerParameters",value:function(e){return this.http.get("/eql/getParam",e).text()}},{key:"getLayerParameters1",value:function(e){return this.http.get("/eql/getParams",e).json()}},{key:"removeLayerParameterValue",value:function(e){return this.http.delete("/eql/removeParam",null,e).then(()=>{})}}]),n}(),te=function(e){k(n,ee);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),ne=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"vkLogin",value:function(){return this.http.createUrl("/account/external/login/vk")}},{key:"googleLogin",value:function(){return this.http.createUrl("/account/external/login/google")}},{key:"facebookLogin",value:function(){return this.http.createUrl("/account/external/login/facebook")}},{key:"loginCallback",value:function(){return this.http.get("/account/external/login/callback").then(()=>{})}},{key:"unbindVk",value:function(){return this.http.delete("/account/external/unbind/vk",null).then(()=>{})}},{key:"unbindGoogle",value:function(){return this.http.delete("/account/external/unbind/google",null).then(()=>{})}},{key:"unbindFacebook",value:function(){return this.http.delete("/account/external/unbind/facebook",null).then(()=>{})}},{key:"bindVk",value:function(){return this.http.createUrl("/account/external/bind/vk")}},{key:"bindGoogle",value:function(){return this.http.createUrl("/account/external/bind/google")}},{key:"bindFacebook",value:function(){return this.http.createUrl("/account/external/bind/facebook")}},{key:"bindCallback",value:function(){return this.http.get("/account/external/bind/callback").then(()=>{})}}]),n}(),re=function(e){k(n,ne);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"login",value:function(e){switch(e){case"vk":return this.vkLogin();case"google":return this.googleLogin();case"facebook":return this.facebookLogin();default:return""}}},{key:"bind",value:function(e){switch(e){case"vk":return this.bindVk();case"google":return this.bindGoogle();case"facebook":return this.bindFacebook();default:return""}}},{key:"unbind",value:function(e){switch(e){case"vk":return this.unbindVk();case"google":return this.unbindGoogle();case"facebook":return this.unbindFacebook();default:return""}}}]),n}(),se=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"increaseResourcesLimit",value:function(e){return this.http.post("/feedback/limits",null,e).json()}},{key:"moreSymbols",value:function(e){return this.http.post("/feedback/symbol",null,e).json()}},{key:"feedback",value:function(e,t){return this.http.post("/feedback",I(t),e).json()}}]),n}(),ie=function(e){k(n,se);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"postFeedback",value:function(e,t){return this.feedback(e,t)}}]),n}(),oe=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"downloadFile",value:function(e){return this.http.get("/upload/file",e).blob()}},{key:"uploadFile",value:function(e){return this.http.post("/upload/file",I(e)).json()}},{key:"deleteFile",value:function(e){return this.http.delete("/upload/file",null,e).then(()=>{})}},{key:"getFileInfo",value:function(e){return this.http.get("/upload/fileInfo",e).json()}}]),n}(),ae=function(e){k(n,oe);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"upload",value:function(e,t){return this.uploadFile({file:e,rewrite:!!t})}}]),n}(),ue=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"get",value:function(e){return this.http.get("/filters/"+e).text()}},{key:"update",value:function(e,t){return this.http.post("/filters/"+e,t).json()}},{key:"create",value:function(e){return this.http.post("/filters",e).json()}}]),n}(),le=function(e){k(n,ue);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),ce=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getServerInfo",value:function(){return this.http.get("/").json()}},{key:"getFunctionsList",value:function(){return this.http.get("/functions").json()}}]),n}(),pe=function(e){k(n,ce);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const he=["providerName"],ye=["providerName"],fe=["providerName"];let ve=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"geocode",value:function(e){let{providerName:t}=e,n=m(e,he);return this.http.get("/geocode/"+t,n).json()}},{key:"geocodeByPoint",value:function(e){let{providerName:t}=e,n=m(e,ye);return this.http.get("/geocode/"+t+"/geocodeByPoint",n).json()}},{key:"suggest",value:function(e){let{providerName:t}=e,n=m(e,fe);return this.http.get("/geocode/"+t+"/suggest",n).json()}}]),n}(),de=function(e){k(n,ve);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"geocode2Gis",value:function(e){return this.geocode(d({providerName:"geocode2gis"},e))}},{key:"suggest2Gis",value:function(e){return this.suggest(d({providerName:"geocode2gis"},e))}}]),n}(),ke=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"startTask",value:function(e){return this.http.post("/ice-router/tasks",e).text()}},{key:"getResult",value:function(e){return this.http.get("/ice-router/tasks/"+e).json()}}]),n}(),ge=function(e){k(n,ke);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),me=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getDataSchema",value:function(e){return this.http.get("/import/dataSchema",e).json()}},{key:"getFeaturesCount",value:function(e){return this.http.post("/import/count",e).json()}},{key:"readPart",value:function(e){return this.http.get("/import/read",e).then(()=>{})}},{key:"getExternalWmsLayers",value:function(e){return this.http.get("/import/wms",e).json()}},{key:"getExternalPbfLayers",value:function(e){return this.http.get("/import/pbf",e).json()}},{key:"getExternalPbfFeatures",value:function(e){return this.http.get("/import/pbf/features",e).json()}},{key:"getExternalArcgisFsLayers",value:function(e){return this.http.get("/import/arcgisfeatureservice",e).json()}},{key:"getExternalArcGisLayers",value:function(e){return this.http.get("/import/arcgismapservice",e).json()}},{key:"getRasterAttributes",value:function(e){return this.http.get("/import/rasterAttributes",e).json()}},{key:"getRasterMeta",value:function(e){return this.http.get("/import/rasterMeta",e).json()}}]),n}(),be=function(e){k(n,me);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const xe=["name"],we=["name"],Te=["name"],je=["name","id"],Se=["name","id"],Pe=["name","id"],Ie=["name","x","y","z"],Le=["name"],Re=["name"],Ce=["name"],Ee=["name"],Ue=["name"],Fe=["name"],Ne=["name"],Ae=["name"],De=["name"],Oe=["name"],Be=["name"],Me=["layerName"],qe=["name","id"];let _e=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getLayersList",value:function(e){return this.http.get("/layers",e).json()}},{key:"setPermissionsBatch",value:function(e){return this.http.put("/layers",e).then(()=>{})}},{key:"deleteResources",value:function(e){return this.http.delete("/layers",null,e).json()}},{key:"getLayerInfo",value:function(e){return this.http.get("/layers/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/layers/"+e,null).then(()=>{})}},{key:"getLayersInfo",value:function(e){return this.http.get("/layers/batchInfo",e).json()}},{key:"publishMapboxService",value:function(e){return this.http.post("/layers",e,{type:"Mapbox"}).json()}},{key:"publishProxyService",value:function(e){return this.http.post("/layers",e,{type:"ProxyService"}).json()}},{key:"publishRouteService",value:function(e){return this.http.post("/layers",e,{type:"RouteService"}).then(()=>{})}},{key:"publishLinearService",value:function(e){return this.http.post("/layers",e,{type:"LinearService"}).then(()=>{})}},{key:"publishRemoteTileService",value:function(e){return this.http.post("/layers",e,{type:"RemoteTileService"}).json()}},{key:"publishLocalTileService",value:function(e){return this.http.post("/layers",e,{type:"LocalTileService"}).json()}},{key:"publishPostgresLayerService",value:function(e){return this.http.post("/layers",e,{type:"PostgresLayerService"}).json()}},{key:"publishQueryLayerService",value:function(e){return this.http.post("/layers",e,{type:"QueryLayerService"}).json()}},{key:"publishPostgresTileCatalogService",value:function(e){return this.http.post("/layers",e,{type:"PostgresTileLayerService"}).json()}},{key:"publishStyledLayerService",value:function(e){return this.http.post("/layers",e,{type:"StyledFeatureLayer"}).json()}},{key:"updateMapboxService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"Mapbox"}).json()}},{key:"updateProxyService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"ProxyService"}).json()}},{key:"updateTileCatalogService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"PostgresTileLayerService"}).json()}},{key:"publishCompositeService",value:function(e){return this.http.post("/layers",e,{type:"CompositeService"}).json()}},{key:"updateRemoteTileService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"RemoteTileService"}).json()}},{key:"updateLocalTileService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"LocalTileService"}).json()}},{key:"updatePostgresLayerService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"PostgresLayerService"}).json()}},{key:"updateQueryLayerService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"QueryLayerService"}).json()}},{key:"updateCompositeService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"CompositeService"}).json()}},{key:"reloadService",value:function(e){return this.http.get("/layers/"+e+"/reload").json()}},{key:"getFeatures",value:function(e,t){return this.http.post("/layers/"+e+"/features/query",t).json()}},{key:"getFeatures1",value:function(e){let{name:t}=e,n=m(e,xe);return this.http.get("/layers/"+t+"/features",n).json()}},{key:"deleteFeature",value:function(e){let{name:t}=e,n=m(e,we);return this.http.delete("/layers/"+t+"/features",null,n).json()}},{key:"createFeatures",value:function(e,t){return this.http.post("/layers/"+e+"/features",t).json()}},{key:"updateFeature",value:function(e,t){return this.http.patch("/layers/"+e+"/features",t).json()}},{key:"featuresContains",value:function(e){let{name:t}=e,n=m(e,Te);return this.http.get("/layers/"+t+"/features/contains",n).json()}},{key:"getById",value:function(e){let{name:t,id:n}=e,r=m(e,je);return this.http.get("/layers/"+t+"/features/"+n,r).json()}},{key:"unite",value:function(e,t){let{name:n,id:r}=e,s=m(e,Se);return this.http.post("/layers/"+n+"/features/"+r+"/unite",t,s).json()}},{key:"subtract",value:function(e,t){let{name:n,id:r}=e,s=m(e,Pe);return this.http.post("/layers/"+n+"/features/"+r+"/subtract",t,s).json()}},{key:"getTilesLayerImage",value:function(e){let{name:t,x:n,y:r,z:s}=e,i=m(e,Ie);return this.http.createUrl("/layers/"+t+"/tile/"+s+"/"+n+"/"+r,i)}},{key:"getLayerImage",value:function(e){let{name:t}=e,n=m(e,Le);return this.http.createUrl("/layers/"+t+"/export",n)}},{key:"getLayerExtent",value:function(e){let{name:t}=e,n=m(e,Re);return this.http.get("/layers/"+t+"/extent",n).json()}},{key:"getByGeometry",value:function(e){let{name:t}=e,n=m(e,Ce);return this.http.get("/layers/"+t+"/features/getByGeometry",n).json()}},{key:"getByGeometryPost",value:function(e,t){let{name:n}=e,r=m(e,Ee);return this.http.post("/layers/"+n+"/features/getByGeometry",t,r).json()}},{key:"deleteFeatures",value:function(e){let{name:t}=e,n=m(e,Ue);return this.http.delete("/layers/"+t+"/features/deleteByIds",null,n).json()}},{key:"deleteByCondition",value:function(e){let{name:t}=e,n=m(e,Fe);return this.http.delete("/layers/"+t+"/features/deleteByCondition",null,n).json()}},{key:"getByGeometryGet",value:function(e){let{name:t}=e,n=m(e,Ne);return this.http.get("/layers/"+t+"/features/getByGeometryByClick",n).json()}},{key:"classify",value:function(e){let{name:t}=e,n=m(e,Ae);return this.http.get("/layers/"+t+"/classify",n).json()}},{key:"distincts",value:function(e){let{name:t}=e,n=m(e,De);return this.http.get("/layers/"+t+"/distincts",n).json()}},{key:"aggregateAttribute",value:function(e){let{name:t}=e,n=m(e,Oe);return this.http.get("/layers/"+t+"/aggregate-values",n).json()}},{key:"getFilteredFeaturesCount",value:function(e){let{name:t}=e,n=m(e,Be);return this.http.get("/layers/"+t+"/features/count",n).json()}},{key:"getFilteredFeaturesCount1",value:function(e,t){return this.http.post("/layers/"+e+"/features/count",t).json()}},{key:"editAttributes",value:function(e,t){return this.http.post("/layers/"+e+"/features/edit-attributes",t).json()}},{key:"selectFeatures",value:function(e){return this.http.get("/layers/features/select",e).json()}},{key:"validateExpression",value:function(e){let{layerName:t}=e,n=m(e,Me);return this.http.get("/layers/"+t+"/validateExpression",n).json()}},{key:"getRasterMeta",value:function(e){let{name:t,id:n}=e,r=m(e,qe);return this.http.get("/layers/"+t+"/"+n+"/metadata",r).json()}},{key:"createRoute",value:function(e,t){return this.http.post("/layers/"+e+"/createRoute",t).json()}},{key:"applyStyle",value:function(e,t){return this.http.put("/layers/"+e+"/style",t).then(()=>{})}},{key:"getStyle",value:function(e){return this.http.get("/layers/"+e+"/style").json()}},{key:"getImageLayout",value:function(e){return this.http.get("/layers/"+e+"/style/sprite.png").blob()}},{key:"getDataLayout",value:function(e){return this.http.get("/layers/"+e+"/style/sprite.json").blob()}},{key:"getPreview",value:function(e){return this.http.createUrl("/layers/"+e+"/preview")}},{key:"setPreview",value:function(e,t){return this.http.post("/layers/"+e+"/preview",I(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/layers/"+e+"/preview",null).then(()=>{})}},{key:"isExists",value:function(e){return this.http.get("/layers/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/layers/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/layers/"+e+"/references").json()}},{key:"getPermissions",value:function(e){return this.http.get("/layers/"+e+"/permissions").json()}},{key:"addPermissions",value:function(e,t){return this.http.post("/layers/"+e+"/permissions",t).json()}},{key:"setPermissions",value:function(e,t){return this.http.put("/layers/"+e+"/permissions",t).json()}},{key:"removePermissions",value:function(e,t){return this.http.delete("/layers/"+e+"/permissions/"+t,null).json()}}]),n}();async function We(e){return(await Promise.all(e.map(e=>e.catch(e=>He(e)?e:new Error(e))))).filter(Ge)}function He(e){return e instanceof Error}function Ge(e){return!He(e)}const Ve=["remote"],ze=["remote"];let Je=function(e){k(n,_e);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getLayerInfos",value:function(e){return We(e.map(e=>this.getLayerInfo(e)))}},{key:"getLayersDeps",value:function(e){return We(e.map(e=>this.getResourceDependencies(e)))}},{key:"getBasemaps",value:function(e){return this.getLayersList(d({},e,{types:["LocalTileService","RemoteTileService"]}))}},{key:"createSubLayer",value:function(e){return this.publishStyledLayerService(e)}},{key:"createTileLayer",value:function(e){let{remote:t}=e,n=m(e,Ve);return t?this.publishRemoteTileService(n):this.publishLocalTileService(n)}},{key:"updateTileLayer",value:function(e){let{remote:t}=e,n=m(e,ze);return t?this.updateRemoteTileService(n.name,n):this.updateLocalTileService(n.name,n)}},{key:"uploadPreview",value:function(e,t){return this.setPreview(e,{file:t})}},{key:"findOne",value:function(e){return this.getLayerInfo(e)}},{key:"findAll",value:function(e){return this.getLayersList(e)}},{key:"create",value:function(e){return this.publishPostgresLayerService(e)}},{key:"update",value:function(e){return this.updatePostgresLayerService(e.name,e)}},{key:"createQueryLayer",value:function(e){return this.publishQueryLayerService(e)}},{key:"updateQueryLayer",value:function(e){return this.updateQueryLayerService(e.name,e)}},{key:"createProxyLayer",value:function(e){return this.publishProxyService(e)}},{key:"updateProxyLayer",value:function(e){return this.updateProxyService(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}();var Qe;(Qe=exports.ErrorReason||(exports.ErrorReason={})).HTTP_OTHER="other",Qe.HTTP_CLIENT="client",Qe.HTTP_SERVER="server",Qe.UNKNOWN="unknown";const Ke=e=>e instanceof n.HTTPError?(e=>{const t=e.response.status;let n=exports.ErrorReason.HTTP_OTHER;return t>=400&&t<500&&(n=exports.ErrorReason.HTTP_CLIENT),t>=500&&(n=exports.ErrorReason.HTTP_SERVER),{type:"http",reason:n,status:t,origin:e}})(e):(e=>({type:"base",reason:exports.ErrorReason.UNKNOWN,origin:e}))(e),Xe=e=>e&&e.type&&e.reason;function Ye(e){return function(t){return!!t.type&&e.includes(t.type)}}const Ze=Ye(["PostgresLayerService","PostgresTileLayerService","QueryLayerService"]);function $e(e){return"string"==typeof e}function et(e,t,n){return n.indexOf(e)===t}const tt=o.customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789",12);(exports.ResourceSeparator||(exports.ResourceSeparator={})).Server=".";let nt=function(){function e(t){let{account:n}=t;y(this,e),this.account=n}return v(e,[{key:"createId",value:function(){return tt()}},{key:"createResourceName",value:function(e){void 0===e&&(e={});const t=e.workspace||this.account.user&&this.account.user.namespace||"",n=e.name||this.createId(),r=e.separator||exports.ResourceSeparator.Server;return t||console.warn("Resource should have workspace. Check account api"),""+t+r+n}},{key:"createTempResourceName",value:function(e){return void 0===e&&(e={}),this.createResourceName(d({workspace:"temp"},e))}},{key:"extractResource",value:function(e){if(e&&e.includes(exports.ResourceSeparator.Server)){const t=e.split(exports.ResourceSeparator.Server),n=t.pop();return{workspace:t.join(exports.ResourceSeparator.Server),name:n}}return{name:"",workspace:""}}},{key:"extractResourceName",value:function(e){return this.extractResource(e).name||e||""}},{key:"extractResourceWorkspace",value:function(e){return this.extractResource(e).workspace||""}}]),e}(),rt=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getNamespaces",value:function(e){return this.http.get("/namespaces",e).json()}},{key:"createNamespace",value:function(e){return this.http.post("/namespaces",null,e).json()}},{key:"getNamespace",value:function(e){return this.http.get("/namespaces/"+e).json()}},{key:"removeNamespace",value:function(e){return this.http.delete("/namespaces/"+e,null).then(()=>{})}}]),n}(),st=function(e){k(n,rt);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),it=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getSubscriptionList",value:function(){return this.http.get("/notifications/subscribes").json()}},{key:"subscribeOperation",value:function(e){return this.http.post("/notifications/subscribes",null,e).then(()=>{})}},{key:"unsubscribeOperation",value:function(e){return this.http.delete("/notifications/subscribes",null,e).then(()=>{})}},{key:"subscribeListOperation",value:function(e){return this.http.post("/notifications/subscribe-list",e).then(()=>{})}},{key:"unsubscribeListOperation",value:function(e){return this.http.post("/notifications/unsubscribe-list",e).then(()=>{})}}]),n}();var ot;(ot=exports.ConnectionStatus||(exports.ConnectionStatus={})).Initialized="Initialized",ot.Connected="Connected",ot.Break="Break",ot.Lost="Lost",ot.SessionClosed="SessionClosed";let at=function(e){k(r,it);var n=w(r);function r(e,s,i){var o;return void 0===i&&(i=!1),y(this,r),(o=n.call(this,e)).api=s,o.MAX_WS_RECONNECT_TRIES=10,o.keepAlive=!1,o.reconnectTries=0,o.subscriptions=[],o._connectStatus=exports.ConnectionStatus.Initialized,o.onWsConnected=()=>{o.connectStatus=exports.ConnectionStatus.Connected,o.keepAlive&&(o.keepAliveTimeout=setInterval(()=>{o.ws&&o.ws.send(JSON.stringify({keepAlive:!0}))},5e3))},o.onWsClosed=e=>{4001===e.code||4002===e.code?o.connectStatus=exports.ConnectionStatus.SessionClosed:o.reconnectTries<o.MAX_WS_RECONNECT_TRIES?(o.connectStatus=exports.ConnectionStatus.Break,o.reconnectTries++,o.ws&&(o.ws.onopen=null,o.ws.onclose=null,o.ws.onmessage=null,o.ws=void 0),o.keepAliveTimeout&&clearInterval(o.keepAliveTimeout),setTimeout(()=>{o.connect()},0)):o.connectStatus=exports.ConnectionStatus.Lost},o.onWsMessage=e=>{let t={};try{t=JSON.parse(e.data)}catch(e){console.debug("Failed to parse ws message from sp.")}if("notification"===t.type&&t.data){const{tag:e,data:n}=t.data;e&&o.emitter.emit(e,new ut(n))}},o.emitter=new t.EventEmitter,o.keepAlive=i,o}return v(r,[{key:"connectStatus",get:function(){return this._connectStatus},set:function(e){this.emitter.emit("ConnectionStatus",new ut(e)),this._connectStatus=e}},{key:"currentWs",get:function(){return this.ws}},{key:"on",value:function(e,t){this.emitter.on(e,t)}},{key:"off",value:function(e,t){this.emitter.off(e,t)}},{key:"subscribe",value:async function(e){this.subscriptions.push(e),setTimeout(()=>{!this.api.isShared&&this.subscriptions.length&&this.subscribeListOperation(this.subscriptions),this.subscriptions=[]},500)}},{key:"unsubscribe",value:async function(e){if((await this.getSubscriptionList()).includes(e))return this.unsubscribeOperation({tag:e})}},{key:"connectWs",value:function(e){const t=e.replace("http://","ws://").replace("https://","wss://");this.wsUrl=t,this.connect()}},{key:"connect",value:function(){this.wsUrl?(this.ws=new WebSocket(this.wsUrl),this.ws.onopen=this.onWsConnected,this.ws.onclose=this.onWsClosed,this.ws.onmessage=this.onWsMessage):console.warn("Connection to WebSocket not allowed. wsUrl not provided")}}]),r}(),ut=v((function e(t){y(this,e),this.data=t})),lt=function(e){k(n,Z);var t=w(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).config=null,e}return v(n,[{key:"fetchPortalSettings",value:async function(e){return this.config=JSON.parse(await this.getConfiguration(e)),this.config}}]),n}(),ct=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"print",value:function(e){return this.http.post("/print/print",e).blob()}},{key:"printToHtml",value:function(e){return this.http.post("/print/printHtml",e).text()}},{key:"uploadTemplate",value:function(e,t){return this.http.post("/print/templates",I(t),e).then(()=>{})}},{key:"getTemplates",value:function(){return this.http.get("/print/templates").json()}},{key:"deleteTemplate",value:function(e){return this.http.delete("/print/templates/"+e,null).then(()=>{})}},{key:"getTemplate",value:function(e){return this.http.get("/print/templates/"+e).text()}}]),n}(),pt=function(e){k(n,ct);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),ht=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getProjectsList",value:function(e){return this.http.get("/projects",e).json()}},{key:"createProject",value:function(e){return this.http.post("/projects",e).json()}},{key:"setPermissionsBatch",value:function(e){return this.http.put("/projects",e).then(()=>{})}},{key:"deleteResources",value:function(e){return this.http.delete("/projects",null,e).json()}},{key:"updateProject",value:function(e,t){return this.http.patch("/projects/"+e,t).json()}},{key:"getProjectInfo",value:function(e){return this.http.get("/projects/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/projects/"+e,null).then(()=>{})}},{key:"getProjectsInfo",value:function(e){return this.http.get("/projects/batchInfo",e).json()}},{key:"getProjectLayersExtendedInfo",value:function(e){return this.http.get("/projects/"+e+"/extended-info").json()}},{key:"getTilesLayerImage",value:function(e,t,n,r){return this.http.createUrl("/projects/"+e+"/tile/"+r+"/"+t+"/"+n)}},{key:"getPreview",value:function(e){return this.http.createUrl("/projects/"+e+"/preview")}},{key:"setPreview",value:function(e,t){return this.http.post("/projects/"+e+"/preview",I(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/projects/"+e+"/preview",null).then(()=>{})}},{key:"isExists",value:function(e){return this.http.get("/projects/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/projects/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/projects/"+e+"/references").json()}},{key:"getPermissions",value:function(e){return this.http.get("/projects/"+e+"/permissions").json()}},{key:"addPermissions",value:function(e,t){return this.http.post("/projects/"+e+"/permissions",t).json()}},{key:"setPermissions",value:function(e,t){return this.http.put("/projects/"+e+"/permissions",t).json()}},{key:"removePermissions",value:function(e,t){return this.http.delete("/projects/"+e+"/permissions/"+t,null).json()}}]),n}(),yt=function(e){k(n,ht);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getProjectInfos",value:function(e){return We(e.map(e=>this.getProjectInfo(e)))}},{key:"getProjectsDeps",value:function(e){return We(e.map(e=>this.getResourceDependencies(e)))}},{key:"uploadPreview",value:function(e,t){return this.setPreview(e,{file:t})}},{key:"findOne",value:function(e){return this.getProjectInfo(e)}},{key:"findAll",value:function(e){return this.getProjectsList(e)}},{key:"create",value:function(e){return this.createProject(e)}},{key:"update",value:function(e){return this.updateProject(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}(),ft=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"checkLimits",value:function(e){return this.http.get("/resources/checkLimits",e).json()}},{key:"copyResources",value:function(e){return this.http.post("/resources/copy",e).json()}}]),n}(),vt=function(e){k(n,ft);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();var dt;(dt=exports.DependencyType||(exports.DependencyType={})).Layer="Layer",dt.Table="Table",dt.Project="Project";let kt=function(){function e(t,n,r){y(this,e),this.projects=t,this.layers=n,this.tables=r}return v(e,[{key:"getProjectInfosWithDeps",value:async function(e){const t=await this.projects.getProjectInfos(e),n=await this.projects.getProjectsDeps(e),{layers:r,tables:s}=await this.getDependencies(n,!0,!0);return{projects:t,deps:{layers:r,tables:s}}}},{key:"getLayerInfosWithDeps",value:async function(e){const t=await this.layers.getLayerInfos(e),n=await this.layers.getLayersDeps(e),{tables:r}=await this.getDependencies(n,!1,!0);return{layers:t,deps:{tables:r}}}},{key:"getDependencies",value:async function(e,t,n){const{tables:r,layers:s}=e.reduce((e,r)=>{const s=r.dependencies||[];if(t){const t=this.getDependentNames(s,exports.DependencyType.Layer);e.layers.push(...t)}if(n){const t=this.getDependentNames(s,exports.DependencyType.Table);e.tables.push(...t)}return e},{tables:[],layers:[]});return{tables:await this.tables.getTableInfos(r.filter(et)),layers:await this.layers.getLayerInfos(s.filter(et))}}},{key:"getDependentNames",value:function(e,t){return e.filter(e=>{let{type:n}=e;return n===t}).map(e=>{let{name:t}=e;return t}).filter($e)}}]),e}(),gt=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getTaskList",value:function(e){return this.http.get("/scheduler/tasks",e).json()}},{key:"getTaskInfo",value:function(e){return this.http.get("/scheduler/tasks/"+e).json()}},{key:"getTaskProgress",value:function(e){return this.http.get("/scheduler/tasks/"+e+"/progress").json()}},{key:"cancelTask",value:function(e){return this.http.post("/scheduler/tasks/"+e+"/cancel",null).json()}},{key:"startCopyTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"copy"}).json()}},{key:"startAggregateTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"aggregate"}).json()}},{key:"startBufferTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"buffer"}).json()}},{key:"startPrintTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"print"}).json()}},{key:"startTilingTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"tiling"}).json()}},{key:"startTilingTask1",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"rasterVrt"}).json()}},{key:"startNetCdfTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"netcdf"}).json()}},{key:"startRouteTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"route"}).json()}},{key:"startUnionTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"union"}).json()}},{key:"startOverlayTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"overlay"}).json()}},{key:"startFilterCopyTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"filterCopy"}).json()}},{key:"startPipelineTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"pipeline"}).json()}},{key:"startEditAttributesBatch",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"editAttributes"}).json()}},{key:"universalSearchTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"universalSearch"}).json()}}]),n}(),mt=function(e){k(n,gt);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"init",value:function(e){return this.notification=e,this.notification.subscribe("server_task")}},{key:"runCopyTask",value:async function(e){const{taskId:t}=await this.startCopyTask(e);return this.processTaskId(t)}},{key:"runBufferTask",value:async function(e){const{taskId:t}=await this.startBufferTask(e);return this.processTaskId(t)}},{key:"runUnionTask",value:async function(e){const{taskId:t}=await this.startUnionTask(e);return this.processTaskId(t)}},{key:"runPrintTask",value:async function(e){const{taskId:t}=await this.startPrintTask(e);return this.processTaskId(t)}},{key:"runTilingTask",value:async function(e){const{taskId:t}=await this.startTilingTask(e);return this.processTaskId(t)}},{key:"runRouteTask",value:async function(e){const{taskId:t}=await this.startRouteTask(e);return this.processTaskId(t)}},{key:"runOverlayTask",value:async function(e){const{taskId:t}=await this.startOverlayTask(e);return this.processTaskId(t)}},{key:"runFilterCopyTask",value:async function(e){const{taskId:t}=await this.startFilterCopyTask(e);return this.processTaskId(t)}},{key:"runPipelineTask",value:async function(e){const{taskId:t}=await this.startPipelineTask(e);return this.processTaskId(t)}},{key:"runEditAttributesTask",value:async function(e){const{taskId:t}=await this.startEditAttributesBatch(e);return this.processTaskId(t)}},{key:"waitTaskCompleted",value:async function(e){return new Promise(async(t,n)=>{const r=await this.getTaskProgress(e);this.resolveTaskStatus(r,t,n);const s=async r=>{let{data:i}=r;if(i.taskId===e&&i.status&&["Completed","Failed","Canceled"].includes(i.status)){const r=await this.getTaskProgress(e);this.notification&&this.notification.off("server_task",s),this.resolveTaskStatus(r,t,n)}};this.notification&&this.notification.on("server_task",s)})}},{key:"resolveTaskStatus",value:function(e,t,n){"Completed"===e.status?t(e):"Failed"!==e.status&&"Canceled"!==e.status||n(e.status)}},{key:"processTaskId",value:function(e){if(e)return this.waitTaskCompleted(e);throw new Error("Task was started with no testId")}}]),n}(),bt=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"findUserByNameByRoles",value:function(e){return this.http.get("/security/findUsersWithRoles",e).json()}},{key:"getUsersAndRoles",value:function(e){return this.http.get("/security/usersandroles",e).json()}},{key:"findUserByName",value:function(e){return this.http.get("/security/users",e).json()}},{key:"getPolicyList",value:function(e){return this.http.get("/security/policies",e).json()}},{key:"removePolicy",value:function(e){return this.http.delete("/security/policies",null,e).then(()=>{})}},{key:"setPolicy",value:function(e){return this.http.post("/security/policies",e).then(()=>{})}}]),n}(),xt=function(e){k(n,bt);var t=w(n);function n(e,r){var s;let{username:i,roles:o}=r;return y(this,n),(s=t.call(this,e)).ownerName="",s.ownerRoles=[],s.ownerName=i,s.ownerRoles=o,s}return v(n,[{key:"reset",value:function(){this.ownerName="",this.ownerRoles=[]}}]),n}(),wt=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"statisticsDb",value:function(e){return this.http.get("/statistics",e).json()}},{key:"statisticsDb1",value:function(e){return this.http.post("/statistics",e).json()}},{key:"classify",value:function(e){return this.http.get("/statistics/classify",e).json()}},{key:"classify1",value:function(e){return this.http.post("/statistics/classify",e).json()}},{key:"sumOfProduct",value:function(e){return this.http.get("/statistics/sumOfProduct",e).json()}},{key:"sumOfProduct1",value:function(e){return this.http.post("/statistics/sumOfProduct",e).json()}}]),n}(),Tt=function(e){k(n,wt);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getStatistic",value:function(e){return this.statisticsDb(e)}},{key:"postStatistic",value:function(e){return this.statisticsDb1(e)}},{key:"getClassify",value:function(e){return this.classify(e)}},{key:"postClassify",value:function(e){return this.classify1(e)}}]),n}(),jt=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getStyle",value:function(e){return this.http.get("/styles/"+e).json()}},{key:"updateStyle",value:function(e,t){return this.http.post("/styles/"+e,t).json()}},{key:"createStyle",value:function(e){return this.http.post("/styles",e).json()}},{key:"getAllFonts",value:function(){return this.http.get("/styles/fonts").json()}},{key:"addFont",value:function(e){return this.http.post("/styles/fonts",I(e)).then(()=>{})}},{key:"removeFont",value:function(e){return this.http.delete("/styles/fonts",null,e).then(()=>{})}}]),n}(),St=function(e){k(n,jt);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const Pt=["name"],It=["name"],Lt=["name"],Rt=["name"];let Ct=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getTableList",value:function(e){return this.http.get("/tables",e).json()}},{key:"createTable",value:function(e){return this.http.post("/tables",e).json()}},{key:"setPermissionsBatch",value:function(e){return this.http.put("/tables",e).then(()=>{})}},{key:"deleteResources",value:function(e){return this.http.delete("/tables",null,e).json()}},{key:"updateTable",value:function(e,t){return this.http.patch("/tables/"+e,t).json()}},{key:"putTable",value:function(e,t){return this.http.put("/tables/"+e,t).json()}},{key:"getTableInfo",value:function(e){return this.http.get("/tables/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/tables/"+e,null).then(()=>{})}},{key:"getTablesInfo",value:function(e){return this.http.get("/tables/batchInfo",e).json()}},{key:"getTableData",value:function(e){let{name:t}=e,n=m(e,Pt);return this.http.get("/tables/"+t+"/data",n).json()}},{key:"writeTableData",value:function(e,t){return this.http.post("/tables/"+e+"/data",t).then(()=>{})}},{key:"updateTableData",value:function(e,t){let{name:n}=e,r=m(e,It);return this.http.patch("/tables/"+n+"/data",t,r).then(()=>{})}},{key:"deleteTableData",value:function(e){let{name:t}=e,n=m(e,Lt);return this.http.delete("/tables/"+t+"/data",null,n).then(()=>{})}},{key:"getUniqueDataRows",value:function(e){let{name:t}=e,n=m(e,Rt);return this.http.get("/tables/"+t+"/data/unique-values",n).json()}},{key:"mapTable",value:function(e,t){return this.http.post("/tables/map-table",t,e).json()}},{key:"unmapTable",value:function(e){return this.http.delete("/tables/map-table/"+e,null).then(()=>{})}},{key:"getPreview",value:function(e){return this.http.createUrl("/tables/"+e+"/preview")}},{key:"setPreview",value:function(e,t){return this.http.post("/tables/"+e+"/preview",I(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/tables/"+e+"/preview",null).then(()=>{})}},{key:"isExists",value:function(e){return this.http.get("/tables/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/tables/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/tables/"+e+"/references").json()}},{key:"getPermissions",value:function(e){return this.http.get("/tables/"+e+"/permissions").json()}},{key:"addPermissions",value:function(e,t){return this.http.post("/tables/"+e+"/permissions",t).json()}},{key:"setPermissions",value:function(e,t){return this.http.put("/tables/"+e+"/permissions",t).json()}},{key:"removePermissions",value:function(e,t){return this.http.delete("/tables/"+e+"/permissions/"+t,null).json()}}]),n}(),Et=function(e){k(n,Ct);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getTableInfos",value:function(e){return We(e.map(e=>this.getTableInfo(e)))}},{key:"uploadPreview",value:function(e,t){return this.setPreview(e,{file:t})}},{key:"findOne",value:function(e){return this.getTableInfo(e)}},{key:"findAll",value:function(e){return this.getTableList(e)}},{key:"create",value:function(e){return this.createTable(e)}},{key:"update",value:function(e){return this.updateTable(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}(),Ut=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),Ft=function(e){k(n,Ut);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const Nt=["name","z","x","y"];let At=function(e){k(n,L);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getVectorTile",value:function(e){let{name:t,z:n,x:r,y:s}=e,i=m(e,Nt);return this.http.get("/vt/"+t+"/"+n+"/"+r+"/"+s+".pbf",i).then(()=>{})}}]),n}(),Dt=function(e){k(n,At);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getVt",value:function(e,t,n,r,s){return this.getVectorTile({name:e,z:t,x:n,y:r,isProject:s})}}]),n}();var Ot;(Ot=exports.UrlPath||(exports.UrlPath={})).Base="/map",Ot.Shared="/shared",Ot.Portal="/portal";const Bt={401:exports.ApiEvent.Unauthorized},Mt=Object.values(exports.UrlPath),qt=Mt[0];let _t=function(e){k(i,t.EventEmitter);var r=w(i);function i(e){var t;let{url:o,wsUrl:a,wsKeepAlive:u,snappingHubUrl:l,http:c,urlPath:p,httpOptions:h}=e;y(this,i),t=r.call(this);const{hooks:f}=h||{};return t.http=c||new j(d({prefixUrl:o,timeout:!1},h||{},{hooks:d({},f||{},{beforeRequest:[...f&&f.beforeRequest||[]],afterResponse:[e=>{const r=Bt[e.status];return r&&t.emit(r,Ke(new n.HTTPError(e))),e},...f&&f.afterResponse||[]]})})),t.url=o,t.wsUrl=a||o,t.urlPath=p||t.defineUrlPath(),t.layers=new Je(t.http),t.tables=new Et(t.http),t.projects=new yt(t.http),t.resources=new kt(t.projects,t.layers,t.tables),t.styles=new St(t.http),t.account=new B(t.http),t.accountPreview=new _(t.http,t.account),t.bulk=new H(t.http),t.security=new xt(t.http,t.account),t.notification=new at(t.http,b(t),u),t.scheduler=new mt(t.http),t.file=new ae(t.http),t.filters=new le(t.http),t.import=new be(t.http),t.geocode=new de(t.http),t.cameras=new Y(t.http),t.print=new pt(t.http),t.tools=new Ft(t.http),t.resourceCatalog=new vt(t.http),t.general=new pe(t.http),t.namespace=new st(t.http),t.external=new re(t.http),t.clientSettings=new $(t.http),t.portalSettings=new lt(t.http),t.iceRouter=new ge(t.http),t.statistic=new Tt(t.http),t.feedback=new ie(t.http),t.vectorTiles=new Dt(t.http),t.universalSearch=new U(t.http),t.spatialReference=new C(t.http),t.eqlTest=new te(t.http),t.catalog=new F(t.http),t.queryToken=new R(t.http),t.names=new nt({account:t.account}),t.snappingHub=l?(new s.HubConnectionBuilder).withUrl(l,{withCredentials:!0,skipNegotiation:!0,transport:s.HttpTransportType.WebSockets}).withAutomaticReconnect().build():null,t}return v(i,[{key:"init",value:async function(e){let{authParams:t,connectWs:n,initScheduler:r,fetchSettings:s,fetchUser:i}=e;try{await this.account.login(t),i&&await this.account.fetchCurrentUser(),n&&await this.connectWs(),r&&await this.initScheduler(),s&&await this.clientSettings.fetchClientSettings({urlPath:this.urlPath}),await this.notification.subscribe("service_update")}catch(e){throw Ke(e)}}},{key:"isAcceptedNetwork",value:function(e){return["vk","google","facebook"].includes(e)}},{key:"socAuthLogin",value:async function(e){if(this.isAcceptedNetwork(e))try{await this.clientSettings.fetchClientSettings({urlPath:exports.UrlPath.Base})}catch(e){throw Ke(e)}}},{key:"connectWs",value:async function(){this.account.isAuth&&(this.notification.connectWs(this.wsUrl),this.notification.on("ConnectionStatus",e=>{e.data===exports.ConnectionStatus.Lost?this.emit(exports.ApiEvent.ConnectionLost,e.data):e.data===exports.ConnectionStatus.SessionClosed&&this.emit(exports.ApiEvent.SessionClosed,e.data)}))}},{key:"connectSignalR",value:async function(){this.account.isAuth&&this.snappingHub&&this.snappingHub.state!==s.HubConnectionState.Connected&&await this.snappingHub.start()}},{key:"logout",value:async function(){await this.account.logout(),await this.security.reset(),this.emit(exports.ApiEvent.Unauthorized,null)}},{key:"initScheduler",value:function(){return this.scheduler.init(this.notification)}},{key:"defineUrlPath",value:function(){const e=(window.location.href.split(window.location.hostname)[1]||"").split("/").filter(Boolean)[0],t=e?"/"+e:void 0;return t&&Mt.includes(t)?t:qt}},{key:"isShared",get:function(){return this.urlPath===exports.UrlPath.Shared}}]),i}(),Wt=function(e){k(n,l.TileLayer);var t=w(n);function n(e,r){var s;return y(this,n),(s=t.call(this,"",{crs:e.crs,opacity:e.opacity})).api=r,s.name=e.name,s.sourceUrl=e.sourceUrl,s.subDomains=e.subDomains,s}return v(n,[{key:"getTileUrl",value:function(e,t,n){var r;const s=this.name,i=this.subDomains?function(e,t){void 0===e&&(e=0),void 0===t&&(t=100);let n=t-e,r=Math.random();return r=Math.floor(r*n),r+=e,r}(0,(null==(r=this.subDomains)?void 0:r.length)-1):void 0;return this.sourceUrl?(this.subDomains&&void 0!==i?this.sourceUrl.replace("{0}",this.subDomains[i]):this.sourceUrl).replace("{1}",""+n).replace("{2}",""+e).replace("{3}",""+t):this.api.layers.getTilesLayerImage({x:e,y:t,z:n,name:s})}}]),n}();const Ht=["name","style","condition","dataFilterId","crs"];let Gt=function(e){k(n,p.DynamicLayer);var t=w(n);function n(e,r){var s;let{name:i,style:o,condition:a,dataFilterId:u,crs:l=c.webMercator}=e,p=m(e,Ht);return y(this,n),(s=t.call(this,p)).api=r,s.name=i,s.styleId=o,s.conditionQuery=a,s.filterId=u,s.crs=l,s.subscribeRedraw(),s}return v(n,[{key:"style",get:function(){return this.styleId},set:function(e){this.styleId=e,this.forceUpdate()}},{key:"condition",get:function(){return this.conditionQuery},set:function(e){this.conditionQuery=e,this.forceUpdate()}},{key:"dataFilterId",get:function(){return this.filterId},set:function(e){this.filterId=e,this.forceUpdate()}},{key:"getUrl",value:function(e,t){return this.api.layers.getLayerImage({name:this.name,extent:e.coordinates,size:[t.width,t.height],extentSr:e.crs.wkid,styleId:this.styleId,condition:this.conditionQuery,dataFilterId:this.filterId})}},{key:"subscribeRedraw",value:function(){this.api.notification.on("service_update",e=>{(null==e?void 0:e.data.layerName)===this.name&&(this.forceUpdate(),this.redraw())})}}]),n}();const Vt={RemoteTileService:Wt,LocalTileService:Wt,PostgresLayerService:Gt,StyledFeatureLayer:Gt,CompositeService:null};let zt=function(){function e(t,n){y(this,e),this.layers=t,this.http=n}return v(e,[{key:"getLayerService",value:async function(e){let t=await this.getLayerInfo(e);const n=t.type;if(!(e=>Boolean(e&&Object.keys(Vt).includes(e)))(n))return;const r=Vt[n];if(r)return new r((e=>d({},e,{name:"services/"+e.name}))(t),this.http);throw new Error('Constructor for service type: "'+t.type+'" not implemented')}},{key:"getLayerInfo",value:async function(e){try{return await this.layers.getLayerInfo(e)}catch(t){throw new Error('Service with name: "'+e+'" not exists')}}}]),e}();var Jt;!function(e){e[e.BaseMaps=0]="BaseMaps",e[e.Layers=1]="Layers"}(Jt||(Jt={}));let Qt=function(e){k(n,_t);var t=w(n);function n(e,r,s){var i;return y(this,n),(i=t.call(this,r)).map=new u.Map,i.painter=new a.DomPainter(i.map),i.mapProps=e,i.auth=s,i.layersManager=new zt(i.layers,i.http),i}return v(n,[{key:"init",value:async function(){await T(g(n.prototype),"init",this).call(this,{authParams:this.auth,connectWs:!0,fetchSettings:!0,initScheduler:!0});const{baseService:e,services:t,projectName:r}=this.mapProps;e&&await this.setBaseMap(e),t&&await Promise.all(t.map(e=>this.addLayer(e))),r&&await this.loadProject(r),this.setMapProps()}},{key:"reset",value:async function(){await this.account.logout(),this.painter.wrapper=null}},{key:"addLayer",value:async function(e){await this.insertLayer(e,Jt.Layers)}},{key:"setBaseMap",value:async function(e){await this.insertLayer(e,Jt.BaseMaps)}},{key:"loadProject",value:async function(e){const t=await this.projects.getProjectInfo(e);if(!t||!t.content)return;const{baseMapName:n,items:r}=t.content;if(n&&await this.setBaseMap(n),r){const e=r.map(e=>e.name).filter(Kt);await Promise.all(e.map(e=>this.addLayer(e)))}}},{key:"insertLayer",value:async function(e,t){const n=await this.layersManager.getLayerService(e);n&&this.map.insertLayer(n.layer,t)}},{key:"setMapProps",value:function(){const{position:e,centerPoint:t,mapWrapper:n,resolution:r}=this.mapProps;e?this.map.position=e:t&&(this.map.centerPoint=t),r&&(this.map.resolution=r),n&&(this.painter.wrapper=n)}}]),n}();const Kt=e=>void 0!==e;var Xt,Yt,Zt,$t,en,tn,nn,rn,sn,on,an,un,ln,cn,pn,hn,yn,fn,vn,dn,kn,gn,mn,bn,xn,wn,Tn,jn,Sn,Pn,In,Ln;(Xt=exports.AggregationFunction||(exports.AggregationFunction={})).None="None",Xt.Array="Array",Xt.Min="Min",Xt.Max="Max",Xt.Avg="Avg",Xt.Sum="Sum",Xt.Extent="Extent",Xt.H3="H3",Xt.Count="Count",Xt.TotalCount="TotalCount",Xt.DistinctCount="DistinctCount",Xt.First="First",Xt.Last="Last",Xt.Median="Median",Xt.Mod="Mod",Xt.StdDeviation="StdDeviation",Xt.SumOfProduct="SumOfProduct",Xt.OnlyValue="OnlyValue",Xt.WeightedAvg="WeightedAvg",Xt.DensityIndicators="DensityIndicators",Xt.DividedSum="DividedSum",(Yt=exports.AttributeSelectorType||(exports.AttributeSelectorType={})).None="None",Yt.SelectFromHandBook="SelectFromHandBook",Yt.SelectFromRange="SelectFromRange",Yt.ViewHandBook="ViewHandBook",(Zt=exports.AttributeType||(exports.AttributeType={})).Unknown="Unknown",Zt.String="String",Zt.Int32="Int32",Zt.Int64="Int64",Zt.Double="Double",Zt.DateTime="DateTime",Zt.Boolean="Boolean",Zt.Point="Point",Zt.Polyline="Polyline",Zt.MultiPolygon="MultiPolygon",Zt.Multipoint="Multipoint",Zt.H3Index="H3Index",Zt.Json="Json",($t=exports.ClassificationType||(exports.ClassificationType={})).None="none",$t.NaturalBreaks="naturalBreaks",$t.EqualInterval="equalInterval",$t.Quantile="quantile",$t.Unique="unique",(en=exports.ClassifyAttributeType||(exports.ClassifyAttributeType={})).Decimal="decimal",en.DateTime="dateTime",en.Text="text",(tn=exports.ConfigurationErrorEnum||(exports.ConfigurationErrorEnum={})).Unknown="Unknown",tn.SerializeError="SerializeError",tn.InvalidDataService="InvalidDataService",tn.InvalidConfiguration="InvalidConfiguration",tn.InvalidDataServiceName="InvalidDataServiceName",tn.InvalidTableName="InvalidTableName",tn.InvalidLayerName="InvalidLayerName",tn.ResourceNotFound="ResourceNotFound",tn.InvalidCondition="InvalidCondition",tn.InvalidAttributes="InvalidAttributes",tn.InvalidIdAttribute="InvalidIdAttribute",tn.InvalidGeometryAttribute="InvalidGeometryAttribute",tn.InvalidGeometryAttributeType="InvalidGeometryAttributeType",tn.InvalidColumnName="InvalidColumnName",tn.InvalidIdColumnSettings="InvalidIdColumnSettings",tn.ColumnNotExistsInTable="ColumnNotExistsInTable",tn.InvalidStyle="InvalidStyle",tn.InvalidLayerType="InvalidLayerType",tn.ColumnLoadingError="ColumnLoadingError",tn.InvalidAttributeFormat="InvalidAttributeFormat",tn.DataSourceNotFound="DataSourceNotFound",tn.DuplicateColumns="DuplicateColumns",tn.DuplicateAttributes="DuplicateAttributes",tn.TableWithoutColumns="TableWithoutColumns",tn.InvalidTableReferenceConfiguration="InvalidTableReferenceConfiguration",(nn=exports.ErrorDetailsType||(exports.ErrorDetailsType={})).ResourceLimitExceeded="ResourceLimitExceeded",nn.ResourceNotFound="ResourceNotFound",nn.InternalError="InternalError",nn.BadRequest="BadRequest",nn.DuplicateContent="DuplicateContent",(rn=exports.ErrorType||(exports.ErrorType={})).NotSpecified="NotSpecified",rn.LimitError="LimitError",rn.ValidationError="ValidationError",rn.JwtExpired="JwtExpired",rn.TokenInvalid="TokenInvalid",rn.RefreshTokenExpired="RefreshTokenExpired",rn.RefreshTokenInvalid="RefreshTokenInvalid",rn.CreateUserFailed="CreateUserFailed",rn.SetUserPasswordFailed="SetUserPasswordFailed",rn.SetUserRoleFailed="SetUserRoleFailed",rn.UpdateUserFailed="UpdateUserFailed",rn.RemoveUserFailed="RemoveUserFailed",rn.CreateRoleFailed="CreateRoleFailed",rn.UpdateRoleFailed="UpdateRoleFailed",rn.RemoveUserRoleFailed="RemoveUserRoleFailed",rn.ChangeActiveStateFailed="ChangeActiveStateFailed",rn.RemoveRoleFailed="RemoveRoleFailed",rn.UserNotFound="UserNotFound",rn.RoleNotFound="RoleNotFound",rn.EmailNotConfirmed="EmailNotConfirmed",rn.DuplicateEmailError="DuplicateEmailError",rn.InvalidPassword="InvalidPassword",rn.RoleExists="RoleExists",rn.UserExists="UserExists",rn.UserLockedError="UserLockedError",rn.InvalidEmail="InvalidEmail",rn.InvalidUsername="InvalidUsername",rn.Unauthorized="Unauthorized",rn.EmailNotChanged="EmailNotChanged",rn.EmailNotSet="EmailNotSet",(sn=exports.FeatureType||(exports.FeatureType={})).Unknown="Unknown",sn.GeometricFeature="GeometricFeature",(on=exports.FontStyle||(exports.FontStyle={})).Normal="normal",on.Oblique="oblique",on.Italic="italic",(an=exports.FontWeight||(exports.FontWeight={})).Thin="Thin",an.ExtraLight="ExtraLight",an.Light="Light",an.SemiLight="SemiLight",an.Normal="Normal",an.Medium="Medium",an.DemiBold="DemiBold",an.Bold="Bold",an.ExtraBold="ExtraBold",an.Black="Black",an.ExtraBlack="ExtraBlack",(un=exports.GeometryType||(exports.GeometryType={})).Unknown="unknown",un.Point="point",un.Polyline="polyline",un.Polygon="multipolygon",un.Envelope="envelope",un.Multipoint="multipoint",(ln=exports.Group||(exports.Group={})).My="my",ln.Role="role",ln.Public="public",ln.All="all",(cn=exports.LineCapStyle||(exports.LineCapStyle={})).Flat="Flat",cn.Square="Square",cn.Round="Round",cn.Triangle="Triangle",(pn=exports.LineEndingType||(exports.LineEndingType={})).None="none",pn.Arrow="arrow",pn.FilledArrow="filledArrow",pn.Square="square",pn.FilledSquare="filledSquare",pn.Circle="circle",pn.FilledCircle="filledCircle",pn.Diamond="diamond",pn.FilledDiamond="filledDiamond",pn.RoundSquare="roundSquare",pn.FilledRoundSquare="filledRoundSquare",pn.Svg="svg",(hn=exports.LineJoinType||(exports.LineJoinType={})).Miter="Miter",hn.Bevel="Bevel",hn.Round="Round",(yn=exports.ObjectTypeFilter||(exports.ObjectTypeFilter={})).All="All",yn.Directory="Directory",yn.File="File",(fn=exports.Operation||(exports.Operation={})).Unknown="Unknown",fn.Union="union",fn.Intersection="intersection",fn.Subtraction="subtraction",fn.SymDifference="symDifference",(vn=exports.OwnerFilter||(exports.OwnerFilter={})).My="My",vn.All="All",vn.Other="Other",(dn=exports.PbfSchema||(exports.PbfSchema={})).XYZ="xyz",dn.TMS="tms",(kn=exports.Permissions||(exports.Permissions={})).None="none",kn.Configure="configure",kn.Write="write",kn.Read="read",kn.ReadConfigure="read,configure",kn.ReadWrite="read,write",kn.All="read,write,configure",(gn=exports.PolicyType||(exports.PolicyType={})).Unknown="Unknown",gn.CreateTable="CreateTable",gn.CreateLayer="CreateLayer",gn.CreateProject="CreateProject",gn.MaxFeaturesInOneTable="MaxFeaturesInOneTable",gn.MaxObjectsToExport="MaxObjectsToExport",gn.MaxUploadContentSize="MaxUploadContentSize",(mn=exports.Quality||(exports.Quality={})).Low="Low",mn.Medium="Medium",mn.High="High",(bn=exports.ReferenceJoinType||(exports.ReferenceJoinType={})).OneToMany="OneToMany",bn.OneToOne="OneToOne",bn.Intersect="Intersect",bn.RightJoin="RightJoin",bn.FullJoin="FullJoin",bn.CrossJoin="CrossJoin",(xn=exports.ResourceType||(exports.ResourceType={})).Unknown="Unknown",xn.Table="table",xn.Layer="layer",xn.Project="project",xn.File="file",xn.Feature="feature",xn.Tag="tag",(wn=exports.ResourceTypeLink||(exports.ResourceTypeLink={})).Table="tables",wn.Layer="layers",wn.Project="projects",(Tn=exports.ServerTaskStatus||(exports.ServerTaskStatus={})).None="None",Tn.Scheduled="Scheduled",Tn.Planning="Planning",Tn.Executing="Executing",Tn.Completed="Completed",Tn.Failed="Failed",Tn.Canceled="Canceled",Tn.Timeout="Timeout",(jn=exports.SimplifyType||(exports.SimplifyType={})).Basic="Basic",jn.PreserveTopology="PreserveTopology",jn.VW="VW",(Sn=exports.StringSubType||(exports.StringSubType={})).None="None",Sn.Image="Image",Sn.PkkCode="PkkCode",Sn.Attachments="Attachments",(Pn=exports.TaskGroup||(exports.TaskGroup={})).My="my",Pn.All="all",(In=exports.TextAlignment||(exports.TextAlignment={})).Right="right",In.Left="left",In.Center="center",In.Justified="justified",(Ln=exports.TextVerticalAlignment||(exports.TextVerticalAlignment={})).Top="top",Ln.Bottom="bottom",Ln.Middle="middle",Object.defineProperty(exports,"HTTPError",{enumerable:!0,get:function(){return n.HTTPError}}),Object.defineProperty(exports,"TimeoutError",{enumerable:!0,get:function(){return n.TimeoutError}}),exports.Account=B,exports.AccountPreview=_,exports.Api=_t,exports.BulkOperations=H,exports.Cameras=Y,exports.ClientSettings=$,exports.EqlTest=te,exports.EvergisDynamicLayer=Gt,exports.EvergisTileLayer=Wt,exports.External=re,exports.Feedback=ie,exports.FileUpload=ae,exports.Filters=le,exports.GEOCODE_PROVIDER="geocode2gis",exports.General=pe,exports.Geocode=de,exports.HttpClient=j,exports.IceRouter=ge,exports.Import=be,exports.Layers=Je,exports.LayersManager=zt,exports.Names=nt,exports.Namespace=st,exports.Notification=at,exports.NotificationEvent=ut,exports.PortalSettings=lt,exports.Print=pt,exports.Projects=yt,exports.ResourceCatalog=vt,exports.Resources=kt,exports.Scheduler=mt,exports.Security=xt,exports.SpatialProcessor=Qt,exports.Statistic=Tt,exports.Styles=St,exports.Tables=Et,exports.Tools=Ft,exports.VectorTiles=Dt,exports.addSubDomainToLocation=e=>window.location.protocol+"//"+e+"."+window.location.host,exports.errorHandler=Ke,exports.formDataFromFile=function(e){const t=new FormData;return t.append("file",e),t},exports.generateId=tt,exports.isEvergisDynamicLayer=function(e){return e instanceof Gt},exports.isEvergisTileLayer=function(e){return e instanceof Wt},exports.isFeatureLayer=function(e){return e instanceof h.FeatureLayer},exports.isHTTPError=e=>Xe(e)&&"http"===e.type,exports.isHandledError=Xe,exports.isLayer=Ze,exports.isProjectContentItems=function(e){return null!=e},exports.isString=$e,exports.isTileLayerService=function(e){return e.type&&/TileService/.test(e.type)},exports.promiseAllIgnoreErrors=We,exports.stripUselessSlashes=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.join("/").split("/").filter(Boolean).join("/")},exports.toFormData=I,exports.unique=et;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@evergis/event-emitter"),n=require("ky"),r=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,s=require("@microsoft/signalr"),i=require("query-string"),o=require("nanoid"),a=require("@evergis/sgis/es/painters/DomPainter/DomPainter"),u=require("@evergis/sgis/es/Map"),l=require("@evergis/sgis/es/layers/TileLayer"),c=require("@evergis/sgis/es/Crs"),p=require("@evergis/sgis/es/layers/DynamicLayer"),h=require("@evergis/sgis");function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function v(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function k(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){if(null==e)return{};var n,r,s={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(s[n]=e[n]);return s}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return b(e)}function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=g(e);if(t){var s=g(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return x(this,n)}}function T(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=g(e)););return e}function j(){return(j="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=T(e,t);if(r){var s=Object.getOwnPropertyDescriptor(r,t);return s.get?s.get.call(arguments.length<3?e:n):s.value}}).apply(this,arguments)}let S=function(){function e(t){var n;void 0===t&&(t={}),y(this,e),this.ky=r.extend(t),this.prefixUrl=(null==(n=t.prefixUrl)?void 0:n.toString())||""}return v(e,[{key:"extend",value:function(e){var t;this.ky=r.extend(e),this.prefixUrl=(null==(t=e.prefixUrl)?void 0:t.toString())||""}},{key:"get",value:function(e,t){return this.ky.get(this.stripSlashes(e),{searchParams:I(t)})}},{key:"post",value:function(e,t,n){const r=P(n,t);return this.ky.post(this.stripSlashes(e),r)}},{key:"put",value:function(e,t,n){const r=P(n,t);return this.ky.put(this.stripSlashes(e),r)}},{key:"patch",value:function(e,t,n){const r=P(n,t);return this.ky.patch(this.stripSlashes(e),r)}},{key:"delete",value:function(e,t,n){const r=P(n,t);return this.ky.delete(this.stripSlashes(e),r)}},{key:"createUrl",value:function(e,t){const n=t?"?"+I(t):"";return this.prefixUrl+this.stripSlashes(e)+n}},{key:"stripSlashes",value:function(e){return this.prefixUrl?e.replace(/^\//g,""):e}}]),e}();function P(e,t){const n={searchParams:I(e)};var r;return void 0!==(r=t)&&"object"==typeof r&&null!==r&&r.constructor===Object||Array.isArray(t)?n.json=t:n.body=t,n}function I(e){return void 0===e&&(e={}),i.stringify(e,{arrayFormat:"comma"})}function L(e){return e instanceof FormData?e:Object.keys(e).reduce((t,n)=>(t.append(n,e[n]),t),new FormData)}let R=v((function e(t){y(this,e),this.http=t})),C=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"createToken",value:function(e){return this.http.put("/accessToken/"+e,null).text()}},{key:"disableToken",value:function(e){return this.http.post("/accessToken/"+e+"/disable",null).then(()=>{})}},{key:"enableToken",value:function(e){return this.http.post("/accessToken/"+e+"/enable",null).then(()=>{})}},{key:"revokeToken",value:function(e){return this.http.delete("/accessToken/"+e,null).then(()=>{})}}]),n}(),E=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getAvailiableCs",value:function(){return this.http.get("/srs/list").json()}},{key:"getProj4Representation",value:function(e){return this.http.get("/srs/"+e+"/proj4").text()}},{key:"getWktRepresentation",value:function(e){return this.http.get("/srs/"+e+"/wkt").text()}}]),n}();const U=["taskId","layerName"];let F=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getSearchResult",value:function(e){let{taskId:t,layerName:n}=e,r=m(e,U);return this.http.get("/search/"+t+"/"+n,r).json()}},{key:"getSearchResult1",value:function(e){return this.http.get("/search/"+e).json()}}]),n}(),N=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getAll",value:function(e){return this.http.get("/resources",e).json()}},{key:"searchResources",value:function(e,t){return this.http.post("/resources/search",t,e).json()}},{key:"getResource",value:function(e){return this.http.get("/resources/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/resources/"+e,null).then(()=>{})}},{key:"moveResource",value:function(e,t){return this.http.post("/resources/"+e+"/move",t).json()}},{key:"createDirectory",value:function(e){return this.http.post("/resources/directory",e).json()}},{key:"createFile",value:function(e){return this.http.post("/resources/file",L(e)).json()}},{key:"getPermissions",value:function(e){return this.http.get("/resources/"+e+"/permissions").json()}},{key:"setPermissions",value:function(e,t){return this.http.put("/resources/"+e+"/permissions",t).json()}},{key:"downloadFile",value:function(e){return this.http.get("/resources/"+e+"/download").blob()}}]),n}();var A;(A=exports.ApiEvent||(exports.ApiEvent={})).ConnectionLost="ConnectionLost",A.Unauthorized="Unauthorized",A.SessionClosed="SessionClosed";let D=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getUsers",value:function(e){return this.http.get("/account/user/list",e).json()}},{key:"getExtendedUsers",value:function(e){return this.http.get("/account/user/extendedlist",e).json()}},{key:"getUserInfo",value:function(e){return this.http.get("/account/"+e).json()}},{key:"getExtendedUserInfo",value:function(e){return this.http.get("/account/extended/"+e).json()}},{key:"isUsernameExists",value:function(e){return this.http.get("/account/user/exists",e).json()}},{key:"isEmailExists",value:function(e){return this.http.get("/account/user/email/exists",e).json()}},{key:"registerUser",value:function(e){return this.http.post("/account/register",e).text()}},{key:"createUser",value:function(e,t){return this.http.post("/account/user",t,e).then(()=>{})}},{key:"updateUser",value:function(e){return this.http.patch("/account/user",e).then(()=>{})}},{key:"confirmEmail",value:function(e){return this.http.post("/account/user/"+e+"/email/confirm",null).then(()=>{})}},{key:"verifyEmail",value:function(e){return this.http.post("/account/user/"+e+"/email/verify",null).then(()=>{})}},{key:"setEmail",value:function(e){return this.http.post("/account/setEmail",L(e)).then(()=>{})}},{key:"confirmEmail1",value:function(e){return this.http.post("/account/user/email/confirm",null,e).then(()=>{})}},{key:"changeEmail",value:function(e){return this.http.post("/account/user/email/change",null,e).then(()=>{})}},{key:"confirmChangeEmail",value:function(e){return this.http.post("/account/user/email/change/confirm",null,e).then(()=>{})}},{key:"setUserPassword",value:function(e){return this.http.patch("/account/password/set",e).then(()=>{})}},{key:"changePassword",value:function(e){return this.http.patch("/account/password/change",L(e)).then(()=>{})}},{key:"resetPassword",value:function(e){return this.http.post("/account/password/reset",null,e).then(()=>{})}},{key:"resetPasswordCallback",value:function(e){return this.http.post("/account/password/reset/confirm",L(e)).then(()=>{})}},{key:"removeUser",value:function(e){return this.http.delete("/account/user/"+e,null).then(()=>{})}},{key:"activateUser",value:function(e){return this.http.post("/account/user/"+e+"/activate",null).then(()=>{})}},{key:"deactivateUser",value:function(e){return this.http.post("/account/user/"+e+"/deactivate",null).then(()=>{})}},{key:"authenticate",value:function(e){return this.http.post("/account/login",e).text()}},{key:"refreshToken",value:function(){return this.http.post("/account/refresh-token",null).text()}},{key:"revokeToken",value:function(){return this.http.delete("/account/revoke-token",null).then(()=>{})}},{key:"ldapLogin",value:function(e){return this.http.post("/account/external/login/ldap",e).then(()=>{})}},{key:"getRoles",value:function(e){return this.http.get("/account/role/list",e).json()}},{key:"createRole",value:function(e){return this.http.post("/account/role",e).then(()=>{})}},{key:"updateRole",value:function(e){return this.http.patch("/account/role",e).then(()=>{})}},{key:"removeRole",value:function(e){return this.http.delete("/account/role/"+e,null).then(()=>{})}},{key:"addToRole",value:function(e,t){return this.http.post("/account/user/"+e+"/role/"+t,null).then(()=>{})}},{key:"removeFromRole",value:function(e,t){return this.http.delete("/account/user/"+e+"/role/"+t,null).then(()=>{})}},{key:"postUsedProjects",value:function(e){return this.http.post("/account/latest_projects",e).json()}},{key:"getUsedProjects",value:function(){return this.http.get("/account/latest_projects").json()}},{key:"truncateUsedProjects",value:function(){return this.http.delete("/account/latest_projects",null).then(()=>{})}}]),n}();const O=()=>JSON.parse(localStorage.getItem("@evergis/user-info")||"null")||void 0,B=e=>{if(e){const t=O();localStorage.setItem("@evergis/user-info",JSON.stringify(d({},t,e)))}else localStorage.removeItem("@evergis/user-info")};let M=function(e){k(n,D);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"login",value:async function(e){e&&await j(g(n.prototype),"authenticate",this).call(this,e)}},{key:"fetchCurrentUser",value:async function(){return this.userInfo=await this.getUserInfo(""),this.userInfo}},{key:"username",get:function(){var e;return(null==(e=this.userInfo)?void 0:e.username)||""}},{key:"logout",value:async function(){await this.revokeToken(),B(void 0),this.userInfo={}}},{key:"updateCurrentUser",value:async function(e){await j(g(n.prototype),"updateUser",this).call(this,d({username:this.username},e)),B(e)}},{key:"setPassword",value:function(e){return this.setUserPassword({username:this.username,password:e})}},{key:"isAuth",get:function(){var e;return!(null==(e=this.userInfo)||!e.username)&&"public"!==this.userInfo.username}},{key:"user",get:function(){if(this.userInfo)return this.userInfo;const e=O();return e&&(this.userInfo=e),e}}]),n}();const q=["username"];let _=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getPreview",value:function(e){return this.http.createUrl("/account/user/preview/"+e)}},{key:"uploadPreview",value:function(e,t){let{username:n}=e,r=m(e,q);return this.http.post("/account/user/preview/"+n,L(t),r).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/account/user/preview/"+e,null).then(()=>{})}}]),n}(),W=function(e){k(n,_);var t=w(n);function n(e,r){var s;return y(this,n),(s=t.call(this,e)).userInfo=r,s}return v(n,[{key:"user",get:function(){if(this.userInfo)return this.userInfo;const e=O();return e&&(this.userInfo=e),e}},{key:"username",get:function(){var e;return(null==(e=this.userInfo)?void 0:e.username)||""}},{key:"updateCurrentUserPhoto",value:async function(e,t){const{fileId:n}=await this.uploadPreview(d({username:this.username},t),{file:e});B({profile_photo:n,has_profile_photo:!0})}},{key:"fetchPreview1",value:async function(){var e;const t=this.getPreview(""),n=await fetch(t),r=null!=(e=n.headers.get("content-type"))&&e.includes("text/plain")?await n.text():t+"?r="+Math.random();B({profile_photo:r,has_profile_photo:!0})}},{key:"deleteCurrentUserPhoto",value:async function(){await this.deletePreview(this.username),B({profile_photo:"",has_profile_photo:!1})}}]),n}(),H=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"batchResourcesPermissionsSet",value:function(e){return this.http.put("/bulk/resources/permissions",e).json()}}]),n}(),G=function(e){k(n,H);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const V=["cameraId"],z=["cameraId"],J=["cameraId"],Q=["cameraId"],K=["cameraId"],X=["cameraId"];let Y=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getCameras",value:function(e){return this.http.get("/cameras",e).json()}},{key:"getArchiveFeed",value:function(e){let{cameraId:t}=e,n=m(e,V);return this.http.get("/cameras/"+t+"/archiveFeed",n).blob()}},{key:"getArchiveTimeline",value:function(e){let{cameraId:t}=e,n=m(e,z);return this.http.get("/cameras/"+t+"/archiveTimeline",n).json()}},{key:"getArchiveCalendar",value:function(e){let{cameraId:t}=e,n=m(e,J);return this.http.get("/cameras/"+t+"/archiveCalendar",n).json()}},{key:"getArchiveSnapshot",value:function(e){let{cameraId:t}=e,n=m(e,Q);return this.http.get("/cameras/"+t+"/archiveSnapshot",n).blob()}},{key:"getLiveFeed",value:function(e){let{cameraId:t}=e,n=m(e,K);return this.http.get("/cameras/"+t+"/liveFeed",n).blob()}},{key:"getLiveSnapshot",value:function(e){return this.http.get("/cameras/"+e+"/liveSnapshot").blob()}},{key:"getLivePreviewStream",value:function(e){let{cameraId:t}=e,n=m(e,X);return this.http.get("/cameras/"+t+"/getLivePreviewsStream",n).json()}}]),n}(),Z=function(e){k(n,Y);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),$=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getConfigurationsList",value:function(e){return this.http.get("/settings/config",e).json()}},{key:"getConfiguration",value:function(e){return this.http.get("/settings",e).text()}},{key:"setConfiguration",value:function(e,t){return this.http.post("/settings",t,e).then(()=>{})}},{key:"removeConfiguration",value:function(e){return this.http.delete("/settings",null,e).then(()=>{})}}]),n}(),ee=function(e){k(n,$);var t=w(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).settings={modules:[],connection:{url:""}},e}return v(n,[{key:"fetchClientSettings",value:async function(e){const t=JSON.parse(await this.getConfiguration(e));return this.updateClientSettings(t),t}},{key:"updateClientSettings",value:function(e){Object.assign(this.settings,e)}}]),n}(),te=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getQueryResult",value:function(e){return this.http.post("/eql/query",e).then(()=>{})}},{key:"getQueryDescription",value:function(e){return this.http.post("/eql/description",e).json()}},{key:"setLayerParameterValue",value:function(e){return this.http.post("/eql/setParam",null,e).then(()=>{})}},{key:"setLayerParameters",value:function(e,t){return this.http.post("/eql/setParams",t,e).then(()=>{})}},{key:"getLayerParameters",value:function(e){return this.http.get("/eql/getParam",e).text()}},{key:"getLayerParameters1",value:function(e){return this.http.get("/eql/getParams",e).json()}},{key:"removeLayerParameterValue",value:function(e){return this.http.delete("/eql/removeParam",null,e).then(()=>{})}}]),n}(),ne=function(e){k(n,te);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),re=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"vkLogin",value:function(){return this.http.createUrl("/account/external/login/vk")}},{key:"googleLogin",value:function(){return this.http.createUrl("/account/external/login/google")}},{key:"facebookLogin",value:function(){return this.http.createUrl("/account/external/login/facebook")}},{key:"loginCallback",value:function(){return this.http.get("/account/external/login/callback").then(()=>{})}},{key:"unbindVk",value:function(){return this.http.delete("/account/external/unbind/vk",null).then(()=>{})}},{key:"unbindGoogle",value:function(){return this.http.delete("/account/external/unbind/google",null).then(()=>{})}},{key:"unbindFacebook",value:function(){return this.http.delete("/account/external/unbind/facebook",null).then(()=>{})}},{key:"bindVk",value:function(){return this.http.createUrl("/account/external/bind/vk")}},{key:"bindGoogle",value:function(){return this.http.createUrl("/account/external/bind/google")}},{key:"bindFacebook",value:function(){return this.http.createUrl("/account/external/bind/facebook")}},{key:"bindCallback",value:function(){return this.http.get("/account/external/bind/callback").then(()=>{})}}]),n}(),se=function(e){k(n,re);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"login",value:function(e){switch(e){case"vk":return this.vkLogin();case"google":return this.googleLogin();case"facebook":return this.facebookLogin();default:return""}}},{key:"bind",value:function(e){switch(e){case"vk":return this.bindVk();case"google":return this.bindGoogle();case"facebook":return this.bindFacebook();default:return""}}},{key:"unbind",value:function(e){switch(e){case"vk":return this.unbindVk();case"google":return this.unbindGoogle();case"facebook":return this.unbindFacebook();default:return""}}}]),n}(),ie=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"increaseResourcesLimit",value:function(e){return this.http.post("/feedback/limits",null,e).json()}},{key:"moreSymbols",value:function(e){return this.http.post("/feedback/symbol",null,e).json()}},{key:"feedback",value:function(e,t){return this.http.post("/feedback",L(t),e).json()}}]),n}(),oe=function(e){k(n,ie);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"postFeedback",value:function(e,t){return this.feedback(e,t)}}]),n}(),ae=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"downloadFile",value:function(e){return this.http.get("/upload/file",e).blob()}},{key:"uploadFile",value:function(e){return this.http.post("/upload/file",L(e)).json()}},{key:"deleteFile",value:function(e){return this.http.delete("/upload/file",null,e).then(()=>{})}},{key:"getFileInfo",value:function(e){return this.http.get("/upload/fileInfo",e).json()}}]),n}(),ue=function(e){k(n,ae);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"upload",value:function(e,t){return this.uploadFile({file:e,rewrite:!!t})}}]),n}(),le=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"get",value:function(e){return this.http.get("/filters/"+e).text()}},{key:"update",value:function(e,t){return this.http.post("/filters/"+e,t).json()}},{key:"create",value:function(e){return this.http.post("/filters",e).json()}}]),n}(),ce=function(e){k(n,le);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),pe=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getServerInfo",value:function(){return this.http.get("/").json()}},{key:"getFunctionsList",value:function(){return this.http.get("/functions").json()}}]),n}(),he=function(e){k(n,pe);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const ye=["providerName"],fe=["providerName"],ve=["providerName"];let de=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"geocode",value:function(e){let{providerName:t}=e,n=m(e,ye);return this.http.get("/geocode/"+t,n).json()}},{key:"geocodeByPoint",value:function(e){let{providerName:t}=e,n=m(e,fe);return this.http.get("/geocode/"+t+"/geocodeByPoint",n).json()}},{key:"suggest",value:function(e){let{providerName:t}=e,n=m(e,ve);return this.http.get("/geocode/"+t+"/suggest",n).json()}}]),n}(),ke=function(e){k(n,de);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"geocode2Gis",value:function(e){return this.geocode(d({providerName:"geocode2gis"},e))}},{key:"suggest2Gis",value:function(e){return this.suggest(d({providerName:"geocode2gis"},e))}}]),n}(),ge=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"startTask",value:function(e){return this.http.post("/ice-router/tasks",e).text()}},{key:"getResult",value:function(e){return this.http.get("/ice-router/tasks/"+e).json()}}]),n}(),me=function(e){k(n,ge);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),be=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getDataSchema",value:function(e){return this.http.get("/import/dataSchema",e).json()}},{key:"getFeaturesCount",value:function(e){return this.http.post("/import/count",e).json()}},{key:"readPart",value:function(e){return this.http.get("/import/read",e).then(()=>{})}},{key:"getExternalWmsLayers",value:function(e){return this.http.get("/import/wms",e).json()}},{key:"getExternalPbfLayers",value:function(e){return this.http.get("/import/pbf",e).json()}},{key:"getExternalPbfFeatures",value:function(e){return this.http.get("/import/pbf/features",e).json()}},{key:"getExternalArcgisFsLayers",value:function(e){return this.http.get("/import/arcgisfeatureservice",e).json()}},{key:"getExternalArcGisLayers",value:function(e){return this.http.get("/import/arcgismapservice",e).json()}},{key:"getRasterAttributes",value:function(e){return this.http.get("/import/rasterAttributes",e).json()}},{key:"getRasterMeta",value:function(e){return this.http.get("/import/rasterMeta",e).json()}}]),n}(),xe=function(e){k(n,be);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const we=["name"],Te=["name"],je=["name"],Se=["name","id"],Pe=["name","id"],Ie=["name","id"],Le=["name","x","y","z"],Re=["name"],Ce=["name"],Ee=["name"],Ue=["name"],Fe=["name"],Ne=["name"],Ae=["name"],De=["name"],Oe=["name"],Be=["name"],Me=["name"],qe=["layerName"],_e=["name","id"];let We=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getLayersList",value:function(e){return this.http.get("/layers",e).json()}},{key:"setPermissionsBatch",value:function(e){return this.http.put("/layers",e).then(()=>{})}},{key:"deleteResources",value:function(e){return this.http.delete("/layers",null,e).json()}},{key:"getLayerInfo",value:function(e){return this.http.get("/layers/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/layers/"+e,null).then(()=>{})}},{key:"getLayersInfo",value:function(e){return this.http.get("/layers/batchInfo",e).json()}},{key:"publishMapboxService",value:function(e){return this.http.post("/layers",e,{type:"Mapbox"}).json()}},{key:"publishProxyService",value:function(e){return this.http.post("/layers",e,{type:"ProxyService"}).json()}},{key:"publishRouteService",value:function(e){return this.http.post("/layers",e,{type:"RouteService"}).then(()=>{})}},{key:"publishLinearService",value:function(e){return this.http.post("/layers",e,{type:"LinearService"}).then(()=>{})}},{key:"publishRemoteTileService",value:function(e){return this.http.post("/layers",e,{type:"RemoteTileService"}).json()}},{key:"publishLocalTileService",value:function(e){return this.http.post("/layers",e,{type:"LocalTileService"}).json()}},{key:"publishPostgresLayerService",value:function(e){return this.http.post("/layers",e,{type:"PostgresLayerService"}).json()}},{key:"publishQueryLayerService",value:function(e){return this.http.post("/layers",e,{type:"QueryLayerService"}).json()}},{key:"publishPostgresTileCatalogService",value:function(e){return this.http.post("/layers",e,{type:"PostgresTileLayerService"}).json()}},{key:"publishStyledLayerService",value:function(e){return this.http.post("/layers",e,{type:"StyledFeatureLayer"}).json()}},{key:"updateMapboxService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"Mapbox"}).json()}},{key:"updateProxyService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"ProxyService"}).json()}},{key:"updateTileCatalogService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"PostgresTileLayerService"}).json()}},{key:"publishCompositeService",value:function(e){return this.http.post("/layers",e,{type:"CompositeService"}).json()}},{key:"updateRemoteTileService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"RemoteTileService"}).json()}},{key:"updateLocalTileService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"LocalTileService"}).json()}},{key:"updatePostgresLayerService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"PostgresLayerService"}).json()}},{key:"updateQueryLayerService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"QueryLayerService"}).json()}},{key:"updateCompositeService",value:function(e,t){return this.http.patch("/layers/"+e,t,{type:"CompositeService"}).json()}},{key:"reloadService",value:function(e){return this.http.get("/layers/"+e+"/reload").json()}},{key:"getFeatures",value:function(e,t){return this.http.post("/layers/"+e+"/features/query",t).json()}},{key:"getFeatures1",value:function(e){let{name:t}=e,n=m(e,we);return this.http.get("/layers/"+t+"/features",n).json()}},{key:"deleteFeature",value:function(e){let{name:t}=e,n=m(e,Te);return this.http.delete("/layers/"+t+"/features",null,n).json()}},{key:"createFeatures",value:function(e,t){return this.http.post("/layers/"+e+"/features",t).json()}},{key:"updateFeature",value:function(e,t){return this.http.patch("/layers/"+e+"/features",t).json()}},{key:"featuresContains",value:function(e){let{name:t}=e,n=m(e,je);return this.http.get("/layers/"+t+"/features/contains",n).json()}},{key:"getById",value:function(e){let{name:t,id:n}=e,r=m(e,Se);return this.http.get("/layers/"+t+"/features/"+n,r).json()}},{key:"unite",value:function(e,t){let{name:n,id:r}=e,s=m(e,Pe);return this.http.post("/layers/"+n+"/features/"+r+"/unite",t,s).json()}},{key:"subtract",value:function(e,t){let{name:n,id:r}=e,s=m(e,Ie);return this.http.post("/layers/"+n+"/features/"+r+"/subtract",t,s).json()}},{key:"getTilesLayerImage",value:function(e){let{name:t,x:n,y:r,z:s}=e,i=m(e,Le);return this.http.createUrl("/layers/"+t+"/tile/"+s+"/"+n+"/"+r,i)}},{key:"getLayerImage",value:function(e){let{name:t}=e,n=m(e,Re);return this.http.createUrl("/layers/"+t+"/export",n)}},{key:"getLayerExtent",value:function(e){let{name:t}=e,n=m(e,Ce);return this.http.get("/layers/"+t+"/extent",n).json()}},{key:"getByGeometry",value:function(e){let{name:t}=e,n=m(e,Ee);return this.http.get("/layers/"+t+"/features/getByGeometry",n).json()}},{key:"getByGeometryPost",value:function(e,t){let{name:n}=e,r=m(e,Ue);return this.http.post("/layers/"+n+"/features/getByGeometry",t,r).json()}},{key:"deleteFeatures",value:function(e){let{name:t}=e,n=m(e,Fe);return this.http.delete("/layers/"+t+"/features/deleteByIds",null,n).json()}},{key:"deleteByCondition",value:function(e){let{name:t}=e,n=m(e,Ne);return this.http.delete("/layers/"+t+"/features/deleteByCondition",null,n).json()}},{key:"getByGeometryGet",value:function(e){let{name:t}=e,n=m(e,Ae);return this.http.get("/layers/"+t+"/features/getByGeometryByClick",n).json()}},{key:"classify",value:function(e){let{name:t}=e,n=m(e,De);return this.http.get("/layers/"+t+"/classify",n).json()}},{key:"distincts",value:function(e){let{name:t}=e,n=m(e,Oe);return this.http.get("/layers/"+t+"/distincts",n).json()}},{key:"aggregateAttribute",value:function(e){let{name:t}=e,n=m(e,Be);return this.http.get("/layers/"+t+"/aggregate-values",n).json()}},{key:"getFilteredFeaturesCount",value:function(e){let{name:t}=e,n=m(e,Me);return this.http.get("/layers/"+t+"/features/count",n).json()}},{key:"getFilteredFeaturesCount1",value:function(e,t){return this.http.post("/layers/"+e+"/features/count",t).json()}},{key:"editAttributes",value:function(e,t){return this.http.post("/layers/"+e+"/features/edit-attributes",t).json()}},{key:"selectFeatures",value:function(e){return this.http.get("/layers/features/select",e).json()}},{key:"validateExpression",value:function(e){let{layerName:t}=e,n=m(e,qe);return this.http.get("/layers/"+t+"/validateExpression",n).json()}},{key:"getRasterMeta",value:function(e){let{name:t,id:n}=e,r=m(e,_e);return this.http.get("/layers/"+t+"/"+n+"/metadata",r).json()}},{key:"createRoute",value:function(e,t){return this.http.post("/layers/"+e+"/createRoute",t).json()}},{key:"applyStyle",value:function(e,t){return this.http.put("/layers/"+e+"/style",t).then(()=>{})}},{key:"getStyle",value:function(e){return this.http.get("/layers/"+e+"/style").json()}},{key:"getImageLayout",value:function(e){return this.http.get("/layers/"+e+"/style/sprite.png").blob()}},{key:"getDataLayout",value:function(e){return this.http.get("/layers/"+e+"/style/sprite.json").blob()}},{key:"getPreview",value:function(e){return this.http.createUrl("/layers/"+e+"/preview")}},{key:"setPreview",value:function(e,t){return this.http.post("/layers/"+e+"/preview",L(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/layers/"+e+"/preview",null).then(()=>{})}},{key:"isExists",value:function(e){return this.http.get("/layers/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/layers/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/layers/"+e+"/references").json()}},{key:"getPermissions",value:function(e){return this.http.get("/layers/"+e+"/permissions").json()}},{key:"addPermissions",value:function(e,t){return this.http.post("/layers/"+e+"/permissions",t).json()}},{key:"setPermissions",value:function(e,t){return this.http.put("/layers/"+e+"/permissions",t).json()}},{key:"removePermissions",value:function(e,t){return this.http.delete("/layers/"+e+"/permissions/"+t,null).json()}}]),n}();async function He(e){return(await Promise.all(e.map(e=>e.catch(e=>Ge(e)?e:new Error(e))))).filter(Ve)}function Ge(e){return e instanceof Error}function Ve(e){return!Ge(e)}const ze=["remote"],Je=["remote"];let Qe=function(e){k(n,We);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getLayerInfos",value:function(e){return He(e.map(e=>this.getLayerInfo(e)))}},{key:"getLayersDeps",value:function(e){return He(e.map(e=>this.getResourceDependencies(e)))}},{key:"getBasemaps",value:function(e){return this.getLayersList(d({},e,{types:["LocalTileService","RemoteTileService"]}))}},{key:"createSubLayer",value:function(e){return this.publishStyledLayerService(e)}},{key:"createTileLayer",value:function(e){let{remote:t}=e,n=m(e,ze);return t?this.publishRemoteTileService(n):this.publishLocalTileService(n)}},{key:"updateTileLayer",value:function(e){let{remote:t}=e,n=m(e,Je);return t?this.updateRemoteTileService(n.name,n):this.updateLocalTileService(n.name,n)}},{key:"uploadPreview",value:function(e,t){return this.setPreview(e,{file:t})}},{key:"findOne",value:function(e){return this.getLayerInfo(e)}},{key:"findAll",value:function(e){return this.getLayersList(e)}},{key:"create",value:function(e){return this.publishPostgresLayerService(e)}},{key:"update",value:function(e){return this.updatePostgresLayerService(e.name,e)}},{key:"createQueryLayer",value:function(e){return this.publishQueryLayerService(e)}},{key:"updateQueryLayer",value:function(e){return this.updateQueryLayerService(e.name,e)}},{key:"createProxyLayer",value:function(e){return this.publishProxyService(e)}},{key:"updateProxyLayer",value:function(e){return this.updateProxyService(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}();var Ke;(Ke=exports.ErrorReason||(exports.ErrorReason={})).HTTP_OTHER="other",Ke.HTTP_CLIENT="client",Ke.HTTP_SERVER="server",Ke.UNKNOWN="unknown";const Xe=e=>e instanceof n.HTTPError?(e=>{const t=e.response.status;let n=exports.ErrorReason.HTTP_OTHER;return t>=400&&t<500&&(n=exports.ErrorReason.HTTP_CLIENT),t>=500&&(n=exports.ErrorReason.HTTP_SERVER),{type:"http",reason:n,status:t,origin:e}})(e):(e=>({type:"base",reason:exports.ErrorReason.UNKNOWN,origin:e}))(e),Ye=e=>e&&e.type&&e.reason;function Ze(e){return function(t){return!!t.type&&e.includes(t.type)}}const $e=Ze(["PostgresLayerService","PostgresTileLayerService","QueryLayerService"]);function et(e){return"string"==typeof e}function tt(e,t,n){return n.indexOf(e)===t}const nt=o.customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789",12);(exports.ResourceSeparator||(exports.ResourceSeparator={})).Server=".";let rt=function(){function e(t){let{account:n}=t;y(this,e),this.account=n}return v(e,[{key:"createId",value:function(){return nt()}},{key:"createResourceName",value:function(e){void 0===e&&(e={});const t=e.workspace||this.account.user&&this.account.user.namespace||"",n=e.name||this.createId(),r=e.separator||exports.ResourceSeparator.Server;return t||console.warn("Resource should have workspace. Check account api"),""+t+r+n}},{key:"createTempResourceName",value:function(e){return void 0===e&&(e={}),this.createResourceName(d({workspace:"temp"},e))}},{key:"extractResource",value:function(e){if(e&&e.includes(exports.ResourceSeparator.Server)){const t=e.split(exports.ResourceSeparator.Server),n=t.pop();return{workspace:t.join(exports.ResourceSeparator.Server),name:n}}return{name:"",workspace:""}}},{key:"extractResourceName",value:function(e){return this.extractResource(e).name||e||""}},{key:"extractResourceWorkspace",value:function(e){return this.extractResource(e).workspace||""}}]),e}(),st=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getNamespaces",value:function(e){return this.http.get("/namespaces",e).json()}},{key:"createNamespace",value:function(e){return this.http.post("/namespaces",null,e).json()}},{key:"getNamespace",value:function(e){return this.http.get("/namespaces/"+e).json()}},{key:"removeNamespace",value:function(e){return this.http.delete("/namespaces/"+e,null).then(()=>{})}}]),n}(),it=function(e){k(n,st);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),ot=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getSubscriptionList",value:function(){return this.http.get("/notifications/subscribes").json()}},{key:"subscribeOperation",value:function(e){return this.http.post("/notifications/subscribes",null,e).then(()=>{})}},{key:"unsubscribeOperation",value:function(e){return this.http.delete("/notifications/subscribes",null,e).then(()=>{})}},{key:"subscribeListOperation",value:function(e){return this.http.post("/notifications/subscribe-list",e).then(()=>{})}},{key:"unsubscribeListOperation",value:function(e){return this.http.post("/notifications/unsubscribe-list",e).then(()=>{})}}]),n}();var at;(at=exports.ConnectionStatus||(exports.ConnectionStatus={})).Initialized="Initialized",at.Connected="Connected",at.Break="Break",at.Lost="Lost",at.SessionClosed="SessionClosed";let ut=function(e){k(r,ot);var n=w(r);function r(e,s,i){var o;return void 0===i&&(i=!1),y(this,r),(o=n.call(this,e)).api=s,o.MAX_WS_RECONNECT_TRIES=10,o.keepAlive=!1,o.reconnectTries=0,o.subscriptions=[],o._connectStatus=exports.ConnectionStatus.Initialized,o.onWsConnected=()=>{o.connectStatus=exports.ConnectionStatus.Connected,o.keepAlive&&(o.keepAliveTimeout=setInterval(()=>{o.ws&&o.ws.send(JSON.stringify({keepAlive:!0}))},5e3))},o.onWsClosed=e=>{4001===e.code||4002===e.code?o.connectStatus=exports.ConnectionStatus.SessionClosed:o.reconnectTries<o.MAX_WS_RECONNECT_TRIES?(o.connectStatus=exports.ConnectionStatus.Break,o.reconnectTries++,o.ws&&(o.ws.onopen=null,o.ws.onclose=null,o.ws.onmessage=null,o.ws=void 0),o.keepAliveTimeout&&clearInterval(o.keepAliveTimeout),setTimeout(()=>{o.connect()},0)):o.connectStatus=exports.ConnectionStatus.Lost},o.onWsMessage=e=>{let t={};try{t=JSON.parse(e.data)}catch(e){console.debug("Failed to parse ws message from sp.")}if("notification"===t.type&&t.data){const{tag:e,data:n}=t.data;e&&o.emitter.emit(e,new lt(n))}},o.emitter=new t.EventEmitter,o.keepAlive=i,o}return v(r,[{key:"connectStatus",get:function(){return this._connectStatus},set:function(e){this.emitter.emit("ConnectionStatus",new lt(e)),this._connectStatus=e}},{key:"currentWs",get:function(){return this.ws}},{key:"on",value:function(e,t){this.emitter.on(e,t)}},{key:"off",value:function(e,t){this.emitter.off(e,t)}},{key:"subscribe",value:async function(e){this.subscriptions.push(e),setTimeout(()=>{!this.api.isShared&&this.subscriptions.length&&this.subscribeListOperation(this.subscriptions),this.subscriptions=[]},500)}},{key:"unsubscribe",value:async function(e){if((await this.getSubscriptionList()).includes(e))return this.unsubscribeOperation({tag:e})}},{key:"connectWs",value:function(e){const t=e.replace("http://","ws://").replace("https://","wss://");this.wsUrl=t,this.connect()}},{key:"connect",value:function(){this.wsUrl?(this.ws=new WebSocket(this.wsUrl),this.ws.onopen=this.onWsConnected,this.ws.onclose=this.onWsClosed,this.ws.onmessage=this.onWsMessage):console.warn("Connection to WebSocket not allowed. wsUrl not provided")}}]),r}(),lt=v((function e(t){y(this,e),this.data=t})),ct=function(e){k(n,$);var t=w(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).config=null,e}return v(n,[{key:"fetchPortalSettings",value:async function(e){return this.config=JSON.parse(await this.getConfiguration(e)),this.config}}]),n}(),pt=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"print",value:function(e){return this.http.post("/print/print",e).blob()}},{key:"printToHtml",value:function(e){return this.http.post("/print/printHtml",e).text()}},{key:"uploadTemplate",value:function(e,t){return this.http.post("/print/templates",L(t),e).then(()=>{})}},{key:"getTemplates",value:function(){return this.http.get("/print/templates").json()}},{key:"deleteTemplate",value:function(e){return this.http.delete("/print/templates/"+e,null).then(()=>{})}},{key:"getTemplate",value:function(e){return this.http.get("/print/templates/"+e).text()}}]),n}(),ht=function(e){k(n,pt);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),yt=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getProjectsList",value:function(e){return this.http.get("/projects",e).json()}},{key:"createProject",value:function(e){return this.http.post("/projects",e).json()}},{key:"setPermissionsBatch",value:function(e){return this.http.put("/projects",e).then(()=>{})}},{key:"deleteResources",value:function(e){return this.http.delete("/projects",null,e).json()}},{key:"updateProject",value:function(e,t){return this.http.patch("/projects/"+e,t).json()}},{key:"getProjectInfo",value:function(e){return this.http.get("/projects/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/projects/"+e,null).then(()=>{})}},{key:"getProjectsInfo",value:function(e){return this.http.get("/projects/batchInfo",e).json()}},{key:"getProjectLayersExtendedInfo",value:function(e){return this.http.get("/projects/"+e+"/extended-info").json()}},{key:"getTilesLayerImage",value:function(e,t,n,r){return this.http.createUrl("/projects/"+e+"/tile/"+r+"/"+t+"/"+n)}},{key:"getPreview",value:function(e){return this.http.createUrl("/projects/"+e+"/preview")}},{key:"setPreview",value:function(e,t){return this.http.post("/projects/"+e+"/preview",L(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/projects/"+e+"/preview",null).then(()=>{})}},{key:"isExists",value:function(e){return this.http.get("/projects/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/projects/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/projects/"+e+"/references").json()}},{key:"getPermissions",value:function(e){return this.http.get("/projects/"+e+"/permissions").json()}},{key:"addPermissions",value:function(e,t){return this.http.post("/projects/"+e+"/permissions",t).json()}},{key:"setPermissions",value:function(e,t){return this.http.put("/projects/"+e+"/permissions",t).json()}},{key:"removePermissions",value:function(e,t){return this.http.delete("/projects/"+e+"/permissions/"+t,null).json()}}]),n}(),ft=function(e){k(n,yt);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getProjectInfos",value:function(e){return He(e.map(e=>this.getProjectInfo(e)))}},{key:"getProjectsDeps",value:function(e){return He(e.map(e=>this.getResourceDependencies(e)))}},{key:"uploadPreview",value:function(e,t){return this.setPreview(e,{file:t})}},{key:"findOne",value:function(e){return this.getProjectInfo(e)}},{key:"findAll",value:function(e){return this.getProjectsList(e)}},{key:"create",value:function(e){return this.createProject(e)}},{key:"update",value:function(e){return this.updateProject(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}(),vt=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"checkLimits",value:function(e){return this.http.get("/resources/checkLimits",e).json()}},{key:"copyResources",value:function(e){return this.http.post("/resources/copy",e).json()}}]),n}(),dt=function(e){k(n,vt);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();var kt;(kt=exports.DependencyType||(exports.DependencyType={})).Layer="Layer",kt.Table="Table",kt.Project="Project";let gt=function(){function e(t,n,r){y(this,e),this.projects=t,this.layers=n,this.tables=r}return v(e,[{key:"getProjectInfosWithDeps",value:async function(e){const t=await this.projects.getProjectInfos(e),n=await this.projects.getProjectsDeps(e),{layers:r,tables:s}=await this.getDependencies(n,!0,!0);return{projects:t,deps:{layers:r,tables:s}}}},{key:"getLayerInfosWithDeps",value:async function(e){const t=await this.layers.getLayerInfos(e),n=await this.layers.getLayersDeps(e),{tables:r}=await this.getDependencies(n,!1,!0);return{layers:t,deps:{tables:r}}}},{key:"getDependencies",value:async function(e,t,n){const{tables:r,layers:s}=e.reduce((e,r)=>{const s=r.dependencies||[];if(t){const t=this.getDependentNames(s,exports.DependencyType.Layer);e.layers.push(...t)}if(n){const t=this.getDependentNames(s,exports.DependencyType.Table);e.tables.push(...t)}return e},{tables:[],layers:[]});return{tables:await this.tables.getTableInfos(r.filter(tt)),layers:await this.layers.getLayerInfos(s.filter(tt))}}},{key:"getDependentNames",value:function(e,t){return e.filter(e=>{let{type:n}=e;return n===t}).map(e=>{let{name:t}=e;return t}).filter(et)}}]),e}(),mt=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getTaskList",value:function(e){return this.http.get("/scheduler/tasks",e).json()}},{key:"getTaskInfo",value:function(e){return this.http.get("/scheduler/tasks/"+e).json()}},{key:"getTaskProgress",value:function(e){return this.http.get("/scheduler/tasks/"+e+"/progress").json()}},{key:"cancelTask",value:function(e){return this.http.post("/scheduler/tasks/"+e+"/cancel",null).json()}},{key:"startCopyTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"copy"}).json()}},{key:"startAggregateTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"aggregate"}).json()}},{key:"startBufferTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"buffer"}).json()}},{key:"startPrintTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"print"}).json()}},{key:"startTilingTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"tiling"}).json()}},{key:"startTilingTask1",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"rasterVrt"}).json()}},{key:"startNetCdfTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"netcdf"}).json()}},{key:"startRouteTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"route"}).json()}},{key:"startUnionTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"union"}).json()}},{key:"startOverlayTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"overlay"}).json()}},{key:"startFilterCopyTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"filterCopy"}).json()}},{key:"startPipelineTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"pipeline"}).json()}},{key:"startEditAttributesBatch",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"editAttributes"}).json()}},{key:"universalSearchTask",value:function(e){return this.http.post("/scheduler/tasks",e,{type:"universalSearch"}).json()}}]),n}(),bt=function(e){k(n,mt);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"init",value:function(e){return this.notification=e,this.notification.subscribe("server_task")}},{key:"runCopyTask",value:async function(e){const{taskId:t}=await this.startCopyTask(e);return this.processTaskId(t)}},{key:"runBufferTask",value:async function(e){const{taskId:t}=await this.startBufferTask(e);return this.processTaskId(t)}},{key:"runUnionTask",value:async function(e){const{taskId:t}=await this.startUnionTask(e);return this.processTaskId(t)}},{key:"runPrintTask",value:async function(e){const{taskId:t}=await this.startPrintTask(e);return this.processTaskId(t)}},{key:"runTilingTask",value:async function(e){const{taskId:t}=await this.startTilingTask(e);return this.processTaskId(t)}},{key:"runRouteTask",value:async function(e){const{taskId:t}=await this.startRouteTask(e);return this.processTaskId(t)}},{key:"runOverlayTask",value:async function(e){const{taskId:t}=await this.startOverlayTask(e);return this.processTaskId(t)}},{key:"runFilterCopyTask",value:async function(e){const{taskId:t}=await this.startFilterCopyTask(e);return this.processTaskId(t)}},{key:"runPipelineTask",value:async function(e){const{taskId:t}=await this.startPipelineTask(e);return this.processTaskId(t)}},{key:"runEditAttributesTask",value:async function(e){const{taskId:t}=await this.startEditAttributesBatch(e);return this.processTaskId(t)}},{key:"waitTaskCompleted",value:async function(e){return new Promise(async(t,n)=>{const r=await this.getTaskProgress(e);this.resolveTaskStatus(r,t,n);const s=async r=>{let{data:i}=r;if(i.taskId===e&&i.status&&["Completed","Failed","Canceled"].includes(i.status)){const r=await this.getTaskProgress(e);this.notification&&this.notification.off("server_task",s),this.resolveTaskStatus(r,t,n)}};this.notification&&this.notification.on("server_task",s)})}},{key:"resolveTaskStatus",value:function(e,t,n){"Completed"===e.status?t(e):"Failed"!==e.status&&"Canceled"!==e.status||n(e.status)}},{key:"processTaskId",value:function(e){if(e)return this.waitTaskCompleted(e);throw new Error("Task was started with no testId")}}]),n}(),xt=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"findUserByNameByRoles",value:function(e){return this.http.get("/security/findUsersWithRoles",e).json()}},{key:"getUsersAndRoles",value:function(e){return this.http.get("/security/usersandroles",e).json()}},{key:"findUserByName",value:function(e){return this.http.get("/security/users",e).json()}},{key:"getPolicyList",value:function(e){return this.http.get("/security/policies",e).json()}},{key:"removePolicy",value:function(e){return this.http.delete("/security/policies",null,e).then(()=>{})}},{key:"setPolicy",value:function(e){return this.http.post("/security/policies",e).then(()=>{})}}]),n}(),wt=function(e){k(n,xt);var t=w(n);function n(e,r){var s;let{username:i,roles:o}=r;return y(this,n),(s=t.call(this,e)).ownerName="",s.ownerRoles=[],s.ownerName=i,s.ownerRoles=o,s}return v(n,[{key:"reset",value:function(){this.ownerName="",this.ownerRoles=[]}}]),n}(),Tt=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"statisticsDb",value:function(e){return this.http.get("/statistics",e).json()}},{key:"statisticsDb1",value:function(e){return this.http.post("/statistics",e).json()}},{key:"classify",value:function(e){return this.http.get("/statistics/classify",e).json()}},{key:"classify1",value:function(e){return this.http.post("/statistics/classify",e).json()}},{key:"sumOfProduct",value:function(e){return this.http.get("/statistics/sumOfProduct",e).json()}},{key:"sumOfProduct1",value:function(e){return this.http.post("/statistics/sumOfProduct",e).json()}}]),n}(),jt=function(e){k(n,Tt);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getStatistic",value:function(e){return this.statisticsDb(e)}},{key:"postStatistic",value:function(e){return this.statisticsDb1(e)}},{key:"getClassify",value:function(e){return this.classify(e)}},{key:"postClassify",value:function(e){return this.classify1(e)}}]),n}(),St=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getStyle",value:function(e){return this.http.get("/styles/"+e).json()}},{key:"updateStyle",value:function(e,t){return this.http.post("/styles/"+e,t).json()}},{key:"createStyle",value:function(e){return this.http.post("/styles",e).json()}},{key:"getAllFonts",value:function(){return this.http.get("/styles/fonts").json()}},{key:"addFont",value:function(e){return this.http.post("/styles/fonts",L(e)).then(()=>{})}},{key:"removeFont",value:function(e){return this.http.delete("/styles/fonts",null,e).then(()=>{})}}]),n}(),Pt=function(e){k(n,St);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const It=["name"],Lt=["name"],Rt=["name"],Ct=["name"];let Et=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getTableList",value:function(e){return this.http.get("/tables",e).json()}},{key:"createTable",value:function(e){return this.http.post("/tables",e).json()}},{key:"setPermissionsBatch",value:function(e){return this.http.put("/tables",e).then(()=>{})}},{key:"deleteResources",value:function(e){return this.http.delete("/tables",null,e).json()}},{key:"updateTable",value:function(e,t){return this.http.patch("/tables/"+e,t).json()}},{key:"putTable",value:function(e,t){return this.http.put("/tables/"+e,t).json()}},{key:"getTableInfo",value:function(e){return this.http.get("/tables/"+e).json()}},{key:"deleteResource",value:function(e){return this.http.delete("/tables/"+e,null).then(()=>{})}},{key:"getTablesInfo",value:function(e){return this.http.get("/tables/batchInfo",e).json()}},{key:"getTableData",value:function(e){let{name:t}=e,n=m(e,It);return this.http.get("/tables/"+t+"/data",n).json()}},{key:"writeTableData",value:function(e,t){return this.http.post("/tables/"+e+"/data",t).then(()=>{})}},{key:"updateTableData",value:function(e,t){let{name:n}=e,r=m(e,Lt);return this.http.patch("/tables/"+n+"/data",t,r).then(()=>{})}},{key:"deleteTableData",value:function(e){let{name:t}=e,n=m(e,Rt);return this.http.delete("/tables/"+t+"/data",null,n).then(()=>{})}},{key:"getUniqueDataRows",value:function(e){let{name:t}=e,n=m(e,Ct);return this.http.get("/tables/"+t+"/data/unique-values",n).json()}},{key:"mapTable",value:function(e,t){return this.http.post("/tables/map-table",t,e).json()}},{key:"unmapTable",value:function(e){return this.http.delete("/tables/map-table/"+e,null).then(()=>{})}},{key:"getPreview",value:function(e){return this.http.createUrl("/tables/"+e+"/preview")}},{key:"setPreview",value:function(e,t){return this.http.post("/tables/"+e+"/preview",L(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/tables/"+e+"/preview",null).then(()=>{})}},{key:"isExists",value:function(e){return this.http.get("/tables/"+e+"/exists").then(()=>{})}},{key:"getResourceDependencies",value:function(e){return this.http.get("/tables/"+e+"/dependencies").json()}},{key:"getResourceReferences",value:function(e){return this.http.get("/tables/"+e+"/references").json()}},{key:"getPermissions",value:function(e){return this.http.get("/tables/"+e+"/permissions").json()}},{key:"addPermissions",value:function(e,t){return this.http.post("/tables/"+e+"/permissions",t).json()}},{key:"setPermissions",value:function(e,t){return this.http.put("/tables/"+e+"/permissions",t).json()}},{key:"removePermissions",value:function(e,t){return this.http.delete("/tables/"+e+"/permissions/"+t,null).json()}}]),n}(),Ut=function(e){k(n,Et);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getTableInfos",value:function(e){return He(e.map(e=>this.getTableInfo(e)))}},{key:"uploadPreview",value:function(e,t){return this.setPreview(e,{file:t})}},{key:"findOne",value:function(e){return this.getTableInfo(e)}},{key:"findAll",value:function(e){return this.getTableList(e)}},{key:"create",value:function(e){return this.createTable(e)}},{key:"update",value:function(e){return this.updateTable(e.name,e)}},{key:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}(),Ft=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}(),Nt=function(e){k(n,Ft);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n)}();const At=["name","z","x","y"];let Dt=function(e){k(n,R);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getVectorTile",value:function(e){let{name:t,z:n,x:r,y:s}=e,i=m(e,At);return this.http.get("/vt/"+t+"/"+n+"/"+r+"/"+s+".pbf",i).then(()=>{})}}]),n}(),Ot=function(e){k(n,Dt);var t=w(n);function n(){return y(this,n),t.apply(this,arguments)}return v(n,[{key:"getVt",value:function(e,t,n,r,s){return this.getVectorTile({name:e,z:t,x:n,y:r,isProject:s})}}]),n}();var Bt;(Bt=exports.UrlPath||(exports.UrlPath={})).Base="/map",Bt.Shared="/shared",Bt.Portal="/portal";const Mt={401:exports.ApiEvent.Unauthorized},qt=Object.values(exports.UrlPath),_t=qt[0];let Wt=function(e){k(i,t.EventEmitter);var r=w(i);function i(e){var t;let{url:o,wsUrl:a,wsKeepAlive:u,snappingHubUrl:l,http:c,urlPath:p,httpOptions:h}=e;y(this,i),t=r.call(this);const{hooks:f}=h||{};return t.http=c||new S(d({prefixUrl:o,timeout:!1},h||{},{hooks:d({},f||{},{beforeRequest:[...f&&f.beforeRequest||[]],afterResponse:[e=>{const r=Mt[e.status];return r&&t.emit(r,Xe(new n.HTTPError(e))),e},...f&&f.afterResponse||[]]})})),t.url=o,t.wsUrl=a||o,t.urlPath=p||t.defineUrlPath(),t.layers=new Qe(t.http),t.tables=new Ut(t.http),t.projects=new ft(t.http),t.resources=new gt(t.projects,t.layers,t.tables),t.styles=new Pt(t.http),t.account=new M(t.http),t.accountPreview=new W(t.http,t.account),t.bulk=new G(t.http),t.security=new wt(t.http,t.account),t.notification=new ut(t.http,b(t),u),t.scheduler=new bt(t.http),t.file=new ue(t.http),t.filters=new ce(t.http),t.import=new xe(t.http),t.geocode=new ke(t.http),t.cameras=new Z(t.http),t.print=new ht(t.http),t.tools=new Nt(t.http),t.resourceCatalog=new dt(t.http),t.general=new he(t.http),t.namespace=new it(t.http),t.external=new se(t.http),t.clientSettings=new ee(t.http),t.portalSettings=new ct(t.http),t.iceRouter=new me(t.http),t.statistic=new jt(t.http),t.feedback=new oe(t.http),t.vectorTiles=new Ot(t.http),t.universalSearch=new F(t.http),t.spatialReference=new E(t.http),t.eqlTest=new ne(t.http),t.catalog=new N(t.http),t.queryToken=new C(t.http),t.names=new rt({account:t.account}),t.snappingHub=l?(new s.HubConnectionBuilder).withUrl(l,{withCredentials:!0,skipNegotiation:!0,transport:s.HttpTransportType.WebSockets}).withAutomaticReconnect().build():null,t}return v(i,[{key:"init",value:async function(e){let{authParams:t,connectWs:n,initScheduler:r,fetchSettings:s,fetchUser:i}=e;try{await this.account.login(t),i&&await this.account.fetchCurrentUser(),n&&await this.connectWs(),r&&await this.initScheduler(),s&&await this.clientSettings.fetchClientSettings({urlPath:this.urlPath}),await this.notification.subscribe("service_update")}catch(e){throw Xe(e)}}},{key:"isAcceptedNetwork",value:function(e){return["vk","google","facebook"].includes(e)}},{key:"socAuthLogin",value:async function(e){if(this.isAcceptedNetwork(e))try{await this.clientSettings.fetchClientSettings({urlPath:exports.UrlPath.Base})}catch(e){throw Xe(e)}}},{key:"connectWs",value:async function(){this.account.isAuth&&(this.notification.connectWs(this.wsUrl),this.notification.on("ConnectionStatus",e=>{e.data===exports.ConnectionStatus.Lost?this.emit(exports.ApiEvent.ConnectionLost,e.data):e.data===exports.ConnectionStatus.SessionClosed&&this.emit(exports.ApiEvent.SessionClosed,e.data)}))}},{key:"connectSignalR",value:async function(){this.account.isAuth&&this.snappingHub&&this.snappingHub.state!==s.HubConnectionState.Connected&&await this.snappingHub.start()}},{key:"logout",value:async function(){await this.account.logout(),await this.security.reset(),this.emit(exports.ApiEvent.Unauthorized,null)}},{key:"initScheduler",value:function(){return this.scheduler.init(this.notification)}},{key:"defineUrlPath",value:function(){const e=(window.location.href.split(window.location.hostname)[1]||"").split("/").filter(Boolean)[0],t=e?"/"+e:void 0;return t&&qt.includes(t)?t:_t}},{key:"isShared",get:function(){return this.urlPath===exports.UrlPath.Shared}}]),i}(),Ht=function(e){k(n,l.TileLayer);var t=w(n);function n(e,r){var s;return y(this,n),(s=t.call(this,"",{crs:e.crs,opacity:e.opacity})).api=r,s.name=e.name,s.sourceUrl=e.sourceUrl,s.subDomains=e.subDomains,s}return v(n,[{key:"getTileUrl",value:function(e,t,n){var r;const s=this.name,i=this.subDomains?function(e,t){void 0===e&&(e=0),void 0===t&&(t=100);let n=t-e,r=Math.random();return r=Math.floor(r*n),r+=e,r}(0,(null==(r=this.subDomains)?void 0:r.length)-1):void 0;return this.sourceUrl?(this.subDomains&&void 0!==i?this.sourceUrl.replace("{0}",this.subDomains[i]):this.sourceUrl).replace("{1}",""+n).replace("{2}",""+e).replace("{3}",""+t):this.api.layers.getTilesLayerImage({x:e,y:t,z:n,name:s})}}]),n}();const Gt=["name","style","condition","dataFilterId","crs"];let Vt=function(e){k(n,p.DynamicLayer);var t=w(n);function n(e,r){var s;let{name:i,style:o,condition:a,dataFilterId:u,crs:l=c.webMercator}=e,p=m(e,Gt);return y(this,n),(s=t.call(this,p)).api=r,s.name=i,s.styleId=o,s.conditionQuery=a,s.filterId=u,s.crs=l,s.subscribeRedraw(),s}return v(n,[{key:"style",get:function(){return this.styleId},set:function(e){this.styleId=e,this.forceUpdate()}},{key:"condition",get:function(){return this.conditionQuery},set:function(e){this.conditionQuery=e,this.forceUpdate()}},{key:"dataFilterId",get:function(){return this.filterId},set:function(e){this.filterId=e,this.forceUpdate()}},{key:"getUrl",value:function(e,t){return this.api.layers.getLayerImage({name:this.name,extent:e.coordinates,size:[t.width,t.height],extentSr:e.crs.wkid,styleId:this.styleId,condition:this.conditionQuery,dataFilterId:this.filterId})}},{key:"subscribeRedraw",value:function(){this.api.notification.on("service_update",e=>{(null==e?void 0:e.data.layerName)===this.name&&(this.forceUpdate(),this.redraw())})}}]),n}();const zt={RemoteTileService:Ht,LocalTileService:Ht,PostgresLayerService:Vt,StyledFeatureLayer:Vt,CompositeService:null};let Jt=function(){function e(t,n){y(this,e),this.layers=t,this.http=n}return v(e,[{key:"getLayerService",value:async function(e){let t=await this.getLayerInfo(e);const n=t.type;if(!(e=>Boolean(e&&Object.keys(zt).includes(e)))(n))return;const r=zt[n];if(r)return new r((e=>d({},e,{name:"services/"+e.name}))(t),this.http);throw new Error('Constructor for service type: "'+t.type+'" not implemented')}},{key:"getLayerInfo",value:async function(e){try{return await this.layers.getLayerInfo(e)}catch(t){throw new Error('Service with name: "'+e+'" not exists')}}}]),e}();var Qt;!function(e){e[e.BaseMaps=0]="BaseMaps",e[e.Layers=1]="Layers"}(Qt||(Qt={}));let Kt=function(e){k(n,Wt);var t=w(n);function n(e,r,s){var i;return y(this,n),(i=t.call(this,r)).map=new u.Map,i.painter=new a.DomPainter(i.map),i.mapProps=e,i.auth=s,i.layersManager=new Jt(i.layers,i.http),i}return v(n,[{key:"init",value:async function(){await j(g(n.prototype),"init",this).call(this,{authParams:this.auth,connectWs:!0,fetchSettings:!0,initScheduler:!0});const{baseService:e,services:t,projectName:r}=this.mapProps;e&&await this.setBaseMap(e),t&&await Promise.all(t.map(e=>this.addLayer(e))),r&&await this.loadProject(r),this.setMapProps()}},{key:"reset",value:async function(){await this.account.logout(),this.painter.wrapper=null}},{key:"addLayer",value:async function(e){await this.insertLayer(e,Qt.Layers)}},{key:"setBaseMap",value:async function(e){await this.insertLayer(e,Qt.BaseMaps)}},{key:"loadProject",value:async function(e){const t=await this.projects.getProjectInfo(e);if(!t||!t.content)return;const{baseMapName:n,items:r}=t.content;if(n&&await this.setBaseMap(n),r){const e=r.map(e=>e.name).filter(Xt);await Promise.all(e.map(e=>this.addLayer(e)))}}},{key:"insertLayer",value:async function(e,t){const n=await this.layersManager.getLayerService(e);n&&this.map.insertLayer(n.layer,t)}},{key:"setMapProps",value:function(){const{position:e,centerPoint:t,mapWrapper:n,resolution:r}=this.mapProps;e?this.map.position=e:t&&(this.map.centerPoint=t),r&&(this.map.resolution=r),n&&(this.painter.wrapper=n)}}]),n}();const Xt=e=>void 0!==e;var Yt,Zt,$t,en,tn,nn,rn,sn,on,an,un,ln,cn,pn,hn,yn,fn,vn,dn,kn,gn,mn,bn,xn,wn,Tn,jn,Sn,Pn,In,Ln,Rn;(Yt=exports.AggregationFunction||(exports.AggregationFunction={})).None="None",Yt.Array="Array",Yt.Min="Min",Yt.Max="Max",Yt.Avg="Avg",Yt.Sum="Sum",Yt.Extent="Extent",Yt.H3="H3",Yt.Count="Count",Yt.TotalCount="TotalCount",Yt.DistinctCount="DistinctCount",Yt.First="First",Yt.Last="Last",Yt.Median="Median",Yt.Mod="Mod",Yt.StdDeviation="StdDeviation",Yt.SumOfProduct="SumOfProduct",Yt.OnlyValue="OnlyValue",Yt.WeightedAvg="WeightedAvg",Yt.DensityIndicators="DensityIndicators",Yt.DividedSum="DividedSum",(Zt=exports.AttributeSelectorType||(exports.AttributeSelectorType={})).None="None",Zt.SelectFromHandBook="SelectFromHandBook",Zt.SelectFromRange="SelectFromRange",Zt.ViewHandBook="ViewHandBook",($t=exports.AttributeType||(exports.AttributeType={})).Unknown="Unknown",$t.String="String",$t.Int32="Int32",$t.Int64="Int64",$t.Double="Double",$t.DateTime="DateTime",$t.Boolean="Boolean",$t.Point="Point",$t.Polyline="Polyline",$t.MultiPolygon="MultiPolygon",$t.Multipoint="Multipoint",$t.H3Index="H3Index",$t.Json="Json",(en=exports.ClassificationType||(exports.ClassificationType={})).None="none",en.NaturalBreaks="naturalBreaks",en.EqualInterval="equalInterval",en.Quantile="quantile",en.Unique="unique",(tn=exports.ClassifyAttributeType||(exports.ClassifyAttributeType={})).Decimal="decimal",tn.DateTime="dateTime",tn.Text="text",(nn=exports.ConfigurationErrorEnum||(exports.ConfigurationErrorEnum={})).Unknown="Unknown",nn.SerializeError="SerializeError",nn.InvalidDataService="InvalidDataService",nn.InvalidConfiguration="InvalidConfiguration",nn.InvalidDataServiceName="InvalidDataServiceName",nn.InvalidTableName="InvalidTableName",nn.InvalidLayerName="InvalidLayerName",nn.ResourceNotFound="ResourceNotFound",nn.InvalidCondition="InvalidCondition",nn.InvalidAttributes="InvalidAttributes",nn.InvalidIdAttribute="InvalidIdAttribute",nn.InvalidGeometryAttribute="InvalidGeometryAttribute",nn.InvalidGeometryAttributeType="InvalidGeometryAttributeType",nn.InvalidColumnName="InvalidColumnName",nn.InvalidIdColumnSettings="InvalidIdColumnSettings",nn.ColumnNotExistsInTable="ColumnNotExistsInTable",nn.InvalidStyle="InvalidStyle",nn.InvalidLayerType="InvalidLayerType",nn.ColumnLoadingError="ColumnLoadingError",nn.InvalidAttributeFormat="InvalidAttributeFormat",nn.DataSourceNotFound="DataSourceNotFound",nn.DuplicateColumns="DuplicateColumns",nn.DuplicateAttributes="DuplicateAttributes",nn.TableWithoutColumns="TableWithoutColumns",nn.InvalidTableReferenceConfiguration="InvalidTableReferenceConfiguration",(rn=exports.ErrorDetailsType||(exports.ErrorDetailsType={})).ResourceLimitExceeded="ResourceLimitExceeded",rn.ResourceNotFound="ResourceNotFound",rn.InternalError="InternalError",rn.BadRequest="BadRequest",rn.DuplicateContent="DuplicateContent",(sn=exports.ErrorType||(exports.ErrorType={})).NotSpecified="NotSpecified",sn.LimitError="LimitError",sn.ValidationError="ValidationError",sn.JwtExpired="JwtExpired",sn.TokenInvalid="TokenInvalid",sn.RefreshTokenExpired="RefreshTokenExpired",sn.RefreshTokenInvalid="RefreshTokenInvalid",sn.CreateUserFailed="CreateUserFailed",sn.SetUserPasswordFailed="SetUserPasswordFailed",sn.SetUserRoleFailed="SetUserRoleFailed",sn.UpdateUserFailed="UpdateUserFailed",sn.RemoveUserFailed="RemoveUserFailed",sn.CreateRoleFailed="CreateRoleFailed",sn.UpdateRoleFailed="UpdateRoleFailed",sn.RemoveUserRoleFailed="RemoveUserRoleFailed",sn.ChangeActiveStateFailed="ChangeActiveStateFailed",sn.RemoveRoleFailed="RemoveRoleFailed",sn.UserNotFound="UserNotFound",sn.RoleNotFound="RoleNotFound",sn.EmailNotConfirmed="EmailNotConfirmed",sn.DuplicateEmailError="DuplicateEmailError",sn.InvalidPassword="InvalidPassword",sn.RoleExists="RoleExists",sn.UserExists="UserExists",sn.UserLockedError="UserLockedError",sn.InvalidEmail="InvalidEmail",sn.InvalidUsername="InvalidUsername",sn.Unauthorized="Unauthorized",sn.EmailNotChanged="EmailNotChanged",sn.EmailNotSet="EmailNotSet",(on=exports.FeatureType||(exports.FeatureType={})).Unknown="Unknown",on.GeometricFeature="GeometricFeature",(an=exports.FontStyle||(exports.FontStyle={})).Normal="normal",an.Oblique="oblique",an.Italic="italic",(un=exports.FontWeight||(exports.FontWeight={})).Thin="Thin",un.ExtraLight="ExtraLight",un.Light="Light",un.SemiLight="SemiLight",un.Normal="Normal",un.Medium="Medium",un.DemiBold="DemiBold",un.Bold="Bold",un.ExtraBold="ExtraBold",un.Black="Black",un.ExtraBlack="ExtraBlack",(ln=exports.GeometryType||(exports.GeometryType={})).Unknown="unknown",ln.Point="point",ln.Polyline="polyline",ln.Polygon="multipolygon",ln.Envelope="envelope",ln.Multipoint="multipoint",(cn=exports.Group||(exports.Group={})).My="my",cn.Role="role",cn.Public="public",cn.All="all",(pn=exports.LineCapStyle||(exports.LineCapStyle={})).Flat="Flat",pn.Square="Square",pn.Round="Round",pn.Triangle="Triangle",(hn=exports.LineEndingType||(exports.LineEndingType={})).None="none",hn.Arrow="arrow",hn.FilledArrow="filledArrow",hn.Square="square",hn.FilledSquare="filledSquare",hn.Circle="circle",hn.FilledCircle="filledCircle",hn.Diamond="diamond",hn.FilledDiamond="filledDiamond",hn.RoundSquare="roundSquare",hn.FilledRoundSquare="filledRoundSquare",hn.Svg="svg",(yn=exports.LineJoinType||(exports.LineJoinType={})).Miter="Miter",yn.Bevel="Bevel",yn.Round="Round",(fn=exports.ObjectTypeFilter||(exports.ObjectTypeFilter={})).All="All",fn.Directory="Directory",fn.File="File",(vn=exports.Operation||(exports.Operation={})).Unknown="Unknown",vn.Union="union",vn.Intersection="intersection",vn.Subtraction="subtraction",vn.SymDifference="symDifference",(dn=exports.OwnerFilter||(exports.OwnerFilter={})).My="My",dn.All="All",dn.Other="Other",(kn=exports.PbfSchema||(exports.PbfSchema={})).XYZ="xyz",kn.TMS="tms",(gn=exports.Permissions||(exports.Permissions={})).None="none",gn.Configure="configure",gn.Write="write",gn.Read="read",gn.ReadConfigure="read,configure",gn.ReadWrite="read,write",gn.All="read,write,configure",(mn=exports.PolicyType||(exports.PolicyType={})).Unknown="Unknown",mn.CreateTable="CreateTable",mn.CreateLayer="CreateLayer",mn.CreateProject="CreateProject",mn.MaxFeaturesInOneTable="MaxFeaturesInOneTable",mn.MaxObjectsToExport="MaxObjectsToExport",mn.MaxUploadContentSize="MaxUploadContentSize",(bn=exports.Quality||(exports.Quality={})).Low="Low",bn.Medium="Medium",bn.High="High",(xn=exports.ReferenceJoinType||(exports.ReferenceJoinType={})).OneToMany="OneToMany",xn.OneToOne="OneToOne",xn.Intersect="Intersect",xn.RightJoin="RightJoin",xn.FullJoin="FullJoin",xn.CrossJoin="CrossJoin",(wn=exports.ResourceType||(exports.ResourceType={})).Unknown="Unknown",wn.Table="table",wn.Layer="layer",wn.Project="project",wn.File="file",wn.Feature="feature",wn.Tag="tag",(Tn=exports.ResourceTypeLink||(exports.ResourceTypeLink={})).Table="tables",Tn.Layer="layers",Tn.Project="projects",(jn=exports.ServerTaskStatus||(exports.ServerTaskStatus={})).None="None",jn.Scheduled="Scheduled",jn.Planning="Planning",jn.Executing="Executing",jn.Completed="Completed",jn.Failed="Failed",jn.Canceled="Canceled",jn.Timeout="Timeout",(Sn=exports.SimplifyType||(exports.SimplifyType={})).Basic="Basic",Sn.PreserveTopology="PreserveTopology",Sn.VW="VW",(Pn=exports.StringSubType||(exports.StringSubType={})).None="None",Pn.Image="Image",Pn.PkkCode="PkkCode",Pn.Attachments="Attachments",(In=exports.TaskGroup||(exports.TaskGroup={})).My="my",In.All="all",(Ln=exports.TextAlignment||(exports.TextAlignment={})).Right="right",Ln.Left="left",Ln.Center="center",Ln.Justified="justified",(Rn=exports.TextVerticalAlignment||(exports.TextVerticalAlignment={})).Top="top",Rn.Bottom="bottom",Rn.Middle="middle",Object.defineProperty(exports,"HTTPError",{enumerable:!0,get:function(){return n.HTTPError}}),Object.defineProperty(exports,"TimeoutError",{enumerable:!0,get:function(){return n.TimeoutError}}),exports.Account=M,exports.AccountPreview=W,exports.Api=Wt,exports.BulkOperations=G,exports.Cameras=Z,exports.ClientSettings=ee,exports.EqlTest=ne,exports.EvergisDynamicLayer=Vt,exports.EvergisTileLayer=Ht,exports.External=se,exports.Feedback=oe,exports.FileUpload=ue,exports.Filters=ce,exports.GEOCODE_PROVIDER="geocode2gis",exports.General=he,exports.Geocode=ke,exports.HttpClient=S,exports.IceRouter=me,exports.Import=xe,exports.Layers=Qe,exports.LayersManager=Jt,exports.Names=rt,exports.Namespace=it,exports.Notification=ut,exports.NotificationEvent=lt,exports.PortalSettings=ct,exports.Print=ht,exports.Projects=ft,exports.ResourceCatalog=dt,exports.Resources=gt,exports.Scheduler=bt,exports.Security=wt,exports.SpatialProcessor=Kt,exports.Statistic=jt,exports.Styles=Pt,exports.Tables=Ut,exports.Tools=Nt,exports.VectorTiles=Ot,exports.addSubDomainToLocation=e=>window.location.protocol+"//"+e+"."+window.location.host,exports.errorHandler=Xe,exports.formDataFromFile=function(e){const t=new FormData;return t.append("file",e),t},exports.generateId=nt,exports.isEvergisDynamicLayer=function(e){return e instanceof Vt},exports.isEvergisTileLayer=function(e){return e instanceof Ht},exports.isFeatureLayer=function(e){return e instanceof h.FeatureLayer},exports.isHTTPError=e=>Ye(e)&&"http"===e.type,exports.isHandledError=Ye,exports.isLayer=$e,exports.isProjectContentItems=function(e){return null!=e},exports.isString=et,exports.isTileLayerService=function(e){return e.type&&/TileService/.test(e.type)},exports.promiseAllIgnoreErrors=He,exports.stripUselessSlashes=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.join("/").split("/").filter(Boolean).join("/")},exports.toFormData=L,exports.unique=tt;
|
|
2
2
|
//# sourceMappingURL=api.cjs.production.min.js.map
|