123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- import {
- _
- } from "./chunk-YBSUITLL.js";
- import {
- d,
- e,
- n2 as n,
- t
- } from "./chunk-Y3WMVFTW.js";
- import {
- d as d2,
- v
- } from "./chunk-ULGDPLM2.js";
- import {
- s3 as s
- } from "./chunk-EMJ4ZSM2.js";
- // node_modules/@arcgis/core/core/Loadable.js
- var i = "not-loaded";
- var d3 = "loading";
- var c = "failed";
- var h = "loaded";
- var u = (s2) => {
- let u2 = class extends s2 {
- constructor(...o) {
- super(...o), this._loadController = null, this.loadError = null, this.loadStatus = "not-loaded", this._set("loadWarnings", []), this.addResolvingPromise(new Promise((o2) => {
- const s3 = this.load.bind(this);
- this.load = (l) => {
- const a = new Promise((o3, s4) => {
- const e2 = d2(l, s4);
- 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(() => {
- e2 && e2.remove();
- });
- });
- if (this.loadStatus === i) {
- this._set("loadStatus", d3);
- const o3 = this._loadController = new AbortController();
- s3({ signal: o3.signal }), v(o3.signal, () => {
- this._promiseProps.abort();
- });
- }
- return o2(), a;
- };
- })), this.when(() => {
- this._set("loadStatus", h), this._loadController = null;
- }, (o2) => {
- this._set("loadStatus", c), this._set("loadError", o2), this._loadController = null;
- });
- }
- get loaded() {
- return this.loadStatus === h;
- }
- get loadWarnings() {
- return this._get("loadWarnings");
- }
- load() {
- return null;
- }
- cancelLoad() {
- return this.isFulfilled() || (this._set("loadError", new s("load:cancelled", "Cancelled")), this._loadController?.abort()), this;
- }
- };
- return e([d({ readOnly: true })], u2.prototype, "loaded", null), e([d({ readOnly: true })], u2.prototype, "loadError", void 0), e([d({ clonable: false })], u2.prototype, "loadStatus", void 0), e([d({ type: [t], readOnly: true })], u2.prototype, "loadWarnings", null), u2 = e([n("esri.core.Loadable")], u2), u2;
- };
- var p = class extends u(_) {
- };
- p = e([n("esri.core.Loadable")], p), function(o) {
- function t2(o2) {
- return !(!o2 || !o2.load);
- }
- o.LoadableMixin = u, o.isLoadable = t2;
- }(p || (p = {}));
- var m = p;
- export {
- m
- };
- //# sourceMappingURL=chunk-TBBTRX4O.js.map
|