@evergis/api 3.0.79 → 3.0.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Api.d.ts +10 -5
- package/dist/__generated__/AccountPreviewService.d.ts +1 -1
- package/dist/__generated__/AccountService.d.ts +3 -3
- package/dist/__generated__/FeedbackService.d.ts +1 -1
- package/dist/__generated__/ImportService.d.ts +6 -28
- package/dist/__generated__/PrintService.d.ts +1 -1
- package/dist/__generated__/ProjectsService.d.ts +2 -2
- package/dist/__generated__/S3Service.d.ts +1 -1
- package/dist/__generated__/StaticContentService.d.ts +1 -1
- package/dist/__generated__/StatisticService.d.ts +2 -2
- package/dist/__generated__/StyleService.d.ts +1 -1
- package/dist/__generated__/TablesService.d.ts +2 -2
- package/dist/__generated__/WmsServerService.d.ts +2 -2
- package/dist/__generated__/data-contracts.d.ts +21 -16
- package/dist/api.cjs.development.js +138 -154
- 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 +140 -156
- package/dist/api.esm.js.map +1 -1
- package/dist/services/Feedback.d.ts +3 -3
- package/package.json +3 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("ky"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,r=require("@evergis/event-emitter"),s=require("query-string"),i=require("nanoid"),o=require("@evergis/sgis/es/painters/DomPainter/DomPainter"),a=require("@evergis/sgis/es/Map"),u=require("@evergis/sgis/es/layers/TileLayer"),l=require("@evergis/sgis/es/layers/DynamicLayer"),c=require("@evergis/sgis");function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(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 y(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),e}function f(){return(f=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 v(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 d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(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 g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?g(e):t}function b(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=d(e);if(t){var s=d(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return m(this,n)}}function w(e,t,n){return(w="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=d(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 x=y((function e(t){p(this,e),this.http=t})),T=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n,[{key:"batchResourcesPermissionsSet",value:function(e){return this.http.put("/bulk/resources/permissions",e).json()}}]),n}(),j=function(e){v(n,T);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n)}(),S=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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}(),P=function(e){v(n,S);var t=b(n);function n(e,r){var s;let{username:i,roles:o}=r;return p(this,n),(s=t.call(this,e)).ownerName="",s.ownerRoles=[],s.ownerName=i,s.ownerRoles=o,s}return y(n,[{key:"reset",value:function(){this.ownerName="",this.ownerRoles=[]}}]),n}(),I=function(){function e(t){var r;void 0===t&&(t={}),p(this,e),this.ky=n.extend(t),this.prefixUrl=(null==(r=t.prefixUrl)?void 0:r.toString())||""}return y(e,[{key:"extend",value:function(e){var t;this.ky=n.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:C(t)})}},{key:"post",value:function(e,t,n){const r=R(n,t);return this.ky.post(this.stripSlashes(e),r)}},{key:"put",value:function(e,t,n){const r=R(n,t);return this.ky.put(this.stripSlashes(e),r)}},{key:"patch",value:function(e,t,n){const r=R(n,t);return this.ky.patch(this.stripSlashes(e),r)}},{key:"delete",value:function(e,t,n){const r=R(n,t);return this.ky.delete(this.stripSlashes(e),r)}},{key:"createUrl",value:function(e,t){const n=t?"?"+C(t):"";return this.prefixUrl+this.stripSlashes(e)+n}},{key:"stripSlashes",value:function(e){return this.prefixUrl?e.replace(/^\//g,""):e}}]),e}();function R(e,t){const n={searchParams:C(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 C(e){return void 0===e&&(e={}),s.stringify(e,{arrayFormat:"comma"})}function L(e){return Object.keys(e).reduce((t,n)=>(t.append(n,e[n]),t),new FormData)}let E=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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(()=>{})}}]),n}(),U=function(e){v(n,E);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n,[{key:"upload",value:function(e,t){return this.uploadFile({file:e,rewrite:!!t})}}]),n}(),F=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n,[{key:"getDataSchema",value:function(e){return this.http.get("/import/dataSchema",e).json()}},{key:"getExcelDataSchema",value:function(e){return this.http.get("/import/excelDataSchema",e).json()}},{key:"getCsvDataSchema",value:function(e){return this.http.get("/import/csvDataSchema",e).json()}},{key:"getKmlDataSchema",value:function(e){return this.http.get("/import/kmlDataSchema",e).json()}},{key:"getRasterAttributes",value:function(e){return this.http.get("/import/rasterAttributes",e).json()}}]),n}(),N=function(e){v(n,F);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n)}(),D=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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 A;(A=exports.ConnectionStatus||(exports.ConnectionStatus={})).Initialized="Initialized",A.Connected="Connected",A.Break="Break",A.Lost="Lost",A.SessionClosed="SessionClosed";let O=function(e){v(n,D);var t=b(n);function n(e,s){var i;return p(this,n),(i=t.call(this,e)).api=s,i.MAX_WS_RECONNECT_TRIES=10,i.reconnectTries=0,i.subscriptions=[],i._connectStatus=exports.ConnectionStatus.Initialized,i.onWsConnected=()=>{i.connectStatus=exports.ConnectionStatus.Connected},i.onWsClosed=e=>{4001===e.code||4002===e.code?i.connectStatus=exports.ConnectionStatus.SessionClosed:i.reconnectTries<i.MAX_WS_RECONNECT_TRIES?(i.connectStatus=exports.ConnectionStatus.Break,i.reconnectTries++,i.ws&&(i.ws.onopen=null,i.ws.onclose=null,i.ws.onmessage=null,i.ws=void 0),setTimeout(()=>{i.connect()},0)):i.connectStatus=exports.ConnectionStatus.Lost},i.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&&i.emitter.emit(e,new B(n))}},i.emitter=new r.EventEmitter,i}return y(n,[{key:"connectStatus",get:function(){return this._connectStatus},set:function(e){this.emitter.emit("ConnectionStatus",new B(e)),this._connectStatus=e}},{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")}}]),n}(),B=y((function e(t){p(this,e),this.data=t})),_=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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:"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()}}]),n}(),M=function(e){v(n,_);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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}();const W=["name"],q=["name"],G=["name"],z=["name","id"],H=["name","id"],V=["name","id"],J=["name","x","y","z"],Q=["name"],K=["name"],X=["name"],Y=["name"],Z=["name"],$=["name"],ee=["name"],te=["name"],ne=["name"],re=["name"],se=["name"],ie=["layerName"];let oe=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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:"publishProxyService",value:function(e){return this.http.post("/layers",e,{type:"ProxyService"}).json()}},{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:"publishPostgresTileCatalogService",value:function(e){return this.http.post("/layers",e,{type:"PostgresTileLayerService"}).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:"publishStyledLayerService",value:function(e){return this.http.post("/layers",e,{type:"StyledFeatureLayer"}).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:"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){let{name:t}=e,n=k(e,W);return this.http.get("/layers/"+t+"/features",n).json()}},{key:"deleteFeature",value:function(e){let{name:t}=e,n=k(e,q);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=k(e,G);return this.http.get("/layers/"+t+"/features/contains",n).json()}},{key:"getById",value:function(e){let{name:t,id:n}=e,r=k(e,z);return this.http.get("/layers/"+t+"/features/"+n,r).json()}},{key:"unite",value:function(e,t){let{name:n,id:r}=e,s=k(e,H);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=k(e,V);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=k(e,J);return this.http.createUrl("/layers/"+t+"/tile/"+s+"/"+n+"/"+r,i)}},{key:"getLayerImage",value:function(e){let{name:t}=e,n=k(e,Q);return this.http.createUrl("/layers/"+t+"/export",n)}},{key:"getLayerExtent",value:function(e){let{name:t}=e,n=k(e,K);return this.http.get("/layers/"+t+"/extent",n).json()}},{key:"getByGeometry",value:function(e){let{name:t}=e,n=k(e,X);return this.http.get("/layers/"+t+"/features/getByGeometry",n).json()}},{key:"getByGeometryPost",value:function(e,t){let{name:n}=e,r=k(e,Y);return this.http.post("/layers/"+n+"/features/getByGeometry",t,r).json()}},{key:"deleteFeatures",value:function(e){let{name:t}=e,n=k(e,Z);return this.http.delete("/layers/"+t+"/features/deleteByIds",null,n).json()}},{key:"deleteByCondition",value:function(e){let{name:t}=e,n=k(e,$);return this.http.delete("/layers/"+t+"/features/deleteByCondition",null,n).json()}},{key:"getByGeometryGet",value:function(e){let{name:t}=e,n=k(e,ee);return this.http.get("/layers/"+t+"/features/getByGeometryByClick",n).json()}},{key:"classify",value:function(e){let{name:t}=e,n=k(e,te);return this.http.get("/layers/"+t+"/classify",n).json()}},{key:"distincts",value:function(e){let{name:t}=e,n=k(e,ne);return this.http.get("/layers/"+t+"/distincts",n).json()}},{key:"aggregateAttribute",value:function(e){let{name:t}=e,n=k(e,re);return this.http.get("/layers/"+t+"/aggregate-values",n).json()}},{key:"getFilteredFeaturesCount",value:function(e){let{name:t}=e,n=k(e,se);return this.http.get("/layers/"+t+"/features/count",n).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=k(e,ie);return this.http.get("/layers/"+t+"/validateExpression",n).json()}},{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:"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 ae(e){return(await Promise.all(e.map(e=>e.catch(e=>ue(e)?e:new Error(e))))).filter(le)}function ue(e){return e instanceof Error}function le(e){return!ue(e)}const ce=["remote"];let pe=function(e){v(n,oe);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n,[{key:"getLayerInfos",value:function(e){return ae(e.map(e=>this.getLayerInfo(e)))}},{key:"getLayersDeps",value:function(e){return ae(e.map(e=>this.getResourceDependencies(e)))}},{key:"getBasemaps",value:function(e){return this.getLayersList(f({},e,{types:["LocalTileService","RemoteTileService"]}))}},{key:"createSubLayer",value:function(e){return this.publishStyledLayerService(e)}},{key:"createTileLayer",value:function(e){let{remote:t}=e,n=k(e,ce);return t?this.publishRemoteTileService(n):this.publishLocalTileService(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:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}();const he=["name"],ye=["name"],fe=["name"],ve=["name"];let de=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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:"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:"getTableData",value:function(e){let{name:t}=e,n=k(e,he);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=k(e,ye);return this.http.patch("/tables/"+n+"/data",t,r).then(()=>{})}},{key:"deleteTableData",value:function(e){let{name:t}=e,n=k(e,fe);return this.http.delete("/tables/"+t+"/data",null,n).then(()=>{})}},{key:"getUniqueDataRows",value:function(e){let{name:t}=e,n=k(e,ve);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,f({type:"Table"},e)).json()}},{key:"mapView",value:function(e,t){return this.http.post("/tables/map-table",t,f({type:"MaterializedView"},e)).json()}},{key:"mapRemoteTable",value:function(e,t){return this.http.post("/tables/map-table",t,f({type:"RemoteTable"},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:"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}(),ke=function(e){v(n,de);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n,[{key:"getTableInfos",value:function(e){return ae(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}(),ge=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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:"getProjectLayersExtendedInfo",value:function(e){return this.http.get("/projects/"+e+"/extended-info").json()}},{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:"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}(),me=function(e){v(n,ge);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n,[{key:"getProjectInfos",value:function(e){return ae(e.map(e=>this.getProjectInfo(e)))}},{key:"getProjectsDeps",value:function(e){return ae(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}();function be(e,t,n){return n.indexOf(e)===t}function we(e){return"string"==typeof e}var xe;(xe=exports.DependencyType||(exports.DependencyType={})).Layer="Layer",xe.Table="Table";let Te=function(){function e(t,n,r){p(this,e),this.projects=t,this.layers=n,this.tables=r}return y(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(be)),layers:await this.layers.getLayerInfos(s.filter(be))}}},{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(we)}}]),e}(),je=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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}(),Se=function(e){v(n,je);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n)}();const Pe=["providerName"],Ie=["providerName"],Re=["providerName"];let Ce=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n,[{key:"geocode",value:function(e){let{providerName:t}=e,n=k(e,Pe);return this.http.get("/geocode/"+t,n).json()}},{key:"geocodeByPoint",value:function(e){let{providerName:t}=e,n=k(e,Ie);return this.http.get("/geocode/"+t+"/geocodeByPoint",n).json()}},{key:"suggest",value:function(e){let{providerName:t}=e,n=k(e,Re);return this.http.get("/geocode/"+t+"/suggest",n).json()}}]),n}(),Le=function(e){v(n,Ce);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n,[{key:"geocode2Gis",value:function(e){return this.geocode(f({providerName:"geocode2gis"},e))}},{key:"suggest2Gis",value:function(e){return this.suggest(f({providerName:"geocode2gis"},e))}}]),n}(),Ee=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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}(),Ue=function(e){v(n,Ee);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n)}(),Fe=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n)}(),Ne=function(e){v(n,Fe);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n)}(),De=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n,[{key:"getServerInfo",value:function(){return this.http.get("/").json()}},{key:"favicon",value:function(){return this.http.createUrl("/favicon.ico")}},{key:"getFunctionsList",value:function(){return this.http.get("/functions").json()}}]),n}(),Ae=function(e){v(n,De);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n)}(),Oe=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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}(),Be=function(e){v(n,Oe);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n)}(),_e=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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:"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 Me=()=>JSON.parse(localStorage.getItem(qe)||"null")||void 0,We=e=>{if(e){const t=Me();localStorage.setItem(qe,JSON.stringify(f({},t,e)))}else localStorage.removeItem(qe)},qe="@evergis/user-info";let Ge=function(e){v(n,_e);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n,[{key:"login",value:async function(e){e&&await w(d(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(),We(void 0),this.userInfo={}}},{key:"updateCurrentUser",value:async function(e){await w(d(n.prototype),"updateUser",this).call(this,f({username:this.username},e)),We(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=Me();return e&&(this.userInfo=e),e}}]),n}(),ze=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n,[{key:"getPreview",value:function(e){return this.http.createUrl("/account/user/"+e+"/preview")}},{key:"uploadPreview",value:function(e,t){return this.http.post("/account/user/"+e+"/preview",L(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/account/user/"+e+"/preview",null).then(()=>{})}},{key:"getPreview1",value:function(){return this.http.createUrl("/account/user/preview")}}]),n}(),He=function(e){v(n,ze);var t=b(n);function n(e,r){var s;return p(this,n),(s=t.call(this,e)).userInfo=r,s}return y(n,[{key:"user",get:function(){if(this.userInfo)return this.userInfo;const e=Me();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){const{fileId:t}=await this.uploadPreview(this.username,{file:e});We({profile_photo:t,has_profile_photo:!0})}},{key:"fetchPreview1",value:async function(){const e=await this.getPreview1();We({profile_photo:e,has_profile_photo:!0})}},{key:"deleteCurrentUserPhoto",value:async function(){await this.deletePreview(this.username),We({profile_photo:"",has_profile_photo:!1})}}]),n}(),Ve=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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}(),Je=function(e){v(n,Ve);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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}(),Qe=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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}(),Ke=function(e){v(n,Qe);var t=b(n);function n(){var e;return p(this,n),(e=t.apply(this,arguments)).settings={modules:[],connection:{url:""}},e}return y(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}(),Xe=function(e){v(n,Qe);var t=b(n);function n(){var e;return p(this,n),(e=t.apply(this,arguments)).config=null,e}return y(n,[{key:"fetchPortalSettings",value:async function(e){return this.config=JSON.parse(await this.getConfiguration(e)),this.config}}]),n}();var Ye;(Ye=exports.ErrorReason||(exports.ErrorReason={})).HTTP_OTHER="other",Ye.HTTP_CLIENT="client",Ye.HTTP_SERVER="server",Ye.UNKNOWN="unknown";const Ze=e=>e instanceof t.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),$e=e=>e&&e.type&&e.reason;function et(e){return function(t){return!!t.type&&e.includes(t.type)}}const tt=et(["PostgresLayerService","PostgresTileLayerService"]),nt=e=>window.location.protocol+"//"+e+"."+window.location.host,rt=i.customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789",12);(exports.ResourceSeparator||(exports.ResourceSeparator={})).Server=".";let st=function(){function e(t){let{account:n}=t;p(this,e),this.account=n}return y(e,[{key:"createId",value:function(){return rt()}},{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(f({workspace:"temp"},e))}},{key:"extractResource",value:function(e){if(e&&e.includes(exports.ResourceSeparator.Server)){const[t,n]=e.split(exports.ResourceSeparator.Server,2);return{workspace:t,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}(),it=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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}(),ot=function(e){v(n,it);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n)}(),at=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n,[{key:"statisticsDb",value:function(e){return this.http.get("/statistics",e).json()}},{key:"classify",value:function(e){return this.http.get("/statistics/classify",e).json()}},{key:"sumOfProduct",value:function(e){return this.http.get("/statistics/sumOfProduct",e).json()}}]),n}(),ut=function(e){v(n,at);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n,[{key:"getStatistic",value:function(e){return this.statisticsDb(e)}},{key:"getClassify",value:function(e){return this.classify(e)}}]),n}(),lt=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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}(),ct=function(e){v(n,lt);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n,[{key:"postFeedback",value:function(e,t){return this.feedback(e,t)}}]),n}(),pt=function(e){v(n,x);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(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){v(n,pt);var t=b(n);function n(){return p(this,n),t.apply(this,arguments)}return y(n)}();var yt,ft;(yt=exports.ApiEvent||(exports.ApiEvent={})).ConnectionLost="ConnectionLost",yt.Unauthorized="Unauthorized",yt.SessionClosed="SessionClosed",(ft=exports.UrlPath||(exports.UrlPath={})).Base="/map",ft.Shared="/shared",ft.Portal="/portal";const vt={401:exports.ApiEvent.Unauthorized},dt=Object.values(exports.UrlPath),kt=dt[0];let gt=function(e){v(s,r.EventEmitter);var n=b(s);function s(e){var r;let{url:i,wsUrl:o,http:a,urlPath:u,httpOptions:l}=e;p(this,s),r=n.call(this);const{hooks:c}=l||{};return r.http=a||new I(f({prefixUrl:i,timeout:!1},l||{},{hooks:f({},c||{},{beforeRequest:[...c&&c.beforeRequest||[]],afterResponse:[e=>{const n=vt[e.status];return n&&r.emit(n,Ze(new t.HTTPError(e))),e},...c&&c.afterResponse||[]]})})),r.url=i,r.wsUrl=o||i,r.urlPath=u||r.defineUrlPath(),r.layers=new pe(r.http),r.tables=new ke(r.http),r.projects=new me(r.http),r.resources=new Te(r.projects,r.layers,r.tables),r.styles=new Se(r.http),r.account=new Ge(r.http),r.accountPreview=new He(r.http,r.account),r.bulk=new j(r.http),r.security=new P(r.http,r.account),r.notification=new O(r.http,g(r)),r.scheduler=new M(r.http),r.file=new U(r.http),r.import=new N(r.http),r.geocode=new Le(r.http),r.print=new ht(r.http),r.tools=new Ne(r.http),r.resourceCatalog=new Ue(r.http),r.general=new Ae(r.http),r.namespace=new Be(r.http),r.external=new Je(r.http),r.clientSettings=new Ke(r.http),r.portalSettings=new Xe(r.http),r.iceRouter=new ot(r.http),r.statistic=new ut(r.http),r.feedback=new ct(r.http),r.names=new st({account:r.account}),r}return y(s,[{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})}catch(e){throw Ze(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 Ze(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:"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&&dt.includes(t)?t:kt}},{key:"isShared",get:function(){return this.urlPath===exports.UrlPath.Shared}}]),s}(),mt=function(e){v(n,u.TileLayer);var t=b(n);function n(e,r){var s;return p(this,n),(s=t.call(this,"",{crs:e.crs})).api=r,s.name=e.name,s.subDomains=e.subDomains,s}return y(n,[{key:"getTileUrl",value:function(e,t,n){const r=this.subDomains,s=r&&r[(e+t+n)%r.length],i=this.api.layers.getTilesLayerImage({x:e,y:t,z:n,name:this.name});return s?""+nt(s)+i:i}}]),n}(),bt=function(e){v(n,l.DynamicLayer);var t=b(n);function n(e,r){var s;return p(this,n),(s=t.call(this)).api=r,s.name=e.name,s.styleId=e.style,s.conditionQuery=e.condition,s.subscribeRedraw(),s}return y(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:"getUrl",value:function(e,t){let n=Math.round((e.xMax-e.xMin)/t),r=Math.round((e.yMax-e.yMin)/t);return this.api.layers.getLayerImage({name:this.name,extent:e.coordinates,size:[n,r],extentSr:e.crs.wkid,styleId:this.styleId,condition:this.conditionQuery})}},{key:"subscribeRedraw",value:function(){const e="service_update_"+this.name.replace(/\//g,"_");this.api.notification.subscribe(e).then(()=>{this.api.notification.on(e,()=>{this.forceUpdate(),this.redraw()})})}}]),n}();const wt={RemoteTileService:mt,LocalTileService:mt,PostgresLayerService:bt,StyledFeatureLayer:bt,CompositeService:null};let xt=function(){function e(t,n){p(this,e),this.layers=t,this.http=n}return y(e,[{key:"getLayerService",value:async function(e){let t=await this.getLayerInfo(e);const n=t.type;if(!(e=>Boolean(e&&Object.keys(wt).includes(e)))(n))return;const r=wt[n];if(r)return new r((e=>f({},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 Tt;!function(e){e[e.BaseMaps=0]="BaseMaps",e[e.Layers=1]="Layers"}(Tt||(Tt={}));let jt=function(e){v(n,gt);var t=b(n);function n(e,r,s){var i;return p(this,n),(i=t.call(this,r)).map=new a.Map,i.painter=new o.DomPainter(i.map),i.mapProps=e,i.auth=s,i.layersManager=new xt(i.layers,i.http),i}return y(n,[{key:"init",value:async function(){await w(d(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,Tt.Layers)}},{key:"setBaseMap",value:async function(e){await this.insertLayer(e,Tt.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(St);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 St=e=>void 0!==e;var Pt,It,Rt,Ct,Lt,Et,Ut,Ft,Nt,Dt,At,Ot,Bt,_t,Mt,Wt,qt,Gt,zt,Ht,Vt,Jt,Qt;(Pt=exports.AggregationFunction||(exports.AggregationFunction={})).None="None",Pt.Array="Array",Pt.Min="Min",Pt.Max="Max",Pt.Avg="Avg",Pt.Sum="Sum",Pt.Extent="Extent",Pt.Count="Count",Pt.First="First",Pt.Last="Last",Pt.Median="Median",Pt.Mod="Mod",Pt.StdDeviation="StdDeviation",Pt.SumOfProduct="SumOfProduct",Pt.OnlyValue="OnlyValue",Pt.WeightedAvg="WeightedAvg",Pt.DensityIndicators="DensityIndicators",Pt.DividedSum="DividedSum",(It=exports.AttributeType||(exports.AttributeType={})).Unknown="Unknown",It.String="String",It.Int32="Int32",It.Int64="Int64",It.Double="Double",It.DateTime="DateTime",It.Boolean="Boolean",It.Point="Point",It.Polyline="Polyline",It.Polygon="Polygon",It.Multipoint="Multipoint",(Rt=exports.ClassificationType||(exports.ClassificationType={})).None="none",Rt.NaturalBreaks="naturalBreaks",Rt.EqualInterval="equalInterval",Rt.Quantile="quantile",Rt.Distinct="unique",(Ct=exports.ClassifyAttributeType||(exports.ClassifyAttributeType={})).Decimal="decimal",Ct.DateTime="dateTime",Ct.Text="text",(Lt=exports.ConfigurationErrorEnum||(exports.ConfigurationErrorEnum={})).Unknown="Unknown",Lt.SerializeError="SerializeError",Lt.InvalidDataService="InvalidDataService",Lt.InvalidConfiguration="InvalidConfiguration",Lt.InvalidDataServiceName="InvalidDataServiceName",Lt.InvalidTableName="InvalidTableName",Lt.ResourceNotFound="ResourceNotFound",Lt.InvalidCondition="InvalidCondition",Lt.InvalidAttributes="InvalidAttributes",Lt.InvalidIdAttribute="InvalidIdAttribute",Lt.InvalidGeometryAttribute="InvalidGeometryAttribute",Lt.InvalidGeometryAttributeType="InvalidGeometryAttributeType",Lt.InvalidColumnName="InvalidColumnName",Lt.InvalidIdColumnSettings="InvalidIdColumnSettings",Lt.ColumnNotExistsInTable="ColumnNotExistsInTable",Lt.InvalidStyle="InvalidStyle",Lt.InvalidLayerType="InvalidLayerType",Lt.ColumnLoadingError="ColumnLoadingError",Lt.InvalidAttributeFormat="InvalidAttributeFormat",Lt.DataSourceNotFound="DataSourceNotFound",(Et=exports.ErrorDetailsType||(exports.ErrorDetailsType={})).ResourceLimitExceeded="ResourceLimitExceeded",Et.ResourceNotFound="ResourceNotFound",Et.InternalError="InternalError",Et.BadRequest="BadRequest",Et.DuplicateContent="DuplicateContent",(Ut=exports.ErrorType||(exports.ErrorType={})).NotSpecified="NotSpecified",Ut.LimitError="LimitError",Ut.ValidationError="ValidationError",Ut.JwtExpired="JwtExpired",Ut.TokenInvalid="TokenInvalid",Ut.RefreshTokenExpired="RefreshTokenExpired",Ut.RefreshTokenInvalid="RefreshTokenInvalid",Ut.CreateUserFailed="CreateUserFailed",Ut.SetUserPasswordFailed="SetUserPasswordFailed",Ut.SetUserRoleFailed="SetUserRoleFailed",Ut.UpdateUserFailed="UpdateUserFailed",Ut.RemoveUserFailed="RemoveUserFailed",Ut.CreateRoleFailed="CreateRoleFailed",Ut.UpdateRoleFailed="UpdateRoleFailed",Ut.RemoveUserRoleFailed="RemoveUserRoleFailed",Ut.ChangeActiveStateFailed="ChangeActiveStateFailed",Ut.RemoveRoleFailed="RemoveRoleFailed",Ut.UserNotFound="UserNotFound",Ut.RoleNotFound="RoleNotFound",Ut.EmailNotConfirmed="EmailNotConfirmed",Ut.DuplicateEmailError="DuplicateEmailError",Ut.InvalidPassword="InvalidPassword",Ut.RoleExists="RoleExists",Ut.UserExists="UserExists",Ut.UserLockedError="UserLockedError",Ut.InvalidEmail="InvalidEmail",Ut.InvalidUsername="InvalidUsername",Ut.Unauthorized="Unauthorized",Ut.EmailNotChanged="EmailNotChanged",Ut.EmailNotSet="EmailNotSet",(Ft=exports.FeatureType||(exports.FeatureType={})).Unknown="Unknown",Ft.GeometricFeature="GeometricFeature",(Nt=exports.FontStyle||(exports.FontStyle={})).Normal="normal",Nt.Oblique="oblique",Nt.Italic="italic",(Dt=exports.FontWeight||(exports.FontWeight={})).Thin="Thin",Dt.ExtraLight="ExtraLight",Dt.Light="Light",Dt.SemiLight="SemiLight",Dt.Normal="Normal",Dt.Medium="Medium",Dt.DemiBold="DemiBold",Dt.Bold="Bold",Dt.ExtraBold="ExtraBold",Dt.Black="Black",Dt.ExtraBlack="ExtraBlack",(At=exports.GeometryType||(exports.GeometryType={})).Unknown="unknown",At.Point="point",At.Polyline="polyline",At.Polygon="polygon",At.Envelope="envelope",At.Multipoint="multipoint",(Ot=exports.Group||(exports.Group={})).My="my",Ot.Role="role",Ot.Public="public",Ot.All="all",(Bt=exports.LineEndingSize||(exports.LineEndingSize={})).Small="small",Bt.Large="large",(_t=exports.LineEndingType||(exports.LineEndingType={})).None="none",_t.Arrow="arrow",_t.FilledArrow="filledArrow",_t.Square="square",_t.FilledSquare="filledSquare",_t.Circle="circle",_t.FilledCircle="filledCircle",(Mt=exports.Operation||(exports.Operation={})).Unknown="Unknown",Mt.Union="union",Mt.Intersection="intersection",Mt.Subtraction="subtraction",Mt.SymDifference="symDifference",(Wt=exports.Permissions||(exports.Permissions={})).None="none",Wt.Configure="configure",Wt.Write="write",Wt.Read="read",Wt.ReadConfigure="read,configure",Wt.ReadWrite="read,write",Wt.All="read,write,configure",(qt=exports.PolicyType||(exports.PolicyType={})).Unknown="Unknown",qt.CreateTable="CreateTable",qt.CreateLayer="CreateLayer",qt.CreateProject="CreateProject",qt.MaxFeaturesInOneTable="MaxFeaturesInOneTable",(Gt=exports.ResourceType||(exports.ResourceType={})).Unknown="Unknown",Gt.Table="table",Gt.Layer="layer",Gt.Project="project",Gt.File="file",Gt.Feature="feature",(zt=exports.ResourceTypeLink||(exports.ResourceTypeLink={})).Table="tables",zt.Layer="layers",zt.Project="projects",(Ht=exports.ServerTaskStatus||(exports.ServerTaskStatus={})).None="None",Ht.Scheduled="Scheduled",Ht.Planning="Planning",Ht.Executing="Executing",Ht.Completed="Completed",Ht.Failed="Failed",Ht.Canceled="Canceled",Ht.Timeout="Timeout",(Vt=exports.StringSubType||(exports.StringSubType={})).None="None",Vt.Image="Image",Vt.PkkCode="PkkCode",(Jt=exports.TextAlignment||(exports.TextAlignment={})).Right="right",Jt.Left="left",Jt.Center="center",Jt.Justified="justified",(Qt=exports.TextVerticalAlignment||(exports.TextVerticalAlignment={})).Top="top",Qt.Bottom="bottom",Qt.Middle="middle",Object.defineProperty(exports,"HTTPError",{enumerable:!0,get:function(){return t.HTTPError}}),Object.defineProperty(exports,"TimeoutError",{enumerable:!0,get:function(){return t.TimeoutError}}),exports.API_USER_INFO_KEY=qe,exports.Account=Ge,exports.AccountPreview=He,exports.Api=gt,exports.BulkOperations=j,exports.ClientSettings=Ke,exports.EvergisDynamicLayer=bt,exports.EvergisTileLayer=mt,exports.External=Je,exports.Feedback=ct,exports.FileUpload=U,exports.GEOCODE_PROVIDER="geocode2gis",exports.General=Ae,exports.Geocode=Le,exports.HttpClient=I,exports.IceRouter=ot,exports.Import=N,exports.Layers=pe,exports.LayersManager=xt,exports.Names=st,exports.Namespace=Be,exports.Notification=O,exports.NotificationEvent=B,exports.PortalSettings=Xe,exports.Projects=me,exports.ResourceCatalog=Ue,exports.Resources=Te,exports.Scheduler=M,exports.Security=P,exports.SpatialProcessor=jt,exports.Statistic=ut,exports.Styles=Se,exports.Tables=ke,exports.Tools=Ne,exports.addSubDomainToLocation=nt,exports.errorHandler=Ze,exports.formDataFromFile=function(e){const t=new FormData;return t.append("file",e),t},exports.generateId=rt,exports.isEvergisDynamicLayer=function(e){return e instanceof bt},exports.isEvergisTileLayer=function(e){return e instanceof mt},exports.isFeatureLayer=function(e){return e instanceof c.FeatureLayer},exports.isHTTPError=e=>$e(e)&&"http"===e.type,exports.isHandledError=$e,exports.isLayer=tt,exports.isProjectContentItems=function(e){return null!=e},exports.isString=we,exports.isTileLayerService=function(e){return e.type&&/TileService/.test(e.type)},exports.promiseAllIgnoreErrors=ae,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=be;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@evergis/event-emitter"),n=require("@microsoft/signalr"),r=require("ky"),s=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,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/layers/DynamicLayer"),p=require("@evergis/sgis");function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(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 f(e,t,n){return t&&y(e.prototype,t),n&&y(e,n),e}function v(){return(v=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 d(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 k(e){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(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 m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?m(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=k(e);if(t){var s=k(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return b(this,n)}}function x(e,t,n){return(x="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=k(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 T=function(){function e(t){var n;void 0===t&&(t={}),h(this,e),this.ky=s.extend(t),this.prefixUrl=(null==(n=t.prefixUrl)?void 0:n.toString())||""}return f(e,[{key:"extend",value:function(e){var t;this.ky=s.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:S(t)})}},{key:"post",value:function(e,t,n){const r=j(n,t);return this.ky.post(this.stripSlashes(e),r)}},{key:"put",value:function(e,t,n){const r=j(n,t);return this.ky.put(this.stripSlashes(e),r)}},{key:"patch",value:function(e,t,n){const r=j(n,t);return this.ky.patch(this.stripSlashes(e),r)}},{key:"delete",value:function(e,t,n){const r=j(n,t);return this.ky.delete(this.stripSlashes(e),r)}},{key:"createUrl",value:function(e,t){const n=t?"?"+S(t):"";return this.prefixUrl+this.stripSlashes(e)+n}},{key:"stripSlashes",value:function(e){return this.prefixUrl?e.replace(/^\//g,""):e}}]),e}();function j(e,t){const n={searchParams:S(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 S(e){return void 0===e&&(e={}),i.stringify(e,{arrayFormat:"comma"})}function P(e){return e instanceof FormData?e:Object.keys(e).reduce((t,n)=>(t.append(n,e[n]),t),new FormData)}var I;(I=exports.ApiEvent||(exports.ApiEvent={})).ConnectionLost="ConnectionLost",I.Unauthorized="Unauthorized",I.SessionClosed="SessionClosed";let C=f((function e(t){h(this,e),this.http=t})),R=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n,[{key:"batchResourcesPermissionsSet",value:function(e){return this.http.put("/bulk/resources/permissions",e).json()}}]),n}(),L=function(e){d(n,R);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n)}(),E=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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}(),U=function(e){d(n,E);var t=w(n);function n(e,r){var s;let{username:i,roles:o}=r;return h(this,n),(s=t.call(this,e)).ownerName="",s.ownerRoles=[],s.ownerName=i,s.ownerRoles=o,s}return f(n,[{key:"reset",value:function(){this.ownerName="",this.ownerRoles=[]}}]),n}(),F=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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",P(e)).json()}},{key:"deleteFile",value:function(e){return this.http.delete("/upload/file",null,e).then(()=>{})}}]),n}(),N=function(e){d(n,F);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n,[{key:"upload",value:function(e,t){return this.uploadFile({file:e,rewrite:!!t})}}]),n}(),D=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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:"getRasterAttributes",value:function(e){return this.http.get("/import/rasterAttributes",e).json()}}]),n}(),A=function(e){d(n,D);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n)}(),O=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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 B;(B=exports.ConnectionStatus||(exports.ConnectionStatus={})).Initialized="Initialized",B.Connected="Connected",B.Break="Break",B.Lost="Lost",B.SessionClosed="SessionClosed";let _=function(e){d(r,O);var n=w(r);function r(e,s){var i;return h(this,r),(i=n.call(this,e)).api=s,i.MAX_WS_RECONNECT_TRIES=10,i.reconnectTries=0,i.subscriptions=[],i._connectStatus=exports.ConnectionStatus.Initialized,i.onWsConnected=()=>{i.connectStatus=exports.ConnectionStatus.Connected},i.onWsClosed=e=>{4001===e.code||4002===e.code?i.connectStatus=exports.ConnectionStatus.SessionClosed:i.reconnectTries<i.MAX_WS_RECONNECT_TRIES?(i.connectStatus=exports.ConnectionStatus.Break,i.reconnectTries++,i.ws&&(i.ws.onopen=null,i.ws.onclose=null,i.ws.onmessage=null,i.ws=void 0),setTimeout(()=>{i.connect()},0)):i.connectStatus=exports.ConnectionStatus.Lost},i.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&&i.emitter.emit(e,new M(n))}},i.emitter=new t.EventEmitter,i}return f(r,[{key:"connectStatus",get:function(){return this._connectStatus},set:function(e){this.emitter.emit("ConnectionStatus",new M(e)),this._connectStatus=e}},{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}(),M=f((function e(t){h(this,e),this.data=t})),q=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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:"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()}}]),n}(),W=function(e){d(n,q);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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}();const G=["name"],H=["name"],z=["name"],V=["name","id"],J=["name","id"],Q=["name","id"],K=["name","x","y","z"],X=["name"],Y=["name"],Z=["name"],$=["name"],ee=["name"],te=["name"],ne=["name"],re=["name"],se=["name"],ie=["name"],oe=["name"],ae=["layerName"];let ue=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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:"publishProxyService",value:function(e){return this.http.post("/layers",e,{type:"ProxyService"}).json()}},{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:"publishPostgresTileCatalogService",value:function(e){return this.http.post("/layers",e,{type:"PostgresTileLayerService"}).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:"publishStyledLayerService",value:function(e){return this.http.post("/layers",e,{type:"StyledFeatureLayer"}).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:"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){let{name:t}=e,n=g(e,G);return this.http.get("/layers/"+t+"/features",n).json()}},{key:"deleteFeature",value:function(e){let{name:t}=e,n=g(e,H);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=g(e,z);return this.http.get("/layers/"+t+"/features/contains",n).json()}},{key:"getById",value:function(e){let{name:t,id:n}=e,r=g(e,V);return this.http.get("/layers/"+t+"/features/"+n,r).json()}},{key:"unite",value:function(e,t){let{name:n,id:r}=e,s=g(e,J);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=g(e,Q);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=g(e,K);return this.http.createUrl("/layers/"+t+"/tile/"+s+"/"+n+"/"+r,i)}},{key:"getLayerImage",value:function(e){let{name:t}=e,n=g(e,X);return this.http.createUrl("/layers/"+t+"/export",n)}},{key:"getLayerExtent",value:function(e){let{name:t}=e,n=g(e,Y);return this.http.get("/layers/"+t+"/extent",n).json()}},{key:"getByGeometry",value:function(e){let{name:t}=e,n=g(e,Z);return this.http.get("/layers/"+t+"/features/getByGeometry",n).json()}},{key:"getByGeometryPost",value:function(e,t){let{name:n}=e,r=g(e,$);return this.http.post("/layers/"+n+"/features/getByGeometry",t,r).json()}},{key:"deleteFeatures",value:function(e){let{name:t}=e,n=g(e,ee);return this.http.delete("/layers/"+t+"/features/deleteByIds",null,n).json()}},{key:"deleteByCondition",value:function(e){let{name:t}=e,n=g(e,te);return this.http.delete("/layers/"+t+"/features/deleteByCondition",null,n).json()}},{key:"getByGeometryGet",value:function(e){let{name:t}=e,n=g(e,ne);return this.http.get("/layers/"+t+"/features/getByGeometryByClick",n).json()}},{key:"classify",value:function(e){let{name:t}=e,n=g(e,re);return this.http.get("/layers/"+t+"/classify",n).json()}},{key:"distincts",value:function(e){let{name:t}=e,n=g(e,se);return this.http.get("/layers/"+t+"/distincts",n).json()}},{key:"aggregateAttribute",value:function(e){let{name:t}=e,n=g(e,ie);return this.http.get("/layers/"+t+"/aggregate-values",n).json()}},{key:"getFilteredFeaturesCount",value:function(e){let{name:t}=e,n=g(e,oe);return this.http.get("/layers/"+t+"/features/count",n).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=g(e,ae);return this.http.get("/layers/"+t+"/validateExpression",n).json()}},{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",P(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/layers/"+e+"/preview",null).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 le(e){return(await Promise.all(e.map(e=>e.catch(e=>ce(e)?e:new Error(e))))).filter(pe)}function ce(e){return e instanceof Error}function pe(e){return!ce(e)}const he=["remote"];let ye=function(e){d(n,ue);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n,[{key:"getLayerInfos",value:function(e){return le(e.map(e=>this.getLayerInfo(e)))}},{key:"getLayersDeps",value:function(e){return le(e.map(e=>this.getResourceDependencies(e)))}},{key:"getBasemaps",value:function(e){return this.getLayersList(v({},e,{types:["LocalTileService","RemoteTileService"]}))}},{key:"createSubLayer",value:function(e){return this.publishStyledLayerService(e)}},{key:"createTileLayer",value:function(e){let{remote:t}=e,n=g(e,he);return t?this.publishRemoteTileService(n):this.publishLocalTileService(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:"remove",value:async function(e){return await this.deleteResource(e),e}}]),n}();const fe=["name"],ve=["name"],de=["name"],ke=["name"];let ge=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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:"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:"getTableData",value:function(e){let{name:t}=e,n=g(e,fe);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=g(e,ve);return this.http.patch("/tables/"+n+"/data",t,r).then(()=>{})}},{key:"deleteTableData",value:function(e){let{name:t}=e,n=g(e,de);return this.http.delete("/tables/"+t+"/data",null,n).then(()=>{})}},{key:"getUniqueDataRows",value:function(e){let{name:t}=e,n=g(e,ke);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,v({type:"Table"},e)).json()}},{key:"mapView",value:function(e,t){return this.http.post("/tables/map-table",t,v({type:"MaterializedView"},e)).json()}},{key:"mapRemoteTable",value:function(e,t){return this.http.post("/tables/map-table",t,v({type:"RemoteTable"},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",P(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/tables/"+e+"/preview",null).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}(),me=function(e){d(n,ge);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n,[{key:"getTableInfos",value:function(e){return le(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}(),be=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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:"getProjectLayersExtendedInfo",value:function(e){return this.http.get("/projects/"+e+"/extended-info").json()}},{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",P(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/projects/"+e+"/preview",null).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}(),we=function(e){d(n,be);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n,[{key:"getProjectInfos",value:function(e){return le(e.map(e=>this.getProjectInfo(e)))}},{key:"getProjectsDeps",value:function(e){return le(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}();function xe(e,t,n){return n.indexOf(e)===t}function Te(e){return"string"==typeof e}var je;(je=exports.DependencyType||(exports.DependencyType={})).Layer="Layer",je.Table="Table";let Se=function(){function e(t,n,r){h(this,e),this.projects=t,this.layers=n,this.tables=r}return f(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(xe)),layers:await this.layers.getLayerInfos(s.filter(xe))}}},{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(Te)}}]),e}(),Pe=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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",P(e)).then(()=>{})}},{key:"removeFont",value:function(e){return this.http.delete("/styles/fonts",null,e).then(()=>{})}}]),n}(),Ie=function(e){d(n,Pe);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n)}();const Ce=["providerName"],Re=["providerName"],Le=["providerName"];let Ee=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n,[{key:"geocode",value:function(e){let{providerName:t}=e,n=g(e,Ce);return this.http.get("/geocode/"+t,n).json()}},{key:"geocodeByPoint",value:function(e){let{providerName:t}=e,n=g(e,Re);return this.http.get("/geocode/"+t+"/geocodeByPoint",n).json()}},{key:"suggest",value:function(e){let{providerName:t}=e,n=g(e,Le);return this.http.get("/geocode/"+t+"/suggest",n).json()}}]),n}(),Ue=function(e){d(n,Ee);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n,[{key:"geocode2Gis",value:function(e){return this.geocode(v({providerName:"geocode2gis"},e))}},{key:"suggest2Gis",value:function(e){return this.suggest(v({providerName:"geocode2gis"},e))}}]),n}(),Fe=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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}(),Ne=function(e){d(n,Fe);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n)}(),De=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n)}(),Ae=function(e){d(n,De);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n)}(),Oe=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n,[{key:"getServerInfo",value:function(){return this.http.get("/").json()}},{key:"favicon",value:function(){return this.http.createUrl("/favicon.ico")}},{key:"getFunctionsList",value:function(){return this.http.get("/functions").json()}}]),n}(),Be=function(e){d(n,Oe);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n)}(),_e=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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}(),Me=function(e){d(n,_e);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n)}(),qe=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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",P(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",P(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",P(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:"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 We=()=>JSON.parse(localStorage.getItem(He)||"null")||void 0,Ge=e=>{if(e){const t=We();localStorage.setItem(He,JSON.stringify(v({},t,e)))}else localStorage.removeItem(He)},He="@evergis/user-info";let ze=function(e){d(n,qe);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n,[{key:"login",value:async function(e){e&&await x(k(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(),Ge(void 0),this.userInfo={}}},{key:"updateCurrentUser",value:async function(e){await x(k(n.prototype),"updateUser",this).call(this,v({username:this.username},e)),Ge(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=We();return e&&(this.userInfo=e),e}}]),n}(),Ve=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n,[{key:"getPreview",value:function(e){return this.http.createUrl("/account/user/"+e+"/preview")}},{key:"uploadPreview",value:function(e,t){return this.http.post("/account/user/"+e+"/preview",P(t)).json()}},{key:"deletePreview",value:function(e){return this.http.delete("/account/user/"+e+"/preview",null).then(()=>{})}},{key:"getPreview1",value:function(){return this.http.createUrl("/account/user/preview")}}]),n}(),Je=function(e){d(n,Ve);var t=w(n);function n(e,r){var s;return h(this,n),(s=t.call(this,e)).userInfo=r,s}return f(n,[{key:"user",get:function(){if(this.userInfo)return this.userInfo;const e=We();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){const{fileId:t}=await this.uploadPreview(this.username,{file:e});Ge({profile_photo:t,has_profile_photo:!0})}},{key:"fetchPreview1",value:async function(){const e=await this.getPreview1();Ge({profile_photo:e,has_profile_photo:!0})}},{key:"deleteCurrentUserPhoto",value:async function(){await this.deletePreview(this.username),Ge({profile_photo:"",has_profile_photo:!1})}}]),n}(),Qe=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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}(),Ke=function(e){d(n,Qe);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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}(),Xe=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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}(),Ye=function(e){d(n,Xe);var t=w(n);function n(){var e;return h(this,n),(e=t.apply(this,arguments)).settings={modules:[],connection:{url:""}},e}return f(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}(),Ze=function(e){d(n,Xe);var t=w(n);function n(){var e;return h(this,n),(e=t.apply(this,arguments)).config=null,e}return f(n,[{key:"fetchPortalSettings",value:async function(e){return this.config=JSON.parse(await this.getConfiguration(e)),this.config}}]),n}();var $e;($e=exports.ErrorReason||(exports.ErrorReason={})).HTTP_OTHER="other",$e.HTTP_CLIENT="client",$e.HTTP_SERVER="server",$e.UNKNOWN="unknown";const et=e=>e instanceof r.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),tt=e=>e&&e.type&&e.reason;function nt(e){return function(t){return!!t.type&&e.includes(t.type)}}const rt=nt(["PostgresLayerService","PostgresTileLayerService"]),st=e=>window.location.protocol+"//"+e+"."+window.location.host,it=o.customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789",12);(exports.ResourceSeparator||(exports.ResourceSeparator={})).Server=".";let ot=function(){function e(t){let{account:n}=t;h(this,e),this.account=n}return f(e,[{key:"createId",value:function(){return it()}},{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(v({workspace:"temp"},e))}},{key:"extractResource",value:function(e){if(e&&e.includes(exports.ResourceSeparator.Server)){const[t,n]=e.split(exports.ResourceSeparator.Server,2);return{workspace:t,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}(),at=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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}(),ut=function(e){d(n,at);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n)}(),lt=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n,[{key:"statisticsDb",value:function(e){return this.http.get("/statistics",e).json()}},{key:"classify",value:function(e){return this.http.get("/statistics/classify",e).json()}},{key:"sumOfProduct",value:function(e){return this.http.get("/statistics/sumOfProduct",e).json()}}]),n}(),ct=function(e){d(n,lt);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n,[{key:"getStatistic",value:function(e){return this.statisticsDb(e)}},{key:"getClassify",value:function(e){return this.classify(e)}}]),n}(),pt=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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",P(t),e).json()}}]),n}(),ht=function(e){d(n,pt);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n,[{key:"postFeedback",value:function(e,t){return this.feedback(e,t)}}]),n}(),yt=function(e){d(n,C);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(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",P(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}(),ft=function(e){d(n,yt);var t=w(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n)}();var vt;(vt=exports.UrlPath||(exports.UrlPath={})).Base="/map",vt.Shared="/shared",vt.Portal="/portal";const dt={401:exports.ApiEvent.Unauthorized},kt=Object.values(exports.UrlPath),gt=kt[0];let mt=function(e){d(i,t.EventEmitter);var s=w(i);function i(e){var t;let{url:o,wsUrl:a,snappingHubUrl:u,http:l,urlPath:c,httpOptions:p}=e;h(this,i),t=s.call(this);const{hooks:y}=p||{};return t.http=l||new T(v({prefixUrl:o,timeout:!1},p||{},{hooks:v({},y||{},{beforeRequest:[...y&&y.beforeRequest||[]],afterResponse:[e=>{const n=dt[e.status];return n&&t.emit(n,et(new r.HTTPError(e))),e},...y&&y.afterResponse||[]]})})),t.url=o,t.wsUrl=a||o,t.urlPath=c||t.defineUrlPath(),t.layers=new ye(t.http),t.tables=new me(t.http),t.projects=new we(t.http),t.resources=new Se(t.projects,t.layers,t.tables),t.styles=new Ie(t.http),t.account=new ze(t.http),t.accountPreview=new Je(t.http,t.account),t.bulk=new L(t.http),t.security=new U(t.http,t.account),t.notification=new _(t.http,m(t)),t.scheduler=new W(t.http),t.file=new N(t.http),t.import=new A(t.http),t.geocode=new Ue(t.http),t.print=new ft(t.http),t.tools=new Ae(t.http),t.resourceCatalog=new Ne(t.http),t.general=new Be(t.http),t.namespace=new Me(t.http),t.external=new Ke(t.http),t.clientSettings=new Ye(t.http),t.portalSettings=new Ze(t.http),t.iceRouter=new ut(t.http),t.statistic=new ct(t.http),t.feedback=new ht(t.http),t.names=new ot({account:t.account}),t.snappingHub=u?(new n.HubConnectionBuilder).withUrl(u,{withCredentials:!0}).withAutomaticReconnect().build():null,t}return f(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})}catch(e){throw et(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 et(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!==n.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&&kt.includes(t)?t:gt}},{key:"isShared",get:function(){return this.urlPath===exports.UrlPath.Shared}}]),i}(),bt=function(e){d(n,l.TileLayer);var t=w(n);function n(e,r){var s;return h(this,n),(s=t.call(this,"",{crs:e.crs})).api=r,s.name=e.name,s.subDomains=e.subDomains,s}return f(n,[{key:"getTileUrl",value:function(e,t,n){const r=this.subDomains,s=r&&r[(e+t+n)%r.length],i=this.api.layers.getTilesLayerImage({x:e,y:t,z:n,name:this.name});return s?""+st(s)+i:i}}]),n}(),wt=function(e){d(n,c.DynamicLayer);var t=w(n);function n(e,r){var s;return h(this,n),(s=t.call(this)).api=r,s.name=e.name,s.styleId=e.style,s.conditionQuery=e.condition,s.subscribeRedraw(),s}return f(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:"getUrl",value:function(e,t){let n=Math.round((e.xMax-e.xMin)/t),r=Math.round((e.yMax-e.yMin)/t);return this.api.layers.getLayerImage({name:this.name,extent:e.coordinates,size:[n,r],extentSr:e.crs.wkid,styleId:this.styleId,condition:this.conditionQuery})}},{key:"subscribeRedraw",value:function(){const e="service_update_"+this.name.replace(/\//g,"_");this.api.notification.subscribe(e).then(()=>{this.api.notification.on(e,()=>{this.forceUpdate(),this.redraw()})})}}]),n}();const xt={RemoteTileService:bt,LocalTileService:bt,PostgresLayerService:wt,StyledFeatureLayer:wt,CompositeService:null};let Tt=function(){function e(t,n){h(this,e),this.layers=t,this.http=n}return f(e,[{key:"getLayerService",value:async function(e){let t=await this.getLayerInfo(e);const n=t.type;if(!(e=>Boolean(e&&Object.keys(xt).includes(e)))(n))return;const r=xt[n];if(r)return new r((e=>v({},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 St=function(e){d(n,mt);var t=w(n);function n(e,r,s){var i;return h(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 Tt(i.layers,i.http),i}return f(n,[{key:"init",value:async function(){await x(k(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(Pt);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 Pt=e=>void 0!==e;var It,Ct,Rt,Lt,Et,Ut,Ft,Nt,Dt,At,Ot,Bt,_t,Mt,qt,Wt,Gt,Ht,zt,Vt,Jt,Qt,Kt;(It=exports.AggregationFunction||(exports.AggregationFunction={})).None="None",It.Array="Array",It.Min="Min",It.Max="Max",It.Avg="Avg",It.Sum="Sum",It.Extent="Extent",It.Count="Count",It.First="First",It.Last="Last",It.Median="Median",It.Mod="Mod",It.StdDeviation="StdDeviation",It.SumOfProduct="SumOfProduct",It.OnlyValue="OnlyValue",It.WeightedAvg="WeightedAvg",It.DensityIndicators="DensityIndicators",It.DividedSum="DividedSum",(Ct=exports.AttributeType||(exports.AttributeType={})).Unknown="Unknown",Ct.String="String",Ct.Int32="Int32",Ct.Int64="Int64",Ct.Double="Double",Ct.DateTime="DateTime",Ct.Boolean="Boolean",Ct.Point="Point",Ct.Polyline="Polyline",Ct.Polygon="Polygon",Ct.Multipoint="Multipoint",(Rt=exports.ClassificationType||(exports.ClassificationType={})).None="none",Rt.NaturalBreaks="naturalBreaks",Rt.EqualInterval="equalInterval",Rt.Quantile="quantile",Rt.Distinct="unique",(Lt=exports.ClassifyAttributeType||(exports.ClassifyAttributeType={})).Decimal="decimal",Lt.DateTime="dateTime",Lt.Text="text",(Et=exports.ConfigurationErrorEnum||(exports.ConfigurationErrorEnum={})).Unknown="Unknown",Et.SerializeError="SerializeError",Et.InvalidDataService="InvalidDataService",Et.InvalidConfiguration="InvalidConfiguration",Et.InvalidDataServiceName="InvalidDataServiceName",Et.InvalidTableName="InvalidTableName",Et.ResourceNotFound="ResourceNotFound",Et.InvalidCondition="InvalidCondition",Et.InvalidAttributes="InvalidAttributes",Et.InvalidIdAttribute="InvalidIdAttribute",Et.InvalidGeometryAttribute="InvalidGeometryAttribute",Et.InvalidGeometryAttributeType="InvalidGeometryAttributeType",Et.InvalidColumnName="InvalidColumnName",Et.InvalidIdColumnSettings="InvalidIdColumnSettings",Et.ColumnNotExistsInTable="ColumnNotExistsInTable",Et.InvalidStyle="InvalidStyle",Et.InvalidLayerType="InvalidLayerType",Et.ColumnLoadingError="ColumnLoadingError",Et.InvalidAttributeFormat="InvalidAttributeFormat",Et.DataSourceNotFound="DataSourceNotFound",(Ut=exports.ErrorDetailsType||(exports.ErrorDetailsType={})).ResourceLimitExceeded="ResourceLimitExceeded",Ut.ResourceNotFound="ResourceNotFound",Ut.InternalError="InternalError",Ut.BadRequest="BadRequest",Ut.DuplicateContent="DuplicateContent",(Ft=exports.ErrorType||(exports.ErrorType={})).NotSpecified="NotSpecified",Ft.LimitError="LimitError",Ft.ValidationError="ValidationError",Ft.JwtExpired="JwtExpired",Ft.TokenInvalid="TokenInvalid",Ft.RefreshTokenExpired="RefreshTokenExpired",Ft.RefreshTokenInvalid="RefreshTokenInvalid",Ft.CreateUserFailed="CreateUserFailed",Ft.SetUserPasswordFailed="SetUserPasswordFailed",Ft.SetUserRoleFailed="SetUserRoleFailed",Ft.UpdateUserFailed="UpdateUserFailed",Ft.RemoveUserFailed="RemoveUserFailed",Ft.CreateRoleFailed="CreateRoleFailed",Ft.UpdateRoleFailed="UpdateRoleFailed",Ft.RemoveUserRoleFailed="RemoveUserRoleFailed",Ft.ChangeActiveStateFailed="ChangeActiveStateFailed",Ft.RemoveRoleFailed="RemoveRoleFailed",Ft.UserNotFound="UserNotFound",Ft.RoleNotFound="RoleNotFound",Ft.EmailNotConfirmed="EmailNotConfirmed",Ft.DuplicateEmailError="DuplicateEmailError",Ft.InvalidPassword="InvalidPassword",Ft.RoleExists="RoleExists",Ft.UserExists="UserExists",Ft.UserLockedError="UserLockedError",Ft.InvalidEmail="InvalidEmail",Ft.InvalidUsername="InvalidUsername",Ft.Unauthorized="Unauthorized",Ft.EmailNotChanged="EmailNotChanged",Ft.EmailNotSet="EmailNotSet",(Nt=exports.FeatureType||(exports.FeatureType={})).Unknown="Unknown",Nt.GeometricFeature="GeometricFeature",(Dt=exports.FontStyle||(exports.FontStyle={})).Normal="normal",Dt.Oblique="oblique",Dt.Italic="italic",(At=exports.FontWeight||(exports.FontWeight={})).Thin="Thin",At.ExtraLight="ExtraLight",At.Light="Light",At.SemiLight="SemiLight",At.Normal="Normal",At.Medium="Medium",At.DemiBold="DemiBold",At.Bold="Bold",At.ExtraBold="ExtraBold",At.Black="Black",At.ExtraBlack="ExtraBlack",(Ot=exports.GeometryType||(exports.GeometryType={})).Unknown="unknown",Ot.Point="point",Ot.Polyline="polyline",Ot.Polygon="polygon",Ot.Envelope="envelope",Ot.Multipoint="multipoint",(Bt=exports.Group||(exports.Group={})).My="my",Bt.Role="role",Bt.Public="public",Bt.All="all",(_t=exports.LineEndingSize||(exports.LineEndingSize={})).Small="small",_t.Large="large",(Mt=exports.LineEndingType||(exports.LineEndingType={})).None="none",Mt.Arrow="arrow",Mt.FilledArrow="filledArrow",Mt.Square="square",Mt.FilledSquare="filledSquare",Mt.Circle="circle",Mt.FilledCircle="filledCircle",(qt=exports.Operation||(exports.Operation={})).Unknown="Unknown",qt.Union="union",qt.Intersection="intersection",qt.Subtraction="subtraction",qt.SymDifference="symDifference",(Wt=exports.Permissions||(exports.Permissions={})).None="none",Wt.Configure="configure",Wt.Write="write",Wt.Read="read",Wt.ReadConfigure="read,configure",Wt.ReadWrite="read,write",Wt.All="read,write,configure",(Gt=exports.PolicyType||(exports.PolicyType={})).Unknown="Unknown",Gt.CreateTable="CreateTable",Gt.CreateLayer="CreateLayer",Gt.CreateProject="CreateProject",Gt.MaxFeaturesInOneTable="MaxFeaturesInOneTable",(Ht=exports.ResourceType||(exports.ResourceType={})).Unknown="Unknown",Ht.Table="table",Ht.Layer="layer",Ht.Project="project",Ht.File="file",Ht.Feature="feature",(zt=exports.ResourceTypeLink||(exports.ResourceTypeLink={})).Table="tables",zt.Layer="layers",zt.Project="projects",(Vt=exports.ServerTaskStatus||(exports.ServerTaskStatus={})).None="None",Vt.Scheduled="Scheduled",Vt.Planning="Planning",Vt.Executing="Executing",Vt.Completed="Completed",Vt.Failed="Failed",Vt.Canceled="Canceled",Vt.Timeout="Timeout",(Jt=exports.StringSubType||(exports.StringSubType={})).None="None",Jt.Image="Image",Jt.PkkCode="PkkCode",(Qt=exports.TextAlignment||(exports.TextAlignment={})).Right="right",Qt.Left="left",Qt.Center="center",Qt.Justified="justified",(Kt=exports.TextVerticalAlignment||(exports.TextVerticalAlignment={})).Top="top",Kt.Bottom="bottom",Kt.Middle="middle",Object.defineProperty(exports,"HTTPError",{enumerable:!0,get:function(){return r.HTTPError}}),Object.defineProperty(exports,"TimeoutError",{enumerable:!0,get:function(){return r.TimeoutError}}),exports.API_USER_INFO_KEY=He,exports.Account=ze,exports.AccountPreview=Je,exports.Api=mt,exports.BulkOperations=L,exports.ClientSettings=Ye,exports.EvergisDynamicLayer=wt,exports.EvergisTileLayer=bt,exports.External=Ke,exports.Feedback=ht,exports.FileUpload=N,exports.GEOCODE_PROVIDER="geocode2gis",exports.General=Be,exports.Geocode=Ue,exports.HttpClient=T,exports.IceRouter=ut,exports.Import=A,exports.Layers=ye,exports.LayersManager=Tt,exports.Names=ot,exports.Namespace=Me,exports.Notification=_,exports.NotificationEvent=M,exports.PortalSettings=Ze,exports.Projects=we,exports.ResourceCatalog=Ne,exports.Resources=Se,exports.Scheduler=W,exports.Security=U,exports.SpatialProcessor=St,exports.Statistic=ct,exports.Styles=Ie,exports.Tables=me,exports.Tools=Ae,exports.addSubDomainToLocation=st,exports.errorHandler=et,exports.formDataFromFile=function(e){const t=new FormData;return t.append("file",e),t},exports.generateId=it,exports.isEvergisDynamicLayer=function(e){return e instanceof wt},exports.isEvergisTileLayer=function(e){return e instanceof bt},exports.isFeatureLayer=function(e){return e instanceof p.FeatureLayer},exports.isHTTPError=e=>tt(e)&&"http"===e.type,exports.isHandledError=tt,exports.isLayer=rt,exports.isProjectContentItems=function(e){return null!=e},exports.isString=Te,exports.isTileLayerService=function(e){return e.type&&/TileService/.test(e.type)},exports.promiseAllIgnoreErrors=le,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=P,exports.unique=xe;
|
|
2
2
|
//# sourceMappingURL=api.cjs.production.min.js.map
|