chunk-YFSLJIO4.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import {
  2. _
  3. } from "./chunk-55RWC67C.js";
  4. import {
  5. e,
  6. n5 as n,
  7. t5 as t,
  8. y3 as y
  9. } from "./chunk-2Z2TG5CU.js";
  10. import {
  11. d,
  12. v
  13. } from "./chunk-V6P2MAQQ.js";
  14. import {
  15. s3 as s
  16. } from "./chunk-E5O6P5I2.js";
  17. // node_modules/@arcgis/core/core/Loadable.js
  18. var i = "not-loaded";
  19. var d2 = "loading";
  20. var c = "failed";
  21. var h = "loaded";
  22. var u = (s2) => {
  23. let u2 = class extends s2 {
  24. constructor(...o) {
  25. super(...o), this._loadController = null, this.loadError = null, this.loadStatus = "not-loaded", this._set("loadWarnings", []), this.addResolvingPromise(new Promise((o2) => {
  26. const s3 = this.load.bind(this);
  27. this.load = (l) => {
  28. const a = new Promise((o3, s4) => {
  29. const e2 = d(l, s4);
  30. this.destroyed && s4(new s("load:instance-destroyed", `Instance of '${this.declaredClass || this.constructor.name}' is already destroyed`, { instance: this })), this._promiseProps.when(o3, s4).finally(() => {
  31. e2 && e2.remove();
  32. });
  33. });
  34. if (this.loadStatus === i) {
  35. this._set("loadStatus", d2);
  36. const o3 = this._loadController = new AbortController();
  37. s3({ signal: o3.signal }), v(o3.signal, () => {
  38. this._promiseProps.abort();
  39. });
  40. }
  41. return o2(), a;
  42. };
  43. })), this.when(() => {
  44. this._set("loadStatus", h), this._loadController = null;
  45. }, (o2) => {
  46. this._set("loadStatus", c), this._set("loadError", o2), this._loadController = null;
  47. });
  48. }
  49. get loaded() {
  50. return this.loadStatus === h;
  51. }
  52. get loadWarnings() {
  53. return this._get("loadWarnings");
  54. }
  55. load() {
  56. return null;
  57. }
  58. cancelLoad() {
  59. var _a;
  60. return this.isFulfilled() || (this._set("loadError", new s("load:cancelled", "Cancelled")), (_a = this._loadController) == null ? void 0 : _a.abort()), this;
  61. }
  62. };
  63. return e([y({ readOnly: true })], u2.prototype, "loaded", null), e([y({ readOnly: true })], u2.prototype, "loadError", void 0), e([y({ clonable: false })], u2.prototype, "loadStatus", void 0), e([y({ type: [t], readOnly: true })], u2.prototype, "loadWarnings", null), u2 = e([n("esri.core.Loadable")], u2), u2;
  64. };
  65. var p = class extends u(_) {
  66. };
  67. p = e([n("esri.core.Loadable")], p), function(o) {
  68. function t2(o2) {
  69. return !(!o2 || !o2.load);
  70. }
  71. o.LoadableMixin = u, o.isLoadable = t2;
  72. }(p || (p = {}));
  73. var m = p;
  74. export {
  75. m
  76. };
  77. //# sourceMappingURL=chunk-YFSLJIO4.js.map