You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
233 lines
6.5 KiB
233 lines
6.5 KiB
import {
|
|
Platform
|
|
} from "./chunk-UPQZZZIG.js";
|
|
import {
|
|
coerceArray
|
|
} from "./chunk-7XTJNSRU.js";
|
|
import {
|
|
CSP_NONCE,
|
|
Inject,
|
|
Injectable,
|
|
NgModule,
|
|
NgZone,
|
|
Observable,
|
|
Optional,
|
|
Subject,
|
|
combineLatest,
|
|
concat,
|
|
debounceTime,
|
|
map,
|
|
setClassMetadata,
|
|
skip,
|
|
startWith,
|
|
take,
|
|
takeUntil,
|
|
ɵɵdefineInjectable,
|
|
ɵɵdefineInjector,
|
|
ɵɵdefineNgModule,
|
|
ɵɵinject
|
|
} from "./chunk-FGESKT7O.js";
|
|
|
|
// node_modules/@angular/cdk/fesm2022/layout.mjs
|
|
var _LayoutModule = class _LayoutModule {
|
|
};
|
|
_LayoutModule.ɵfac = function LayoutModule_Factory(t) {
|
|
return new (t || _LayoutModule)();
|
|
};
|
|
_LayoutModule.ɵmod = ɵɵdefineNgModule({
|
|
type: _LayoutModule
|
|
});
|
|
_LayoutModule.ɵinj = ɵɵdefineInjector({});
|
|
var LayoutModule = _LayoutModule;
|
|
(() => {
|
|
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(LayoutModule, [{
|
|
type: NgModule,
|
|
args: [{}]
|
|
}], null, null);
|
|
})();
|
|
var mediaQueriesForWebkitCompatibility = /* @__PURE__ */ new Set();
|
|
var mediaQueryStyleNode;
|
|
var _MediaMatcher = class _MediaMatcher {
|
|
constructor(_platform, _nonce) {
|
|
this._platform = _platform;
|
|
this._nonce = _nonce;
|
|
this._matchMedia = this._platform.isBrowser && window.matchMedia ? (
|
|
// matchMedia is bound to the window scope intentionally as it is an illegal invocation to
|
|
// call it from a different scope.
|
|
window.matchMedia.bind(window)
|
|
) : noopMatchMedia;
|
|
}
|
|
/**
|
|
* Evaluates the given media query and returns the native MediaQueryList from which results
|
|
* can be retrieved.
|
|
* Confirms the layout engine will trigger for the selector query provided and returns the
|
|
* MediaQueryList for the query provided.
|
|
*/
|
|
matchMedia(query) {
|
|
if (this._platform.WEBKIT || this._platform.BLINK) {
|
|
createEmptyStyleRule(query, this._nonce);
|
|
}
|
|
return this._matchMedia(query);
|
|
}
|
|
};
|
|
_MediaMatcher.ɵfac = function MediaMatcher_Factory(t) {
|
|
return new (t || _MediaMatcher)(ɵɵinject(Platform), ɵɵinject(CSP_NONCE, 8));
|
|
};
|
|
_MediaMatcher.ɵprov = ɵɵdefineInjectable({
|
|
token: _MediaMatcher,
|
|
factory: _MediaMatcher.ɵfac,
|
|
providedIn: "root"
|
|
});
|
|
var MediaMatcher = _MediaMatcher;
|
|
(() => {
|
|
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(MediaMatcher, [{
|
|
type: Injectable,
|
|
args: [{
|
|
providedIn: "root"
|
|
}]
|
|
}], () => [{
|
|
type: Platform
|
|
}, {
|
|
type: void 0,
|
|
decorators: [{
|
|
type: Optional
|
|
}, {
|
|
type: Inject,
|
|
args: [CSP_NONCE]
|
|
}]
|
|
}], null);
|
|
})();
|
|
function createEmptyStyleRule(query, nonce) {
|
|
if (mediaQueriesForWebkitCompatibility.has(query)) {
|
|
return;
|
|
}
|
|
try {
|
|
if (!mediaQueryStyleNode) {
|
|
mediaQueryStyleNode = document.createElement("style");
|
|
if (nonce) {
|
|
mediaQueryStyleNode.nonce = nonce;
|
|
}
|
|
mediaQueryStyleNode.setAttribute("type", "text/css");
|
|
document.head.appendChild(mediaQueryStyleNode);
|
|
}
|
|
if (mediaQueryStyleNode.sheet) {
|
|
mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);
|
|
mediaQueriesForWebkitCompatibility.add(query);
|
|
}
|
|
} catch (e) {
|
|
console.error(e);
|
|
}
|
|
}
|
|
function noopMatchMedia(query) {
|
|
return {
|
|
matches: query === "all" || query === "",
|
|
media: query,
|
|
addListener: () => {
|
|
},
|
|
removeListener: () => {
|
|
}
|
|
};
|
|
}
|
|
var _BreakpointObserver = class _BreakpointObserver {
|
|
constructor(_mediaMatcher, _zone) {
|
|
this._mediaMatcher = _mediaMatcher;
|
|
this._zone = _zone;
|
|
this._queries = /* @__PURE__ */ new Map();
|
|
this._destroySubject = new Subject();
|
|
}
|
|
/** Completes the active subject, signalling to all other observables to complete. */
|
|
ngOnDestroy() {
|
|
this._destroySubject.next();
|
|
this._destroySubject.complete();
|
|
}
|
|
/**
|
|
* Whether one or more media queries match the current viewport size.
|
|
* @param value One or more media queries to check.
|
|
* @returns Whether any of the media queries match.
|
|
*/
|
|
isMatched(value) {
|
|
const queries = splitQueries(coerceArray(value));
|
|
return queries.some((mediaQuery) => this._registerQuery(mediaQuery).mql.matches);
|
|
}
|
|
/**
|
|
* Gets an observable of results for the given queries that will emit new results for any changes
|
|
* in matching of the given queries.
|
|
* @param value One or more media queries to check.
|
|
* @returns A stream of matches for the given queries.
|
|
*/
|
|
observe(value) {
|
|
const queries = splitQueries(coerceArray(value));
|
|
const observables = queries.map((query) => this._registerQuery(query).observable);
|
|
let stateObservable = combineLatest(observables);
|
|
stateObservable = concat(stateObservable.pipe(take(1)), stateObservable.pipe(skip(1), debounceTime(0)));
|
|
return stateObservable.pipe(map((breakpointStates) => {
|
|
const response = {
|
|
matches: false,
|
|
breakpoints: {}
|
|
};
|
|
breakpointStates.forEach(({
|
|
matches,
|
|
query
|
|
}) => {
|
|
response.matches = response.matches || matches;
|
|
response.breakpoints[query] = matches;
|
|
});
|
|
return response;
|
|
}));
|
|
}
|
|
/** Registers a specific query to be listened for. */
|
|
_registerQuery(query) {
|
|
if (this._queries.has(query)) {
|
|
return this._queries.get(query);
|
|
}
|
|
const mql = this._mediaMatcher.matchMedia(query);
|
|
const queryObservable = new Observable((observer) => {
|
|
const handler = (e) => this._zone.run(() => observer.next(e));
|
|
mql.addListener(handler);
|
|
return () => {
|
|
mql.removeListener(handler);
|
|
};
|
|
}).pipe(startWith(mql), map(({
|
|
matches
|
|
}) => ({
|
|
query,
|
|
matches
|
|
})), takeUntil(this._destroySubject));
|
|
const output = {
|
|
observable: queryObservable,
|
|
mql
|
|
};
|
|
this._queries.set(query, output);
|
|
return output;
|
|
}
|
|
};
|
|
_BreakpointObserver.ɵfac = function BreakpointObserver_Factory(t) {
|
|
return new (t || _BreakpointObserver)(ɵɵinject(MediaMatcher), ɵɵinject(NgZone));
|
|
};
|
|
_BreakpointObserver.ɵprov = ɵɵdefineInjectable({
|
|
token: _BreakpointObserver,
|
|
factory: _BreakpointObserver.ɵfac,
|
|
providedIn: "root"
|
|
});
|
|
var BreakpointObserver = _BreakpointObserver;
|
|
(() => {
|
|
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BreakpointObserver, [{
|
|
type: Injectable,
|
|
args: [{
|
|
providedIn: "root"
|
|
}]
|
|
}], () => [{
|
|
type: MediaMatcher
|
|
}, {
|
|
type: NgZone
|
|
}], null);
|
|
})();
|
|
function splitQueries(queries) {
|
|
return queries.map((query) => query.split(",")).reduce((a1, a2) => a1.concat(a2)).map((query) => query.trim());
|
|
}
|
|
|
|
export {
|
|
MediaMatcher,
|
|
BreakpointObserver
|
|
};
|
|
//# sourceMappingURL=chunk-5OJ3CSUZ.js.map
|
|
|