@nextgis/ngw-leaflet 2.4.1 → 3.0.0-alpha.0

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.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-leaflet; version: 2.4.1; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 3.0.0-alpha.0; author: NextGIS */
2
2
  function styleInject(css, ref) {
3
3
  if ( ref === void 0 ) ref = {};
4
4
  var insertAt = ref.insertAt;
@@ -14930,7 +14930,7 @@ function objectRemoveEmpty(obj) {
14930
14930
  }
14931
14931
 
14932
14932
  function round(val, toFixed) {
14933
- const n = toFixed ? Number("1e+" + toFixed) : 1;
14933
+ const n = 1;
14934
14934
  return Math.round((val + Number.EPSILON) * n) / n;
14935
14935
  }
14936
14936
 
@@ -15048,15 +15048,15 @@ function createFeaturePositionOptions(features) {
15048
15048
  };
15049
15049
  }
15050
15050
 
15051
- var __defProp$$ = Object.defineProperty;
15052
- var __defNormalProp$$ = (obj, key, value) => key in obj ? __defProp$$(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15053
- var __publicField$I = (obj, key, value) => __defNormalProp$$(obj, typeof key !== "symbol" ? key + "" : key, value);
15051
+ var __defProp$Y = Object.defineProperty;
15052
+ var __defNormalProp$Y = (obj, key, value) => key in obj ? __defProp$Y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15053
+ var __publicField$E = (obj, key, value) => __defNormalProp$Y(obj, typeof key !== "symbol" ? key + "" : key, value);
15054
15054
  class BaseAdapter {
15055
15055
  constructor(map, options) {
15056
15056
  this.map = map;
15057
15057
  this.options = options;
15058
- __publicField$I(this, "layer");
15059
- __publicField$I(this, "pane", "order-0");
15058
+ __publicField$E(this, "layer");
15059
+ __publicField$E(this, "pane", "order-0");
15060
15060
  if (options.order !== void 0) {
15061
15061
  const pane = "order-" + options.order;
15062
15062
  let exist = map.getPane(pane);
@@ -15085,19 +15085,19 @@ function convertMapClickEvent(evt) {
15085
15085
  };
15086
15086
  }
15087
15087
 
15088
- var __defProp$_ = Object.defineProperty;
15089
- var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
15090
- var __hasOwnProp$E = Object.prototype.hasOwnProperty;
15091
- var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
15092
- var __defNormalProp$_ = (obj, key, value) => key in obj ? __defProp$_(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15093
- var __spreadValues$D = (a, b) => {
15088
+ var __defProp$X = Object.defineProperty;
15089
+ var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
15090
+ var __hasOwnProp$G = Object.prototype.hasOwnProperty;
15091
+ var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
15092
+ var __defNormalProp$X = (obj, key, value) => key in obj ? __defProp$X(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15093
+ var __spreadValues$F = (a, b) => {
15094
15094
  for (var prop in b || (b = {}))
15095
- if (__hasOwnProp$E.call(b, prop))
15096
- __defNormalProp$_(a, prop, b[prop]);
15097
- if (__getOwnPropSymbols$E)
15098
- for (var prop of __getOwnPropSymbols$E(b)) {
15099
- if (__propIsEnum$E.call(b, prop))
15100
- __defNormalProp$_(a, prop, b[prop]);
15095
+ if (__hasOwnProp$G.call(b, prop))
15096
+ __defNormalProp$X(a, prop, b[prop]);
15097
+ if (__getOwnPropSymbols$G)
15098
+ for (var prop of __getOwnPropSymbols$G(b)) {
15099
+ if (__propIsEnum$G.call(b, prop))
15100
+ __defNormalProp$X(a, prop, b[prop]);
15101
15101
  }
15102
15102
  return a;
15103
15103
  };
@@ -15107,7 +15107,7 @@ function createMouseEvent({
15107
15107
  }) {
15108
15108
  const layer_ = source.target;
15109
15109
  const feature = layer_.feature;
15110
- const opt = __spreadValues$D({
15110
+ const opt = __spreadValues$F({
15111
15111
  layer,
15112
15112
  feature,
15113
15113
  event: convertMapClickEvent(source),
@@ -15116,30 +15116,30 @@ function createMouseEvent({
15116
15116
  return opt;
15117
15117
  }
15118
15118
 
15119
- var __defProp$Z = Object.defineProperty;
15120
- var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
15121
- var __hasOwnProp$D = Object.prototype.hasOwnProperty;
15122
- var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
15123
- var __defNormalProp$Z = (obj, key, value) => key in obj ? __defProp$Z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15124
- var __spreadValues$C = (a, b) => {
15119
+ var __defProp$W = Object.defineProperty;
15120
+ var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
15121
+ var __hasOwnProp$F = Object.prototype.hasOwnProperty;
15122
+ var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
15123
+ var __defNormalProp$W = (obj, key, value) => key in obj ? __defProp$W(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15124
+ var __spreadValues$E = (a, b) => {
15125
15125
  for (var prop in b || (b = {}))
15126
- if (__hasOwnProp$D.call(b, prop))
15127
- __defNormalProp$Z(a, prop, b[prop]);
15128
- if (__getOwnPropSymbols$D)
15129
- for (var prop of __getOwnPropSymbols$D(b)) {
15130
- if (__propIsEnum$D.call(b, prop))
15131
- __defNormalProp$Z(a, prop, b[prop]);
15126
+ if (__hasOwnProp$F.call(b, prop))
15127
+ __defNormalProp$W(a, prop, b[prop]);
15128
+ if (__getOwnPropSymbols$F)
15129
+ for (var prop of __getOwnPropSymbols$F(b)) {
15130
+ if (__propIsEnum$F.call(b, prop))
15131
+ __defNormalProp$W(a, prop, b[prop]);
15132
15132
  }
15133
15133
  return a;
15134
15134
  };
15135
- var __publicField$H = (obj, key, value) => __defNormalProp$Z(obj, typeof key !== "symbol" ? key + "" : key, value);
15135
+ var __publicField$D = (obj, key, value) => __defNormalProp$W(obj, typeof key !== "symbol" ? key + "" : key, value);
15136
15136
  class GeoJsonEvents {
15137
15137
  constructor(layer) {
15138
- __publicField$H(this, "layer");
15139
- __publicField$H(this, "_onclick");
15140
- __publicField$H(this, "_ondblclick");
15141
- __publicField$H(this, "_mouseout");
15142
- __publicField$H(this, "_mouseover");
15138
+ __publicField$D(this, "layer");
15139
+ __publicField$D(this, "_onclick");
15140
+ __publicField$D(this, "_ondblclick");
15141
+ __publicField$D(this, "_mouseout");
15142
+ __publicField$D(this, "_mouseover");
15143
15143
  this.layer = layer;
15144
15144
  }
15145
15145
  handleMouseEvents(layer) {
@@ -15148,7 +15148,7 @@ class GeoJsonEvents {
15148
15148
  if (onClick_) {
15149
15149
  this._onclick = (e) => {
15150
15150
  const selected = !!this.layer._getSelected(layer);
15151
- onClick_(__spreadValues$C({
15151
+ onClick_(__spreadValues$E({
15152
15152
  selected
15153
15153
  }, this._createMouseEvent(e)));
15154
15154
  };
@@ -15158,7 +15158,7 @@ class GeoJsonEvents {
15158
15158
  this._ondblclick = (e) => {
15159
15159
  leafletSrcExports.DomEvent.stopPropagation(e);
15160
15160
  const selected = !!this.layer._getSelected(layer);
15161
- onDoubleClick(__spreadValues$C({
15161
+ onDoubleClick(__spreadValues$E({
15162
15162
  selected
15163
15163
  }, this._createMouseEvent(e)));
15164
15164
  };
@@ -15836,19 +15836,19 @@ const typeExpressions = {
15836
15836
  typeof: evaluateArgs(([arg]) => typeOfValue(arg))
15837
15837
  };
15838
15838
 
15839
- var __defProp$Y = Object.defineProperty;
15840
- var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
15841
- var __hasOwnProp$C = Object.prototype.hasOwnProperty;
15842
- var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
15843
- var __defNormalProp$Y = (obj, key, value) => key in obj ? __defProp$Y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15844
- var __spreadValues$B = (a, b) => {
15839
+ var __defProp$V = Object.defineProperty;
15840
+ var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
15841
+ var __hasOwnProp$E = Object.prototype.hasOwnProperty;
15842
+ var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
15843
+ var __defNormalProp$V = (obj, key, value) => key in obj ? __defProp$V(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15844
+ var __spreadValues$D = (a, b) => {
15845
15845
  for (var prop in b || (b = {}))
15846
- if (__hasOwnProp$C.call(b, prop))
15847
- __defNormalProp$Y(a, prop, b[prop]);
15848
- if (__getOwnPropSymbols$C)
15849
- for (var prop of __getOwnPropSymbols$C(b)) {
15850
- if (__propIsEnum$C.call(b, prop))
15851
- __defNormalProp$Y(a, prop, b[prop]);
15846
+ if (__hasOwnProp$E.call(b, prop))
15847
+ __defNormalProp$V(a, prop, b[prop]);
15848
+ if (__getOwnPropSymbols$E)
15849
+ for (var prop of __getOwnPropSymbols$E(b)) {
15850
+ if (__propIsEnum$E.call(b, prop))
15851
+ __defNormalProp$V(a, prop, b[prop]);
15852
15852
  }
15853
15853
  return a;
15854
15854
  };
@@ -15860,7 +15860,7 @@ function isExpression(value) {
15860
15860
  }
15861
15861
  return false;
15862
15862
  }
15863
- const expressions = __spreadValues$B(__spreadValues$B(__spreadValues$B(__spreadValues$B(__spreadValues$B(__spreadValues$B({}, mathExpressions), typeExpressions), stringExpressions), lookupExpressions), decisionExpressions), interpolationExpressions);
15863
+ const expressions = __spreadValues$D(__spreadValues$D(__spreadValues$D(__spreadValues$D(__spreadValues$D(__spreadValues$D({}, mathExpressions), typeExpressions), stringExpressions), lookupExpressions), decisionExpressions), interpolationExpressions);
15864
15864
  function evaluate(expression, data = {}) {
15865
15865
  const [name, ...args] = expression;
15866
15866
  const expressionFun = expressions[name];
@@ -15873,19 +15873,19 @@ function evaluate(expression, data = {}) {
15873
15873
  throw new Error(`Expression "${name}" is not supported.`);
15874
15874
  }
15875
15875
 
15876
- var __defProp$X = Object.defineProperty;
15877
- var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
15878
- var __hasOwnProp$B = Object.prototype.hasOwnProperty;
15879
- var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
15880
- var __defNormalProp$X = (obj, key, value) => key in obj ? __defProp$X(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15881
- var __spreadValues$A = (a, b) => {
15876
+ var __defProp$U = Object.defineProperty;
15877
+ var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
15878
+ var __hasOwnProp$D = Object.prototype.hasOwnProperty;
15879
+ var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
15880
+ var __defNormalProp$U = (obj, key, value) => key in obj ? __defProp$U(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15881
+ var __spreadValues$C = (a, b) => {
15882
15882
  for (var prop in b || (b = {}))
15883
- if (__hasOwnProp$B.call(b, prop))
15884
- __defNormalProp$X(a, prop, b[prop]);
15885
- if (__getOwnPropSymbols$B)
15886
- for (var prop of __getOwnPropSymbols$B(b)) {
15887
- if (__propIsEnum$B.call(b, prop))
15888
- __defNormalProp$X(a, prop, b[prop]);
15883
+ if (__hasOwnProp$D.call(b, prop))
15884
+ __defNormalProp$U(a, prop, b[prop]);
15885
+ if (__getOwnPropSymbols$D)
15886
+ for (var prop of __getOwnPropSymbols$D(b)) {
15887
+ if (__propIsEnum$D.call(b, prop))
15888
+ __defNormalProp$U(a, prop, b[prop]);
15889
15889
  }
15890
15890
  return a;
15891
15891
  };
@@ -15918,25 +15918,25 @@ function createExpressionCallback(paint) {
15918
15918
  for (const p in expressions) {
15919
15919
  fromCb[p] = expressions[p](feature);
15920
15920
  }
15921
- return __spreadValues$A(__spreadValues$A({}, paint), fromCb);
15921
+ return __spreadValues$C(__spreadValues$C({}, paint), fromCb);
15922
15922
  };
15923
15923
  }
15924
15924
  return;
15925
15925
  }
15926
15926
 
15927
- var __defProp$W = Object.defineProperty;
15928
- var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
15929
- var __hasOwnProp$A = Object.prototype.hasOwnProperty;
15930
- var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
15931
- var __defNormalProp$W = (obj, key, value) => key in obj ? __defProp$W(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15932
- var __spreadValues$z = (a, b) => {
15927
+ var __defProp$T = Object.defineProperty;
15928
+ var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
15929
+ var __hasOwnProp$C = Object.prototype.hasOwnProperty;
15930
+ var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
15931
+ var __defNormalProp$T = (obj, key, value) => key in obj ? __defProp$T(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
15932
+ var __spreadValues$B = (a, b) => {
15933
15933
  for (var prop in b || (b = {}))
15934
- if (__hasOwnProp$A.call(b, prop))
15935
- __defNormalProp$W(a, prop, b[prop]);
15936
- if (__getOwnPropSymbols$A)
15937
- for (var prop of __getOwnPropSymbols$A(b)) {
15938
- if (__propIsEnum$A.call(b, prop))
15939
- __defNormalProp$W(a, prop, b[prop]);
15934
+ if (__hasOwnProp$C.call(b, prop))
15935
+ __defNormalProp$T(a, prop, b[prop]);
15936
+ if (__getOwnPropSymbols$C)
15937
+ for (var prop of __getOwnPropSymbols$C(b)) {
15938
+ if (__propIsEnum$C.call(b, prop))
15939
+ __defNormalProp$T(a, prop, b[prop]);
15940
15940
  }
15941
15941
  return a;
15942
15942
  };
@@ -15983,7 +15983,7 @@ function isPropertyFilter(filter) {
15983
15983
  return false;
15984
15984
  }
15985
15985
  function featureFilter(feature, filters) {
15986
- const properties = __spreadValues$z({}, feature.properties);
15986
+ const properties = __spreadValues$B({}, feature.properties);
15987
15987
  if (properties) {
15988
15988
  properties.$id = feature.id;
15989
15989
  return propertiesFilter(properties, filters);
@@ -16018,19 +16018,19 @@ function propertiesFilter(properties, filters) {
16018
16018
  return logic === "any" ? filters_.some(filterFunction) : filters_.every(filterFunction);
16019
16019
  }
16020
16020
 
16021
- var __defProp$V = Object.defineProperty;
16022
- var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
16023
- var __hasOwnProp$z = Object.prototype.hasOwnProperty;
16024
- var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
16025
- var __defNormalProp$V = (obj, key, value) => key in obj ? __defProp$V(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16026
- var __spreadValues$y = (a, b) => {
16021
+ var __defProp$S = Object.defineProperty;
16022
+ var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
16023
+ var __hasOwnProp$B = Object.prototype.hasOwnProperty;
16024
+ var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
16025
+ var __defNormalProp$S = (obj, key, value) => key in obj ? __defProp$S(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16026
+ var __spreadValues$A = (a, b) => {
16027
16027
  for (var prop in b || (b = {}))
16028
- if (__hasOwnProp$z.call(b, prop))
16029
- __defNormalProp$V(a, prop, b[prop]);
16030
- if (__getOwnPropSymbols$z)
16031
- for (var prop of __getOwnPropSymbols$z(b)) {
16032
- if (__propIsEnum$z.call(b, prop))
16033
- __defNormalProp$V(a, prop, b[prop]);
16028
+ if (__hasOwnProp$B.call(b, prop))
16029
+ __defNormalProp$S(a, prop, b[prop]);
16030
+ if (__getOwnPropSymbols$B)
16031
+ for (var prop of __getOwnPropSymbols$B(b)) {
16032
+ if (__propIsEnum$B.call(b, prop))
16033
+ __defNormalProp$S(a, prop, b[prop]);
16034
16034
  }
16035
16035
  return a;
16036
16036
  };
@@ -16059,7 +16059,7 @@ function createPropertiesPaint(propertiesPaint) {
16059
16059
  return (feature) => {
16060
16060
  const paint = paintsFilters.find((x) => featureFilter(feature, x[0]));
16061
16061
  if (paint) {
16062
- return __spreadValues$y(__spreadValues$y({}, mask), paint[1]);
16062
+ return __spreadValues$A(__spreadValues$A({}, mask), paint[1]);
16063
16063
  }
16064
16064
  return mask;
16065
16065
  };
@@ -16083,8 +16083,8 @@ function expressionCallback({
16083
16083
  }
16084
16084
  function finalizePaint({ paint, defaultPaint }) {
16085
16085
  var _a;
16086
- let newPaint = __spreadValues$y({}, defaultPaint);
16087
- newPaint = __spreadValues$y(__spreadValues$y({}, newPaint), paint);
16086
+ let newPaint = __spreadValues$A({}, defaultPaint);
16087
+ newPaint = __spreadValues$A(__spreadValues$A({}, newPaint), paint);
16088
16088
  newPaint.fill = (_a = newPaint.fill) != null ? _a : true;
16089
16089
  newPaint.stroke = newPaint.stroke !== void 0 ? newPaint.stroke : !newPaint.fill || !!(newPaint.strokeColor || newPaint.strokeOpacity);
16090
16090
  return newPaint;
@@ -16097,7 +16097,7 @@ function preparePaint({
16097
16097
  if (!paint) {
16098
16098
  throw new Error("paint is empty");
16099
16099
  }
16100
- let newPaint = __spreadValues$y({}, defaultPaint);
16100
+ let newPaint = __spreadValues$A({}, defaultPaint);
16101
16101
  if (isPaintCallback(paint)) {
16102
16102
  const getPaintFunction = (feature) => {
16103
16103
  const getPaint = preparePaint({
@@ -16154,41 +16154,41 @@ function preparePaint({
16154
16154
  return newPaint;
16155
16155
  }
16156
16156
 
16157
- var __defProp$U = Object.defineProperty;
16157
+ var __defProp$R = Object.defineProperty;
16158
16158
  var __defProps$j = Object.defineProperties;
16159
16159
  var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
16160
- var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
16161
- var __hasOwnProp$y = Object.prototype.hasOwnProperty;
16162
- var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
16163
- var __defNormalProp$U = (obj, key, value) => key in obj ? __defProp$U(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16164
- var __spreadValues$x = (a, b) => {
16160
+ var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
16161
+ var __hasOwnProp$A = Object.prototype.hasOwnProperty;
16162
+ var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
16163
+ var __defNormalProp$R = (obj, key, value) => key in obj ? __defProp$R(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16164
+ var __spreadValues$z = (a, b) => {
16165
16165
  for (var prop in b || (b = {}))
16166
- if (__hasOwnProp$y.call(b, prop))
16167
- __defNormalProp$U(a, prop, b[prop]);
16168
- if (__getOwnPropSymbols$y)
16169
- for (var prop of __getOwnPropSymbols$y(b)) {
16170
- if (__propIsEnum$y.call(b, prop))
16171
- __defNormalProp$U(a, prop, b[prop]);
16166
+ if (__hasOwnProp$A.call(b, prop))
16167
+ __defNormalProp$R(a, prop, b[prop]);
16168
+ if (__getOwnPropSymbols$A)
16169
+ for (var prop of __getOwnPropSymbols$A(b)) {
16170
+ if (__propIsEnum$A.call(b, prop))
16171
+ __defNormalProp$R(a, prop, b[prop]);
16172
16172
  }
16173
16173
  return a;
16174
16174
  };
16175
16175
  var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
16176
- var __objRest$4 = (source, exclude) => {
16176
+ var __objRest$5 = (source, exclude) => {
16177
16177
  var target = {};
16178
16178
  for (var prop in source)
16179
- if (__hasOwnProp$y.call(source, prop) && exclude.indexOf(prop) < 0)
16179
+ if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
16180
16180
  target[prop] = source[prop];
16181
- if (source != null && __getOwnPropSymbols$y)
16182
- for (var prop of __getOwnPropSymbols$y(source)) {
16183
- if (exclude.indexOf(prop) < 0 && __propIsEnum$y.call(source, prop))
16181
+ if (source != null && __getOwnPropSymbols$A)
16182
+ for (var prop of __getOwnPropSymbols$A(source)) {
16183
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
16184
16184
  target[prop] = source[prop];
16185
16185
  }
16186
16186
  return target;
16187
16187
  };
16188
- var __publicField$G = (obj, key, value) => __defNormalProp$U(obj, typeof key !== "symbol" ? key + "" : key, value);
16188
+ var __publicField$C = (obj, key, value) => __defNormalProp$R(obj, key + "" , value);
16189
16189
  class GeoJsonPaint {
16190
16190
  constructor(layer) {
16191
- __publicField$G(this, "layer");
16191
+ __publicField$C(this, "layer");
16192
16192
  this.layer = layer;
16193
16193
  }
16194
16194
  setPaintEachLayer(paint) {
@@ -16256,7 +16256,7 @@ class GeoJsonPaint {
16256
16256
  return PAINT;
16257
16257
  }
16258
16258
  _createDivIcon(icon) {
16259
- const _a = icon, { html, rotate, className } = _a, toLIconOpt = __objRest$4(_a, ["html", "rotate", "className"]);
16259
+ const _a = icon, { html, rotate, className } = _a, toLIconOpt = __objRest$5(_a, ["html", "rotate", "className"]);
16260
16260
  const element = document.createElement("div");
16261
16261
  if (className) {
16262
16262
  element.className = className;
@@ -16267,7 +16267,7 @@ class GeoJsonPaint {
16267
16267
  if (html) {
16268
16268
  element.innerHTML = html;
16269
16269
  }
16270
- const divIcon = new leafletSrcExports.DivIcon(__spreadProps$j(__spreadValues$x({
16270
+ const divIcon = new leafletSrcExports.DivIcon(__spreadProps$j(__spreadValues$z({
16271
16271
  className: ""
16272
16272
  }, toLIconOpt), {
16273
16273
  html: element
@@ -16293,7 +16293,7 @@ class GeoJsonPaint {
16293
16293
  }
16294
16294
  return (_, latlng) => {
16295
16295
  const p = PAINT;
16296
- return new leafletSrcExports.CircleMarker(latlng, this.preparePaint(__spreadValues$x(__spreadValues$x({}, p), icon)));
16296
+ return new leafletSrcExports.CircleMarker(latlng, this.preparePaint(__spreadValues$z(__spreadValues$z({}, p), icon)));
16297
16297
  };
16298
16298
  }
16299
16299
  createPaintOptions(paint) {
@@ -16315,27 +16315,27 @@ class GeoJsonPaint {
16315
16315
  }
16316
16316
  }
16317
16317
 
16318
- var __defProp$T = Object.defineProperty;
16318
+ var __defProp$Q = Object.defineProperty;
16319
16319
  var __defProps$i = Object.defineProperties;
16320
16320
  var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
16321
- var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
16322
- var __hasOwnProp$x = Object.prototype.hasOwnProperty;
16323
- var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
16324
- var __defNormalProp$T = (obj, key, value) => key in obj ? __defProp$T(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16325
- var __spreadValues$w = (a, b) => {
16321
+ var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
16322
+ var __hasOwnProp$z = Object.prototype.hasOwnProperty;
16323
+ var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
16324
+ var __defNormalProp$Q = (obj, key, value) => key in obj ? __defProp$Q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16325
+ var __spreadValues$y = (a, b) => {
16326
16326
  for (var prop in b || (b = {}))
16327
- if (__hasOwnProp$x.call(b, prop))
16328
- __defNormalProp$T(a, prop, b[prop]);
16329
- if (__getOwnPropSymbols$x)
16330
- for (var prop of __getOwnPropSymbols$x(b)) {
16331
- if (__propIsEnum$x.call(b, prop))
16332
- __defNormalProp$T(a, prop, b[prop]);
16327
+ if (__hasOwnProp$z.call(b, prop))
16328
+ __defNormalProp$Q(a, prop, b[prop]);
16329
+ if (__getOwnPropSymbols$z)
16330
+ for (var prop of __getOwnPropSymbols$z(b)) {
16331
+ if (__propIsEnum$z.call(b, prop))
16332
+ __defNormalProp$Q(a, prop, b[prop]);
16333
16333
  }
16334
16334
  return a;
16335
16335
  };
16336
16336
  var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
16337
- var __publicField$F = (obj, key, value) => __defNormalProp$T(obj, typeof key !== "symbol" ? key + "" : key, value);
16338
- var __async$l = (__this, __arguments, generator) => {
16337
+ var __publicField$B = (obj, key, value) => __defNormalProp$Q(obj, typeof key !== "symbol" ? key + "" : key, value);
16338
+ var __async$s = (__this, __arguments, generator) => {
16339
16339
  return new Promise((resolve, reject) => {
16340
16340
  var fulfilled = (value) => {
16341
16341
  try {
@@ -16358,22 +16358,22 @@ var __async$l = (__this, __arguments, generator) => {
16358
16358
  class GeoJsonAdapter extends BaseAdapter {
16359
16359
  constructor(map, options) {
16360
16360
  super(map, options);
16361
- __publicField$F(this, "layer");
16362
- __publicField$F(this, "selected", false);
16363
- __publicField$F(this, "type");
16364
- __publicField$F(this, "_layers", []);
16365
- __publicField$F(this, "_events");
16366
- __publicField$F(this, "paint");
16367
- __publicField$F(this, "selectedPaint");
16368
- __publicField$F(this, "_selectedLayers", []);
16369
- __publicField$F(this, "_filteredLayers", []);
16370
- __publicField$F(this, "_filterFun");
16371
- __publicField$F(this, "_openedPopup", []);
16372
- __publicField$F(this, "_paint");
16373
- __publicField$F(this, "$updateTooltip", debounce(() => {
16361
+ __publicField$B(this, "layer");
16362
+ __publicField$B(this, "selected", false);
16363
+ __publicField$B(this, "type");
16364
+ __publicField$B(this, "_layers", []);
16365
+ __publicField$B(this, "_events");
16366
+ __publicField$B(this, "paint");
16367
+ __publicField$B(this, "selectedPaint");
16368
+ __publicField$B(this, "_selectedLayers", []);
16369
+ __publicField$B(this, "_filteredLayers", []);
16370
+ __publicField$B(this, "_filterFun");
16371
+ __publicField$B(this, "_openedPopup", []);
16372
+ __publicField$B(this, "_paint");
16373
+ __publicField$B(this, "$updateTooltip", debounce(() => {
16374
16374
  this.updateTooltip();
16375
16375
  }, 300));
16376
- __publicField$F(this, "$unselect", () => {
16376
+ __publicField$B(this, "$unselect", () => {
16377
16377
  this.unselect();
16378
16378
  });
16379
16379
  this._events = new GeoJsonEvents(this);
@@ -16382,7 +16382,7 @@ class GeoJsonAdapter extends BaseAdapter {
16382
16382
  addLayer(options) {
16383
16383
  Object.assign(this.options, options);
16384
16384
  this.paint = options.paint;
16385
- this.layer = new leafletSrcExports.FeatureGroup([], __spreadProps$i(__spreadValues$w({}, options.nativeOptions), {
16385
+ this.layer = new leafletSrcExports.FeatureGroup([], __spreadProps$i(__spreadValues$y({}, options.nativeOptions), {
16386
16386
  pane: this.pane
16387
16387
  }));
16388
16388
  this.selectedPaint = options.selectedPaint;
@@ -16431,7 +16431,7 @@ class GeoJsonAdapter extends BaseAdapter {
16431
16431
  }
16432
16432
  getSelected() {
16433
16433
  return this._selectedLayers.map((x) => {
16434
- return __spreadValues$w({
16434
+ return __spreadValues$y({
16435
16435
  target: this,
16436
16436
  feature: x.feature,
16437
16437
  layer: x
@@ -16450,14 +16450,14 @@ class GeoJsonAdapter extends BaseAdapter {
16450
16450
  const filteredLayers = [];
16451
16451
  this._layers.forEach(({ feature, layer }) => {
16452
16452
  if (layer) {
16453
- const ok = fun ? fun(__spreadValues$w({
16453
+ const ok = fun ? fun(__spreadValues$y({
16454
16454
  target: this,
16455
16455
  feature,
16456
16456
  layer
16457
16457
  }, createFeaturePositionOptions(feature))) : true;
16458
16458
  if (ok) {
16459
16459
  layer_.addLayer(layer);
16460
- filteredLayers.push(__spreadValues$w({
16460
+ filteredLayers.push(__spreadValues$y({
16461
16461
  target: this,
16462
16462
  feature,
16463
16463
  layer
@@ -16478,7 +16478,7 @@ class GeoJsonAdapter extends BaseAdapter {
16478
16478
  getLayers() {
16479
16479
  return this._layers.map(({ layer, feature }) => {
16480
16480
  const visible = layer && !!layer._map;
16481
- return __spreadValues$w({
16481
+ return __spreadValues$y({
16482
16482
  feature,
16483
16483
  layer,
16484
16484
  visible,
@@ -16596,13 +16596,13 @@ class GeoJsonAdapter extends BaseAdapter {
16596
16596
  }
16597
16597
  }
16598
16598
  updatePaint(paint) {
16599
- this.paint = __spreadValues$w(__spreadValues$w({}, this.paint), paint);
16599
+ this.paint = __spreadValues$y(__spreadValues$y({}, this.paint), paint);
16600
16600
  for (const l of this._layers) {
16601
16601
  this._paint.setPaint(l, this.paint);
16602
16602
  }
16603
16603
  }
16604
16604
  updateSelectedPaint(paint) {
16605
- this.selectedPaint = __spreadValues$w(__spreadValues$w({}, this.selectedPaint), paint);
16605
+ this.selectedPaint = __spreadValues$y(__spreadValues$y({}, this.selectedPaint), paint);
16606
16606
  for (const l of this._selectedLayers) {
16607
16607
  this._paint.setPaint(l, this.selectedPaint);
16608
16608
  }
@@ -16619,7 +16619,7 @@ class GeoJsonAdapter extends BaseAdapter {
16619
16619
  if (feature.properties && labelField) {
16620
16620
  message = feature.properties[labelField];
16621
16621
  } else if (label) {
16622
- message = label(__spreadValues$w(__spreadValues$w({
16622
+ message = label(__spreadValues$y(__spreadValues$y({
16623
16623
  target: this
16624
16624
  }, layerDef), createFeaturePositionOptions(feature)));
16625
16625
  }
@@ -16630,7 +16630,7 @@ class GeoJsonAdapter extends BaseAdapter {
16630
16630
  }
16631
16631
  }
16632
16632
  _openPopup(_0) {
16633
- return __async$l(this, arguments, function* (def, options = {}, type, latLng) {
16633
+ return __async$s(this, arguments, function* (def, options = {}, type, latLng) {
16634
16634
  var _a, _b;
16635
16635
  const { feature, layer } = def;
16636
16636
  const {
@@ -16638,7 +16638,7 @@ class GeoJsonAdapter extends BaseAdapter {
16638
16638
  autoPan,
16639
16639
  maxWidth,
16640
16640
  closeButton: closeButton_
16641
- } = __spreadValues$w({
16641
+ } = __spreadValues$y({
16642
16642
  minWidth: 300
16643
16643
  }, options);
16644
16644
  const closeButton = closeButton_ != null ? closeButton_ : !this.options.selectOnHover;
@@ -16654,7 +16654,7 @@ class GeoJsonAdapter extends BaseAdapter {
16654
16654
  };
16655
16655
  let content;
16656
16656
  if (options.createPopupContent) {
16657
- content = yield options.createPopupContent(__spreadValues$w({
16657
+ content = yield options.createPopupContent(__spreadValues$y({
16658
16658
  layer,
16659
16659
  feature,
16660
16660
  target: this,
@@ -16730,9 +16730,9 @@ class GeoJsonAdapter extends BaseAdapter {
16730
16730
  lopt = {
16731
16731
  style: (feature) => {
16732
16732
  if (feature) {
16733
- return this._paint.preparePaint(__spreadValues$w(__spreadValues$w({}, PAINT), paint(feature)));
16733
+ return this._paint.preparePaint(__spreadValues$y(__spreadValues$y({}, PAINT), paint(feature)));
16734
16734
  } else {
16735
- return this._paint.preparePaint(__spreadProps$i(__spreadValues$w({}, PAINT), { type: "path" }));
16735
+ return this._paint.preparePaint(__spreadProps$i(__spreadValues$y({}, PAINT), { type: "path" }));
16736
16736
  }
16737
16737
  }
16738
16738
  };
@@ -16748,7 +16748,7 @@ class GeoJsonAdapter extends BaseAdapter {
16748
16748
  _onEachFeature(feature, layer) {
16749
16749
  const layer_ = this.layer;
16750
16750
  if (layer_) {
16751
- const def = __spreadValues$w({
16751
+ const def = __spreadValues$y({
16752
16752
  target: this,
16753
16753
  feature,
16754
16754
  layer
@@ -16783,7 +16783,7 @@ class GeoJsonAdapter extends BaseAdapter {
16783
16783
  setTimeout(() => {
16784
16784
  if (popup) {
16785
16785
  this._openPopup(
16786
- __spreadValues$w({
16786
+ __spreadValues$y({
16787
16787
  target: this,
16788
16788
  layer,
16789
16789
  feature
@@ -16801,7 +16801,7 @@ class GeoJsonAdapter extends BaseAdapter {
16801
16801
  leafletSrcExports.DomEvent.stopPropagation(e);
16802
16802
  const layer = e.target;
16803
16803
  const feature = layer.feature;
16804
- const def = __spreadValues$w({
16804
+ const def = __spreadValues$y({
16805
16805
  target: this,
16806
16806
  layer,
16807
16807
  feature
@@ -16834,7 +16834,7 @@ class GeoJsonAdapter extends BaseAdapter {
16834
16834
  }
16835
16835
  if (this.options.onSelect) {
16836
16836
  const features = def.feature ? [def.feature] : [];
16837
- this.options.onSelect(__spreadValues$w({
16837
+ this.options.onSelect(__spreadValues$y({
16838
16838
  type,
16839
16839
  layer: this,
16840
16840
  features
@@ -16919,20 +16919,20 @@ function callAjax(src, headers) {
16919
16919
  return [promise, abortFunc];
16920
16920
  }
16921
16921
 
16922
- var __defProp$S = Object.defineProperty;
16923
- var __defNormalProp$S = (obj, key, value) => key in obj ? __defProp$S(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16924
- var __publicField$E = (obj, key, value) => __defNormalProp$S(obj, typeof key !== "symbol" ? key + "" : key, value);
16922
+ var __defProp$P = Object.defineProperty;
16923
+ var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16924
+ var __publicField$A = (obj, key, value) => __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
16925
16925
  class Queue {
16926
16926
  /**
16927
16927
  * @param {PromiseQueueOptions} options - Configuration options for the queue.
16928
16928
  */
16929
16929
  constructor({ concurrency = 1, delay = 0 } = {}) {
16930
- __publicField$E(this, "queue", []);
16931
- __publicField$E(this, "concurrency");
16932
- __publicField$E(this, "activeCount", 0);
16933
- __publicField$E(this, "timeoutId");
16934
- __publicField$E(this, "delay");
16935
- __publicField$E(this, "toAbort", []);
16930
+ __publicField$A(this, "queue", []);
16931
+ __publicField$A(this, "concurrency");
16932
+ __publicField$A(this, "activeCount", 0);
16933
+ __publicField$A(this, "timeoutId");
16934
+ __publicField$A(this, "delay");
16935
+ __publicField$A(this, "toAbort", []);
16936
16936
  this.concurrency = concurrency;
16937
16937
  this.delay = delay;
16938
16938
  }
@@ -17008,13 +17008,13 @@ class Queue {
17008
17008
 
17009
17009
  const imageQueue = new Queue({ concurrency: 6, delay: 200 });
17010
17010
 
17011
- var __defProp$R = Object.defineProperty;
17012
- var __defNormalProp$R = (obj, key, value) => key in obj ? __defProp$R(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17013
- var __publicField$D = (obj, key, value) => __defNormalProp$R(obj, typeof key !== "symbol" ? key + "" : key, value);
17011
+ var __defProp$O = Object.defineProperty;
17012
+ var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17013
+ var __publicField$z = (obj, key, value) => __defNormalProp$O(obj, key + "" , value);
17014
17014
  class ImageOverlay extends leafletSrcExports.ImageOverlay {
17015
17015
  constructor(imageUrl, bounds, options) {
17016
17016
  super(imageUrl, bounds, options);
17017
- __publicField$D(this, "_aborter");
17017
+ __publicField$z(this, "_aborter");
17018
17018
  }
17019
17019
  cancelLoad() {
17020
17020
  if (this._aborter) {
@@ -17039,13 +17039,13 @@ class ImageOverlay extends leafletSrcExports.ImageOverlay {
17039
17039
  }
17040
17040
  }
17041
17041
 
17042
- var __defProp$Q = Object.defineProperty;
17043
- var __defNormalProp$Q = (obj, key, value) => key in obj ? __defProp$Q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17044
- var __publicField$C = (obj, key, value) => __defNormalProp$Q(obj, typeof key !== "symbol" ? key + "" : key, value);
17042
+ var __defProp$N = Object.defineProperty;
17043
+ var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17044
+ var __publicField$y = (obj, key, value) => __defNormalProp$N(obj, typeof key !== "symbol" ? key + "" : key, value);
17045
17045
  class ImageLayer extends leafletSrcExports.Layer {
17046
17046
  constructor(url, options) {
17047
17047
  super(options);
17048
- __publicField$C(this, "defaultWmsParams", {
17048
+ __publicField$y(this, "defaultWmsParams", {
17049
17049
  service: "WMS",
17050
17050
  request: "GetMap",
17051
17051
  version: "1.1.1",
@@ -17054,7 +17054,7 @@ class ImageLayer extends leafletSrcExports.Layer {
17054
17054
  format: "image/jpeg",
17055
17055
  transparent: false
17056
17056
  });
17057
- __publicField$C(this, "options", {
17057
+ __publicField$y(this, "options", {
17058
17058
  crs: null,
17059
17059
  uppercase: false,
17060
17060
  attribution: "",
@@ -17066,11 +17066,11 @@ class ImageLayer extends leafletSrcExports.Layer {
17066
17066
  viewPortBuffer: 0,
17067
17067
  setViewDelay: 100
17068
17068
  });
17069
- __publicField$C(this, "wmsParams");
17070
- __publicField$C(this, "_url");
17071
- __publicField$C(this, "_currentUrl");
17072
- __publicField$C(this, "_currentOverlay");
17073
- __publicField$C(this, "_loadedOverlay");
17069
+ __publicField$y(this, "wmsParams");
17070
+ __publicField$y(this, "_url");
17071
+ __publicField$y(this, "_currentUrl");
17072
+ __publicField$y(this, "_currentOverlay");
17073
+ __publicField$y(this, "_loadedOverlay");
17074
17074
  this._url = url;
17075
17075
  const params = {};
17076
17076
  const opts = {};
@@ -17229,34 +17229,34 @@ class ImageLayer extends leafletSrcExports.Layer {
17229
17229
  }
17230
17230
  }
17231
17231
 
17232
- var __defProp$P = Object.defineProperty;
17233
- var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
17234
- var __hasOwnProp$w = Object.prototype.hasOwnProperty;
17235
- var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
17236
- var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17237
- var __spreadValues$v = (a, b) => {
17232
+ var __defProp$M = Object.defineProperty;
17233
+ var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
17234
+ var __hasOwnProp$y = Object.prototype.hasOwnProperty;
17235
+ var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
17236
+ var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17237
+ var __spreadValues$x = (a, b) => {
17238
17238
  for (var prop in b || (b = {}))
17239
- if (__hasOwnProp$w.call(b, prop))
17240
- __defNormalProp$P(a, prop, b[prop]);
17241
- if (__getOwnPropSymbols$w)
17242
- for (var prop of __getOwnPropSymbols$w(b)) {
17243
- if (__propIsEnum$w.call(b, prop))
17244
- __defNormalProp$P(a, prop, b[prop]);
17239
+ if (__hasOwnProp$y.call(b, prop))
17240
+ __defNormalProp$M(a, prop, b[prop]);
17241
+ if (__getOwnPropSymbols$y)
17242
+ for (var prop of __getOwnPropSymbols$y(b)) {
17243
+ if (__propIsEnum$y.call(b, prop))
17244
+ __defNormalProp$M(a, prop, b[prop]);
17245
17245
  }
17246
17246
  return a;
17247
17247
  };
17248
- var __publicField$B = (obj, key, value) => __defNormalProp$P(obj, typeof key !== "symbol" ? key + "" : key, value);
17248
+ var __publicField$x = (obj, key, value) => __defNormalProp$M(obj, typeof key !== "symbol" ? key + "" : key, value);
17249
17249
  class ImageAdapter extends BaseAdapter {
17250
17250
  constructor() {
17251
17251
  super(...arguments);
17252
- __publicField$B(this, "layer");
17252
+ __publicField$x(this, "layer");
17253
17253
  }
17254
17254
  addLayer(options) {
17255
17255
  const url = options && options.url;
17256
17256
  if (url) {
17257
- options = __spreadValues$v({ transparent: true }, options);
17257
+ options = __spreadValues$x({ transparent: true }, options);
17258
17258
  const updateWmsParamsFromOpt = options.updateWmsParams;
17259
- this.layer = new ImageLayer(url, __spreadValues$v(__spreadValues$v(__spreadValues$v({
17259
+ this.layer = new ImageLayer(url, __spreadValues$x(__spreadValues$x(__spreadValues$x({
17260
17260
  pane: this.pane,
17261
17261
  headers: options.headers,
17262
17262
  setViewDelay: options.setViewDelay
@@ -17272,7 +17272,7 @@ class ImageAdapter extends BaseAdapter {
17272
17272
  }
17273
17273
  }
17274
17274
  }
17275
- __publicField$B(ImageAdapter, "queue", imageQueue);
17275
+ __publicField$x(ImageAdapter, "queue", imageQueue);
17276
17276
 
17277
17277
  function makeRemote(Base) {
17278
17278
  return class RemoteTileLayer extends Base {
@@ -17334,33 +17334,33 @@ class TileLayerBase extends leafletSrcExports.TileLayer {
17334
17334
  }
17335
17335
  const TileLayer = makeRemote(TileLayerBase);
17336
17336
 
17337
- var __defProp$O = Object.defineProperty;
17337
+ var __defProp$L = Object.defineProperty;
17338
17338
  var __defProps$h = Object.defineProperties;
17339
17339
  var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
17340
- var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
17341
- var __hasOwnProp$v = Object.prototype.hasOwnProperty;
17342
- var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
17343
- var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17344
- var __spreadValues$u = (a, b) => {
17340
+ var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
17341
+ var __hasOwnProp$x = Object.prototype.hasOwnProperty;
17342
+ var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
17343
+ var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17344
+ var __spreadValues$w = (a, b) => {
17345
17345
  for (var prop in b || (b = {}))
17346
- if (__hasOwnProp$v.call(b, prop))
17347
- __defNormalProp$O(a, prop, b[prop]);
17348
- if (__getOwnPropSymbols$v)
17349
- for (var prop of __getOwnPropSymbols$v(b)) {
17350
- if (__propIsEnum$v.call(b, prop))
17351
- __defNormalProp$O(a, prop, b[prop]);
17346
+ if (__hasOwnProp$x.call(b, prop))
17347
+ __defNormalProp$L(a, prop, b[prop]);
17348
+ if (__getOwnPropSymbols$x)
17349
+ for (var prop of __getOwnPropSymbols$x(b)) {
17350
+ if (__propIsEnum$x.call(b, prop))
17351
+ __defNormalProp$L(a, prop, b[prop]);
17352
17352
  }
17353
17353
  return a;
17354
17354
  };
17355
17355
  var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
17356
- var __objRest$3 = (source, exclude) => {
17356
+ var __objRest$4 = (source, exclude) => {
17357
17357
  var target = {};
17358
17358
  for (var prop in source)
17359
- if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
17359
+ if (__hasOwnProp$x.call(source, prop) && exclude.indexOf(prop) < 0)
17360
17360
  target[prop] = source[prop];
17361
- if (source != null && __getOwnPropSymbols$v)
17362
- for (var prop of __getOwnPropSymbols$v(source)) {
17363
- if (exclude.indexOf(prop) < 0 && __propIsEnum$v.call(source, prop))
17361
+ if (source != null && __getOwnPropSymbols$x)
17362
+ for (var prop of __getOwnPropSymbols$x(source)) {
17363
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$x.call(source, prop))
17364
17364
  target[prop] = source[prop];
17365
17365
  }
17366
17366
  return target;
@@ -17369,9 +17369,9 @@ class TileAdapter extends BaseAdapter {
17369
17369
  addLayer(options) {
17370
17370
  this.options = Object.assign(this.options, options);
17371
17371
  if (options) {
17372
- const _a = options, { url } = _a, opt = __objRest$3(_a, ["url"]);
17372
+ const _a = options, { url } = _a, opt = __objRest$4(_a, ["url"]);
17373
17373
  if (url) {
17374
- const tileLayerOptions = __spreadValues$u({
17374
+ const tileLayerOptions = __spreadValues$w({
17375
17375
  pane: this.pane,
17376
17376
  attribution: opt.attribution,
17377
17377
  minZoom: opt.minZoom,
@@ -17382,7 +17382,7 @@ class TileAdapter extends BaseAdapter {
17382
17382
  }
17383
17383
  let layer;
17384
17384
  if (opt.headers) {
17385
- layer = new TileLayer(url, __spreadProps$h(__spreadValues$u({}, tileLayerOptions), {
17385
+ layer = new TileLayer(url, __spreadProps$h(__spreadValues$w({}, tileLayerOptions), {
17386
17386
  headers: opt.headers,
17387
17387
  setViewDelay: opt.setViewDelay
17388
17388
  }));
@@ -17405,21 +17405,21 @@ class TileAdapter extends BaseAdapter {
17405
17405
  }
17406
17406
  }
17407
17407
 
17408
- var __defProp$N = Object.defineProperty;
17408
+ var __defProp$K = Object.defineProperty;
17409
17409
  var __defProps$g = Object.defineProperties;
17410
17410
  var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
17411
- var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
17412
- var __hasOwnProp$u = Object.prototype.hasOwnProperty;
17413
- var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
17414
- var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17415
- var __spreadValues$t = (a, b) => {
17411
+ var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
17412
+ var __hasOwnProp$w = Object.prototype.hasOwnProperty;
17413
+ var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
17414
+ var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17415
+ var __spreadValues$v = (a, b) => {
17416
17416
  for (var prop in b || (b = {}))
17417
- if (__hasOwnProp$u.call(b, prop))
17418
- __defNormalProp$N(a, prop, b[prop]);
17419
- if (__getOwnPropSymbols$u)
17420
- for (var prop of __getOwnPropSymbols$u(b)) {
17421
- if (__propIsEnum$u.call(b, prop))
17422
- __defNormalProp$N(a, prop, b[prop]);
17417
+ if (__hasOwnProp$w.call(b, prop))
17418
+ __defNormalProp$K(a, prop, b[prop]);
17419
+ if (__getOwnPropSymbols$w)
17420
+ for (var prop of __getOwnPropSymbols$w(b)) {
17421
+ if (__propIsEnum$w.call(b, prop))
17422
+ __defNormalProp$K(a, prop, b[prop]);
17423
17423
  }
17424
17424
  return a;
17425
17425
  };
@@ -17427,7 +17427,7 @@ var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
17427
17427
  class OsmAdapter extends TileAdapter {
17428
17428
  addLayer(options) {
17429
17429
  const url = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
17430
- return super.addLayer(__spreadProps$g(__spreadValues$t({
17430
+ return super.addLayer(__spreadProps$g(__spreadValues$v({
17431
17431
  name: "OpenStreetMap",
17432
17432
  attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
17433
17433
  }, options), {
@@ -17443,33 +17443,33 @@ class WmsLayerBase extends leafletSrcExports.TileLayer.WMS {
17443
17443
  }
17444
17444
  const WmsLayer = makeRemote(WmsLayerBase);
17445
17445
 
17446
- var __defProp$M = Object.defineProperty;
17446
+ var __defProp$J = Object.defineProperty;
17447
17447
  var __defProps$f = Object.defineProperties;
17448
17448
  var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
17449
- var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
17450
- var __hasOwnProp$t = Object.prototype.hasOwnProperty;
17451
- var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
17452
- var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17453
- var __spreadValues$s = (a, b) => {
17454
- for (var prop in b || (b = {}))
17455
- if (__hasOwnProp$t.call(b, prop))
17456
- __defNormalProp$M(a, prop, b[prop]);
17457
- if (__getOwnPropSymbols$t)
17458
- for (var prop of __getOwnPropSymbols$t(b)) {
17459
- if (__propIsEnum$t.call(b, prop))
17460
- __defNormalProp$M(a, prop, b[prop]);
17449
+ var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
17450
+ var __hasOwnProp$v = Object.prototype.hasOwnProperty;
17451
+ var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
17452
+ var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17453
+ var __spreadValues$u = (a, b) => {
17454
+ for (var prop in b || (b = {}))
17455
+ if (__hasOwnProp$v.call(b, prop))
17456
+ __defNormalProp$J(a, prop, b[prop]);
17457
+ if (__getOwnPropSymbols$v)
17458
+ for (var prop of __getOwnPropSymbols$v(b)) {
17459
+ if (__propIsEnum$v.call(b, prop))
17460
+ __defNormalProp$J(a, prop, b[prop]);
17461
17461
  }
17462
17462
  return a;
17463
17463
  };
17464
17464
  var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
17465
- var __objRest$2 = (source, exclude) => {
17465
+ var __objRest$3 = (source, exclude) => {
17466
17466
  var target = {};
17467
17467
  for (var prop in source)
17468
- if (__hasOwnProp$t.call(source, prop) && exclude.indexOf(prop) < 0)
17468
+ if (__hasOwnProp$v.call(source, prop) && exclude.indexOf(prop) < 0)
17469
17469
  target[prop] = source[prop];
17470
- if (source != null && __getOwnPropSymbols$t)
17471
- for (var prop of __getOwnPropSymbols$t(source)) {
17472
- if (exclude.indexOf(prop) < 0 && __propIsEnum$t.call(source, prop))
17470
+ if (source != null && __getOwnPropSymbols$v)
17471
+ for (var prop of __getOwnPropSymbols$v(source)) {
17472
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$v.call(source, prop))
17473
17473
  target[prop] = source[prop];
17474
17474
  }
17475
17475
  return target;
@@ -17477,9 +17477,9 @@ var __objRest$2 = (source, exclude) => {
17477
17477
  class WmsAdapter extends BaseAdapter {
17478
17478
  addLayer(options) {
17479
17479
  Object.assign(this.options, options);
17480
- const _a = options, { url } = _a, opt = __objRest$2(_a, ["url"]);
17480
+ const _a = options, { url } = _a, opt = __objRest$3(_a, ["url"]);
17481
17481
  if (url) {
17482
- const layerOptions = __spreadValues$s({
17482
+ const layerOptions = __spreadValues$u({
17483
17483
  pane: this.pane,
17484
17484
  attribution: opt.attribution,
17485
17485
  minZoom: opt.minZoom,
@@ -17490,7 +17490,7 @@ class WmsAdapter extends BaseAdapter {
17490
17490
  }, options.nativeOptions);
17491
17491
  let layer;
17492
17492
  if (opt.headers) {
17493
- layer = new WmsLayer(url, __spreadProps$f(__spreadValues$s({}, layerOptions), { headers: opt.headers }));
17493
+ layer = new WmsLayer(url, __spreadProps$f(__spreadValues$u({}, layerOptions), { headers: opt.headers }));
17494
17494
  } else {
17495
17495
  layer = new leafletSrcExports.TileLayer.WMS(url, layerOptions);
17496
17496
  }
@@ -17507,33 +17507,33 @@ function arrayToBoundsExpression(bounds) {
17507
17507
  ];
17508
17508
  }
17509
17509
 
17510
- var __defProp$L = Object.defineProperty;
17511
- var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
17512
- var __hasOwnProp$s = Object.prototype.hasOwnProperty;
17513
- var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
17514
- var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17515
- var __spreadValues$r = (a, b) => {
17510
+ var __defProp$I = Object.defineProperty;
17511
+ var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
17512
+ var __hasOwnProp$u = Object.prototype.hasOwnProperty;
17513
+ var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
17514
+ var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17515
+ var __spreadValues$t = (a, b) => {
17516
17516
  for (var prop in b || (b = {}))
17517
- if (__hasOwnProp$s.call(b, prop))
17518
- __defNormalProp$L(a, prop, b[prop]);
17519
- if (__getOwnPropSymbols$s)
17520
- for (var prop of __getOwnPropSymbols$s(b)) {
17521
- if (__propIsEnum$s.call(b, prop))
17522
- __defNormalProp$L(a, prop, b[prop]);
17517
+ if (__hasOwnProp$u.call(b, prop))
17518
+ __defNormalProp$I(a, prop, b[prop]);
17519
+ if (__getOwnPropSymbols$u)
17520
+ for (var prop of __getOwnPropSymbols$u(b)) {
17521
+ if (__propIsEnum$u.call(b, prop))
17522
+ __defNormalProp$I(a, prop, b[prop]);
17523
17523
  }
17524
17524
  return a;
17525
17525
  };
17526
- var __publicField$A = (obj, key, value) => __defNormalProp$L(obj, typeof key !== "symbol" ? key + "" : key, value);
17526
+ var __publicField$w = (obj, key, value) => __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
17527
17527
  const _LeafletMapAdapter = class _LeafletMapAdapter {
17528
17528
  constructor() {
17529
- __publicField$A(this, "options", { target: "map" });
17530
- __publicField$A(this, "layerAdapters", _LeafletMapAdapter.layerAdapters);
17531
- __publicField$A(this, "controlAdapters", _LeafletMapAdapter.controlAdapters);
17532
- __publicField$A(this, "emitter", new EventEmitter());
17533
- __publicField$A(this, "map");
17534
- __publicField$A(this, "_resizeObserver");
17535
- __publicField$A(this, "_unselectCb", []);
17536
- __publicField$A(this, "_universalEvents", [
17529
+ __publicField$w(this, "options", { target: "map" });
17530
+ __publicField$w(this, "layerAdapters", _LeafletMapAdapter.layerAdapters);
17531
+ __publicField$w(this, "controlAdapters", _LeafletMapAdapter.controlAdapters);
17532
+ __publicField$w(this, "emitter", new EventEmitter());
17533
+ __publicField$w(this, "map");
17534
+ __publicField$w(this, "_resizeObserver");
17535
+ __publicField$w(this, "_unselectCb", []);
17536
+ __publicField$w(this, "_universalEvents", [
17537
17537
  "move",
17538
17538
  "zoom",
17539
17539
  "zoomend",
@@ -17541,14 +17541,14 @@ const _LeafletMapAdapter = class _LeafletMapAdapter {
17541
17541
  "moveend",
17542
17542
  "movestart"
17543
17543
  ]);
17544
- __publicField$A(this, "_positionEvents", [
17544
+ __publicField$w(this, "_positionEvents", [
17545
17545
  "mousemove",
17546
17546
  "mouseout",
17547
17547
  "mouseover"
17548
17548
  ]);
17549
17549
  }
17550
17550
  create(options) {
17551
- this.options = __spreadValues$r({}, options);
17551
+ this.options = __spreadValues$t({}, options);
17552
17552
  if (this.options.target) {
17553
17553
  const {
17554
17554
  zoom,
@@ -17558,7 +17558,7 @@ const _LeafletMapAdapter = class _LeafletMapAdapter {
17558
17558
  maxBounds: mb,
17559
17559
  mapAdapterOptions
17560
17560
  } = this.options;
17561
- this.map = this.options.map || new leafletSrcExports.Map(this.options.target, __spreadValues$r({
17561
+ this.map = this.options.map || new leafletSrcExports.Map(this.options.target, __spreadValues$t({
17562
17562
  attributionControl: false,
17563
17563
  zoomControl: false,
17564
17564
  maxBounds: mb ? arrayToBoundsExpression(mb) : void 0,
@@ -17841,7 +17841,7 @@ const _LeafletMapAdapter = class _LeafletMapAdapter {
17841
17841
  }
17842
17842
  }
17843
17843
  };
17844
- __publicField$A(_LeafletMapAdapter, "layerAdapters", {
17844
+ __publicField$w(_LeafletMapAdapter, "layerAdapters", {
17845
17845
  GEOJSON: GeoJsonAdapter,
17846
17846
  IMAGE: ImageAdapter,
17847
17847
  TILE: TileAdapter,
@@ -17849,315 +17849,13 @@ __publicField$A(_LeafletMapAdapter, "layerAdapters", {
17849
17849
  // // MVT: MvtAdapter,
17850
17850
  OSM: OsmAdapter
17851
17851
  });
17852
- __publicField$A(_LeafletMapAdapter, "controlAdapters", {
17852
+ __publicField$w(_LeafletMapAdapter, "controlAdapters", {
17853
17853
  ZOOM: leafletSrcExports.Control.Zoom,
17854
17854
  ATTRIBUTION: AttributionControl
17855
17855
  });
17856
- __publicField$A(_LeafletMapAdapter, "Map", leafletSrcExports.Map);
17856
+ __publicField$w(_LeafletMapAdapter, "Map", leafletSrcExports.Map);
17857
17857
  let LeafletMapAdapter = _LeafletMapAdapter;
17858
17858
 
17859
- var __defProp$K = Object.defineProperty;
17860
- var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17861
- var __publicField$z = (obj, key, value) => __defNormalProp$K(obj, typeof key !== "symbol" ? key + "" : key, value);
17862
- class CancelError extends Error {
17863
- constructor() {
17864
- super();
17865
- __publicField$z(this, "name", "CancelError");
17866
- Object.setPrototypeOf(this, CancelError.prototype);
17867
- }
17868
- }
17869
-
17870
- var __defProp$J = Object.defineProperty;
17871
- var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17872
- var __publicField$y = (obj, key, value) => __defNormalProp$J(obj, typeof key !== "symbol" ? key + "" : key, value);
17873
- class PromiseControl {
17874
- constructor(options = {}) {
17875
- this.options = options;
17876
- __publicField$y(this, "_promises", /* @__PURE__ */ new Map());
17877
- }
17878
- get isLoaded() {
17879
- return this._promises.size > 0;
17880
- }
17881
- remove(promise) {
17882
- if (this._promises.has(promise)) {
17883
- this._promises.delete(promise);
17884
- this._onStop();
17885
- }
17886
- }
17887
- get(promise) {
17888
- return this._promises.get(promise);
17889
- }
17890
- add(promise, name) {
17891
- const key = name ? name : promise;
17892
- const exist = this._promises.get(key);
17893
- if (this.options.onStart && !this.isLoaded) {
17894
- this.options.onStart();
17895
- }
17896
- if (exist) {
17897
- return exist;
17898
- }
17899
- this._promises.set(key, promise);
17900
- promise.finally(() => {
17901
- this.remove(key);
17902
- });
17903
- return promise;
17904
- }
17905
- abort() {
17906
- if (this.isLoaded) {
17907
- this._promises.forEach((x) => {
17908
- if (x.cancel) {
17909
- x.cancel();
17910
- }
17911
- });
17912
- this._promises.clear();
17913
- this._onStop();
17914
- }
17915
- }
17916
- waitFunc(func, name = "") {
17917
- name = name || func.name;
17918
- const exist = this.get(name);
17919
- if (exist) {
17920
- return exist;
17921
- }
17922
- return this.add(func(), name);
17923
- }
17924
- WaitForMe(name = "") {
17925
- const get = this.get.bind(this);
17926
- const add = this.add.bind(this);
17927
- return function(target, key, descriptor) {
17928
- const originalMethod = descriptor.value;
17929
- name = name || key;
17930
- descriptor.value = function(...args) {
17931
- const exist = get(name);
17932
- if (exist) {
17933
- return exist;
17934
- }
17935
- const result = add(originalMethod.apply(this, args), name);
17936
- return result;
17937
- };
17938
- return descriptor;
17939
- };
17940
- }
17941
- /** @deprecated use {@link PromiseControl.WaitForMe } instead */
17942
- GetOrCreateDecorator(name = "") {
17943
- return this.WaitForMe(name);
17944
- }
17945
- _onStop() {
17946
- if (this.options.onStop && !this.isLoaded) {
17947
- this.options.onStop();
17948
- }
17949
- }
17950
- }
17951
-
17952
- var __defProp$I = Object.defineProperty;
17953
- var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17954
- var __publicField$x = (obj, key, value) => __defNormalProp$I(obj, typeof key !== "symbol" ? key + "" : key, value);
17955
- class TimeoutError extends Error {
17956
- constructor() {
17957
- super();
17958
- __publicField$x(this, "name", "TimeoutError");
17959
- Object.setPrototypeOf(this, TimeoutError.prototype);
17960
- }
17961
- }
17962
-
17963
- var __defProp$H = Object.defineProperty;
17964
- var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17965
- var __publicField$w = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
17966
- var _a;
17967
- const handleCallback = (resolve, reject, callback, r) => {
17968
- try {
17969
- resolve(callback(r));
17970
- } catch (e) {
17971
- reject(e);
17972
- }
17973
- };
17974
- let ID$3 = 0;
17975
- _a = Symbol.toStringTag;
17976
- const _CancelablePromise = class _CancelablePromise {
17977
- constructor(executor, timeout) {
17978
- // @ts-ignore
17979
- __publicField$w(this, _a);
17980
- __publicField$w(this, "id", ID$3++);
17981
- __publicField$w(this, "_isCanceled", false);
17982
- __publicField$w(this, "_isPending", true);
17983
- __publicField$w(this, "_promise");
17984
- __publicField$w(this, "_cancelPromise");
17985
- __publicField$w(this, "_cancelHandlers", []);
17986
- __publicField$w(this, "_setCanceledCallback");
17987
- __publicField$w(this, "_parentPromise");
17988
- __publicField$w(this, "_children", []);
17989
- this._cancelPromise = new Promise((resolve_, reject_) => {
17990
- this._setCanceledCallback = (er) => resolve_(er || new CancelError());
17991
- });
17992
- const promises = [
17993
- this._cancelPromise,
17994
- new Promise((resolve, reject) => {
17995
- const onResolve = (value) => {
17996
- if (value instanceof _CancelablePromise) {
17997
- this.attach(value);
17998
- } else {
17999
- this._isPending = false;
18000
- }
18001
- resolve(value);
18002
- };
18003
- const onReject = (error) => {
18004
- this._isPending = false;
18005
- reject(error);
18006
- };
18007
- const onCancel = (handler) => {
18008
- if (!this._isPending) {
18009
- throw new Error(
18010
- "The `onCancel` handler was attached after the promise settled."
18011
- );
18012
- }
18013
- this._cancelHandlers.push(handler);
18014
- };
18015
- return executor(onResolve, onReject, onCancel);
18016
- })
18017
- ];
18018
- if (timeout) {
18019
- promises.push(
18020
- new Promise((resolve, reject) => {
18021
- setTimeout(() => {
18022
- if (this._isPending) {
18023
- try {
18024
- this.cancel();
18025
- } finally {
18026
- reject(new TimeoutError());
18027
- }
18028
- }
18029
- }, timeout);
18030
- })
18031
- );
18032
- }
18033
- this._promise = Promise.race(promises);
18034
- }
18035
- static createControl(opt) {
18036
- return new PromiseControl(opt);
18037
- }
18038
- static resolve(value) {
18039
- return new _CancelablePromise((resolve) => resolve(value));
18040
- }
18041
- static reject(value) {
18042
- return new _CancelablePromise((resolve, reject) => reject(value));
18043
- }
18044
- static all(values) {
18045
- return new _CancelablePromise((resolve, reject) => {
18046
- Promise.all(values).then(resolve).catch(reject);
18047
- }).catch((er) => {
18048
- if (er instanceof this.CancelError) {
18049
- for (const v of values) {
18050
- const v_ = v;
18051
- if ("cancel" in v_) {
18052
- v_.cancel();
18053
- }
18054
- }
18055
- }
18056
- throw er;
18057
- });
18058
- }
18059
- attach(p) {
18060
- if (this._isCanceled) {
18061
- p.cancel();
18062
- } else {
18063
- this._children.push(p);
18064
- }
18065
- }
18066
- then(onfulfilled, onrejected) {
18067
- const p = new _CancelablePromise((resolve, reject) => {
18068
- if (this._promise) {
18069
- const reject_ = (r) => {
18070
- if (onrejected) {
18071
- handleCallback(resolve, reject, onrejected, r);
18072
- } else {
18073
- reject(r);
18074
- }
18075
- };
18076
- this._promise.then((r) => {
18077
- if (this._isCanceled) {
18078
- reject_(r);
18079
- } else {
18080
- if (onfulfilled) {
18081
- handleCallback(resolve, reject, onfulfilled, r);
18082
- } else {
18083
- resolve(r);
18084
- }
18085
- }
18086
- }, reject_);
18087
- }
18088
- });
18089
- p._parentPromise = this;
18090
- this._children.push(p);
18091
- return p;
18092
- }
18093
- catch(onrejected) {
18094
- if (this._isCanceled && onrejected) {
18095
- onrejected(new CancelError());
18096
- }
18097
- return this.then(void 0, onrejected);
18098
- }
18099
- finally(onfinally) {
18100
- if (this._promise) {
18101
- return this._promise.finally(onfinally);
18102
- }
18103
- if (this._isCanceled) {
18104
- return Promise.reject(new CancelError());
18105
- }
18106
- return Promise.reject(onfinally);
18107
- }
18108
- cancel() {
18109
- if (this._isCanceled || !this._isPending) {
18110
- return this;
18111
- }
18112
- this._isCanceled = true;
18113
- const parent = this._getTopParent();
18114
- if (parent) {
18115
- parent.cancel();
18116
- }
18117
- if (this._children) {
18118
- this._children.forEach((x) => x.cancel());
18119
- }
18120
- if (this._isPending) {
18121
- if (this._cancelHandlers.length) {
18122
- try {
18123
- for (const handler of this._cancelHandlers) {
18124
- handler();
18125
- }
18126
- } catch (error) {
18127
- }
18128
- }
18129
- if (this._setCanceledCallback) {
18130
- this._setCanceledCallback();
18131
- }
18132
- }
18133
- this._destroy();
18134
- return this;
18135
- }
18136
- _getTopParent() {
18137
- let parent = this._parentPromise;
18138
- let hasParent = !!parent;
18139
- while (hasParent) {
18140
- if (parent && parent._parentPromise) {
18141
- parent = parent._parentPromise;
18142
- hasParent = !!parent;
18143
- } else {
18144
- hasParent = false;
18145
- }
18146
- }
18147
- return parent;
18148
- }
18149
- _destroy() {
18150
- this._setCanceledCallback = void 0;
18151
- this._cancelPromise = void 0;
18152
- this._promise = void 0;
18153
- }
18154
- };
18155
- __publicField$w(_CancelablePromise, "CancelError", CancelError);
18156
- __publicField$w(_CancelablePromise, "TimeoutError", TimeoutError);
18157
- __publicField$w(_CancelablePromise, "PromiseControl", PromiseControl);
18158
- let CancelablePromise = _CancelablePromise;
18159
- Object.setPrototypeOf(CancelablePromise.prototype, Promise.prototype);
18160
-
18161
17859
  const svgPath = {
18162
17860
  brill: '<path d="m6 0-5 6 5 6 5-6z"/>',
18163
17861
  circle: '<circle cx="6" cy="6" r="6"/>',
@@ -18230,9 +17928,9 @@ function getIcon(opt = {}) {
18230
17928
  };
18231
17929
  }
18232
17930
 
18233
- var __defProp$G = Object.defineProperty;
18234
- var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18235
- var __publicField$v = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
17931
+ var __defProp$H = Object.defineProperty;
17932
+ var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17933
+ var __publicField$v = (obj, key, value) => __defNormalProp$H(obj, typeof key !== "symbol" ? key + "" : key, value);
18236
17934
  const _Cache = class _Cache {
18237
17935
  constructor(options = {}) {
18238
17936
  __publicField$v(this, "cache", []);
@@ -18268,8 +17966,7 @@ const _Cache = class _Cache {
18268
17966
  * // somewhere else in the code
18269
17967
  * const item = await cache.addFull('foo', getItemFunc).then((resp) => {
18270
17968
  * console.log(resp); // 'New item'
18271
- * })
18272
- *
17969
+ * });
18273
17970
  * ```
18274
17971
  */
18275
17972
  addFull(key, valueToSet, props) {
@@ -18284,13 +17981,11 @@ const _Cache = class _Cache {
18284
17981
  } else {
18285
17982
  value = valueToSet;
18286
17983
  }
18287
- const props_ = props && JSON.parse(JSON.stringify(objectRemoveEmpty(props)));
17984
+ const nonEmptyProps = props && JSON.parse(JSON.stringify(objectRemoveEmpty(props)));
18288
17985
  const cacheItem = {
18289
17986
  key,
18290
17987
  value,
18291
- props: props_,
18292
- // TODO: remove backward compatibility use only props
18293
- options: props_
17988
+ props: nonEmptyProps
18294
17989
  };
18295
17990
  if (onlyFull && !full(value)) {
18296
17991
  return value;
@@ -18299,7 +17994,6 @@ const _Cache = class _Cache {
18299
17994
  if (value instanceof Promise) {
18300
17995
  value.catch((er) => {
18301
17996
  this.delete(key, props);
18302
- throw er;
18303
17997
  });
18304
17998
  if (onlyFull) {
18305
17999
  value.then((x) => {
@@ -18318,9 +18012,7 @@ const _Cache = class _Cache {
18318
18012
  }
18319
18013
  match(key, props) {
18320
18014
  const cacheRecord = this._find(key, props);
18321
- if (cacheRecord) {
18322
- return cacheRecord.value;
18323
- }
18015
+ return cacheRecord == null ? void 0 : cacheRecord.value;
18324
18016
  }
18325
18017
  matchAll(key, props) {
18326
18018
  if (key) {
@@ -18329,37 +18021,30 @@ const _Cache = class _Cache {
18329
18021
  return this.cache.map((x) => x.value);
18330
18022
  }
18331
18023
  delete(keyOrItem, props) {
18332
- let exist = [];
18333
- if (typeof keyOrItem === "string") {
18334
- exist = this.cache.filter((x) => this._filter(x, keyOrItem, props));
18335
- } else {
18336
- exist.push(keyOrItem);
18337
- }
18338
- for (const e of exist) {
18339
- const index = this.cache.indexOf(e);
18340
- this.cache.splice(index, 1);
18024
+ const itemsToDelete = typeof keyOrItem === "string" ? this.cache.filter((x) => this._filter(x, keyOrItem, props)) : [keyOrItem];
18025
+ for (const item of itemsToDelete) {
18026
+ const index = this.cache.indexOf(item);
18027
+ if (index !== -1) {
18028
+ this.cache.splice(index, 1);
18029
+ }
18341
18030
  }
18342
18031
  }
18343
18032
  _find(key, props) {
18344
18033
  return this.cache.find((x) => this._filter(x, key, props));
18345
18034
  }
18346
18035
  _filter(item, key, props) {
18347
- if (item.key === key) {
18348
- if (props) {
18349
- const itemProps = item.props || item.options;
18350
- return objectDeepEqual(itemProps || {}, objectRemoveEmpty(props));
18351
- }
18352
- return true;
18353
- }
18354
- return false;
18036
+ if (item.key !== key) return false;
18037
+ if (!props) return true;
18038
+ const itemProps = item.props;
18039
+ return objectDeepEqual(itemProps || {}, objectRemoveEmpty(props));
18355
18040
  }
18356
18041
  };
18357
18042
  __publicField$v(_Cache, "instance", {});
18358
18043
  let Cache = _Cache;
18359
18044
 
18360
- var __defProp$F = Object.defineProperty;
18361
- var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18362
- var __publicField$u = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
18045
+ var __defProp$G = Object.defineProperty;
18046
+ var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18047
+ var __publicField$u = (obj, key, value) => __defNormalProp$G(obj, typeof key !== "symbol" ? key + "" : key, value);
18363
18048
  class NgwError extends Error {
18364
18049
  constructor(er) {
18365
18050
  super();
@@ -18376,9 +18061,9 @@ class NgwError extends Error {
18376
18061
  }
18377
18062
  }
18378
18063
 
18379
- var __defProp$E = Object.defineProperty;
18380
- var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18381
- var __publicField$t = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
18064
+ var __defProp$F = Object.defineProperty;
18065
+ var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18066
+ var __publicField$t = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
18382
18067
  class ResourceNotFoundError extends NgwError {
18383
18068
  constructor(obj) {
18384
18069
  super(obj);
@@ -18417,27 +18102,24 @@ function resourceToQuery(resource, prefix = "") {
18417
18102
  return query;
18418
18103
  }
18419
18104
 
18420
- var __defProp$D = Object.defineProperty;
18421
- var __defProps$e = Object.defineProperties;
18422
- var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
18423
- var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
18424
- var __hasOwnProp$r = Object.prototype.hasOwnProperty;
18425
- var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
18426
- var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18427
- var __spreadValues$q = (a, b) => {
18105
+ var __defProp$E = Object.defineProperty;
18106
+ var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
18107
+ var __hasOwnProp$t = Object.prototype.hasOwnProperty;
18108
+ var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
18109
+ var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18110
+ var __spreadValues$s = (a, b) => {
18428
18111
  for (var prop in b || (b = {}))
18429
- if (__hasOwnProp$r.call(b, prop))
18430
- __defNormalProp$D(a, prop, b[prop]);
18431
- if (__getOwnPropSymbols$r)
18432
- for (var prop of __getOwnPropSymbols$r(b)) {
18433
- if (__propIsEnum$r.call(b, prop))
18434
- __defNormalProp$D(a, prop, b[prop]);
18112
+ if (__hasOwnProp$t.call(b, prop))
18113
+ __defNormalProp$E(a, prop, b[prop]);
18114
+ if (__getOwnPropSymbols$t)
18115
+ for (var prop of __getOwnPropSymbols$t(b)) {
18116
+ if (__propIsEnum$t.call(b, prop))
18117
+ __defNormalProp$E(a, prop, b[prop]);
18435
18118
  }
18436
18119
  return a;
18437
18120
  };
18438
- var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
18439
- var __publicField$s = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
18440
- var __async$k = (__this, __arguments, generator) => {
18121
+ var __publicField$s = (obj, key, value) => __defNormalProp$E(obj, typeof key !== "symbol" ? key + "" : key, value);
18122
+ var __async$r = (__this, __arguments, generator) => {
18441
18123
  return new Promise((resolve, reject) => {
18442
18124
  var fulfilled = (value) => {
18443
18125
  try {
@@ -18478,39 +18160,27 @@ class ResourcesControl {
18478
18160
  * Fetching resource would be cached to speed up next call
18479
18161
  */
18480
18162
  getOne(resource, requestOptions) {
18481
- const cache = this.cache;
18482
- const forCache = {};
18483
- const opt = __spreadProps$e(__spreadValues$q({}, requestOptions), { cache: false });
18484
- if (typeof resource === "string") {
18485
- forCache.keyname = resource;
18486
- } else if (typeof resource === "number") {
18487
- forCache.id = resource;
18488
- } else if (isObject(resource)) {
18163
+ const opt = __spreadValues$s({}, requestOptions);
18164
+ if (typeof resource === "string") ; else if (typeof resource === "number") ; else if (isObject(resource)) {
18489
18165
  if (resource.id !== void 0) {
18490
- forCache.id = resource.id;
18166
+ resource.id;
18491
18167
  } else {
18492
18168
  if (resource.keyname) {
18493
- forCache.keyname = resource.keyname;
18169
+ resource.keyname;
18494
18170
  }
18495
18171
  if (resource.display_name) {
18496
- forCache.display_name = resource.display_name;
18172
+ resource.display_name;
18497
18173
  }
18498
18174
  }
18499
18175
  }
18500
- const makeRequest = () => {
18501
- if (typeof resource === "string") {
18502
- return this._fetchResourceBy({ keyname: resource }, opt);
18503
- } else if (typeof resource === "number") {
18504
- return this._fetchResourceById(resource, opt);
18505
- } else if (isObject(resource)) {
18506
- return this._fetchResourceBy(resource, opt);
18507
- }
18508
- return CancelablePromise.resolve(void 0);
18509
- };
18510
- if (requestOptions == null ? void 0 : requestOptions.cache) {
18511
- return cache.addFull("resource", makeRequest, forCache);
18176
+ if (typeof resource === "string") {
18177
+ return this._fetchResourceBy({ keyname: resource }, opt);
18178
+ } else if (typeof resource === "number") {
18179
+ return this._fetchResourceById(resource, opt);
18180
+ } else if (isObject(resource)) {
18181
+ return this._fetchResourceBy(resource, opt);
18512
18182
  }
18513
- return makeRequest();
18183
+ return Promise.resolve(void 0);
18514
18184
  }
18515
18185
  getOneOrFail(resource, requestOptions) {
18516
18186
  return this.getOne(resource, requestOptions).then((res) => {
@@ -18532,7 +18202,7 @@ class ResourcesControl {
18532
18202
  */
18533
18203
  getId(resource, requestOptions) {
18534
18204
  if (typeof resource === "number") {
18535
- return CancelablePromise.resolve(resource);
18205
+ return Promise.resolve(resource);
18536
18206
  } else if (typeof resource === "string" || isObject(resource)) {
18537
18207
  return this.getOne(resource, requestOptions).then((res) => {
18538
18208
  if (res) {
@@ -18540,7 +18210,7 @@ class ResourcesControl {
18540
18210
  }
18541
18211
  });
18542
18212
  }
18543
- return CancelablePromise.resolve(void 0);
18213
+ return Promise.resolve(void 0);
18544
18214
  }
18545
18215
  /**
18546
18216
  * A fast way to retrieve resource ID for any resource definition.
@@ -18567,12 +18237,12 @@ class ResourcesControl {
18567
18237
  } else {
18568
18238
  Object.assign(query, resourceToQuery(resource));
18569
18239
  }
18570
- return this.connector.get("resource.search", requestOptions, __spreadValues$q({
18240
+ return this.connector.get("resource.search", requestOptions, __spreadValues$s({
18571
18241
  serialization: "full"
18572
18242
  }, query)).then((resources) => {
18573
- if (resources) {
18243
+ if ((requestOptions == null ? void 0 : requestOptions.cache) && resources) {
18574
18244
  for (const x of resources) {
18575
- this.cache.add("resource.item", CancelablePromise.resolve(x), {
18245
+ this.cache.add("resource.item", Promise.resolve(x), {
18576
18246
  id: x.resource.id
18577
18247
  });
18578
18248
  }
@@ -18588,7 +18258,7 @@ class ResourcesControl {
18588
18258
  if (child) {
18589
18259
  return this.getOne(child.resource.parent.id, requestOptions);
18590
18260
  }
18591
- return CancelablePromise.resolve(void 0);
18261
+ return Promise.resolve(void 0);
18592
18262
  });
18593
18263
  }
18594
18264
  getChildrenOf(resource, requestOptions) {
@@ -18618,18 +18288,16 @@ class ResourcesControl {
18618
18288
  });
18619
18289
  }
18620
18290
  _getChildrenOf(parent, requestOptions, _items = []) {
18621
- return this.connector.get(
18622
- "resource.collection",
18623
- __spreadValues$q({ cache: true }, requestOptions),
18624
- {
18625
- parent
18626
- }
18627
- ).then((items) => {
18291
+ return this.connector.get("resource.collection", requestOptions, {
18292
+ parent
18293
+ }).then((items) => {
18628
18294
  const recursivePromises = [];
18629
18295
  for (const item of items) {
18630
- this.cache.add("resource.item", CancelablePromise.resolve(item), {
18631
- id: item.resource.id
18632
- });
18296
+ if (requestOptions == null ? void 0 : requestOptions.cache) {
18297
+ this.cache.add("resource.item", Promise.resolve(item), {
18298
+ id: item.resource.id
18299
+ });
18300
+ }
18633
18301
  _items.push(item);
18634
18302
  if ((requestOptions == null ? void 0 : requestOptions.recursive) && item.resource.children) {
18635
18303
  recursivePromises.push(
@@ -18638,7 +18306,7 @@ class ResourcesControl {
18638
18306
  }
18639
18307
  }
18640
18308
  if (recursivePromises.length) {
18641
- return CancelablePromise.all(recursivePromises).then(() => {
18309
+ return Promise.all(recursivePromises).then(() => {
18642
18310
  return _items;
18643
18311
  });
18644
18312
  }
@@ -18646,11 +18314,12 @@ class ResourcesControl {
18646
18314
  });
18647
18315
  }
18648
18316
  _cleanResourceItemCache(id) {
18649
- return __async$k(this, null, function* () {
18317
+ return __async$r(this, null, function* () {
18318
+ var _a;
18650
18319
  const all = this.cache.all();
18651
18320
  const toDelete = [];
18652
18321
  for (const c of all) {
18653
- const cid = c.options && c.options.id;
18322
+ const cid = (_a = c.props) == null ? void 0 : _a.id;
18654
18323
  if (["resource.item", "resource"].includes(c.key) && cid !== void 0) {
18655
18324
  if (typeof cid === "number") {
18656
18325
  if (cid === id) {
@@ -18670,18 +18339,7 @@ class ResourcesControl {
18670
18339
  });
18671
18340
  }
18672
18341
  _fetchResourceById(id, requestOptions) {
18673
- const promise = () => this.connector.get("resource.item", requestOptions, { id });
18674
- if (requestOptions == null ? void 0 : requestOptions.cache) {
18675
- return this.cache.add("resource.item", promise, {
18676
- id
18677
- }).catch((er) => {
18678
- if (!(er instanceof ResourceNotFoundError)) {
18679
- throw er;
18680
- }
18681
- return void 0;
18682
- });
18683
- }
18684
- return promise();
18342
+ return this.connector.get("resource.item", requestOptions, { id });
18685
18343
  }
18686
18344
  _fetchResourceBy(resource, requestOptions) {
18687
18345
  return this.getMany(resource, requestOptions).then((resources) => {
@@ -18689,7 +18347,7 @@ class ResourcesControl {
18689
18347
  });
18690
18348
  }
18691
18349
  _resourceCacheFilter(resource) {
18692
- return CancelablePromise.all(this.cache.matchAll("resource.item")).then(
18350
+ return Promise.all(this.cache.matchAll("resource.item")).then(
18693
18351
  (resources) => {
18694
18352
  const items = [];
18695
18353
  resources.filter((x) => {
@@ -18733,9 +18391,16 @@ function removeConnector(connector) {
18733
18391
  }
18734
18392
  }
18735
18393
 
18736
- var __defProp$C = Object.defineProperty;
18737
- var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18738
- var __publicField$r = (obj, key, value) => __defNormalProp$C(obj, typeof key !== "symbol" ? key + "" : key, value);
18394
+ class AbortError extends Error {
18395
+ constructor(message = "AbortError") {
18396
+ super(message);
18397
+ this.name = "AbortError";
18398
+ }
18399
+ }
18400
+
18401
+ var __defProp$D = Object.defineProperty;
18402
+ var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18403
+ var __publicField$r = (obj, key, value) => __defNormalProp$D(obj, typeof key !== "symbol" ? key + "" : key, value);
18739
18404
  class InsufficientPermissionsError extends NgwError {
18740
18405
  constructor(obj) {
18741
18406
  super(obj);
@@ -18758,64 +18423,96 @@ function template(str, data) {
18758
18423
  });
18759
18424
  }
18760
18425
 
18426
+ var __defProp$C = Object.defineProperty;
18427
+ var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
18428
+ var __hasOwnProp$s = Object.prototype.hasOwnProperty;
18429
+ var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
18430
+ var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18431
+ var __spreadValues$r = (a, b) => {
18432
+ for (var prop in b || (b = {}))
18433
+ if (__hasOwnProp$s.call(b, prop))
18434
+ __defNormalProp$C(a, prop, b[prop]);
18435
+ if (__getOwnPropSymbols$s)
18436
+ for (var prop of __getOwnPropSymbols$s(b)) {
18437
+ if (__propIsEnum$s.call(b, prop))
18438
+ __defNormalProp$C(a, prop, b[prop]);
18439
+ }
18440
+ return a;
18441
+ };
18442
+ var __async$q = (__this, __arguments, generator) => {
18443
+ return new Promise((resolve, reject) => {
18444
+ var fulfilled = (value) => {
18445
+ try {
18446
+ step(generator.next(value));
18447
+ } catch (e) {
18448
+ reject(e);
18449
+ }
18450
+ };
18451
+ var rejected = (value) => {
18452
+ try {
18453
+ step(generator.throw(value));
18454
+ } catch (e) {
18455
+ reject(e);
18456
+ }
18457
+ };
18458
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18459
+ step((generator = generator.apply(__this, __arguments)).next());
18460
+ });
18461
+ };
18761
18462
  function apiRequest(opt) {
18762
- const params = opt.params;
18763
- return new CancelablePromise((resolve, reject) => {
18764
- return opt.connector.connect().then((apiItems) => {
18765
- let apiItem = apiItems && apiItems[opt.name];
18766
- if (apiItem) {
18767
- apiItem = [...apiItem];
18768
- let url = apiItem.shift();
18769
- if (apiItem.length) {
18770
- const replaceParams = {};
18771
- for (let fry = 0; fry < apiItem.length; fry++) {
18772
- const arg = apiItem[fry];
18773
- replaceParams[fry] = "{" + arg + "}";
18774
- if (params[arg] === void 0) {
18775
- throw new Error(
18776
- "`" + arg + "` url api argument is not specified"
18777
- );
18778
- }
18779
- }
18780
- if (url) {
18781
- url = template(url, replaceParams);
18463
+ return __async$q(this, null, function* () {
18464
+ const { params, name, connector, requestOptions } = opt;
18465
+ const apiItems = yield connector.connect();
18466
+ let apiItem = apiItems && apiItems[name];
18467
+ if (apiItem) {
18468
+ apiItem = [...apiItem];
18469
+ let url = apiItem.shift();
18470
+ if (apiItem.length) {
18471
+ const replaceParams = {};
18472
+ for (let fry = 0; fry < apiItem.length; fry++) {
18473
+ const arg = apiItem[fry];
18474
+ replaceParams[fry] = `{${arg}}`;
18475
+ if (params[arg] === void 0) {
18476
+ throw new Error(`\`${arg}\` URL API argument is not specified`);
18782
18477
  }
18783
18478
  }
18784
- if (params) {
18785
- const paramArray = [];
18786
- const paramList = params.paramList;
18787
- if (Array.isArray(paramList)) {
18788
- delete params.paramList;
18789
- paramList.forEach((x) => {
18790
- paramArray.push(`${x[0]}=${x[1]}`);
18791
- });
18792
- }
18793
- for (const p in params) {
18794
- if (apiItem.indexOf(p) === -1) {
18795
- paramArray.push(`${p}=${params[p]}`);
18796
- }
18797
- }
18798
- if (paramArray.length) {
18799
- url = url + "?" + paramArray.join("&");
18479
+ if (url) {
18480
+ url = template(url, replaceParams);
18481
+ }
18482
+ }
18483
+ if (params) {
18484
+ const paramArray = [];
18485
+ const paramList = params.paramList;
18486
+ if (Array.isArray(paramList)) {
18487
+ paramList.forEach(([key, value]) => {
18488
+ paramArray.push(`${key}=${value}`);
18489
+ });
18490
+ }
18491
+ for (const p in params) {
18492
+ if (apiItem.indexOf(p) === -1) {
18493
+ paramArray.push(`${p}=${params[p]}`);
18800
18494
  }
18801
18495
  }
18802
- if (url) {
18803
- resolve(opt.connector.makeQuery(url, params, opt.requestOptions));
18804
- } else {
18805
- reject(new Error("request url is not set"));
18496
+ if (paramArray.length) {
18497
+ url = `${url}?${paramArray.join("&")}`;
18806
18498
  }
18499
+ }
18500
+ if (url) {
18501
+ return connector.makeQuery(url, params, __spreadValues$r({
18502
+ cacheName: name
18503
+ }, requestOptions));
18807
18504
  } else {
18808
- resolve(void 0);
18505
+ throw new Error("Request URL is not set");
18809
18506
  }
18810
- }).catch((er) => {
18811
- reject(er);
18812
- });
18507
+ } else {
18508
+ return void 0;
18509
+ }
18813
18510
  });
18814
18511
  }
18815
18512
 
18816
18513
  var __defProp$B = Object.defineProperty;
18817
18514
  var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18818
- var __publicField$q = (obj, key, value) => __defNormalProp$B(obj, typeof key !== "symbol" ? key + "" : key, value);
18515
+ var __publicField$q = (obj, key, value) => __defNormalProp$B(obj, key + "" , value);
18819
18516
  class NetworkError extends Error {
18820
18517
  constructor(url) {
18821
18518
  super();
@@ -18909,23 +18606,59 @@ let loadData;
18909
18606
  }
18910
18607
 
18911
18608
  var __defProp$A = Object.defineProperty;
18912
- var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
18913
- var __hasOwnProp$q = Object.prototype.hasOwnProperty;
18914
- var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
18609
+ var __defProps$e = Object.defineProperties;
18610
+ var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
18611
+ var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
18612
+ var __hasOwnProp$r = Object.prototype.hasOwnProperty;
18613
+ var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
18915
18614
  var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18916
- var __spreadValues$p = (a, b) => {
18615
+ var __spreadValues$q = (a, b) => {
18917
18616
  for (var prop in b || (b = {}))
18918
- if (__hasOwnProp$q.call(b, prop))
18617
+ if (__hasOwnProp$r.call(b, prop))
18919
18618
  __defNormalProp$A(a, prop, b[prop]);
18920
- if (__getOwnPropSymbols$q)
18921
- for (var prop of __getOwnPropSymbols$q(b)) {
18922
- if (__propIsEnum$q.call(b, prop))
18619
+ if (__getOwnPropSymbols$r)
18620
+ for (var prop of __getOwnPropSymbols$r(b)) {
18621
+ if (__propIsEnum$r.call(b, prop))
18923
18622
  __defNormalProp$A(a, prop, b[prop]);
18924
18623
  }
18925
18624
  return a;
18926
18625
  };
18626
+ var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
18627
+ var __objRest$2 = (source, exclude) => {
18628
+ var target = {};
18629
+ for (var prop in source)
18630
+ if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
18631
+ target[prop] = source[prop];
18632
+ if (source != null && __getOwnPropSymbols$r)
18633
+ for (var prop of __getOwnPropSymbols$r(source)) {
18634
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
18635
+ target[prop] = source[prop];
18636
+ }
18637
+ return target;
18638
+ };
18927
18639
  var __publicField$p = (obj, key, value) => __defNormalProp$A(obj, typeof key !== "symbol" ? key + "" : key, value);
18640
+ var __async$p = (__this, __arguments, generator) => {
18641
+ return new Promise((resolve, reject) => {
18642
+ var fulfilled = (value) => {
18643
+ try {
18644
+ step(generator.next(value));
18645
+ } catch (e) {
18646
+ reject(e);
18647
+ }
18648
+ };
18649
+ var rejected = (value) => {
18650
+ try {
18651
+ step(generator.throw(value));
18652
+ } catch (e) {
18653
+ reject(e);
18654
+ }
18655
+ };
18656
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18657
+ step((generator = generator.apply(__this, __arguments)).next());
18658
+ });
18659
+ };
18928
18660
  let ID$2 = 0;
18661
+ let REQUEST_ID = 0;
18929
18662
  class NgwConnector {
18930
18663
  constructor(options) {
18931
18664
  this.options = options;
@@ -18935,7 +18668,7 @@ class NgwConnector {
18935
18668
  __publicField$p(this, "resources");
18936
18669
  __publicField$p(this, "cache");
18937
18670
  __publicField$p(this, "routeStr", "/api/component/pyramid/route");
18938
- __publicField$p(this, "activeRequests", []);
18671
+ __publicField$p(this, "activeRequests", {});
18939
18672
  __publicField$p(this, "requestTransform");
18940
18673
  const exist = findConnector(options);
18941
18674
  this.cache = new Cache({ namespace: options.cacheId });
@@ -18992,29 +18725,27 @@ class NgwConnector {
18992
18725
  * ```
18993
18726
  */
18994
18727
  connect() {
18995
- const auth = this.options.auth;
18996
- const makeConnect = () => new CancelablePromise((resolve, reject) => {
18997
- const makeQuery = () => {
18998
- return this.makeQuery(this.routeStr, {}, {}).then((route) => {
18999
- resolve(route);
19000
- }).catch((er) => {
19001
- reject(er);
19002
- });
19003
- };
18728
+ return __async$p(this, null, function* () {
18729
+ const auth = this.options.auth;
19004
18730
  if (auth) {
19005
18731
  const { login, password } = auth;
19006
18732
  if (login && password) {
19007
- return this._login({ login, password }).then(() => {
19008
- return makeQuery();
19009
- }).catch((er) => reject(er));
18733
+ yield this._login({ login, password });
19010
18734
  }
19011
18735
  }
19012
- return makeQuery();
19013
- });
19014
- return this.cache.add("route", makeConnect, {
19015
- id: this.id,
19016
- auth,
19017
- baseUrl: this.options.baseUrl
18736
+ return yield this.makeQuery(
18737
+ this.routeStr,
18738
+ {},
18739
+ {
18740
+ cacheName: "route",
18741
+ cache: true,
18742
+ cacheProps: {
18743
+ id: this.id,
18744
+ auth,
18745
+ baseUrl: this.options.baseUrl
18746
+ }
18747
+ }
18748
+ );
19018
18749
  });
19019
18750
  }
19020
18751
  /**
@@ -19038,20 +18769,22 @@ class NgwConnector {
19038
18769
  this.emitter.emit("logout");
19039
18770
  }
19040
18771
  getUserInfo(credentials, options) {
19041
- if (this.user && this.user.id) {
19042
- return CancelablePromise.resolve(this.user);
19043
- }
19044
- if (credentials) {
19045
- this.options.auth = credentials;
19046
- }
19047
- const options_ = __spreadValues$p({
19048
- headers: this.getAuthorizationHeaders(credentials)
19049
- }, options);
19050
- return this.makeQuery(
19051
- "/api/component/auth/current_user",
19052
- {},
19053
- options_
19054
- );
18772
+ return __async$p(this, null, function* () {
18773
+ if (this.user && this.user.id) {
18774
+ return this.user;
18775
+ }
18776
+ if (credentials) {
18777
+ this.options.auth = credentials;
18778
+ }
18779
+ const options_ = __spreadValues$q({
18780
+ headers: this.getAuthorizationHeaders(credentials)
18781
+ }, options);
18782
+ return this.makeQuery(
18783
+ "/api/component/auth/current_user",
18784
+ {},
18785
+ options_
18786
+ );
18787
+ });
19055
18788
  }
19056
18789
  /**
19057
18790
  * Obtaining the required Headers for authentication of requests in the NGW.
@@ -19060,7 +18793,7 @@ class NgwConnector {
19060
18793
  const client = this.makeClientId(credentials);
19061
18794
  if (client) {
19062
18795
  return {
19063
- Authorization: "Basic " + client
18796
+ Authorization: `Basic ${client}`
19064
18797
  };
19065
18798
  }
19066
18799
  }
@@ -19068,21 +18801,22 @@ class NgwConnector {
19068
18801
  credentials = credentials || this.options.auth;
19069
18802
  if (credentials) {
19070
18803
  const { login, password } = credentials;
19071
- const str = unescape(encodeURIComponent(`${login}:${password}`));
18804
+ const str = `${login}:${password}`;
18805
+ const encodedStr = encodeURIComponent(str);
19072
18806
  {
19073
- return window.btoa(str);
18807
+ return window.btoa(encodedStr);
19074
18808
  }
19075
18809
  }
19076
18810
  }
19077
18811
  /** Stop all api requests */
19078
18812
  abort() {
19079
- for (const req of this.activeRequests) {
19080
- req.cancel();
18813
+ for (const abortController of Object.values(this.activeRequests)) {
18814
+ abortController.abort();
19081
18815
  }
19082
- this.activeRequests = [];
18816
+ this.activeRequests = {};
19083
18817
  }
19084
18818
  getActiveApiRequests() {
19085
- return [...this.activeRequests];
18819
+ return __spreadValues$q({}, this.activeRequests);
19086
18820
  }
19087
18821
  /**
19088
18822
  * Send request to NGW api router.
@@ -19114,23 +18848,10 @@ class NgwConnector {
19114
18848
  * ```
19115
18849
  */
19116
18850
  apiRequest(name, params_ = {}, requestOptions = {}) {
19117
- var _a, _b;
19118
- const { method, headers, withCredentials, responseType } = requestOptions;
19119
- params_ = (_a = requestOptions.params) != null ? _a : params_;
19120
- const params = objectRemoveEmpty(params_);
19121
- const makeApiRequest = () => apiRequest({ name, params, requestOptions, connector: this });
19122
- if (requestOptions.cache && method === "GET") {
19123
- return this.cache.add(name, makeApiRequest, __spreadValues$p({
19124
- params
19125
- }, objectRemoveEmpty({
19126
- headers,
19127
- withCredentials,
19128
- responseType,
19129
- baseUrl: this.options.baseUrl,
19130
- userId: (_b = this.user) == null ? void 0 : _b.id
19131
- })));
19132
- }
19133
- return makeApiRequest();
18851
+ var _a;
18852
+ params_ = (_a = requestOptions.params) != null ? _a : params_;
18853
+ const params = objectRemoveEmpty(params_);
18854
+ return apiRequest({ name, params, requestOptions, connector: this });
19134
18855
  }
19135
18856
  /**
19136
18857
  * Shortcut method for send POST request to NGW.
@@ -19220,17 +18941,67 @@ class NgwConnector {
19220
18941
  * @param params - Query params
19221
18942
  * @param options - Request options
19222
18943
  */
19223
- makeQuery(url, params, options = {}) {
19224
- url = (this.options.baseUrl ? this.options.baseUrl : "") + url;
19225
- if (url) {
18944
+ makeQuery(_0, _1) {
18945
+ return __async$p(this, arguments, function* (url, params, options = {}) {
18946
+ var _b;
18947
+ url = (this.options.baseUrl ? this.options.baseUrl : "") + url;
18948
+ if (!url) {
18949
+ throw new Error("Empty `url` not allowed");
18950
+ }
19226
18951
  if (params) {
19227
- url = template(url, params);
18952
+ const _a = params, restParams = __objRest$2(_a, ["paramList"]);
18953
+ url = template(url, restParams);
19228
18954
  }
19229
18955
  url = encodeURI(fixUrlStr(url));
19230
- return this._loadData(url, options);
19231
- } else {
19232
- throw new Error("Empty `url` not allowed");
19233
- }
18956
+ const {
18957
+ cache,
18958
+ signal: externalSignal,
18959
+ method = "GET",
18960
+ headers,
18961
+ cacheName,
18962
+ cacheProps,
18963
+ responseType,
18964
+ withCredentials
18965
+ } = options;
18966
+ const internalAbortController = new AbortController();
18967
+ const internalSignal = internalAbortController.signal;
18968
+ if (externalSignal) {
18969
+ if (externalSignal.aborted) {
18970
+ throw new AbortError();
18971
+ }
18972
+ externalSignal.addEventListener("abort", () => {
18973
+ internalAbortController.abort();
18974
+ });
18975
+ }
18976
+ options.signal = internalSignal;
18977
+ const createPromise = () => __async$p(this, null, function* () {
18978
+ const id = REQUEST_ID++;
18979
+ this.activeRequests[id] = internalAbortController;
18980
+ try {
18981
+ return this._loadData(url, options);
18982
+ } finally {
18983
+ this._cleanActiveRequest(id);
18984
+ }
18985
+ });
18986
+ if (cache && method === "GET") {
18987
+ const cacheOptions = cacheProps ? cacheProps : __spreadProps$e(__spreadValues$q({}, objectRemoveEmpty({
18988
+ headers,
18989
+ withCredentials,
18990
+ responseType,
18991
+ baseUrl: this.options.baseUrl,
18992
+ userId: (_b = this.user) == null ? void 0 : _b.id
18993
+ })), {
18994
+ params
18995
+ });
18996
+ return this.cache.add(
18997
+ cacheName || url,
18998
+ createPromise,
18999
+ cacheOptions,
19000
+ false
19001
+ );
19002
+ }
19003
+ return createPromise();
19004
+ });
19234
19005
  }
19235
19006
  // -------------------------------------------------------------------------
19236
19007
  // Resource Methods
@@ -19312,26 +19083,29 @@ class NgwConnector {
19312
19083
  */
19313
19084
  _loadData(url, options) {
19314
19085
  options.responseType = options.responseType || "json";
19315
- if (options.signal && options.signal.aborted) {
19316
- return CancelablePromise.reject(new CancelablePromise.CancelError());
19317
- }
19318
- const request = new CancelablePromise((resolve, reject, onCancel) => {
19086
+ return new Promise((resolve, reject) => {
19087
+ var _a;
19319
19088
  if (this.user) {
19320
19089
  options = options || {};
19321
- options.headers = __spreadValues$p(__spreadValues$p({}, this.getAuthorizationHeaders()), options.headers);
19090
+ options.headers = __spreadValues$q(__spreadValues$q({}, this.getAuthorizationHeaders()), options.headers);
19322
19091
  }
19323
19092
  if (this.requestTransform) {
19324
19093
  const [transUrl, transOptions] = this.requestTransform(url, options);
19325
19094
  url = transUrl;
19326
19095
  options = transOptions;
19327
19096
  }
19328
- loadData(url, resolve, options, reject, onCancel);
19329
- }).then((resp) => {
19330
- this._cleanActiveRequests(request);
19331
- return resp;
19097
+ let runOnAbort = void 0;
19098
+ loadData(url, resolve, options, reject, (handler) => {
19099
+ runOnAbort = handler;
19100
+ });
19101
+ (_a = options.signal) == null ? void 0 : _a.addEventListener("abort", () => {
19102
+ if (runOnAbort !== void 0) {
19103
+ runOnAbort();
19104
+ }
19105
+ reject(new AbortError());
19106
+ });
19332
19107
  }).catch((httpError) => {
19333
- this._cleanActiveRequests(request);
19334
- if (httpError instanceof CancelablePromise.CancelError) ; else {
19108
+ if (httpError.name !== "AbortError") {
19335
19109
  {
19336
19110
  console.warn("DEV WARN", httpError);
19337
19111
  }
@@ -19340,31 +19114,24 @@ class NgwConnector {
19340
19114
  throw er;
19341
19115
  }
19342
19116
  }
19117
+ throw httpError;
19343
19118
  });
19344
- if (options.signal && typeof options.signal.addEventListener === "function") {
19345
- options.signal.addEventListener("abort", () => {
19346
- request.cancel();
19347
- this._cleanActiveRequests(request);
19348
- });
19349
- }
19350
- this.activeRequests.push(request);
19351
- return request;
19352
19119
  }
19353
19120
  _login(credentials, options) {
19354
- return this.getUserInfo(credentials, options).then((data) => {
19355
- this.user = data;
19356
- this.emitter.emit("login", data);
19357
- return data;
19358
- }).catch((er) => {
19359
- this.emitter.emit("login:error", er);
19360
- throw er;
19121
+ return __async$p(this, null, function* () {
19122
+ try {
19123
+ const data = yield this.getUserInfo(credentials, options);
19124
+ this.user = data;
19125
+ this.emitter.emit("login", data);
19126
+ return data;
19127
+ } catch (er) {
19128
+ this.emitter.emit("login:error", er);
19129
+ throw er;
19130
+ }
19361
19131
  });
19362
19132
  }
19363
- _cleanActiveRequests(request) {
19364
- const activeRequestIndex = this.activeRequests.indexOf(request);
19365
- if (activeRequestIndex !== -1) {
19366
- this.activeRequests.splice(activeRequestIndex, 1);
19367
- }
19133
+ _cleanActiveRequest(requestId) {
19134
+ delete this.activeRequests[requestId];
19368
19135
  }
19369
19136
  _handleHttpError(er) {
19370
19137
  if (er) {
@@ -19387,22 +19154,42 @@ __publicField$p(NgwConnector, "errors", {
19387
19154
  var __defProp$z = Object.defineProperty;
19388
19155
  var __defProps$d = Object.defineProperties;
19389
19156
  var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
19390
- var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
19391
- var __hasOwnProp$p = Object.prototype.hasOwnProperty;
19392
- var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
19157
+ var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
19158
+ var __hasOwnProp$q = Object.prototype.hasOwnProperty;
19159
+ var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
19393
19160
  var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19394
- var __spreadValues$o = (a, b) => {
19161
+ var __spreadValues$p = (a, b) => {
19395
19162
  for (var prop in b || (b = {}))
19396
- if (__hasOwnProp$p.call(b, prop))
19163
+ if (__hasOwnProp$q.call(b, prop))
19397
19164
  __defNormalProp$z(a, prop, b[prop]);
19398
- if (__getOwnPropSymbols$p)
19399
- for (var prop of __getOwnPropSymbols$p(b)) {
19400
- if (__propIsEnum$p.call(b, prop))
19165
+ if (__getOwnPropSymbols$q)
19166
+ for (var prop of __getOwnPropSymbols$q(b)) {
19167
+ if (__propIsEnum$q.call(b, prop))
19401
19168
  __defNormalProp$z(a, prop, b[prop]);
19402
19169
  }
19403
19170
  return a;
19404
19171
  };
19405
19172
  var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
19173
+ var __async$o = (__this, __arguments, generator) => {
19174
+ return new Promise((resolve, reject) => {
19175
+ var fulfilled = (value) => {
19176
+ try {
19177
+ step(generator.next(value));
19178
+ } catch (e) {
19179
+ reject(e);
19180
+ }
19181
+ };
19182
+ var rejected = (value) => {
19183
+ try {
19184
+ step(generator.throw(value));
19185
+ } catch (e) {
19186
+ reject(e);
19187
+ }
19188
+ };
19189
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
19190
+ step((generator = generator.apply(__this, __arguments)).next());
19191
+ });
19192
+ };
19406
19193
  const FEATURE_REQUEST_PARAMS = {
19407
19194
  srs: 4326,
19408
19195
  geom_format: "geojson"
@@ -19443,10 +19230,9 @@ function updateItemRequestParam(params, options) {
19443
19230
  }
19444
19231
  }
19445
19232
  function createFeatureFieldFilterQueries(opt) {
19446
- const queries = getQueries(
19447
- opt
19448
- );
19449
- return CancelablePromise.all(queries).then((itemsParts) => {
19233
+ return __async$o(this, null, function* () {
19234
+ const queries = getQueries(opt);
19235
+ const itemsParts = yield Promise.all(queries);
19450
19236
  const ids = [];
19451
19237
  const items = [];
19452
19238
  for (const part of itemsParts) {
@@ -19488,13 +19274,13 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
19488
19274
  for (const f of filters_) {
19489
19275
  if (isPropertyFilter(f)) {
19490
19276
  _queries.push(
19491
- fetchNgwLayerItemsRequest(__spreadProps$d(__spreadValues$o({}, opt), {
19277
+ fetchNgwLayerItemsRequest(__spreadProps$d(__spreadValues$p({}, opt), {
19492
19278
  paramList: [..._parentAllParams, ...paramList, createParam(f)]
19493
19279
  }))
19494
19280
  );
19495
19281
  } else {
19496
19282
  getQueries(
19497
- __spreadProps$d(__spreadValues$o({}, opt), {
19283
+ __spreadProps$d(__spreadValues$p({}, opt), {
19498
19284
  filters: f
19499
19285
  }),
19500
19286
  _queries,
@@ -19515,7 +19301,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
19515
19301
  if (propertiesFilterList.length) {
19516
19302
  for (const x of propertiesFilterList) {
19517
19303
  getQueries(
19518
- __spreadProps$d(__spreadValues$o({}, opt), {
19304
+ __spreadProps$d(__spreadValues$p({}, opt), {
19519
19305
  filters: x
19520
19306
  }),
19521
19307
  _queries,
@@ -19524,7 +19310,7 @@ function getQueries(opt, _queries = [], _parentAllParams = []) {
19524
19310
  }
19525
19311
  } else {
19526
19312
  _queries.push(
19527
- fetchNgwLayerItemsRequest(__spreadProps$d(__spreadValues$o({}, opt), {
19313
+ fetchNgwLayerItemsRequest(__spreadProps$d(__spreadValues$p({}, opt), {
19528
19314
  paramList: [..._parentAllParams, ...paramList, ...filters2]
19529
19315
  }))
19530
19316
  );
@@ -19540,7 +19326,7 @@ function createWktFromCoordArray(coord) {
19540
19326
  return `POLYGON((${polygon.join(", ")}))`;
19541
19327
  }
19542
19328
  function fetchNgwLayerItemsRequest(options) {
19543
- const params = __spreadValues$o({}, FEATURE_REQUEST_PARAMS);
19329
+ const params = __spreadValues$p({}, FEATURE_REQUEST_PARAMS);
19544
19330
  const {
19545
19331
  limit,
19546
19332
  cache,
@@ -19579,7 +19365,7 @@ function fetchNgwLayerItemsRequest(options) {
19579
19365
  if (paramList) {
19580
19366
  params.paramList = paramList;
19581
19367
  }
19582
- const reqParams = __spreadValues$o({
19368
+ const reqParams = __spreadValues$p({
19583
19369
  id: resourceId
19584
19370
  }, params);
19585
19371
  return connector.get(
@@ -19592,52 +19378,90 @@ function fetchNgwLayerItemsRequest(options) {
19592
19378
  var __defProp$y = Object.defineProperty;
19593
19379
  var __defProps$c = Object.defineProperties;
19594
19380
  var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
19595
- var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
19596
- var __hasOwnProp$o = Object.prototype.hasOwnProperty;
19597
- var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
19381
+ var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
19382
+ var __hasOwnProp$p = Object.prototype.hasOwnProperty;
19383
+ var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
19598
19384
  var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19599
- var __spreadValues$n = (a, b) => {
19385
+ var __spreadValues$o = (a, b) => {
19600
19386
  for (var prop in b || (b = {}))
19601
- if (__hasOwnProp$o.call(b, prop))
19387
+ if (__hasOwnProp$p.call(b, prop))
19602
19388
  __defNormalProp$y(a, prop, b[prop]);
19603
- if (__getOwnPropSymbols$o)
19604
- for (var prop of __getOwnPropSymbols$o(b)) {
19605
- if (__propIsEnum$o.call(b, prop))
19389
+ if (__getOwnPropSymbols$p)
19390
+ for (var prop of __getOwnPropSymbols$p(b)) {
19391
+ if (__propIsEnum$p.call(b, prop))
19606
19392
  __defNormalProp$y(a, prop, b[prop]);
19607
19393
  }
19608
19394
  return a;
19609
19395
  };
19610
19396
  var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
19397
+ var __async$n = (__this, __arguments, generator) => {
19398
+ return new Promise((resolve, reject) => {
19399
+ var fulfilled = (value) => {
19400
+ try {
19401
+ step(generator.next(value));
19402
+ } catch (e) {
19403
+ reject(e);
19404
+ }
19405
+ };
19406
+ var rejected = (value) => {
19407
+ try {
19408
+ step(generator.throw(value));
19409
+ } catch (e) {
19410
+ reject(e);
19411
+ }
19412
+ };
19413
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
19414
+ step((generator = generator.apply(__this, __arguments)).next());
19415
+ });
19416
+ };
19611
19417
  function fetchNgwLayerItem(options) {
19612
- const params = __spreadValues$n({}, FEATURE_REQUEST_PARAMS);
19613
- updateItemRequestParam(params, options);
19614
- const queryParams = __spreadValues$n({
19615
- id: options.resourceId,
19616
- fid: options.featureId
19617
- }, params);
19618
- const cache = options.cache || true;
19619
- return options.connector.get("feature_layer.feature.item", { cache }, queryParams).then((resp) => {
19620
- return __spreadProps$c(__spreadValues$n({}, resp), {
19621
- toGeojson: () => {
19622
- if (resp.geom) {
19623
- return CancelablePromise.resolve(createGeoJsonFeature(resp));
19624
- } else {
19625
- return fetchNgwLayerItem(__spreadProps$c(__spreadValues$n({}, options), {
19626
- geom: true,
19627
- fields: null,
19628
- extensions: null
19629
- })).then((onlyGeomItem) => {
19630
- const geom = onlyGeomItem.geom;
19631
- return createGeoJsonFeature(__spreadProps$c(__spreadValues$n({}, resp), { geom }));
19632
- });
19633
- }
19418
+ return __async$n(this, null, function* () {
19419
+ const params = __spreadValues$o({}, FEATURE_REQUEST_PARAMS);
19420
+ updateItemRequestParam(params, options);
19421
+ const queryParams = __spreadValues$o({
19422
+ id: options.resourceId,
19423
+ fid: options.featureId
19424
+ }, params);
19425
+ const resp = yield options.connector.get(
19426
+ "feature_layer.feature.item",
19427
+ options,
19428
+ queryParams
19429
+ );
19430
+ const toGeojson = () => __async$n(this, null, function* () {
19431
+ if (resp.geom) {
19432
+ return createGeoJsonFeature(resp);
19433
+ } else {
19434
+ const onlyGeomItem = yield fetchNgwLayerItem(__spreadProps$c(__spreadValues$o({}, options), {
19435
+ geom: true,
19436
+ fields: null,
19437
+ extensions: null
19438
+ }));
19439
+ const geom = onlyGeomItem.geom;
19440
+ return createGeoJsonFeature(__spreadProps$c(__spreadValues$o({}, resp), { geom }));
19634
19441
  }
19635
19442
  });
19443
+ return __spreadProps$c(__spreadValues$o({}, resp), {
19444
+ toGeojson
19445
+ });
19636
19446
  });
19637
19447
  }
19638
19448
 
19639
19449
  var __defProp$x = Object.defineProperty;
19450
+ var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
19451
+ var __hasOwnProp$o = Object.prototype.hasOwnProperty;
19452
+ var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
19640
19453
  var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19454
+ var __spreadValues$n = (a, b) => {
19455
+ for (var prop in b || (b = {}))
19456
+ if (__hasOwnProp$o.call(b, prop))
19457
+ __defNormalProp$x(a, prop, b[prop]);
19458
+ if (__getOwnPropSymbols$o)
19459
+ for (var prop of __getOwnPropSymbols$o(b)) {
19460
+ if (__propIsEnum$o.call(b, prop))
19461
+ __defNormalProp$x(a, prop, b[prop]);
19462
+ }
19463
+ return a;
19464
+ };
19641
19465
  var __publicField$o = (obj, key, value) => __defNormalProp$x(obj, typeof key !== "symbol" ? key + "" : key, value);
19642
19466
  class BookmarkItem {
19643
19467
  constructor(options) {
@@ -19655,11 +19479,11 @@ class BookmarkItem {
19655
19479
  this.name = String(item.id);
19656
19480
  }
19657
19481
  }
19658
- extent() {
19482
+ extent(opt) {
19659
19483
  if (this._extent) {
19660
- return CancelablePromise.resolve(this._extent);
19484
+ return Promise.resolve(this._extent);
19661
19485
  }
19662
- return this.options.connector.get("feature_layer.feature.item_extent", null, {
19486
+ return this.options.connector.get("feature_layer.feature.item_extent", opt, {
19663
19487
  id: this.resourceId,
19664
19488
  fid: this.item.id
19665
19489
  }).then((resp) => {
@@ -19669,18 +19493,18 @@ class BookmarkItem {
19669
19493
  return lonLat;
19670
19494
  });
19671
19495
  }
19672
- geoJson() {
19496
+ geoJson(opt) {
19673
19497
  if (this.item.geom) {
19674
- return CancelablePromise.resolve(createGeoJsonFeature(this.item));
19498
+ return Promise.resolve(createGeoJsonFeature(this.item));
19675
19499
  } else {
19676
- return fetchNgwLayerItem({
19500
+ return fetchNgwLayerItem(__spreadValues$n({
19677
19501
  resourceId: this.resourceId,
19678
19502
  featureId: this.item.id,
19679
19503
  connector: this.options.connector,
19680
19504
  geom: true,
19681
19505
  fields: null,
19682
19506
  extensions: null
19683
- }).then((onlyGeomItem) => {
19507
+ }, opt)).then((onlyGeomItem) => {
19684
19508
  const geom = onlyGeomItem.geom;
19685
19509
  this.item.geom = geom;
19686
19510
  return createGeoJsonFeature(this.item);
@@ -19690,22 +19514,20 @@ class BookmarkItem {
19690
19514
  }
19691
19515
 
19692
19516
  function treeEvery(item, filter, relation, itemPrepare) {
19693
- return !!treeWrapper(item, filter, relation, treeEvery_, itemPrepare);
19517
+ return !!treeWrapper(item, filter, relation, treeEvery_);
19694
19518
  }
19695
19519
  function treeSome(item, filter, relation, itemPrepare) {
19696
- return !!treeWrapper(item, filter, relation, treeFind_, itemPrepare);
19520
+ return !!treeWrapper(item, filter, relation, treeFind_);
19697
19521
  }
19698
19522
  function treeFind(item, filter, relation, itemPrepare) {
19699
- return treeWrapper(item, filter, relation, treeFind_, itemPrepare);
19523
+ return treeWrapper(item, filter, relation, treeFind_);
19700
19524
  }
19701
19525
  function treeFilter(item, filter, relation, itemPrepare) {
19702
19526
  return treeWrapper(
19703
19527
  item,
19704
19528
  filter,
19705
19529
  relation,
19706
- treeFilter_,
19707
- itemPrepare
19708
- );
19530
+ treeFilter_);
19709
19531
  }
19710
19532
  function getChildren(item, relation = "children") {
19711
19533
  let children = [];
@@ -19722,13 +19544,6 @@ function getChildren(item, relation = "children") {
19722
19544
  }
19723
19545
  function treeWrapper(item, filter = (x) => !!x, relation = "children", treeFunction, itemPrepare) {
19724
19546
  const filterFunction = typeof filter === "function" ? filter : (i) => propertiesFilter(i, filter);
19725
- if (itemPrepare) {
19726
- return treeFunction(
19727
- item,
19728
- (i) => filterFunction(itemPrepare(i)),
19729
- relation
19730
- );
19731
- }
19732
19547
  return treeFunction(item, filterFunction, relation);
19733
19548
  }
19734
19549
  function treeFind_(item, filterFunc = (x) => !!x, relation, _filtered = []) {
@@ -19995,7 +19810,7 @@ var __spreadValues$m = (a, b) => {
19995
19810
  }
19996
19811
  return a;
19997
19812
  };
19998
- var __publicField$l = (obj, key, value) => __defNormalProp$u(obj, typeof key !== "symbol" ? key + "" : key, value);
19813
+ var __publicField$l = (obj, key, value) => __defNormalProp$u(obj, key + "" , value);
19999
19814
  const _CheckProperty = class _CheckProperty extends BaseProperty {
20000
19815
  constructor(name, item, options) {
20001
19816
  super(name, item, __spreadValues$m(__spreadValues$m({}, _CheckProperty.options), options));
@@ -20319,9 +20134,10 @@ function getNgwWebmapExtent(webmap) {
20319
20134
  function fetchNgwLayerExtent({
20320
20135
  resourceId,
20321
20136
  connector,
20322
- cache = true
20137
+ cache = true,
20138
+ signal
20323
20139
  }) {
20324
- return connector.get("layer.extent", { cache }, { id: resourceId }).then((resp) => {
20140
+ return connector.get("layer.extent", { cache, signal }, { id: resourceId }).then((resp) => {
20325
20141
  if (resp) {
20326
20142
  const { maxLat, maxLon, minLat, minLon } = resp.extent;
20327
20143
  const extentArray = [minLon, minLat, maxLon, maxLat];
@@ -20333,11 +20149,12 @@ function fetchNgwLayerItemExtent({
20333
20149
  resourceId,
20334
20150
  featureId,
20335
20151
  connector,
20336
- cache = true
20152
+ cache = true,
20153
+ signal
20337
20154
  }) {
20338
20155
  return connector.get(
20339
20156
  "feature_layer.feature.item_extent",
20340
- { cache },
20157
+ { cache, signal },
20341
20158
  { id: resourceId, fid: featureId }
20342
20159
  ).then((resp) => {
20343
20160
  if (resp) {
@@ -20348,7 +20165,10 @@ function fetchNgwLayerItemExtent({
20348
20165
  });
20349
20166
  }
20350
20167
  function fetchNgwExtent(options) {
20351
- return options.connector.getResource(options.resourceId).then((resource) => {
20168
+ return options.connector.getResource(options.resourceId, {
20169
+ signal: options.signal,
20170
+ cache: options.cache
20171
+ }).then((resource) => {
20352
20172
  if (resource) {
20353
20173
  return fetchNgwResourceExtent(resource, options.connector, options);
20354
20174
  }
@@ -20356,11 +20176,11 @@ function fetchNgwExtent(options) {
20356
20176
  }
20357
20177
  function fetchNgwResourceExtent(item, connector, options) {
20358
20178
  if (item.webmap) {
20359
- return CancelablePromise.resolve(getNgwWebmapExtent(item.webmap));
20179
+ return Promise.resolve(getNgwWebmapExtent(item.webmap));
20360
20180
  } else {
20361
20181
  const resource = item.resource;
20362
20182
  if (resource.cls && resource.cls.indexOf("style") !== -1) {
20363
- return connector.getResource(resource.parent.id).then((res) => {
20183
+ return connector.getResource(resource.parent.id, options).then((res) => {
20364
20184
  if (res) {
20365
20185
  return fetchNgwLayerExtent(__spreadProps$b(__spreadValues$j({}, options), {
20366
20186
  resourceId: res.resource.id,
@@ -20380,7 +20200,7 @@ function fetchNgwResourceExtent(item, connector, options) {
20380
20200
  var __defProp$q = Object.defineProperty;
20381
20201
  var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20382
20202
  var __publicField$i = (obj, key, value) => __defNormalProp$q(obj, typeof key !== "symbol" ? key + "" : key, value);
20383
- var __async$j = (__this, __arguments, generator) => {
20203
+ var __async$m = (__this, __arguments, generator) => {
20384
20204
  return new Promise((resolve, reject) => {
20385
20205
  var fulfilled = (value) => {
20386
20206
  try {
@@ -20408,12 +20228,12 @@ class NgwResource {
20408
20228
  }
20409
20229
  /** @deprecated use {@link NgwResource.getBounds} instead */
20410
20230
  getExtent() {
20411
- return __async$j(this, null, function* () {
20231
+ return __async$m(this, null, function* () {
20412
20232
  return this.getBounds();
20413
20233
  });
20414
20234
  }
20415
20235
  getBounds(options) {
20416
- return __async$j(this, null, function* () {
20236
+ return __async$m(this, null, function* () {
20417
20237
  if (this._extent) {
20418
20238
  return this._extent;
20419
20239
  }
@@ -20429,7 +20249,7 @@ class NgwResource {
20429
20249
  }
20430
20250
  }
20431
20251
 
20432
- var __async$i = (__this, __arguments, generator) => {
20252
+ var __async$l = (__this, __arguments, generator) => {
20433
20253
  return new Promise((resolve, reject) => {
20434
20254
  var fulfilled = (value) => {
20435
20255
  try {
@@ -20450,7 +20270,7 @@ var __async$i = (__this, __arguments, generator) => {
20450
20270
  });
20451
20271
  };
20452
20272
  function resourceIdFromLayerOptions(options, connector) {
20453
- return __async$i(this, null, function* () {
20273
+ return __async$l(this, null, function* () {
20454
20274
  const resource = options.resource;
20455
20275
  const item = resource;
20456
20276
  let { keyname, resourceId } = options;
@@ -20552,7 +20372,7 @@ var __objRest$1 = (source, exclude) => {
20552
20372
  return target;
20553
20373
  };
20554
20374
  var __publicField$h = (obj, key, value) => __defNormalProp$p(obj, typeof key !== "symbol" ? key + "" : key, value);
20555
- var __async$h = (__this, __arguments, generator) => {
20375
+ var __async$k = (__this, __arguments, generator) => {
20556
20376
  return new Promise((resolve, reject) => {
20557
20377
  var fulfilled = (value) => {
20558
20378
  try {
@@ -20604,7 +20424,7 @@ function createQmsAdapter(webMapOrOptions, url = URL, createOpt = {}) {
20604
20424
  }
20605
20425
  }
20606
20426
  addLayer(options) {
20607
- return __async$h(this, null, function* () {
20427
+ return __async$k(this, null, function* () {
20608
20428
  if (!this.qms && options.qmsId) {
20609
20429
  try {
20610
20430
  this.qms = yield loadJson(
@@ -20712,7 +20532,7 @@ var __spreadValues$g = (a, b) => {
20712
20532
  };
20713
20533
  var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
20714
20534
  var __superGet$2 = (cls, obj, key) => __reflectGet$2(__getProtoOf$2(cls), key, obj);
20715
- var __async$g = (__this, __arguments, generator) => {
20535
+ var __async$j = (__this, __arguments, generator) => {
20716
20536
  return new Promise((resolve, reject) => {
20717
20537
  var fulfilled = (value) => {
20718
20538
  try {
@@ -20733,7 +20553,7 @@ var __async$g = (__this, __arguments, generator) => {
20733
20553
  });
20734
20554
  };
20735
20555
  function createBasemapLayerAdapter(_0) {
20736
- return __async$g(this, arguments, function* ({
20556
+ return __async$j(this, arguments, function* ({
20737
20557
  webMap,
20738
20558
  item
20739
20559
  }) {
@@ -20754,7 +20574,7 @@ function createBasemapLayerAdapter(_0) {
20754
20574
  if (TileAdapter) {
20755
20575
  class BasemapTileAdapter extends TileAdapter {
20756
20576
  addLayer(opt) {
20757
- return __async$g(this, null, function* () {
20577
+ return __async$j(this, null, function* () {
20758
20578
  return __superGet$2(BasemapTileAdapter.prototype, this, "addLayer").call(this, __spreadProps$a(__spreadValues$g({}, opt), { url }));
20759
20579
  });
20760
20580
  }
@@ -20794,11 +20614,12 @@ function createPopupContent(feature, item) {
20794
20614
  function fetchNgwLayerCount({
20795
20615
  connector,
20796
20616
  resourceId,
20797
- cache = true
20617
+ cache = true,
20618
+ signal
20798
20619
  }) {
20799
20620
  return connector.get(
20800
20621
  "feature_layer.feature.count",
20801
- { cache },
20622
+ { cache, signal },
20802
20623
  {
20803
20624
  id: resourceId
20804
20625
  }
@@ -20852,13 +20673,34 @@ var __spreadValues$f = (a, b) => {
20852
20673
  return a;
20853
20674
  };
20854
20675
  var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
20676
+ var __async$i = (__this, __arguments, generator) => {
20677
+ return new Promise((resolve, reject) => {
20678
+ var fulfilled = (value) => {
20679
+ try {
20680
+ step(generator.next(value));
20681
+ } catch (e) {
20682
+ reject(e);
20683
+ }
20684
+ };
20685
+ var rejected = (value) => {
20686
+ try {
20687
+ step(generator.throw(value));
20688
+ } catch (e) {
20689
+ reject(e);
20690
+ }
20691
+ };
20692
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
20693
+ step((generator = generator.apply(__this, __arguments)).next());
20694
+ });
20695
+ };
20855
20696
  function fetchNgwLayerItems(options) {
20856
- const filters = options.filters;
20857
- if (filters) {
20858
- return createFeatureFieldFilterQueries(__spreadProps$9(__spreadValues$f({}, options), {
20859
- filters
20860
- })).then((data) => {
20861
- var _a;
20697
+ return __async$i(this, null, function* () {
20698
+ var _a;
20699
+ const filters = options.filters;
20700
+ if (filters) {
20701
+ let data = yield createFeatureFieldFilterQueries(__spreadProps$9(__spreadValues$f({}, options), {
20702
+ filters
20703
+ }));
20862
20704
  const clientFilterValidate = (_a = options.clientFilterValidate) != null ? _a : isFilterWithAnyCase(filters);
20863
20705
  if (clientFilterValidate) {
20864
20706
  data = data.filter((y) => {
@@ -20870,10 +20712,10 @@ function fetchNgwLayerItems(options) {
20870
20712
  });
20871
20713
  }
20872
20714
  return data;
20873
- });
20874
- } else {
20875
- return fetchNgwLayerItemsRequest(options);
20876
- }
20715
+ } else {
20716
+ return fetchNgwLayerItemsRequest(options);
20717
+ }
20718
+ });
20877
20719
  }
20878
20720
  function isFilterWithAnyCase(filters) {
20879
20721
  if (filters[0] === "any") {
@@ -20891,8 +20733,29 @@ function isFilterWithAnyCase(filters) {
20891
20733
  return false;
20892
20734
  }
20893
20735
 
20736
+ var __async$h = (__this, __arguments, generator) => {
20737
+ return new Promise((resolve, reject) => {
20738
+ var fulfilled = (value) => {
20739
+ try {
20740
+ step(generator.next(value));
20741
+ } catch (e) {
20742
+ reject(e);
20743
+ }
20744
+ };
20745
+ var rejected = (value) => {
20746
+ try {
20747
+ step(generator.throw(value));
20748
+ } catch (e) {
20749
+ reject(e);
20750
+ }
20751
+ };
20752
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
20753
+ step((generator = generator.apply(__this, __arguments)).next());
20754
+ });
20755
+ };
20894
20756
  function fetchNgwLayerFeatures(options) {
20895
- return fetchNgwLayerItems(options).then((x) => {
20757
+ return __async$h(this, null, function* () {
20758
+ const x = yield fetchNgwLayerItems(options);
20896
20759
  const features = [];
20897
20760
  x.forEach((y) => {
20898
20761
  features.push(createGeoJsonFeature(y));
@@ -20952,7 +20815,7 @@ var __spreadValues$e = (a, b) => {
20952
20815
  var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
20953
20816
  var __publicField$f = (obj, key, value) => __defNormalProp$l(obj, typeof key !== "symbol" ? key + "" : key, value);
20954
20817
  var __superGet$1 = (cls, obj, key) => __reflectGet$1(__getProtoOf$1(cls), key, obj);
20955
- var __async$f = (__this, __arguments, generator) => {
20818
+ var __async$g = (__this, __arguments, generator) => {
20956
20819
  return new Promise((resolve, reject) => {
20957
20820
  var fulfilled = (value) => {
20958
20821
  try {
@@ -20973,7 +20836,7 @@ var __async$f = (__this, __arguments, generator) => {
20973
20836
  });
20974
20837
  };
20975
20838
  function createGeoJsonAdapter(props) {
20976
- return __async$f(this, null, function* () {
20839
+ return __async$g(this, null, function* () {
20977
20840
  var _a, _b;
20978
20841
  const {
20979
20842
  item,
@@ -20989,29 +20852,35 @@ function createGeoJsonAdapter(props) {
20989
20852
  const _loadedIds = [];
20990
20853
  let _fullDataLoad = false;
20991
20854
  let _lastFilterArgs;
20992
- let _dataPromise;
20855
+ let internalAbortController;
20993
20856
  const resourceId = yield resourceIdFromLayerOptions(options, connector);
20994
20857
  if ((_b = (_a = options.adapterOptions) == null ? void 0 : _a.popupOptions) == null ? void 0 : _b.fromProperties) {
20995
20858
  options.adapterOptions.popupOptions.createPopupContent = ({ feature }) => {
20996
20859
  return feature && createPopupContent(feature, item);
20997
20860
  };
20998
20861
  }
20999
- const getData = (filters, filterOpt) => __async$f(this, null, function* () {
20862
+ const getData = (filters, filterOpt) => __async$g(this, null, function* () {
21000
20863
  abort();
20864
+ internalAbortController = new AbortController();
20865
+ const internalSignal = internalAbortController.signal;
20866
+ if (filterOpt == null ? void 0 : filterOpt.signal) {
20867
+ filterOpt.signal.addEventListener("abort", internalAbortController.abort);
20868
+ }
20869
+ filterOpt = filterOpt || {};
20870
+ filterOpt.signal = internalSignal;
21001
20871
  _lastFilterArgs = { filters, options: filterOpt };
21002
- _dataPromise = fetchNgwLayerFeatureCollection(__spreadValues$e({
20872
+ return fetchNgwLayerFeatureCollection(__spreadValues$e({
21003
20873
  resourceId,
21004
20874
  filters,
21005
20875
  connector,
21006
20876
  cache: true
21007
20877
  }, filterOpt));
21008
- return yield _dataPromise;
21009
20878
  });
21010
20879
  let removed = false;
21011
20880
  const abort = () => {
21012
- if (_dataPromise) {
21013
- _dataPromise.cancel();
21014
- _dataPromise = void 0;
20881
+ if (internalAbortController) {
20882
+ internalAbortController.abort();
20883
+ internalAbortController = void 0;
21015
20884
  }
21016
20885
  };
21017
20886
  class NgwGeoJsonAdapter extends GeoJsonAdapter {
@@ -21024,7 +20893,7 @@ function createGeoJsonAdapter(props) {
21024
20893
  __publicField$f(this, "__disableMapMoveListener");
21025
20894
  }
21026
20895
  addLayer(opt) {
21027
- return __async$f(this, null, function* () {
20896
+ return __async$g(this, null, function* () {
21028
20897
  let needUpdate = !opt.data;
21029
20898
  const waitFullLoad = opt.waitFullLoad !== void 0 ? opt.waitFullLoad : true;
21030
20899
  if (options.id !== void 0) {
@@ -21069,7 +20938,7 @@ function createGeoJsonAdapter(props) {
21069
20938
  return this.getBounds();
21070
20939
  }
21071
20940
  getBounds() {
21072
- return __async$f(this, null, function* () {
20941
+ return __async$g(this, null, function* () {
21073
20942
  const hasData = this.getLayers && this.getLayers().length;
21074
20943
  const strategy = this.options.strategy;
21075
20944
  if ((strategy == null ? void 0 : strategy.startsWith("BBOX")) || hasData) {
@@ -21095,7 +20964,7 @@ function createGeoJsonAdapter(props) {
21095
20964
  return fetchNgwLayerCount({ connector, resourceId, cache: true });
21096
20965
  }
21097
20966
  updateLayer(filterArgs) {
21098
- return __async$f(this, null, function* () {
20967
+ return __async$g(this, null, function* () {
21099
20968
  var _a2;
21100
20969
  filterArgs = filterArgs || _lastFilterArgs || {};
21101
20970
  if ((_a2 = this.options.strategy) == null ? void 0 : _a2.startsWith("BBOX")) {
@@ -21161,7 +21030,7 @@ function createGeoJsonAdapter(props) {
21161
21030
  });
21162
21031
  }
21163
21032
  propertiesFilter(filters, opt) {
21164
- return __async$f(this, null, function* () {
21033
+ return __async$g(this, null, function* () {
21165
21034
  abort();
21166
21035
  if (this.filter && _fullDataLoad) {
21167
21036
  this.filter((e) => {
@@ -21235,7 +21104,7 @@ function createGeoJsonAdapter(props) {
21235
21104
  });
21236
21105
  }
21237
21106
 
21238
- var __async$e = (__this, __arguments, generator) => {
21107
+ var __async$f = (__this, __arguments, generator) => {
21239
21108
  return new Promise((resolve, reject) => {
21240
21109
  var fulfilled = (value) => {
21241
21110
  try {
@@ -21256,7 +21125,7 @@ var __async$e = (__this, __arguments, generator) => {
21256
21125
  });
21257
21126
  };
21258
21127
  function createWebMapAdapter(_0) {
21259
- return __async$e(this, arguments, function* ({
21128
+ return __async$f(this, arguments, function* ({
21260
21129
  layerOptions: options,
21261
21130
  webMap,
21262
21131
  connector
@@ -21384,7 +21253,7 @@ var __spreadValues$d = (a, b) => {
21384
21253
  };
21385
21254
  var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
21386
21255
  var __publicField$e = (obj, key, value) => __defNormalProp$k(obj, typeof key !== "symbol" ? key + "" : key, value);
21387
- var __async$d = (__this, __arguments, generator) => {
21256
+ var __async$e = (__this, __arguments, generator) => {
21388
21257
  return new Promise((resolve, reject) => {
21389
21258
  var fulfilled = (value) => {
21390
21259
  try {
@@ -21405,7 +21274,7 @@ var __async$d = (__this, __arguments, generator) => {
21405
21274
  });
21406
21275
  };
21407
21276
  function createRasterAdapter(_0) {
21408
- return __async$d(this, arguments, function* ({
21277
+ return __async$e(this, arguments, function* ({
21409
21278
  layerOptions,
21410
21279
  webMap,
21411
21280
  connector,
@@ -21461,7 +21330,7 @@ function createRasterAdapter(_0) {
21461
21330
  return super.addLayer(__spreadValues$d(__spreadValues$d({}, this.options), addOptions));
21462
21331
  }
21463
21332
  getLegend(options) {
21464
- return __async$d(this, null, function* () {
21333
+ return __async$e(this, null, function* () {
21465
21334
  const ngwLegend = yield connector.get("render.legend_symbols", __spreadValues$d({
21466
21335
  params: { id: resourceId },
21467
21336
  cache: true
@@ -21481,7 +21350,7 @@ function createRasterAdapter(_0) {
21481
21350
  });
21482
21351
  }
21483
21352
  getIdentificationIds() {
21484
- return __async$d(this, null, function* () {
21353
+ return __async$e(this, null, function* () {
21485
21354
  if (this.item) {
21486
21355
  if (adapter === "MVT") {
21487
21356
  return [this.item.resource.id];
@@ -21522,7 +21391,7 @@ var __spreadValues$c = (a, b) => {
21522
21391
  return a;
21523
21392
  };
21524
21393
  var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
21525
- var __async$c = (__this, __arguments, generator) => {
21394
+ var __async$d = (__this, __arguments, generator) => {
21526
21395
  return new Promise((resolve, reject) => {
21527
21396
  var fulfilled = (value) => {
21528
21397
  try {
@@ -21558,7 +21427,7 @@ const supportCls = [
21558
21427
  "tmsclient_layer"
21559
21428
  ];
21560
21429
  function createAdapterFromFirstStyle(_0) {
21561
- return __async$c(this, arguments, function* ({
21430
+ return __async$d(this, arguments, function* ({
21562
21431
  layerOptions,
21563
21432
  webMap,
21564
21433
  connector,
@@ -21577,7 +21446,7 @@ function createAdapterFromFirstStyle(_0) {
21577
21446
  });
21578
21447
  }
21579
21448
  function createAsyncAdapter(options, webMap, connector) {
21580
- return __async$c(this, null, function* () {
21449
+ return __async$d(this, null, function* () {
21581
21450
  let adapter;
21582
21451
  let item;
21583
21452
  const adapterType = options.adapter;
@@ -21774,7 +21643,7 @@ var __spreadValues$a = (a, b) => {
21774
21643
  return a;
21775
21644
  };
21776
21645
  var __publicField$d = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
21777
- var __async$b = (__this, __arguments, generator) => {
21646
+ var __async$c = (__this, __arguments, generator) => {
21778
21647
  return new Promise((resolve, reject) => {
21779
21648
  var fulfilled = (value) => {
21780
21649
  try {
@@ -21824,7 +21693,7 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
21824
21693
  }
21825
21694
  }
21826
21695
  static create(webMap, item, options, connector, parent) {
21827
- return __async$b(this, null, function* () {
21696
+ return __async$c(this, null, function* () {
21828
21697
  const ngwWebmapItem = new _NgwWebmapItem(
21829
21698
  webMap,
21830
21699
  item,
@@ -21853,15 +21722,14 @@ const _NgwWebmapItem = class _NgwWebmapItem extends Item {
21853
21722
  return this.layer;
21854
21723
  }
21855
21724
  getLegend(options) {
21856
- return __async$b(this, null, function* () {
21725
+ return __async$c(this, null, function* () {
21857
21726
  var _a;
21858
21727
  const id = (_a = this.layer) == null ? void 0 : _a.id;
21859
21728
  if (id !== void 0) {
21860
21729
  const connector = this.connector;
21861
21730
  if (connector) {
21862
21731
  const ngwLegend = yield connector.get("render.legend_symbols", __spreadValues$a({
21863
- params: { id: this.item.resourceId },
21864
- cache: true
21732
+ params: { id: this.item.resourceId }
21865
21733
  }, options));
21866
21734
  const legend = {
21867
21735
  layerId: id,
@@ -22052,7 +21920,7 @@ var __spreadValues$9 = (a, b) => {
22052
21920
  return a;
22053
21921
  };
22054
21922
  var __publicField$c = (obj, key, value) => __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
22055
- var __async$a = (__this, __arguments, generator) => {
21923
+ var __async$b = (__this, __arguments, generator) => {
22056
21924
  return new Promise((resolve, reject) => {
22057
21925
  var fulfilled = (value) => {
22058
21926
  try {
@@ -22073,7 +21941,7 @@ var __async$a = (__this, __arguments, generator) => {
22073
21941
  });
22074
21942
  };
22075
21943
  function createOnFirstShowAdapter(_0) {
22076
- return __async$a(this, arguments, function* ({
21944
+ return __async$b(this, arguments, function* ({
22077
21945
  webMap,
22078
21946
  adapterOptions = {},
22079
21947
  onLayerAdded,
@@ -22099,7 +21967,7 @@ function createOnFirstShowAdapter(_0) {
22099
21967
  return this._removed;
22100
21968
  }
22101
21969
  showLayer() {
22102
- return __async$a(this, null, function* () {
21970
+ return __async$b(this, null, function* () {
22103
21971
  this.options.visibility = true;
22104
21972
  if (this.layer.length) {
22105
21973
  for (const x of this.layer) {
@@ -22111,7 +21979,7 @@ function createOnFirstShowAdapter(_0) {
22111
21979
  });
22112
21980
  }
22113
21981
  hideLayer() {
22114
- return __async$a(this, null, function* () {
21982
+ return __async$b(this, null, function* () {
22115
21983
  this.options.visibility = false;
22116
21984
  if (this.layer) {
22117
21985
  for (const x of this.layer) {
@@ -22121,7 +21989,7 @@ function createOnFirstShowAdapter(_0) {
22121
21989
  });
22122
21990
  }
22123
21991
  loadLayer() {
22124
- return __async$a(this, null, function* () {
21992
+ return __async$b(this, null, function* () {
22125
21993
  if (!this.layer.length && !this._creatingInProgress) {
22126
21994
  this._creatingInProgress = true;
22127
21995
  const Adapter = yield createAdapter(this);
@@ -22155,7 +22023,7 @@ function createOnFirstShowAdapter(_0) {
22155
22023
  });
22156
22024
  }
22157
22025
 
22158
- var __async$9 = (__this, __arguments, generator) => {
22026
+ var __async$a = (__this, __arguments, generator) => {
22159
22027
  return new Promise((resolve, reject) => {
22160
22028
  var fulfilled = (value) => {
22161
22029
  try {
@@ -22176,7 +22044,7 @@ var __async$9 = (__this, __arguments, generator) => {
22176
22044
  });
22177
22045
  };
22178
22046
  function createOnFirstShowNgwAdapter(_0) {
22179
- return __async$9(this, arguments, function* ({
22047
+ return __async$a(this, arguments, function* ({
22180
22048
  webMap,
22181
22049
  connector,
22182
22050
  item,
@@ -22229,7 +22097,7 @@ var __spreadValues$8 = (a, b) => {
22229
22097
  return a;
22230
22098
  };
22231
22099
  var __publicField$b = (obj, key, value) => __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
22232
- var __async$8 = (__this, __arguments, generator) => {
22100
+ var __async$9 = (__this, __arguments, generator) => {
22233
22101
  return new Promise((resolve, reject) => {
22234
22102
  var fulfilled = (value) => {
22235
22103
  try {
@@ -22280,7 +22148,7 @@ class NgwWebmapLayerAdapter {
22280
22148
  }
22281
22149
  }
22282
22150
  addLayer(options) {
22283
- return __async$8(this, null, function* () {
22151
+ return __async$9(this, null, function* () {
22284
22152
  var _a, _b;
22285
22153
  this.options = __spreadValues$8(__spreadValues$8({}, this.options), options);
22286
22154
  this.layer = yield this._getWebMapLayerItem();
@@ -22313,21 +22181,21 @@ class NgwWebmapLayerAdapter {
22313
22181
  delete this._webmapLayersIds;
22314
22182
  }
22315
22183
  showLayer() {
22316
- return __async$8(this, null, function* () {
22184
+ return __async$9(this, null, function* () {
22317
22185
  if (this.layer && this.layer.properties) {
22318
22186
  return this.layer.properties.property("visibility").set(true);
22319
22187
  }
22320
22188
  });
22321
22189
  }
22322
22190
  hideLayer() {
22323
- return __async$8(this, null, function* () {
22191
+ return __async$9(this, null, function* () {
22324
22192
  if (this.layer && this.layer.properties) {
22325
22193
  return this.layer.properties.property("visibility").set(false);
22326
22194
  }
22327
22195
  });
22328
22196
  }
22329
22197
  setOpacity(val) {
22330
- return __async$8(this, null, function* () {
22198
+ return __async$9(this, null, function* () {
22331
22199
  if (this.layer && this.layer.properties) {
22332
22200
  return this.layer.properties.property("opacity").set(val);
22333
22201
  }
@@ -22352,22 +22220,22 @@ class NgwWebmapLayerAdapter {
22352
22220
  return webmap.bookmark_resource.id;
22353
22221
  }
22354
22222
  }
22355
- fetchBookmarks() {
22223
+ fetchBookmarks(options) {
22356
22224
  const bookmarkResId = this.getBookmarksResourceId();
22357
22225
  const connector = this.options.connector;
22358
22226
  if (bookmarkResId) {
22359
- return connector.getResourceOrFail(bookmarkResId).then((item) => {
22227
+ return connector.getResourceOrFail(bookmarkResId, options).then((item) => {
22360
22228
  var _a;
22361
22229
  const labelField = (_a = item.feature_layer) == null ? void 0 : _a.fields.find(
22362
22230
  (x) => x.label_field
22363
22231
  );
22364
22232
  const keyname = labelField && labelField.keyname;
22365
- return fetchNgwLayerItems({
22233
+ return fetchNgwLayerItems(__spreadValues$8({
22366
22234
  connector,
22367
22235
  resourceId: bookmarkResId,
22368
22236
  geom: false,
22369
22237
  fields: keyname ? [keyname] : void 0
22370
- }).then((items) => {
22238
+ }, options)).then((items) => {
22371
22239
  const bookmarks = [];
22372
22240
  for (const i of items) {
22373
22241
  const bookmark = new BookmarkItem({
@@ -22386,24 +22254,24 @@ class NgwWebmapLayerAdapter {
22386
22254
  "Webmap was not loaded correctly, it is impossible to extract bookmarks"
22387
22255
  );
22388
22256
  }
22389
- getLegend() {
22390
- return __async$8(this, null, function* () {
22257
+ getLegend(options) {
22258
+ return __async$9(this, null, function* () {
22391
22259
  const legends = [];
22392
22260
  let deps = this.getDependLayers();
22393
22261
  deps = deps.sort((a, b) => b.id - a.id);
22394
22262
  for (const d of deps) {
22395
- const layerLegend = yield d.getLegend();
22263
+ const layerLegend = yield d.getLegend(options);
22396
22264
  legends.push(...layerLegend);
22397
22265
  }
22398
22266
  return legends;
22399
22267
  });
22400
22268
  }
22401
- getIdentificationIds() {
22402
- return __async$8(this, null, function* () {
22269
+ getIdentificationIds(options) {
22270
+ return __async$9(this, null, function* () {
22403
22271
  const visibleLayers = [];
22404
22272
  let ids = this._webmapLayersIds;
22405
22273
  if (!ids) {
22406
- ids = yield this._getWebMapIds();
22274
+ ids = yield this._getWebMapIds(options);
22407
22275
  this._webmapLayersIds = ids;
22408
22276
  }
22409
22277
  if (ids && ids.length) {
@@ -22425,7 +22293,7 @@ class NgwWebmapLayerAdapter {
22425
22293
  });
22426
22294
  }
22427
22295
  _getWebMapLayerItem() {
22428
- return __async$8(this, null, function* () {
22296
+ return __async$9(this, null, function* () {
22429
22297
  if (this.resourceId) {
22430
22298
  const webmap = yield this.getWebMapConfig(this.resourceId);
22431
22299
  if (webmap && webmap.root_item) {
@@ -22458,7 +22326,7 @@ class NgwWebmapLayerAdapter {
22458
22326
  });
22459
22327
  }
22460
22328
  getWebMapConfig(id) {
22461
- return __async$8(this, null, function* () {
22329
+ return __async$9(this, null, function* () {
22462
22330
  const data = yield this.options.connector.getResource(id);
22463
22331
  if (data) {
22464
22332
  this.response = data;
@@ -22552,8 +22420,8 @@ class NgwWebmapLayerAdapter {
22552
22420
  }
22553
22421
  return item;
22554
22422
  }
22555
- _getWebMapIds() {
22556
- return __async$8(this, null, function* () {
22423
+ _getWebMapIds(options) {
22424
+ return __async$9(this, null, function* () {
22557
22425
  const webMapItem = this.layer;
22558
22426
  if (webMapItem && webMapItem.item.item_type === "root") {
22559
22427
  const layers = webMapItem.tree.getDescendants();
@@ -22562,7 +22430,7 @@ class NgwWebmapLayerAdapter {
22562
22430
  const item = x.item;
22563
22431
  if (item.item_type === "layer") {
22564
22432
  const id = item.layer_style_id;
22565
- const promise = this.options.connector.getResource(id).then((y) => {
22433
+ const promise = this.options.connector.getResource(id, options).then((y) => {
22566
22434
  if (y) {
22567
22435
  const parentId = Number(y.resource.parent.id);
22568
22436
  item.parentId = parentId;
@@ -22596,7 +22464,7 @@ var __spreadValues$7 = (a, b) => {
22596
22464
  return a;
22597
22465
  };
22598
22466
  var __publicField$a = (obj, key, value) => __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
22599
- var __async$7 = (__this, __arguments, generator) => {
22467
+ var __async$8 = (__this, __arguments, generator) => {
22600
22468
  return new Promise((resolve, reject) => {
22601
22469
  var fulfilled = (value) => {
22602
22470
  try {
@@ -22641,7 +22509,7 @@ class NgwKit {
22641
22509
  classAdapters[cls] = adapter;
22642
22510
  }
22643
22511
  onLoadSync(webMap) {
22644
- return __async$7(this, null, function* () {
22512
+ return __async$8(this, null, function* () {
22645
22513
  if (this.options.resourceId && this.url) {
22646
22514
  const resourceIds = [this.options.resourceId];
22647
22515
  if (resourceIds.length) {
@@ -22724,7 +22592,7 @@ class IdentifyItem {
22724
22592
  }
22725
22593
  identify(options = {}) {
22726
22594
  if (this._item) {
22727
- return CancelablePromise.resolve(this._item);
22595
+ return Promise.resolve(this._item);
22728
22596
  }
22729
22597
  return fetchNgwLayerItem(__spreadValues$6({
22730
22598
  connector: this.connector,
@@ -22739,30 +22607,30 @@ class IdentifyItem {
22739
22607
  return resp;
22740
22608
  });
22741
22609
  }
22742
- resource() {
22610
+ resource(opt) {
22743
22611
  if (this._resource) {
22744
- return CancelablePromise.resolve(this._resource.feature_layer);
22612
+ return Promise.resolve(this._resource.feature_layer);
22745
22613
  }
22746
- return this.connector.getResource(this.layerId).then((resp) => {
22614
+ return this.connector.getResource(this.layerId, opt).then((resp) => {
22747
22615
  this._resource = resp;
22748
22616
  return this._resource.feature_layer;
22749
22617
  });
22750
22618
  }
22751
- getBounds() {
22619
+ getBounds(opt) {
22752
22620
  if (this._extent) {
22753
- return CancelablePromise.resolve(this._extent);
22621
+ return Promise.resolve(this._extent);
22754
22622
  }
22755
- return fetchNgwLayerItemExtent({
22623
+ return fetchNgwLayerItemExtent(__spreadValues$6({
22756
22624
  connector: this.connector,
22757
22625
  featureId: this.id,
22758
22626
  resourceId: this.layerId
22759
- });
22627
+ }, opt));
22760
22628
  }
22761
- geojson() {
22629
+ geojson(options) {
22762
22630
  if (this._geojson) {
22763
- return CancelablePromise.resolve(this._geojson);
22631
+ return Promise.resolve(this._geojson);
22764
22632
  }
22765
- return this.identify().then((resp) => {
22633
+ return this.identify(options).then((resp) => {
22766
22634
  return resp.toGeojson().then((geojson) => {
22767
22635
  this._geojson = geojson;
22768
22636
  return geojson;
@@ -22771,8 +22639,29 @@ class IdentifyItem {
22771
22639
  }
22772
22640
  }
22773
22641
 
22642
+ var __async$7 = (__this, __arguments, generator) => {
22643
+ return new Promise((resolve, reject) => {
22644
+ var fulfilled = (value) => {
22645
+ try {
22646
+ step(generator.next(value));
22647
+ } catch (e) {
22648
+ reject(e);
22649
+ }
22650
+ };
22651
+ var rejected = (value) => {
22652
+ try {
22653
+ step(generator.throw(value));
22654
+ } catch (e) {
22655
+ reject(e);
22656
+ }
22657
+ };
22658
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
22659
+ step((generator = generator.apply(__this, __arguments)).next());
22660
+ });
22661
+ };
22774
22662
  function fetchNgwLayerFeature(options) {
22775
- return fetchNgwLayerItem(options).then((item) => {
22663
+ return __async$7(this, null, function* () {
22664
+ const item = yield fetchNgwLayerItem(options);
22776
22665
  return createGeoJsonFeature(item);
22777
22666
  });
22778
22667
  }
@@ -22857,7 +22746,7 @@ function fetchIdentifyGeoJson(options) {
22857
22746
  const withGeom = item.features.find((x) => x.geom);
22858
22747
  if (withGeom && withGeom.geom) {
22859
22748
  const geom = withGeom.geom;
22860
- return CancelablePromise.resolve(
22749
+ return Promise.resolve(
22861
22750
  createGeoJsonFeature(__spreadProps$5(__spreadValues$5({}, withGeom), {
22862
22751
  geom
22863
22752
  }))
@@ -22870,7 +22759,7 @@ function fetchIdentifyGeoJson(options) {
22870
22759
  if (params && params.length) {
22871
22760
  return fetchNgwLayerFeature(__spreadValues$5(__spreadProps$5(__spreadValues$5({}, requestOptions), { connector }), params[0]));
22872
22761
  }
22873
- return CancelablePromise.resolve(void 0);
22762
+ return Promise.resolve(void 0);
22874
22763
  }
22875
22764
  function fetchIdentifyItem(options) {
22876
22765
  const { connector, identify } = options;
@@ -22880,7 +22769,7 @@ function fetchIdentifyItem(options) {
22880
22769
  connector
22881
22770
  }, options.requestOptions), params[0]));
22882
22771
  }
22883
- return CancelablePromise.resolve(void 0);
22772
+ return Promise.resolve(void 0);
22884
22773
  }
22885
22774
  function featureLayerIdentify(options) {
22886
22775
  const { geom, signal, cache, layers } = options;
@@ -22924,9 +22813,9 @@ function getPolygonCoordinates(geom) {
22924
22813
  function sendIdentifyRequest(ev, options) {
22925
22814
  deprecatedMapClick(ev);
22926
22815
  const [lng, lat] = ev.lngLat;
22927
- const { geom, radius, signal, cache } = options;
22816
+ const { geom, radius } = options;
22928
22817
  const geom_ = geom != null ? geom : getCirclePolygonCoordinates(lng, lat, radius);
22929
- return featureLayerIdentify(__spreadProps$5(__spreadValues$5({}, options), { geom: geom_, signal, cache }));
22818
+ return featureLayerIdentify(__spreadProps$5(__spreadValues$5({}, options), { geom: geom_ }));
22930
22819
  }
22931
22820
  function createIdentifyItem(opt) {
22932
22821
  return new IdentifyItem(opt);
@@ -23272,7 +23161,7 @@ const _WebMapMain = class _WebMapMain {
23272
23161
  __publicField$3(this, "_mapState", []);
23273
23162
  __publicField$3(this, "_extent");
23274
23163
  __publicField$3(this, "_eventsStatus", {});
23275
- __publicField$3(this, "_coordFromMapClickPromise");
23164
+ __publicField$3(this, "_coordFromMapClickAbort");
23276
23165
  __publicField$3(this, "_mapEvents", {});
23277
23166
  this.mapAdapter = mapOptions.mapAdapter;
23278
23167
  this._starterKits = mapOptions.starterKits || [];
@@ -23587,36 +23476,34 @@ const _WebMapMain = class _WebMapMain {
23587
23476
  return { stop };
23588
23477
  }
23589
23478
  stopGetCoordFromMapClick() {
23590
- if (this._coordFromMapClickPromise) {
23591
- this._coordFromMapClickPromise.cancel();
23479
+ if (this._coordFromMapClickAbort) {
23480
+ this._coordFromMapClickAbort();
23481
+ this._coordFromMapClickAbort = void 0;
23592
23482
  }
23593
23483
  }
23594
23484
  getCoordFromMapClick() {
23595
- if (!this._coordFromMapClickPromise) {
23596
- this._coordFromMapClickPromise = new CancelablePromise(
23597
- (resolve, reject, onCancel) => {
23598
- const cursor = this.getCursor() || "grab";
23599
- this._removeEventListeners({ include: ["click"] });
23600
- this.setCursor("crosshair");
23601
- const onCancel_ = () => {
23602
- this.setCursor(cursor);
23603
- this._addEventsListeners({ include: ["click"] });
23604
- this.mapAdapter.emitter.off("click", onMapClick);
23605
- this._coordFromMapClickPromise = void 0;
23606
- };
23607
- const onMapClick = (e) => {
23608
- onCancel_();
23609
- deprecatedMapClick(e);
23610
- resolve(e.lngLat);
23611
- };
23612
- this.mapAdapter.emitter.once("click", onMapClick);
23613
- onCancel(onCancel_);
23614
- }
23615
- );
23485
+ if (!this._coordFromMapClickAbort) {
23486
+ return new Promise((resolve, reject) => {
23487
+ const cursor = this.getCursor() || "grab";
23488
+ this._removeEventListeners({ include: ["click"] });
23489
+ this.setCursor("crosshair");
23490
+ const onCancel_ = () => {
23491
+ this.setCursor(cursor);
23492
+ this._addEventsListeners({ include: ["click"] });
23493
+ this.mapAdapter.emitter.off("click", onMapClick);
23494
+ this._coordFromMapClickAbort = void 0;
23495
+ };
23496
+ const onMapClick = (e) => {
23497
+ onCancel_();
23498
+ deprecatedMapClick(e);
23499
+ resolve(e.lngLat);
23500
+ };
23501
+ this.mapAdapter.emitter.once("click", onMapClick);
23502
+ this._coordFromMapClickAbort = onCancel_;
23503
+ });
23616
23504
  } else {
23617
23505
  return this.getCoordFromMapClick();
23618
23506
  }
23619
- return this._coordFromMapClickPromise;
23620
23507
  }
23621
23508
  _emitStatusEvent(eventName, data) {
23622
23509
  const _eventName = eventName;
@@ -25404,26 +25291,35 @@ const _NgwMap = class _NgwMap extends WebMap {
25404
25291
  }, options));
25405
25292
  }
25406
25293
  fetchIdentifyItem(identify, requestOptions) {
25294
+ const abortController = new AbortController();
25295
+ const abortSignal = abortController.signal;
25296
+ if (requestOptions == null ? void 0 : requestOptions.signal) {
25297
+ requestOptions.signal.addEventListener("abort", abortController.abort);
25298
+ }
25299
+ requestOptions = requestOptions || {};
25300
+ requestOptions.signal = abortSignal;
25407
25301
  const promise = fetchIdentifyItem({
25408
25302
  identify,
25409
25303
  connector: this.connector,
25410
25304
  requestOptions
25411
25305
  // multiple,
25412
25306
  });
25413
- this._addPromise("identify", promise);
25307
+ this._addPromise("identify", promise, abortController);
25414
25308
  return promise;
25415
25309
  }
25416
25310
  fetchIdentifyGeoJson(identify, multiple = false) {
25311
+ const abortController = new AbortController();
25417
25312
  const promise = fetchIdentifyGeoJson({
25418
25313
  identify,
25419
25314
  connector: this.connector,
25420
- multiple
25315
+ multiple,
25316
+ requestOptions: { signal: abortController.signal }
25421
25317
  });
25422
25318
  if (promise && "then" in promise) {
25423
- this._addPromise("identify", promise);
25319
+ this._addPromise("identify", promise, abortController);
25424
25320
  return promise;
25425
25321
  } else {
25426
- return CancelablePromise.resolve(promise);
25322
+ return Promise.resolve(promise);
25427
25323
  }
25428
25324
  }
25429
25325
  /**
@@ -25597,7 +25493,7 @@ const _NgwMap = class _NgwMap extends WebMap {
25597
25493
  args.forEach((name) => {
25598
25494
  const group = this._promises[name];
25599
25495
  if (group) {
25600
- group.forEach((x) => x.cancel());
25496
+ group.forEach((x) => x[1].abort());
25601
25497
  this._promises[name] = [];
25602
25498
  }
25603
25499
  });
@@ -25664,11 +25560,13 @@ const _NgwMap = class _NgwMap extends WebMap {
25664
25560
  }, highlightDuration);
25665
25561
  }
25666
25562
  }
25563
+ const abortController = new AbortController();
25667
25564
  const selectPromise = sendIdentifyRequest(ev, {
25668
25565
  layers: ids,
25669
25566
  connector: this.connector,
25670
25567
  radius,
25671
- geom
25568
+ geom,
25569
+ signal: abortController.signal
25672
25570
  }).then((resp) => {
25673
25571
  const identify = __spreadProps$1(__spreadValues$1({}, resp), {
25674
25572
  resources: ids,
@@ -25679,22 +25577,22 @@ const _NgwMap = class _NgwMap extends WebMap {
25679
25577
  this._emitStatusEvent("ngw:select", identifyEvent);
25680
25578
  return identifyEvent;
25681
25579
  });
25682
- this._addPromise("select", selectPromise);
25580
+ this._addPromise("select", selectPromise, abortController);
25683
25581
  return selectPromise;
25684
25582
  });
25685
25583
  }
25686
- _addPromise(groupName, promise) {
25584
+ _addPromise(groupName, promise, abortController) {
25687
25585
  const group = this._promises[groupName];
25688
- if (group && group.indexOf(promise) === -1) {
25586
+ if (group && group.findIndex((g) => g[0] === promise) === -1) {
25689
25587
  const removeFromGroup = () => {
25690
- const index = group.indexOf(promise);
25588
+ const index = group.findIndex((g) => g[0] === promise);
25691
25589
  if (index !== -1) {
25692
25590
  group.splice(index, 1);
25693
25591
  }
25694
25592
  };
25695
25593
  promise.then(removeFromGroup);
25696
25594
  promise.catch(removeFromGroup);
25697
- group.push(promise);
25595
+ group.push([promise, abortController]);
25698
25596
  }
25699
25597
  }
25700
25598
  _isFitFromResource() {