@absolutejs/absolute 0.19.0-beta.1083 → 0.19.0-beta.1085
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.
- package/dist/angular/browser.js +18 -18
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/components/defer-slot-templates.directive.js +2 -2
- package/dist/angular/components/defer-slot.component.js +3 -3
- package/dist/angular/components/image.component.js +3 -3
- package/dist/angular/components/stream-slot.component.js +3 -3
- package/dist/angular/index.js +43 -43
- package/dist/angular/server.js +31 -31
- package/dist/build.js +105 -54
- package/dist/build.js.map +4 -4
- package/dist/cli/config/server.js +11 -11
- package/dist/client/index.js +13 -13
- package/dist/index.js +130 -79
- package/dist/index.js.map +4 -4
- package/dist/islands/index.js +14 -14
- package/dist/react/browser.js +3 -3
- package/dist/react/components/browser/index.js +5 -5
- package/dist/react/components/index.js +7 -7
- package/dist/react/hooks/index.js +2 -2
- package/dist/react/index.js +30 -30
- package/dist/react/jsxDevRuntimeCompat.js +1 -1
- package/dist/react/router/browser.js +2 -2
- package/dist/react/router/index.js +2 -2
- package/dist/react/server.js +13 -13
- package/dist/src/build/chainInlineSourcemaps.d.ts +1 -0
- package/dist/src/core/build.d.ts +5 -0
- package/dist/src/utils/loadConfig.d.ts +1 -0
- package/dist/svelte/index.js +26 -26
- package/dist/svelte/router/page.js +1 -1
- package/dist/svelte/server.js +13 -13
- package/dist/types/build.d.ts +1 -0
- package/dist/vue/browser.js +3 -3
- package/dist/vue/components/Image.js +1 -1
- package/dist/vue/components/index.js +5 -5
- package/dist/vue/index.js +36 -36
- package/dist/vue/server.js +13 -13
- package/package.json +1 -1
- package/dist/.absolutejs/generated/angular/indexes/angular-example.1g23yr9r.js +0 -167
- package/dist/.absolutejs/generated/react/indexes/ReactExample.e6kzvjqy.js +0 -3
- package/dist/.absolutejs/generated/svelte/client/pages/SvelteExample.5pq2wmw6.js +0 -1
- package/dist/.absolutejs/generated/svelte/indexes/pages/SvelteExample.9zcw5vtg.js +0 -1
- package/dist/.absolutejs/generated/vue/client/pages/VueExample.q47m56s4.js +0 -1
- package/dist/.absolutejs/generated/vue/indexes/VueExample.6bqszcxv.js +0 -1
- package/dist/_prerendered/angular.html +0 -45
- package/dist/_prerendered/angular.meta +0 -1
- package/dist/_prerendered/html.html +0 -70
- package/dist/_prerendered/html.meta +0 -1
- package/dist/_prerendered/htmx.html +0 -239
- package/dist/_prerendered/htmx.meta +0 -1
- package/dist/_prerendered/index.html +0 -70
- package/dist/_prerendered/index.meta +0 -1
- package/dist/_prerendered/react.html +0 -1
- package/dist/_prerendered/react.meta +0 -1
- package/dist/_prerendered/vue.html +0 -41
- package/dist/_prerendered/vue.meta +0 -1
- package/dist/angular/example/angular/pages/angular-example.djr1v9hj.js +0 -373
- package/dist/angular/vendor/angular_common.js +0 -310
- package/dist/angular/vendor/angular_common_http.js +0 -129
- package/dist/angular/vendor/angular_core.js +0 -1177
- package/dist/angular/vendor/angular_core_primitives_di.js +0 -36
- package/dist/angular/vendor/angular_core_primitives_signals.js +0 -132
- package/dist/angular/vendor/angular_platform-browser.js +0 -117
- package/dist/angular/vendor/angular_router.js +0 -6410
- package/dist/angular/vendor/chunk-2c9evnn0.js +0 -4764
- package/dist/angular/vendor/chunk-3evcs0sk.js +0 -2567
- package/dist/angular/vendor/chunk-5h3qyvpj.js +0 -729
- package/dist/angular/vendor/chunk-hgg0w52m.js +0 -62
- package/dist/angular/vendor/chunk-n6rt7w2y.js +0 -23
- package/dist/angular/vendor/chunk-t4tc7c8b.js +0 -28013
- package/dist/angular/vendor/chunk-vqd7j0kb.js +0 -1786
- package/dist/angular/vendor/chunk-yqjkhk8j.js +0 -145
- package/dist/angular/vendor/server/angular_common.js +0 -311
- package/dist/angular/vendor/server/angular_common_http.js +0 -130
- package/dist/angular/vendor/server/angular_core.js +0 -1178
- package/dist/angular/vendor/server/angular_core_primitives_di.js +0 -37
- package/dist/angular/vendor/server/angular_core_primitives_signals.js +0 -133
- package/dist/angular/vendor/server/angular_platform-browser.js +0 -118
- package/dist/angular/vendor/server/angular_platform-server.js +0 -59
- package/dist/angular/vendor/server/angular_router.js +0 -261
- package/dist/angular/vendor/server/angular_ssr.js +0 -11669
- package/dist/angular/vendor/server/chunk-2akxms5e.js +0 -2566
- package/dist/angular/vendor/server/chunk-659a9c3p.js +0 -6218
- package/dist/angular/vendor/server/chunk-8eecnjd1.js +0 -16686
- package/dist/angular/vendor/server/chunk-9jz2apvp.js +0 -743
- package/dist/angular/vendor/server/chunk-dhs2bg35.js +0 -48
- package/dist/angular/vendor/server/chunk-hs2gc8sr.js +0 -1787
- package/dist/angular/vendor/server/chunk-k46n34mb.js +0 -63
- package/dist/angular/vendor/server/chunk-p2fdvyh1.js +0 -4767
- package/dist/angular/vendor/server/chunk-r0w9r4bg.js +0 -730
- package/dist/angular/vendor/server/chunk-vthxj7kd.js +0 -146
- package/dist/angular/vendor/server/chunk-xahr7f2f.js +0 -35534
- package/dist/assets/css/tailwind.generated.css +0 -218
- package/dist/assets/css/vue-example-compiled.abzaxheq.css +0 -32
- package/dist/assets/ico/favicon.ico +0 -0
- package/dist/assets/png/absolutejs-temp.png +0 -0
- package/dist/assets/svg/HTML5_Badge.svg +0 -7
- package/dist/assets/svg/angular.svg +0 -18
- package/dist/assets/svg/htmx-logo-black.svg +0 -9
- package/dist/assets/svg/htmx-logo-white.svg +0 -9
- package/dist/assets/svg/react.svg +0 -1
- package/dist/assets/svg/svelte-logo.svg +0 -1
- package/dist/assets/svg/vue-logo.svg +0 -4
- package/dist/chunk-7pp6gkg8.js +0 -2
- package/dist/chunk-ek2qyx2c.js +0 -11
- package/dist/chunk-ysr5ycdt.js +0 -2
- package/dist/client.tsx +0 -15
- package/dist/example/html/scripts/typescript-example.fqn9zkdh.js +0 -1
- package/dist/html/pages/HTMLExample.html +0 -70
- package/dist/htmx/htmx.min.js +0 -1
- package/dist/htmx/pages/HTMXExample.html +0 -239
- package/dist/htmx.min.js +0 -1
- package/dist/indexes/angular-example.xsx88ph0.css +0 -227
- package/dist/indexes/html-example.s3banzdc.css +0 -221
- package/dist/indexes/htmx-example.5vgssc3f.css +0 -221
- package/dist/indexes/react-example.bz1k8xa2.css +0 -245
- package/dist/indexes/svelte-example.vy3015es.css +0 -221
- package/dist/indexes/vue-example.q4vf2wtq.css +0 -228
- package/dist/manifest.json +0 -26
- package/dist/nested/dynamic-module.txt +0 -1
- package/dist/package-asset.txt +0 -1
- package/dist/react/vendor/chunk-2kh60w9b.js +0 -33
- package/dist/react/vendor/chunk-9g12fvrw.js +0 -236
- package/dist/react/vendor/chunk-rejbymp5.js +0 -837
- package/dist/react/vendor/chunk-wwy122hz.js +0 -200
- package/dist/react/vendor/react-dom.js +0 -44
- package/dist/react/vendor/react-dom_client.js +0 -15864
- package/dist/react/vendor/react-refresh_runtime.js +0 -304
- package/dist/react/vendor/react.js +0 -103
- package/dist/react/vendor/react_jsx-dev-runtime.js +0 -17
- package/dist/react/vendor/react_jsx-runtime.js +0 -22
- package/dist/robots.txt +0 -2
- package/dist/runtime/blob.txt +0 -1
- package/dist/runtime/dir-join.txt +0 -1
- package/dist/runtime/nested/binary.bin +0 -1
- package/dist/runtime/nested/readfile.txt +0 -1
- package/dist/runtime/template.html +0 -1
- package/dist/server.js +0 -92156
- package/dist/sitemap.xml +0 -48
- package/dist/svelte/server/pages/SvelteExample.fxs20w1b.js +0 -290
- package/dist/svelte/vendor/chunk-5qdxn1p3.js +0 -4586
- package/dist/svelte/vendor/chunk-8qdfbbez.js +0 -12
- package/dist/svelte/vendor/chunk-r2jyyfjt.js +0 -4495
- package/dist/svelte/vendor/svelte.js +0 -49
- package/dist/svelte/vendor/svelte_internal.js +0 -2
- package/dist/svelte/vendor/svelte_internal_client.js +0 -395
- package/dist/svelte/vendor/svelte_internal_disclose-version.js +0 -7
- package/dist/svelte/vendor/svelte_internal_flags_async.js +0 -6
- package/dist/svelte/vendor/svelte_internal_flags_legacy.js +0 -6
- package/dist/svelte/vendor/svelte_store.js +0 -99
- package/dist/vue/server/pages/VueExample.fyhmna2p.css +0 -32
- package/dist/vue/server/pages/VueExample.fyhmna2p.js +0 -75
- package/dist/vue/vendor/vue.js +0 -11011
|
@@ -1,4767 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
BrowserPlatformLocation,
|
|
4
|
-
DomAdapter,
|
|
5
|
-
LOCATION_INITIALIZED,
|
|
6
|
-
PlatformLocation,
|
|
7
|
-
XhrFactory,
|
|
8
|
-
getDOM,
|
|
9
|
-
parseCookieValue,
|
|
10
|
-
setRootDomAdapter
|
|
11
|
-
} from "./chunk-vthxj7kd.js";
|
|
12
|
-
import {
|
|
13
|
-
ApplicationRef,
|
|
14
|
-
Attribute,
|
|
15
|
-
ChangeDetectorRef,
|
|
16
|
-
DEFAULT_CURRENCY_CODE,
|
|
17
|
-
DOCUMENT,
|
|
18
|
-
DestroyRef,
|
|
19
|
-
Directive,
|
|
20
|
-
ElementRef,
|
|
21
|
-
Host,
|
|
22
|
-
IMAGE_CONFIG,
|
|
23
|
-
IMAGE_CONFIG_DEFAULTS,
|
|
24
|
-
INTERNAL_APPLICATION_ERROR_HANDLER,
|
|
25
|
-
Inject,
|
|
26
|
-
Injectable,
|
|
27
|
-
InjectionToken,
|
|
28
|
-
Injector,
|
|
29
|
-
Input,
|
|
30
|
-
IterableDiffers,
|
|
31
|
-
KeyValueDiffers,
|
|
32
|
-
LOCALE_ID,
|
|
33
|
-
LocaleDataIndex,
|
|
34
|
-
NgModule,
|
|
35
|
-
NgModuleRef$1,
|
|
36
|
-
NgZone,
|
|
37
|
-
Optional,
|
|
38
|
-
Pipe,
|
|
39
|
-
Renderer2,
|
|
40
|
-
RendererStyleFlags2,
|
|
41
|
-
RuntimeError,
|
|
42
|
-
TemplateRef,
|
|
43
|
-
Version,
|
|
44
|
-
ViewContainerRef,
|
|
45
|
-
booleanAttribute,
|
|
46
|
-
createNgModule,
|
|
47
|
-
findLocaleData,
|
|
48
|
-
formatRuntimeError,
|
|
49
|
-
getLocaleCurrencyCode,
|
|
50
|
-
getLocalePluralCase,
|
|
51
|
-
inject,
|
|
52
|
-
isPromise,
|
|
53
|
-
isSignal,
|
|
54
|
-
isSubscribable,
|
|
55
|
-
numberAttribute,
|
|
56
|
-
performanceMarkFeature,
|
|
57
|
-
registerLocaleData,
|
|
58
|
-
require_cjs,
|
|
59
|
-
setClassMetadata,
|
|
60
|
-
stringify,
|
|
61
|
-
untracked,
|
|
62
|
-
unwrapSafeValue,
|
|
63
|
-
\u{275}\u{275}NgOnChangesFeature as \u{275}_NgOnChangesFeature,
|
|
64
|
-
\u{275}\u{275}defineDirective as \u{275}_defineDirective,
|
|
65
|
-
\u{275}\u{275}defineInjectable as \u{275}_defineInjectable,
|
|
66
|
-
\u{275}\u{275}defineInjector as \u{275}_defineInjector,
|
|
67
|
-
\u{275}\u{275}defineNgModule as \u{275}_defineNgModule,
|
|
68
|
-
\u{275}\u{275}definePipe as \u{275}_definePipe,
|
|
69
|
-
\u{275}\u{275}directiveInject as \u{275}_directiveInject,
|
|
70
|
-
\u{275}\u{275}getInheritedFactory as \u{275}_getInheritedFactory,
|
|
71
|
-
\u{275}\u{275}inject as \u{275}_inject,
|
|
72
|
-
\u{275}\u{275}injectAttribute as \u{275}_injectAttribute,
|
|
73
|
-
\u{275}\u{275}styleProp as \u{275}_styleProp
|
|
74
|
-
} from "./chunk-xahr7f2f.js";
|
|
75
|
-
import {
|
|
76
|
-
__export,
|
|
77
|
-
__toESM
|
|
78
|
-
} from "./chunk-dhs2bg35.js";
|
|
79
|
-
|
|
80
|
-
// node_modules/@angular/common/fesm2022/_location-chunk.mjs
|
|
81
|
-
var import_rxjs = __toESM(require_cjs(), 1);
|
|
82
|
-
function joinWithSlash(start, end) {
|
|
83
|
-
if (!start)
|
|
84
|
-
return end;
|
|
85
|
-
if (!end)
|
|
86
|
-
return start;
|
|
87
|
-
if (start.endsWith("/")) {
|
|
88
|
-
return end.startsWith("/") ? start + end.slice(1) : start + end;
|
|
89
|
-
}
|
|
90
|
-
return end.startsWith("/") ? start + end : `${start}/${end}`;
|
|
91
|
-
}
|
|
92
|
-
function stripTrailingSlash(url) {
|
|
93
|
-
const pathEndIdx = url.search(/#|\?|$/);
|
|
94
|
-
return url[pathEndIdx - 1] === "/" ? url.slice(0, pathEndIdx - 1) + url.slice(pathEndIdx) : url;
|
|
95
|
-
}
|
|
96
|
-
function normalizeQueryParams(params) {
|
|
97
|
-
return params && params[0] !== "?" ? `?${params}` : params;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
class LocationStrategy {
|
|
101
|
-
historyGo(relativePosition) {
|
|
102
|
-
throw new Error(ngDevMode ? "Not implemented" : "");
|
|
103
|
-
}
|
|
104
|
-
static \u{275}fac = function LocationStrategy_Factory(__ngFactoryType__) {
|
|
105
|
-
return new (__ngFactoryType__ || LocationStrategy);
|
|
106
|
-
};
|
|
107
|
-
static \u{275}prov = /* @__PURE__ */ \u{275}_defineInjectable({
|
|
108
|
-
token: LocationStrategy,
|
|
109
|
-
factory: () => (() => inject(PathLocationStrategy))(),
|
|
110
|
-
providedIn: "root"
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
(() => {
|
|
114
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LocationStrategy, [{
|
|
115
|
-
type: Injectable,
|
|
116
|
-
args: [{
|
|
117
|
-
providedIn: "root",
|
|
118
|
-
useFactory: () => inject(PathLocationStrategy)
|
|
119
|
-
}]
|
|
120
|
-
}], null, null);
|
|
121
|
-
})();
|
|
122
|
-
var APP_BASE_HREF = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "appBaseHref" : "");
|
|
123
|
-
|
|
124
|
-
class PathLocationStrategy extends LocationStrategy {
|
|
125
|
-
_platformLocation;
|
|
126
|
-
_baseHref;
|
|
127
|
-
_removeListenerFns = [];
|
|
128
|
-
constructor(_platformLocation, href) {
|
|
129
|
-
super();
|
|
130
|
-
this._platformLocation = _platformLocation;
|
|
131
|
-
this._baseHref = href ?? this._platformLocation.getBaseHrefFromDOM() ?? inject(DOCUMENT).location?.origin ?? "";
|
|
132
|
-
}
|
|
133
|
-
ngOnDestroy() {
|
|
134
|
-
while (this._removeListenerFns.length) {
|
|
135
|
-
this._removeListenerFns.pop()();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
onPopState(fn) {
|
|
139
|
-
this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));
|
|
140
|
-
}
|
|
141
|
-
getBaseHref() {
|
|
142
|
-
return this._baseHref;
|
|
143
|
-
}
|
|
144
|
-
prepareExternalUrl(internal) {
|
|
145
|
-
return joinWithSlash(this._baseHref, internal);
|
|
146
|
-
}
|
|
147
|
-
path(includeHash = false) {
|
|
148
|
-
const pathname = this._platformLocation.pathname + normalizeQueryParams(this._platformLocation.search);
|
|
149
|
-
const hash = this._platformLocation.hash;
|
|
150
|
-
return hash && includeHash ? `${pathname}${hash}` : pathname;
|
|
151
|
-
}
|
|
152
|
-
pushState(state, title, url, queryParams) {
|
|
153
|
-
const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));
|
|
154
|
-
this._platformLocation.pushState(state, title, externalUrl);
|
|
155
|
-
}
|
|
156
|
-
replaceState(state, title, url, queryParams) {
|
|
157
|
-
const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));
|
|
158
|
-
this._platformLocation.replaceState(state, title, externalUrl);
|
|
159
|
-
}
|
|
160
|
-
forward() {
|
|
161
|
-
this._platformLocation.forward();
|
|
162
|
-
}
|
|
163
|
-
back() {
|
|
164
|
-
this._platformLocation.back();
|
|
165
|
-
}
|
|
166
|
-
getState() {
|
|
167
|
-
return this._platformLocation.getState();
|
|
168
|
-
}
|
|
169
|
-
historyGo(relativePosition = 0) {
|
|
170
|
-
this._platformLocation.historyGo?.(relativePosition);
|
|
171
|
-
}
|
|
172
|
-
static \u{275}fac = function PathLocationStrategy_Factory(__ngFactoryType__) {
|
|
173
|
-
return new (__ngFactoryType__ || PathLocationStrategy)(\u{275}_inject(PlatformLocation), \u{275}_inject(APP_BASE_HREF, 8));
|
|
174
|
-
};
|
|
175
|
-
static \u{275}prov = /* @__PURE__ */ \u{275}_defineInjectable({
|
|
176
|
-
token: PathLocationStrategy,
|
|
177
|
-
factory: PathLocationStrategy.\u{275}fac,
|
|
178
|
-
providedIn: "root"
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
(() => {
|
|
182
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PathLocationStrategy, [{
|
|
183
|
-
type: Injectable,
|
|
184
|
-
args: [{
|
|
185
|
-
providedIn: "root"
|
|
186
|
-
}]
|
|
187
|
-
}], () => [{
|
|
188
|
-
type: PlatformLocation
|
|
189
|
-
}, {
|
|
190
|
-
type: undefined,
|
|
191
|
-
decorators: [{
|
|
192
|
-
type: Optional
|
|
193
|
-
}, {
|
|
194
|
-
type: Inject,
|
|
195
|
-
args: [APP_BASE_HREF]
|
|
196
|
-
}]
|
|
197
|
-
}], null);
|
|
198
|
-
})();
|
|
199
|
-
|
|
200
|
-
class NoTrailingSlashPathLocationStrategy extends PathLocationStrategy {
|
|
201
|
-
prepareExternalUrl(internal) {
|
|
202
|
-
const path = extractUrlPath(internal);
|
|
203
|
-
if (path.endsWith("/") && path.length > 1) {
|
|
204
|
-
internal = path.slice(0, -1) + internal.slice(path.length);
|
|
205
|
-
}
|
|
206
|
-
return super.prepareExternalUrl(internal);
|
|
207
|
-
}
|
|
208
|
-
static \u{275}fac = /* @__PURE__ */ (() => {
|
|
209
|
-
let \u{275}NoTrailingSlashPathLocationStrategy_BaseFactory;
|
|
210
|
-
return function NoTrailingSlashPathLocationStrategy_Factory(__ngFactoryType__) {
|
|
211
|
-
return (\u{275}NoTrailingSlashPathLocationStrategy_BaseFactory || (\u{275}NoTrailingSlashPathLocationStrategy_BaseFactory = \u{275}_getInheritedFactory(NoTrailingSlashPathLocationStrategy)))(__ngFactoryType__ || NoTrailingSlashPathLocationStrategy);
|
|
212
|
-
};
|
|
213
|
-
})();
|
|
214
|
-
static \u{275}prov = /* @__PURE__ */ \u{275}_defineInjectable({
|
|
215
|
-
token: NoTrailingSlashPathLocationStrategy,
|
|
216
|
-
factory: NoTrailingSlashPathLocationStrategy.\u{275}fac,
|
|
217
|
-
providedIn: "root"
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
(() => {
|
|
221
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NoTrailingSlashPathLocationStrategy, [{
|
|
222
|
-
type: Injectable,
|
|
223
|
-
args: [{
|
|
224
|
-
providedIn: "root"
|
|
225
|
-
}]
|
|
226
|
-
}], null, null);
|
|
227
|
-
})();
|
|
228
|
-
|
|
229
|
-
class TrailingSlashPathLocationStrategy extends PathLocationStrategy {
|
|
230
|
-
prepareExternalUrl(internal) {
|
|
231
|
-
const path = extractUrlPath(internal);
|
|
232
|
-
if (!path.endsWith("/")) {
|
|
233
|
-
internal = path + "/" + internal.slice(path.length);
|
|
234
|
-
}
|
|
235
|
-
return super.prepareExternalUrl(internal);
|
|
236
|
-
}
|
|
237
|
-
static \u{275}fac = /* @__PURE__ */ (() => {
|
|
238
|
-
let \u{275}TrailingSlashPathLocationStrategy_BaseFactory;
|
|
239
|
-
return function TrailingSlashPathLocationStrategy_Factory(__ngFactoryType__) {
|
|
240
|
-
return (\u{275}TrailingSlashPathLocationStrategy_BaseFactory || (\u{275}TrailingSlashPathLocationStrategy_BaseFactory = \u{275}_getInheritedFactory(TrailingSlashPathLocationStrategy)))(__ngFactoryType__ || TrailingSlashPathLocationStrategy);
|
|
241
|
-
};
|
|
242
|
-
})();
|
|
243
|
-
static \u{275}prov = /* @__PURE__ */ \u{275}_defineInjectable({
|
|
244
|
-
token: TrailingSlashPathLocationStrategy,
|
|
245
|
-
factory: TrailingSlashPathLocationStrategy.\u{275}fac,
|
|
246
|
-
providedIn: "root"
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
(() => {
|
|
250
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TrailingSlashPathLocationStrategy, [{
|
|
251
|
-
type: Injectable,
|
|
252
|
-
args: [{
|
|
253
|
-
providedIn: "root"
|
|
254
|
-
}]
|
|
255
|
-
}], null, null);
|
|
256
|
-
})();
|
|
257
|
-
function extractUrlPath(url) {
|
|
258
|
-
const questionMarkOrHashIndex = url.search(/[?#]/);
|
|
259
|
-
const pathEnd = questionMarkOrHashIndex > -1 ? questionMarkOrHashIndex : url.length;
|
|
260
|
-
return url.slice(0, pathEnd);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
class Location {
|
|
264
|
-
_subject = new import_rxjs.Subject;
|
|
265
|
-
_basePath;
|
|
266
|
-
_locationStrategy;
|
|
267
|
-
_urlChangeListeners = [];
|
|
268
|
-
_urlChangeSubscription = null;
|
|
269
|
-
constructor(locationStrategy) {
|
|
270
|
-
this._locationStrategy = locationStrategy;
|
|
271
|
-
const baseHref = this._locationStrategy.getBaseHref();
|
|
272
|
-
this._basePath = _stripOrigin(stripTrailingSlash(_stripIndexHtml(baseHref)));
|
|
273
|
-
this._locationStrategy.onPopState((ev) => {
|
|
274
|
-
this._subject.next({
|
|
275
|
-
url: this.path(true),
|
|
276
|
-
pop: true,
|
|
277
|
-
state: ev.state,
|
|
278
|
-
type: ev.type
|
|
279
|
-
});
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
ngOnDestroy() {
|
|
283
|
-
this._urlChangeSubscription?.unsubscribe();
|
|
284
|
-
this._urlChangeListeners = [];
|
|
285
|
-
}
|
|
286
|
-
path(includeHash = false) {
|
|
287
|
-
return this.normalize(this._locationStrategy.path(includeHash));
|
|
288
|
-
}
|
|
289
|
-
getState() {
|
|
290
|
-
return this._locationStrategy.getState();
|
|
291
|
-
}
|
|
292
|
-
isCurrentPathEqualTo(path, query = "") {
|
|
293
|
-
return this.path() == this.normalize(path + normalizeQueryParams(query));
|
|
294
|
-
}
|
|
295
|
-
normalize(url) {
|
|
296
|
-
return Location.stripTrailingSlash(_stripBasePath(this._basePath, _stripIndexHtml(url)));
|
|
297
|
-
}
|
|
298
|
-
prepareExternalUrl(url) {
|
|
299
|
-
if (url && url[0] !== "/") {
|
|
300
|
-
url = "/" + url;
|
|
301
|
-
}
|
|
302
|
-
return this._locationStrategy.prepareExternalUrl(url);
|
|
303
|
-
}
|
|
304
|
-
go(path, query = "", state = null) {
|
|
305
|
-
this._locationStrategy.pushState(state, "", path, query);
|
|
306
|
-
this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);
|
|
307
|
-
}
|
|
308
|
-
replaceState(path, query = "", state = null) {
|
|
309
|
-
this._locationStrategy.replaceState(state, "", path, query);
|
|
310
|
-
this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);
|
|
311
|
-
}
|
|
312
|
-
forward() {
|
|
313
|
-
this._locationStrategy.forward();
|
|
314
|
-
}
|
|
315
|
-
back() {
|
|
316
|
-
this._locationStrategy.back();
|
|
317
|
-
}
|
|
318
|
-
historyGo(relativePosition = 0) {
|
|
319
|
-
this._locationStrategy.historyGo?.(relativePosition);
|
|
320
|
-
}
|
|
321
|
-
onUrlChange(fn) {
|
|
322
|
-
this._urlChangeListeners.push(fn);
|
|
323
|
-
this._urlChangeSubscription ??= this.subscribe((v) => {
|
|
324
|
-
this._notifyUrlChangeListeners(v.url, v.state);
|
|
325
|
-
});
|
|
326
|
-
return () => {
|
|
327
|
-
const fnIndex = this._urlChangeListeners.indexOf(fn);
|
|
328
|
-
this._urlChangeListeners.splice(fnIndex, 1);
|
|
329
|
-
if (this._urlChangeListeners.length === 0) {
|
|
330
|
-
this._urlChangeSubscription?.unsubscribe();
|
|
331
|
-
this._urlChangeSubscription = null;
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
_notifyUrlChangeListeners(url = "", state) {
|
|
336
|
-
this._urlChangeListeners.forEach((fn) => fn(url, state));
|
|
337
|
-
}
|
|
338
|
-
subscribe(onNext, onThrow, onReturn) {
|
|
339
|
-
return this._subject.subscribe({
|
|
340
|
-
next: onNext,
|
|
341
|
-
error: onThrow ?? undefined,
|
|
342
|
-
complete: onReturn ?? undefined
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
static normalizeQueryParams = normalizeQueryParams;
|
|
346
|
-
static joinWithSlash = joinWithSlash;
|
|
347
|
-
static stripTrailingSlash = stripTrailingSlash;
|
|
348
|
-
static \u{275}fac = function Location_Factory(__ngFactoryType__) {
|
|
349
|
-
return new (__ngFactoryType__ || Location)(\u{275}_inject(LocationStrategy));
|
|
350
|
-
};
|
|
351
|
-
static \u{275}prov = /* @__PURE__ */ \u{275}_defineInjectable({
|
|
352
|
-
token: Location,
|
|
353
|
-
factory: () => createLocation(),
|
|
354
|
-
providedIn: "root"
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
(() => {
|
|
358
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Location, [{
|
|
359
|
-
type: Injectable,
|
|
360
|
-
args: [{
|
|
361
|
-
providedIn: "root",
|
|
362
|
-
useFactory: createLocation
|
|
363
|
-
}]
|
|
364
|
-
}], () => [{
|
|
365
|
-
type: LocationStrategy
|
|
366
|
-
}], null);
|
|
367
|
-
})();
|
|
368
|
-
function createLocation() {
|
|
369
|
-
return new Location(\u{275}_inject(LocationStrategy));
|
|
370
|
-
}
|
|
371
|
-
function _stripBasePath(basePath, url) {
|
|
372
|
-
if (!basePath || !url.startsWith(basePath)) {
|
|
373
|
-
return url;
|
|
374
|
-
}
|
|
375
|
-
const strippedUrl = url.substring(basePath.length);
|
|
376
|
-
if (strippedUrl === "" || ["/", ";", "?", "#"].includes(strippedUrl[0])) {
|
|
377
|
-
return strippedUrl;
|
|
378
|
-
}
|
|
379
|
-
return url;
|
|
380
|
-
}
|
|
381
|
-
function _stripIndexHtml(url) {
|
|
382
|
-
return url.replace(/\/index.html$/, "");
|
|
383
|
-
}
|
|
384
|
-
function _stripOrigin(baseHref) {
|
|
385
|
-
const isAbsoluteUrl = new RegExp("^(https?:)?//").test(baseHref);
|
|
386
|
-
if (isAbsoluteUrl) {
|
|
387
|
-
const [, pathname] = baseHref.split(/\/\/[^\/]+/);
|
|
388
|
-
return pathname;
|
|
389
|
-
}
|
|
390
|
-
return baseHref;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
// node_modules/@angular/common/fesm2022/_common_module-chunk.mjs
|
|
394
|
-
class HashLocationStrategy extends LocationStrategy {
|
|
395
|
-
_platformLocation;
|
|
396
|
-
_baseHref = "";
|
|
397
|
-
_removeListenerFns = [];
|
|
398
|
-
constructor(_platformLocation, _baseHref) {
|
|
399
|
-
super();
|
|
400
|
-
this._platformLocation = _platformLocation;
|
|
401
|
-
if (_baseHref != null) {
|
|
402
|
-
this._baseHref = _baseHref;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
ngOnDestroy() {
|
|
406
|
-
while (this._removeListenerFns.length) {
|
|
407
|
-
this._removeListenerFns.pop()();
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
onPopState(fn) {
|
|
411
|
-
this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));
|
|
412
|
-
}
|
|
413
|
-
getBaseHref() {
|
|
414
|
-
return this._baseHref;
|
|
415
|
-
}
|
|
416
|
-
path(includeHash = false) {
|
|
417
|
-
const path = this._platformLocation.hash ?? "#";
|
|
418
|
-
return path.length > 0 ? path.substring(1) : path;
|
|
419
|
-
}
|
|
420
|
-
prepareExternalUrl(internal) {
|
|
421
|
-
const url = joinWithSlash(this._baseHref, internal);
|
|
422
|
-
return url.length > 0 ? "#" + url : url;
|
|
423
|
-
}
|
|
424
|
-
pushState(state, title, path, queryParams) {
|
|
425
|
-
const url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)) || this._platformLocation.pathname;
|
|
426
|
-
this._platformLocation.pushState(state, title, url);
|
|
427
|
-
}
|
|
428
|
-
replaceState(state, title, path, queryParams) {
|
|
429
|
-
const url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)) || this._platformLocation.pathname;
|
|
430
|
-
this._platformLocation.replaceState(state, title, url);
|
|
431
|
-
}
|
|
432
|
-
forward() {
|
|
433
|
-
this._platformLocation.forward();
|
|
434
|
-
}
|
|
435
|
-
back() {
|
|
436
|
-
this._platformLocation.back();
|
|
437
|
-
}
|
|
438
|
-
getState() {
|
|
439
|
-
return this._platformLocation.getState();
|
|
440
|
-
}
|
|
441
|
-
historyGo(relativePosition = 0) {
|
|
442
|
-
this._platformLocation.historyGo?.(relativePosition);
|
|
443
|
-
}
|
|
444
|
-
static \u{275}fac = function HashLocationStrategy_Factory(__ngFactoryType__) {
|
|
445
|
-
return new (__ngFactoryType__ || HashLocationStrategy)(\u{275}_inject(PlatformLocation), \u{275}_inject(APP_BASE_HREF, 8));
|
|
446
|
-
};
|
|
447
|
-
static \u{275}prov = /* @__PURE__ */ \u{275}_defineInjectable({
|
|
448
|
-
token: HashLocationStrategy,
|
|
449
|
-
factory: HashLocationStrategy.\u{275}fac
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
(() => {
|
|
453
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(HashLocationStrategy, [{
|
|
454
|
-
type: Injectable
|
|
455
|
-
}], () => [{
|
|
456
|
-
type: PlatformLocation
|
|
457
|
-
}, {
|
|
458
|
-
type: undefined,
|
|
459
|
-
decorators: [{
|
|
460
|
-
type: Optional
|
|
461
|
-
}, {
|
|
462
|
-
type: Inject,
|
|
463
|
-
args: [APP_BASE_HREF]
|
|
464
|
-
}]
|
|
465
|
-
}], null);
|
|
466
|
-
})();
|
|
467
|
-
var CURRENCIES_EN = {
|
|
468
|
-
ADP: [undefined, undefined, 0],
|
|
469
|
-
AFN: [undefined, "\u060B", 0],
|
|
470
|
-
ALL: [undefined, undefined, 0],
|
|
471
|
-
AMD: [undefined, "\u058F", 2],
|
|
472
|
-
AOA: [undefined, "Kz"],
|
|
473
|
-
ARS: [undefined, "$"],
|
|
474
|
-
AUD: ["A$", "$"],
|
|
475
|
-
AZN: [undefined, "\u20BC"],
|
|
476
|
-
BAM: [undefined, "KM"],
|
|
477
|
-
BBD: [undefined, "$"],
|
|
478
|
-
BDT: [undefined, "\u09F3"],
|
|
479
|
-
BHD: [undefined, undefined, 3],
|
|
480
|
-
BIF: [undefined, undefined, 0],
|
|
481
|
-
BMD: [undefined, "$"],
|
|
482
|
-
BND: [undefined, "$"],
|
|
483
|
-
BOB: [undefined, "Bs"],
|
|
484
|
-
BRL: ["R$"],
|
|
485
|
-
BSD: [undefined, "$"],
|
|
486
|
-
BWP: [undefined, "P"],
|
|
487
|
-
BYN: [undefined, undefined, 2],
|
|
488
|
-
BYR: [undefined, undefined, 0],
|
|
489
|
-
BZD: [undefined, "$"],
|
|
490
|
-
CAD: ["CA$", "$", 2],
|
|
491
|
-
CHF: [undefined, undefined, 2],
|
|
492
|
-
CLF: [undefined, undefined, 4],
|
|
493
|
-
CLP: [undefined, "$", 0],
|
|
494
|
-
CNY: ["CN\xA5", "\xA5"],
|
|
495
|
-
COP: [undefined, "$", 2],
|
|
496
|
-
CRC: [undefined, "\u20A1", 2],
|
|
497
|
-
CUC: [undefined, "$"],
|
|
498
|
-
CUP: [undefined, "$"],
|
|
499
|
-
CZK: [undefined, "K\u010D", 2],
|
|
500
|
-
DJF: [undefined, undefined, 0],
|
|
501
|
-
DKK: [undefined, "kr", 2],
|
|
502
|
-
DOP: [undefined, "$"],
|
|
503
|
-
EGP: [undefined, "E\xA3"],
|
|
504
|
-
ESP: [undefined, "\u20A7", 0],
|
|
505
|
-
EUR: ["\u20AC"],
|
|
506
|
-
FJD: [undefined, "$"],
|
|
507
|
-
FKP: [undefined, "\xA3"],
|
|
508
|
-
GBP: ["\xA3"],
|
|
509
|
-
GEL: [undefined, "\u20BE"],
|
|
510
|
-
GHS: [undefined, "GH\u20B5"],
|
|
511
|
-
GIP: [undefined, "\xA3"],
|
|
512
|
-
GNF: [undefined, "FG", 0],
|
|
513
|
-
GTQ: [undefined, "Q"],
|
|
514
|
-
GYD: [undefined, "$", 2],
|
|
515
|
-
HKD: ["HK$", "$"],
|
|
516
|
-
HNL: [undefined, "L"],
|
|
517
|
-
HRK: [undefined, "kn"],
|
|
518
|
-
HUF: [undefined, "Ft", 2],
|
|
519
|
-
IDR: [undefined, "Rp", 2],
|
|
520
|
-
ILS: ["\u20AA"],
|
|
521
|
-
INR: ["\u20B9"],
|
|
522
|
-
IQD: [undefined, undefined, 0],
|
|
523
|
-
IRR: [undefined, undefined, 0],
|
|
524
|
-
ISK: [undefined, "kr", 0],
|
|
525
|
-
ITL: [undefined, undefined, 0],
|
|
526
|
-
JMD: [undefined, "$"],
|
|
527
|
-
JOD: [undefined, undefined, 3],
|
|
528
|
-
JPY: ["\xA5", undefined, 0],
|
|
529
|
-
KGS: [undefined, "\u20C0"],
|
|
530
|
-
KHR: [undefined, "\u17DB"],
|
|
531
|
-
KMF: [undefined, "CF", 0],
|
|
532
|
-
KPW: [undefined, "\u20A9", 0],
|
|
533
|
-
KRW: ["\u20A9", undefined, 0],
|
|
534
|
-
KWD: [undefined, undefined, 3],
|
|
535
|
-
KYD: [undefined, "$"],
|
|
536
|
-
KZT: [undefined, "\u20B8"],
|
|
537
|
-
LAK: [undefined, "\u20AD", 0],
|
|
538
|
-
LBP: [undefined, "L\xA3", 0],
|
|
539
|
-
LKR: [undefined, "Rs"],
|
|
540
|
-
LRD: [undefined, "$"],
|
|
541
|
-
LTL: [undefined, "Lt"],
|
|
542
|
-
LUF: [undefined, undefined, 0],
|
|
543
|
-
LVL: [undefined, "Ls"],
|
|
544
|
-
LYD: [undefined, undefined, 3],
|
|
545
|
-
MGA: [undefined, "Ar", 0],
|
|
546
|
-
MGF: [undefined, undefined, 0],
|
|
547
|
-
MMK: [undefined, "K", 0],
|
|
548
|
-
MNT: [undefined, "\u20AE", 2],
|
|
549
|
-
MRO: [undefined, undefined, 0],
|
|
550
|
-
MUR: [undefined, "Rs", 2],
|
|
551
|
-
MXN: ["MX$", "$"],
|
|
552
|
-
MYR: [undefined, "RM"],
|
|
553
|
-
NAD: [undefined, "$"],
|
|
554
|
-
NGN: [undefined, "\u20A6"],
|
|
555
|
-
NIO: [undefined, "C$"],
|
|
556
|
-
NOK: [undefined, "kr", 2],
|
|
557
|
-
NPR: [undefined, "Rs"],
|
|
558
|
-
NZD: ["NZ$", "$"],
|
|
559
|
-
OMR: [undefined, undefined, 3],
|
|
560
|
-
PHP: ["\u20B1"],
|
|
561
|
-
PKR: [undefined, "Rs", 2],
|
|
562
|
-
PLN: [undefined, "z\u0142"],
|
|
563
|
-
PYG: [undefined, "\u20B2", 0],
|
|
564
|
-
RON: [undefined, "lei"],
|
|
565
|
-
RSD: [undefined, undefined, 0],
|
|
566
|
-
RUB: [undefined, "\u20BD"],
|
|
567
|
-
RWF: [undefined, "RF", 0],
|
|
568
|
-
SBD: [undefined, "$"],
|
|
569
|
-
SEK: [undefined, "kr", 2],
|
|
570
|
-
SGD: [undefined, "$"],
|
|
571
|
-
SHP: [undefined, "\xA3"],
|
|
572
|
-
SLE: [undefined, undefined, 2],
|
|
573
|
-
SLL: [undefined, undefined, 0],
|
|
574
|
-
SOS: [undefined, undefined, 0],
|
|
575
|
-
SRD: [undefined, "$"],
|
|
576
|
-
SSP: [undefined, "\xA3"],
|
|
577
|
-
STD: [undefined, undefined, 0],
|
|
578
|
-
STN: [undefined, "Db"],
|
|
579
|
-
SYP: [undefined, "\xA3", 0],
|
|
580
|
-
THB: [undefined, "\u0E3F"],
|
|
581
|
-
TMM: [undefined, undefined, 0],
|
|
582
|
-
TND: [undefined, undefined, 3],
|
|
583
|
-
TOP: [undefined, "T$"],
|
|
584
|
-
TRL: [undefined, undefined, 0],
|
|
585
|
-
TRY: [undefined, "\u20BA"],
|
|
586
|
-
TTD: [undefined, "$"],
|
|
587
|
-
TWD: ["NT$", "$", 2],
|
|
588
|
-
TZS: [undefined, undefined, 2],
|
|
589
|
-
UAH: [undefined, "\u20B4"],
|
|
590
|
-
UGX: [undefined, undefined, 0],
|
|
591
|
-
USD: ["$"],
|
|
592
|
-
UYI: [undefined, undefined, 0],
|
|
593
|
-
UYU: [undefined, "$"],
|
|
594
|
-
UYW: [undefined, undefined, 4],
|
|
595
|
-
UZS: [undefined, undefined, 2],
|
|
596
|
-
VEF: [undefined, "Bs", 2],
|
|
597
|
-
VND: ["\u20AB", undefined, 0],
|
|
598
|
-
VUV: [undefined, undefined, 0],
|
|
599
|
-
XAF: ["FCFA", undefined, 0],
|
|
600
|
-
XCD: ["EC$", "$"],
|
|
601
|
-
XCG: ["Cg."],
|
|
602
|
-
XOF: ["F\u202FCFA", undefined, 0],
|
|
603
|
-
XPF: ["CFPF", undefined, 0],
|
|
604
|
-
XXX: ["\xA4"],
|
|
605
|
-
YER: [undefined, undefined, 0],
|
|
606
|
-
ZAR: [undefined, "R"],
|
|
607
|
-
ZMK: [undefined, undefined, 0],
|
|
608
|
-
ZMW: [undefined, "ZK"],
|
|
609
|
-
ZWD: [undefined, undefined, 0]
|
|
610
|
-
};
|
|
611
|
-
var NumberFormatStyle;
|
|
612
|
-
(function(NumberFormatStyle2) {
|
|
613
|
-
NumberFormatStyle2[NumberFormatStyle2["Decimal"] = 0] = "Decimal";
|
|
614
|
-
NumberFormatStyle2[NumberFormatStyle2["Percent"] = 1] = "Percent";
|
|
615
|
-
NumberFormatStyle2[NumberFormatStyle2["Currency"] = 2] = "Currency";
|
|
616
|
-
NumberFormatStyle2[NumberFormatStyle2["Scientific"] = 3] = "Scientific";
|
|
617
|
-
})(NumberFormatStyle || (NumberFormatStyle = {}));
|
|
618
|
-
var Plural;
|
|
619
|
-
(function(Plural2) {
|
|
620
|
-
Plural2[Plural2["Zero"] = 0] = "Zero";
|
|
621
|
-
Plural2[Plural2["One"] = 1] = "One";
|
|
622
|
-
Plural2[Plural2["Two"] = 2] = "Two";
|
|
623
|
-
Plural2[Plural2["Few"] = 3] = "Few";
|
|
624
|
-
Plural2[Plural2["Many"] = 4] = "Many";
|
|
625
|
-
Plural2[Plural2["Other"] = 5] = "Other";
|
|
626
|
-
})(Plural || (Plural = {}));
|
|
627
|
-
var FormStyle;
|
|
628
|
-
(function(FormStyle2) {
|
|
629
|
-
FormStyle2[FormStyle2["Format"] = 0] = "Format";
|
|
630
|
-
FormStyle2[FormStyle2["Standalone"] = 1] = "Standalone";
|
|
631
|
-
})(FormStyle || (FormStyle = {}));
|
|
632
|
-
var TranslationWidth;
|
|
633
|
-
(function(TranslationWidth2) {
|
|
634
|
-
TranslationWidth2[TranslationWidth2["Narrow"] = 0] = "Narrow";
|
|
635
|
-
TranslationWidth2[TranslationWidth2["Abbreviated"] = 1] = "Abbreviated";
|
|
636
|
-
TranslationWidth2[TranslationWidth2["Wide"] = 2] = "Wide";
|
|
637
|
-
TranslationWidth2[TranslationWidth2["Short"] = 3] = "Short";
|
|
638
|
-
})(TranslationWidth || (TranslationWidth = {}));
|
|
639
|
-
var FormatWidth;
|
|
640
|
-
(function(FormatWidth2) {
|
|
641
|
-
FormatWidth2[FormatWidth2["Short"] = 0] = "Short";
|
|
642
|
-
FormatWidth2[FormatWidth2["Medium"] = 1] = "Medium";
|
|
643
|
-
FormatWidth2[FormatWidth2["Long"] = 2] = "Long";
|
|
644
|
-
FormatWidth2[FormatWidth2["Full"] = 3] = "Full";
|
|
645
|
-
})(FormatWidth || (FormatWidth = {}));
|
|
646
|
-
var NumberSymbol = {
|
|
647
|
-
Decimal: 0,
|
|
648
|
-
Group: 1,
|
|
649
|
-
List: 2,
|
|
650
|
-
PercentSign: 3,
|
|
651
|
-
PlusSign: 4,
|
|
652
|
-
MinusSign: 5,
|
|
653
|
-
Exponential: 6,
|
|
654
|
-
SuperscriptingExponent: 7,
|
|
655
|
-
PerMille: 8,
|
|
656
|
-
Infinity: 9,
|
|
657
|
-
NaN: 10,
|
|
658
|
-
TimeSeparator: 11,
|
|
659
|
-
CurrencyDecimal: 12,
|
|
660
|
-
CurrencyGroup: 13
|
|
661
|
-
};
|
|
662
|
-
var WeekDay;
|
|
663
|
-
(function(WeekDay2) {
|
|
664
|
-
WeekDay2[WeekDay2["Sunday"] = 0] = "Sunday";
|
|
665
|
-
WeekDay2[WeekDay2["Monday"] = 1] = "Monday";
|
|
666
|
-
WeekDay2[WeekDay2["Tuesday"] = 2] = "Tuesday";
|
|
667
|
-
WeekDay2[WeekDay2["Wednesday"] = 3] = "Wednesday";
|
|
668
|
-
WeekDay2[WeekDay2["Thursday"] = 4] = "Thursday";
|
|
669
|
-
WeekDay2[WeekDay2["Friday"] = 5] = "Friday";
|
|
670
|
-
WeekDay2[WeekDay2["Saturday"] = 6] = "Saturday";
|
|
671
|
-
})(WeekDay || (WeekDay = {}));
|
|
672
|
-
function getLocaleId(locale) {
|
|
673
|
-
return findLocaleData(locale)[LocaleDataIndex.LocaleId];
|
|
674
|
-
}
|
|
675
|
-
function getLocaleDayPeriods(locale, formStyle, width) {
|
|
676
|
-
const data = findLocaleData(locale);
|
|
677
|
-
const amPmData = [data[LocaleDataIndex.DayPeriodsFormat], data[LocaleDataIndex.DayPeriodsStandalone]];
|
|
678
|
-
const amPm = getLastDefinedValue(amPmData, formStyle);
|
|
679
|
-
return getLastDefinedValue(amPm, width);
|
|
680
|
-
}
|
|
681
|
-
function getLocaleDayNames(locale, formStyle, width) {
|
|
682
|
-
const data = findLocaleData(locale);
|
|
683
|
-
const daysData = [data[LocaleDataIndex.DaysFormat], data[LocaleDataIndex.DaysStandalone]];
|
|
684
|
-
const days = getLastDefinedValue(daysData, formStyle);
|
|
685
|
-
return getLastDefinedValue(days, width);
|
|
686
|
-
}
|
|
687
|
-
function getLocaleMonthNames(locale, formStyle, width) {
|
|
688
|
-
const data = findLocaleData(locale);
|
|
689
|
-
const monthsData = [data[LocaleDataIndex.MonthsFormat], data[LocaleDataIndex.MonthsStandalone]];
|
|
690
|
-
const months = getLastDefinedValue(monthsData, formStyle);
|
|
691
|
-
return getLastDefinedValue(months, width);
|
|
692
|
-
}
|
|
693
|
-
function getLocaleEraNames(locale, width) {
|
|
694
|
-
const data = findLocaleData(locale);
|
|
695
|
-
const erasData = data[LocaleDataIndex.Eras];
|
|
696
|
-
return getLastDefinedValue(erasData, width);
|
|
697
|
-
}
|
|
698
|
-
function getLocaleFirstDayOfWeek(locale) {
|
|
699
|
-
const data = findLocaleData(locale);
|
|
700
|
-
return data[LocaleDataIndex.FirstDayOfWeek];
|
|
701
|
-
}
|
|
702
|
-
function getLocaleWeekEndRange(locale) {
|
|
703
|
-
const data = findLocaleData(locale);
|
|
704
|
-
return data[LocaleDataIndex.WeekendRange];
|
|
705
|
-
}
|
|
706
|
-
function getLocaleDateFormat(locale, width) {
|
|
707
|
-
const data = findLocaleData(locale);
|
|
708
|
-
return getLastDefinedValue(data[LocaleDataIndex.DateFormat], width);
|
|
709
|
-
}
|
|
710
|
-
function getLocaleTimeFormat(locale, width) {
|
|
711
|
-
const data = findLocaleData(locale);
|
|
712
|
-
return getLastDefinedValue(data[LocaleDataIndex.TimeFormat], width);
|
|
713
|
-
}
|
|
714
|
-
function getLocaleDateTimeFormat(locale, width) {
|
|
715
|
-
const data = findLocaleData(locale);
|
|
716
|
-
const dateTimeFormatData = data[LocaleDataIndex.DateTimeFormat];
|
|
717
|
-
return getLastDefinedValue(dateTimeFormatData, width);
|
|
718
|
-
}
|
|
719
|
-
function getLocaleNumberSymbol(locale, symbol) {
|
|
720
|
-
const data = findLocaleData(locale);
|
|
721
|
-
const res = data[LocaleDataIndex.NumberSymbols][symbol];
|
|
722
|
-
if (typeof res === "undefined") {
|
|
723
|
-
if (symbol === NumberSymbol.CurrencyDecimal) {
|
|
724
|
-
return data[LocaleDataIndex.NumberSymbols][NumberSymbol.Decimal];
|
|
725
|
-
} else if (symbol === NumberSymbol.CurrencyGroup) {
|
|
726
|
-
return data[LocaleDataIndex.NumberSymbols][NumberSymbol.Group];
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
return res;
|
|
730
|
-
}
|
|
731
|
-
function getLocaleNumberFormat(locale, type) {
|
|
732
|
-
const data = findLocaleData(locale);
|
|
733
|
-
return data[LocaleDataIndex.NumberFormats][type];
|
|
734
|
-
}
|
|
735
|
-
function getLocaleCurrencySymbol(locale) {
|
|
736
|
-
const data = findLocaleData(locale);
|
|
737
|
-
return data[LocaleDataIndex.CurrencySymbol] || null;
|
|
738
|
-
}
|
|
739
|
-
function getLocaleCurrencyName(locale) {
|
|
740
|
-
const data = findLocaleData(locale);
|
|
741
|
-
return data[LocaleDataIndex.CurrencyName] || null;
|
|
742
|
-
}
|
|
743
|
-
function getLocaleCurrencyCode2(locale) {
|
|
744
|
-
return getLocaleCurrencyCode(locale);
|
|
745
|
-
}
|
|
746
|
-
function getLocaleCurrencies(locale) {
|
|
747
|
-
const data = findLocaleData(locale);
|
|
748
|
-
return data[LocaleDataIndex.Currencies];
|
|
749
|
-
}
|
|
750
|
-
var getLocalePluralCase2 = getLocalePluralCase;
|
|
751
|
-
function checkFullData(data) {
|
|
752
|
-
if (!data[LocaleDataIndex.ExtraData]) {
|
|
753
|
-
throw new RuntimeError(2303, ngDevMode && `Missing extra locale data for the locale "${data[LocaleDataIndex.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`);
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
function getLocaleExtraDayPeriodRules(locale) {
|
|
757
|
-
const data = findLocaleData(locale);
|
|
758
|
-
checkFullData(data);
|
|
759
|
-
const rules = data[LocaleDataIndex.ExtraData][2] || [];
|
|
760
|
-
return rules.map((rule) => {
|
|
761
|
-
if (typeof rule === "string") {
|
|
762
|
-
return extractTime(rule);
|
|
763
|
-
}
|
|
764
|
-
return [extractTime(rule[0]), extractTime(rule[1])];
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
function getLocaleExtraDayPeriods(locale, formStyle, width) {
|
|
768
|
-
const data = findLocaleData(locale);
|
|
769
|
-
checkFullData(data);
|
|
770
|
-
const dayPeriodsData = [data[LocaleDataIndex.ExtraData][0], data[LocaleDataIndex.ExtraData][1]];
|
|
771
|
-
const dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];
|
|
772
|
-
return getLastDefinedValue(dayPeriods, width) || [];
|
|
773
|
-
}
|
|
774
|
-
function getLocaleDirection(locale) {
|
|
775
|
-
const data = findLocaleData(locale);
|
|
776
|
-
return data[LocaleDataIndex.Directionality];
|
|
777
|
-
}
|
|
778
|
-
function getLastDefinedValue(data, index) {
|
|
779
|
-
for (let i = index;i > -1; i--) {
|
|
780
|
-
if (typeof data[i] !== "undefined") {
|
|
781
|
-
return data[i];
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
throw new RuntimeError(2304, ngDevMode && "Locale data API: locale data undefined");
|
|
785
|
-
}
|
|
786
|
-
function extractTime(time) {
|
|
787
|
-
const [h, m] = time.split(":");
|
|
788
|
-
return {
|
|
789
|
-
hours: +h,
|
|
790
|
-
minutes: +m
|
|
791
|
-
};
|
|
792
|
-
}
|
|
793
|
-
function getCurrencySymbol(code, format, locale = "en") {
|
|
794
|
-
const currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];
|
|
795
|
-
const symbolNarrow = currency[1];
|
|
796
|
-
if (format === "narrow" && typeof symbolNarrow === "string") {
|
|
797
|
-
return symbolNarrow;
|
|
798
|
-
}
|
|
799
|
-
return currency[0] || code;
|
|
800
|
-
}
|
|
801
|
-
var DEFAULT_NB_OF_CURRENCY_DIGITS = 2;
|
|
802
|
-
function getNumberOfCurrencyDigits(code) {
|
|
803
|
-
let digits;
|
|
804
|
-
const currency = CURRENCIES_EN[code];
|
|
805
|
-
if (currency) {
|
|
806
|
-
digits = currency[2];
|
|
807
|
-
}
|
|
808
|
-
return typeof digits === "number" ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS;
|
|
809
|
-
}
|
|
810
|
-
var ISO8601_DATE_REGEX = /^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
|
|
811
|
-
var NAMED_FORMATS = {};
|
|
812
|
-
var DATE_FORMATS_SPLIT = /((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;
|
|
813
|
-
function formatDate(value, format, locale, timezone) {
|
|
814
|
-
let date = toDate(value);
|
|
815
|
-
const namedFormat = getNamedFormat(locale, format);
|
|
816
|
-
format = namedFormat || format;
|
|
817
|
-
let parts = [];
|
|
818
|
-
let match;
|
|
819
|
-
while (format) {
|
|
820
|
-
match = DATE_FORMATS_SPLIT.exec(format);
|
|
821
|
-
if (match) {
|
|
822
|
-
parts = parts.concat(match.slice(1));
|
|
823
|
-
const part = parts.pop();
|
|
824
|
-
if (!part) {
|
|
825
|
-
break;
|
|
826
|
-
}
|
|
827
|
-
format = part;
|
|
828
|
-
} else {
|
|
829
|
-
parts.push(format);
|
|
830
|
-
break;
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
if (typeof ngDevMode === "undefined" || ngDevMode) {
|
|
834
|
-
assertValidDateFormat(parts);
|
|
835
|
-
}
|
|
836
|
-
let dateTimezoneOffset = date.getTimezoneOffset();
|
|
837
|
-
if (timezone) {
|
|
838
|
-
dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
|
|
839
|
-
date = convertTimezoneToLocal(date, timezone);
|
|
840
|
-
}
|
|
841
|
-
let text = "";
|
|
842
|
-
parts.forEach((value2) => {
|
|
843
|
-
const dateFormatter = getDateFormatter(value2);
|
|
844
|
-
text += dateFormatter ? dateFormatter(date, locale, dateTimezoneOffset) : value2 === "''" ? "'" : value2.replace(/(^'|'$)/g, "").replace(/''/g, "'");
|
|
845
|
-
});
|
|
846
|
-
return text;
|
|
847
|
-
}
|
|
848
|
-
function assertValidDateFormat(parts) {
|
|
849
|
-
if (parts.some((part) => /^Y+$/.test(part)) && !parts.some((part) => /^w+$/.test(part))) {
|
|
850
|
-
const message = `Suspicious use of week-based year "Y" in date pattern "${parts.join("")}". Did you mean to use calendar year "y" instead?`;
|
|
851
|
-
if (parts.length === 1) {
|
|
852
|
-
console.error(formatRuntimeError(2300, message));
|
|
853
|
-
} else {
|
|
854
|
-
throw new RuntimeError(2300, message);
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
function createDate(year, month, date) {
|
|
859
|
-
const newDate = new Date(0);
|
|
860
|
-
newDate.setFullYear(year, month, date);
|
|
861
|
-
newDate.setHours(0, 0, 0);
|
|
862
|
-
return newDate;
|
|
863
|
-
}
|
|
864
|
-
function getNamedFormat(locale, format) {
|
|
865
|
-
const localeId = getLocaleId(locale);
|
|
866
|
-
NAMED_FORMATS[localeId] ??= {};
|
|
867
|
-
if (NAMED_FORMATS[localeId][format]) {
|
|
868
|
-
return NAMED_FORMATS[localeId][format];
|
|
869
|
-
}
|
|
870
|
-
let formatValue = "";
|
|
871
|
-
switch (format) {
|
|
872
|
-
case "shortDate":
|
|
873
|
-
formatValue = getLocaleDateFormat(locale, FormatWidth.Short);
|
|
874
|
-
break;
|
|
875
|
-
case "mediumDate":
|
|
876
|
-
formatValue = getLocaleDateFormat(locale, FormatWidth.Medium);
|
|
877
|
-
break;
|
|
878
|
-
case "longDate":
|
|
879
|
-
formatValue = getLocaleDateFormat(locale, FormatWidth.Long);
|
|
880
|
-
break;
|
|
881
|
-
case "fullDate":
|
|
882
|
-
formatValue = getLocaleDateFormat(locale, FormatWidth.Full);
|
|
883
|
-
break;
|
|
884
|
-
case "shortTime":
|
|
885
|
-
formatValue = getLocaleTimeFormat(locale, FormatWidth.Short);
|
|
886
|
-
break;
|
|
887
|
-
case "mediumTime":
|
|
888
|
-
formatValue = getLocaleTimeFormat(locale, FormatWidth.Medium);
|
|
889
|
-
break;
|
|
890
|
-
case "longTime":
|
|
891
|
-
formatValue = getLocaleTimeFormat(locale, FormatWidth.Long);
|
|
892
|
-
break;
|
|
893
|
-
case "fullTime":
|
|
894
|
-
formatValue = getLocaleTimeFormat(locale, FormatWidth.Full);
|
|
895
|
-
break;
|
|
896
|
-
case "short":
|
|
897
|
-
const shortTime = getNamedFormat(locale, "shortTime");
|
|
898
|
-
const shortDate = getNamedFormat(locale, "shortDate");
|
|
899
|
-
formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]);
|
|
900
|
-
break;
|
|
901
|
-
case "medium":
|
|
902
|
-
const mediumTime = getNamedFormat(locale, "mediumTime");
|
|
903
|
-
const mediumDate = getNamedFormat(locale, "mediumDate");
|
|
904
|
-
formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]);
|
|
905
|
-
break;
|
|
906
|
-
case "long":
|
|
907
|
-
const longTime = getNamedFormat(locale, "longTime");
|
|
908
|
-
const longDate = getNamedFormat(locale, "longDate");
|
|
909
|
-
formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]);
|
|
910
|
-
break;
|
|
911
|
-
case "full":
|
|
912
|
-
const fullTime = getNamedFormat(locale, "fullTime");
|
|
913
|
-
const fullDate = getNamedFormat(locale, "fullDate");
|
|
914
|
-
formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]);
|
|
915
|
-
break;
|
|
916
|
-
}
|
|
917
|
-
if (formatValue) {
|
|
918
|
-
NAMED_FORMATS[localeId][format] = formatValue;
|
|
919
|
-
}
|
|
920
|
-
return formatValue;
|
|
921
|
-
}
|
|
922
|
-
function formatDateTime(str, opt_values) {
|
|
923
|
-
if (opt_values) {
|
|
924
|
-
str = str.replace(/\{([^}]+)}/g, function(match, key) {
|
|
925
|
-
return opt_values != null && key in opt_values ? opt_values[key] : match;
|
|
926
|
-
});
|
|
927
|
-
}
|
|
928
|
-
return str;
|
|
929
|
-
}
|
|
930
|
-
function padNumber(num, digits, minusSign = "-", trim, negWrap) {
|
|
931
|
-
let neg = "";
|
|
932
|
-
if (num < 0 || negWrap && num <= 0) {
|
|
933
|
-
if (negWrap) {
|
|
934
|
-
num = -num + 1;
|
|
935
|
-
} else {
|
|
936
|
-
num = -num;
|
|
937
|
-
neg = minusSign;
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
let strNum = String(num);
|
|
941
|
-
while (strNum.length < digits) {
|
|
942
|
-
strNum = "0" + strNum;
|
|
943
|
-
}
|
|
944
|
-
if (trim) {
|
|
945
|
-
strNum = strNum.slice(strNum.length - digits);
|
|
946
|
-
}
|
|
947
|
-
return neg + strNum;
|
|
948
|
-
}
|
|
949
|
-
function formatFractionalSeconds(milliseconds, digits) {
|
|
950
|
-
const strMs = padNumber(milliseconds, 3);
|
|
951
|
-
return strMs.substring(0, digits);
|
|
952
|
-
}
|
|
953
|
-
function dateGetter(name, size, offset = 0, trim = false, negWrap = false) {
|
|
954
|
-
return function(date, locale) {
|
|
955
|
-
let part = getDatePart(name, date);
|
|
956
|
-
if (offset > 0 || part > -offset) {
|
|
957
|
-
part += offset;
|
|
958
|
-
}
|
|
959
|
-
if (name === 3) {
|
|
960
|
-
if (part === 0 && offset === -12) {
|
|
961
|
-
part = 12;
|
|
962
|
-
}
|
|
963
|
-
} else if (name === 6) {
|
|
964
|
-
return formatFractionalSeconds(part, size);
|
|
965
|
-
}
|
|
966
|
-
const localeMinus = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
|
|
967
|
-
return padNumber(part, size, localeMinus, trim, negWrap);
|
|
968
|
-
};
|
|
969
|
-
}
|
|
970
|
-
function getDatePart(part, date) {
|
|
971
|
-
switch (part) {
|
|
972
|
-
case 0:
|
|
973
|
-
return date.getFullYear();
|
|
974
|
-
case 1:
|
|
975
|
-
return date.getMonth();
|
|
976
|
-
case 2:
|
|
977
|
-
return date.getDate();
|
|
978
|
-
case 3:
|
|
979
|
-
return date.getHours();
|
|
980
|
-
case 4:
|
|
981
|
-
return date.getMinutes();
|
|
982
|
-
case 5:
|
|
983
|
-
return date.getSeconds();
|
|
984
|
-
case 6:
|
|
985
|
-
return date.getMilliseconds();
|
|
986
|
-
case 7:
|
|
987
|
-
return date.getDay();
|
|
988
|
-
default:
|
|
989
|
-
throw new RuntimeError(2301, ngDevMode && `Unknown DateType value "${part}".`);
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
function dateStrGetter(name, width, form = FormStyle.Format, extended = false) {
|
|
993
|
-
return function(date, locale) {
|
|
994
|
-
return getDateTranslation(date, locale, name, width, form, extended);
|
|
995
|
-
};
|
|
996
|
-
}
|
|
997
|
-
function getDateTranslation(date, locale, name, width, form, extended) {
|
|
998
|
-
switch (name) {
|
|
999
|
-
case 2:
|
|
1000
|
-
return getLocaleMonthNames(locale, form, width)[date.getMonth()];
|
|
1001
|
-
case 1:
|
|
1002
|
-
return getLocaleDayNames(locale, form, width)[date.getDay()];
|
|
1003
|
-
case 0:
|
|
1004
|
-
const currentHours = date.getHours();
|
|
1005
|
-
const currentMinutes = date.getMinutes();
|
|
1006
|
-
if (extended) {
|
|
1007
|
-
const rules = getLocaleExtraDayPeriodRules(locale);
|
|
1008
|
-
const dayPeriods = getLocaleExtraDayPeriods(locale, form, width);
|
|
1009
|
-
const index = rules.findIndex((rule) => {
|
|
1010
|
-
if (Array.isArray(rule)) {
|
|
1011
|
-
const [from, to] = rule;
|
|
1012
|
-
const afterFrom = currentHours >= from.hours && currentMinutes >= from.minutes;
|
|
1013
|
-
const beforeTo = currentHours < to.hours || currentHours === to.hours && currentMinutes < to.minutes;
|
|
1014
|
-
if (from.hours < to.hours) {
|
|
1015
|
-
if (afterFrom && beforeTo) {
|
|
1016
|
-
return true;
|
|
1017
|
-
}
|
|
1018
|
-
} else if (afterFrom || beforeTo) {
|
|
1019
|
-
return true;
|
|
1020
|
-
}
|
|
1021
|
-
} else {
|
|
1022
|
-
if (rule.hours === currentHours && rule.minutes === currentMinutes) {
|
|
1023
|
-
return true;
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
return false;
|
|
1027
|
-
});
|
|
1028
|
-
if (index !== -1) {
|
|
1029
|
-
return dayPeriods[index];
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
return getLocaleDayPeriods(locale, form, width)[currentHours < 12 ? 0 : 1];
|
|
1033
|
-
case 3:
|
|
1034
|
-
return getLocaleEraNames(locale, width)[date.getFullYear() <= 0 ? 0 : 1];
|
|
1035
|
-
default:
|
|
1036
|
-
const unexpected = name;
|
|
1037
|
-
throw new RuntimeError(2302, ngDevMode && `unexpected translation type ${unexpected}`);
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
function timeZoneGetter(width) {
|
|
1041
|
-
return function(date, locale, offset) {
|
|
1042
|
-
const zone = -1 * offset;
|
|
1043
|
-
const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
|
|
1044
|
-
const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);
|
|
1045
|
-
switch (width) {
|
|
1046
|
-
case 0:
|
|
1047
|
-
return (zone >= 0 ? "+" : "") + padNumber(hours, 2, minusSign) + padNumber(Math.abs(zone % 60), 2, minusSign);
|
|
1048
|
-
case 1:
|
|
1049
|
-
return "GMT" + (zone >= 0 ? "+" : "") + padNumber(hours, 1, minusSign);
|
|
1050
|
-
case 2:
|
|
1051
|
-
return "GMT" + (zone >= 0 ? "+" : "") + padNumber(hours, 2, minusSign) + ":" + padNumber(Math.abs(zone % 60), 2, minusSign);
|
|
1052
|
-
case 3:
|
|
1053
|
-
if (offset === 0) {
|
|
1054
|
-
return "Z";
|
|
1055
|
-
} else {
|
|
1056
|
-
return (zone >= 0 ? "+" : "") + padNumber(hours, 2, minusSign) + ":" + padNumber(Math.abs(zone % 60), 2, minusSign);
|
|
1057
|
-
}
|
|
1058
|
-
default:
|
|
1059
|
-
throw new RuntimeError(2310, ngDevMode && `Unknown zone width "${width}"`);
|
|
1060
|
-
}
|
|
1061
|
-
};
|
|
1062
|
-
}
|
|
1063
|
-
var JANUARY = 0;
|
|
1064
|
-
var THURSDAY = 4;
|
|
1065
|
-
function getFirstThursdayOfYear(year) {
|
|
1066
|
-
const firstDayOfYear = createDate(year, JANUARY, 1).getDay();
|
|
1067
|
-
return createDate(year, 0, 1 + (firstDayOfYear <= THURSDAY ? THURSDAY : THURSDAY + 7) - firstDayOfYear);
|
|
1068
|
-
}
|
|
1069
|
-
function getThursdayThisIsoWeek(datetime) {
|
|
1070
|
-
const currentDay = datetime.getDay();
|
|
1071
|
-
const deltaToThursday = currentDay === 0 ? -3 : THURSDAY - currentDay;
|
|
1072
|
-
return createDate(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + deltaToThursday);
|
|
1073
|
-
}
|
|
1074
|
-
function weekGetter(size, monthBased = false) {
|
|
1075
|
-
return function(date, locale) {
|
|
1076
|
-
let result;
|
|
1077
|
-
if (monthBased) {
|
|
1078
|
-
const nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1;
|
|
1079
|
-
const today = date.getDate();
|
|
1080
|
-
result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7);
|
|
1081
|
-
} else {
|
|
1082
|
-
const thisThurs = getThursdayThisIsoWeek(date);
|
|
1083
|
-
const firstThurs = getFirstThursdayOfYear(thisThurs.getFullYear());
|
|
1084
|
-
const diff = thisThurs.getTime() - firstThurs.getTime();
|
|
1085
|
-
result = 1 + Math.round(diff / 604800000);
|
|
1086
|
-
}
|
|
1087
|
-
return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
|
|
1088
|
-
};
|
|
1089
|
-
}
|
|
1090
|
-
function weekNumberingYearGetter(size, trim = false) {
|
|
1091
|
-
return function(date, locale) {
|
|
1092
|
-
const thisThurs = getThursdayThisIsoWeek(date);
|
|
1093
|
-
const weekNumberingYear = thisThurs.getFullYear();
|
|
1094
|
-
return padNumber(weekNumberingYear, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim);
|
|
1095
|
-
};
|
|
1096
|
-
}
|
|
1097
|
-
var DATE_FORMATS = {};
|
|
1098
|
-
function getDateFormatter(format) {
|
|
1099
|
-
if (DATE_FORMATS[format]) {
|
|
1100
|
-
return DATE_FORMATS[format];
|
|
1101
|
-
}
|
|
1102
|
-
let formatter;
|
|
1103
|
-
switch (format) {
|
|
1104
|
-
case "G":
|
|
1105
|
-
case "GG":
|
|
1106
|
-
case "GGG":
|
|
1107
|
-
formatter = dateStrGetter(3, TranslationWidth.Abbreviated);
|
|
1108
|
-
break;
|
|
1109
|
-
case "GGGG":
|
|
1110
|
-
formatter = dateStrGetter(3, TranslationWidth.Wide);
|
|
1111
|
-
break;
|
|
1112
|
-
case "GGGGG":
|
|
1113
|
-
formatter = dateStrGetter(3, TranslationWidth.Narrow);
|
|
1114
|
-
break;
|
|
1115
|
-
case "y":
|
|
1116
|
-
formatter = dateGetter(0, 1, 0, false, true);
|
|
1117
|
-
break;
|
|
1118
|
-
case "yy":
|
|
1119
|
-
formatter = dateGetter(0, 2, 0, true, true);
|
|
1120
|
-
break;
|
|
1121
|
-
case "yyy":
|
|
1122
|
-
formatter = dateGetter(0, 3, 0, false, true);
|
|
1123
|
-
break;
|
|
1124
|
-
case "yyyy":
|
|
1125
|
-
formatter = dateGetter(0, 4, 0, false, true);
|
|
1126
|
-
break;
|
|
1127
|
-
case "Y":
|
|
1128
|
-
formatter = weekNumberingYearGetter(1);
|
|
1129
|
-
break;
|
|
1130
|
-
case "YY":
|
|
1131
|
-
formatter = weekNumberingYearGetter(2, true);
|
|
1132
|
-
break;
|
|
1133
|
-
case "YYY":
|
|
1134
|
-
formatter = weekNumberingYearGetter(3);
|
|
1135
|
-
break;
|
|
1136
|
-
case "YYYY":
|
|
1137
|
-
formatter = weekNumberingYearGetter(4);
|
|
1138
|
-
break;
|
|
1139
|
-
case "M":
|
|
1140
|
-
case "L":
|
|
1141
|
-
formatter = dateGetter(1, 1, 1);
|
|
1142
|
-
break;
|
|
1143
|
-
case "MM":
|
|
1144
|
-
case "LL":
|
|
1145
|
-
formatter = dateGetter(1, 2, 1);
|
|
1146
|
-
break;
|
|
1147
|
-
case "MMM":
|
|
1148
|
-
formatter = dateStrGetter(2, TranslationWidth.Abbreviated);
|
|
1149
|
-
break;
|
|
1150
|
-
case "MMMM":
|
|
1151
|
-
formatter = dateStrGetter(2, TranslationWidth.Wide);
|
|
1152
|
-
break;
|
|
1153
|
-
case "MMMMM":
|
|
1154
|
-
formatter = dateStrGetter(2, TranslationWidth.Narrow);
|
|
1155
|
-
break;
|
|
1156
|
-
case "LLL":
|
|
1157
|
-
formatter = dateStrGetter(2, TranslationWidth.Abbreviated, FormStyle.Standalone);
|
|
1158
|
-
break;
|
|
1159
|
-
case "LLLL":
|
|
1160
|
-
formatter = dateStrGetter(2, TranslationWidth.Wide, FormStyle.Standalone);
|
|
1161
|
-
break;
|
|
1162
|
-
case "LLLLL":
|
|
1163
|
-
formatter = dateStrGetter(2, TranslationWidth.Narrow, FormStyle.Standalone);
|
|
1164
|
-
break;
|
|
1165
|
-
case "w":
|
|
1166
|
-
formatter = weekGetter(1);
|
|
1167
|
-
break;
|
|
1168
|
-
case "ww":
|
|
1169
|
-
formatter = weekGetter(2);
|
|
1170
|
-
break;
|
|
1171
|
-
case "W":
|
|
1172
|
-
formatter = weekGetter(1, true);
|
|
1173
|
-
break;
|
|
1174
|
-
case "d":
|
|
1175
|
-
formatter = dateGetter(2, 1);
|
|
1176
|
-
break;
|
|
1177
|
-
case "dd":
|
|
1178
|
-
formatter = dateGetter(2, 2);
|
|
1179
|
-
break;
|
|
1180
|
-
case "c":
|
|
1181
|
-
case "cc":
|
|
1182
|
-
formatter = dateGetter(7, 1);
|
|
1183
|
-
break;
|
|
1184
|
-
case "ccc":
|
|
1185
|
-
formatter = dateStrGetter(1, TranslationWidth.Abbreviated, FormStyle.Standalone);
|
|
1186
|
-
break;
|
|
1187
|
-
case "cccc":
|
|
1188
|
-
formatter = dateStrGetter(1, TranslationWidth.Wide, FormStyle.Standalone);
|
|
1189
|
-
break;
|
|
1190
|
-
case "ccccc":
|
|
1191
|
-
formatter = dateStrGetter(1, TranslationWidth.Narrow, FormStyle.Standalone);
|
|
1192
|
-
break;
|
|
1193
|
-
case "cccccc":
|
|
1194
|
-
formatter = dateStrGetter(1, TranslationWidth.Short, FormStyle.Standalone);
|
|
1195
|
-
break;
|
|
1196
|
-
case "E":
|
|
1197
|
-
case "EE":
|
|
1198
|
-
case "EEE":
|
|
1199
|
-
formatter = dateStrGetter(1, TranslationWidth.Abbreviated);
|
|
1200
|
-
break;
|
|
1201
|
-
case "EEEE":
|
|
1202
|
-
formatter = dateStrGetter(1, TranslationWidth.Wide);
|
|
1203
|
-
break;
|
|
1204
|
-
case "EEEEE":
|
|
1205
|
-
formatter = dateStrGetter(1, TranslationWidth.Narrow);
|
|
1206
|
-
break;
|
|
1207
|
-
case "EEEEEE":
|
|
1208
|
-
formatter = dateStrGetter(1, TranslationWidth.Short);
|
|
1209
|
-
break;
|
|
1210
|
-
case "a":
|
|
1211
|
-
case "aa":
|
|
1212
|
-
case "aaa":
|
|
1213
|
-
formatter = dateStrGetter(0, TranslationWidth.Abbreviated);
|
|
1214
|
-
break;
|
|
1215
|
-
case "aaaa":
|
|
1216
|
-
formatter = dateStrGetter(0, TranslationWidth.Wide);
|
|
1217
|
-
break;
|
|
1218
|
-
case "aaaaa":
|
|
1219
|
-
formatter = dateStrGetter(0, TranslationWidth.Narrow);
|
|
1220
|
-
break;
|
|
1221
|
-
case "b":
|
|
1222
|
-
case "bb":
|
|
1223
|
-
case "bbb":
|
|
1224
|
-
formatter = dateStrGetter(0, TranslationWidth.Abbreviated, FormStyle.Standalone, true);
|
|
1225
|
-
break;
|
|
1226
|
-
case "bbbb":
|
|
1227
|
-
formatter = dateStrGetter(0, TranslationWidth.Wide, FormStyle.Standalone, true);
|
|
1228
|
-
break;
|
|
1229
|
-
case "bbbbb":
|
|
1230
|
-
formatter = dateStrGetter(0, TranslationWidth.Narrow, FormStyle.Standalone, true);
|
|
1231
|
-
break;
|
|
1232
|
-
case "B":
|
|
1233
|
-
case "BB":
|
|
1234
|
-
case "BBB":
|
|
1235
|
-
formatter = dateStrGetter(0, TranslationWidth.Abbreviated, FormStyle.Format, true);
|
|
1236
|
-
break;
|
|
1237
|
-
case "BBBB":
|
|
1238
|
-
formatter = dateStrGetter(0, TranslationWidth.Wide, FormStyle.Format, true);
|
|
1239
|
-
break;
|
|
1240
|
-
case "BBBBB":
|
|
1241
|
-
formatter = dateStrGetter(0, TranslationWidth.Narrow, FormStyle.Format, true);
|
|
1242
|
-
break;
|
|
1243
|
-
case "h":
|
|
1244
|
-
formatter = dateGetter(3, 1, -12);
|
|
1245
|
-
break;
|
|
1246
|
-
case "hh":
|
|
1247
|
-
formatter = dateGetter(3, 2, -12);
|
|
1248
|
-
break;
|
|
1249
|
-
case "H":
|
|
1250
|
-
formatter = dateGetter(3, 1);
|
|
1251
|
-
break;
|
|
1252
|
-
case "HH":
|
|
1253
|
-
formatter = dateGetter(3, 2);
|
|
1254
|
-
break;
|
|
1255
|
-
case "m":
|
|
1256
|
-
formatter = dateGetter(4, 1);
|
|
1257
|
-
break;
|
|
1258
|
-
case "mm":
|
|
1259
|
-
formatter = dateGetter(4, 2);
|
|
1260
|
-
break;
|
|
1261
|
-
case "s":
|
|
1262
|
-
formatter = dateGetter(5, 1);
|
|
1263
|
-
break;
|
|
1264
|
-
case "ss":
|
|
1265
|
-
formatter = dateGetter(5, 2);
|
|
1266
|
-
break;
|
|
1267
|
-
case "S":
|
|
1268
|
-
formatter = dateGetter(6, 1);
|
|
1269
|
-
break;
|
|
1270
|
-
case "SS":
|
|
1271
|
-
formatter = dateGetter(6, 2);
|
|
1272
|
-
break;
|
|
1273
|
-
case "SSS":
|
|
1274
|
-
formatter = dateGetter(6, 3);
|
|
1275
|
-
break;
|
|
1276
|
-
case "Z":
|
|
1277
|
-
case "ZZ":
|
|
1278
|
-
case "ZZZ":
|
|
1279
|
-
formatter = timeZoneGetter(0);
|
|
1280
|
-
break;
|
|
1281
|
-
case "ZZZZZ":
|
|
1282
|
-
formatter = timeZoneGetter(3);
|
|
1283
|
-
break;
|
|
1284
|
-
case "O":
|
|
1285
|
-
case "OO":
|
|
1286
|
-
case "OOO":
|
|
1287
|
-
case "z":
|
|
1288
|
-
case "zz":
|
|
1289
|
-
case "zzz":
|
|
1290
|
-
formatter = timeZoneGetter(1);
|
|
1291
|
-
break;
|
|
1292
|
-
case "OOOO":
|
|
1293
|
-
case "ZZZZ":
|
|
1294
|
-
case "zzzz":
|
|
1295
|
-
formatter = timeZoneGetter(2);
|
|
1296
|
-
break;
|
|
1297
|
-
default:
|
|
1298
|
-
return null;
|
|
1299
|
-
}
|
|
1300
|
-
DATE_FORMATS[format] = formatter;
|
|
1301
|
-
return formatter;
|
|
1302
|
-
}
|
|
1303
|
-
function timezoneToOffset(timezone, fallback) {
|
|
1304
|
-
timezone = timezone.replace(/:/g, "");
|
|
1305
|
-
const requestedTimezoneOffset = Date.parse("Jan 01, 1970 00:00:00 " + timezone) / 60000;
|
|
1306
|
-
return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
|
|
1307
|
-
}
|
|
1308
|
-
function addDateMinutes(date, minutes) {
|
|
1309
|
-
date = new Date(date.getTime());
|
|
1310
|
-
date.setMinutes(date.getMinutes() + minutes);
|
|
1311
|
-
return date;
|
|
1312
|
-
}
|
|
1313
|
-
function convertTimezoneToLocal(date, timezone, reverse) {
|
|
1314
|
-
const reverseValue = -1;
|
|
1315
|
-
const dateTimezoneOffset = date.getTimezoneOffset();
|
|
1316
|
-
const timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
|
|
1317
|
-
return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));
|
|
1318
|
-
}
|
|
1319
|
-
function toDate(value) {
|
|
1320
|
-
if (isDate(value)) {
|
|
1321
|
-
return value;
|
|
1322
|
-
}
|
|
1323
|
-
if (typeof value === "number" && !isNaN(value)) {
|
|
1324
|
-
return new Date(value);
|
|
1325
|
-
}
|
|
1326
|
-
if (typeof value === "string") {
|
|
1327
|
-
value = value.trim();
|
|
1328
|
-
if (/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(value)) {
|
|
1329
|
-
const [y, m = 1, d = 1] = value.split("-").map((val) => +val);
|
|
1330
|
-
return createDate(y, m - 1, d);
|
|
1331
|
-
}
|
|
1332
|
-
const parsedNb = parseFloat(value);
|
|
1333
|
-
if (!isNaN(value - parsedNb)) {
|
|
1334
|
-
return new Date(parsedNb);
|
|
1335
|
-
}
|
|
1336
|
-
let match;
|
|
1337
|
-
if (match = value.match(ISO8601_DATE_REGEX)) {
|
|
1338
|
-
return isoStringToDate(match);
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1341
|
-
const date = new Date(value);
|
|
1342
|
-
if (!isDate(date)) {
|
|
1343
|
-
throw new RuntimeError(2311, ngDevMode && `Unable to convert "${value}" into a date`);
|
|
1344
|
-
}
|
|
1345
|
-
return date;
|
|
1346
|
-
}
|
|
1347
|
-
function isoStringToDate(match) {
|
|
1348
|
-
const date = new Date(0);
|
|
1349
|
-
let tzHour = 0;
|
|
1350
|
-
let tzMin = 0;
|
|
1351
|
-
const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;
|
|
1352
|
-
const timeSetter = match[8] ? date.setUTCHours : date.setHours;
|
|
1353
|
-
if (match[9]) {
|
|
1354
|
-
tzHour = Number(match[9] + match[10]);
|
|
1355
|
-
tzMin = Number(match[9] + match[11]);
|
|
1356
|
-
}
|
|
1357
|
-
dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));
|
|
1358
|
-
const h = Number(match[4] || 0) - tzHour;
|
|
1359
|
-
const m = Number(match[5] || 0) - tzMin;
|
|
1360
|
-
const s = Number(match[6] || 0);
|
|
1361
|
-
const ms = Math.floor(parseFloat("0." + (match[7] || 0)) * 1000);
|
|
1362
|
-
timeSetter.call(date, h, m, s, ms);
|
|
1363
|
-
return date;
|
|
1364
|
-
}
|
|
1365
|
-
function isDate(value) {
|
|
1366
|
-
return value instanceof Date && !isNaN(value.valueOf());
|
|
1367
|
-
}
|
|
1368
|
-
var NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/;
|
|
1369
|
-
var MAX_DIGITS = 22;
|
|
1370
|
-
var DECIMAL_SEP = ".";
|
|
1371
|
-
var ZERO_CHAR = "0";
|
|
1372
|
-
var PATTERN_SEP = ";";
|
|
1373
|
-
var GROUP_SEP = ",";
|
|
1374
|
-
var DIGIT_CHAR = "#";
|
|
1375
|
-
var CURRENCY_CHAR = "\xA4";
|
|
1376
|
-
var PERCENT_CHAR = "%";
|
|
1377
|
-
function formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimalSymbol, digitsInfo, isPercent = false) {
|
|
1378
|
-
let formattedText = "";
|
|
1379
|
-
let isZero = false;
|
|
1380
|
-
if (!isFinite(value)) {
|
|
1381
|
-
formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity);
|
|
1382
|
-
} else {
|
|
1383
|
-
let parsedNumber = parseNumber(value);
|
|
1384
|
-
if (isPercent) {
|
|
1385
|
-
parsedNumber = toPercent(parsedNumber);
|
|
1386
|
-
}
|
|
1387
|
-
let minInt = pattern.minInt;
|
|
1388
|
-
let minFraction = pattern.minFrac;
|
|
1389
|
-
let maxFraction = pattern.maxFrac;
|
|
1390
|
-
if (digitsInfo) {
|
|
1391
|
-
const parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);
|
|
1392
|
-
if (parts === null) {
|
|
1393
|
-
throw new RuntimeError(2306, ngDevMode && `${digitsInfo} is not a valid digit info`);
|
|
1394
|
-
}
|
|
1395
|
-
const minIntPart = parts[1];
|
|
1396
|
-
const minFractionPart = parts[3];
|
|
1397
|
-
const maxFractionPart = parts[5];
|
|
1398
|
-
if (minIntPart != null) {
|
|
1399
|
-
minInt = parseIntAutoRadix(minIntPart);
|
|
1400
|
-
}
|
|
1401
|
-
if (minFractionPart != null) {
|
|
1402
|
-
minFraction = parseIntAutoRadix(minFractionPart);
|
|
1403
|
-
}
|
|
1404
|
-
if (maxFractionPart != null) {
|
|
1405
|
-
maxFraction = parseIntAutoRadix(maxFractionPart);
|
|
1406
|
-
} else if (minFractionPart != null && minFraction > maxFraction) {
|
|
1407
|
-
maxFraction = minFraction;
|
|
1408
|
-
}
|
|
1409
|
-
}
|
|
1410
|
-
roundNumber(parsedNumber, minFraction, maxFraction);
|
|
1411
|
-
let digits = parsedNumber.digits;
|
|
1412
|
-
let integerLen = parsedNumber.integerLen;
|
|
1413
|
-
const exponent = parsedNumber.exponent;
|
|
1414
|
-
let decimals = [];
|
|
1415
|
-
isZero = digits.every((d) => !d);
|
|
1416
|
-
for (;integerLen < minInt; integerLen++) {
|
|
1417
|
-
digits.unshift(0);
|
|
1418
|
-
}
|
|
1419
|
-
for (;integerLen < 0; integerLen++) {
|
|
1420
|
-
digits.unshift(0);
|
|
1421
|
-
}
|
|
1422
|
-
if (integerLen > 0) {
|
|
1423
|
-
decimals = digits.splice(integerLen, digits.length);
|
|
1424
|
-
} else {
|
|
1425
|
-
decimals = digits;
|
|
1426
|
-
digits = [0];
|
|
1427
|
-
}
|
|
1428
|
-
const groups = [];
|
|
1429
|
-
if (digits.length >= pattern.lgSize) {
|
|
1430
|
-
groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(""));
|
|
1431
|
-
}
|
|
1432
|
-
while (digits.length > pattern.gSize) {
|
|
1433
|
-
groups.unshift(digits.splice(-pattern.gSize, digits.length).join(""));
|
|
1434
|
-
}
|
|
1435
|
-
if (digits.length) {
|
|
1436
|
-
groups.unshift(digits.join(""));
|
|
1437
|
-
}
|
|
1438
|
-
formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol));
|
|
1439
|
-
if (decimals.length) {
|
|
1440
|
-
formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join("");
|
|
1441
|
-
}
|
|
1442
|
-
if (exponent) {
|
|
1443
|
-
formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + "+" + exponent;
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
if (value < 0 && !isZero) {
|
|
1447
|
-
formattedText = pattern.negPre + formattedText + pattern.negSuf;
|
|
1448
|
-
} else {
|
|
1449
|
-
formattedText = pattern.posPre + formattedText + pattern.posSuf;
|
|
1450
|
-
}
|
|
1451
|
-
return formattedText;
|
|
1452
|
-
}
|
|
1453
|
-
function formatCurrency(value, locale, currency, currencyCode, digitsInfo) {
|
|
1454
|
-
const format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency);
|
|
1455
|
-
const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
|
|
1456
|
-
pattern.minFrac = getNumberOfCurrencyDigits(currencyCode);
|
|
1457
|
-
pattern.maxFrac = pattern.minFrac;
|
|
1458
|
-
const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.CurrencyGroup, NumberSymbol.CurrencyDecimal, digitsInfo);
|
|
1459
|
-
return res.replace(CURRENCY_CHAR, currency).replace(CURRENCY_CHAR, "").trim();
|
|
1460
|
-
}
|
|
1461
|
-
function formatPercent(value, locale, digitsInfo) {
|
|
1462
|
-
const format = getLocaleNumberFormat(locale, NumberFormatStyle.Percent);
|
|
1463
|
-
const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
|
|
1464
|
-
const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo, true);
|
|
1465
|
-
return res.replace(new RegExp(PERCENT_CHAR, "g"), getLocaleNumberSymbol(locale, NumberSymbol.PercentSign));
|
|
1466
|
-
}
|
|
1467
|
-
function formatNumber(value, locale, digitsInfo) {
|
|
1468
|
-
const format = getLocaleNumberFormat(locale, NumberFormatStyle.Decimal);
|
|
1469
|
-
const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
|
|
1470
|
-
return formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo);
|
|
1471
|
-
}
|
|
1472
|
-
function parseNumberFormat(format, minusSign = "-") {
|
|
1473
|
-
const p = {
|
|
1474
|
-
minInt: 1,
|
|
1475
|
-
minFrac: 0,
|
|
1476
|
-
maxFrac: 0,
|
|
1477
|
-
posPre: "",
|
|
1478
|
-
posSuf: "",
|
|
1479
|
-
negPre: "",
|
|
1480
|
-
negSuf: "",
|
|
1481
|
-
gSize: 0,
|
|
1482
|
-
lgSize: 0
|
|
1483
|
-
};
|
|
1484
|
-
const patternParts = format.split(PATTERN_SEP);
|
|
1485
|
-
const positive = patternParts[0];
|
|
1486
|
-
const negative = patternParts[1];
|
|
1487
|
-
const positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ? positive.split(DECIMAL_SEP) : [positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1), positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)], integer = positiveParts[0], fraction = positiveParts[1] || "";
|
|
1488
|
-
p.posPre = integer.substring(0, integer.indexOf(DIGIT_CHAR));
|
|
1489
|
-
for (let i = 0;i < fraction.length; i++) {
|
|
1490
|
-
const ch = fraction.charAt(i);
|
|
1491
|
-
if (ch === ZERO_CHAR) {
|
|
1492
|
-
p.minFrac = p.maxFrac = i + 1;
|
|
1493
|
-
} else if (ch === DIGIT_CHAR) {
|
|
1494
|
-
p.maxFrac = i + 1;
|
|
1495
|
-
} else {
|
|
1496
|
-
p.posSuf += ch;
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
const groups = integer.split(GROUP_SEP);
|
|
1500
|
-
p.gSize = groups[1] ? groups[1].length : 0;
|
|
1501
|
-
p.lgSize = groups[2] || groups[1] ? (groups[2] || groups[1]).length : 0;
|
|
1502
|
-
if (negative) {
|
|
1503
|
-
const trunkLen = positive.length - p.posPre.length - p.posSuf.length, pos = negative.indexOf(DIGIT_CHAR);
|
|
1504
|
-
p.negPre = negative.substring(0, pos).replace(/'/g, "");
|
|
1505
|
-
p.negSuf = negative.slice(pos + trunkLen).replace(/'/g, "");
|
|
1506
|
-
} else {
|
|
1507
|
-
p.negPre = minusSign + p.posPre;
|
|
1508
|
-
p.negSuf = p.posSuf;
|
|
1509
|
-
}
|
|
1510
|
-
return p;
|
|
1511
|
-
}
|
|
1512
|
-
function toPercent(parsedNumber) {
|
|
1513
|
-
if (parsedNumber.digits[0] === 0) {
|
|
1514
|
-
return parsedNumber;
|
|
1515
|
-
}
|
|
1516
|
-
const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;
|
|
1517
|
-
if (parsedNumber.exponent) {
|
|
1518
|
-
parsedNumber.exponent += 2;
|
|
1519
|
-
} else {
|
|
1520
|
-
if (fractionLen === 0) {
|
|
1521
|
-
parsedNumber.digits.push(0, 0);
|
|
1522
|
-
} else if (fractionLen === 1) {
|
|
1523
|
-
parsedNumber.digits.push(0);
|
|
1524
|
-
}
|
|
1525
|
-
parsedNumber.integerLen += 2;
|
|
1526
|
-
}
|
|
1527
|
-
return parsedNumber;
|
|
1528
|
-
}
|
|
1529
|
-
function parseNumber(num) {
|
|
1530
|
-
let numStr = Math.abs(num) + "";
|
|
1531
|
-
let exponent = 0, digits, integerLen;
|
|
1532
|
-
let i, j, zeros;
|
|
1533
|
-
if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {
|
|
1534
|
-
numStr = numStr.replace(DECIMAL_SEP, "");
|
|
1535
|
-
}
|
|
1536
|
-
if ((i = numStr.search(/e/i)) > 0) {
|
|
1537
|
-
if (integerLen < 0)
|
|
1538
|
-
integerLen = i;
|
|
1539
|
-
integerLen += +numStr.slice(i + 1);
|
|
1540
|
-
numStr = numStr.substring(0, i);
|
|
1541
|
-
} else if (integerLen < 0) {
|
|
1542
|
-
integerLen = numStr.length;
|
|
1543
|
-
}
|
|
1544
|
-
for (i = 0;numStr.charAt(i) === ZERO_CHAR; i++) {}
|
|
1545
|
-
if (i === (zeros = numStr.length)) {
|
|
1546
|
-
digits = [0];
|
|
1547
|
-
integerLen = 1;
|
|
1548
|
-
} else {
|
|
1549
|
-
zeros--;
|
|
1550
|
-
while (numStr.charAt(zeros) === ZERO_CHAR)
|
|
1551
|
-
zeros--;
|
|
1552
|
-
integerLen -= i;
|
|
1553
|
-
digits = [];
|
|
1554
|
-
for (j = 0;i <= zeros; i++, j++) {
|
|
1555
|
-
digits[j] = Number(numStr.charAt(i));
|
|
1556
|
-
}
|
|
1557
|
-
}
|
|
1558
|
-
if (integerLen > MAX_DIGITS) {
|
|
1559
|
-
digits = digits.splice(0, MAX_DIGITS - 1);
|
|
1560
|
-
exponent = integerLen - 1;
|
|
1561
|
-
integerLen = 1;
|
|
1562
|
-
}
|
|
1563
|
-
return {
|
|
1564
|
-
digits,
|
|
1565
|
-
exponent,
|
|
1566
|
-
integerLen
|
|
1567
|
-
};
|
|
1568
|
-
}
|
|
1569
|
-
function roundNumber(parsedNumber, minFrac, maxFrac) {
|
|
1570
|
-
if (minFrac > maxFrac) {
|
|
1571
|
-
throw new RuntimeError(2307, ngDevMode && `The minimum number of digits after fraction (${minFrac}) is higher than the maximum (${maxFrac}).`);
|
|
1572
|
-
}
|
|
1573
|
-
let digits = parsedNumber.digits;
|
|
1574
|
-
let fractionLen = digits.length - parsedNumber.integerLen;
|
|
1575
|
-
const fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac);
|
|
1576
|
-
let roundAt = fractionSize + parsedNumber.integerLen;
|
|
1577
|
-
let digit = digits[roundAt];
|
|
1578
|
-
if (roundAt > 0) {
|
|
1579
|
-
digits.splice(Math.max(parsedNumber.integerLen, roundAt));
|
|
1580
|
-
for (let j = roundAt;j < digits.length; j++) {
|
|
1581
|
-
digits[j] = 0;
|
|
1582
|
-
}
|
|
1583
|
-
} else {
|
|
1584
|
-
fractionLen = Math.max(0, fractionLen);
|
|
1585
|
-
parsedNumber.integerLen = 1;
|
|
1586
|
-
digits.length = Math.max(1, roundAt = fractionSize + 1);
|
|
1587
|
-
digits[0] = 0;
|
|
1588
|
-
for (let i = 1;i < roundAt; i++)
|
|
1589
|
-
digits[i] = 0;
|
|
1590
|
-
}
|
|
1591
|
-
if (digit >= 5) {
|
|
1592
|
-
if (roundAt - 1 < 0) {
|
|
1593
|
-
for (let k = 0;k > roundAt; k--) {
|
|
1594
|
-
digits.unshift(0);
|
|
1595
|
-
parsedNumber.integerLen++;
|
|
1596
|
-
}
|
|
1597
|
-
digits.unshift(1);
|
|
1598
|
-
parsedNumber.integerLen++;
|
|
1599
|
-
} else {
|
|
1600
|
-
digits[roundAt - 1]++;
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
for (;fractionLen < Math.max(0, fractionSize); fractionLen++)
|
|
1604
|
-
digits.push(0);
|
|
1605
|
-
let dropTrailingZeros = fractionSize !== 0;
|
|
1606
|
-
const minLen = minFrac + parsedNumber.integerLen;
|
|
1607
|
-
const carry = digits.reduceRight(function(carry2, d, i, digits2) {
|
|
1608
|
-
d = d + carry2;
|
|
1609
|
-
digits2[i] = d < 10 ? d : d - 10;
|
|
1610
|
-
if (dropTrailingZeros) {
|
|
1611
|
-
if (digits2[i] === 0 && i >= minLen) {
|
|
1612
|
-
digits2.pop();
|
|
1613
|
-
} else {
|
|
1614
|
-
dropTrailingZeros = false;
|
|
1615
|
-
}
|
|
1616
|
-
}
|
|
1617
|
-
return d >= 10 ? 1 : 0;
|
|
1618
|
-
}, 0);
|
|
1619
|
-
if (carry) {
|
|
1620
|
-
digits.unshift(carry);
|
|
1621
|
-
parsedNumber.integerLen++;
|
|
1622
|
-
}
|
|
1623
|
-
}
|
|
1624
|
-
function parseIntAutoRadix(text) {
|
|
1625
|
-
const result = parseInt(text);
|
|
1626
|
-
if (isNaN(result)) {
|
|
1627
|
-
throw new RuntimeError(2305, ngDevMode && "Invalid integer literal when parsing " + text);
|
|
1628
|
-
}
|
|
1629
|
-
return result;
|
|
1630
|
-
}
|
|
1631
|
-
|
|
1632
|
-
class NgLocalization {
|
|
1633
|
-
static \u{275}fac = function NgLocalization_Factory(__ngFactoryType__) {
|
|
1634
|
-
return new (__ngFactoryType__ || NgLocalization);
|
|
1635
|
-
};
|
|
1636
|
-
static \u{275}prov = /* @__PURE__ */ \u{275}_defineInjectable({
|
|
1637
|
-
token: NgLocalization,
|
|
1638
|
-
factory: () => (() => new NgLocaleLocalization(inject(LOCALE_ID)))(),
|
|
1639
|
-
providedIn: "root"
|
|
1640
|
-
});
|
|
1641
|
-
}
|
|
1642
|
-
(() => {
|
|
1643
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgLocalization, [{
|
|
1644
|
-
type: Injectable,
|
|
1645
|
-
args: [{
|
|
1646
|
-
providedIn: "root",
|
|
1647
|
-
useFactory: () => new NgLocaleLocalization(inject(LOCALE_ID))
|
|
1648
|
-
}]
|
|
1649
|
-
}], null, null);
|
|
1650
|
-
})();
|
|
1651
|
-
function getPluralCategory(value, cases, ngLocalization, locale) {
|
|
1652
|
-
let key = `=${value}`;
|
|
1653
|
-
if (cases.indexOf(key) > -1) {
|
|
1654
|
-
return key;
|
|
1655
|
-
}
|
|
1656
|
-
key = ngLocalization.getPluralCategory(value, locale);
|
|
1657
|
-
if (cases.indexOf(key) > -1) {
|
|
1658
|
-
return key;
|
|
1659
|
-
}
|
|
1660
|
-
if (cases.indexOf("other") > -1) {
|
|
1661
|
-
return "other";
|
|
1662
|
-
}
|
|
1663
|
-
throw new RuntimeError(2308, ngDevMode && `No plural message found for value "${value}"`);
|
|
1664
|
-
}
|
|
1665
|
-
|
|
1666
|
-
class NgLocaleLocalization extends NgLocalization {
|
|
1667
|
-
locale;
|
|
1668
|
-
constructor(locale) {
|
|
1669
|
-
super();
|
|
1670
|
-
this.locale = locale;
|
|
1671
|
-
}
|
|
1672
|
-
getPluralCategory(value, locale) {
|
|
1673
|
-
const plural = getLocalePluralCase2(locale || this.locale)(value);
|
|
1674
|
-
switch (plural) {
|
|
1675
|
-
case Plural.Zero:
|
|
1676
|
-
return "zero";
|
|
1677
|
-
case Plural.One:
|
|
1678
|
-
return "one";
|
|
1679
|
-
case Plural.Two:
|
|
1680
|
-
return "two";
|
|
1681
|
-
case Plural.Few:
|
|
1682
|
-
return "few";
|
|
1683
|
-
case Plural.Many:
|
|
1684
|
-
return "many";
|
|
1685
|
-
default:
|
|
1686
|
-
return "other";
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
static \u{275}fac = function NgLocaleLocalization_Factory(__ngFactoryType__) {
|
|
1690
|
-
return new (__ngFactoryType__ || NgLocaleLocalization)(\u{275}_inject(LOCALE_ID));
|
|
1691
|
-
};
|
|
1692
|
-
static \u{275}prov = /* @__PURE__ */ \u{275}_defineInjectable({
|
|
1693
|
-
token: NgLocaleLocalization,
|
|
1694
|
-
factory: NgLocaleLocalization.\u{275}fac
|
|
1695
|
-
});
|
|
1696
|
-
}
|
|
1697
|
-
(() => {
|
|
1698
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgLocaleLocalization, [{
|
|
1699
|
-
type: Injectable
|
|
1700
|
-
}], () => [{
|
|
1701
|
-
type: undefined,
|
|
1702
|
-
decorators: [{
|
|
1703
|
-
type: Inject,
|
|
1704
|
-
args: [LOCALE_ID]
|
|
1705
|
-
}]
|
|
1706
|
-
}], null);
|
|
1707
|
-
})();
|
|
1708
|
-
var WS_REGEXP = /\s+/;
|
|
1709
|
-
var EMPTY_ARRAY = [];
|
|
1710
|
-
|
|
1711
|
-
class NgClass {
|
|
1712
|
-
_ngEl;
|
|
1713
|
-
_renderer;
|
|
1714
|
-
initialClasses = EMPTY_ARRAY;
|
|
1715
|
-
rawClass;
|
|
1716
|
-
stateMap = new Map;
|
|
1717
|
-
constructor(_ngEl, _renderer) {
|
|
1718
|
-
this._ngEl = _ngEl;
|
|
1719
|
-
this._renderer = _renderer;
|
|
1720
|
-
}
|
|
1721
|
-
set klass(value) {
|
|
1722
|
-
this.initialClasses = value != null ? value.trim().split(WS_REGEXP) : EMPTY_ARRAY;
|
|
1723
|
-
}
|
|
1724
|
-
set ngClass(value) {
|
|
1725
|
-
this.rawClass = typeof value === "string" ? value.trim().split(WS_REGEXP) : value;
|
|
1726
|
-
}
|
|
1727
|
-
ngDoCheck() {
|
|
1728
|
-
for (const klass of this.initialClasses) {
|
|
1729
|
-
this._updateState(klass, true);
|
|
1730
|
-
}
|
|
1731
|
-
const rawClass = this.rawClass;
|
|
1732
|
-
if (Array.isArray(rawClass) || rawClass instanceof Set) {
|
|
1733
|
-
for (const klass of rawClass) {
|
|
1734
|
-
this._updateState(klass, true);
|
|
1735
|
-
}
|
|
1736
|
-
} else if (rawClass != null) {
|
|
1737
|
-
for (const klass of Object.keys(rawClass)) {
|
|
1738
|
-
this._updateState(klass, Boolean(rawClass[klass]));
|
|
1739
|
-
}
|
|
1740
|
-
}
|
|
1741
|
-
this._applyStateDiff();
|
|
1742
|
-
}
|
|
1743
|
-
_updateState(klass, nextEnabled) {
|
|
1744
|
-
const state = this.stateMap.get(klass);
|
|
1745
|
-
if (state !== undefined) {
|
|
1746
|
-
if (state.enabled !== nextEnabled) {
|
|
1747
|
-
state.changed = true;
|
|
1748
|
-
state.enabled = nextEnabled;
|
|
1749
|
-
}
|
|
1750
|
-
state.touched = true;
|
|
1751
|
-
} else {
|
|
1752
|
-
this.stateMap.set(klass, {
|
|
1753
|
-
enabled: nextEnabled,
|
|
1754
|
-
changed: true,
|
|
1755
|
-
touched: true
|
|
1756
|
-
});
|
|
1757
|
-
}
|
|
1758
|
-
}
|
|
1759
|
-
_applyStateDiff() {
|
|
1760
|
-
for (const stateEntry of this.stateMap) {
|
|
1761
|
-
const klass = stateEntry[0];
|
|
1762
|
-
const state = stateEntry[1];
|
|
1763
|
-
if (state.changed) {
|
|
1764
|
-
this._toggleClass(klass, state.enabled);
|
|
1765
|
-
state.changed = false;
|
|
1766
|
-
} else if (!state.touched) {
|
|
1767
|
-
if (state.enabled) {
|
|
1768
|
-
this._toggleClass(klass, false);
|
|
1769
|
-
}
|
|
1770
|
-
this.stateMap.delete(klass);
|
|
1771
|
-
}
|
|
1772
|
-
state.touched = false;
|
|
1773
|
-
}
|
|
1774
|
-
}
|
|
1775
|
-
_toggleClass(klass, enabled) {
|
|
1776
|
-
if (ngDevMode) {
|
|
1777
|
-
if (typeof klass !== "string") {
|
|
1778
|
-
throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${stringify(klass)}`);
|
|
1779
|
-
}
|
|
1780
|
-
}
|
|
1781
|
-
klass = klass.trim();
|
|
1782
|
-
if (klass.length > 0) {
|
|
1783
|
-
klass.split(WS_REGEXP).forEach((klass2) => {
|
|
1784
|
-
if (enabled) {
|
|
1785
|
-
this._renderer.addClass(this._ngEl.nativeElement, klass2);
|
|
1786
|
-
} else {
|
|
1787
|
-
this._renderer.removeClass(this._ngEl.nativeElement, klass2);
|
|
1788
|
-
}
|
|
1789
|
-
});
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
static \u{275}fac = function NgClass_Factory(__ngFactoryType__) {
|
|
1793
|
-
return new (__ngFactoryType__ || NgClass)(\u{275}_directiveInject(ElementRef), \u{275}_directiveInject(Renderer2));
|
|
1794
|
-
};
|
|
1795
|
-
static \u{275}dir = /* @__PURE__ */ \u{275}_defineDirective({
|
|
1796
|
-
type: NgClass,
|
|
1797
|
-
selectors: [["", "ngClass", ""]],
|
|
1798
|
-
inputs: {
|
|
1799
|
-
klass: [0, "class", "klass"],
|
|
1800
|
-
ngClass: "ngClass"
|
|
1801
|
-
}
|
|
1802
|
-
});
|
|
1803
|
-
}
|
|
1804
|
-
(() => {
|
|
1805
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgClass, [{
|
|
1806
|
-
type: Directive,
|
|
1807
|
-
args: [{
|
|
1808
|
-
selector: "[ngClass]"
|
|
1809
|
-
}]
|
|
1810
|
-
}], () => [{
|
|
1811
|
-
type: ElementRef
|
|
1812
|
-
}, {
|
|
1813
|
-
type: Renderer2
|
|
1814
|
-
}], {
|
|
1815
|
-
klass: [{
|
|
1816
|
-
type: Input,
|
|
1817
|
-
args: ["class"]
|
|
1818
|
-
}],
|
|
1819
|
-
ngClass: [{
|
|
1820
|
-
type: Input,
|
|
1821
|
-
args: ["ngClass"]
|
|
1822
|
-
}]
|
|
1823
|
-
});
|
|
1824
|
-
})();
|
|
1825
|
-
|
|
1826
|
-
class NgComponentOutlet {
|
|
1827
|
-
_viewContainerRef;
|
|
1828
|
-
ngComponentOutlet = null;
|
|
1829
|
-
ngComponentOutletInputs;
|
|
1830
|
-
ngComponentOutletInjector;
|
|
1831
|
-
ngComponentOutletEnvironmentInjector;
|
|
1832
|
-
ngComponentOutletContent;
|
|
1833
|
-
ngComponentOutletNgModule;
|
|
1834
|
-
_componentRef;
|
|
1835
|
-
_moduleRef;
|
|
1836
|
-
_inputsUsed = new Map;
|
|
1837
|
-
get componentInstance() {
|
|
1838
|
-
return this._componentRef?.instance ?? null;
|
|
1839
|
-
}
|
|
1840
|
-
constructor(_viewContainerRef) {
|
|
1841
|
-
this._viewContainerRef = _viewContainerRef;
|
|
1842
|
-
}
|
|
1843
|
-
_needToReCreateNgModuleInstance(changes) {
|
|
1844
|
-
return changes["ngComponentOutletNgModule"] !== undefined;
|
|
1845
|
-
}
|
|
1846
|
-
_needToReCreateComponentInstance(changes) {
|
|
1847
|
-
return changes["ngComponentOutlet"] !== undefined || changes["ngComponentOutletContent"] !== undefined || changes["ngComponentOutletInjector"] !== undefined || changes["ngComponentOutletEnvironmentInjector"] !== undefined || this._needToReCreateNgModuleInstance(changes);
|
|
1848
|
-
}
|
|
1849
|
-
ngOnChanges(changes) {
|
|
1850
|
-
if (this._needToReCreateComponentInstance(changes)) {
|
|
1851
|
-
this._viewContainerRef.clear();
|
|
1852
|
-
this._inputsUsed.clear();
|
|
1853
|
-
this._componentRef = undefined;
|
|
1854
|
-
if (this.ngComponentOutlet) {
|
|
1855
|
-
const injector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector;
|
|
1856
|
-
if (this._needToReCreateNgModuleInstance(changes)) {
|
|
1857
|
-
this._moduleRef?.destroy();
|
|
1858
|
-
if (this.ngComponentOutletNgModule) {
|
|
1859
|
-
this._moduleRef = createNgModule(this.ngComponentOutletNgModule, getParentInjector(injector));
|
|
1860
|
-
} else {
|
|
1861
|
-
this._moduleRef = undefined;
|
|
1862
|
-
}
|
|
1863
|
-
}
|
|
1864
|
-
this._componentRef = this._viewContainerRef.createComponent(this.ngComponentOutlet, {
|
|
1865
|
-
injector,
|
|
1866
|
-
ngModuleRef: this._moduleRef,
|
|
1867
|
-
projectableNodes: this.ngComponentOutletContent,
|
|
1868
|
-
environmentInjector: this.ngComponentOutletEnvironmentInjector
|
|
1869
|
-
});
|
|
1870
|
-
}
|
|
1871
|
-
}
|
|
1872
|
-
}
|
|
1873
|
-
ngDoCheck() {
|
|
1874
|
-
if (this._componentRef) {
|
|
1875
|
-
if (this.ngComponentOutletInputs) {
|
|
1876
|
-
for (const inputName of Object.keys(this.ngComponentOutletInputs)) {
|
|
1877
|
-
this._inputsUsed.set(inputName, true);
|
|
1878
|
-
}
|
|
1879
|
-
}
|
|
1880
|
-
this._applyInputStateDiff(this._componentRef);
|
|
1881
|
-
}
|
|
1882
|
-
}
|
|
1883
|
-
ngOnDestroy() {
|
|
1884
|
-
this._moduleRef?.destroy();
|
|
1885
|
-
}
|
|
1886
|
-
_applyInputStateDiff(componentRef) {
|
|
1887
|
-
for (const [inputName, touched] of this._inputsUsed) {
|
|
1888
|
-
if (!touched) {
|
|
1889
|
-
componentRef.setInput(inputName, undefined);
|
|
1890
|
-
this._inputsUsed.delete(inputName);
|
|
1891
|
-
} else {
|
|
1892
|
-
componentRef.setInput(inputName, this.ngComponentOutletInputs[inputName]);
|
|
1893
|
-
this._inputsUsed.set(inputName, false);
|
|
1894
|
-
}
|
|
1895
|
-
}
|
|
1896
|
-
}
|
|
1897
|
-
static \u{275}fac = function NgComponentOutlet_Factory(__ngFactoryType__) {
|
|
1898
|
-
return new (__ngFactoryType__ || NgComponentOutlet)(\u{275}_directiveInject(ViewContainerRef));
|
|
1899
|
-
};
|
|
1900
|
-
static \u{275}dir = /* @__PURE__ */ \u{275}_defineDirective({
|
|
1901
|
-
type: NgComponentOutlet,
|
|
1902
|
-
selectors: [["", "ngComponentOutlet", ""]],
|
|
1903
|
-
inputs: {
|
|
1904
|
-
ngComponentOutlet: "ngComponentOutlet",
|
|
1905
|
-
ngComponentOutletInputs: "ngComponentOutletInputs",
|
|
1906
|
-
ngComponentOutletInjector: "ngComponentOutletInjector",
|
|
1907
|
-
ngComponentOutletEnvironmentInjector: "ngComponentOutletEnvironmentInjector",
|
|
1908
|
-
ngComponentOutletContent: "ngComponentOutletContent",
|
|
1909
|
-
ngComponentOutletNgModule: "ngComponentOutletNgModule"
|
|
1910
|
-
},
|
|
1911
|
-
exportAs: ["ngComponentOutlet"],
|
|
1912
|
-
features: [\u{275}_NgOnChangesFeature]
|
|
1913
|
-
});
|
|
1914
|
-
}
|
|
1915
|
-
(() => {
|
|
1916
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgComponentOutlet, [{
|
|
1917
|
-
type: Directive,
|
|
1918
|
-
args: [{
|
|
1919
|
-
selector: "[ngComponentOutlet]",
|
|
1920
|
-
exportAs: "ngComponentOutlet"
|
|
1921
|
-
}]
|
|
1922
|
-
}], () => [{
|
|
1923
|
-
type: ViewContainerRef
|
|
1924
|
-
}], {
|
|
1925
|
-
ngComponentOutlet: [{
|
|
1926
|
-
type: Input
|
|
1927
|
-
}],
|
|
1928
|
-
ngComponentOutletInputs: [{
|
|
1929
|
-
type: Input
|
|
1930
|
-
}],
|
|
1931
|
-
ngComponentOutletInjector: [{
|
|
1932
|
-
type: Input
|
|
1933
|
-
}],
|
|
1934
|
-
ngComponentOutletEnvironmentInjector: [{
|
|
1935
|
-
type: Input
|
|
1936
|
-
}],
|
|
1937
|
-
ngComponentOutletContent: [{
|
|
1938
|
-
type: Input
|
|
1939
|
-
}],
|
|
1940
|
-
ngComponentOutletNgModule: [{
|
|
1941
|
-
type: Input
|
|
1942
|
-
}]
|
|
1943
|
-
});
|
|
1944
|
-
})();
|
|
1945
|
-
function getParentInjector(injector) {
|
|
1946
|
-
const parentNgModule = injector.get(NgModuleRef$1);
|
|
1947
|
-
return parentNgModule.injector;
|
|
1948
|
-
}
|
|
1949
|
-
|
|
1950
|
-
class NgForOfContext {
|
|
1951
|
-
$implicit;
|
|
1952
|
-
ngForOf;
|
|
1953
|
-
index;
|
|
1954
|
-
count;
|
|
1955
|
-
constructor($implicit, ngForOf, index, count) {
|
|
1956
|
-
this.$implicit = $implicit;
|
|
1957
|
-
this.ngForOf = ngForOf;
|
|
1958
|
-
this.index = index;
|
|
1959
|
-
this.count = count;
|
|
1960
|
-
}
|
|
1961
|
-
get first() {
|
|
1962
|
-
return this.index === 0;
|
|
1963
|
-
}
|
|
1964
|
-
get last() {
|
|
1965
|
-
return this.index === this.count - 1;
|
|
1966
|
-
}
|
|
1967
|
-
get even() {
|
|
1968
|
-
return this.index % 2 === 0;
|
|
1969
|
-
}
|
|
1970
|
-
get odd() {
|
|
1971
|
-
return !this.even;
|
|
1972
|
-
}
|
|
1973
|
-
}
|
|
1974
|
-
|
|
1975
|
-
class NgForOf {
|
|
1976
|
-
_viewContainer;
|
|
1977
|
-
_template;
|
|
1978
|
-
_differs;
|
|
1979
|
-
set ngForOf(ngForOf) {
|
|
1980
|
-
this._ngForOf = ngForOf;
|
|
1981
|
-
this._ngForOfDirty = true;
|
|
1982
|
-
}
|
|
1983
|
-
set ngForTrackBy(fn) {
|
|
1984
|
-
if ((typeof ngDevMode === "undefined" || ngDevMode) && fn != null && typeof fn !== "function") {
|
|
1985
|
-
console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}. ` + `See https://angular.dev/api/common/NgForOf#change-propagation for more information.`);
|
|
1986
|
-
}
|
|
1987
|
-
this._trackByFn = fn;
|
|
1988
|
-
}
|
|
1989
|
-
get ngForTrackBy() {
|
|
1990
|
-
return this._trackByFn;
|
|
1991
|
-
}
|
|
1992
|
-
_ngForOf = null;
|
|
1993
|
-
_ngForOfDirty = true;
|
|
1994
|
-
_differ = null;
|
|
1995
|
-
_trackByFn;
|
|
1996
|
-
constructor(_viewContainer, _template, _differs) {
|
|
1997
|
-
this._viewContainer = _viewContainer;
|
|
1998
|
-
this._template = _template;
|
|
1999
|
-
this._differs = _differs;
|
|
2000
|
-
}
|
|
2001
|
-
set ngForTemplate(value) {
|
|
2002
|
-
if (value) {
|
|
2003
|
-
this._template = value;
|
|
2004
|
-
}
|
|
2005
|
-
}
|
|
2006
|
-
ngDoCheck() {
|
|
2007
|
-
if (this._ngForOfDirty) {
|
|
2008
|
-
this._ngForOfDirty = false;
|
|
2009
|
-
const value = this._ngForOf;
|
|
2010
|
-
if (!this._differ && value) {
|
|
2011
|
-
if (typeof ngDevMode === "undefined" || ngDevMode) {
|
|
2012
|
-
try {
|
|
2013
|
-
this._differ = this._differs.find(value).create(this.ngForTrackBy);
|
|
2014
|
-
} catch {
|
|
2015
|
-
let errorMessage = `Cannot find a differ supporting object '${value}' of type '` + `${getTypeName(value)}'. NgFor only supports binding to Iterables, such as Arrays.`;
|
|
2016
|
-
if (typeof value === "object") {
|
|
2017
|
-
errorMessage += " Did you mean to use the keyvalue pipe?";
|
|
2018
|
-
}
|
|
2019
|
-
throw new RuntimeError(-2200, errorMessage);
|
|
2020
|
-
}
|
|
2021
|
-
} else {
|
|
2022
|
-
this._differ = this._differs.find(value).create(this.ngForTrackBy);
|
|
2023
|
-
}
|
|
2024
|
-
}
|
|
2025
|
-
}
|
|
2026
|
-
if (this._differ) {
|
|
2027
|
-
const changes = this._differ.diff(this._ngForOf);
|
|
2028
|
-
if (changes)
|
|
2029
|
-
this._applyChanges(changes);
|
|
2030
|
-
}
|
|
2031
|
-
}
|
|
2032
|
-
_applyChanges(changes) {
|
|
2033
|
-
const viewContainer = this._viewContainer;
|
|
2034
|
-
changes.forEachOperation((item, adjustedPreviousIndex, currentIndex) => {
|
|
2035
|
-
if (item.previousIndex == null) {
|
|
2036
|
-
viewContainer.createEmbeddedView(this._template, new NgForOfContext(item.item, this._ngForOf, -1, -1), currentIndex === null ? undefined : currentIndex);
|
|
2037
|
-
} else if (currentIndex == null) {
|
|
2038
|
-
viewContainer.remove(adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex);
|
|
2039
|
-
} else if (adjustedPreviousIndex !== null) {
|
|
2040
|
-
const view = viewContainer.get(adjustedPreviousIndex);
|
|
2041
|
-
viewContainer.move(view, currentIndex);
|
|
2042
|
-
applyViewChange(view, item);
|
|
2043
|
-
}
|
|
2044
|
-
});
|
|
2045
|
-
for (let i = 0, ilen = viewContainer.length;i < ilen; i++) {
|
|
2046
|
-
const viewRef = viewContainer.get(i);
|
|
2047
|
-
const context = viewRef.context;
|
|
2048
|
-
context.index = i;
|
|
2049
|
-
context.count = ilen;
|
|
2050
|
-
context.ngForOf = this._ngForOf;
|
|
2051
|
-
}
|
|
2052
|
-
changes.forEachIdentityChange((record) => {
|
|
2053
|
-
const viewRef = viewContainer.get(record.currentIndex);
|
|
2054
|
-
applyViewChange(viewRef, record);
|
|
2055
|
-
});
|
|
2056
|
-
}
|
|
2057
|
-
static ngTemplateContextGuard(dir, ctx) {
|
|
2058
|
-
return true;
|
|
2059
|
-
}
|
|
2060
|
-
static \u{275}fac = function NgForOf_Factory(__ngFactoryType__) {
|
|
2061
|
-
return new (__ngFactoryType__ || NgForOf)(\u{275}_directiveInject(ViewContainerRef), \u{275}_directiveInject(TemplateRef), \u{275}_directiveInject(IterableDiffers));
|
|
2062
|
-
};
|
|
2063
|
-
static \u{275}dir = /* @__PURE__ */ \u{275}_defineDirective({
|
|
2064
|
-
type: NgForOf,
|
|
2065
|
-
selectors: [["", "ngFor", "", "ngForOf", ""]],
|
|
2066
|
-
inputs: {
|
|
2067
|
-
ngForOf: "ngForOf",
|
|
2068
|
-
ngForTrackBy: "ngForTrackBy",
|
|
2069
|
-
ngForTemplate: "ngForTemplate"
|
|
2070
|
-
}
|
|
2071
|
-
});
|
|
2072
|
-
}
|
|
2073
|
-
(() => {
|
|
2074
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgForOf, [{
|
|
2075
|
-
type: Directive,
|
|
2076
|
-
args: [{
|
|
2077
|
-
selector: "[ngFor][ngForOf]"
|
|
2078
|
-
}]
|
|
2079
|
-
}], () => [{
|
|
2080
|
-
type: ViewContainerRef
|
|
2081
|
-
}, {
|
|
2082
|
-
type: TemplateRef
|
|
2083
|
-
}, {
|
|
2084
|
-
type: IterableDiffers
|
|
2085
|
-
}], {
|
|
2086
|
-
ngForOf: [{
|
|
2087
|
-
type: Input
|
|
2088
|
-
}],
|
|
2089
|
-
ngForTrackBy: [{
|
|
2090
|
-
type: Input
|
|
2091
|
-
}],
|
|
2092
|
-
ngForTemplate: [{
|
|
2093
|
-
type: Input
|
|
2094
|
-
}]
|
|
2095
|
-
});
|
|
2096
|
-
})();
|
|
2097
|
-
function applyViewChange(view, record) {
|
|
2098
|
-
view.context.$implicit = record.item;
|
|
2099
|
-
}
|
|
2100
|
-
function getTypeName(type) {
|
|
2101
|
-
return type["name"] || typeof type;
|
|
2102
|
-
}
|
|
2103
|
-
|
|
2104
|
-
class NgIf {
|
|
2105
|
-
_viewContainer;
|
|
2106
|
-
_context = new NgIfContext;
|
|
2107
|
-
_thenTemplateRef = null;
|
|
2108
|
-
_elseTemplateRef = null;
|
|
2109
|
-
_thenViewRef = null;
|
|
2110
|
-
_elseViewRef = null;
|
|
2111
|
-
constructor(_viewContainer, templateRef) {
|
|
2112
|
-
this._viewContainer = _viewContainer;
|
|
2113
|
-
this._thenTemplateRef = templateRef;
|
|
2114
|
-
}
|
|
2115
|
-
set ngIf(condition) {
|
|
2116
|
-
this._context.$implicit = this._context.ngIf = condition;
|
|
2117
|
-
this._updateView();
|
|
2118
|
-
}
|
|
2119
|
-
set ngIfThen(templateRef) {
|
|
2120
|
-
assertTemplate(templateRef, (typeof ngDevMode === "undefined" || ngDevMode) && "ngIfThen");
|
|
2121
|
-
this._thenTemplateRef = templateRef;
|
|
2122
|
-
this._thenViewRef = null;
|
|
2123
|
-
this._updateView();
|
|
2124
|
-
}
|
|
2125
|
-
set ngIfElse(templateRef) {
|
|
2126
|
-
assertTemplate(templateRef, (typeof ngDevMode === "undefined" || ngDevMode) && "ngIfElse");
|
|
2127
|
-
this._elseTemplateRef = templateRef;
|
|
2128
|
-
this._elseViewRef = null;
|
|
2129
|
-
this._updateView();
|
|
2130
|
-
}
|
|
2131
|
-
_updateView() {
|
|
2132
|
-
if (this._context.$implicit) {
|
|
2133
|
-
if (!this._thenViewRef) {
|
|
2134
|
-
this._viewContainer.clear();
|
|
2135
|
-
this._elseViewRef = null;
|
|
2136
|
-
if (this._thenTemplateRef) {
|
|
2137
|
-
this._thenViewRef = this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);
|
|
2138
|
-
}
|
|
2139
|
-
}
|
|
2140
|
-
} else {
|
|
2141
|
-
if (!this._elseViewRef) {
|
|
2142
|
-
this._viewContainer.clear();
|
|
2143
|
-
this._thenViewRef = null;
|
|
2144
|
-
if (this._elseTemplateRef) {
|
|
2145
|
-
this._elseViewRef = this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);
|
|
2146
|
-
}
|
|
2147
|
-
}
|
|
2148
|
-
}
|
|
2149
|
-
}
|
|
2150
|
-
static ngIfUseIfTypeGuard;
|
|
2151
|
-
static ngTemplateGuard_ngIf;
|
|
2152
|
-
static ngTemplateContextGuard(dir, ctx) {
|
|
2153
|
-
return true;
|
|
2154
|
-
}
|
|
2155
|
-
static \u{275}fac = function NgIf_Factory(__ngFactoryType__) {
|
|
2156
|
-
return new (__ngFactoryType__ || NgIf)(\u{275}_directiveInject(ViewContainerRef), \u{275}_directiveInject(TemplateRef));
|
|
2157
|
-
};
|
|
2158
|
-
static \u{275}dir = /* @__PURE__ */ \u{275}_defineDirective({
|
|
2159
|
-
type: NgIf,
|
|
2160
|
-
selectors: [["", "ngIf", ""]],
|
|
2161
|
-
inputs: {
|
|
2162
|
-
ngIf: "ngIf",
|
|
2163
|
-
ngIfThen: "ngIfThen",
|
|
2164
|
-
ngIfElse: "ngIfElse"
|
|
2165
|
-
}
|
|
2166
|
-
});
|
|
2167
|
-
}
|
|
2168
|
-
(() => {
|
|
2169
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgIf, [{
|
|
2170
|
-
type: Directive,
|
|
2171
|
-
args: [{
|
|
2172
|
-
selector: "[ngIf]"
|
|
2173
|
-
}]
|
|
2174
|
-
}], () => [{
|
|
2175
|
-
type: ViewContainerRef
|
|
2176
|
-
}, {
|
|
2177
|
-
type: TemplateRef
|
|
2178
|
-
}], {
|
|
2179
|
-
ngIf: [{
|
|
2180
|
-
type: Input
|
|
2181
|
-
}],
|
|
2182
|
-
ngIfThen: [{
|
|
2183
|
-
type: Input
|
|
2184
|
-
}],
|
|
2185
|
-
ngIfElse: [{
|
|
2186
|
-
type: Input
|
|
2187
|
-
}]
|
|
2188
|
-
});
|
|
2189
|
-
})();
|
|
2190
|
-
|
|
2191
|
-
class NgIfContext {
|
|
2192
|
-
$implicit = null;
|
|
2193
|
-
ngIf = null;
|
|
2194
|
-
}
|
|
2195
|
-
function assertTemplate(templateRef, property) {
|
|
2196
|
-
if (templateRef && !templateRef.createEmbeddedView) {
|
|
2197
|
-
throw new RuntimeError(2020, (typeof ngDevMode === "undefined" || ngDevMode) && `${property} must be a TemplateRef, but received '${stringify(templateRef)}'.`);
|
|
2198
|
-
}
|
|
2199
|
-
}
|
|
2200
|
-
|
|
2201
|
-
class SwitchView {
|
|
2202
|
-
_viewContainerRef;
|
|
2203
|
-
_templateRef;
|
|
2204
|
-
_created = false;
|
|
2205
|
-
constructor(_viewContainerRef, _templateRef) {
|
|
2206
|
-
this._viewContainerRef = _viewContainerRef;
|
|
2207
|
-
this._templateRef = _templateRef;
|
|
2208
|
-
}
|
|
2209
|
-
create() {
|
|
2210
|
-
this._created = true;
|
|
2211
|
-
this._viewContainerRef.createEmbeddedView(this._templateRef);
|
|
2212
|
-
}
|
|
2213
|
-
destroy() {
|
|
2214
|
-
this._created = false;
|
|
2215
|
-
this._viewContainerRef.clear();
|
|
2216
|
-
}
|
|
2217
|
-
enforceState(created) {
|
|
2218
|
-
if (created && !this._created) {
|
|
2219
|
-
this.create();
|
|
2220
|
-
} else if (!created && this._created) {
|
|
2221
|
-
this.destroy();
|
|
2222
|
-
}
|
|
2223
|
-
}
|
|
2224
|
-
}
|
|
2225
|
-
|
|
2226
|
-
class NgSwitch {
|
|
2227
|
-
_defaultViews = [];
|
|
2228
|
-
_defaultUsed = false;
|
|
2229
|
-
_caseCount = 0;
|
|
2230
|
-
_lastCaseCheckIndex = 0;
|
|
2231
|
-
_lastCasesMatched = false;
|
|
2232
|
-
_ngSwitch;
|
|
2233
|
-
set ngSwitch(newValue) {
|
|
2234
|
-
this._ngSwitch = newValue;
|
|
2235
|
-
if (this._caseCount === 0) {
|
|
2236
|
-
this._updateDefaultCases(true);
|
|
2237
|
-
}
|
|
2238
|
-
}
|
|
2239
|
-
_addCase() {
|
|
2240
|
-
return this._caseCount++;
|
|
2241
|
-
}
|
|
2242
|
-
_addDefault(view) {
|
|
2243
|
-
this._defaultViews.push(view);
|
|
2244
|
-
}
|
|
2245
|
-
_matchCase(value) {
|
|
2246
|
-
const matched = value === this._ngSwitch;
|
|
2247
|
-
this._lastCasesMatched ||= matched;
|
|
2248
|
-
this._lastCaseCheckIndex++;
|
|
2249
|
-
if (this._lastCaseCheckIndex === this._caseCount) {
|
|
2250
|
-
this._updateDefaultCases(!this._lastCasesMatched);
|
|
2251
|
-
this._lastCaseCheckIndex = 0;
|
|
2252
|
-
this._lastCasesMatched = false;
|
|
2253
|
-
}
|
|
2254
|
-
return matched;
|
|
2255
|
-
}
|
|
2256
|
-
_updateDefaultCases(useDefault) {
|
|
2257
|
-
if (this._defaultViews.length > 0 && useDefault !== this._defaultUsed) {
|
|
2258
|
-
this._defaultUsed = useDefault;
|
|
2259
|
-
for (const defaultView of this._defaultViews) {
|
|
2260
|
-
defaultView.enforceState(useDefault);
|
|
2261
|
-
}
|
|
2262
|
-
}
|
|
2263
|
-
}
|
|
2264
|
-
static \u{275}fac = function NgSwitch_Factory(__ngFactoryType__) {
|
|
2265
|
-
return new (__ngFactoryType__ || NgSwitch);
|
|
2266
|
-
};
|
|
2267
|
-
static \u{275}dir = /* @__PURE__ */ \u{275}_defineDirective({
|
|
2268
|
-
type: NgSwitch,
|
|
2269
|
-
selectors: [["", "ngSwitch", ""]],
|
|
2270
|
-
inputs: {
|
|
2271
|
-
ngSwitch: "ngSwitch"
|
|
2272
|
-
}
|
|
2273
|
-
});
|
|
2274
|
-
}
|
|
2275
|
-
(() => {
|
|
2276
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSwitch, [{
|
|
2277
|
-
type: Directive,
|
|
2278
|
-
args: [{
|
|
2279
|
-
selector: "[ngSwitch]"
|
|
2280
|
-
}]
|
|
2281
|
-
}], null, {
|
|
2282
|
-
ngSwitch: [{
|
|
2283
|
-
type: Input
|
|
2284
|
-
}]
|
|
2285
|
-
});
|
|
2286
|
-
})();
|
|
2287
|
-
|
|
2288
|
-
class NgSwitchCase {
|
|
2289
|
-
ngSwitch;
|
|
2290
|
-
_view;
|
|
2291
|
-
ngSwitchCase;
|
|
2292
|
-
constructor(viewContainer, templateRef, ngSwitch) {
|
|
2293
|
-
this.ngSwitch = ngSwitch;
|
|
2294
|
-
if ((typeof ngDevMode === "undefined" || ngDevMode) && !ngSwitch) {
|
|
2295
|
-
throwNgSwitchProviderNotFoundError("ngSwitchCase", "NgSwitchCase");
|
|
2296
|
-
}
|
|
2297
|
-
ngSwitch._addCase();
|
|
2298
|
-
this._view = new SwitchView(viewContainer, templateRef);
|
|
2299
|
-
}
|
|
2300
|
-
ngDoCheck() {
|
|
2301
|
-
this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase));
|
|
2302
|
-
}
|
|
2303
|
-
static \u{275}fac = function NgSwitchCase_Factory(__ngFactoryType__) {
|
|
2304
|
-
return new (__ngFactoryType__ || NgSwitchCase)(\u{275}_directiveInject(ViewContainerRef), \u{275}_directiveInject(TemplateRef), \u{275}_directiveInject(NgSwitch, 9));
|
|
2305
|
-
};
|
|
2306
|
-
static \u{275}dir = /* @__PURE__ */ \u{275}_defineDirective({
|
|
2307
|
-
type: NgSwitchCase,
|
|
2308
|
-
selectors: [["", "ngSwitchCase", ""]],
|
|
2309
|
-
inputs: {
|
|
2310
|
-
ngSwitchCase: "ngSwitchCase"
|
|
2311
|
-
}
|
|
2312
|
-
});
|
|
2313
|
-
}
|
|
2314
|
-
(() => {
|
|
2315
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSwitchCase, [{
|
|
2316
|
-
type: Directive,
|
|
2317
|
-
args: [{
|
|
2318
|
-
selector: "[ngSwitchCase]"
|
|
2319
|
-
}]
|
|
2320
|
-
}], () => [{
|
|
2321
|
-
type: ViewContainerRef
|
|
2322
|
-
}, {
|
|
2323
|
-
type: TemplateRef
|
|
2324
|
-
}, {
|
|
2325
|
-
type: NgSwitch,
|
|
2326
|
-
decorators: [{
|
|
2327
|
-
type: Optional
|
|
2328
|
-
}, {
|
|
2329
|
-
type: Host
|
|
2330
|
-
}]
|
|
2331
|
-
}], {
|
|
2332
|
-
ngSwitchCase: [{
|
|
2333
|
-
type: Input
|
|
2334
|
-
}]
|
|
2335
|
-
});
|
|
2336
|
-
})();
|
|
2337
|
-
|
|
2338
|
-
class NgSwitchDefault {
|
|
2339
|
-
constructor(viewContainer, templateRef, ngSwitch) {
|
|
2340
|
-
if ((typeof ngDevMode === "undefined" || ngDevMode) && !ngSwitch) {
|
|
2341
|
-
throwNgSwitchProviderNotFoundError("ngSwitchDefault", "NgSwitchDefault");
|
|
2342
|
-
}
|
|
2343
|
-
ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));
|
|
2344
|
-
}
|
|
2345
|
-
static \u{275}fac = function NgSwitchDefault_Factory(__ngFactoryType__) {
|
|
2346
|
-
return new (__ngFactoryType__ || NgSwitchDefault)(\u{275}_directiveInject(ViewContainerRef), \u{275}_directiveInject(TemplateRef), \u{275}_directiveInject(NgSwitch, 9));
|
|
2347
|
-
};
|
|
2348
|
-
static \u{275}dir = /* @__PURE__ */ \u{275}_defineDirective({
|
|
2349
|
-
type: NgSwitchDefault,
|
|
2350
|
-
selectors: [["", "ngSwitchDefault", ""]]
|
|
2351
|
-
});
|
|
2352
|
-
}
|
|
2353
|
-
(() => {
|
|
2354
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgSwitchDefault, [{
|
|
2355
|
-
type: Directive,
|
|
2356
|
-
args: [{
|
|
2357
|
-
selector: "[ngSwitchDefault]"
|
|
2358
|
-
}]
|
|
2359
|
-
}], () => [{
|
|
2360
|
-
type: ViewContainerRef
|
|
2361
|
-
}, {
|
|
2362
|
-
type: TemplateRef
|
|
2363
|
-
}, {
|
|
2364
|
-
type: NgSwitch,
|
|
2365
|
-
decorators: [{
|
|
2366
|
-
type: Optional
|
|
2367
|
-
}, {
|
|
2368
|
-
type: Host
|
|
2369
|
-
}]
|
|
2370
|
-
}], null);
|
|
2371
|
-
})();
|
|
2372
|
-
function throwNgSwitchProviderNotFoundError(attrName, directiveName) {
|
|
2373
|
-
throw new RuntimeError(2000, `An element with the "${attrName}" attribute ` + `(matching the "${directiveName}" directive) must be located inside an element with the "ngSwitch" attribute ` + `(matching "NgSwitch" directive)`);
|
|
2374
|
-
}
|
|
2375
|
-
|
|
2376
|
-
class NgPlural {
|
|
2377
|
-
_localization;
|
|
2378
|
-
_activeView;
|
|
2379
|
-
_caseViews = {};
|
|
2380
|
-
constructor(_localization) {
|
|
2381
|
-
this._localization = _localization;
|
|
2382
|
-
}
|
|
2383
|
-
set ngPlural(value) {
|
|
2384
|
-
this._updateView(value);
|
|
2385
|
-
}
|
|
2386
|
-
addCase(value, switchView) {
|
|
2387
|
-
this._caseViews[value] = switchView;
|
|
2388
|
-
}
|
|
2389
|
-
_updateView(switchValue) {
|
|
2390
|
-
this._clearViews();
|
|
2391
|
-
const cases = Object.keys(this._caseViews);
|
|
2392
|
-
const key = getPluralCategory(switchValue, cases, this._localization);
|
|
2393
|
-
this._activateView(this._caseViews[key]);
|
|
2394
|
-
}
|
|
2395
|
-
_clearViews() {
|
|
2396
|
-
if (this._activeView)
|
|
2397
|
-
this._activeView.destroy();
|
|
2398
|
-
}
|
|
2399
|
-
_activateView(view) {
|
|
2400
|
-
if (view) {
|
|
2401
|
-
this._activeView = view;
|
|
2402
|
-
this._activeView.create();
|
|
2403
|
-
}
|
|
2404
|
-
}
|
|
2405
|
-
static \u{275}fac = function NgPlural_Factory(__ngFactoryType__) {
|
|
2406
|
-
return new (__ngFactoryType__ || NgPlural)(\u{275}_directiveInject(NgLocalization));
|
|
2407
|
-
};
|
|
2408
|
-
static \u{275}dir = /* @__PURE__ */ \u{275}_defineDirective({
|
|
2409
|
-
type: NgPlural,
|
|
2410
|
-
selectors: [["", "ngPlural", ""]],
|
|
2411
|
-
inputs: {
|
|
2412
|
-
ngPlural: "ngPlural"
|
|
2413
|
-
}
|
|
2414
|
-
});
|
|
2415
|
-
}
|
|
2416
|
-
(() => {
|
|
2417
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgPlural, [{
|
|
2418
|
-
type: Directive,
|
|
2419
|
-
args: [{
|
|
2420
|
-
selector: "[ngPlural]"
|
|
2421
|
-
}]
|
|
2422
|
-
}], () => [{
|
|
2423
|
-
type: NgLocalization
|
|
2424
|
-
}], {
|
|
2425
|
-
ngPlural: [{
|
|
2426
|
-
type: Input
|
|
2427
|
-
}]
|
|
2428
|
-
});
|
|
2429
|
-
})();
|
|
2430
|
-
|
|
2431
|
-
class NgPluralCase {
|
|
2432
|
-
value;
|
|
2433
|
-
constructor(value, template, viewContainer, ngPlural) {
|
|
2434
|
-
this.value = value;
|
|
2435
|
-
const isANumber = !isNaN(Number(value));
|
|
2436
|
-
ngPlural.addCase(isANumber ? `=${value}` : value, new SwitchView(viewContainer, template));
|
|
2437
|
-
}
|
|
2438
|
-
static \u{275}fac = function NgPluralCase_Factory(__ngFactoryType__) {
|
|
2439
|
-
return new (__ngFactoryType__ || NgPluralCase)(\u{275}_injectAttribute("ngPluralCase"), \u{275}_directiveInject(TemplateRef), \u{275}_directiveInject(ViewContainerRef), \u{275}_directiveInject(NgPlural, 1));
|
|
2440
|
-
};
|
|
2441
|
-
static \u{275}dir = /* @__PURE__ */ \u{275}_defineDirective({
|
|
2442
|
-
type: NgPluralCase,
|
|
2443
|
-
selectors: [["", "ngPluralCase", ""]]
|
|
2444
|
-
});
|
|
2445
|
-
}
|
|
2446
|
-
(() => {
|
|
2447
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgPluralCase, [{
|
|
2448
|
-
type: Directive,
|
|
2449
|
-
args: [{
|
|
2450
|
-
selector: "[ngPluralCase]"
|
|
2451
|
-
}]
|
|
2452
|
-
}], () => [{
|
|
2453
|
-
type: undefined,
|
|
2454
|
-
decorators: [{
|
|
2455
|
-
type: Attribute,
|
|
2456
|
-
args: ["ngPluralCase"]
|
|
2457
|
-
}]
|
|
2458
|
-
}, {
|
|
2459
|
-
type: TemplateRef
|
|
2460
|
-
}, {
|
|
2461
|
-
type: ViewContainerRef
|
|
2462
|
-
}, {
|
|
2463
|
-
type: NgPlural,
|
|
2464
|
-
decorators: [{
|
|
2465
|
-
type: Host
|
|
2466
|
-
}]
|
|
2467
|
-
}], null);
|
|
2468
|
-
})();
|
|
2469
|
-
|
|
2470
|
-
class NgStyle {
|
|
2471
|
-
_ngEl;
|
|
2472
|
-
_differs;
|
|
2473
|
-
_renderer;
|
|
2474
|
-
_ngStyle = null;
|
|
2475
|
-
_differ = null;
|
|
2476
|
-
constructor(_ngEl, _differs, _renderer) {
|
|
2477
|
-
this._ngEl = _ngEl;
|
|
2478
|
-
this._differs = _differs;
|
|
2479
|
-
this._renderer = _renderer;
|
|
2480
|
-
}
|
|
2481
|
-
set ngStyle(values) {
|
|
2482
|
-
this._ngStyle = values;
|
|
2483
|
-
if (!this._differ && values) {
|
|
2484
|
-
this._differ = this._differs.find(values).create();
|
|
2485
|
-
}
|
|
2486
|
-
}
|
|
2487
|
-
ngDoCheck() {
|
|
2488
|
-
if (this._differ) {
|
|
2489
|
-
const changes = this._differ.diff(this._ngStyle);
|
|
2490
|
-
if (changes) {
|
|
2491
|
-
this._applyChanges(changes);
|
|
2492
|
-
}
|
|
2493
|
-
}
|
|
2494
|
-
}
|
|
2495
|
-
_setStyle(nameAndUnit, value) {
|
|
2496
|
-
const [name, unit] = nameAndUnit.split(".");
|
|
2497
|
-
const flags = name.indexOf("-") === -1 ? undefined : RendererStyleFlags2.DashCase;
|
|
2498
|
-
if (value != null) {
|
|
2499
|
-
this._renderer.setStyle(this._ngEl.nativeElement, name, unit ? `${value}${unit}` : value, flags);
|
|
2500
|
-
} else {
|
|
2501
|
-
this._renderer.removeStyle(this._ngEl.nativeElement, name, flags);
|
|
2502
|
-
}
|
|
2503
|
-
}
|
|
2504
|
-
_applyChanges(changes) {
|
|
2505
|
-
changes.forEachRemovedItem((record) => this._setStyle(record.key, null));
|
|
2506
|
-
changes.forEachAddedItem((record) => this._setStyle(record.key, record.currentValue));
|
|
2507
|
-
changes.forEachChangedItem((record) => this._setStyle(record.key, record.currentValue));
|
|
2508
|
-
}
|
|
2509
|
-
static \u{275}fac = function NgStyle_Factory(__ngFactoryType__) {
|
|
2510
|
-
return new (__ngFactoryType__ || NgStyle)(\u{275}_directiveInject(ElementRef), \u{275}_directiveInject(KeyValueDiffers), \u{275}_directiveInject(Renderer2));
|
|
2511
|
-
};
|
|
2512
|
-
static \u{275}dir = /* @__PURE__ */ \u{275}_defineDirective({
|
|
2513
|
-
type: NgStyle,
|
|
2514
|
-
selectors: [["", "ngStyle", ""]],
|
|
2515
|
-
inputs: {
|
|
2516
|
-
ngStyle: "ngStyle"
|
|
2517
|
-
}
|
|
2518
|
-
});
|
|
2519
|
-
}
|
|
2520
|
-
(() => {
|
|
2521
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgStyle, [{
|
|
2522
|
-
type: Directive,
|
|
2523
|
-
args: [{
|
|
2524
|
-
selector: "[ngStyle]"
|
|
2525
|
-
}]
|
|
2526
|
-
}], () => [{
|
|
2527
|
-
type: ElementRef
|
|
2528
|
-
}, {
|
|
2529
|
-
type: KeyValueDiffers
|
|
2530
|
-
}, {
|
|
2531
|
-
type: Renderer2
|
|
2532
|
-
}], {
|
|
2533
|
-
ngStyle: [{
|
|
2534
|
-
type: Input,
|
|
2535
|
-
args: ["ngStyle"]
|
|
2536
|
-
}]
|
|
2537
|
-
});
|
|
2538
|
-
})();
|
|
2539
|
-
|
|
2540
|
-
class NgTemplateOutlet {
|
|
2541
|
-
_viewContainerRef;
|
|
2542
|
-
_viewRef = null;
|
|
2543
|
-
ngTemplateOutletContext = null;
|
|
2544
|
-
ngTemplateOutlet = null;
|
|
2545
|
-
ngTemplateOutletInjector = null;
|
|
2546
|
-
injector = inject(Injector);
|
|
2547
|
-
constructor(_viewContainerRef) {
|
|
2548
|
-
this._viewContainerRef = _viewContainerRef;
|
|
2549
|
-
}
|
|
2550
|
-
ngOnChanges(changes) {
|
|
2551
|
-
if (this._shouldRecreateView(changes)) {
|
|
2552
|
-
const viewContainerRef = this._viewContainerRef;
|
|
2553
|
-
if (this._viewRef) {
|
|
2554
|
-
viewContainerRef.remove(viewContainerRef.indexOf(this._viewRef));
|
|
2555
|
-
}
|
|
2556
|
-
if (!this.ngTemplateOutlet) {
|
|
2557
|
-
this._viewRef = null;
|
|
2558
|
-
return;
|
|
2559
|
-
}
|
|
2560
|
-
const viewContext = this._createContextForwardProxy();
|
|
2561
|
-
this._viewRef = viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, viewContext, {
|
|
2562
|
-
injector: this._getInjector()
|
|
2563
|
-
});
|
|
2564
|
-
}
|
|
2565
|
-
}
|
|
2566
|
-
_getInjector() {
|
|
2567
|
-
if (this.ngTemplateOutletInjector === "outlet") {
|
|
2568
|
-
return this.injector;
|
|
2569
|
-
}
|
|
2570
|
-
return this.ngTemplateOutletInjector ?? undefined;
|
|
2571
|
-
}
|
|
2572
|
-
_shouldRecreateView(changes) {
|
|
2573
|
-
return !!changes["ngTemplateOutlet"] || !!changes["ngTemplateOutletInjector"];
|
|
2574
|
-
}
|
|
2575
|
-
_createContextForwardProxy() {
|
|
2576
|
-
return new Proxy({}, {
|
|
2577
|
-
set: (_target, prop, newValue) => {
|
|
2578
|
-
if (!this.ngTemplateOutletContext) {
|
|
2579
|
-
return false;
|
|
2580
|
-
}
|
|
2581
|
-
return Reflect.set(this.ngTemplateOutletContext, prop, newValue);
|
|
2582
|
-
},
|
|
2583
|
-
get: (_target, prop, receiver) => {
|
|
2584
|
-
if (!this.ngTemplateOutletContext) {
|
|
2585
|
-
return;
|
|
2586
|
-
}
|
|
2587
|
-
return Reflect.get(this.ngTemplateOutletContext, prop, receiver);
|
|
2588
|
-
}
|
|
2589
|
-
});
|
|
2590
|
-
}
|
|
2591
|
-
static \u{275}fac = function NgTemplateOutlet_Factory(__ngFactoryType__) {
|
|
2592
|
-
return new (__ngFactoryType__ || NgTemplateOutlet)(\u{275}_directiveInject(ViewContainerRef));
|
|
2593
|
-
};
|
|
2594
|
-
static \u{275}dir = /* @__PURE__ */ \u{275}_defineDirective({
|
|
2595
|
-
type: NgTemplateOutlet,
|
|
2596
|
-
selectors: [["", "ngTemplateOutlet", ""]],
|
|
2597
|
-
inputs: {
|
|
2598
|
-
ngTemplateOutletContext: "ngTemplateOutletContext",
|
|
2599
|
-
ngTemplateOutlet: "ngTemplateOutlet",
|
|
2600
|
-
ngTemplateOutletInjector: "ngTemplateOutletInjector"
|
|
2601
|
-
},
|
|
2602
|
-
features: [\u{275}_NgOnChangesFeature]
|
|
2603
|
-
});
|
|
2604
|
-
}
|
|
2605
|
-
(() => {
|
|
2606
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgTemplateOutlet, [{
|
|
2607
|
-
type: Directive,
|
|
2608
|
-
args: [{
|
|
2609
|
-
selector: "[ngTemplateOutlet]"
|
|
2610
|
-
}]
|
|
2611
|
-
}], () => [{
|
|
2612
|
-
type: ViewContainerRef
|
|
2613
|
-
}], {
|
|
2614
|
-
ngTemplateOutletContext: [{
|
|
2615
|
-
type: Input
|
|
2616
|
-
}],
|
|
2617
|
-
ngTemplateOutlet: [{
|
|
2618
|
-
type: Input
|
|
2619
|
-
}],
|
|
2620
|
-
ngTemplateOutletInjector: [{
|
|
2621
|
-
type: Input
|
|
2622
|
-
}]
|
|
2623
|
-
});
|
|
2624
|
-
})();
|
|
2625
|
-
var COMMON_DIRECTIVES = [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase];
|
|
2626
|
-
function invalidPipeArgumentError(type, value) {
|
|
2627
|
-
return new RuntimeError(2100, ngDevMode && `InvalidPipeArgument: '${value}' for pipe '${stringify(type)}'`);
|
|
2628
|
-
}
|
|
2629
|
-
function warnIfSignal(pipeName, value) {
|
|
2630
|
-
if (isSignal(value)) {
|
|
2631
|
-
console.warn(`The ${pipeName} does not unwrap signals. Received a signal with value:`, value());
|
|
2632
|
-
}
|
|
2633
|
-
}
|
|
2634
|
-
|
|
2635
|
-
class SubscribableStrategy {
|
|
2636
|
-
createSubscription(async, updateLatestValue, onError) {
|
|
2637
|
-
return untracked(() => async.subscribe({
|
|
2638
|
-
next: updateLatestValue,
|
|
2639
|
-
error: onError
|
|
2640
|
-
}));
|
|
2641
|
-
}
|
|
2642
|
-
dispose(subscription) {
|
|
2643
|
-
untracked(() => subscription.unsubscribe());
|
|
2644
|
-
}
|
|
2645
|
-
}
|
|
2646
|
-
|
|
2647
|
-
class PromiseStrategy {
|
|
2648
|
-
createSubscription(async, updateLatestValue, onError) {
|
|
2649
|
-
async.then((v) => updateLatestValue?.(v), (e) => onError?.(e));
|
|
2650
|
-
return {
|
|
2651
|
-
unsubscribe: () => {
|
|
2652
|
-
updateLatestValue = null;
|
|
2653
|
-
onError = null;
|
|
2654
|
-
}
|
|
2655
|
-
};
|
|
2656
|
-
}
|
|
2657
|
-
dispose(subscription) {
|
|
2658
|
-
subscription.unsubscribe();
|
|
2659
|
-
}
|
|
2660
|
-
}
|
|
2661
|
-
var _promiseStrategy = new PromiseStrategy;
|
|
2662
|
-
var _subscribableStrategy = new SubscribableStrategy;
|
|
2663
|
-
|
|
2664
|
-
class AsyncPipe {
|
|
2665
|
-
_ref;
|
|
2666
|
-
_latestValue = null;
|
|
2667
|
-
markForCheckOnValueUpdate = true;
|
|
2668
|
-
_subscription = null;
|
|
2669
|
-
_obj = null;
|
|
2670
|
-
_strategy = null;
|
|
2671
|
-
applicationErrorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);
|
|
2672
|
-
constructor(ref) {
|
|
2673
|
-
this._ref = ref;
|
|
2674
|
-
}
|
|
2675
|
-
ngOnDestroy() {
|
|
2676
|
-
if (this._subscription) {
|
|
2677
|
-
this._dispose();
|
|
2678
|
-
}
|
|
2679
|
-
this._ref = null;
|
|
2680
|
-
}
|
|
2681
|
-
transform(obj) {
|
|
2682
|
-
if (!this._obj) {
|
|
2683
|
-
if (obj) {
|
|
2684
|
-
try {
|
|
2685
|
-
this.markForCheckOnValueUpdate = false;
|
|
2686
|
-
this._subscribe(obj);
|
|
2687
|
-
} finally {
|
|
2688
|
-
this.markForCheckOnValueUpdate = true;
|
|
2689
|
-
}
|
|
2690
|
-
}
|
|
2691
|
-
return this._latestValue;
|
|
2692
|
-
}
|
|
2693
|
-
if (obj !== this._obj) {
|
|
2694
|
-
this._dispose();
|
|
2695
|
-
return this.transform(obj);
|
|
2696
|
-
}
|
|
2697
|
-
return this._latestValue;
|
|
2698
|
-
}
|
|
2699
|
-
_subscribe(obj) {
|
|
2700
|
-
this._obj = obj;
|
|
2701
|
-
this._strategy = this._selectStrategy(obj);
|
|
2702
|
-
this._subscription = this._strategy.createSubscription(obj, (value) => this._updateLatestValue(obj, value), (e) => this.applicationErrorHandler(e));
|
|
2703
|
-
}
|
|
2704
|
-
_selectStrategy(obj) {
|
|
2705
|
-
if (isPromise(obj)) {
|
|
2706
|
-
return _promiseStrategy;
|
|
2707
|
-
}
|
|
2708
|
-
if (isSubscribable(obj)) {
|
|
2709
|
-
return _subscribableStrategy;
|
|
2710
|
-
}
|
|
2711
|
-
throw invalidPipeArgumentError(AsyncPipe, obj);
|
|
2712
|
-
}
|
|
2713
|
-
_dispose() {
|
|
2714
|
-
this._strategy.dispose(this._subscription);
|
|
2715
|
-
this._latestValue = null;
|
|
2716
|
-
this._subscription = null;
|
|
2717
|
-
this._obj = null;
|
|
2718
|
-
}
|
|
2719
|
-
_updateLatestValue(async, value) {
|
|
2720
|
-
if (async === this._obj) {
|
|
2721
|
-
this._latestValue = value;
|
|
2722
|
-
if (this.markForCheckOnValueUpdate) {
|
|
2723
|
-
this._ref?.markForCheck();
|
|
2724
|
-
}
|
|
2725
|
-
}
|
|
2726
|
-
}
|
|
2727
|
-
static \u{275}fac = function AsyncPipe_Factory(__ngFactoryType__) {
|
|
2728
|
-
return new (__ngFactoryType__ || AsyncPipe)(\u{275}_directiveInject(ChangeDetectorRef, 16));
|
|
2729
|
-
};
|
|
2730
|
-
static \u{275}pipe = /* @__PURE__ */ \u{275}_definePipe({
|
|
2731
|
-
name: "async",
|
|
2732
|
-
type: AsyncPipe,
|
|
2733
|
-
pure: false
|
|
2734
|
-
});
|
|
2735
|
-
}
|
|
2736
|
-
(() => {
|
|
2737
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(AsyncPipe, [{
|
|
2738
|
-
type: Pipe,
|
|
2739
|
-
args: [{
|
|
2740
|
-
name: "async",
|
|
2741
|
-
pure: false
|
|
2742
|
-
}]
|
|
2743
|
-
}], () => [{
|
|
2744
|
-
type: ChangeDetectorRef
|
|
2745
|
-
}], null);
|
|
2746
|
-
})();
|
|
2747
|
-
|
|
2748
|
-
class LowerCasePipe {
|
|
2749
|
-
transform(value) {
|
|
2750
|
-
if (value == null)
|
|
2751
|
-
return null;
|
|
2752
|
-
assertPipeArgument(LowerCasePipe, value);
|
|
2753
|
-
return value.toLowerCase();
|
|
2754
|
-
}
|
|
2755
|
-
static \u{275}fac = function LowerCasePipe_Factory(__ngFactoryType__) {
|
|
2756
|
-
return new (__ngFactoryType__ || LowerCasePipe);
|
|
2757
|
-
};
|
|
2758
|
-
static \u{275}pipe = /* @__PURE__ */ \u{275}_definePipe({
|
|
2759
|
-
name: "lowercase",
|
|
2760
|
-
type: LowerCasePipe,
|
|
2761
|
-
pure: true
|
|
2762
|
-
});
|
|
2763
|
-
}
|
|
2764
|
-
(() => {
|
|
2765
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LowerCasePipe, [{
|
|
2766
|
-
type: Pipe,
|
|
2767
|
-
args: [{
|
|
2768
|
-
name: "lowercase"
|
|
2769
|
-
}]
|
|
2770
|
-
}], null, null);
|
|
2771
|
-
})();
|
|
2772
|
-
var unicodeWordMatch = /(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])\S*/g;
|
|
2773
|
-
|
|
2774
|
-
class TitleCasePipe {
|
|
2775
|
-
transform(value) {
|
|
2776
|
-
if (value == null)
|
|
2777
|
-
return null;
|
|
2778
|
-
assertPipeArgument(TitleCasePipe, value);
|
|
2779
|
-
return value.replace(unicodeWordMatch, (txt) => txt[0].toUpperCase() + txt.slice(1).toLowerCase());
|
|
2780
|
-
}
|
|
2781
|
-
static \u{275}fac = function TitleCasePipe_Factory(__ngFactoryType__) {
|
|
2782
|
-
return new (__ngFactoryType__ || TitleCasePipe);
|
|
2783
|
-
};
|
|
2784
|
-
static \u{275}pipe = /* @__PURE__ */ \u{275}_definePipe({
|
|
2785
|
-
name: "titlecase",
|
|
2786
|
-
type: TitleCasePipe,
|
|
2787
|
-
pure: true
|
|
2788
|
-
});
|
|
2789
|
-
}
|
|
2790
|
-
(() => {
|
|
2791
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TitleCasePipe, [{
|
|
2792
|
-
type: Pipe,
|
|
2793
|
-
args: [{
|
|
2794
|
-
name: "titlecase"
|
|
2795
|
-
}]
|
|
2796
|
-
}], null, null);
|
|
2797
|
-
})();
|
|
2798
|
-
|
|
2799
|
-
class UpperCasePipe {
|
|
2800
|
-
transform(value) {
|
|
2801
|
-
if (value == null)
|
|
2802
|
-
return null;
|
|
2803
|
-
assertPipeArgument(UpperCasePipe, value);
|
|
2804
|
-
return value.toUpperCase();
|
|
2805
|
-
}
|
|
2806
|
-
static \u{275}fac = function UpperCasePipe_Factory(__ngFactoryType__) {
|
|
2807
|
-
return new (__ngFactoryType__ || UpperCasePipe);
|
|
2808
|
-
};
|
|
2809
|
-
static \u{275}pipe = /* @__PURE__ */ \u{275}_definePipe({
|
|
2810
|
-
name: "uppercase",
|
|
2811
|
-
type: UpperCasePipe,
|
|
2812
|
-
pure: true
|
|
2813
|
-
});
|
|
2814
|
-
}
|
|
2815
|
-
(() => {
|
|
2816
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(UpperCasePipe, [{
|
|
2817
|
-
type: Pipe,
|
|
2818
|
-
args: [{
|
|
2819
|
-
name: "uppercase"
|
|
2820
|
-
}]
|
|
2821
|
-
}], null, null);
|
|
2822
|
-
})();
|
|
2823
|
-
function assertPipeArgument(pipe, value) {
|
|
2824
|
-
if (typeof value !== "string") {
|
|
2825
|
-
throw invalidPipeArgumentError(pipe, value);
|
|
2826
|
-
}
|
|
2827
|
-
}
|
|
2828
|
-
var DEFAULT_DATE_FORMAT = "mediumDate";
|
|
2829
|
-
var DATE_PIPE_DEFAULT_TIMEZONE = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "DATE_PIPE_DEFAULT_TIMEZONE" : "");
|
|
2830
|
-
var DATE_PIPE_DEFAULT_OPTIONS = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "DATE_PIPE_DEFAULT_OPTIONS" : "");
|
|
2831
|
-
|
|
2832
|
-
class DatePipe {
|
|
2833
|
-
locale;
|
|
2834
|
-
defaultTimezone;
|
|
2835
|
-
defaultOptions;
|
|
2836
|
-
constructor(locale, defaultTimezone, defaultOptions) {
|
|
2837
|
-
this.locale = locale;
|
|
2838
|
-
this.defaultTimezone = defaultTimezone;
|
|
2839
|
-
this.defaultOptions = defaultOptions;
|
|
2840
|
-
}
|
|
2841
|
-
transform(value, format, timezone, locale) {
|
|
2842
|
-
if (value == null || value === "" || value !== value)
|
|
2843
|
-
return null;
|
|
2844
|
-
try {
|
|
2845
|
-
const _format = format ?? this.defaultOptions?.dateFormat ?? DEFAULT_DATE_FORMAT;
|
|
2846
|
-
const _timezone = timezone ?? this.defaultOptions?.timezone ?? this.defaultTimezone ?? undefined;
|
|
2847
|
-
return formatDate(value, _format, locale || this.locale, _timezone);
|
|
2848
|
-
} catch (error) {
|
|
2849
|
-
throw invalidPipeArgumentError(DatePipe, error.message);
|
|
2850
|
-
}
|
|
2851
|
-
}
|
|
2852
|
-
static \u{275}fac = function DatePipe_Factory(__ngFactoryType__) {
|
|
2853
|
-
return new (__ngFactoryType__ || DatePipe)(\u{275}_directiveInject(LOCALE_ID, 16), \u{275}_directiveInject(DATE_PIPE_DEFAULT_TIMEZONE, 24), \u{275}_directiveInject(DATE_PIPE_DEFAULT_OPTIONS, 24));
|
|
2854
|
-
};
|
|
2855
|
-
static \u{275}pipe = /* @__PURE__ */ \u{275}_definePipe({
|
|
2856
|
-
name: "date",
|
|
2857
|
-
type: DatePipe,
|
|
2858
|
-
pure: true
|
|
2859
|
-
});
|
|
2860
|
-
}
|
|
2861
|
-
(() => {
|
|
2862
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DatePipe, [{
|
|
2863
|
-
type: Pipe,
|
|
2864
|
-
args: [{
|
|
2865
|
-
name: "date"
|
|
2866
|
-
}]
|
|
2867
|
-
}], () => [{
|
|
2868
|
-
type: undefined,
|
|
2869
|
-
decorators: [{
|
|
2870
|
-
type: Inject,
|
|
2871
|
-
args: [LOCALE_ID]
|
|
2872
|
-
}]
|
|
2873
|
-
}, {
|
|
2874
|
-
type: undefined,
|
|
2875
|
-
decorators: [{
|
|
2876
|
-
type: Inject,
|
|
2877
|
-
args: [DATE_PIPE_DEFAULT_TIMEZONE]
|
|
2878
|
-
}, {
|
|
2879
|
-
type: Optional
|
|
2880
|
-
}]
|
|
2881
|
-
}, {
|
|
2882
|
-
type: undefined,
|
|
2883
|
-
decorators: [{
|
|
2884
|
-
type: Inject,
|
|
2885
|
-
args: [DATE_PIPE_DEFAULT_OPTIONS]
|
|
2886
|
-
}, {
|
|
2887
|
-
type: Optional
|
|
2888
|
-
}]
|
|
2889
|
-
}], null);
|
|
2890
|
-
})();
|
|
2891
|
-
var _INTERPOLATION_REGEXP = /#/g;
|
|
2892
|
-
|
|
2893
|
-
class I18nPluralPipe {
|
|
2894
|
-
_localization;
|
|
2895
|
-
constructor(_localization) {
|
|
2896
|
-
this._localization = _localization;
|
|
2897
|
-
}
|
|
2898
|
-
transform(value, pluralMap, locale) {
|
|
2899
|
-
if (value == null)
|
|
2900
|
-
return "";
|
|
2901
|
-
if (typeof pluralMap !== "object" || pluralMap === null) {
|
|
2902
|
-
throw invalidPipeArgumentError(I18nPluralPipe, pluralMap);
|
|
2903
|
-
}
|
|
2904
|
-
const key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale);
|
|
2905
|
-
return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());
|
|
2906
|
-
}
|
|
2907
|
-
static \u{275}fac = function I18nPluralPipe_Factory(__ngFactoryType__) {
|
|
2908
|
-
return new (__ngFactoryType__ || I18nPluralPipe)(\u{275}_directiveInject(NgLocalization, 16));
|
|
2909
|
-
};
|
|
2910
|
-
static \u{275}pipe = /* @__PURE__ */ \u{275}_definePipe({
|
|
2911
|
-
name: "i18nPlural",
|
|
2912
|
-
type: I18nPluralPipe,
|
|
2913
|
-
pure: true
|
|
2914
|
-
});
|
|
2915
|
-
}
|
|
2916
|
-
(() => {
|
|
2917
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(I18nPluralPipe, [{
|
|
2918
|
-
type: Pipe,
|
|
2919
|
-
args: [{
|
|
2920
|
-
name: "i18nPlural"
|
|
2921
|
-
}]
|
|
2922
|
-
}], () => [{
|
|
2923
|
-
type: NgLocalization
|
|
2924
|
-
}], null);
|
|
2925
|
-
})();
|
|
2926
|
-
|
|
2927
|
-
class I18nSelectPipe {
|
|
2928
|
-
transform(value, mapping) {
|
|
2929
|
-
if (value == null)
|
|
2930
|
-
return "";
|
|
2931
|
-
if (typeof mapping !== "object" || typeof value !== "string") {
|
|
2932
|
-
throw invalidPipeArgumentError(I18nSelectPipe, mapping);
|
|
2933
|
-
}
|
|
2934
|
-
if (mapping.hasOwnProperty(value)) {
|
|
2935
|
-
return mapping[value];
|
|
2936
|
-
}
|
|
2937
|
-
if (mapping.hasOwnProperty("other")) {
|
|
2938
|
-
return mapping["other"];
|
|
2939
|
-
}
|
|
2940
|
-
return "";
|
|
2941
|
-
}
|
|
2942
|
-
static \u{275}fac = function I18nSelectPipe_Factory(__ngFactoryType__) {
|
|
2943
|
-
return new (__ngFactoryType__ || I18nSelectPipe);
|
|
2944
|
-
};
|
|
2945
|
-
static \u{275}pipe = /* @__PURE__ */ \u{275}_definePipe({
|
|
2946
|
-
name: "i18nSelect",
|
|
2947
|
-
type: I18nSelectPipe,
|
|
2948
|
-
pure: true
|
|
2949
|
-
});
|
|
2950
|
-
}
|
|
2951
|
-
(() => {
|
|
2952
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(I18nSelectPipe, [{
|
|
2953
|
-
type: Pipe,
|
|
2954
|
-
args: [{
|
|
2955
|
-
name: "i18nSelect"
|
|
2956
|
-
}]
|
|
2957
|
-
}], null, null);
|
|
2958
|
-
})();
|
|
2959
|
-
|
|
2960
|
-
class JsonPipe {
|
|
2961
|
-
transform(value) {
|
|
2962
|
-
ngDevMode && warnIfSignal("JsonPipe", value);
|
|
2963
|
-
return JSON.stringify(value, null, 2);
|
|
2964
|
-
}
|
|
2965
|
-
static \u{275}fac = function JsonPipe_Factory(__ngFactoryType__) {
|
|
2966
|
-
return new (__ngFactoryType__ || JsonPipe);
|
|
2967
|
-
};
|
|
2968
|
-
static \u{275}pipe = /* @__PURE__ */ \u{275}_definePipe({
|
|
2969
|
-
name: "json",
|
|
2970
|
-
type: JsonPipe,
|
|
2971
|
-
pure: false
|
|
2972
|
-
});
|
|
2973
|
-
}
|
|
2974
|
-
(() => {
|
|
2975
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(JsonPipe, [{
|
|
2976
|
-
type: Pipe,
|
|
2977
|
-
args: [{
|
|
2978
|
-
name: "json",
|
|
2979
|
-
pure: false
|
|
2980
|
-
}]
|
|
2981
|
-
}], null, null);
|
|
2982
|
-
})();
|
|
2983
|
-
function makeKeyValuePair(key, value) {
|
|
2984
|
-
return {
|
|
2985
|
-
key,
|
|
2986
|
-
value
|
|
2987
|
-
};
|
|
2988
|
-
}
|
|
2989
|
-
|
|
2990
|
-
class KeyValuePipe {
|
|
2991
|
-
differs;
|
|
2992
|
-
constructor(differs) {
|
|
2993
|
-
this.differs = differs;
|
|
2994
|
-
}
|
|
2995
|
-
differ;
|
|
2996
|
-
keyValues = [];
|
|
2997
|
-
compareFn = defaultComparator;
|
|
2998
|
-
transform(input, compareFn = defaultComparator) {
|
|
2999
|
-
ngDevMode && warnIfSignal("KeyValuePipe", input);
|
|
3000
|
-
if (!input || !(input instanceof Map) && typeof input !== "object") {
|
|
3001
|
-
return null;
|
|
3002
|
-
}
|
|
3003
|
-
this.differ ??= this.differs.find(input).create();
|
|
3004
|
-
const differChanges = this.differ.diff(input);
|
|
3005
|
-
const compareFnChanged = compareFn !== this.compareFn;
|
|
3006
|
-
if (differChanges) {
|
|
3007
|
-
this.keyValues = [];
|
|
3008
|
-
differChanges.forEachItem((r) => {
|
|
3009
|
-
this.keyValues.push(makeKeyValuePair(r.key, r.currentValue));
|
|
3010
|
-
});
|
|
3011
|
-
}
|
|
3012
|
-
if (differChanges || compareFnChanged) {
|
|
3013
|
-
if (compareFn) {
|
|
3014
|
-
this.keyValues.sort(compareFn);
|
|
3015
|
-
}
|
|
3016
|
-
this.compareFn = compareFn;
|
|
3017
|
-
}
|
|
3018
|
-
return this.keyValues;
|
|
3019
|
-
}
|
|
3020
|
-
static \u{275}fac = function KeyValuePipe_Factory(__ngFactoryType__) {
|
|
3021
|
-
return new (__ngFactoryType__ || KeyValuePipe)(\u{275}_directiveInject(KeyValueDiffers, 16));
|
|
3022
|
-
};
|
|
3023
|
-
static \u{275}pipe = /* @__PURE__ */ \u{275}_definePipe({
|
|
3024
|
-
name: "keyvalue",
|
|
3025
|
-
type: KeyValuePipe,
|
|
3026
|
-
pure: false
|
|
3027
|
-
});
|
|
3028
|
-
}
|
|
3029
|
-
(() => {
|
|
3030
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(KeyValuePipe, [{
|
|
3031
|
-
type: Pipe,
|
|
3032
|
-
args: [{
|
|
3033
|
-
name: "keyvalue",
|
|
3034
|
-
pure: false
|
|
3035
|
-
}]
|
|
3036
|
-
}], () => [{
|
|
3037
|
-
type: KeyValueDiffers
|
|
3038
|
-
}], null);
|
|
3039
|
-
})();
|
|
3040
|
-
function defaultComparator(keyValueA, keyValueB) {
|
|
3041
|
-
const a = keyValueA.key;
|
|
3042
|
-
const b = keyValueB.key;
|
|
3043
|
-
if (a === b)
|
|
3044
|
-
return 0;
|
|
3045
|
-
if (a == null)
|
|
3046
|
-
return 1;
|
|
3047
|
-
if (b == null)
|
|
3048
|
-
return -1;
|
|
3049
|
-
if (typeof a == "string" && typeof b == "string") {
|
|
3050
|
-
return a < b ? -1 : 1;
|
|
3051
|
-
}
|
|
3052
|
-
if (typeof a == "number" && typeof b == "number") {
|
|
3053
|
-
return a - b;
|
|
3054
|
-
}
|
|
3055
|
-
if (typeof a == "boolean" && typeof b == "boolean") {
|
|
3056
|
-
return a < b ? -1 : 1;
|
|
3057
|
-
}
|
|
3058
|
-
const aString = String(a);
|
|
3059
|
-
const bString = String(b);
|
|
3060
|
-
return aString == bString ? 0 : aString < bString ? -1 : 1;
|
|
3061
|
-
}
|
|
3062
|
-
|
|
3063
|
-
class DecimalPipe {
|
|
3064
|
-
_locale;
|
|
3065
|
-
constructor(_locale) {
|
|
3066
|
-
this._locale = _locale;
|
|
3067
|
-
}
|
|
3068
|
-
transform(value, digitsInfo, locale) {
|
|
3069
|
-
if (!isValue(value))
|
|
3070
|
-
return null;
|
|
3071
|
-
locale ||= this._locale;
|
|
3072
|
-
try {
|
|
3073
|
-
const num = strToNumber(value);
|
|
3074
|
-
return formatNumber(num, locale, digitsInfo);
|
|
3075
|
-
} catch (error) {
|
|
3076
|
-
throw invalidPipeArgumentError(DecimalPipe, error.message);
|
|
3077
|
-
}
|
|
3078
|
-
}
|
|
3079
|
-
static \u{275}fac = function DecimalPipe_Factory(__ngFactoryType__) {
|
|
3080
|
-
return new (__ngFactoryType__ || DecimalPipe)(\u{275}_directiveInject(LOCALE_ID, 16));
|
|
3081
|
-
};
|
|
3082
|
-
static \u{275}pipe = /* @__PURE__ */ \u{275}_definePipe({
|
|
3083
|
-
name: "number",
|
|
3084
|
-
type: DecimalPipe,
|
|
3085
|
-
pure: true
|
|
3086
|
-
});
|
|
3087
|
-
}
|
|
3088
|
-
(() => {
|
|
3089
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DecimalPipe, [{
|
|
3090
|
-
type: Pipe,
|
|
3091
|
-
args: [{
|
|
3092
|
-
name: "number"
|
|
3093
|
-
}]
|
|
3094
|
-
}], () => [{
|
|
3095
|
-
type: undefined,
|
|
3096
|
-
decorators: [{
|
|
3097
|
-
type: Inject,
|
|
3098
|
-
args: [LOCALE_ID]
|
|
3099
|
-
}]
|
|
3100
|
-
}], null);
|
|
3101
|
-
})();
|
|
3102
|
-
|
|
3103
|
-
class PercentPipe {
|
|
3104
|
-
_locale;
|
|
3105
|
-
constructor(_locale) {
|
|
3106
|
-
this._locale = _locale;
|
|
3107
|
-
}
|
|
3108
|
-
transform(value, digitsInfo, locale) {
|
|
3109
|
-
if (!isValue(value))
|
|
3110
|
-
return null;
|
|
3111
|
-
locale ||= this._locale;
|
|
3112
|
-
try {
|
|
3113
|
-
const num = strToNumber(value);
|
|
3114
|
-
return formatPercent(num, locale, digitsInfo);
|
|
3115
|
-
} catch (error) {
|
|
3116
|
-
throw invalidPipeArgumentError(PercentPipe, error.message);
|
|
3117
|
-
}
|
|
3118
|
-
}
|
|
3119
|
-
static \u{275}fac = function PercentPipe_Factory(__ngFactoryType__) {
|
|
3120
|
-
return new (__ngFactoryType__ || PercentPipe)(\u{275}_directiveInject(LOCALE_ID, 16));
|
|
3121
|
-
};
|
|
3122
|
-
static \u{275}pipe = /* @__PURE__ */ \u{275}_definePipe({
|
|
3123
|
-
name: "percent",
|
|
3124
|
-
type: PercentPipe,
|
|
3125
|
-
pure: true
|
|
3126
|
-
});
|
|
3127
|
-
}
|
|
3128
|
-
(() => {
|
|
3129
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PercentPipe, [{
|
|
3130
|
-
type: Pipe,
|
|
3131
|
-
args: [{
|
|
3132
|
-
name: "percent"
|
|
3133
|
-
}]
|
|
3134
|
-
}], () => [{
|
|
3135
|
-
type: undefined,
|
|
3136
|
-
decorators: [{
|
|
3137
|
-
type: Inject,
|
|
3138
|
-
args: [LOCALE_ID]
|
|
3139
|
-
}]
|
|
3140
|
-
}], null);
|
|
3141
|
-
})();
|
|
3142
|
-
|
|
3143
|
-
class CurrencyPipe {
|
|
3144
|
-
_locale;
|
|
3145
|
-
_defaultCurrencyCode;
|
|
3146
|
-
constructor(_locale, _defaultCurrencyCode = "USD") {
|
|
3147
|
-
this._locale = _locale;
|
|
3148
|
-
this._defaultCurrencyCode = _defaultCurrencyCode;
|
|
3149
|
-
}
|
|
3150
|
-
transform(value, currencyCode = this._defaultCurrencyCode, display = "symbol", digitsInfo, locale) {
|
|
3151
|
-
if (!isValue(value))
|
|
3152
|
-
return null;
|
|
3153
|
-
locale ||= this._locale;
|
|
3154
|
-
if (typeof display === "boolean") {
|
|
3155
|
-
if (typeof ngDevMode === "undefined" || ngDevMode) {
|
|
3156
|
-
console.warn(`Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are "code", "symbol" or "symbol-narrow".`);
|
|
3157
|
-
}
|
|
3158
|
-
display = display ? "symbol" : "code";
|
|
3159
|
-
}
|
|
3160
|
-
let currency = currencyCode || this._defaultCurrencyCode;
|
|
3161
|
-
if (display !== "code") {
|
|
3162
|
-
if (display === "symbol" || display === "symbol-narrow") {
|
|
3163
|
-
currency = getCurrencySymbol(currency, display === "symbol" ? "wide" : "narrow", locale);
|
|
3164
|
-
} else {
|
|
3165
|
-
currency = display;
|
|
3166
|
-
}
|
|
3167
|
-
}
|
|
3168
|
-
try {
|
|
3169
|
-
const num = strToNumber(value);
|
|
3170
|
-
return formatCurrency(num, locale, currency, currencyCode, digitsInfo);
|
|
3171
|
-
} catch (error) {
|
|
3172
|
-
throw invalidPipeArgumentError(CurrencyPipe, error.message);
|
|
3173
|
-
}
|
|
3174
|
-
}
|
|
3175
|
-
static \u{275}fac = function CurrencyPipe_Factory(__ngFactoryType__) {
|
|
3176
|
-
return new (__ngFactoryType__ || CurrencyPipe)(\u{275}_directiveInject(LOCALE_ID, 16), \u{275}_directiveInject(DEFAULT_CURRENCY_CODE, 16));
|
|
3177
|
-
};
|
|
3178
|
-
static \u{275}pipe = /* @__PURE__ */ \u{275}_definePipe({
|
|
3179
|
-
name: "currency",
|
|
3180
|
-
type: CurrencyPipe,
|
|
3181
|
-
pure: true
|
|
3182
|
-
});
|
|
3183
|
-
}
|
|
3184
|
-
(() => {
|
|
3185
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CurrencyPipe, [{
|
|
3186
|
-
type: Pipe,
|
|
3187
|
-
args: [{
|
|
3188
|
-
name: "currency"
|
|
3189
|
-
}]
|
|
3190
|
-
}], () => [{
|
|
3191
|
-
type: undefined,
|
|
3192
|
-
decorators: [{
|
|
3193
|
-
type: Inject,
|
|
3194
|
-
args: [LOCALE_ID]
|
|
3195
|
-
}]
|
|
3196
|
-
}, {
|
|
3197
|
-
type: undefined,
|
|
3198
|
-
decorators: [{
|
|
3199
|
-
type: Inject,
|
|
3200
|
-
args: [DEFAULT_CURRENCY_CODE]
|
|
3201
|
-
}]
|
|
3202
|
-
}], null);
|
|
3203
|
-
})();
|
|
3204
|
-
function isValue(value) {
|
|
3205
|
-
return !(value == null || value === "" || value !== value);
|
|
3206
|
-
}
|
|
3207
|
-
function strToNumber(value) {
|
|
3208
|
-
if (typeof value === "string" && !isNaN(Number(value) - parseFloat(value))) {
|
|
3209
|
-
return Number(value);
|
|
3210
|
-
}
|
|
3211
|
-
if (typeof value !== "number") {
|
|
3212
|
-
throw new RuntimeError(2309, ngDevMode && `${value} is not a number`);
|
|
3213
|
-
}
|
|
3214
|
-
return value;
|
|
3215
|
-
}
|
|
3216
|
-
|
|
3217
|
-
class SlicePipe {
|
|
3218
|
-
transform(value, start, end) {
|
|
3219
|
-
if (value == null)
|
|
3220
|
-
return null;
|
|
3221
|
-
const supports = typeof value === "string" || Array.isArray(value);
|
|
3222
|
-
if (!supports) {
|
|
3223
|
-
throw invalidPipeArgumentError(SlicePipe, value);
|
|
3224
|
-
}
|
|
3225
|
-
return value.slice(start, end);
|
|
3226
|
-
}
|
|
3227
|
-
static \u{275}fac = function SlicePipe_Factory(__ngFactoryType__) {
|
|
3228
|
-
return new (__ngFactoryType__ || SlicePipe);
|
|
3229
|
-
};
|
|
3230
|
-
static \u{275}pipe = /* @__PURE__ */ \u{275}_definePipe({
|
|
3231
|
-
name: "slice",
|
|
3232
|
-
type: SlicePipe,
|
|
3233
|
-
pure: false
|
|
3234
|
-
});
|
|
3235
|
-
}
|
|
3236
|
-
(() => {
|
|
3237
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SlicePipe, [{
|
|
3238
|
-
type: Pipe,
|
|
3239
|
-
args: [{
|
|
3240
|
-
name: "slice",
|
|
3241
|
-
pure: false
|
|
3242
|
-
}]
|
|
3243
|
-
}], null, null);
|
|
3244
|
-
})();
|
|
3245
|
-
var COMMON_PIPES = [AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe];
|
|
3246
|
-
|
|
3247
|
-
class CommonModule {
|
|
3248
|
-
static \u{275}fac = function CommonModule_Factory(__ngFactoryType__) {
|
|
3249
|
-
return new (__ngFactoryType__ || CommonModule);
|
|
3250
|
-
};
|
|
3251
|
-
static \u{275}mod = /* @__PURE__ */ \u{275}_defineNgModule({
|
|
3252
|
-
type: CommonModule
|
|
3253
|
-
});
|
|
3254
|
-
static \u{275}inj = /* @__PURE__ */ \u{275}_defineInjector({});
|
|
3255
|
-
}
|
|
3256
|
-
(() => {
|
|
3257
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CommonModule, [{
|
|
3258
|
-
type: NgModule,
|
|
3259
|
-
args: [{
|
|
3260
|
-
imports: [COMMON_DIRECTIVES, COMMON_PIPES],
|
|
3261
|
-
exports: [COMMON_DIRECTIVES, COMMON_PIPES]
|
|
3262
|
-
}]
|
|
3263
|
-
}], null, null);
|
|
3264
|
-
})();
|
|
3265
|
-
|
|
3266
|
-
// node_modules/@angular/common/fesm2022/_platform_navigation-chunk.mjs
|
|
3267
|
-
var PRECOMMIT_HANDLER_SUPPORTED = new InjectionToken("", {
|
|
3268
|
-
factory: () => {
|
|
3269
|
-
return typeof window !== "undefined" && typeof window.NavigationPrecommitController !== "undefined";
|
|
3270
|
-
}
|
|
3271
|
-
});
|
|
3272
|
-
|
|
3273
|
-
class PlatformNavigation {
|
|
3274
|
-
static \u{275}fac = function PlatformNavigation_Factory(__ngFactoryType__) {
|
|
3275
|
-
return new (__ngFactoryType__ || PlatformNavigation);
|
|
3276
|
-
};
|
|
3277
|
-
static \u{275}prov = /* @__PURE__ */ \u{275}_defineInjectable({
|
|
3278
|
-
token: PlatformNavigation,
|
|
3279
|
-
factory: () => (() => window.navigation)(),
|
|
3280
|
-
providedIn: "platform"
|
|
3281
|
-
});
|
|
3282
|
-
}
|
|
3283
|
-
(() => {
|
|
3284
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformNavigation, [{
|
|
3285
|
-
type: Injectable,
|
|
3286
|
-
args: [{
|
|
3287
|
-
providedIn: "platform",
|
|
3288
|
-
useFactory: () => window.navigation
|
|
3289
|
-
}]
|
|
3290
|
-
}], null, null);
|
|
3291
|
-
})();
|
|
3292
|
-
|
|
3293
|
-
// node_modules/@angular/common/fesm2022/common.mjs
|
|
3294
|
-
var exports_common = {};
|
|
3295
|
-
__export(exports_common, {
|
|
3296
|
-
\u{275}setRootDomAdapter: () => setRootDomAdapter,
|
|
3297
|
-
\u{275}parseCookieValue: () => parseCookieValue,
|
|
3298
|
-
\u{275}normalizeQueryParams: () => normalizeQueryParams,
|
|
3299
|
-
\u{275}getDOM: () => getDOM,
|
|
3300
|
-
\u{275}PRECOMMIT_HANDLER_SUPPORTED: () => PRECOMMIT_HANDLER_SUPPORTED,
|
|
3301
|
-
\u{275}PLATFORM_SERVER_ID: () => PLATFORM_SERVER_ID,
|
|
3302
|
-
\u{275}PLATFORM_BROWSER_ID: () => PLATFORM_BROWSER_ID,
|
|
3303
|
-
\u{275}NullViewportScroller: () => NullViewportScroller,
|
|
3304
|
-
\u{275}NavigationAdapterForLocation: () => NavigationAdapterForLocation,
|
|
3305
|
-
\u{275}DomAdapter: () => DomAdapter,
|
|
3306
|
-
registerLocaleData: () => registerLocaleData2,
|
|
3307
|
-
provideNetlifyLoader: () => provideNetlifyLoader,
|
|
3308
|
-
provideImgixLoader: () => provideImgixLoader,
|
|
3309
|
-
provideImageKitLoader: () => provideImageKitLoader,
|
|
3310
|
-
provideCloudinaryLoader: () => provideCloudinaryLoader,
|
|
3311
|
-
provideCloudflareLoader: () => provideCloudflareLoader,
|
|
3312
|
-
isPlatformServer: () => isPlatformServer,
|
|
3313
|
-
isPlatformBrowser: () => isPlatformBrowser,
|
|
3314
|
-
getNumberOfCurrencyDigits: () => getNumberOfCurrencyDigits,
|
|
3315
|
-
getLocaleWeekEndRange: () => getLocaleWeekEndRange,
|
|
3316
|
-
getLocaleTimeFormat: () => getLocaleTimeFormat,
|
|
3317
|
-
getLocalePluralCase: () => getLocalePluralCase2,
|
|
3318
|
-
getLocaleNumberSymbol: () => getLocaleNumberSymbol,
|
|
3319
|
-
getLocaleNumberFormat: () => getLocaleNumberFormat,
|
|
3320
|
-
getLocaleMonthNames: () => getLocaleMonthNames,
|
|
3321
|
-
getLocaleId: () => getLocaleId,
|
|
3322
|
-
getLocaleFirstDayOfWeek: () => getLocaleFirstDayOfWeek,
|
|
3323
|
-
getLocaleExtraDayPeriods: () => getLocaleExtraDayPeriods,
|
|
3324
|
-
getLocaleExtraDayPeriodRules: () => getLocaleExtraDayPeriodRules,
|
|
3325
|
-
getLocaleEraNames: () => getLocaleEraNames,
|
|
3326
|
-
getLocaleDirection: () => getLocaleDirection,
|
|
3327
|
-
getLocaleDayPeriods: () => getLocaleDayPeriods,
|
|
3328
|
-
getLocaleDayNames: () => getLocaleDayNames,
|
|
3329
|
-
getLocaleDateTimeFormat: () => getLocaleDateTimeFormat,
|
|
3330
|
-
getLocaleDateFormat: () => getLocaleDateFormat,
|
|
3331
|
-
getLocaleCurrencySymbol: () => getLocaleCurrencySymbol,
|
|
3332
|
-
getLocaleCurrencyName: () => getLocaleCurrencyName,
|
|
3333
|
-
getLocaleCurrencyCode: () => getLocaleCurrencyCode2,
|
|
3334
|
-
getCurrencySymbol: () => getCurrencySymbol,
|
|
3335
|
-
formatPercent: () => formatPercent,
|
|
3336
|
-
formatNumber: () => formatNumber,
|
|
3337
|
-
formatDate: () => formatDate,
|
|
3338
|
-
formatCurrency: () => formatCurrency,
|
|
3339
|
-
XhrFactory: () => XhrFactory,
|
|
3340
|
-
WeekDay: () => WeekDay,
|
|
3341
|
-
ViewportScroller: () => ViewportScroller,
|
|
3342
|
-
VERSION: () => VERSION,
|
|
3343
|
-
UpperCasePipe: () => UpperCasePipe,
|
|
3344
|
-
TranslationWidth: () => TranslationWidth,
|
|
3345
|
-
TrailingSlashPathLocationStrategy: () => TrailingSlashPathLocationStrategy,
|
|
3346
|
-
TitleCasePipe: () => TitleCasePipe,
|
|
3347
|
-
SlicePipe: () => SlicePipe,
|
|
3348
|
-
Plural: () => Plural,
|
|
3349
|
-
PlatformNavigation: () => PlatformNavigation,
|
|
3350
|
-
PlatformLocation: () => PlatformLocation,
|
|
3351
|
-
PercentPipe: () => PercentPipe,
|
|
3352
|
-
PathLocationStrategy: () => PathLocationStrategy,
|
|
3353
|
-
PRECONNECT_CHECK_BLOCKLIST: () => PRECONNECT_CHECK_BLOCKLIST,
|
|
3354
|
-
NumberSymbol: () => NumberSymbol,
|
|
3355
|
-
NumberFormatStyle: () => NumberFormatStyle,
|
|
3356
|
-
NoTrailingSlashPathLocationStrategy: () => NoTrailingSlashPathLocationStrategy,
|
|
3357
|
-
NgTemplateOutlet: () => NgTemplateOutlet,
|
|
3358
|
-
NgSwitchDefault: () => NgSwitchDefault,
|
|
3359
|
-
NgSwitchCase: () => NgSwitchCase,
|
|
3360
|
-
NgSwitch: () => NgSwitch,
|
|
3361
|
-
NgStyle: () => NgStyle,
|
|
3362
|
-
NgPluralCase: () => NgPluralCase,
|
|
3363
|
-
NgPlural: () => NgPlural,
|
|
3364
|
-
NgOptimizedImage: () => NgOptimizedImage,
|
|
3365
|
-
NgLocalization: () => NgLocalization,
|
|
3366
|
-
NgLocaleLocalization: () => NgLocaleLocalization,
|
|
3367
|
-
NgIfContext: () => NgIfContext,
|
|
3368
|
-
NgIf: () => NgIf,
|
|
3369
|
-
NgForOfContext: () => NgForOfContext,
|
|
3370
|
-
NgForOf: () => NgForOf,
|
|
3371
|
-
NgFor: () => NgForOf,
|
|
3372
|
-
NgComponentOutlet: () => NgComponentOutlet,
|
|
3373
|
-
NgClass: () => NgClass,
|
|
3374
|
-
LowerCasePipe: () => LowerCasePipe,
|
|
3375
|
-
LocationStrategy: () => LocationStrategy,
|
|
3376
|
-
Location: () => Location,
|
|
3377
|
-
LOCATION_INITIALIZED: () => LOCATION_INITIALIZED,
|
|
3378
|
-
KeyValuePipe: () => KeyValuePipe,
|
|
3379
|
-
JsonPipe: () => JsonPipe,
|
|
3380
|
-
IMAGE_LOADER: () => IMAGE_LOADER,
|
|
3381
|
-
IMAGE_CONFIG: () => IMAGE_CONFIG,
|
|
3382
|
-
I18nSelectPipe: () => I18nSelectPipe,
|
|
3383
|
-
I18nPluralPipe: () => I18nPluralPipe,
|
|
3384
|
-
HashLocationStrategy: () => HashLocationStrategy,
|
|
3385
|
-
FormatWidth: () => FormatWidth,
|
|
3386
|
-
FormStyle: () => FormStyle,
|
|
3387
|
-
DecimalPipe: () => DecimalPipe,
|
|
3388
|
-
DatePipe: () => DatePipe,
|
|
3389
|
-
DOCUMENT: () => DOCUMENT,
|
|
3390
|
-
DATE_PIPE_DEFAULT_TIMEZONE: () => DATE_PIPE_DEFAULT_TIMEZONE,
|
|
3391
|
-
DATE_PIPE_DEFAULT_OPTIONS: () => DATE_PIPE_DEFAULT_OPTIONS,
|
|
3392
|
-
CurrencyPipe: () => CurrencyPipe,
|
|
3393
|
-
CommonModule: () => CommonModule,
|
|
3394
|
-
BrowserPlatformLocation: () => BrowserPlatformLocation,
|
|
3395
|
-
AsyncPipe: () => AsyncPipe,
|
|
3396
|
-
APP_BASE_HREF: () => APP_BASE_HREF
|
|
3397
|
-
});
|
|
3398
|
-
class NavigationAdapterForLocation extends Location {
|
|
3399
|
-
navigation = inject(PlatformNavigation);
|
|
3400
|
-
destroyRef = inject(DestroyRef);
|
|
3401
|
-
constructor() {
|
|
3402
|
-
super(inject(LocationStrategy));
|
|
3403
|
-
this.registerNavigationListeners();
|
|
3404
|
-
}
|
|
3405
|
-
registerNavigationListeners() {
|
|
3406
|
-
const currentEntryChangeListener = () => {
|
|
3407
|
-
this._notifyUrlChangeListeners(this.path(true), this.getState());
|
|
3408
|
-
};
|
|
3409
|
-
this.navigation.addEventListener("currententrychange", currentEntryChangeListener);
|
|
3410
|
-
this.destroyRef.onDestroy(() => {
|
|
3411
|
-
this.navigation.removeEventListener("currententrychange", currentEntryChangeListener);
|
|
3412
|
-
});
|
|
3413
|
-
}
|
|
3414
|
-
getState() {
|
|
3415
|
-
return this.navigation.currentEntry?.getState();
|
|
3416
|
-
}
|
|
3417
|
-
replaceState(path, query = "", state = null) {
|
|
3418
|
-
const url = this.prepareExternalUrl(path + normalizeQueryParams(query));
|
|
3419
|
-
this.navigation.navigate(url, {
|
|
3420
|
-
state,
|
|
3421
|
-
history: "replace"
|
|
3422
|
-
});
|
|
3423
|
-
}
|
|
3424
|
-
go(path, query = "", state = null) {
|
|
3425
|
-
const url = this.prepareExternalUrl(path + normalizeQueryParams(query));
|
|
3426
|
-
this.navigation.navigate(url, {
|
|
3427
|
-
state,
|
|
3428
|
-
history: "push"
|
|
3429
|
-
});
|
|
3430
|
-
}
|
|
3431
|
-
back() {
|
|
3432
|
-
this.navigation.back();
|
|
3433
|
-
}
|
|
3434
|
-
forward() {
|
|
3435
|
-
this.navigation.forward();
|
|
3436
|
-
}
|
|
3437
|
-
onUrlChange(fn) {
|
|
3438
|
-
this._urlChangeListeners.push(fn);
|
|
3439
|
-
return () => {
|
|
3440
|
-
const fnIndex = this._urlChangeListeners.indexOf(fn);
|
|
3441
|
-
this._urlChangeListeners.splice(fnIndex, 1);
|
|
3442
|
-
};
|
|
3443
|
-
}
|
|
3444
|
-
static \u{275}fac = function NavigationAdapterForLocation_Factory(__ngFactoryType__) {
|
|
3445
|
-
return new (__ngFactoryType__ || NavigationAdapterForLocation);
|
|
3446
|
-
};
|
|
3447
|
-
static \u{275}prov = /* @__PURE__ */ \u{275}_defineInjectable({
|
|
3448
|
-
token: NavigationAdapterForLocation,
|
|
3449
|
-
factory: NavigationAdapterForLocation.\u{275}fac
|
|
3450
|
-
});
|
|
3451
|
-
}
|
|
3452
|
-
(() => {
|
|
3453
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NavigationAdapterForLocation, [{
|
|
3454
|
-
type: Injectable
|
|
3455
|
-
}], () => [], null);
|
|
3456
|
-
})();
|
|
3457
|
-
function registerLocaleData2(data, localeId, extraData) {
|
|
3458
|
-
return registerLocaleData(data, localeId, extraData);
|
|
3459
|
-
}
|
|
3460
|
-
var PLATFORM_BROWSER_ID = "browser";
|
|
3461
|
-
var PLATFORM_SERVER_ID = "server";
|
|
3462
|
-
function isPlatformBrowser(platformId) {
|
|
3463
|
-
return platformId === PLATFORM_BROWSER_ID;
|
|
3464
|
-
}
|
|
3465
|
-
function isPlatformServer(platformId) {
|
|
3466
|
-
return platformId === PLATFORM_SERVER_ID;
|
|
3467
|
-
}
|
|
3468
|
-
var VERSION = /* @__PURE__ */ new Version("21.2.6");
|
|
3469
|
-
|
|
3470
|
-
class ViewportScroller {
|
|
3471
|
-
static \u{275}prov = /* @__PURE__ */ \u{275}_defineInjectable({
|
|
3472
|
-
token: ViewportScroller,
|
|
3473
|
-
providedIn: "root",
|
|
3474
|
-
factory: () => typeof ngServerMode !== "undefined" && ngServerMode ? new NullViewportScroller : new BrowserViewportScroller(inject(DOCUMENT), window)
|
|
3475
|
-
});
|
|
3476
|
-
}
|
|
3477
|
-
|
|
3478
|
-
class BrowserViewportScroller {
|
|
3479
|
-
document;
|
|
3480
|
-
window;
|
|
3481
|
-
offset = () => [0, 0];
|
|
3482
|
-
constructor(document, window2) {
|
|
3483
|
-
this.document = document;
|
|
3484
|
-
this.window = window2;
|
|
3485
|
-
}
|
|
3486
|
-
setOffset(offset) {
|
|
3487
|
-
if (Array.isArray(offset)) {
|
|
3488
|
-
this.offset = () => offset;
|
|
3489
|
-
} else {
|
|
3490
|
-
this.offset = offset;
|
|
3491
|
-
}
|
|
3492
|
-
}
|
|
3493
|
-
getScrollPosition() {
|
|
3494
|
-
return [this.window.scrollX, this.window.scrollY];
|
|
3495
|
-
}
|
|
3496
|
-
scrollToPosition(position, options) {
|
|
3497
|
-
this.window.scrollTo({
|
|
3498
|
-
...options,
|
|
3499
|
-
left: position[0],
|
|
3500
|
-
top: position[1]
|
|
3501
|
-
});
|
|
3502
|
-
}
|
|
3503
|
-
scrollToAnchor(target, options) {
|
|
3504
|
-
const elSelected = findAnchorFromDocument(this.document, target);
|
|
3505
|
-
if (elSelected) {
|
|
3506
|
-
this.scrollToElement(elSelected, options);
|
|
3507
|
-
elSelected.focus();
|
|
3508
|
-
}
|
|
3509
|
-
}
|
|
3510
|
-
setHistoryScrollRestoration(scrollRestoration) {
|
|
3511
|
-
try {
|
|
3512
|
-
this.window.history.scrollRestoration = scrollRestoration;
|
|
3513
|
-
} catch {
|
|
3514
|
-
console.warn(formatRuntimeError(2400, ngDevMode && "Failed to set `window.history.scrollRestoration`. " + `This may occur when:
|
|
3515
|
-
` + `\u2022 The script is running inside a sandboxed iframe
|
|
3516
|
-
` + `\u2022 The window is partially navigated or inactive
|
|
3517
|
-
` + `\u2022 The script is executed in an untrusted or special context (e.g., test runners, browser extensions, or content previews)
|
|
3518
|
-
` + "Scroll position may not be preserved across navigation."));
|
|
3519
|
-
}
|
|
3520
|
-
}
|
|
3521
|
-
scrollToElement(el, options) {
|
|
3522
|
-
const rect = el.getBoundingClientRect();
|
|
3523
|
-
const left = rect.left + this.window.pageXOffset;
|
|
3524
|
-
const top = rect.top + this.window.pageYOffset;
|
|
3525
|
-
const offset = this.offset();
|
|
3526
|
-
this.window.scrollTo({
|
|
3527
|
-
...options,
|
|
3528
|
-
left: left - offset[0],
|
|
3529
|
-
top: top - offset[1]
|
|
3530
|
-
});
|
|
3531
|
-
}
|
|
3532
|
-
}
|
|
3533
|
-
function findAnchorFromDocument(document, target) {
|
|
3534
|
-
const documentResult = document.getElementById(target) || document.getElementsByName(target)[0];
|
|
3535
|
-
if (documentResult) {
|
|
3536
|
-
return documentResult;
|
|
3537
|
-
}
|
|
3538
|
-
if (typeof document.createTreeWalker === "function" && document.body && typeof document.body.attachShadow === "function") {
|
|
3539
|
-
const treeWalker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT);
|
|
3540
|
-
let currentNode = treeWalker.currentNode;
|
|
3541
|
-
while (currentNode) {
|
|
3542
|
-
const shadowRoot = currentNode.shadowRoot;
|
|
3543
|
-
if (shadowRoot) {
|
|
3544
|
-
const result = shadowRoot.getElementById(target) || shadowRoot.querySelector(`[name="${target}"]`);
|
|
3545
|
-
if (result) {
|
|
3546
|
-
return result;
|
|
3547
|
-
}
|
|
3548
|
-
}
|
|
3549
|
-
currentNode = treeWalker.nextNode();
|
|
3550
|
-
}
|
|
3551
|
-
}
|
|
3552
|
-
return null;
|
|
3553
|
-
}
|
|
3554
|
-
|
|
3555
|
-
class NullViewportScroller {
|
|
3556
|
-
setOffset(offset) {}
|
|
3557
|
-
getScrollPosition() {
|
|
3558
|
-
return [0, 0];
|
|
3559
|
-
}
|
|
3560
|
-
scrollToPosition(position) {}
|
|
3561
|
-
scrollToAnchor(anchor) {}
|
|
3562
|
-
setHistoryScrollRestoration(scrollRestoration) {}
|
|
3563
|
-
}
|
|
3564
|
-
var PLACEHOLDER_QUALITY = "20";
|
|
3565
|
-
function getUrl(src, win) {
|
|
3566
|
-
return isAbsoluteUrl(src) ? new URL(src) : new URL(src, win.location.href);
|
|
3567
|
-
}
|
|
3568
|
-
function isAbsoluteUrl(src) {
|
|
3569
|
-
return /^https?:\/\//.test(src);
|
|
3570
|
-
}
|
|
3571
|
-
function extractHostname(url) {
|
|
3572
|
-
return isAbsoluteUrl(url) ? new URL(url).hostname : url;
|
|
3573
|
-
}
|
|
3574
|
-
function isValidPath(path) {
|
|
3575
|
-
const isString = typeof path === "string";
|
|
3576
|
-
if (!isString || path.trim() === "") {
|
|
3577
|
-
return false;
|
|
3578
|
-
}
|
|
3579
|
-
try {
|
|
3580
|
-
const url = new URL(path);
|
|
3581
|
-
return true;
|
|
3582
|
-
} catch {
|
|
3583
|
-
return false;
|
|
3584
|
-
}
|
|
3585
|
-
}
|
|
3586
|
-
function normalizePath(path) {
|
|
3587
|
-
return path.endsWith("/") ? path.slice(0, -1) : path;
|
|
3588
|
-
}
|
|
3589
|
-
function normalizeSrc(src) {
|
|
3590
|
-
return src.startsWith("/") ? src.slice(1) : src;
|
|
3591
|
-
}
|
|
3592
|
-
var noopImageLoader = (config) => config.src;
|
|
3593
|
-
var IMAGE_LOADER = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "ImageLoader" : "", {
|
|
3594
|
-
factory: () => noopImageLoader
|
|
3595
|
-
});
|
|
3596
|
-
function createImageLoader(buildUrlFn, exampleUrls) {
|
|
3597
|
-
return function provideImageLoader(path) {
|
|
3598
|
-
if (!isValidPath(path)) {
|
|
3599
|
-
throwInvalidPathError(path, exampleUrls || []);
|
|
3600
|
-
}
|
|
3601
|
-
path = normalizePath(path);
|
|
3602
|
-
const loaderFn = (config) => {
|
|
3603
|
-
if (isAbsoluteUrl(config.src)) {
|
|
3604
|
-
throwUnexpectedAbsoluteUrlError(path, config.src);
|
|
3605
|
-
}
|
|
3606
|
-
return buildUrlFn(path, {
|
|
3607
|
-
...config,
|
|
3608
|
-
src: normalizeSrc(config.src)
|
|
3609
|
-
});
|
|
3610
|
-
};
|
|
3611
|
-
const providers = [{
|
|
3612
|
-
provide: IMAGE_LOADER,
|
|
3613
|
-
useValue: loaderFn
|
|
3614
|
-
}];
|
|
3615
|
-
return providers;
|
|
3616
|
-
};
|
|
3617
|
-
}
|
|
3618
|
-
function throwInvalidPathError(path, exampleUrls) {
|
|
3619
|
-
throw new RuntimeError(2959, ngDevMode && `Image loader has detected an invalid path (\`${path}\`). ` + `To fix this, supply a path using one of the following formats: ${exampleUrls.join(" or ")}`);
|
|
3620
|
-
}
|
|
3621
|
-
function throwUnexpectedAbsoluteUrlError(path, url) {
|
|
3622
|
-
throw new RuntimeError(2959, ngDevMode && `Image loader has detected a \`<img>\` tag with an invalid \`ngSrc\` attribute: ${url}. ` + `This image loader expects \`ngSrc\` to be a relative URL - ` + `however the provided value is an absolute URL. ` + `To fix this, provide \`ngSrc\` as a path relative to the base URL ` + `configured for this loader (\`${path}\`).`);
|
|
3623
|
-
}
|
|
3624
|
-
function normalizeLoaderTransform(transform, separator) {
|
|
3625
|
-
if (typeof transform === "string") {
|
|
3626
|
-
return transform;
|
|
3627
|
-
}
|
|
3628
|
-
return Object.entries(transform).map(([key, value]) => `${key}${separator}${value}`).join(",");
|
|
3629
|
-
}
|
|
3630
|
-
var provideCloudflareLoader = createImageLoader(createCloudflareUrl, ngDevMode ? ["https://<ZONE>/cdn-cgi/image/<OPTIONS>/<SOURCE-IMAGE>"] : undefined);
|
|
3631
|
-
function createCloudflareUrl(path, config) {
|
|
3632
|
-
let params = `format=auto`;
|
|
3633
|
-
if (config.width) {
|
|
3634
|
-
params += `,width=${config.width}`;
|
|
3635
|
-
}
|
|
3636
|
-
if (config.height) {
|
|
3637
|
-
params += `,height=${config.height}`;
|
|
3638
|
-
}
|
|
3639
|
-
if (config.isPlaceholder) {
|
|
3640
|
-
params += `,quality=${PLACEHOLDER_QUALITY}`;
|
|
3641
|
-
}
|
|
3642
|
-
if (config.loaderParams?.["transform"]) {
|
|
3643
|
-
const transformStr = normalizeLoaderTransform(config.loaderParams["transform"], "=");
|
|
3644
|
-
params += `,${transformStr}`;
|
|
3645
|
-
}
|
|
3646
|
-
return `${path}/cdn-cgi/image/${params}/${config.src}`;
|
|
3647
|
-
}
|
|
3648
|
-
var cloudinaryLoaderInfo = {
|
|
3649
|
-
name: "Cloudinary",
|
|
3650
|
-
testUrl: isCloudinaryUrl
|
|
3651
|
-
};
|
|
3652
|
-
var CLOUDINARY_LOADER_REGEX = /https?\:\/\/[^\/]+\.cloudinary\.com\/.+/;
|
|
3653
|
-
function isCloudinaryUrl(url) {
|
|
3654
|
-
return CLOUDINARY_LOADER_REGEX.test(url);
|
|
3655
|
-
}
|
|
3656
|
-
var provideCloudinaryLoader = createImageLoader(createCloudinaryUrl, ngDevMode ? ["https://res.cloudinary.com/mysite", "https://mysite.cloudinary.com", "https://subdomain.mysite.com"] : undefined);
|
|
3657
|
-
function createCloudinaryUrl(path, config) {
|
|
3658
|
-
const quality = config.isPlaceholder ? "q_auto:low" : "q_auto";
|
|
3659
|
-
let params = `f_auto,${quality}`;
|
|
3660
|
-
if (config.width) {
|
|
3661
|
-
params += `,w_${config.width}`;
|
|
3662
|
-
}
|
|
3663
|
-
if (config.height) {
|
|
3664
|
-
params += `,h_${config.height}`;
|
|
3665
|
-
}
|
|
3666
|
-
if (config.loaderParams?.["rounded"]) {
|
|
3667
|
-
params += `,r_max`;
|
|
3668
|
-
}
|
|
3669
|
-
if (config.loaderParams?.["transform"]) {
|
|
3670
|
-
const transformStr = normalizeLoaderTransform(config.loaderParams["transform"], "_");
|
|
3671
|
-
params += `,${transformStr}`;
|
|
3672
|
-
}
|
|
3673
|
-
return `${path}/image/upload/${params}/${config.src}`;
|
|
3674
|
-
}
|
|
3675
|
-
var imageKitLoaderInfo = {
|
|
3676
|
-
name: "ImageKit",
|
|
3677
|
-
testUrl: isImageKitUrl
|
|
3678
|
-
};
|
|
3679
|
-
var IMAGE_KIT_LOADER_REGEX = /https?\:\/\/[^\/]+\.imagekit\.io\/.+/;
|
|
3680
|
-
function isImageKitUrl(url) {
|
|
3681
|
-
return IMAGE_KIT_LOADER_REGEX.test(url);
|
|
3682
|
-
}
|
|
3683
|
-
var provideImageKitLoader = createImageLoader(createImagekitUrl, ngDevMode ? ["https://ik.imagekit.io/mysite", "https://subdomain.mysite.com"] : undefined);
|
|
3684
|
-
function createImagekitUrl(path, config) {
|
|
3685
|
-
const {
|
|
3686
|
-
src,
|
|
3687
|
-
width
|
|
3688
|
-
} = config;
|
|
3689
|
-
const params = [];
|
|
3690
|
-
if (width) {
|
|
3691
|
-
params.push(`w-${width}`);
|
|
3692
|
-
}
|
|
3693
|
-
if (config.height) {
|
|
3694
|
-
params.push(`h-${config.height}`);
|
|
3695
|
-
}
|
|
3696
|
-
if (config.isPlaceholder) {
|
|
3697
|
-
params.push(`q-${PLACEHOLDER_QUALITY}`);
|
|
3698
|
-
}
|
|
3699
|
-
if (config.loaderParams?.["transform"]) {
|
|
3700
|
-
const transformStr = normalizeLoaderTransform(config.loaderParams["transform"], "-");
|
|
3701
|
-
params.push(transformStr);
|
|
3702
|
-
}
|
|
3703
|
-
const urlSegments = params.length ? [path, `tr:${params.join(",")}`, src] : [path, src];
|
|
3704
|
-
const url = new URL(urlSegments.join("/"));
|
|
3705
|
-
return url.href;
|
|
3706
|
-
}
|
|
3707
|
-
var imgixLoaderInfo = {
|
|
3708
|
-
name: "Imgix",
|
|
3709
|
-
testUrl: isImgixUrl
|
|
3710
|
-
};
|
|
3711
|
-
var IMGIX_LOADER_REGEX = /https?\:\/\/[^\/]+\.imgix\.net\/.+/;
|
|
3712
|
-
function isImgixUrl(url) {
|
|
3713
|
-
return IMGIX_LOADER_REGEX.test(url);
|
|
3714
|
-
}
|
|
3715
|
-
var provideImgixLoader = createImageLoader(createImgixUrl, ngDevMode ? ["https://somepath.imgix.net/"] : undefined);
|
|
3716
|
-
function createImgixUrl(path, config) {
|
|
3717
|
-
const params = [];
|
|
3718
|
-
params.push("auto=format");
|
|
3719
|
-
if (config.width) {
|
|
3720
|
-
params.push(`w=${config.width}`);
|
|
3721
|
-
}
|
|
3722
|
-
if (config.height) {
|
|
3723
|
-
params.push(`h=${config.height}`);
|
|
3724
|
-
}
|
|
3725
|
-
if (config.isPlaceholder) {
|
|
3726
|
-
params.push(`q=${PLACEHOLDER_QUALITY}`);
|
|
3727
|
-
}
|
|
3728
|
-
if (config.loaderParams?.["transform"]) {
|
|
3729
|
-
const transform = normalizeLoaderTransform(config.loaderParams["transform"], "=").split(",");
|
|
3730
|
-
params.push(...transform);
|
|
3731
|
-
}
|
|
3732
|
-
const url = new URL(`${path}/${config.src}`);
|
|
3733
|
-
url.search = params.join("&");
|
|
3734
|
-
return url.href;
|
|
3735
|
-
}
|
|
3736
|
-
var netlifyLoaderInfo = {
|
|
3737
|
-
name: "Netlify",
|
|
3738
|
-
testUrl: isNetlifyUrl
|
|
3739
|
-
};
|
|
3740
|
-
var NETLIFY_LOADER_REGEX = /https?\:\/\/[^\/]+\.netlify\.app\/.+/;
|
|
3741
|
-
function isNetlifyUrl(url) {
|
|
3742
|
-
return NETLIFY_LOADER_REGEX.test(url);
|
|
3743
|
-
}
|
|
3744
|
-
function provideNetlifyLoader(path) {
|
|
3745
|
-
if (path && !isValidPath(path)) {
|
|
3746
|
-
throw new RuntimeError(2959, ngDevMode && `Image loader has detected an invalid path (\`${path}\`). ` + `To fix this, supply either the full URL to the Netlify site, or leave it empty to use the current site.`);
|
|
3747
|
-
}
|
|
3748
|
-
if (path) {
|
|
3749
|
-
const url = new URL(path);
|
|
3750
|
-
path = url.origin;
|
|
3751
|
-
}
|
|
3752
|
-
const loaderFn = (config) => {
|
|
3753
|
-
return createNetlifyUrl(config, path);
|
|
3754
|
-
};
|
|
3755
|
-
const providers = [{
|
|
3756
|
-
provide: IMAGE_LOADER,
|
|
3757
|
-
useValue: loaderFn
|
|
3758
|
-
}];
|
|
3759
|
-
return providers;
|
|
3760
|
-
}
|
|
3761
|
-
var validParams = new Map([["height", "h"], ["fit", "fit"], ["quality", "q"], ["q", "q"], ["position", "position"]]);
|
|
3762
|
-
function createNetlifyUrl(config, path) {
|
|
3763
|
-
const url = new URL(path ?? "https://a/");
|
|
3764
|
-
url.pathname = "/.netlify/images";
|
|
3765
|
-
if (!isAbsoluteUrl(config.src) && !config.src.startsWith("/")) {
|
|
3766
|
-
config.src = "/" + config.src;
|
|
3767
|
-
}
|
|
3768
|
-
url.searchParams.set("url", config.src);
|
|
3769
|
-
if (config.width) {
|
|
3770
|
-
url.searchParams.set("w", config.width.toString());
|
|
3771
|
-
}
|
|
3772
|
-
if (config.height) {
|
|
3773
|
-
url.searchParams.set("h", config.height.toString());
|
|
3774
|
-
}
|
|
3775
|
-
const configQuality = config.loaderParams?.["quality"] ?? config.loaderParams?.["q"];
|
|
3776
|
-
if (config.isPlaceholder && !configQuality) {
|
|
3777
|
-
url.searchParams.set("q", PLACEHOLDER_QUALITY);
|
|
3778
|
-
}
|
|
3779
|
-
for (const [param, value] of Object.entries(config.loaderParams ?? {})) {
|
|
3780
|
-
if (validParams.has(param)) {
|
|
3781
|
-
url.searchParams.set(validParams.get(param), value.toString());
|
|
3782
|
-
} else {
|
|
3783
|
-
if (ngDevMode) {
|
|
3784
|
-
console.warn(formatRuntimeError(2959, `The Netlify image loader has detected an \`<img>\` tag with the unsupported attribute "\`${param}\`".`));
|
|
3785
|
-
}
|
|
3786
|
-
}
|
|
3787
|
-
}
|
|
3788
|
-
return url.hostname === "a" ? url.href.replace(url.origin, "") : url.href;
|
|
3789
|
-
}
|
|
3790
|
-
function imgDirectiveDetails(ngSrc, includeNgSrc = true) {
|
|
3791
|
-
const ngSrcInfo = includeNgSrc ? `(activated on an <img> element with the \`ngSrc="${ngSrc}"\`) ` : "";
|
|
3792
|
-
return `The NgOptimizedImage directive ${ngSrcInfo}has detected that`;
|
|
3793
|
-
}
|
|
3794
|
-
function assertDevMode(checkName) {
|
|
3795
|
-
if (!ngDevMode) {
|
|
3796
|
-
throw new RuntimeError(2958, `Unexpected invocation of the ${checkName} in the prod mode. ` + `Please make sure that the prod mode is enabled for production builds.`);
|
|
3797
|
-
}
|
|
3798
|
-
}
|
|
3799
|
-
|
|
3800
|
-
class LCPImageObserver {
|
|
3801
|
-
images = new Map;
|
|
3802
|
-
window = inject(DOCUMENT).defaultView;
|
|
3803
|
-
observer = null;
|
|
3804
|
-
constructor() {
|
|
3805
|
-
assertDevMode("LCP checker");
|
|
3806
|
-
if ((typeof ngServerMode === "undefined" || !ngServerMode) && typeof PerformanceObserver !== "undefined") {
|
|
3807
|
-
this.observer = this.initPerformanceObserver();
|
|
3808
|
-
}
|
|
3809
|
-
}
|
|
3810
|
-
initPerformanceObserver() {
|
|
3811
|
-
const observer = new PerformanceObserver((entryList) => {
|
|
3812
|
-
const entries = entryList.getEntries();
|
|
3813
|
-
if (entries.length === 0)
|
|
3814
|
-
return;
|
|
3815
|
-
const lcpElement = entries[entries.length - 1];
|
|
3816
|
-
const imgSrc = lcpElement.element?.src ?? "";
|
|
3817
|
-
if (imgSrc.startsWith("data:") || imgSrc.startsWith("blob:"))
|
|
3818
|
-
return;
|
|
3819
|
-
const img = this.images.get(imgSrc);
|
|
3820
|
-
if (!img)
|
|
3821
|
-
return;
|
|
3822
|
-
if (!img.priority && !img.alreadyWarnedPriority) {
|
|
3823
|
-
img.alreadyWarnedPriority = true;
|
|
3824
|
-
logMissingPriorityError(imgSrc);
|
|
3825
|
-
}
|
|
3826
|
-
if (img.modified && !img.alreadyWarnedModified) {
|
|
3827
|
-
img.alreadyWarnedModified = true;
|
|
3828
|
-
logModifiedWarning(imgSrc);
|
|
3829
|
-
}
|
|
3830
|
-
});
|
|
3831
|
-
observer.observe({
|
|
3832
|
-
type: "largest-contentful-paint",
|
|
3833
|
-
buffered: true
|
|
3834
|
-
});
|
|
3835
|
-
return observer;
|
|
3836
|
-
}
|
|
3837
|
-
registerImage(rewrittenSrc, isPriority) {
|
|
3838
|
-
if (!this.observer)
|
|
3839
|
-
return;
|
|
3840
|
-
const url = getUrl(rewrittenSrc, this.window).href;
|
|
3841
|
-
const existingState = this.images.get(url);
|
|
3842
|
-
if (existingState) {
|
|
3843
|
-
existingState.priority = existingState.priority || isPriority;
|
|
3844
|
-
existingState.count++;
|
|
3845
|
-
} else {
|
|
3846
|
-
const newObservedImageState = {
|
|
3847
|
-
priority: isPriority,
|
|
3848
|
-
modified: false,
|
|
3849
|
-
alreadyWarnedModified: false,
|
|
3850
|
-
alreadyWarnedPriority: false,
|
|
3851
|
-
count: 1
|
|
3852
|
-
};
|
|
3853
|
-
this.images.set(url, newObservedImageState);
|
|
3854
|
-
}
|
|
3855
|
-
}
|
|
3856
|
-
unregisterImage(rewrittenSrc) {
|
|
3857
|
-
if (!this.observer)
|
|
3858
|
-
return;
|
|
3859
|
-
const url = getUrl(rewrittenSrc, this.window).href;
|
|
3860
|
-
const existingState = this.images.get(url);
|
|
3861
|
-
if (existingState) {
|
|
3862
|
-
existingState.count--;
|
|
3863
|
-
if (existingState.count <= 0) {
|
|
3864
|
-
this.images.delete(url);
|
|
3865
|
-
}
|
|
3866
|
-
}
|
|
3867
|
-
}
|
|
3868
|
-
updateImage(originalSrc, newSrc) {
|
|
3869
|
-
if (!this.observer)
|
|
3870
|
-
return;
|
|
3871
|
-
const originalUrl = getUrl(originalSrc, this.window).href;
|
|
3872
|
-
const newUrl = getUrl(newSrc, this.window).href;
|
|
3873
|
-
if (originalUrl === newUrl)
|
|
3874
|
-
return;
|
|
3875
|
-
const originalState = this.images.get(originalUrl);
|
|
3876
|
-
if (!originalState)
|
|
3877
|
-
return;
|
|
3878
|
-
originalState.count--;
|
|
3879
|
-
if (originalState.count <= 0) {
|
|
3880
|
-
this.images.delete(originalUrl);
|
|
3881
|
-
}
|
|
3882
|
-
const newState = this.images.get(newUrl);
|
|
3883
|
-
if (newState) {
|
|
3884
|
-
newState.priority = newState.priority || originalState.priority;
|
|
3885
|
-
newState.modified = true;
|
|
3886
|
-
newState.alreadyWarnedPriority = newState.alreadyWarnedPriority || originalState.alreadyWarnedPriority;
|
|
3887
|
-
newState.alreadyWarnedModified = newState.alreadyWarnedModified || originalState.alreadyWarnedModified;
|
|
3888
|
-
newState.count++;
|
|
3889
|
-
} else {
|
|
3890
|
-
this.images.set(newUrl, {
|
|
3891
|
-
priority: originalState.priority,
|
|
3892
|
-
modified: true,
|
|
3893
|
-
alreadyWarnedModified: originalState.alreadyWarnedModified,
|
|
3894
|
-
alreadyWarnedPriority: originalState.alreadyWarnedPriority,
|
|
3895
|
-
count: 1
|
|
3896
|
-
});
|
|
3897
|
-
}
|
|
3898
|
-
}
|
|
3899
|
-
ngOnDestroy() {
|
|
3900
|
-
if (!this.observer)
|
|
3901
|
-
return;
|
|
3902
|
-
this.observer.disconnect();
|
|
3903
|
-
this.images.clear();
|
|
3904
|
-
}
|
|
3905
|
-
static \u{275}fac = function LCPImageObserver_Factory(__ngFactoryType__) {
|
|
3906
|
-
return new (__ngFactoryType__ || LCPImageObserver);
|
|
3907
|
-
};
|
|
3908
|
-
static \u{275}prov = /* @__PURE__ */ \u{275}_defineInjectable({
|
|
3909
|
-
token: LCPImageObserver,
|
|
3910
|
-
factory: LCPImageObserver.\u{275}fac,
|
|
3911
|
-
providedIn: "root"
|
|
3912
|
-
});
|
|
3913
|
-
}
|
|
3914
|
-
(() => {
|
|
3915
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LCPImageObserver, [{
|
|
3916
|
-
type: Injectable,
|
|
3917
|
-
args: [{
|
|
3918
|
-
providedIn: "root"
|
|
3919
|
-
}]
|
|
3920
|
-
}], () => [], null);
|
|
3921
|
-
})();
|
|
3922
|
-
function logMissingPriorityError(ngSrc) {
|
|
3923
|
-
const directiveDetails = imgDirectiveDetails(ngSrc);
|
|
3924
|
-
console.error(formatRuntimeError(2955, `${directiveDetails} this image is the Largest Contentful Paint (LCP) ` + `element but was not marked "priority". This image should be marked ` + `"priority" in order to prioritize its loading. ` + `To fix this, add the "priority" attribute.`));
|
|
3925
|
-
}
|
|
3926
|
-
function logModifiedWarning(ngSrc) {
|
|
3927
|
-
const directiveDetails = imgDirectiveDetails(ngSrc);
|
|
3928
|
-
console.warn(formatRuntimeError(2964, `${directiveDetails} this image is the Largest Contentful Paint (LCP) ` + `element and has had its "ngSrc" attribute modified. This can cause ` + `slower loading performance. It is recommended not to modify the "ngSrc" ` + `property on any image which could be the LCP element.`));
|
|
3929
|
-
}
|
|
3930
|
-
var INTERNAL_PRECONNECT_CHECK_BLOCKLIST = new Set(["localhost", "127.0.0.1", "0.0.0.0", "[::1]"]);
|
|
3931
|
-
var PRECONNECT_CHECK_BLOCKLIST = new InjectionToken(typeof ngDevMode !== "undefined" && ngDevMode ? "PRECONNECT_CHECK_BLOCKLIST" : "");
|
|
3932
|
-
|
|
3933
|
-
class PreconnectLinkChecker {
|
|
3934
|
-
document = inject(DOCUMENT);
|
|
3935
|
-
preconnectLinks = null;
|
|
3936
|
-
alreadySeen = new Set;
|
|
3937
|
-
window = this.document.defaultView;
|
|
3938
|
-
blocklist = new Set(INTERNAL_PRECONNECT_CHECK_BLOCKLIST);
|
|
3939
|
-
constructor() {
|
|
3940
|
-
assertDevMode("preconnect link checker");
|
|
3941
|
-
const blocklist = inject(PRECONNECT_CHECK_BLOCKLIST, {
|
|
3942
|
-
optional: true
|
|
3943
|
-
});
|
|
3944
|
-
if (blocklist) {
|
|
3945
|
-
this.populateBlocklist(blocklist);
|
|
3946
|
-
}
|
|
3947
|
-
}
|
|
3948
|
-
populateBlocklist(origins) {
|
|
3949
|
-
if (Array.isArray(origins)) {
|
|
3950
|
-
deepForEach(origins, (origin) => {
|
|
3951
|
-
this.blocklist.add(extractHostname(origin));
|
|
3952
|
-
});
|
|
3953
|
-
} else {
|
|
3954
|
-
this.blocklist.add(extractHostname(origins));
|
|
3955
|
-
}
|
|
3956
|
-
}
|
|
3957
|
-
assertPreconnect(rewrittenSrc, originalNgSrc) {
|
|
3958
|
-
if (typeof ngServerMode !== "undefined" && ngServerMode)
|
|
3959
|
-
return;
|
|
3960
|
-
const imgUrl = getUrl(rewrittenSrc, this.window);
|
|
3961
|
-
if (this.blocklist.has(imgUrl.hostname) || this.alreadySeen.has(imgUrl.origin))
|
|
3962
|
-
return;
|
|
3963
|
-
this.alreadySeen.add(imgUrl.origin);
|
|
3964
|
-
this.preconnectLinks ??= this.queryPreconnectLinks();
|
|
3965
|
-
if (!this.preconnectLinks.has(imgUrl.origin)) {
|
|
3966
|
-
console.warn(formatRuntimeError(2956, `${imgDirectiveDetails(originalNgSrc)} there is no preconnect tag present for this ` + `image. Preconnecting to the origin(s) that serve priority images ensures that these ` + `images are delivered as soon as possible. To fix this, please add the following ` + `element into the <head> of the document:
|
|
3967
|
-
` + ` <link rel="preconnect" href="${imgUrl.origin}">`));
|
|
3968
|
-
}
|
|
3969
|
-
}
|
|
3970
|
-
queryPreconnectLinks() {
|
|
3971
|
-
const preconnectUrls = new Set;
|
|
3972
|
-
const links = this.document.querySelectorAll("link[rel=preconnect]");
|
|
3973
|
-
for (const link of links) {
|
|
3974
|
-
const url = getUrl(link.href, this.window);
|
|
3975
|
-
preconnectUrls.add(url.origin);
|
|
3976
|
-
}
|
|
3977
|
-
return preconnectUrls;
|
|
3978
|
-
}
|
|
3979
|
-
ngOnDestroy() {
|
|
3980
|
-
this.preconnectLinks?.clear();
|
|
3981
|
-
this.alreadySeen.clear();
|
|
3982
|
-
}
|
|
3983
|
-
static \u{275}fac = function PreconnectLinkChecker_Factory(__ngFactoryType__) {
|
|
3984
|
-
return new (__ngFactoryType__ || PreconnectLinkChecker);
|
|
3985
|
-
};
|
|
3986
|
-
static \u{275}prov = /* @__PURE__ */ \u{275}_defineInjectable({
|
|
3987
|
-
token: PreconnectLinkChecker,
|
|
3988
|
-
factory: PreconnectLinkChecker.\u{275}fac,
|
|
3989
|
-
providedIn: "root"
|
|
3990
|
-
});
|
|
3991
|
-
}
|
|
3992
|
-
(() => {
|
|
3993
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PreconnectLinkChecker, [{
|
|
3994
|
-
type: Injectable,
|
|
3995
|
-
args: [{
|
|
3996
|
-
providedIn: "root"
|
|
3997
|
-
}]
|
|
3998
|
-
}], () => [], null);
|
|
3999
|
-
})();
|
|
4000
|
-
function deepForEach(input, fn) {
|
|
4001
|
-
for (let value of input) {
|
|
4002
|
-
Array.isArray(value) ? deepForEach(value, fn) : fn(value);
|
|
4003
|
-
}
|
|
4004
|
-
}
|
|
4005
|
-
var DEFAULT_PRELOADED_IMAGES_LIMIT = 5;
|
|
4006
|
-
var PRELOADED_IMAGES = new InjectionToken(typeof ngDevMode === "undefined" || ngDevMode ? "NG_OPTIMIZED_PRELOADED_IMAGES" : "", {
|
|
4007
|
-
factory: () => new Set
|
|
4008
|
-
});
|
|
4009
|
-
|
|
4010
|
-
class PreloadLinkCreator {
|
|
4011
|
-
preloadedImages = inject(PRELOADED_IMAGES);
|
|
4012
|
-
document = inject(DOCUMENT);
|
|
4013
|
-
errorShown = false;
|
|
4014
|
-
createPreloadLinkTag(renderer, src, srcset, sizes) {
|
|
4015
|
-
if (ngDevMode && !this.errorShown && this.preloadedImages.size >= DEFAULT_PRELOADED_IMAGES_LIMIT) {
|
|
4016
|
-
this.errorShown = true;
|
|
4017
|
-
console.warn(formatRuntimeError(2961, `The \`NgOptimizedImage\` directive has detected that more than ` + `${DEFAULT_PRELOADED_IMAGES_LIMIT} images were marked as priority. ` + `This might negatively affect an overall performance of the page. ` + `To fix this, remove the "priority" attribute from images with less priority.`));
|
|
4018
|
-
}
|
|
4019
|
-
if (this.preloadedImages.has(src)) {
|
|
4020
|
-
return;
|
|
4021
|
-
}
|
|
4022
|
-
this.preloadedImages.add(src);
|
|
4023
|
-
const preload = renderer.createElement("link");
|
|
4024
|
-
renderer.setAttribute(preload, "as", "image");
|
|
4025
|
-
renderer.setAttribute(preload, "href", src);
|
|
4026
|
-
renderer.setAttribute(preload, "rel", "preload");
|
|
4027
|
-
renderer.setAttribute(preload, "fetchpriority", "high");
|
|
4028
|
-
if (sizes) {
|
|
4029
|
-
renderer.setAttribute(preload, "imageSizes", sizes);
|
|
4030
|
-
}
|
|
4031
|
-
if (srcset) {
|
|
4032
|
-
renderer.setAttribute(preload, "imageSrcset", srcset);
|
|
4033
|
-
}
|
|
4034
|
-
renderer.appendChild(this.document.head, preload);
|
|
4035
|
-
}
|
|
4036
|
-
static \u{275}fac = function PreloadLinkCreator_Factory(__ngFactoryType__) {
|
|
4037
|
-
return new (__ngFactoryType__ || PreloadLinkCreator);
|
|
4038
|
-
};
|
|
4039
|
-
static \u{275}prov = /* @__PURE__ */ \u{275}_defineInjectable({
|
|
4040
|
-
token: PreloadLinkCreator,
|
|
4041
|
-
factory: PreloadLinkCreator.\u{275}fac,
|
|
4042
|
-
providedIn: "root"
|
|
4043
|
-
});
|
|
4044
|
-
}
|
|
4045
|
-
(() => {
|
|
4046
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PreloadLinkCreator, [{
|
|
4047
|
-
type: Injectable,
|
|
4048
|
-
args: [{
|
|
4049
|
-
providedIn: "root"
|
|
4050
|
-
}]
|
|
4051
|
-
}], null, null);
|
|
4052
|
-
})();
|
|
4053
|
-
var BASE64_IMG_MAX_LENGTH_IN_ERROR = 50;
|
|
4054
|
-
var VALID_WIDTH_DESCRIPTOR_SRCSET = /^((\s*\d+w\s*(,|$)){1,})$/;
|
|
4055
|
-
var VALID_DENSITY_DESCRIPTOR_SRCSET = /^((\s*\d+(\.\d+)?x\s*(,|$)){1,})$/;
|
|
4056
|
-
var ABSOLUTE_SRCSET_DENSITY_CAP = 3;
|
|
4057
|
-
var RECOMMENDED_SRCSET_DENSITY_CAP = 2;
|
|
4058
|
-
var DENSITY_SRCSET_MULTIPLIERS = [1, 2];
|
|
4059
|
-
var VIEWPORT_BREAKPOINT_CUTOFF = 640;
|
|
4060
|
-
var ASPECT_RATIO_TOLERANCE = 0.1;
|
|
4061
|
-
var OVERSIZED_IMAGE_TOLERANCE = 1000;
|
|
4062
|
-
var FIXED_SRCSET_WIDTH_LIMIT = 1920;
|
|
4063
|
-
var FIXED_SRCSET_HEIGHT_LIMIT = 1080;
|
|
4064
|
-
var PLACEHOLDER_DIMENSION_LIMIT = 1000;
|
|
4065
|
-
var DATA_URL_WARN_LIMIT = 4000;
|
|
4066
|
-
var DATA_URL_ERROR_LIMIT = 1e4;
|
|
4067
|
-
var BUILT_IN_LOADERS = [imgixLoaderInfo, imageKitLoaderInfo, cloudinaryLoaderInfo, netlifyLoaderInfo];
|
|
4068
|
-
var PRIORITY_COUNT_THRESHOLD = 10;
|
|
4069
|
-
var IMGS_WITH_PRIORITY_ATTR_COUNT = 0;
|
|
4070
|
-
|
|
4071
|
-
class NgOptimizedImage {
|
|
4072
|
-
imageLoader = inject(IMAGE_LOADER);
|
|
4073
|
-
config = processConfig(inject(IMAGE_CONFIG));
|
|
4074
|
-
renderer = inject(Renderer2);
|
|
4075
|
-
imgElement = inject(ElementRef).nativeElement;
|
|
4076
|
-
injector = inject(Injector);
|
|
4077
|
-
destroyRef = inject(DestroyRef);
|
|
4078
|
-
lcpObserver;
|
|
4079
|
-
_renderedSrc = null;
|
|
4080
|
-
ngSrc;
|
|
4081
|
-
ngSrcset;
|
|
4082
|
-
sizes;
|
|
4083
|
-
width;
|
|
4084
|
-
height;
|
|
4085
|
-
decoding;
|
|
4086
|
-
loading;
|
|
4087
|
-
priority = false;
|
|
4088
|
-
loaderParams;
|
|
4089
|
-
disableOptimizedSrcset = false;
|
|
4090
|
-
fill = false;
|
|
4091
|
-
placeholder;
|
|
4092
|
-
placeholderConfig;
|
|
4093
|
-
src;
|
|
4094
|
-
srcset;
|
|
4095
|
-
constructor() {
|
|
4096
|
-
if (ngDevMode) {
|
|
4097
|
-
this.lcpObserver = this.injector.get(LCPImageObserver);
|
|
4098
|
-
this.destroyRef.onDestroy(() => {
|
|
4099
|
-
if (!this.priority && this._renderedSrc !== null) {
|
|
4100
|
-
this.lcpObserver.unregisterImage(this._renderedSrc);
|
|
4101
|
-
}
|
|
4102
|
-
});
|
|
4103
|
-
}
|
|
4104
|
-
this.destroyRef.onDestroy(() => {
|
|
4105
|
-
this.renderer.removeAttribute(this.imgElement, "loading");
|
|
4106
|
-
});
|
|
4107
|
-
}
|
|
4108
|
-
ngOnInit() {
|
|
4109
|
-
performanceMarkFeature("NgOptimizedImage");
|
|
4110
|
-
if (ngDevMode) {
|
|
4111
|
-
const ngZone = this.injector.get(NgZone);
|
|
4112
|
-
assertNonEmptyInput(this, "ngSrc", this.ngSrc);
|
|
4113
|
-
assertValidNgSrcset(this, this.ngSrcset);
|
|
4114
|
-
assertNoConflictingSrc(this);
|
|
4115
|
-
if (this.ngSrcset) {
|
|
4116
|
-
assertNoConflictingSrcset(this);
|
|
4117
|
-
}
|
|
4118
|
-
assertNotBase64Image(this);
|
|
4119
|
-
assertNotBlobUrl(this);
|
|
4120
|
-
if (this.fill) {
|
|
4121
|
-
assertEmptyWidthAndHeight(this);
|
|
4122
|
-
ngZone.runOutsideAngular(() => assertNonZeroRenderedHeight(this, this.imgElement, this.renderer, this.destroyRef));
|
|
4123
|
-
} else {
|
|
4124
|
-
assertNonEmptyWidthAndHeight(this);
|
|
4125
|
-
if (this.height !== undefined) {
|
|
4126
|
-
assertGreaterThanZero(this, this.height, "height");
|
|
4127
|
-
}
|
|
4128
|
-
if (this.width !== undefined) {
|
|
4129
|
-
assertGreaterThanZero(this, this.width, "width");
|
|
4130
|
-
}
|
|
4131
|
-
ngZone.runOutsideAngular(() => assertNoImageDistortion(this, this.imgElement, this.renderer, this.destroyRef));
|
|
4132
|
-
}
|
|
4133
|
-
assertValidLoadingInput(this);
|
|
4134
|
-
assertValidDecodingInput(this);
|
|
4135
|
-
if (!this.ngSrcset) {
|
|
4136
|
-
assertNoComplexSizes(this);
|
|
4137
|
-
}
|
|
4138
|
-
assertValidPlaceholder(this, this.imageLoader);
|
|
4139
|
-
assertNotMissingBuiltInLoader(this.ngSrc, this.imageLoader);
|
|
4140
|
-
assertNoNgSrcsetWithoutLoader(this, this.imageLoader);
|
|
4141
|
-
assertNoLoaderParamsWithoutLoader(this, this.imageLoader);
|
|
4142
|
-
ngZone.runOutsideAngular(() => {
|
|
4143
|
-
this.lcpObserver.registerImage(this.getRewrittenSrc(), this.priority);
|
|
4144
|
-
});
|
|
4145
|
-
if (this.priority) {
|
|
4146
|
-
const checker = this.injector.get(PreconnectLinkChecker);
|
|
4147
|
-
checker.assertPreconnect(this.getRewrittenSrc(), this.ngSrc);
|
|
4148
|
-
if (typeof ngServerMode !== "undefined" && !ngServerMode) {
|
|
4149
|
-
const applicationRef = this.injector.get(ApplicationRef);
|
|
4150
|
-
assetPriorityCountBelowThreshold(applicationRef);
|
|
4151
|
-
}
|
|
4152
|
-
}
|
|
4153
|
-
}
|
|
4154
|
-
if (this.placeholder) {
|
|
4155
|
-
this.removePlaceholderOnLoad(this.imgElement);
|
|
4156
|
-
}
|
|
4157
|
-
this.setHostAttributes();
|
|
4158
|
-
}
|
|
4159
|
-
setHostAttributes() {
|
|
4160
|
-
if (this.fill) {
|
|
4161
|
-
this.sizes ||= "100vw";
|
|
4162
|
-
} else {
|
|
4163
|
-
this.setHostAttribute("width", this.width.toString());
|
|
4164
|
-
this.setHostAttribute("height", this.height.toString());
|
|
4165
|
-
}
|
|
4166
|
-
this.setHostAttribute("loading", this.getLoadingBehavior());
|
|
4167
|
-
this.setHostAttribute("fetchpriority", this.getFetchPriority());
|
|
4168
|
-
this.setHostAttribute("decoding", this.getDecoding());
|
|
4169
|
-
this.setHostAttribute("ng-img", "true");
|
|
4170
|
-
const rewrittenSrcset = this.updateSrcAndSrcset();
|
|
4171
|
-
if (this.sizes) {
|
|
4172
|
-
if (this.getLoadingBehavior() === "lazy") {
|
|
4173
|
-
this.setHostAttribute("sizes", "auto, " + this.sizes);
|
|
4174
|
-
} else {
|
|
4175
|
-
this.setHostAttribute("sizes", this.sizes);
|
|
4176
|
-
}
|
|
4177
|
-
} else {
|
|
4178
|
-
if (this.ngSrcset && VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset) && this.getLoadingBehavior() === "lazy") {
|
|
4179
|
-
this.setHostAttribute("sizes", "auto, 100vw");
|
|
4180
|
-
}
|
|
4181
|
-
}
|
|
4182
|
-
if (typeof ngServerMode !== "undefined" && ngServerMode && this.priority) {
|
|
4183
|
-
const preloadLinkCreator = this.injector.get(PreloadLinkCreator);
|
|
4184
|
-
preloadLinkCreator.createPreloadLinkTag(this.renderer, this.getRewrittenSrc(), rewrittenSrcset, this.sizes);
|
|
4185
|
-
}
|
|
4186
|
-
}
|
|
4187
|
-
ngOnChanges(changes) {
|
|
4188
|
-
if (ngDevMode) {
|
|
4189
|
-
assertNoPostInitInputChange(this, changes, ["ngSrcset", "width", "height", "priority", "fill", "loading", "sizes", "loaderParams", "disableOptimizedSrcset"]);
|
|
4190
|
-
}
|
|
4191
|
-
if (changes["ngSrc"] && !changes["ngSrc"].isFirstChange()) {
|
|
4192
|
-
const oldSrc = this._renderedSrc;
|
|
4193
|
-
this.updateSrcAndSrcset(true);
|
|
4194
|
-
if (ngDevMode) {
|
|
4195
|
-
const newSrc = this._renderedSrc;
|
|
4196
|
-
if (oldSrc && newSrc && oldSrc !== newSrc) {
|
|
4197
|
-
const ngZone = this.injector.get(NgZone);
|
|
4198
|
-
ngZone.runOutsideAngular(() => {
|
|
4199
|
-
this.lcpObserver.updateImage(oldSrc, newSrc);
|
|
4200
|
-
});
|
|
4201
|
-
}
|
|
4202
|
-
}
|
|
4203
|
-
}
|
|
4204
|
-
if (ngDevMode && changes["placeholder"]?.currentValue && typeof ngServerMode !== "undefined" && !ngServerMode) {
|
|
4205
|
-
assertPlaceholderDimensions(this, this.imgElement);
|
|
4206
|
-
}
|
|
4207
|
-
}
|
|
4208
|
-
getAspectRatio() {
|
|
4209
|
-
if (this.width && this.height && this.height !== 0) {
|
|
4210
|
-
return this.width / this.height;
|
|
4211
|
-
}
|
|
4212
|
-
return null;
|
|
4213
|
-
}
|
|
4214
|
-
callImageLoader(configWithoutCustomParams) {
|
|
4215
|
-
let augmentedConfig = configWithoutCustomParams;
|
|
4216
|
-
if (this.loaderParams) {
|
|
4217
|
-
augmentedConfig.loaderParams = this.loaderParams;
|
|
4218
|
-
}
|
|
4219
|
-
const ratio = this.getAspectRatio();
|
|
4220
|
-
if (ratio !== null && augmentedConfig.width) {
|
|
4221
|
-
augmentedConfig.height = Math.round(augmentedConfig.width / ratio);
|
|
4222
|
-
}
|
|
4223
|
-
return this.imageLoader(augmentedConfig);
|
|
4224
|
-
}
|
|
4225
|
-
getLoadingBehavior() {
|
|
4226
|
-
if (!this.priority && this.loading !== undefined) {
|
|
4227
|
-
return this.loading;
|
|
4228
|
-
}
|
|
4229
|
-
return this.priority ? "eager" : "lazy";
|
|
4230
|
-
}
|
|
4231
|
-
getFetchPriority() {
|
|
4232
|
-
return this.priority ? "high" : "auto";
|
|
4233
|
-
}
|
|
4234
|
-
getDecoding() {
|
|
4235
|
-
if (this.priority) {
|
|
4236
|
-
return "sync";
|
|
4237
|
-
}
|
|
4238
|
-
return this.decoding ?? "auto";
|
|
4239
|
-
}
|
|
4240
|
-
getRewrittenSrc() {
|
|
4241
|
-
if (!this._renderedSrc) {
|
|
4242
|
-
const imgConfig = {
|
|
4243
|
-
src: this.ngSrc
|
|
4244
|
-
};
|
|
4245
|
-
this._renderedSrc = this.callImageLoader(imgConfig);
|
|
4246
|
-
}
|
|
4247
|
-
return this._renderedSrc;
|
|
4248
|
-
}
|
|
4249
|
-
getRewrittenSrcset() {
|
|
4250
|
-
const widthSrcSet = VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset);
|
|
4251
|
-
const finalSrcs = this.ngSrcset.split(",").filter((src) => src !== "").map((srcStr) => {
|
|
4252
|
-
srcStr = srcStr.trim();
|
|
4253
|
-
const width = widthSrcSet ? parseFloat(srcStr) : parseFloat(srcStr) * this.width;
|
|
4254
|
-
return `${this.callImageLoader({
|
|
4255
|
-
src: this.ngSrc,
|
|
4256
|
-
width
|
|
4257
|
-
})} ${srcStr}`;
|
|
4258
|
-
});
|
|
4259
|
-
return finalSrcs.join(", ");
|
|
4260
|
-
}
|
|
4261
|
-
getAutomaticSrcset() {
|
|
4262
|
-
if (this.sizes) {
|
|
4263
|
-
return this.getResponsiveSrcset();
|
|
4264
|
-
} else {
|
|
4265
|
-
return this.getFixedSrcset();
|
|
4266
|
-
}
|
|
4267
|
-
}
|
|
4268
|
-
getResponsiveSrcset() {
|
|
4269
|
-
const {
|
|
4270
|
-
breakpoints
|
|
4271
|
-
} = this.config;
|
|
4272
|
-
let filteredBreakpoints = breakpoints;
|
|
4273
|
-
if (this.sizes?.trim() === "100vw") {
|
|
4274
|
-
filteredBreakpoints = breakpoints.filter((bp) => bp >= VIEWPORT_BREAKPOINT_CUTOFF);
|
|
4275
|
-
}
|
|
4276
|
-
const finalSrcs = filteredBreakpoints.map((bp) => `${this.callImageLoader({
|
|
4277
|
-
src: this.ngSrc,
|
|
4278
|
-
width: bp
|
|
4279
|
-
})} ${bp}w`);
|
|
4280
|
-
return finalSrcs.join(", ");
|
|
4281
|
-
}
|
|
4282
|
-
updateSrcAndSrcset(forceSrcRecalc = false) {
|
|
4283
|
-
if (forceSrcRecalc) {
|
|
4284
|
-
this._renderedSrc = null;
|
|
4285
|
-
}
|
|
4286
|
-
const rewrittenSrc = this.getRewrittenSrc();
|
|
4287
|
-
this.setHostAttribute("src", rewrittenSrc);
|
|
4288
|
-
let rewrittenSrcset = undefined;
|
|
4289
|
-
if (this.ngSrcset) {
|
|
4290
|
-
rewrittenSrcset = this.getRewrittenSrcset();
|
|
4291
|
-
} else if (this.shouldGenerateAutomaticSrcset()) {
|
|
4292
|
-
rewrittenSrcset = this.getAutomaticSrcset();
|
|
4293
|
-
}
|
|
4294
|
-
if (rewrittenSrcset) {
|
|
4295
|
-
this.setHostAttribute("srcset", rewrittenSrcset);
|
|
4296
|
-
}
|
|
4297
|
-
return rewrittenSrcset;
|
|
4298
|
-
}
|
|
4299
|
-
getFixedSrcset() {
|
|
4300
|
-
const finalSrcs = DENSITY_SRCSET_MULTIPLIERS.map((multiplier) => `${this.callImageLoader({
|
|
4301
|
-
src: this.ngSrc,
|
|
4302
|
-
width: this.width * multiplier
|
|
4303
|
-
})} ${multiplier}x`);
|
|
4304
|
-
return finalSrcs.join(", ");
|
|
4305
|
-
}
|
|
4306
|
-
shouldGenerateAutomaticSrcset() {
|
|
4307
|
-
let oversizedImage = false;
|
|
4308
|
-
if (!this.sizes) {
|
|
4309
|
-
oversizedImage = this.width > FIXED_SRCSET_WIDTH_LIMIT || this.height > FIXED_SRCSET_HEIGHT_LIMIT;
|
|
4310
|
-
}
|
|
4311
|
-
return !this.disableOptimizedSrcset && !this.srcset && this.imageLoader !== noopImageLoader && !oversizedImage;
|
|
4312
|
-
}
|
|
4313
|
-
generatePlaceholder(placeholderInput) {
|
|
4314
|
-
const {
|
|
4315
|
-
placeholderResolution
|
|
4316
|
-
} = this.config;
|
|
4317
|
-
if (placeholderInput === true) {
|
|
4318
|
-
return `url(${this.callImageLoader({
|
|
4319
|
-
src: this.ngSrc,
|
|
4320
|
-
width: placeholderResolution,
|
|
4321
|
-
isPlaceholder: true
|
|
4322
|
-
})})`;
|
|
4323
|
-
} else if (typeof placeholderInput === "string") {
|
|
4324
|
-
return `url(${placeholderInput})`;
|
|
4325
|
-
}
|
|
4326
|
-
return null;
|
|
4327
|
-
}
|
|
4328
|
-
shouldBlurPlaceholder(placeholderConfig) {
|
|
4329
|
-
if (!placeholderConfig || !placeholderConfig.hasOwnProperty("blur")) {
|
|
4330
|
-
return true;
|
|
4331
|
-
}
|
|
4332
|
-
return Boolean(placeholderConfig.blur);
|
|
4333
|
-
}
|
|
4334
|
-
removePlaceholderOnLoad(img) {
|
|
4335
|
-
const callback = () => {
|
|
4336
|
-
const changeDetectorRef = this.injector.get(ChangeDetectorRef);
|
|
4337
|
-
removeLoadListenerFn();
|
|
4338
|
-
removeErrorListenerFn();
|
|
4339
|
-
this.placeholder = false;
|
|
4340
|
-
changeDetectorRef.markForCheck();
|
|
4341
|
-
};
|
|
4342
|
-
const removeLoadListenerFn = this.renderer.listen(img, "load", callback);
|
|
4343
|
-
const removeErrorListenerFn = this.renderer.listen(img, "error", callback);
|
|
4344
|
-
this.destroyRef.onDestroy(() => {
|
|
4345
|
-
removeLoadListenerFn();
|
|
4346
|
-
removeErrorListenerFn();
|
|
4347
|
-
});
|
|
4348
|
-
callOnLoadIfImageIsLoaded(img, callback);
|
|
4349
|
-
}
|
|
4350
|
-
setHostAttribute(name, value) {
|
|
4351
|
-
this.renderer.setAttribute(this.imgElement, name, value);
|
|
4352
|
-
}
|
|
4353
|
-
static \u{275}fac = function NgOptimizedImage_Factory(__ngFactoryType__) {
|
|
4354
|
-
return new (__ngFactoryType__ || NgOptimizedImage);
|
|
4355
|
-
};
|
|
4356
|
-
static \u{275}dir = /* @__PURE__ */ \u{275}_defineDirective({
|
|
4357
|
-
type: NgOptimizedImage,
|
|
4358
|
-
selectors: [["img", "ngSrc", ""]],
|
|
4359
|
-
hostVars: 18,
|
|
4360
|
-
hostBindings: function NgOptimizedImage_HostBindings(rf, ctx) {
|
|
4361
|
-
if (rf & 2) {
|
|
4362
|
-
\u{275}_styleProp("position", ctx.fill ? "absolute" : null)("width", ctx.fill ? "100%" : null)("height", ctx.fill ? "100%" : null)("inset", ctx.fill ? "0" : null)("background-size", ctx.placeholder ? "cover" : null)("background-position", ctx.placeholder ? "50% 50%" : null)("background-repeat", ctx.placeholder ? "no-repeat" : null)("background-image", ctx.placeholder ? ctx.generatePlaceholder(ctx.placeholder) : null)("filter", ctx.placeholder && ctx.shouldBlurPlaceholder(ctx.placeholderConfig) ? "blur(15px)" : null);
|
|
4363
|
-
}
|
|
4364
|
-
},
|
|
4365
|
-
inputs: {
|
|
4366
|
-
ngSrc: [2, "ngSrc", "ngSrc", unwrapSafeUrl],
|
|
4367
|
-
ngSrcset: "ngSrcset",
|
|
4368
|
-
sizes: "sizes",
|
|
4369
|
-
width: [2, "width", "width", numberAttribute],
|
|
4370
|
-
height: [2, "height", "height", numberAttribute],
|
|
4371
|
-
decoding: "decoding",
|
|
4372
|
-
loading: "loading",
|
|
4373
|
-
priority: [2, "priority", "priority", booleanAttribute],
|
|
4374
|
-
loaderParams: "loaderParams",
|
|
4375
|
-
disableOptimizedSrcset: [2, "disableOptimizedSrcset", "disableOptimizedSrcset", booleanAttribute],
|
|
4376
|
-
fill: [2, "fill", "fill", booleanAttribute],
|
|
4377
|
-
placeholder: [2, "placeholder", "placeholder", booleanOrUrlAttribute],
|
|
4378
|
-
placeholderConfig: "placeholderConfig",
|
|
4379
|
-
src: "src",
|
|
4380
|
-
srcset: "srcset"
|
|
4381
|
-
},
|
|
4382
|
-
features: [\u{275}_NgOnChangesFeature]
|
|
4383
|
-
});
|
|
4384
|
-
}
|
|
4385
|
-
(() => {
|
|
4386
|
-
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgOptimizedImage, [{
|
|
4387
|
-
type: Directive,
|
|
4388
|
-
args: [{
|
|
4389
|
-
selector: "img[ngSrc]",
|
|
4390
|
-
host: {
|
|
4391
|
-
"[style.position]": 'fill ? "absolute" : null',
|
|
4392
|
-
"[style.width]": 'fill ? "100%" : null',
|
|
4393
|
-
"[style.height]": 'fill ? "100%" : null',
|
|
4394
|
-
"[style.inset]": 'fill ? "0" : null',
|
|
4395
|
-
"[style.background-size]": 'placeholder ? "cover" : null',
|
|
4396
|
-
"[style.background-position]": 'placeholder ? "50% 50%" : null',
|
|
4397
|
-
"[style.background-repeat]": 'placeholder ? "no-repeat" : null',
|
|
4398
|
-
"[style.background-image]": "placeholder ? generatePlaceholder(placeholder) : null",
|
|
4399
|
-
"[style.filter]": 'placeholder && shouldBlurPlaceholder(placeholderConfig) ? "blur(15px)" : null'
|
|
4400
|
-
}
|
|
4401
|
-
}]
|
|
4402
|
-
}], () => [], {
|
|
4403
|
-
ngSrc: [{
|
|
4404
|
-
type: Input,
|
|
4405
|
-
args: [{
|
|
4406
|
-
required: true,
|
|
4407
|
-
transform: unwrapSafeUrl
|
|
4408
|
-
}]
|
|
4409
|
-
}],
|
|
4410
|
-
ngSrcset: [{
|
|
4411
|
-
type: Input
|
|
4412
|
-
}],
|
|
4413
|
-
sizes: [{
|
|
4414
|
-
type: Input
|
|
4415
|
-
}],
|
|
4416
|
-
width: [{
|
|
4417
|
-
type: Input,
|
|
4418
|
-
args: [{
|
|
4419
|
-
transform: numberAttribute
|
|
4420
|
-
}]
|
|
4421
|
-
}],
|
|
4422
|
-
height: [{
|
|
4423
|
-
type: Input,
|
|
4424
|
-
args: [{
|
|
4425
|
-
transform: numberAttribute
|
|
4426
|
-
}]
|
|
4427
|
-
}],
|
|
4428
|
-
decoding: [{
|
|
4429
|
-
type: Input
|
|
4430
|
-
}],
|
|
4431
|
-
loading: [{
|
|
4432
|
-
type: Input
|
|
4433
|
-
}],
|
|
4434
|
-
priority: [{
|
|
4435
|
-
type: Input,
|
|
4436
|
-
args: [{
|
|
4437
|
-
transform: booleanAttribute
|
|
4438
|
-
}]
|
|
4439
|
-
}],
|
|
4440
|
-
loaderParams: [{
|
|
4441
|
-
type: Input
|
|
4442
|
-
}],
|
|
4443
|
-
disableOptimizedSrcset: [{
|
|
4444
|
-
type: Input,
|
|
4445
|
-
args: [{
|
|
4446
|
-
transform: booleanAttribute
|
|
4447
|
-
}]
|
|
4448
|
-
}],
|
|
4449
|
-
fill: [{
|
|
4450
|
-
type: Input,
|
|
4451
|
-
args: [{
|
|
4452
|
-
transform: booleanAttribute
|
|
4453
|
-
}]
|
|
4454
|
-
}],
|
|
4455
|
-
placeholder: [{
|
|
4456
|
-
type: Input,
|
|
4457
|
-
args: [{
|
|
4458
|
-
transform: booleanOrUrlAttribute
|
|
4459
|
-
}]
|
|
4460
|
-
}],
|
|
4461
|
-
placeholderConfig: [{
|
|
4462
|
-
type: Input
|
|
4463
|
-
}],
|
|
4464
|
-
src: [{
|
|
4465
|
-
type: Input
|
|
4466
|
-
}],
|
|
4467
|
-
srcset: [{
|
|
4468
|
-
type: Input
|
|
4469
|
-
}]
|
|
4470
|
-
});
|
|
4471
|
-
})();
|
|
4472
|
-
function processConfig(config) {
|
|
4473
|
-
let sortedBreakpoints = {};
|
|
4474
|
-
if (config.breakpoints) {
|
|
4475
|
-
sortedBreakpoints.breakpoints = config.breakpoints.sort((a, b) => a - b);
|
|
4476
|
-
}
|
|
4477
|
-
return Object.assign({}, IMAGE_CONFIG_DEFAULTS, config, sortedBreakpoints);
|
|
4478
|
-
}
|
|
4479
|
-
function assertNoConflictingSrc(dir) {
|
|
4480
|
-
if (dir.src) {
|
|
4481
|
-
throw new RuntimeError(2950, `${imgDirectiveDetails(dir.ngSrc)} both \`src\` and \`ngSrc\` have been set. ` + `Supplying both of these attributes breaks lazy loading. ` + `The NgOptimizedImage directive sets \`src\` itself based on the value of \`ngSrc\`. ` + `To fix this, please remove the \`src\` attribute.`);
|
|
4482
|
-
}
|
|
4483
|
-
}
|
|
4484
|
-
function assertNoConflictingSrcset(dir) {
|
|
4485
|
-
if (dir.srcset) {
|
|
4486
|
-
throw new RuntimeError(2951, `${imgDirectiveDetails(dir.ngSrc)} both \`srcset\` and \`ngSrcset\` have been set. ` + `Supplying both of these attributes breaks lazy loading. ` + `The NgOptimizedImage directive sets \`srcset\` itself based on the value of ` + `\`ngSrcset\`. To fix this, please remove the \`srcset\` attribute.`);
|
|
4487
|
-
}
|
|
4488
|
-
}
|
|
4489
|
-
function assertNotBase64Image(dir) {
|
|
4490
|
-
let ngSrc = dir.ngSrc.trim();
|
|
4491
|
-
if (ngSrc.startsWith("data:")) {
|
|
4492
|
-
if (ngSrc.length > BASE64_IMG_MAX_LENGTH_IN_ERROR) {
|
|
4493
|
-
ngSrc = ngSrc.substring(0, BASE64_IMG_MAX_LENGTH_IN_ERROR) + "...";
|
|
4494
|
-
}
|
|
4495
|
-
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`ngSrc\` is a Base64-encoded string ` + `(${ngSrc}). NgOptimizedImage does not support Base64-encoded strings. ` + `To fix this, disable the NgOptimizedImage directive for this element ` + `by removing \`ngSrc\` and using a standard \`src\` attribute instead.`);
|
|
4496
|
-
}
|
|
4497
|
-
}
|
|
4498
|
-
function assertNoComplexSizes(dir) {
|
|
4499
|
-
let sizes = dir.sizes;
|
|
4500
|
-
if (sizes?.match(/((\)|,)\s|^)\d+px/)) {
|
|
4501
|
-
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`sizes\` was set to a string including ` + `pixel values. For automatic \`srcset\` generation, \`sizes\` must only include responsive ` + `values, such as \`sizes="50vw"\` or \`sizes="(min-width: 768px) 50vw, 100vw"\`. ` + `To fix this, modify the \`sizes\` attribute, or provide your own \`ngSrcset\` value directly.`);
|
|
4502
|
-
}
|
|
4503
|
-
}
|
|
4504
|
-
function assertValidPlaceholder(dir, imageLoader) {
|
|
4505
|
-
assertNoPlaceholderConfigWithoutPlaceholder(dir);
|
|
4506
|
-
assertNoRelativePlaceholderWithoutLoader(dir, imageLoader);
|
|
4507
|
-
assertNoOversizedDataUrl(dir);
|
|
4508
|
-
}
|
|
4509
|
-
function assertNoPlaceholderConfigWithoutPlaceholder(dir) {
|
|
4510
|
-
if (dir.placeholderConfig && !dir.placeholder) {
|
|
4511
|
-
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`placeholderConfig\` options were provided for an ` + `image that does not use the \`placeholder\` attribute, and will have no effect.`);
|
|
4512
|
-
}
|
|
4513
|
-
}
|
|
4514
|
-
function assertNoRelativePlaceholderWithoutLoader(dir, imageLoader) {
|
|
4515
|
-
if (dir.placeholder === true && imageLoader === noopImageLoader) {
|
|
4516
|
-
throw new RuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to true but ` + `no image loader is configured (i.e. the default one is being used), ` + `which would result in the same image being used for the primary image and its placeholder. ` + `To fix this, provide a loader or remove the \`placeholder\` attribute from the image.`);
|
|
4517
|
-
}
|
|
4518
|
-
}
|
|
4519
|
-
function assertNoOversizedDataUrl(dir) {
|
|
4520
|
-
if (dir.placeholder && typeof dir.placeholder === "string" && dir.placeholder.startsWith("data:")) {
|
|
4521
|
-
if (dir.placeholder.length > DATA_URL_ERROR_LIMIT) {
|
|
4522
|
-
throw new RuntimeError(2965, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to a data URL which is longer ` + `than ${DATA_URL_ERROR_LIMIT} characters. This is strongly discouraged, as large inline placeholders ` + `directly increase the bundle size of Angular and hurt page load performance. To fix this, generate ` + `a smaller data URL placeholder.`);
|
|
4523
|
-
}
|
|
4524
|
-
if (dir.placeholder.length > DATA_URL_WARN_LIMIT) {
|
|
4525
|
-
console.warn(formatRuntimeError(2965, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to a data URL which is longer ` + `than ${DATA_URL_WARN_LIMIT} characters. This is discouraged, as large inline placeholders ` + `directly increase the bundle size of Angular and hurt page load performance. For better loading performance, ` + `generate a smaller data URL placeholder.`));
|
|
4526
|
-
}
|
|
4527
|
-
}
|
|
4528
|
-
}
|
|
4529
|
-
function assertNotBlobUrl(dir) {
|
|
4530
|
-
const ngSrc = dir.ngSrc.trim();
|
|
4531
|
-
if (ngSrc.startsWith("blob:")) {
|
|
4532
|
-
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrc\` was set to a blob URL (${ngSrc}). ` + `Blob URLs are not supported by the NgOptimizedImage directive. ` + `To fix this, disable the NgOptimizedImage directive for this element ` + `by removing \`ngSrc\` and using a regular \`src\` attribute instead.`);
|
|
4533
|
-
}
|
|
4534
|
-
}
|
|
4535
|
-
function assertNonEmptyInput(dir, name, value) {
|
|
4536
|
-
const isString = typeof value === "string";
|
|
4537
|
-
const isEmptyString = isString && value.trim() === "";
|
|
4538
|
-
if (!isString || isEmptyString) {
|
|
4539
|
-
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`${name}\` has an invalid value ` + `(\`${value}\`). To fix this, change the value to a non-empty string.`);
|
|
4540
|
-
}
|
|
4541
|
-
}
|
|
4542
|
-
function assertValidNgSrcset(dir, value) {
|
|
4543
|
-
if (value == null)
|
|
4544
|
-
return;
|
|
4545
|
-
assertNonEmptyInput(dir, "ngSrcset", value);
|
|
4546
|
-
const stringVal = value;
|
|
4547
|
-
const isValidWidthDescriptor = VALID_WIDTH_DESCRIPTOR_SRCSET.test(stringVal);
|
|
4548
|
-
const isValidDensityDescriptor = VALID_DENSITY_DESCRIPTOR_SRCSET.test(stringVal);
|
|
4549
|
-
if (isValidDensityDescriptor) {
|
|
4550
|
-
assertUnderDensityCap(dir, stringVal);
|
|
4551
|
-
}
|
|
4552
|
-
const isValidSrcset = isValidWidthDescriptor || isValidDensityDescriptor;
|
|
4553
|
-
if (!isValidSrcset) {
|
|
4554
|
-
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrcset\` has an invalid value (\`${value}\`). ` + `To fix this, supply \`ngSrcset\` using a comma-separated list of one or more width ` + `descriptors (e.g. "100w, 200w") or density descriptors (e.g. "1x, 2x").`);
|
|
4555
|
-
}
|
|
4556
|
-
}
|
|
4557
|
-
function assertUnderDensityCap(dir, value) {
|
|
4558
|
-
const underDensityCap = value.split(",").every((num) => num === "" || parseFloat(num) <= ABSOLUTE_SRCSET_DENSITY_CAP);
|
|
4559
|
-
if (!underDensityCap) {
|
|
4560
|
-
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` contains an unsupported image density:` + `\`${value}\`. NgOptimizedImage generally recommends a max image density of ` + `${RECOMMENDED_SRCSET_DENSITY_CAP}x but supports image densities up to ` + `${ABSOLUTE_SRCSET_DENSITY_CAP}x. The human eye cannot distinguish between image densities ` + `greater than ${RECOMMENDED_SRCSET_DENSITY_CAP}x - which makes them unnecessary for ` + `most use cases. Images that will be pinch-zoomed are typically the primary use case for ` + `${ABSOLUTE_SRCSET_DENSITY_CAP}x images. Please remove the high density descriptor and try again.`);
|
|
4561
|
-
}
|
|
4562
|
-
}
|
|
4563
|
-
function postInitInputChangeError(dir, inputName) {
|
|
4564
|
-
let reason;
|
|
4565
|
-
if (inputName === "width" || inputName === "height") {
|
|
4566
|
-
reason = `Changing \`${inputName}\` may result in different attribute value ` + `applied to the underlying image element and cause layout shifts on a page.`;
|
|
4567
|
-
} else {
|
|
4568
|
-
reason = `Changing the \`${inputName}\` would have no effect on the underlying ` + `image element, because the resource loading has already occurred.`;
|
|
4569
|
-
}
|
|
4570
|
-
return new RuntimeError(2953, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` was updated after initialization. ` + `The NgOptimizedImage directive will not react to this input change. ${reason} ` + `To fix this, either switch \`${inputName}\` to a static value ` + `or wrap the image element in an @if that is gated on the necessary value.`);
|
|
4571
|
-
}
|
|
4572
|
-
function assertNoPostInitInputChange(dir, changes, inputs) {
|
|
4573
|
-
inputs.forEach((input) => {
|
|
4574
|
-
const isUpdated = changes.hasOwnProperty(input);
|
|
4575
|
-
if (isUpdated && !changes[input].isFirstChange()) {
|
|
4576
|
-
if (input === "ngSrc") {
|
|
4577
|
-
dir = {
|
|
4578
|
-
ngSrc: changes[input].previousValue
|
|
4579
|
-
};
|
|
4580
|
-
}
|
|
4581
|
-
throw postInitInputChangeError(dir, input);
|
|
4582
|
-
}
|
|
4583
|
-
});
|
|
4584
|
-
}
|
|
4585
|
-
function assertGreaterThanZero(dir, inputValue, inputName) {
|
|
4586
|
-
const validNumber = typeof inputValue === "number" && inputValue > 0;
|
|
4587
|
-
const validString = typeof inputValue === "string" && /^\d+$/.test(inputValue.trim()) && parseInt(inputValue) > 0;
|
|
4588
|
-
if (!validNumber && !validString) {
|
|
4589
|
-
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` has an invalid value. ` + `To fix this, provide \`${inputName}\` as a number greater than 0.`);
|
|
4590
|
-
}
|
|
4591
|
-
}
|
|
4592
|
-
function assertNoImageDistortion(dir, img, renderer, destroyRef) {
|
|
4593
|
-
const callback = () => {
|
|
4594
|
-
removeLoadListenerFn();
|
|
4595
|
-
removeErrorListenerFn();
|
|
4596
|
-
const computedStyle = window.getComputedStyle(img);
|
|
4597
|
-
let renderedWidth = parseFloat(computedStyle.getPropertyValue("width"));
|
|
4598
|
-
let renderedHeight = parseFloat(computedStyle.getPropertyValue("height"));
|
|
4599
|
-
const boxSizing = computedStyle.getPropertyValue("box-sizing");
|
|
4600
|
-
if (boxSizing === "border-box") {
|
|
4601
|
-
const paddingTop = computedStyle.getPropertyValue("padding-top");
|
|
4602
|
-
const paddingRight = computedStyle.getPropertyValue("padding-right");
|
|
4603
|
-
const paddingBottom = computedStyle.getPropertyValue("padding-bottom");
|
|
4604
|
-
const paddingLeft = computedStyle.getPropertyValue("padding-left");
|
|
4605
|
-
renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
|
|
4606
|
-
renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
|
|
4607
|
-
}
|
|
4608
|
-
const renderedAspectRatio = renderedWidth / renderedHeight;
|
|
4609
|
-
const nonZeroRenderedDimensions = renderedWidth !== 0 && renderedHeight !== 0;
|
|
4610
|
-
const intrinsicWidth = img.naturalWidth;
|
|
4611
|
-
const intrinsicHeight = img.naturalHeight;
|
|
4612
|
-
const intrinsicAspectRatio = intrinsicWidth / intrinsicHeight;
|
|
4613
|
-
const suppliedWidth = dir.width;
|
|
4614
|
-
const suppliedHeight = dir.height;
|
|
4615
|
-
const suppliedAspectRatio = suppliedWidth / suppliedHeight;
|
|
4616
|
-
const inaccurateDimensions = Math.abs(suppliedAspectRatio - intrinsicAspectRatio) > ASPECT_RATIO_TOLERANCE;
|
|
4617
|
-
const stylingDistortion = nonZeroRenderedDimensions && Math.abs(intrinsicAspectRatio - renderedAspectRatio) > ASPECT_RATIO_TOLERANCE;
|
|
4618
|
-
if (inaccurateDimensions) {
|
|
4619
|
-
console.warn(formatRuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the image does not match ` + `the aspect ratio indicated by the width and height attributes. ` + `
|
|
4620
|
-
Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` + `(aspect-ratio: ${round(intrinsicAspectRatio)}).
|
|
4621
|
-
Supplied width and height attributes: ` + `${suppliedWidth}w x ${suppliedHeight}h (aspect-ratio: ${round(suppliedAspectRatio)}). ` + `
|
|
4622
|
-
To fix this, update the width and height attributes.`));
|
|
4623
|
-
} else if (stylingDistortion) {
|
|
4624
|
-
console.warn(formatRuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the rendered image ` + `does not match the image's intrinsic aspect ratio. ` + `
|
|
4625
|
-
Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` + `(aspect-ratio: ${round(intrinsicAspectRatio)}).
|
|
4626
|
-
Rendered image size: ` + `${renderedWidth}w x ${renderedHeight}h (aspect-ratio: ` + `${round(renderedAspectRatio)}).
|
|
4627
|
-
This issue can occur if "width" and "height" ` + `attributes are added to an image without updating the corresponding ` + `image styling. To fix this, adjust image styling. In most cases, ` + `adding "height: auto" or "width: auto" to the image styling will fix ` + `this issue.`));
|
|
4628
|
-
} else if (!dir.ngSrcset && nonZeroRenderedDimensions) {
|
|
4629
|
-
const recommendedWidth = RECOMMENDED_SRCSET_DENSITY_CAP * renderedWidth;
|
|
4630
|
-
const recommendedHeight = RECOMMENDED_SRCSET_DENSITY_CAP * renderedHeight;
|
|
4631
|
-
const oversizedWidth = intrinsicWidth - recommendedWidth >= OVERSIZED_IMAGE_TOLERANCE;
|
|
4632
|
-
const oversizedHeight = intrinsicHeight - recommendedHeight >= OVERSIZED_IMAGE_TOLERANCE;
|
|
4633
|
-
if (oversizedWidth || oversizedHeight) {
|
|
4634
|
-
console.warn(formatRuntimeError(2960, `${imgDirectiveDetails(dir.ngSrc)} the intrinsic image is significantly ` + `larger than necessary. ` + `
|
|
4635
|
-
Rendered image size: ${renderedWidth}w x ${renderedHeight}h. ` + `
|
|
4636
|
-
Intrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h. ` + `
|
|
4637
|
-
Recommended intrinsic image size: ${recommendedWidth}w x ${recommendedHeight}h. ` + `
|
|
4638
|
-
Note: Recommended intrinsic image size is calculated assuming a maximum DPR of ` + `${RECOMMENDED_SRCSET_DENSITY_CAP}. To improve loading time, resize the image ` + `or consider using the "ngSrcset" and "sizes" attributes.`));
|
|
4639
|
-
}
|
|
4640
|
-
}
|
|
4641
|
-
};
|
|
4642
|
-
const removeLoadListenerFn = renderer.listen(img, "load", callback);
|
|
4643
|
-
const removeErrorListenerFn = renderer.listen(img, "error", () => {
|
|
4644
|
-
removeLoadListenerFn();
|
|
4645
|
-
removeErrorListenerFn();
|
|
4646
|
-
});
|
|
4647
|
-
destroyRef.onDestroy(() => {
|
|
4648
|
-
removeLoadListenerFn();
|
|
4649
|
-
removeErrorListenerFn();
|
|
4650
|
-
});
|
|
4651
|
-
callOnLoadIfImageIsLoaded(img, callback);
|
|
4652
|
-
}
|
|
4653
|
-
function assertNonEmptyWidthAndHeight(dir) {
|
|
4654
|
-
let missingAttributes = [];
|
|
4655
|
-
if (dir.width === undefined)
|
|
4656
|
-
missingAttributes.push("width");
|
|
4657
|
-
if (dir.height === undefined)
|
|
4658
|
-
missingAttributes.push("height");
|
|
4659
|
-
if (missingAttributes.length > 0) {
|
|
4660
|
-
throw new RuntimeError(2954, `${imgDirectiveDetails(dir.ngSrc)} these required attributes ` + `are missing: ${missingAttributes.map((attr) => `"${attr}"`).join(", ")}. ` + `Including "width" and "height" attributes will prevent image-related layout shifts. ` + `To fix this, include "width" and "height" attributes on the image tag or turn on ` + `"fill" mode with the \`fill\` attribute.`);
|
|
4661
|
-
}
|
|
4662
|
-
}
|
|
4663
|
-
function assertEmptyWidthAndHeight(dir) {
|
|
4664
|
-
if (dir.width || dir.height) {
|
|
4665
|
-
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the attributes \`height\` and/or \`width\` are present ` + `along with the \`fill\` attribute. Because \`fill\` mode causes an image to fill its containing ` + `element, the size attributes have no effect and should be removed.`);
|
|
4666
|
-
}
|
|
4667
|
-
}
|
|
4668
|
-
function assertNonZeroRenderedHeight(dir, img, renderer, destroyRef) {
|
|
4669
|
-
const callback = () => {
|
|
4670
|
-
removeLoadListenerFn();
|
|
4671
|
-
removeErrorListenerFn();
|
|
4672
|
-
const renderedHeight = img.clientHeight;
|
|
4673
|
-
if (dir.fill && renderedHeight === 0) {
|
|
4674
|
-
console.warn(formatRuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the height of the fill-mode image is zero. ` + `This is likely because the containing element does not have the CSS 'position' ` + `property set to one of the following: "relative", "fixed", or "absolute". ` + `To fix this problem, make sure the container element has the CSS 'position' ` + `property defined and the height of the element is not zero.`));
|
|
4675
|
-
}
|
|
4676
|
-
};
|
|
4677
|
-
const removeLoadListenerFn = renderer.listen(img, "load", callback);
|
|
4678
|
-
const removeErrorListenerFn = renderer.listen(img, "error", () => {
|
|
4679
|
-
removeLoadListenerFn();
|
|
4680
|
-
removeErrorListenerFn();
|
|
4681
|
-
});
|
|
4682
|
-
destroyRef.onDestroy(() => {
|
|
4683
|
-
removeLoadListenerFn();
|
|
4684
|
-
removeErrorListenerFn();
|
|
4685
|
-
});
|
|
4686
|
-
callOnLoadIfImageIsLoaded(img, callback);
|
|
4687
|
-
}
|
|
4688
|
-
function assertValidLoadingInput(dir) {
|
|
4689
|
-
if (dir.loading && dir.priority) {
|
|
4690
|
-
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute ` + `was used on an image that was marked "priority". ` + `Setting \`loading\` on priority images is not allowed ` + `because these images will always be eagerly loaded. ` + `To fix this, remove the \u201Cloading\u201D attribute from the priority image.`);
|
|
4691
|
-
}
|
|
4692
|
-
const validInputs = ["auto", "eager", "lazy"];
|
|
4693
|
-
if (typeof dir.loading === "string" && !validInputs.includes(dir.loading)) {
|
|
4694
|
-
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute ` + `has an invalid value (\`${dir.loading}\`). ` + `To fix this, provide a valid value ("lazy", "eager", or "auto").`);
|
|
4695
|
-
}
|
|
4696
|
-
}
|
|
4697
|
-
function assertValidDecodingInput(dir) {
|
|
4698
|
-
const validInputs = ["sync", "async", "auto"];
|
|
4699
|
-
if (typeof dir.decoding === "string" && !validInputs.includes(dir.decoding)) {
|
|
4700
|
-
throw new RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`decoding\` attribute ` + `has an invalid value (\`${dir.decoding}\`). ` + `To fix this, provide a valid value ("sync", "async", or "auto").`);
|
|
4701
|
-
}
|
|
4702
|
-
}
|
|
4703
|
-
function assertNotMissingBuiltInLoader(ngSrc, imageLoader) {
|
|
4704
|
-
if (imageLoader === noopImageLoader) {
|
|
4705
|
-
let builtInLoaderName = "";
|
|
4706
|
-
for (const loader of BUILT_IN_LOADERS) {
|
|
4707
|
-
if (loader.testUrl(ngSrc)) {
|
|
4708
|
-
builtInLoaderName = loader.name;
|
|
4709
|
-
break;
|
|
4710
|
-
}
|
|
4711
|
-
}
|
|
4712
|
-
if (builtInLoaderName) {
|
|
4713
|
-
console.warn(formatRuntimeError(2962, `NgOptimizedImage: It looks like your images may be hosted on the ` + `${builtInLoaderName} CDN, but your app is not using Angular's ` + `built-in loader for that CDN. We recommend switching to use ` + `the built-in by calling \`provide${builtInLoaderName}Loader()\` ` + `in your \`providers\` and passing it your instance's base URL. ` + `If you don't want to use the built-in loader, define a custom ` + `loader function using IMAGE_LOADER to silence this warning.`));
|
|
4714
|
-
}
|
|
4715
|
-
}
|
|
4716
|
-
}
|
|
4717
|
-
function assertNoNgSrcsetWithoutLoader(dir, imageLoader) {
|
|
4718
|
-
if (dir.ngSrcset && imageLoader === noopImageLoader) {
|
|
4719
|
-
console.warn(formatRuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` attribute is present but ` + `no image loader is configured (i.e. the default one is being used), ` + `which would result in the same image being used for all configured sizes. ` + `To fix this, provide a loader or remove the \`ngSrcset\` attribute from the image.`));
|
|
4720
|
-
}
|
|
4721
|
-
}
|
|
4722
|
-
function assertNoLoaderParamsWithoutLoader(dir, imageLoader) {
|
|
4723
|
-
if (dir.loaderParams && imageLoader === noopImageLoader) {
|
|
4724
|
-
console.warn(formatRuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`loaderParams\` attribute is present but ` + `no image loader is configured (i.e. the default one is being used), ` + `which means that the loaderParams data will not be consumed and will not affect the URL. ` + `To fix this, provide a custom loader or remove the \`loaderParams\` attribute from the image.`));
|
|
4725
|
-
}
|
|
4726
|
-
}
|
|
4727
|
-
async function assetPriorityCountBelowThreshold(appRef) {
|
|
4728
|
-
if (IMGS_WITH_PRIORITY_ATTR_COUNT === 0) {
|
|
4729
|
-
IMGS_WITH_PRIORITY_ATTR_COUNT++;
|
|
4730
|
-
await appRef.whenStable();
|
|
4731
|
-
if (IMGS_WITH_PRIORITY_ATTR_COUNT > PRIORITY_COUNT_THRESHOLD) {
|
|
4732
|
-
console.warn(formatRuntimeError(2966, `NgOptimizedImage: The "priority" attribute is set to true more than ${PRIORITY_COUNT_THRESHOLD} times (${IMGS_WITH_PRIORITY_ATTR_COUNT} times). ` + `Marking too many images as "high" priority can hurt your application's LCP (https://web.dev/lcp). ` + `"Priority" should only be set on the image expected to be the page's LCP element.`));
|
|
4733
|
-
}
|
|
4734
|
-
} else {
|
|
4735
|
-
IMGS_WITH_PRIORITY_ATTR_COUNT++;
|
|
4736
|
-
}
|
|
4737
|
-
}
|
|
4738
|
-
function assertPlaceholderDimensions(dir, imgElement) {
|
|
4739
|
-
const computedStyle = window.getComputedStyle(imgElement);
|
|
4740
|
-
let renderedWidth = parseFloat(computedStyle.getPropertyValue("width"));
|
|
4741
|
-
let renderedHeight = parseFloat(computedStyle.getPropertyValue("height"));
|
|
4742
|
-
if (renderedWidth > PLACEHOLDER_DIMENSION_LIMIT || renderedHeight > PLACEHOLDER_DIMENSION_LIMIT) {
|
|
4743
|
-
console.warn(formatRuntimeError(2967, `${imgDirectiveDetails(dir.ngSrc)} it uses a placeholder image, but at least one ` + `of the dimensions attribute (height or width) exceeds the limit of ${PLACEHOLDER_DIMENSION_LIMIT}px. ` + `To fix this, use a smaller image as a placeholder.`));
|
|
4744
|
-
}
|
|
4745
|
-
}
|
|
4746
|
-
function callOnLoadIfImageIsLoaded(img, callback) {
|
|
4747
|
-
if (img.complete && img.naturalWidth) {
|
|
4748
|
-
callback();
|
|
4749
|
-
}
|
|
4750
|
-
}
|
|
4751
|
-
function round(input) {
|
|
4752
|
-
return Number.isInteger(input) ? input : input.toFixed(2);
|
|
4753
|
-
}
|
|
4754
|
-
function unwrapSafeUrl(value) {
|
|
4755
|
-
if (typeof value === "string") {
|
|
4756
|
-
return value;
|
|
4757
|
-
}
|
|
4758
|
-
return unwrapSafeValue(value);
|
|
4759
|
-
}
|
|
4760
|
-
function booleanOrUrlAttribute(value) {
|
|
4761
|
-
if (typeof value === "string" && value !== "true" && value !== "false" && value !== "") {
|
|
4762
|
-
return value;
|
|
4763
|
-
}
|
|
4764
|
-
return booleanAttribute(value);
|
|
4765
|
-
}
|
|
4766
|
-
|
|
4767
|
-
export { LocationStrategy, APP_BASE_HREF, PathLocationStrategy, NoTrailingSlashPathLocationStrategy, TrailingSlashPathLocationStrategy, Location, HashLocationStrategy, NumberFormatStyle, Plural, FormStyle, TranslationWidth, FormatWidth, NumberSymbol, WeekDay, getLocaleId, getLocaleDayPeriods, getLocaleDayNames, getLocaleMonthNames, getLocaleEraNames, getLocaleFirstDayOfWeek, getLocaleWeekEndRange, getLocaleDateFormat, getLocaleTimeFormat, getLocaleDateTimeFormat, getLocaleNumberSymbol, getLocaleNumberFormat, getLocaleCurrencySymbol, getLocaleCurrencyName, getLocaleCurrencyCode2 as getLocaleCurrencyCode, getLocalePluralCase2 as getLocalePluralCase, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleDirection, getCurrencySymbol, getNumberOfCurrencyDigits, formatDate, formatCurrency, formatPercent, formatNumber, NgLocalization, NgLocaleLocalization, NgClass, NgComponentOutlet, NgForOfContext, NgForOf, NgIf, NgIfContext, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase, NgStyle, NgTemplateOutlet, AsyncPipe, LowerCasePipe, TitleCasePipe, UpperCasePipe, DATE_PIPE_DEFAULT_TIMEZONE, DATE_PIPE_DEFAULT_OPTIONS, DatePipe, I18nPluralPipe, I18nSelectPipe, JsonPipe, KeyValuePipe, DecimalPipe, PercentPipe, CurrencyPipe, SlicePipe, CommonModule, PRECOMMIT_HANDLER_SUPPORTED, PlatformNavigation, NavigationAdapterForLocation, registerLocaleData2 as registerLocaleData, PLATFORM_BROWSER_ID, PLATFORM_SERVER_ID, isPlatformBrowser, isPlatformServer, VERSION, ViewportScroller, NullViewportScroller, IMAGE_LOADER, provideCloudflareLoader, provideCloudinaryLoader, provideImageKitLoader, provideImgixLoader, provideNetlifyLoader, PRECONNECT_CHECK_BLOCKLIST, NgOptimizedImage, exports_common };
|