@arcgis/lumina 4.33.0-next.15 → 4.33.0-next.150

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.
Files changed (58) hide show
  1. package/dist/Controller-BQOv8BAL.js +587 -0
  2. package/dist/LitElement.d.ts +56 -45
  3. package/dist/config.d.ts +7 -9
  4. package/dist/config.js +18 -8
  5. package/dist/context.d.ts +14 -4
  6. package/dist/controllers/Controller.d.ts +147 -0
  7. package/dist/controllers/ControllerInternals.d.ts +53 -0
  8. package/dist/controllers/ControllerManager.d.ts +68 -0
  9. package/dist/controllers/accessor/index.d.ts +4 -0
  10. package/dist/controllers/accessor/index.js +245 -0
  11. package/dist/controllers/accessor/reEmitEvent.d.ts +10 -0
  12. package/dist/controllers/accessor/store.d.ts +17 -0
  13. package/dist/controllers/accessor/useAccessor.d.ts +71 -0
  14. package/dist/controllers/functional.d.ts +19 -0
  15. package/dist/controllers/index.d.ts +24 -0
  16. package/dist/controllers/index.js +270 -0
  17. package/dist/controllers/load.d.ts +6 -0
  18. package/dist/controllers/proxyExports.d.ts +27 -0
  19. package/dist/controllers/tests/autoDestroyMock.d.ts +5 -0
  20. package/dist/controllers/tests/utils.d.ts +1 -0
  21. package/dist/controllers/toFunction.d.ts +8 -0
  22. package/dist/controllers/trackKey.d.ts +8 -0
  23. package/dist/controllers/trackPropKey.d.ts +21 -0
  24. package/dist/controllers/trackPropertyKey.d.ts +29 -0
  25. package/dist/controllers/types.d.ts +187 -0
  26. package/dist/controllers/useDirection.d.ts +11 -0
  27. package/dist/controllers/useMedia.d.ts +8 -0
  28. package/dist/controllers/usePropertyChange.d.ts +14 -0
  29. package/dist/controllers/useT9n.d.ts +48 -0
  30. package/dist/controllers/useWatchAttributes.d.ts +7 -0
  31. package/dist/controllers/utils.d.ts +12 -0
  32. package/dist/createEvent.d.ts +8 -3
  33. package/dist/decorators.d.ts +2 -2
  34. package/dist/devOnlyDetectIncorrectLazyUsages.d.ts +1 -1
  35. package/dist/hmrSupport.d.ts +1 -1
  36. package/dist/hmrSupport.js +22 -28
  37. package/dist/index.d.ts +17 -16
  38. package/dist/index.js +423 -194
  39. package/dist/jsx/baseTypes.d.ts +13 -9
  40. package/dist/jsx/directives.d.ts +25 -7
  41. package/dist/jsx/generatedTypes.d.ts +420 -90
  42. package/dist/jsx/types.d.ts +5 -32
  43. package/dist/lazyLoad-DUvrNd2L.js +406 -0
  44. package/dist/lazyLoad.d.ts +27 -72
  45. package/dist/lifecycleSupport.d.ts +2 -2
  46. package/dist/makeRuntime.d.ts +148 -0
  47. package/dist/proxyExports-Cdzj7WL_.js +60 -0
  48. package/dist/render.d.ts +5 -0
  49. package/dist/runtime.d.ts +4 -107
  50. package/dist/stencilSsrCompatibility/index.d.ts +2 -6
  51. package/dist/stencilSsrCompatibility/index.js +2 -3
  52. package/dist/typings/importMeta.d.ts +2 -2
  53. package/dist/utils.d.ts +8 -0
  54. package/dist/wrappersUtils.d.ts +13 -1
  55. package/package.json +7 -6
  56. package/dist/chunk-NO7HOBNA.js +0 -421
  57. package/dist/chunk-PGHUBTOM.js +0 -21
  58. package/dist/wrappersUtils.test.d.ts +0 -1
@@ -0,0 +1,587 @@
1
+ import { isEsriInternalEnv, safeCall, Deferred, safeAsyncCall } from "@arcgis/components-utils";
2
+ import { nothing } from "lit";
3
+ const controllerSymbol = Symbol.for("controller");
4
+ const isController = (value) => typeof value === "object" && value !== null && (controllerSymbol in value || "hostConnected" in value || "hostDisconnected" in value || "hostUpdate" in value || "hostUpdated" in value);
5
+ const isPromise = (arg) => typeof arg?.then === "function";
6
+ const getControllersCount = (component) => component.M.length;
7
+ let ambientComponent;
8
+ const setAmbientComponent = (component) => {
9
+ if (ambientComponent === component) {
10
+ return;
11
+ }
12
+ ambientComponent = component;
13
+ queueMicrotask(() => ambientComponent === component ? ambientComponent = void 0 : 0);
14
+ };
15
+ const retrieveComponent = (name) => {
16
+ if (process.env.NODE_ENV !== "production" && ambientComponent === void 0) {
17
+ throw new Error(
18
+ [
19
+ `Unable to find out which component ${name || "this"} controller `,
20
+ "belongs to. Possible causes:\n",
21
+ "- You might have multiple versions of ",
22
+ "@arcgis/lumina package installed\n",
23
+ ...isEsriInternalEnv() ? [
24
+ "- You tried to create controller outside the component. If so, ",
25
+ "please wrap your controller definition in an arrow function (like",
26
+ "`const myController = ()=>makeController(...);`) and call that",
27
+ "function inside the component (`my = myController();`), or ",
28
+ "define your controller using makeGenericController/GenericController ",
29
+ "instead.\n",
30
+ "- You tried to create a controller inside an async function. ",
31
+ "This is allowed without calling controller.use(). Make sure you ",
32
+ "use it like `await controller.use(useController())`."
33
+ ] : []
34
+ ].join("")
35
+ );
36
+ }
37
+ return ambientComponent;
38
+ };
39
+ let ambientControllers = [];
40
+ const setParentController = (controller) => {
41
+ if (controller === void 0) {
42
+ ambientControllers = [];
43
+ return;
44
+ }
45
+ const index = ambientControllers.indexOf(controller);
46
+ ambientControllers = index === -1 ? [...ambientControllers, controller] : ambientControllers.slice(0, index + 1);
47
+ queueMicrotask(() => ambientControllers = []);
48
+ };
49
+ const retrieveParentControllers = () => ambientControllers;
50
+ let ambientChildController;
51
+ const setAmbientChildController = (controller) => {
52
+ if (ambientChildController === controller) {
53
+ return;
54
+ }
55
+ ambientChildController = controller;
56
+ queueMicrotask(() => ambientChildController === controller ? ambientChildController = void 0 : 0);
57
+ };
58
+ const retrieveAmbientChildController = () => {
59
+ const controller = ambientChildController;
60
+ ambientChildController = void 0;
61
+ return controller;
62
+ };
63
+ const use = async (value, watchExports) => {
64
+ const controller = useRefSync(value);
65
+ if (controller === void 0) {
66
+ if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && typeof watchExports === "function") {
67
+ throw new Error(
68
+ `Unable to resolve a controller from the provided value, so can't watch it's exports. The value you passed is not a controller and not a controller exports. If your controller exports a literal value, try making your controller export an object instead`
69
+ );
70
+ }
71
+ return value;
72
+ }
73
+ await controller.ready;
74
+ if (typeof watchExports === "function") {
75
+ if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && controller.watchExports === void 0) {
76
+ throw new Error(`The controller must implement watchExports method to support watching exports`);
77
+ }
78
+ const unsubscribe = controller.watchExports(
79
+ (exports) => watchExports(exports, unsubscribe)
80
+ );
81
+ }
82
+ return controller.exports;
83
+ };
84
+ const useRef = async (value) => {
85
+ const controller = useRefSync(value);
86
+ if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && controller === void 0) {
87
+ throw new Error(
88
+ `Unable to resolve a controller from the provided value. The value you passed is not a controller and not a controller exports. If your controller exports a literal value, try making your controller export an object instead`
89
+ );
90
+ }
91
+ await controller.ready;
92
+ return controller;
93
+ };
94
+ const useRefSync = (value) => {
95
+ const component = retrieveComponent();
96
+ const controller = component.manager.X(value);
97
+ if (controller !== void 0) {
98
+ return controller;
99
+ }
100
+ if (isController(value)) {
101
+ return value;
102
+ }
103
+ const ambientChildController2 = retrieveAmbientChildController();
104
+ if (ambientChildController2 !== void 0) {
105
+ return ambientChildController2;
106
+ }
107
+ return void 0;
108
+ };
109
+ let shouldBypassReadOnly = false;
110
+ const bypassReadOnly = (callback) => {
111
+ shouldBypassReadOnly = true;
112
+ try {
113
+ return callback();
114
+ } finally {
115
+ shouldBypassReadOnly = false;
116
+ }
117
+ };
118
+ const bypassSetter = bypassReadOnly;
119
+ const trackPropertyKey = (object, onResolved, defaultValue) => {
120
+ const keys = Object.keys(object);
121
+ const keyCount = keys.length;
122
+ if (keyTrackMap === void 0) {
123
+ queueMicrotask(keyTrackResolve);
124
+ }
125
+ keyTrackMap ??= /* @__PURE__ */ new Map();
126
+ let pendingTrackers = keyTrackMap.get(object);
127
+ if (pendingTrackers === void 0) {
128
+ pendingTrackers = { callbacks: [], keyCount };
129
+ keyTrackMap.set(object, pendingTrackers);
130
+ }
131
+ if (pendingTrackers.keyCount !== keyCount) {
132
+ pendingTrackers.callbacks.forEach((resolve) => resolve(keys));
133
+ pendingTrackers.callbacks = [];
134
+ pendingTrackers.keyCount = keyCount;
135
+ }
136
+ pendingTrackers.callbacks.push((keys2) => {
137
+ const callback = (key2) => safeCall(onResolved, null, key2);
138
+ const key = keys2[keyCount];
139
+ if (key === void 0) {
140
+ callback(void 0);
141
+ } else if (object[key] === defaultValue) {
142
+ callback(key);
143
+ } else {
144
+ callback(void 0);
145
+ }
146
+ });
147
+ return defaultValue;
148
+ };
149
+ let keyTrackMap = void 0;
150
+ const keyTrackResolve = () => {
151
+ keyTrackMap?.forEach(({ callbacks }, object) => {
152
+ const keys = Object.keys(object);
153
+ callbacks.forEach((commit) => commit(keys));
154
+ });
155
+ keyTrackMap = void 0;
156
+ };
157
+ const trackPropKey = (component, onResolved, defaultValue) => {
158
+ const manager = component.manager;
159
+ if (manager.V !== nothing && manager.V !== defaultValue) {
160
+ manager.S(void 0, void 0);
161
+ }
162
+ if (manager.T.length === 0) {
163
+ queueMicrotask(() => manager.S(void 0, void 0));
164
+ }
165
+ manager.V = defaultValue;
166
+ manager.T.push((key, value) => safeCall(onResolved, void 0, defaultValue === value ? key : void 0));
167
+ return defaultValue;
168
+ };
169
+ const trackKey = (hostsCandidates = [
170
+ retrieveComponent(),
171
+ ...retrieveParentControllers()
172
+ ], onResolved, defaultValue) => {
173
+ const candidateHosts = Array.isArray(hostsCandidates) ? hostsCandidates : [hostsCandidates];
174
+ let leftToResolve = candidateHosts.length + 1;
175
+ const resolved = (resolution) => {
176
+ leftToResolve -= 1;
177
+ if (resolution !== void 0) {
178
+ leftToResolve = Math.min(leftToResolve, 0);
179
+ }
180
+ if (leftToResolve === 0) {
181
+ onResolved(resolution);
182
+ }
183
+ };
184
+ candidateHosts.forEach(
185
+ (host) => trackPropertyKey(
186
+ host,
187
+ (key) => resolved(key === void 0 ? void 0 : { key, host, isReactive: false }),
188
+ defaultValue
189
+ )
190
+ );
191
+ for (const host of candidateHosts) {
192
+ if ("manager" in host && host.manager.component === host) {
193
+ trackPropKey(
194
+ host,
195
+ (key) => resolved(key === void 0 ? void 0 : { key, host, isReactive: true }),
196
+ defaultValue
197
+ );
198
+ break;
199
+ }
200
+ }
201
+ return defaultValue;
202
+ };
203
+ const createEventFactory = (eventName = "", options = {}, component = retrieveComponent()) => {
204
+ const emitter = {
205
+ emit: (payload) => {
206
+ if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && !component.el.isConnected) {
207
+ console.warn(`Trying to emit an ${eventName} event on a disconnected element ${component.el.localName}`);
208
+ }
209
+ if (eventName === "") {
210
+ keyTrackResolve();
211
+ if (process.env.NODE_ENV !== "production" && isEsriInternalEnv() && eventName === "") {
212
+ throw new Error("Unable to resolve event name from property name");
213
+ }
214
+ }
215
+ const event = new CustomEvent(eventName, {
216
+ detail: payload,
217
+ cancelable: true,
218
+ bubbles: true,
219
+ composed: true,
220
+ ...options
221
+ });
222
+ component.el.dispatchEvent(event);
223
+ return event;
224
+ }
225
+ };
226
+ if (eventName === "") {
227
+ trackKey(
228
+ void 0,
229
+ process.env.NODE_ENV !== "production" && isEsriInternalEnv() ? (resolution) => {
230
+ if (resolution === void 0) {
231
+ throw new Error(`createEvent must be called in property default value only`);
232
+ }
233
+ eventName = resolution.key;
234
+ } : (resolution) => eventName = resolution.key,
235
+ emitter
236
+ );
237
+ }
238
+ return emitter;
239
+ };
240
+ const createEvent = createEventFactory.bind(null, "");
241
+ var _a;
242
+ _a = controllerSymbol;
243
+ class Controller {
244
+ constructor(component) {
245
+ this.#hostConnected = [];
246
+ this.#hostDisconnected = [];
247
+ this.#hostLoad = [];
248
+ this.#hostLoaded = [];
249
+ this.#hostUpdate = [];
250
+ this.#hostUpdated = [];
251
+ this.#hostDestroy = [];
252
+ this.#hostLifecycle = [];
253
+ this.#lifecycleCleanups = [];
254
+ this.#loadCalled = false;
255
+ this.P = new Deferred();
256
+ this.connectedCalled = false;
257
+ this.loadedCalled = false;
258
+ this[_a] = true;
259
+ this.#exportWatchers = [];
260
+ const that = this;
261
+ const resolvedComponent = component ?? retrieveComponent(new.target.name);
262
+ that.#component = resolvedComponent;
263
+ that.ready = that.P.promise;
264
+ that.#exports = makeProvisionalValue(that);
265
+ if (process.env.NODE_ENV !== "production") {
266
+ Object.defineProperty(this, "component", {
267
+ writable: false,
268
+ enumerable: false,
269
+ configurable: true,
270
+ value: resolvedComponent
271
+ });
272
+ if ("hostDestroy" in this) {
273
+ that.#component.manager.devOnly$ensureHasDestroy?.();
274
+ }
275
+ } else {
276
+ that.component = resolvedComponent;
277
+ }
278
+ that.#component.addController(that);
279
+ const manager = that.#component.manager;
280
+ const isInControllerManager = manager === void 0;
281
+ if (!isInControllerManager) {
282
+ setParentController(that);
283
+ queueMicrotask(() => that.catchUpLifecycle());
284
+ }
285
+ }
286
+ #hostConnected;
287
+ #hostDisconnected;
288
+ #hostLoad;
289
+ #hostLoaded;
290
+ #hostUpdate;
291
+ #hostUpdated;
292
+ #hostDestroy;
293
+ #hostLifecycle;
294
+ #lifecycleCleanups;
295
+ #loadCalled;
296
+ #component;
297
+ /**
298
+ * If controller is being added dynamically, after the component
299
+ * construction, then trigger connected and load right away
300
+ */
301
+ catchUpLifecycle() {
302
+ const { manager } = this.#component;
303
+ const connectedWillStillHappen = !manager.connectedCalled;
304
+ if (!connectedWillStillHappen && !this.connectedCalled) {
305
+ this.triggerConnected();
306
+ }
307
+ const loadWillStillHappen = !manager.#loadCalled;
308
+ if (loadWillStillHappen) {
309
+ return;
310
+ }
311
+ this.triggerLoad().then(
312
+ () => (
313
+ // Call loaded ourself, unless manager is going to do it
314
+ manager.loadedCalled && this.triggerLoaded()
315
+ )
316
+ ).catch(console.error);
317
+ }
318
+ #exports;
319
+ get exports() {
320
+ return this.#exports;
321
+ }
322
+ /**
323
+ * Set controller's exports property (for usage with proxyExports()) and mark
324
+ * controller as ready (for usage in other controllers). Also, triggers
325
+ * re-render of the component
326
+ */
327
+ set exports(exports) {
328
+ const oldExports = this.#exports;
329
+ if (oldExports !== exports) {
330
+ this.#exports = exports;
331
+ this.#exportWatchers.forEach(safeCall);
332
+ if (this.connectedCalled && this.O !== false) {
333
+ this.#component.requestUpdate(this.O, oldExports);
334
+ }
335
+ }
336
+ this.P.resolve(exports);
337
+ }
338
+ setProvisionalExports(exports, proxy = true) {
339
+ this.#exports = proxy ? makeProvisionalValue(exports) : exports;
340
+ this.#exportWatchers.forEach(safeCall);
341
+ }
342
+ #exportWatchers;
343
+ watchExports(callback) {
344
+ const safeCallback = () => callback(this.#exports);
345
+ this.#exportWatchers.push(safeCallback);
346
+ return () => void this.#exportWatchers.splice(this.#exportWatchers.indexOf(safeCallback), 1);
347
+ }
348
+ /**
349
+ * A flexible utility for making sure a controller is loaded before it's used,
350
+ * regardless of how or where a controller was defined:
351
+ *
352
+ * @example
353
+ * makeGenericController(async (component, controller) => {
354
+ * // Await some controller from the component:
355
+ * await controller.use(component.someController);
356
+ * // Initialize new controllers
357
+ * await controller.use(load(importCoreReactiveUtils));
358
+ * await controller.use(new ViewModelController(component,newWidgetsHomeHomeViewModel));
359
+ * await controller.use(someController(component));
360
+ * });
361
+ *
362
+ * @remarks
363
+ * If your controller is not async, and you are not creating it async, then
364
+ * you are not required to use controller.use - you can use it directly.
365
+ * Similarly, accessing controllers after componentWillLoad callback does not
366
+ * require awaiting them as they are guaranteed to be loaded by then.
367
+ */
368
+ get use() {
369
+ setAmbientComponent(this.#component);
370
+ return use;
371
+ }
372
+ /**
373
+ * Just like controller.use, but returns the controller itself, rather than it's
374
+ * exports
375
+ *
376
+ * Use cases:
377
+ * - You have a controller and you want to make sure it's loaded before you
378
+ * try to use it
379
+ * - Your controller is not using exports, so you wish to access some props on
380
+ * it directly
381
+ * - You have a controller exports only, and you want to retrieve the
382
+ * controller itself. This is useful if you wish to call .watchExports() or
383
+ * some other method on the controller
384
+ */
385
+ get useRef() {
386
+ setAmbientComponent(this.#component);
387
+ return useRef;
388
+ }
389
+ /**
390
+ * Like useRef, but doesn't wait for the controller to get ready
391
+ *
392
+ * @private
393
+ */
394
+ get useRefSync() {
395
+ setAmbientComponent(this.#component);
396
+ return useRefSync;
397
+ }
398
+ controllerRemoved() {
399
+ if (this.#component.el.isConnected) {
400
+ this.triggerDisconnected();
401
+ }
402
+ this.triggerDestroy();
403
+ }
404
+ // Register a lifecycle callback
405
+ onConnected(callback) {
406
+ this.#hostConnected.push(callback);
407
+ }
408
+ onDisconnected(callback) {
409
+ this.#hostDisconnected.push(callback);
410
+ }
411
+ onLoad(callback) {
412
+ this.#hostLoad.push(callback);
413
+ }
414
+ onLoaded(callback) {
415
+ this.#hostLoaded.push(callback);
416
+ }
417
+ onUpdate(callback) {
418
+ this.#hostUpdate.push(callback);
419
+ }
420
+ onUpdated(callback) {
421
+ this.#hostUpdated.push(callback);
422
+ }
423
+ onDestroy(callback) {
424
+ if (process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
425
+ this.#component.manager.devOnly$ensureHasDestroy?.();
426
+ }
427
+ this.#hostDestroy.push(callback);
428
+ }
429
+ onLifecycle(callback) {
430
+ this.#hostLifecycle.push(callback);
431
+ if (this.connectedCalled && this.#component.el.isConnected) {
432
+ this.#callLifecycle(callback);
433
+ }
434
+ }
435
+ // Call each lifecycle hook
436
+ /** @private */
437
+ triggerConnected() {
438
+ const that = this;
439
+ if (that.hostConnected) {
440
+ safeCall(that.hostConnected, that);
441
+ }
442
+ that.#hostConnected.forEach(safeCall);
443
+ that.triggerLifecycle();
444
+ that.connectedCalled = true;
445
+ }
446
+ /** @private */
447
+ triggerDisconnected() {
448
+ const that = this;
449
+ if (that.hostDisconnected) {
450
+ safeCall(that.hostDisconnected, that);
451
+ }
452
+ that.#hostDisconnected.forEach(safeCall);
453
+ that.#lifecycleCleanups.forEach(safeCall);
454
+ that.#lifecycleCleanups = [];
455
+ }
456
+ /** @private */
457
+ async triggerLoad() {
458
+ if (this.#loadCalled) {
459
+ return;
460
+ }
461
+ this.#loadCalled = true;
462
+ const genericController = this;
463
+ if (genericController.hostLoad) {
464
+ await safeAsyncCall(genericController.hostLoad, genericController);
465
+ }
466
+ if (this.#hostLoad.length > 0) {
467
+ await Promise.allSettled(this.#hostLoad.map(safeAsyncCall));
468
+ }
469
+ this.P.resolve(this.#exports);
470
+ }
471
+ /** @private */
472
+ triggerLoaded() {
473
+ if (this.loadedCalled) {
474
+ return;
475
+ }
476
+ if (this.hostLoaded) {
477
+ safeCall(this.hostLoaded, this);
478
+ }
479
+ this.#hostLoaded.forEach(safeCall);
480
+ this.loadedCalled = true;
481
+ }
482
+ /** @private */
483
+ triggerUpdate(changes) {
484
+ if (this.hostUpdate) {
485
+ safeCall(this.hostUpdate, this, changes);
486
+ }
487
+ this.#hostUpdate.forEach(callUpdate, changes);
488
+ }
489
+ /** @private */
490
+ triggerUpdated(changes) {
491
+ if (this.hostUpdated) {
492
+ safeCall(this.hostUpdated, this, changes);
493
+ }
494
+ this.#hostUpdated.forEach(callUpdate, changes);
495
+ }
496
+ /** @private */
497
+ triggerDestroy() {
498
+ if (this.hostDestroy) {
499
+ safeCall(this.hostDestroy, this);
500
+ }
501
+ this.#hostDestroy.forEach(safeCall);
502
+ }
503
+ /** @private */
504
+ triggerLifecycle() {
505
+ if (this.hostLifecycle) {
506
+ this.#callLifecycle(() => this.hostLifecycle());
507
+ }
508
+ this.#hostLifecycle.forEach(this.#callLifecycle, this);
509
+ }
510
+ #callLifecycle(callback) {
511
+ setAmbientComponent(this.#component);
512
+ const cleanupRaw = safeCall(callback);
513
+ const cleanup = Array.isArray(cleanupRaw) ? cleanupRaw : [cleanupRaw];
514
+ cleanup.forEach((cleanup2) => {
515
+ if (typeof cleanup2 === "function") {
516
+ this.#lifecycleCleanups.push(cleanup2);
517
+ } else if (typeof cleanup2 === "object" && typeof cleanup2.remove === "function") {
518
+ this.#lifecycleCleanups.push(cleanup2.remove);
519
+ }
520
+ });
521
+ }
522
+ }
523
+ function callUpdate(callback) {
524
+ safeCall(callback, void 0, this);
525
+ }
526
+ const GenericController = Controller;
527
+ const makeProvisionalValue = (base) => {
528
+ if (typeof base !== "object" && typeof base !== "function" || base === null) {
529
+ return base;
530
+ }
531
+ const proxyDefinition = {
532
+ get(target, prop, receiver) {
533
+ if ((prop === "exports" || prop === "_exports") && prop in target && target[prop] === proxy) {
534
+ return void 0;
535
+ }
536
+ if (prop in target || prop in Promise.prototype || typeof prop === "symbol") {
537
+ return typeof target === "function" ? target[prop] : Reflect.get(target, prop, receiver);
538
+ }
539
+ if (process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
540
+ if (process.env.NODE_ENV === "test" && (prop.startsWith("$$") || prop.startsWith("@@") || prop === "nodeType" || prop === "tagName" || prop === "toJSON" || prop === "hasAttribute")) {
541
+ return;
542
+ }
543
+ console.error(
544
+ `Trying to access "${prop.toString()}" on the controller before it's loaded. ${accessBeforeLoad}`
545
+ );
546
+ }
547
+ return void 0;
548
+ }
549
+ };
550
+ if (process.env.NODE_ENV !== "production" && isEsriInternalEnv()) {
551
+ proxyDefinition.set = (target, prop, newValue, receiver) => {
552
+ console.error(`Trying to set "${prop.toString()}" on the controller before it's loaded. ${accessBeforeLoad}`);
553
+ return Reflect.set(target, prop, newValue, receiver);
554
+ };
555
+ }
556
+ const proxy = new Proxy(base, proxyDefinition);
557
+ return proxy;
558
+ };
559
+ const accessBeforeLoad = process.env.NODE_ENV !== "production" && isEsriInternalEnv() ? [
560
+ "This might be the case if you are trying to access an async controller in ",
561
+ "connectedCallback(). Or, if you are using it inside of ",
562
+ "componentWillLoad()/another controller without controller.use. Example correct ",
563
+ "usage:\n",
564
+ "makeController(async (component, controller)=>{ await controller.use(someOtherController); });"
565
+ ].join("") : void 0;
566
+ export {
567
+ Controller as C,
568
+ GenericController as G,
569
+ shouldBypassReadOnly as a,
570
+ createEvent as b,
571
+ controllerSymbol as c,
572
+ setParentController as d,
573
+ retrieveParentControllers as e,
574
+ createEventFactory as f,
575
+ bypassSetter as g,
576
+ bypassReadOnly as h,
577
+ isPromise as i,
578
+ trackPropertyKey as j,
579
+ keyTrackResolve as k,
580
+ trackPropKey as l,
581
+ isController as m,
582
+ getControllersCount as n,
583
+ setAmbientChildController as o,
584
+ retrieveComponent as r,
585
+ setAmbientComponent as s,
586
+ trackKey as t
587
+ };