ember-source 5.11.0-beta.2 → 5.11.1

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 (147) hide show
  1. package/build-metadata.json +3 -3
  2. package/dist/ember-template-compiler.js +48 -42
  3. package/dist/ember-testing.js +1 -1
  4. package/dist/ember.debug.js +23102 -23100
  5. package/dist/ember.prod.js +31562 -31563
  6. package/dist/packages/@ember/-internals/container/index.js +1 -1
  7. package/dist/packages/@ember/-internals/deprecations/index.js +2 -1
  8. package/dist/packages/@ember/-internals/glimmer/index.js +2 -1
  9. package/dist/packages/@ember/-internals/meta/lib/meta.js +4 -3
  10. package/dist/packages/@ember/-internals/metal/index.js +9 -8
  11. package/dist/packages/@ember/-internals/routing/index.js +6 -5
  12. package/dist/packages/@ember/-internals/runtime/lib/ext/rsvp.js +3 -2
  13. package/dist/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +6 -5
  14. package/dist/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +4 -3
  15. package/dist/packages/@ember/-internals/runtime/lib/mixins/container_proxy.js +1 -1
  16. package/dist/packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js +2 -1
  17. package/dist/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +4 -3
  18. package/dist/packages/@ember/-internals/string/index.js +1 -1
  19. package/dist/packages/@ember/-internals/utils/index.js +4 -4
  20. package/dist/packages/@ember/-internals/views/index.js +1 -1
  21. package/dist/packages/@ember/-internals/views/lib/compat/fallback-view-registry.js +1 -1
  22. package/dist/packages/@ember/-internals/views/lib/component_lookup.js +1 -1
  23. package/dist/packages/@ember/-internals/views/lib/mixins/action_support.js +5 -3
  24. package/dist/packages/@ember/-internals/views/lib/mixins/child_views_support.js +3 -3
  25. package/dist/packages/@ember/-internals/views/lib/mixins/class_names_support.js +4 -3
  26. package/dist/packages/@ember/-internals/views/lib/mixins/view_support.js +4 -3
  27. package/dist/packages/@ember/-internals/views/lib/system/event_dispatcher.js +6 -12
  28. package/dist/packages/@ember/-internals/views/lib/system/utils.js +3 -2
  29. package/dist/packages/@ember/-internals/views/lib/views/core_view.js +76 -8
  30. package/dist/packages/@ember/-internals/views/lib/views/states.js +4 -3
  31. package/dist/packages/@ember/application/index.js +16 -7
  32. package/dist/packages/@ember/application/instance.js +13 -9
  33. package/dist/packages/@ember/application/namespace.js +7 -6
  34. package/dist/packages/@ember/array/index.js +617 -11
  35. package/dist/packages/@ember/array/make.js +1 -0
  36. package/dist/packages/@ember/array/mutable.js +1 -1
  37. package/dist/packages/@ember/array/proxy.js +8 -5
  38. package/dist/packages/@ember/component/helper.js +4 -4
  39. package/dist/packages/@ember/component/index.js +4 -4
  40. package/dist/packages/@ember/controller/index.js +6 -6
  41. package/dist/packages/@ember/debug/container-debug-adapter.js +5 -4
  42. package/dist/packages/@ember/debug/data-adapter.js +7 -4
  43. package/dist/packages/@ember/debug/index.js +213 -4
  44. package/dist/packages/@ember/debug/lib/assert.js +47 -0
  45. package/dist/packages/@ember/debug/lib/deprecate.js +194 -4
  46. package/dist/packages/@ember/debug/lib/inspect.js +120 -2
  47. package/dist/packages/@ember/debug/lib/warn.js +94 -3
  48. package/dist/packages/@ember/engine/index.js +440 -17
  49. package/dist/packages/@ember/engine/instance.js +175 -11
  50. package/dist/packages/@ember/engine/parent.js +1 -0
  51. package/dist/packages/@ember/helper/index.js +4 -4
  52. package/dist/packages/@ember/instrumentation/index.js +2 -1
  53. package/dist/packages/@ember/modifier/index.js +13 -5
  54. package/dist/packages/@ember/modifier/on.js +15 -0
  55. package/dist/packages/@ember/object/-internals.js +6 -5
  56. package/dist/packages/@ember/object/compat.js +4 -3
  57. package/dist/packages/@ember/object/computed.js +4 -4
  58. package/dist/packages/@ember/object/core.js +861 -14
  59. package/dist/packages/@ember/object/evented.js +4 -4
  60. package/dist/packages/@ember/object/events.js +3 -3
  61. package/dist/packages/@ember/object/index.js +260 -9
  62. package/dist/packages/@ember/object/internals.js +1 -1
  63. package/dist/packages/@ember/object/lib/computed/computed_macros.js +8 -6
  64. package/dist/packages/@ember/object/lib/computed/reduce_computed_macros.js +8 -4
  65. package/dist/packages/@ember/object/mixin.js +6 -5
  66. package/dist/packages/@ember/object/observable.js +103 -9
  67. package/dist/packages/@ember/object/observers.js +3 -3
  68. package/dist/packages/@ember/object/promise-proxy-mixin.js +5 -5
  69. package/dist/packages/@ember/renderer/index.js +4 -4
  70. package/dist/packages/@ember/routing/-internals.js +3 -1
  71. package/dist/packages/@ember/routing/hash-location.js +2 -2
  72. package/dist/packages/@ember/routing/history-location.js +3 -2
  73. package/dist/packages/@ember/routing/index.js +4 -4
  74. package/dist/packages/@ember/routing/lib/dsl.js +2 -1
  75. package/dist/packages/@ember/routing/lib/generate_controller.js +4 -3
  76. package/dist/packages/@ember/routing/lib/router_state.js +26 -1
  77. package/dist/packages/@ember/routing/lib/routing-service.js +107 -9
  78. package/dist/packages/@ember/routing/lib/utils.js +238 -7
  79. package/dist/packages/@ember/routing/none-location.js +3 -2
  80. package/dist/packages/@ember/routing/route.js +1618 -22
  81. package/dist/packages/@ember/routing/router-service.js +638 -12
  82. package/dist/packages/@ember/routing/router.js +1449 -14
  83. package/dist/packages/@ember/runloop/index.js +760 -6
  84. package/dist/packages/@ember/service/index.js +3 -3
  85. package/dist/packages/@ember/template/index.js +4 -4
  86. package/dist/packages/@ember/utils/index.js +2 -1
  87. package/dist/packages/@ember/utils/lib/compare.js +159 -4
  88. package/dist/packages/@ember/utils/lib/is_empty.js +4 -4
  89. package/dist/packages/@ember/utils/lib/type-of.js +110 -1
  90. package/dist/packages/@glimmer/tracking/index.js +3 -3
  91. package/dist/packages/@glimmer/tracking/primitives/cache.js +3 -3
  92. package/dist/packages/ember/barrel.js +28 -13
  93. package/dist/packages/ember/version.js +1 -1
  94. package/dist/packages/ember-testing/lib/adapters/adapter.js +1 -1
  95. package/dist/packages/ember-testing/lib/adapters/qunit.js +2 -1
  96. package/dist/packages/ember-testing/lib/ext/application.js +2 -1
  97. package/dist/packages/ember-testing/lib/ext/rsvp.js +1 -1
  98. package/dist/packages/ember-testing/lib/helpers/and_then.js +2 -1
  99. package/dist/packages/ember-testing/lib/helpers/current_path.js +8 -6
  100. package/dist/packages/ember-testing/lib/helpers/current_route_name.js +8 -6
  101. package/dist/packages/ember-testing/lib/helpers/current_url.js +6 -5
  102. package/dist/packages/ember-testing/lib/helpers/pause_test.js +2 -1
  103. package/dist/packages/ember-testing/lib/helpers/visit.js +4 -3
  104. package/dist/packages/ember-testing/lib/helpers/wait.js +4 -3
  105. package/dist/packages/ember-testing/lib/initializers.js +15 -8
  106. package/dist/packages/ember-testing/lib/setup_for_testing.js +1 -1
  107. package/dist/packages/ember-testing/lib/test/run.js +1 -1
  108. package/dist/packages/router_js/index.js +2 -1
  109. package/dist/packages/shared-chunks/{alias-By_2yu5c.js → alias-Dri0koi2.js} +5 -3
  110. package/dist/packages/shared-chunks/array-3xbmc_4J.js +119 -0
  111. package/dist/packages/shared-chunks/{cache-gDE3bkXq.js → cache-BESCGvbE.js} +667 -1529
  112. package/dist/packages/shared-chunks/{core_view-Cxne2_wu.js → chunk-3SQBS3Y5-Cj4eryg1.js} +1 -88
  113. package/dist/packages/shared-chunks/{index-BXPoca1S.js → index-Llq6dmgX.js} +40 -4660
  114. package/dist/packages/shared-chunks/{is_proxy-Dmis-70B.js → is_proxy-DjvCKvd5.js} +1 -1
  115. package/dist/packages/shared-chunks/{mandatory-setter-1UQhiJOb.js → mandatory-setter-BiXq-dpN.js} +2 -1
  116. package/dist/packages/shared-chunks/{name-z9D9Yibn.js → name-Dx2bGFVv.js} +1 -1
  117. package/dist/packages/shared-chunks/{namespace_search-CBgHTkDh.js → namespace_search-btMaPM-_.js} +2 -2
  118. package/dist/packages/shared-chunks/{property_set-CW4q-uo4.js → property_set-BapAkp3X.js} +5 -4
  119. package/dist/packages/shared-chunks/{registry-DzfcDwii.js → registry-B8WARvkP.js} +3 -2
  120. package/dist/packages/shared-chunks/{router-B-Q1aYBn.js → router-DrLZsJeE.js} +2 -482
  121. package/dist/packages/shared-chunks/{set_properties-DvalyQdu.js → set_properties-BScfxzvI.js} +2 -2
  122. package/dist/packages/shared-chunks/setup-registry-du4pSGZi.js +48 -0
  123. package/dist/packages/shared-chunks/{to-string-D8i3mjEU.js → to-string-B1BmwUkt.js} +1 -1
  124. package/dist/packages/shared-chunks/unrecognized-url-error-zpz-JEoG.js +484 -0
  125. package/docs/data.json +152 -142
  126. package/package.json +4 -7
  127. package/types/stable/@ember/-internals/metal/lib/array.d.ts +1 -2
  128. package/types/stable/@ember/-internals/metal/lib/object-at.d.ts +4 -0
  129. package/types/stable/@ember/-internals/metal/lib/observer.d.ts +2 -1
  130. package/types/stable/@ember/array/index.d.ts +1 -1
  131. package/types/stable/@ember/array/make.d.ts +3 -0
  132. package/types/stable/@ember/debug/index.d.ts +3 -7
  133. package/types/stable/@ember/debug/lib/assert.d.ts +8 -0
  134. package/types/stable/@ember/engine/index.d.ts +1 -1
  135. package/types/stable/@ember/engine/instance.d.ts +2 -2
  136. package/types/stable/@ember/engine/parent.d.ts +3 -0
  137. package/types/stable/@ember/modifier/index.d.ts +1 -3
  138. package/types/stable/@ember/modifier/on.d.ts +5 -0
  139. package/types/stable/@ember/routing/lib/routing-service.d.ts +1 -1
  140. package/types/stable/@ember/routing/route.d.ts +2 -3
  141. package/types/stable/@ember/routing/router-service.d.ts +1 -1
  142. package/types/stable/@ember/routing/router.d.ts +4 -4
  143. package/types/stable/ember/barrel.d.ts +1 -1
  144. package/types/stable/ember/index.d.ts +1 -1
  145. package/types/stable/index.d.ts +5 -0
  146. package/dist/packages/shared-chunks/index-DTxy4Zgx.js +0 -641
  147. package/dist/packages/shared-chunks/index-PYiGj1jp.js +0 -2071
@@ -1,4 +1,4 @@
1
- import { e as isObject } from './mandatory-setter-1UQhiJOb.js';
1
+ import { e as isObject } from './mandatory-setter-BiXq-dpN.js';
2
2
 
3
3
  const PROXIES = new WeakSet();
4
4
  function isProxy(value) {
@@ -1,5 +1,6 @@
1
1
  import { isDevelopingApp } from '@embroider/macros';
2
- import { a as assert } from './index-DTxy4Zgx.js';
2
+ import '../@ember/debug/index.js';
3
+ import { assert } from '../@ember/debug/lib/assert.js';
3
4
 
4
5
  /**
5
6
  Strongly hint runtimes to intern the provided string.
@@ -1,4 +1,4 @@
1
- import { e as isObject } from './mandatory-setter-1UQhiJOb.js';
1
+ import { e as isObject } from './mandatory-setter-BiXq-dpN.js';
2
2
 
3
3
  const NAMES = new WeakMap();
4
4
  function setName(obj, name) {
@@ -1,7 +1,7 @@
1
1
  import { c as context } from './env-BJLX2Arx.js';
2
- import './mandatory-setter-1UQhiJOb.js';
2
+ import './mandatory-setter-BiXq-dpN.js';
3
3
  import '@embroider/macros';
4
- import { g as getName, s as setName } from './name-z9D9Yibn.js';
4
+ import { g as getName, s as setName } from './name-Dx2bGFVv.js';
5
5
 
6
6
  const hasOwnProperty = Object.prototype.hasOwnProperty;
7
7
  let searchDisabled = false;
@@ -1,8 +1,9 @@
1
- import { l as lookupDescriptor, h as setWithMandatorySetter } from './mandatory-setter-1UQhiJOb.js';
1
+ import { l as lookupDescriptor, h as setWithMandatorySetter } from './mandatory-setter-BiXq-dpN.js';
2
2
  import { isDevelopingApp } from '@embroider/macros';
3
- import { t as toString } from './to-string-D8i3mjEU.js';
4
- import { a as assert } from './index-DTxy4Zgx.js';
5
- import { h as isPath, k as COMPUTED_SETTERS, l as getPossibleMandatoryProxyValue, n as notifyPropertyChange, m as _getPath } from './cache-gDE3bkXq.js';
3
+ import { t as toString } from './to-string-B1BmwUkt.js';
4
+ import '../@ember/debug/index.js';
5
+ import { q as isPath, r as COMPUTED_SETTERS, u as getPossibleMandatoryProxyValue, n as notifyPropertyChange, _ as _getPath } from './cache-BESCGvbE.js';
6
+ import { assert } from '../@ember/debug/lib/assert.js';
6
7
 
7
8
  /**
8
9
  @module @ember/object
@@ -1,8 +1,9 @@
1
- import { i as intern } from './mandatory-setter-1UQhiJOb.js';
1
+ import { i as intern } from './mandatory-setter-BiXq-dpN.js';
2
2
  import { isDevelopingApp } from '@embroider/macros';
3
3
  import { m as makeDictionary } from './dictionary-gc5gpyOG.js';
4
- import { a as assert } from './index-DTxy4Zgx.js';
4
+ import '../@ember/debug/index.js';
5
5
  import { setOwner } from '../@ember/-internals/owner/index.js';
6
+ import { assert } from '../@ember/debug/lib/assert.js';
6
7
 
7
8
  // doesn't work with isolatedModules
8
9
  let leakTracking;
@@ -1,470 +1,6 @@
1
1
  import RouteRecognizer from '../route-recognizer/index.js';
2
2
  import { P as Promise$1 } from './rsvp-DaQAFb0W.js';
3
- import { isDevelopingApp } from '@embroider/macros';
4
-
5
- function buildTransitionAborted() {
6
- let error = new Error('TransitionAborted');
7
- error.name = 'TransitionAborted';
8
- error.code = 'TRANSITION_ABORTED';
9
- return error;
10
- }
11
- function isTransitionAborted(maybeError) {
12
- return typeof maybeError === 'object' && maybeError !== null && maybeError.code === 'TRANSITION_ABORTED';
13
- }
14
- function isAbortable(maybeAbortable) {
15
- return typeof maybeAbortable === 'object' && maybeAbortable !== null && typeof maybeAbortable.isAborted === 'boolean';
16
- }
17
- function throwIfAborted(maybe) {
18
- if (isAbortable(maybe) && maybe.isAborted) {
19
- throw buildTransitionAborted();
20
- }
21
- }
22
-
23
- const slice = Array.prototype.slice;
24
- const hasOwnProperty = Object.prototype.hasOwnProperty;
25
- /**
26
- Determines if an object is Promise by checking if it is "thenable".
27
- **/
28
- function isPromise(p) {
29
- return p !== null && typeof p === 'object' && typeof p.then === 'function';
30
- }
31
- function merge(hash, other) {
32
- for (let prop in other) {
33
- if (hasOwnProperty.call(other, prop)) {
34
- hash[prop] = other[prop];
35
- }
36
- }
37
- }
38
- /**
39
- @private
40
-
41
- Extracts query params from the end of an array
42
- **/
43
- function extractQueryParams(array) {
44
- let len = array && array.length,
45
- head,
46
- queryParams;
47
- if (len && len > 0) {
48
- let obj = array[len - 1];
49
- if (isQueryParamsContainer(obj)) {
50
- queryParams = obj.queryParams;
51
- head = slice.call(array, 0, len - 1);
52
- return [head, queryParams];
53
- }
54
- }
55
- // SAFETY: We confirmed that the last item isn't a QP container
56
- return [array, null];
57
- }
58
- // TODO: Actually check that Dict is QueryParams
59
- function isQueryParamsContainer(obj) {
60
- if (obj && typeof obj === 'object') {
61
- let cast = obj;
62
- return 'queryParams' in cast && Object.keys(cast.queryParams).every(k => typeof k === 'string');
63
- }
64
- return false;
65
- }
66
- /**
67
- @private
68
-
69
- Coerces query param properties and array elements into strings.
70
- **/
71
- function coerceQueryParamsToString(queryParams) {
72
- for (let key in queryParams) {
73
- let val = queryParams[key];
74
- if (typeof val === 'number') {
75
- queryParams[key] = '' + val;
76
- } else if (Array.isArray(val)) {
77
- for (let i = 0, l = val.length; i < l; i++) {
78
- val[i] = '' + val[i];
79
- }
80
- }
81
- }
82
- }
83
- /**
84
- @private
85
- */
86
- function log(router, ...args) {
87
- if (!router.log) {
88
- return;
89
- }
90
- if (args.length === 2) {
91
- let [sequence, msg] = args;
92
- router.log('Transition #' + sequence + ': ' + msg);
93
- } else {
94
- let [msg] = args;
95
- router.log(msg);
96
- }
97
- }
98
- function isParam(object) {
99
- return typeof object === 'string' || object instanceof String || typeof object === 'number' || object instanceof Number;
100
- }
101
- function forEach(array, callback) {
102
- for (let i = 0, l = array.length; i < l && callback(array[i]) !== false; i++) {
103
- // empty intentionally
104
- }
105
- }
106
- function getChangelist(oldObject, newObject) {
107
- let key;
108
- let results = {
109
- all: {},
110
- changed: {},
111
- removed: {}
112
- };
113
- merge(results.all, newObject);
114
- let didChange = false;
115
- coerceQueryParamsToString(oldObject);
116
- coerceQueryParamsToString(newObject);
117
- // Calculate removals
118
- for (key in oldObject) {
119
- if (hasOwnProperty.call(oldObject, key)) {
120
- if (!hasOwnProperty.call(newObject, key)) {
121
- didChange = true;
122
- results.removed[key] = oldObject[key];
123
- }
124
- }
125
- }
126
- // Calculate changes
127
- for (key in newObject) {
128
- if (hasOwnProperty.call(newObject, key)) {
129
- let oldElement = oldObject[key];
130
- let newElement = newObject[key];
131
- if (isArray(oldElement) && isArray(newElement)) {
132
- if (oldElement.length !== newElement.length) {
133
- results.changed[key] = newObject[key];
134
- didChange = true;
135
- } else {
136
- for (let i = 0, l = oldElement.length; i < l; i++) {
137
- if (oldElement[i] !== newElement[i]) {
138
- results.changed[key] = newObject[key];
139
- didChange = true;
140
- }
141
- }
142
- }
143
- } else if (oldObject[key] !== newObject[key]) {
144
- results.changed[key] = newObject[key];
145
- didChange = true;
146
- }
147
- }
148
- }
149
- return didChange ? results : undefined;
150
- }
151
- function isArray(obj) {
152
- return Array.isArray(obj);
153
- }
154
- function promiseLabel(label) {
155
- return 'Router: ' + label;
156
- }
157
-
158
- const STATE_SYMBOL = `__STATE__-2619860001345920-3322w3`;
159
- const PARAMS_SYMBOL = `__PARAMS__-261986232992830203-23323`;
160
- const QUERY_PARAMS_SYMBOL = `__QPS__-2619863929824844-32323`;
161
- /**
162
- A Transition is a thenable (a promise-like object) that represents
163
- an attempt to transition to another route. It can be aborted, either
164
- explicitly via `abort` or by attempting another transition while a
165
- previous one is still underway. An aborted transition can also
166
- be `retry()`d later.
167
-
168
- @class Transition
169
- @constructor
170
- @param {Object} router
171
- @param {Object} intent
172
- @param {Object} state
173
- @param {Object} error
174
- @private
175
- */
176
- class Transition {
177
- constructor(router, intent, state, error = undefined, previousTransition = undefined) {
178
- this.from = null;
179
- this.to = undefined;
180
- this.isAborted = false;
181
- this.isActive = true;
182
- this.urlMethod = 'update';
183
- this.resolveIndex = 0;
184
- this.queryParamsOnly = false;
185
- this.isTransition = true;
186
- this.isCausedByAbortingTransition = false;
187
- this.isCausedByInitialTransition = false;
188
- this.isCausedByAbortingReplaceTransition = false;
189
- this._visibleQueryParams = {};
190
- this.isIntermediate = false;
191
- this[STATE_SYMBOL] = state || router.state;
192
- this.intent = intent;
193
- this.router = router;
194
- this.data = intent && intent.data || {};
195
- this.resolvedModels = {};
196
- this[QUERY_PARAMS_SYMBOL] = {};
197
- this.promise = undefined;
198
- this.error = undefined;
199
- this[PARAMS_SYMBOL] = {};
200
- this.routeInfos = [];
201
- this.targetName = undefined;
202
- this.pivotHandler = undefined;
203
- this.sequence = -1;
204
- if (isDevelopingApp()) {
205
- let error = new Error(`Transition creation stack`);
206
- this.debugCreationStack = () => error.stack;
207
- // not aborted yet, will be replaced when `this.isAborted` is set
208
- this.debugAbortStack = () => undefined;
209
- this.debugPreviousTransition = previousTransition;
210
- }
211
- if (error) {
212
- this.promise = Promise$1.reject(error);
213
- this.error = error;
214
- return;
215
- }
216
- // if you're doing multiple redirects, need the new transition to know if it
217
- // is actually part of the first transition or not. Any further redirects
218
- // in the initial transition also need to know if they are part of the
219
- // initial transition
220
- this.isCausedByAbortingTransition = !!previousTransition;
221
- this.isCausedByInitialTransition = !!previousTransition && (previousTransition.isCausedByInitialTransition || previousTransition.sequence === 0);
222
- // Every transition in the chain is a replace
223
- this.isCausedByAbortingReplaceTransition = !!previousTransition && previousTransition.urlMethod === 'replace' && (!previousTransition.isCausedByAbortingTransition || previousTransition.isCausedByAbortingReplaceTransition);
224
- if (state) {
225
- this[PARAMS_SYMBOL] = state.params;
226
- this[QUERY_PARAMS_SYMBOL] = state.queryParams;
227
- this.routeInfos = state.routeInfos;
228
- let len = state.routeInfos.length;
229
- if (len) {
230
- this.targetName = state.routeInfos[len - 1].name;
231
- }
232
- for (let i = 0; i < len; ++i) {
233
- let handlerInfo = state.routeInfos[i];
234
- // TODO: this all seems hacky
235
- if (!handlerInfo.isResolved) {
236
- break;
237
- }
238
- this.pivotHandler = handlerInfo.route;
239
- }
240
- this.sequence = router.currentSequence++;
241
- this.promise = state.resolve(this).catch(result => {
242
- let error = this.router.transitionDidError(result, this);
243
- throw error;
244
- }, promiseLabel('Handle Abort'));
245
- } else {
246
- this.promise = Promise$1.resolve(this[STATE_SYMBOL]);
247
- this[PARAMS_SYMBOL] = {};
248
- }
249
- }
250
- /**
251
- The Transition's internal promise. Calling `.then` on this property
252
- is that same as calling `.then` on the Transition object itself, but
253
- this property is exposed for when you want to pass around a
254
- Transition's promise, but not the Transition object itself, since
255
- Transition object can be externally `abort`ed, while the promise
256
- cannot.
257
- @property promise
258
- @type {Object}
259
- @public
260
- */
261
- /**
262
- Custom state can be stored on a Transition's `data` object.
263
- This can be useful for decorating a Transition within an earlier
264
- hook and shared with a later hook. Properties set on `data` will
265
- be copied to new transitions generated by calling `retry` on this
266
- transition.
267
- @property data
268
- @type {Object}
269
- @public
270
- */
271
- /**
272
- A standard promise hook that resolves if the transition
273
- succeeds and rejects if it fails/redirects/aborts.
274
- Forwards to the internal `promise` property which you can
275
- use in situations where you want to pass around a thenable,
276
- but not the Transition itself.
277
- @method then
278
- @param {Function} onFulfilled
279
- @param {Function} onRejected
280
- @param {String} label optional string for labeling the promise.
281
- Useful for tooling.
282
- @return {Promise}
283
- @public
284
- */
285
- then(onFulfilled, onRejected, label) {
286
- return this.promise.then(onFulfilled, onRejected, label);
287
- }
288
- /**
289
- Forwards to the internal `promise` property which you can
290
- use in situations where you want to pass around a thennable,
291
- but not the Transition itself.
292
- @method catch
293
- @param {Function} onRejection
294
- @param {String} label optional string for labeling the promise.
295
- Useful for tooling.
296
- @return {Promise}
297
- @public
298
- */
299
- catch(onRejection, label) {
300
- return this.promise.catch(onRejection, label);
301
- }
302
- /**
303
- Forwards to the internal `promise` property which you can
304
- use in situations where you want to pass around a thenable,
305
- but not the Transition itself.
306
- @method finally
307
- @param {Function} callback
308
- @param {String} label optional string for labeling the promise.
309
- Useful for tooling.
310
- @return {Promise}
311
- @public
312
- */
313
- finally(callback, label) {
314
- return this.promise.finally(callback, label);
315
- }
316
- /**
317
- Aborts the Transition. Note you can also implicitly abort a transition
318
- by initiating another transition while a previous one is underway.
319
- @method abort
320
- @return {Transition} this transition
321
- @public
322
- */
323
- abort() {
324
- this.rollback();
325
- let transition = new Transition(this.router, undefined, undefined, undefined);
326
- transition.to = this.from;
327
- transition.from = this.from;
328
- transition.isAborted = true;
329
- this.router.routeWillChange(transition);
330
- this.router.routeDidChange(transition);
331
- return this;
332
- }
333
- rollback() {
334
- if (!this.isAborted) {
335
- log(this.router, this.sequence, this.targetName + ': transition was aborted');
336
- if (isDevelopingApp()) {
337
- let error = new Error(`Transition aborted stack`);
338
- this.debugAbortStack = () => error.stack;
339
- }
340
- if (this.intent !== undefined && this.intent !== null) {
341
- this.intent.preTransitionState = this.router.state;
342
- }
343
- this.isAborted = true;
344
- this.isActive = false;
345
- this.router.activeTransition = undefined;
346
- }
347
- }
348
- redirect(newTransition) {
349
- this.rollback();
350
- this.router.routeWillChange(newTransition);
351
- }
352
- /**
353
- Retries a previously-aborted transition (making sure to abort the
354
- transition if it's still active). Returns a new transition that
355
- represents the new attempt to transition.
356
- @method retry
357
- @return {Transition} new transition
358
- @public
359
- */
360
- retry() {
361
- // TODO: add tests for merged state retry()s
362
- this.abort();
363
- let newTransition = this.router.transitionByIntent(this.intent, false);
364
- // inheriting a `null` urlMethod is not valid
365
- // the urlMethod is only set to `null` when
366
- // the transition is initiated *after* the url
367
- // has been updated (i.e. `router.handleURL`)
368
- //
369
- // in that scenario, the url method cannot be
370
- // inherited for a new transition because then
371
- // the url would not update even though it should
372
- if (this.urlMethod !== null) {
373
- newTransition.method(this.urlMethod);
374
- }
375
- return newTransition;
376
- }
377
- /**
378
- Sets the URL-changing method to be employed at the end of a
379
- successful transition. By default, a new Transition will just
380
- use `updateURL`, but passing 'replace' to this method will
381
- cause the URL to update using 'replaceWith' instead. Omitting
382
- a parameter will disable the URL change, allowing for transitions
383
- that don't update the URL at completion (this is also used for
384
- handleURL, since the URL has already changed before the
385
- transition took place).
386
- @method method
387
- @param {String} method the type of URL-changing method to use
388
- at the end of a transition. Accepted values are 'replace',
389
- falsy values, or any other non-falsy value (which is
390
- interpreted as an updateURL transition).
391
- @return {Transition} this transition
392
- @public
393
- */
394
- method(method) {
395
- this.urlMethod = method;
396
- return this;
397
- }
398
- // Alias 'trigger' as 'send'
399
- send(ignoreFailure = false, _name, err, transition, handler) {
400
- this.trigger(ignoreFailure, _name, err, transition, handler);
401
- }
402
- /**
403
- Fires an event on the current list of resolved/resolving
404
- handlers within this transition. Useful for firing events
405
- on route hierarchies that haven't fully been entered yet.
406
- Note: This method is also aliased as `send`
407
- @method trigger
408
- @param {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error
409
- @param {String} name the name of the event to fire
410
- @public
411
- */
412
- trigger(ignoreFailure = false, name, ...args) {
413
- // TODO: Deprecate the current signature
414
- if (typeof ignoreFailure === 'string') {
415
- name = ignoreFailure;
416
- ignoreFailure = false;
417
- }
418
- this.router.triggerEvent(this[STATE_SYMBOL].routeInfos.slice(0, this.resolveIndex + 1), ignoreFailure, name, args);
419
- }
420
- /**
421
- Transitions are aborted and their promises rejected
422
- when redirects occur; this method returns a promise
423
- that will follow any redirects that occur and fulfill
424
- with the value fulfilled by any redirecting transitions
425
- that occur.
426
- @method followRedirects
427
- @return {Promise} a promise that fulfills with the same
428
- value that the final redirecting transition fulfills with
429
- @public
430
- */
431
- followRedirects() {
432
- let router = this.router;
433
- return this.promise.catch(function (reason) {
434
- if (router.activeTransition) {
435
- return router.activeTransition.followRedirects();
436
- }
437
- return Promise$1.reject(reason);
438
- });
439
- }
440
- toString() {
441
- return 'Transition (sequence ' + this.sequence + ')';
442
- }
443
- /**
444
- @private
445
- */
446
- log(message) {
447
- log(this.router, this.sequence, message);
448
- }
449
- }
450
- /**
451
- @private
452
-
453
- Logs and returns an instance of TransitionAborted.
454
- */
455
- function logAbort(transition) {
456
- log(transition.router, transition.sequence, 'detected abort.');
457
- return buildTransitionAborted();
458
- }
459
- function isTransition(obj) {
460
- return typeof obj === 'object' && obj instanceof Transition && obj.isTransition;
461
- }
462
- function prepareResult(obj) {
463
- if (isTransition(obj)) {
464
- return null;
465
- }
466
- return obj;
467
- }
3
+ import { t as throwIfAborted, P as PARAMS_SYMBOL, i as isTransition, p as prepareResult, a as isPromise, Q as QUERY_PARAMS_SYMBOL, m as merge, b as isParam, f as forEach, c as promiseLabel, U as UnrecognizedURLError, T as Transition, S as STATE_SYMBOL, g as getChangelist, d as log, l as logAbort, e as isTransitionAborted, h as extractQueryParams } from './unrecognized-url-error-zpz-JEoG.js';
468
4
 
469
5
  let ROUTE_INFOS = new WeakMap();
470
6
  function toReadOnlyRouteInfo(routeInfos, queryParams = {}, options = {
@@ -1111,22 +647,6 @@ class NamedTransitionIntent extends TransitionIntent {
1111
647
  }
1112
648
  }
1113
649
 
1114
- const UnrecognizedURLError = function () {
1115
- UnrecognizedURLError.prototype = Object.create(Error.prototype);
1116
- UnrecognizedURLError.prototype.constructor = UnrecognizedURLError;
1117
- function UnrecognizedURLError(message) {
1118
- let error = Error.call(this, message);
1119
- this.name = 'UnrecognizedURLError';
1120
- this.message = message || 'UnrecognizedURL';
1121
- if (Error.captureStackTrace) {
1122
- Error.captureStackTrace(this, UnrecognizedURLError);
1123
- } else {
1124
- this.stack = error.stack;
1125
- }
1126
- }
1127
- return UnrecognizedURLError;
1128
- }();
1129
-
1130
650
  class URLTransitionIntent extends TransitionIntent {
1131
651
  constructor(router, url, data) {
1132
652
  super(router, data);
@@ -1942,4 +1462,4 @@ function paramsEqual(params, otherParams) {
1942
1462
  return true;
1943
1463
  }
1944
1464
 
1945
- export { InternalRouteInfo as I, PARAMS_SYMBOL as P, QUERY_PARAMS_SYMBOL as Q, Router as R, STATE_SYMBOL as S, Transition as T, TransitionState as a, TransitionError as b, logAbort as l };
1465
+ export { InternalRouteInfo as I, Router as R, TransitionState as T, TransitionError as a };
@@ -1,5 +1,5 @@
1
- import { g as get, a2 as changeProperties } from './cache-gDE3bkXq.js';
2
- import { s as set } from './property_set-CW4q-uo4.js';
1
+ import { g as get, T as changeProperties } from './cache-BESCGvbE.js';
2
+ import { s as set } from './property_set-BapAkp3X.js';
3
3
 
4
4
  /**
5
5
  @module @ember/object
@@ -0,0 +1,48 @@
1
+ import { p as privatize } from './registry-B8WARvkP.js';
2
+ import { getOwner } from '../@ember/-internals/owner/index.js';
3
+ import '../@ember/debug/index.js';
4
+ import { R as RootTemplate, b as Renderer, O as OutletView, c as OutletTemplate, I as Input, L as LinkTo, T as Textarea } from './index-Llq6dmgX.js';
5
+ import { clientBuilder, rehydrationBuilder } from '../@glimmer/runtime/index.js';
6
+ import { serializeBuilder } from '../@glimmer/node/index.js';
7
+ import { isDevelopingApp } from '@embroider/macros';
8
+ import { assert } from '../@ember/debug/lib/assert.js';
9
+
10
+ function setupApplicationRegistry(registry) {
11
+ // because we are using injections we can't use instantiate false
12
+ // we need to use bind() to copy the function so factory for
13
+ // association won't leak
14
+ registry.register('service:-dom-builder', {
15
+ // Additionally, we *must* constrain this to require `props` on create, else
16
+ // we *know* it cannot have an owner.
17
+ create(props) {
18
+ let owner = getOwner(props);
19
+ (isDevelopingApp() && !(owner) && assert('DomBuilderService is unexpectedly missing an owner', owner));
20
+ let env = owner.lookup('-environment:main');
21
+ switch (env._renderMode) {
22
+ case 'serialize':
23
+ return serializeBuilder.bind(null);
24
+ case 'rehydrate':
25
+ return rehydrationBuilder.bind(null);
26
+ default:
27
+ return clientBuilder.bind(null);
28
+ }
29
+ }
30
+ });
31
+ registry.register(privatize`template:-root`, RootTemplate);
32
+ registry.register('renderer:-dom', Renderer);
33
+ }
34
+ function setupEngineRegistry(registry) {
35
+ registry.optionsForType('template', {
36
+ instantiate: false
37
+ });
38
+ registry.register('view:-outlet', OutletView);
39
+ registry.register('template:-outlet', OutletTemplate);
40
+ registry.optionsForType('helper', {
41
+ instantiate: false
42
+ });
43
+ registry.register('component:input', Input);
44
+ registry.register('component:link-to', LinkTo);
45
+ registry.register('component:textarea', Textarea);
46
+ }
47
+
48
+ export { setupApplicationRegistry as a, setupEngineRegistry as s };
@@ -1,4 +1,4 @@
1
- import { G as GUID_KEY, i as intern } from './mandatory-setter-1UQhiJOb.js';
1
+ import { G as GUID_KEY, i as intern } from './mandatory-setter-BiXq-dpN.js';
2
2
  import { isDevelopingApp } from '@embroider/macros';
3
3
 
4
4
  const GENERATED_SYMBOLS = [];